Home / Language / [ SC Tutorial ] 1. Overview of SystemC

[ SC Tutorial ] 1. Overview of SystemC

SystemC Language Architecture

SystemC is a system design language based on C++ . Since C++ already addresses most software concerns, it should come as no surprise that SystemC focuses primarily on non-software issues. The primary area of application for SystemC is the design of electronic systems, but SystemC has been applied to non-electronic systems.
The components of SystemC include : Simulation Kernel, Threads & Methods, Events, Sensitive & Notifications, Channels & Interface, Modules & Hierarchy, Data types (Logic, Integers, Fixed point,…), Predefined Primitive Channels(Mutexs, FIFOs, Signals,…)

[1] C++ Mechanics for SystemC

SystemC is a C++ class library, therefore, to compile and run a SystemC program, one must have a working C++ and SystemC environment.
The components of this environment include a:

    • SystemC-supported platform
    • SystemC-supported C++ compiler
    • SystemC library (downloaded and compiled)
    • Compiler command sequence, make file, or equivalent
SystemC Compilation Flow

The compiler and linker need to know two special pieces of information.

    • The SystemC header files are located (systemc.h).
    • The compiled SystemC libraries are located

This is typically accomplished by providing an environment variable named SYSTEMC, and ensuring the Makefile rules use the information

[2] A C++ Class for Hardware

SystemC provides mechanisms crucial to modeling hardware while using a language environment compatible with software development. SystemC provides several hardware-oriented constructs that are not normally available in a software language but are required to model hardware

The major hardware-oriented features implemented within SystemC include:

    • Time mode
    • Hardware data types
    • Module hierarchy to manage structure and connectivity
    • Communications management between concurrent units of execution
    • Concurrency model
[2.1] Time Model

SystemC tracks time with 64 bits of resolution using a class known as sc_time. An enumerated type defines several natural time units from femtoseconds to seconds (SC_FS, SC_PS, SC_NS, SC_US, SC_MS, SC_SEC)

SystemC provides sc_clock class for those models that require a clock.

[2.2] Hardware Data Types

Beside C++ native data types SystemC provides hardware-compatible data types as four-state logic (0,1,X,Z) data types (e.g : sc_logic) , integral (e.g : sc_int<>) and fixed-point (e.g : sc_fixed<>) quantities.

[2.3] Hierarchy and Structure

SystemC provides several constructs for implementing hardware hierarchy. Hardware designs traditionally use blocks interconnected with wires or signals for this purpose. For modeling hardware hierarchy, SystemC uses the module entity interconnected to other modules using channels. The hierarchy comes from the instantiation of module classes within other modules

[2.4] Communications Management

The SystemC channel provides a powerful mechanism for modeling communications. Conceptually, a channel is more than a simple signal or wire. Channels can represent complex communications schemes that eventually map to significant hardware. SystemC provides several built-in channels common to software and hardware design ( sc_mutex, sc_fifo, sc_signal<> …) and finally, modules connect to channels via the port class ( sc_port<> …)

[2.5] Concurrency

Simulation of concurrent execution is accomplished by simulating each concurrent unit (defined by a SC_METHOD, SC_THREAD, or SC_CTHREAD). Each unit is allowed to execute until simulation of the other units is required to keep behaviors aligned in time. In fact, the simulation code itself determines when the simulator makes these switches by the use of events


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 *