{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

468Lec20_SC_DynamicProcesses

468Lec20_SC_DynamicProcesses - ECEN 468 Advanced Logic...

Info iconThis preview shows pages 1–8. Sign up to view the full content.

View Full Document Right Arrow Icon
Lecture 20: SystemC Dynamic Processes and Design Hierarchy ECEN 468 Advanced Logic Design ECEN 468 Lecture 20
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
SC_HAS_PROCESS If you want to use C/C++ constructor style instead of SC_CTOR, and the module has processes o Use “ SC_HAS_PROCESS (module_name)” together with the constructor When do you need this? o The constructor needs arguments besides module name o The constructor implementation needs to be placed in .cpp file instead of within module declaration ECEN 468 Lecture 20 2
Background image of page 2
Constructor with Multiple Arguments ECEN 468 Lecture 20 3 //File: module_name.h SC_MODULE (module_name) { SC_HAS_PROCESS (module_name); module_name( sc_module_name instname[, arg1…]) : sc_module (instname) [, other_initializers] { //constructor body } };
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Another Example of SC_HAS_PROCESS ECEN 468 Lecture 20 4 //File: module_name.h SC_MODULE (module_name) { module_name( sc_module_name instname[, arg1…]); … … }; //File: module_name.cpp SC_HAS_PROCESS (module_name); module_name::module_name( sc_module_name instname[, arg1…]) : sc_module (instname) [, other_initializers] { //constructor body } };
Background image of page 4
Two Coding Styles ECEN 468 Lecture 20 5 //File: *.h SC_MODULE (mod_nm) { channel instances submodule instances SC_CTOR () {…} processes }; //File: *.cpp mod_nm::process() { … … } //File: *.h SC_MODULE (mod_nm) { channel* instances submodule* instances SC_CTOR (); processes }; //File: *.cpp SC_HAS_PROCESS(mod_nm); mod_nm::mod_nm() { constructor } mod_nm::process() { … … } More flexible Separation
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
SystemC Time Resolution All objects of sc_time use a global time resolution Default 1 picosecond ECEN 468 Lecture 20 6 sc_time sc_get_time_resolution (); sc_set_time_resolution ( double , sc_time_unit ); //Change only once //before creating objects of sc_time and simulation
Background image of page 6
Dynamic vs. Static Processes
Background image of page 7

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Image of page 8
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}