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
0
votes
1 answer

error: ‘sc_unit’ was not declared in this scope (SystemC-2.3.0)

// first_counter.cpp SC_MODULE (first_counter) { sc_in_clk clock; // clock input of the design sc_in reset; // active high, synchronous reset input sc_in enable; // active high enable…
0
votes
1 answer

Default stack size in SystemC

Does anyone knows why default stack size in SystemC is equal to 0x50000 if we don't use POSIX Threads (and at the same time use Cygwin) and 0x20000 on other case?
pmor
  • 5,392
  • 4
  • 17
  • 36
0
votes
1 answer

Need for a faster software module (Virtual prototype)?

This question is related to the software modelling(Virtual Prototyping). I do not understand fully why there is a need for a faster virtual prototype. I mean a module which simulates the required functionality in less time as compared to an RTL…
Uchia Itachi
  • 5,287
  • 2
  • 23
  • 26
0
votes
1 answer

SystemC HLS Synthesis Error

@E [SYNCHK-77] The top function 'method_coupling' (src/method_coupling.cpp:82) has no outputs. Possible cause(s) are: (1) Output parameters are passed by value; (2) intended outputs (parameters or global variables) are never written; (3) there are…
user1220086
  • 215
  • 1
  • 3
  • 14
0
votes
2 answers

How to properly convert sc_lv to sc_uint?

For a project, I am trying to convert a value that I receive from an sc_lv<8> type input port to an sc_uint<8> type signal. By the way, the input port is connected to an sc_signal_rv<8> channel. I tried casting the input data using this line…
KaiserHaz
  • 25
  • 1
  • 9
0
votes
1 answer

Install System C to Cygwin

I am trying to install System C 2.3.0 to Cygwin (1.7.25). I am running the ../configure in the objdir (as many tutorials online state) but i get the following error: checking for gcc... gcc checking for C compiler default output file…
user1220086
  • 215
  • 1
  • 3
  • 14
0
votes
1 answer

In SystemC, can the sc_signal_in/out type port be bound to the primary channel sc_buffer?

I am using SystemC for modelling, and I am a little bit confused about the "channel", which includes signal, buffer and fifo. So could anyone tell me the difference of signal and buffer? Is it the same as the difference between the wire and register…
Han
  • 397
  • 1
  • 6
  • 18
0
votes
1 answer

sc_start warning W571 indicates the signal/port binding fail?

After Signal/Port binding, when signal changed, the sensitive list will cause SC_METHOD registered method to run. When I'm implementing the SystemC version, I met this warning W571. To be honest, I think this warning is correct because there is no…
milesma
  • 1,561
  • 1
  • 15
  • 37
0
votes
2 answers

SystemC data type conversions

I am newbie to system c and i am trying to work on system c data type's conversions. I have a inport which a system c ufixed type and i need to change it to a bool type on the outport. i tried the following code. SC_MODULE(convert) { sc_in
aram
  • 71
  • 1
  • 10
0
votes
2 answers

How to use header file in SystemC Hello World program?

I'm migrating from C++ to SystemC, met following basic questions. (I've searched in google, but only got examples in a single .cpp file). Thanks in advance. I know following "hello.cpp" works: //hello.cpp #include "systemc.h" SC_MODULE…
milesma
  • 1,561
  • 1
  • 15
  • 37
0
votes
1 answer

SystemC sensitivity list behaviour / driving the pins from main program

I am writing a simple System C program for simulating and logic. The sensitivity list has a ,b as its members . I want to drive 0 ,1 on these lines in the main program and as per the definition of sensitivity list my and-module should run and give…
K_TGTK
  • 765
  • 1
  • 8
  • 24
0
votes
1 answer

std::out of range in a noxim code

Im starting with some SystemC coding and i'm trying to use a Network-on-chip simulator called "Noxim", which i've heard is very smooth and simple. However, im getting this common error when I'm trying to "make" some part of the simulation terminate…
primer_cuervo
  • 101
  • 1
  • 10
0
votes
1 answer

Difficulty in using C standard libraries in the SoCLib tool

I'm an electronic engineering student from Brazil and I'm currently working with embedded systems. I'm trying to port a MP3 decoder (written in C), called minimp3, to a platform built with the aid of the SoCLib tool (this tool has a bunch of…
0
votes
1 answer

Implementing a mod 12 counter in SystemC

How do I go about implementing a modulus 12 counter in SystemC? I am new to the library and do not have much experience with it. please help.
0
votes
1 answer

Getting the names for VCD traced signals in SystemC

SystemC allows signals (or members etc.) to be traced via the sc_trace function, the result being a VCD file that can be used in other programs. The naming of these signals is rather arbitrary though, with the function accepting any string (that…
Jay
  • 237
  • 2
  • 14