30 #ifndef __SYSTEMC_CORE_EXT_SC_MODULE_HH__ 31 #define __SYSTEMC_CORE_EXT_SC_MODULE_HH__ 54 struct ProcessFuncWrapper;
75 class sc_signal_in_if;
78 class sc_event_and_list;
79 class sc_event_or_list;
103 virtual ::Port &gem5_getPort(
const std::string &if_name,
int idx=-1);
106 friend class ::sc_gem5::Kernel;
107 friend class ::sc_gem5::Module;
111 virtual const char *
kind()
const {
return "sc_module"; }
203 void async_reset_signal_is(
const sc_in<bool> &,
bool);
210 void dont_initialize();
211 void set_stack_size(
size_t);
293 #define SC_MODULE(name) struct name : ::sc_core::sc_module 295 #define SC_CTOR(name) \ 296 typedef name SC_CURRENT_USER_MODULE; \ 297 name(::sc_core::sc_module_name) 299 #define SC_HAS_PROCESS(name) typedef name SC_CURRENT_USER_MODULE 301 #define SC_METHOD(name) \ 303 ::sc_gem5::Process *p = \ 304 ::sc_gem5::newMethodProcess( \ 305 #name, new ::sc_gem5::ProcessMemberFuncWrapper< \ 306 SC_CURRENT_USER_MODULE>(this, \ 307 &SC_CURRENT_USER_MODULE::name)); \ 309 this->sensitive << p; \ 311 #define SC_THREAD(name) \ 313 ::sc_gem5::Process *p = \ 314 ::sc_gem5::newThreadProcess( \ 315 #name, new ::sc_gem5::ProcessMemberFuncWrapper< \ 316 SC_CURRENT_USER_MODULE>(this, \ 317 &SC_CURRENT_USER_MODULE::name)); \ 319 this->sensitive << p; \ 321 #define SC_CTHREAD(name, clk) \ 323 ::sc_gem5::Process *p = \ 324 ::sc_gem5::newCThreadProcess( \ 325 #name, new ::sc_gem5::ProcessMemberFuncWrapper< \ 326 SC_CURRENT_USER_MODULE>(this, \ 327 &SC_CURRENT_USER_MODULE::name)); \ 329 this->sensitive(p, clk); \ 337 void at_posedge(
const sc_signal_in_if<bool> &);
338 void at_posedge(
const sc_signal_in_if<sc_dt::sc_logic> &);
339 void at_negedge(
const sc_signal_in_if<bool> &);
340 void at_negedge(
const sc_signal_in_if<sc_dt::sc_logic> &);
357 #define SC_NEW(x) ::sc_core::sc_module_sc_new(new x); 361 ::sc_core::sc_set_location(__FILE__, __LINE__); \ 363 ::sc_core::sc_set_location(NULL, 0) 366 #define SC_WAITN(n) \ 367 ::sc_core::sc_set_location(__FILE__, __LINE__); \ 368 ::sc_core::wait(n); \ 369 ::sc_core::sc_set_location(NULL, 0) 372 #define SC_WAIT_UNTIL(expr) \ 373 do { SC_WAIT(); } while (!(expr)) 377 #endif //__SYSTEMC_EXT_CORE_SC_MODULE_HH__ Ports are used to interface objects to each other.
sc_gem5::Module * _gem5_module
sc_module(const sc_module &)
const std::string & name()
sc_module * sc_module_sc_new(sc_module *mod)
sc_signed operator<<(const sc_signed &u, const sc_int_base &v)
const char * sc_gen_unique_name(const char *seed)
sc_concref_r< sc_bitref_r< T1 >, sc_bitref_r< T2 > > operator,(sc_bitref_r< T1 >, sc_bitref_r< T2 >)
bool sc_start_of_simulation_invoked()
bool sc_hierarchical_name_exists(const char *name)
virtual void end_of_simulation()
sc_interface * interface() const
virtual void start_of_simulation()
Process * newCThreadProcess(const char *name, ProcessFuncWrapper *func)
const sc_bind_proxy SC_BIND_PROXY_NIL
Process * newMethodProcess(const char *name, ProcessFuncWrapper *func)
virtual void end_of_elaboration()
sc_interface * _interface
Process * newThreadProcess(const char *name, ProcessFuncWrapper *func)
void at_negedge(const sc_signal_in_if< bool > &s)
bool sc_end_of_simulation_invoked()
void at_posedge(const sc_signal_in_if< bool > &s)
sc_port_base * port() const
virtual const char * kind() const
virtual void before_end_of_elaboration()