00001 /***************************************************************************** 00002 00003 The following code is derived, directly or indirectly, from the SystemC 00004 source code Copyright (c) 1996-2006 by all Contributors. 00005 All Rights reserved. 00006 00007 The contents of this file are subject to the restrictions and limitations 00008 set forth in the SystemC Open Source License Version 2.4 (the "License"); 00009 You may not use this file except in compliance with such restrictions and 00010 limitations. You may obtain instructions on how to receive a copy of the 00011 License at http://www.systemc.org/. Software distributed by Contributors 00012 under the License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF 00013 ANY KIND, either express or implied. See the License for the specific 00014 language governing rights and limitations under the License. 00015 00016 *****************************************************************************/ 00017 00018 /***************************************************************************** 00019 00020 sc_spawn_options.h -- Process spawning options specification. 00021 00022 Original Authors: Andy Goodrich, Forte Design Systems, 17 June 2003 00023 Stuart Swan, Cadence, 00024 Bishnupriya Bhattacharya, Cadence Design Systems, 00025 25 August, 2003 00026 00027 *****************************************************************************/ 00028 00029 /***************************************************************************** 00030 00031 MODIFICATION LOG - modifiers, enter your name, affiliation, date and 00032 changes you are making here. 00033 00034 Name, Affiliation, Date: 00035 Description of Modification: 00036 00037 *****************************************************************************/ 00038 00039 // $Log: sc_spawn_options.h,v $ 00040 // Revision 1.1.1.1 2006/12/15 20:31:37 acg 00041 // SystemC 2.2 00042 // 00043 // Revision 1.3 2006/01/13 18:44:30 acg 00044 // Added $Log to record CVS changes into the source. 00045 // 00046 00047 #if !defined(sc_spawn_options_h_INCLUDED) 00048 #define sc_spawn_options_h_INCLUDED 00049 00050 #include <vector> 00051 #include "sysc/communication/sc_export.h" 00052 #include "sysc/communication/sc_signal_ports.h" 00053 00054 namespace sc_core { 00055 00056 class sc_event; 00057 class sc_port_base; 00058 class sc_interface; 00059 class sc_event_finder; 00060 class sc_process_b; 00061 00062 //============================================================================= 00063 // CLASS sc_spawn_options 00064 // 00065 //============================================================================= 00066 class sc_spawn_options { 00067 friend class sc_cthread_process; 00068 friend class sc_method_process; 00069 friend class sc_process_b; 00070 friend class sc_thread_process; 00071 public: 00072 sc_spawn_options() : 00073 m_dont_initialize(false), m_spawn_method(false), m_stack_size(0) 00074 { } 00075 00076 void spawn_method() { m_spawn_method = true; } 00077 void dont_initialize() { m_dont_initialize = true; } 00078 bool is_method() const { return m_spawn_method; } 00079 void set_stack_size(int stack_size) { m_stack_size = stack_size; } 00080 void set_sensitivity(const sc_event* event) 00081 { m_sensitive_events.push_back(event); } 00082 void set_sensitivity(sc_port_base* port_base) 00083 { m_sensitive_port_bases.push_back(port_base); } 00084 void set_sensitivity(sc_interface* interface_p) 00085 { m_sensitive_interfaces.push_back(interface_p); } 00086 void set_sensitivity(sc_export_base* export_base) 00087 { m_sensitive_interfaces.push_back(export_base->get_interface()); } 00088 void set_sensitivity(sc_event_finder* event_finder) 00089 { m_sensitive_event_finders.push_back(event_finder); } 00090 00091 private: 00092 sc_spawn_options( const sc_spawn_options& ); 00093 const sc_spawn_options& operator = ( const sc_spawn_options& ); 00094 00095 protected: 00096 bool m_dont_initialize; 00097 std::vector<const sc_event*> m_sensitive_events; 00098 std::vector<sc_event_finder*> m_sensitive_event_finders; 00099 std::vector<sc_interface*> m_sensitive_interfaces; 00100 std::vector<sc_port_base*> m_sensitive_port_bases; 00101 bool m_spawn_method; // Method not thread. 00102 int m_stack_size; // Thread stack size. 00103 }; 00104 00105 } // namespace sc_core 00106 00107 #endif // !defined(sc_spawn_options_h_INCLUDED)