|
Post by mohitn on Apr 29, 2013 11:30:02 GMT
SC_CTOR v/s SC_HAS_PROCESS Could anybody help me understand the difference in their usage
|
|
|
Post by T C Surendhar on Apr 29, 2013 11:52:25 GMT
SC_CTOR v/s SC_HAS_PROCESS Could anybody help me understand the difference in their usage Hello, ---- SC_CTOR is a macro to construct(default systemc constructor ) a module with build-in arguments. Here you cannot pass user-defined arguments. ----- SC_HAS_PROCESS is also a macro used when user-defined constructor is used to construct systemc module, here you can pass user defined arguments. After constructing your constructor(not using SC_CTOR) you should always use SC_HAS_PROCESS macro to register your module in systemc kernel by passing module name as argument
Thanks T C Surendhar
|
|
|
Post by Akhil Kumar on Apr 30, 2013 3:58:57 GMT
SC_CTOR v/s SC_HAS_PROCESS Could anybody help me understand the difference in their usage Hello, ---- SC_CTOR is a macro to construct(default systemc constructor ) a module with build-in arguments. Here you cannot pass user-defined arguments. ----- SC_HAS_PROCESS is also a macro used when user-defined constructor is used to construct systemc module, here you can pass user defined arguments. After constructing your constructor(not using SC_CTOR) you should always use SC_HAS_PROCESS macro to register your module in systemc kernel by passing module name as argument
Thanks T C Surendhar
Difference between SC_CTOR and SC_HAS_PROCESS: - Normal
constructor + SC_HAS_PROCESS replaces the use of SC_CTOR. But SC_CTOR can't replace the use of Normal constructor + SC_HAS_PROCESS in cases where parameterization is used and concurrent processes are implemented. - "SC_CTOR"
SystemC constructor macro cannot be used where we have to pass argument to it (means in parameterized models). For example, you want to initialize a variable using parameter, in this case you will have to use normal constructor and SC_HAS_PROCESS(module name).
- One
more case where SC_CTOR cannot be employed is, models in which concurrent processes are implemented. In attached example (look at attached image), two processes (log and run) are implemented, process "run" is a thread used for generation of clock which is used by sensitivity list of method process "log". These are concurrent processes, here we can't use SC_CTOR(sample_module) but we have to declare normal constructor (sample_module(sc_module_name nm):sc_module(nm)) and call SC_HAS_PROCESS(sample_module).
|
|