Fading Coder

One Final Commit for the Last Sprint

Home > Tech > Content

Introduction to SystemC and Installation Guide

Tech May 8 8

Introduction

SystemC is a C++ library used for modeling and simulating hardware systems, particularly for digital and mixed-signal designs. It enables high-level architectural exploration, performance evaluasion, and software-hardware co-design without requiring specialized hardware description languages or EDA tools.

Developed by Accellera and released under the Apache 2.0 license, SystemC is open-source and suitable for both academic and commercial use. It supports modular design, cycle-accurate simulation, and transaction-level modeling (TLM), making it ideal for system-level design, aglorithm validation, and reference model generation.

By leveraging C++ libraries, SystemC allows integration with numerical, signal processing, and machine learning frameworks, streamlining algorithm development and system verification.

Installation

Download the SystemC source code from the official Accellera website. While the latest release is SystemC 2.3.4, version 2.3.3 is widely used and more stable for most use cases.

Extract the source archive and create a build directory:

mkdir build
cd build

Modify the CMakeLists.txt file in the source directory with the following changes:

  • Set CMAKE_BUILD_TYPE to Debug (line 271)
  • Update CMAKE_CXX_STANDARD to 14 (line 276)
  • Change the install prefix to a preferred location, e.g., /usr/local/systemc (line 545)

Compile and install:

cmake ..
make
sudo make install

Sample Project

Create a main.cpp file:

#include <systemc.h>

SC_MODULE(greeter) {
    SC_CTOR(greeter) {
        SC_THREAD(print_message);
    }

    void print_message() {
        std::cout << "Welcome to SystemC simulation" << std::endl;
    }
};

int sc_main(int argc, char* argv[]) {
    greeter g("GREETER");
    sc_start();
    return 0;
}

Create a CMakeLists.txt:

cmake_minimum_required(VERSION 3.0)
project(systemc_demo)

set(SystemC_ROOT /usr/local/systemc)
find_package(SystemCLanguage REQUIRED CONFIG)

add_executable(demo main.cpp)
target_link_libraries(demo SystemC::systemc)

SystemC-AMS Extension

SystemC-AMS extends SystemC for analog and mixed-signal modeling. Download and extract the source, then create a build directory. Update the CMakeLists.txt to include the SystemC headers and set the C++ standard to match the SystemC instlalation. Compile and install similarly to SystemC.

In your project, include the SystemC-AMS headers and update CMakeLists.txt to link against both SystemC and SystemC-AMS libraries.

Tags: SystemCC++

Related Articles

Understanding Strong and Weak References in Java

Strong References Strong reference are the most prevalent type of object referencing in Java. When an object has a strong reference pointing to it, the garbage collector will not reclaim its memory. F...

Comprehensive Guide to SSTI Explained with Payload Bypass Techniques

Introduction Server-Side Template Injection (SSTI) is a vulnerability in web applications where user input is improper handled within the template engine and executed on the server. This exploit can r...

Implement Image Upload Functionality for Django Integrated TinyMCE Editor

Django’s Admin panel is highly user-friendly, and pairing it with TinyMCE, an effective rich text editor, simplifies content management significantly. Combining the two is particular useful for bloggi...

Leave a Comment

Anonymous

◎Feel free to join the discussion and share your thoughts.