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
1
vote
1 answer

Loading SystemC modules dynamically at run-time

In my simulator framework, the HW/SW modules are implemented in SystemC and pre-built. The platform to be simulated is described in XML. The simulator core parses the XML, determines the modules used and corresponding libraries files (e.g. dlls in…
Wei He
  • 107
  • 6
1
vote
1 answer

Error reported (expression must have a constant value) while parameterizing sc_lv

I am working on System C. In a class First I have declared a integer: int G_WIDTH; Then I am using G_WIDTH in : sc_in < sc_lv > a; When I am trying to simulate it. Following error is reported: Expression <*sc_in < sc_lv > a;*> must…
0
votes
2 answers

SystemC error, using visual c++ 2008

I am using systemC with visual C++ 2008. I wrote a simple hello world program. However I am getting this error repeatedly: warning C4996: 'sprintf': This function or variable may be unsafe. Why this is happening? I would appreciate any help.
newbie
  • 4,639
  • 10
  • 32
  • 45
0
votes
1 answer

How to define `sc_fixed` variables that have word/integer lengths that are based off (but not the same size as!) those of a template parameter

Let's say I want to write a generic SystemC module which does some algorithm processing on fixed point data of various representations, so I implement it as as module template where the fixed point input/output type is specified as a template…
0
votes
0 answers

error: declaration of 'class T' template class FIFO_READ_HS: public sc_module, public sc_fifo_in_if

Coming accross declaration of 'class T' error. I have this code: #include "systemc.h" template class FIFO_READ_HS: public sc_module, public sc_fifo_in_if { public: // ports sc_in_clk clock; sc_in data; …
Crazy Kid
  • 9
  • 1
0
votes
2 answers

Makefile:77: *** missing separator. Stop

Hi I am trying to install systemC on WSL2, when I run sudo make I seem to be getting this error Making all in src make[1]: Entering directory '/home/ryans/systemc-2.3.4/src' Makefile:77: *** missing separator. Stop. make[1]: Leaving directory…
albusSimba
  • 441
  • 4
  • 14
0
votes
2 answers

How to dynamically create templated classes with compile-time information?

I am working on a small design with SystemC for a systolic array. For that I have implemented a templated shift register class where the data type and the delay are the templates. For every row of the array I need to attach a shift register with a…
Necrotos
  • 61
  • 8
0
votes
1 answer

SystemC ERROR: type name requires a specifier or qualifier

I am trying to write synthesizable SystemC code. My code: struct test:sc_module{ sc_in> inp; sc_out> outp; void run(){ sc_lv<4> temp = inp.read(); outp.write(temp); } SC_CTOR(test){ …
dpk
  • 1
  • 1
0
votes
1 answer

Building SystemC Library for ISO C++ 2011 standard with MinGW

I have some C++ code, which requires the ISO C++ 2011 standard and also uses SystemC functionality. Therefore I guess it makes most sense to build the SystemC library with the same standard. For the build MinGW should be used. I already did the…
Lars
  • 11
  • 3
0
votes
1 answer

'b_transport' is not a member of 'tlm_utils::simple_initiator_socket<...>' while trying to use TLM2

I am trying to use TLM2 for a simulation project but for some reason I can't use b_transport the same way I see it used in other projects, here is the code snippet that doesn't build due to this error(error C2039 : 'b_transport' : is not a member of…
hades
  • 1
0
votes
1 answer

SystemC binding a socket to a port

I have a virtual model given to me by one of the vendors. This model has a port for interrupt and I want to connect it to my interrupt controller. The problem is that the port in my interrupt controller is a socket and I can't bind them…
0
votes
1 answer

Link issue on Windows with pthreads - Is gcc or SystemC to blame?

​ Hi, I've recently come across a link issue that I cannot explain. Here is an example that couldn't really be simpler: sc_main.cpp: #include int sc_main (int argc, char* argv[]) { sc_start(SC_ZERO_TIME); return(0); } I use the…
DaveC
  • 115
  • 8
0
votes
0 answers

Is there a way to create an array(or vector) of sc_out signal in a System C module?

I would like to create an array of sc_out and sc_in in sc_module. I looked at the documentation of sc_vector, but I couldn't get it to work. I like to be able to read and write individual sc_out…
0
votes
1 answer

Need help to implement an interrupt controller simulator which handles the ISR

I am on the implementation of an interrupt controller simulator, which will take signals from other rest of the HW modules in simulation and run the ISR. Below is the SystemC code roughly made to get the concept clear. In this case, we need ISR to…
Jomon
  • 1
0
votes
1 answer

what is the the difference between Dataflow model and RTL style coding in verilog/SystemC

I have studied in my school that both the models are used in same perspective but when i went through online there are pages which define some tips to convert Dataflow models to RTL models, so can someone explain me with an example what is the…
Nikhil
  • 17
  • 3