Home / Language / [ SC Tutorial ] 2. SystemC Components

[ SC Tutorial ] 2. SystemC Components

[1] Modules and Hierarchy

First, We need to understand two basic types of processes in SystemC. the SystemC simulation kernel schedules the execution of simulation processes. Simulation processes are simply member functions of SC_MODULE classes that are also “registered” with the simulation kernel.

By using SC_MODULE class, It is building a system with hierarchy, You can access to sub-model or any signal, port, … by named.

[2] Threads and Methods

From a software perspective, processes are simply threads of execution.
From a hardware perspective, processes provide necessary modeling of independently-timed circuits. Simulation processes are member functions of a
SC_MODULE that are registered with the simulation kernel. Registration occurs during the elaboration phase (during the execution of the constructor for the SC_MODULE class) using a SC_METHOD, SC_THREAD, or SC_CTHREAD SystemC macro.

The differs between SC_THREAD and SC_METHOD in two ways. First, whereas SC_METHODs are invoked multiple times, the SC_THREAD is only invoked once. Second, a SC_THREAD has the option to suspend itself and potentially allow time to pass before continuing. In this sense, a SC_THREAD is similar to a traditional software thread of execution.

SC_CTHREAD is a special case of the SC_THREAD. This process is simply a thread process that has the requirement of being sensitive to a clock. It exists because of historical problems and several synthesis tools depend on it at the time of writing.

[3] Events, Sensitivity, and Notification

They are very important concepts for understanding the implementation of concurrency by the SystemC simulator.

Events ( sc_event class) are caused  by “notify” which the sc_event member function. A process (SC_METHOD, SC_THREAD, SC_CTHREAD) can sensitive to an event or multi-events. and the event occurs, the simulation kernel schedules the process to be invoked.

Two types of sensitivity :

    • Static sensitivity is implemented by using the SystemC sensitive command to a process at elaboration time (within the constructor).
    • Dynamic sensitivity lets a simulation process change its sensitivity on the fly. The SC_METHOD implements dynamic sensitivity with a next_trigger(arg) command. The SC_THREAD implements dynamic sensitivity with a wait(arg) command. Both SC_METHOD and SC_THREAD can switch between dynamic and static sensitivity during simulation
[4] Channels and Interfaces

Modules are interconnected using either primitive channels or hierarchical channels. Both types of channels connect to modules via ports. The powerful ability to have interchangeable channels is implemented through a component called an interface


About admin

Check Also

[ SC Tutorial ] 3. SystemC Data types

SystemC has a number of predefined data types to support hardware designs spanning from the …

Leave a Reply

Your email address will not be published. Required fields are marked *