2. Implementing Modules
• SC_MODULE():
– the smallest container of functionality with states,
behavior and structure
– It may contains
•
•
•
•
•
•
•
Ports
Member channel instance
Member data instance
Member module instance
Constructor
Destructor
Process member function
3. SystemC Processes
• SC_THREAD:
–
–
–
–
–
similar to software thread
It gains control from the system until it returns it to simulator.
called only once and return
can suspend itself using wait().
Blocked because of blocking operation such as read/write
• Sc_method:
–
–
–
–
–
–
Simpler and more efficient
Run completely and return
Cannot suspend internally
Called by the simulation kernel repeatedly based on sensitivity.
Similar to always@ in Verilog.
Implied waits can be implemented by calling SystemC built-in blocking
methods such as read and write of sc_fifo.
4. 2 Ways to Register and Initialize a
Process
• SC_CTOR:
– C++ uses constructor before the process method.
– In the constructor, the methods of implementing the
process is defined.
• SC_HAS_PROCESS:
– It is a cpp macro.
– It is usually used when one wants to place the
constructor in the implementation.
– Use arguments to specify the specifications of models.
– If you are making an IP, this is the better way to do.