Questions tagged [systemc]

C++ library used for system-level modeling of hardware designs. Used by engineers in making architectural decisions, modeling performance and enabling software/firmware development concurrently with traditional hardware development.

Wiki

SystemC is a collection C++ classes and macros which provide an event-driven simulation interface in C++. These facilities enable a designer to simulate concurrent processes, each described using plain C++ syntax. SystemC processes can communicate in a simulated real-time environment, using signals of all the datatypes offered by C++, some additional ones offered by the SystemC library, as well as user defined. In certain respects, SystemC deliberately mimics the hardware description languages VHDL (tag ) and Verilog (tag ), but is more aptly described as a system-level modelling language.

SystemC is standardized as IEEE 1666-2011 (available as a free download). SystemC-AMS is standardized as IEEE 1666-2011.1 (also available as a free download).

Example

#include "systemc.h"
 
SC_MODULE(adder)          // module (class) declaration
{
  sc_in<int> a, b;        // ports
  sc_out<int> sum;
 
  void do_add()           // process
  {
    sum.write(a.read() + b.read()); //or just sum = a + b
  }
 
  SC_CTOR(adder)          // constructor
  {
    SC_METHOD(do_add);    // register do_add to kernel
    sensitive << a << b;  // sensitivity list of do_add
  }
};

Tag usage

The tag can be used for programming related problems in system level modelling and other related fields. Please avoid theoretical and "refer-a-book"-type questions on stackoverflow.

Read more

279 questions
2
votes
2 answers

In SystemC why cant a wait be put in SC_METHOD?

I was going through some tutorial on SystemC and there was a mention that we cant put wait in SC_METHOD, it didn't explain why.
K_TGTK
  • 765
  • 1
  • 8
  • 24
2
votes
1 answer

What is the best way to check whether a signal is a valid one in SystemC?

I am having a little problem in a SystemC simulation because in one component I did forget to check for signals integrity and my simulation breaks because of this. Basically I do not handle situations when my signals are like "XXXXX..." or…
Andry
  • 16,172
  • 27
  • 138
  • 246
2
votes
1 answer

SystemC 2.3.0 support modeling power domains and abstract schedulers

the new SystemC library 2.3.0 was released in July, 2012.It was reported to be able to support modeling of concepts such as power domains and abstract schedulers. Has anyone checked or worked on how SystemC 2.3.0 can support the modeling of power…
coder
  • 71
  • 2
  • 7
2
votes
1 answer

Reference to class is ambiguous when compiling with g++4.5.2

I need a bit of help here: when using g++ 4.1 to build my code, there was no error regarding "reference to class is ambiguous". It only happens when using g++4.5.2 to compile the same code, and here is the code fragment: #include…
user960095
  • 21
  • 4
2
votes
2 answers

What is the minimum length of time/cycles a System Verilog wait() statement will wait?

I have a SystemVerilog task I am trying to port to SystemC. The body of the task simply waits on a boolean expression and then pushes onto a queue. The SystemC wait mechanism doesn't work quite the same way though, it will only wait on time or…
Rich
  • 1,165
  • 1
  • 15
  • 29
2
votes
1 answer

enable debugf in SystemC

I was looking at the source of SystemC and saw that there are things like: #define DEBUGF \ if (0) std::cout << "sc_cor_pthread.cpp(" << __LINE__ << ") " and later on there are lines such as: DEBUGF << this << ":…
none
  • 11,793
  • 9
  • 51
  • 87
2
votes
5 answers

Error while loading shared libraries: libsystemc-2.3.0.so

I am a new user to Linux and I am trying to install systemc-2.3.0 library on my machine (Fedora 16). I have followed every instructions very carefully, mentioned in the INSTALL file of the library but I am getting an error when I am trying to run a…
SilverSurfer
  • 656
  • 1
  • 6
  • 23
2
votes
3 answers

In systemC how do you get the sc_time in the end_of_simulation routine

I would like to report what the time is at the end of a simulation. I thought that I would use the end_of_simulation routine, and just do a sc_timestamp in the routine to do this. The problem is that the kernel has terminated before…
Chris
  • 483
  • 3
  • 14
1
vote
1 answer

makefile.in not found while installing systemC

I'm trying to install SystemC on mac (x86, macOs 13.0.1). I followed the steps described in the docs: $ cd path/to/systemc-2.3.3 $ mkdir objdir $ cd objdir $ export CXX=g++ $ ../configure But when I run the configure, I have an error cause it says…
L.DZ
  • 111
  • 3
  • 12
1
vote
2 answers

Installing SystemC 2.2.0, compilation with GCC 4.6 and package for Fedora

How to install SystemC on Fedora 15? Problems: no RPM package (licensing problems) does not compile with 4.6 even with -fpermissive (clang doesn't compile your modules)
Paweł Prażak
  • 3,091
  • 1
  • 27
  • 42
1
vote
1 answer

SystemC simulation misses the first iteration

I'm having difficulties with initiating the simulation. Whenever I start a for loop, I always miss the first iteration of the loop. Here is my code: #include #include using namespace std; SC_MODULE(cpu){ sc_in_clk clk {…
L. B.
  • 13
  • 2
1
vote
1 answer

Error E109 - complete binding failed: port not bound

I have been to create a proof of concept for an instance inside an instance, and I am getting a "complete binding error", which I have not been able to get past. I have searched online, and though I found similar cases, they could not explain mine.…
user3684405
  • 89
  • 1
  • 5
1
vote
2 answers

Cross-compiling SystemC libraries and linking to them

I'm starting from scratch and am following the main steps below: 1. Build and install a cross-compiler toolchain (host Linux, target Win64): Get this MXE version, only changing plugins/gcc6/gcc6-overlay.mk with: $(PKG)_VERSION :=…
DaveC
  • 115
  • 8
1
vote
1 answer

Setting signals length using received parameters in SystemC

context I'm making a simulation environment with systemC co-simulated with verilog/VHDL RTL modules using modelsim/questasim My Verilog modules use parameters to set up each module My VHDL modules use generics to set up each module My systemC…
NicolasDg
  • 117
  • 1
  • 6
1
vote
2 answers

typedef an sc_fixed but got template error

Trying to define a simple sc_fixed type in Visual Studio 2017: #include #include # just in case .... typedef sc_fixed<16, 4> fixed_type; .... This typedef line resulted an error: E0864: sc_fixed is not a…
visitor99999
  • 163
  • 1
  • 10