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
5 answers

SystemC constructor, class

I am new in systemc. There is one confusion that I am having. I am creating a sc_module(hello_world). The sc_ctor(hello_world) has nothing between the curly braces and I just have a simple void say_hello() function inside the module which prints…
newbie
  • 4,639
  • 10
  • 32
  • 45
2
votes
2 answers

what the meaning of (a&b)>>c in this systemc code?

when I read SYSTEMC code,I find a function return int like this: static inline int rp_get_busaccess_response(struct rp_pkt *pkt) { return (pkt->busaccess_ext_base.attributes & RP_BUS_RESP_MASK) >> …
celia
  • 25
  • 5
2
votes
0 answers

What API to use for a Verilator test harness?

Verilator can output SystemC or C++ classes. There is a 'Verilator' API and I can find the headers, but they are just raw classes with no documentation. Some code looks like classes that are used directly by the backend to achieve the simulation…
artless noise
  • 21,212
  • 6
  • 68
  • 105
2
votes
1 answer

Is there a better/alternate way to implement delay in SystemC Modules

I have implemented a 4 bit adder with delay in its output port. SC_MODULE(adder4){ sc_in> A,B; sc_out> OUT; sc_event ev; sc_uint<4> val_a,val_b,val_s; void add(){ val_a = A.read(); val_b = B.read(); …
IVIaster
  • 21
  • 4
2
votes
2 answers

Problem handling signals in SystemC simulation application

I am simulating a CPU and I'm doing this using high level simulation tools. SystemC is a good resource for these purposes. I'm using two modules: DataPath Memory CPU datapath is modeled as a unique high level entity, however the following code…
Andry
  • 16,172
  • 27
  • 138
  • 246
2
votes
1 answer

How to disable SystemC runtime warnings?

I have successfully compiled a SystemC application that I use in order to simulate a CPU when running on a general architecture. Well my problem is just that, when running the application in order to create the VCD file, the SystemC kernel plots me…
Andry
  • 16,172
  • 27
  • 138
  • 246
2
votes
2 answers

Specifying signal delays in SystemC as clause AFTER in VHDL

I have a problem in SystemC trying to write a signal after some time passes... Consider the following: process (clk) begin -- Updating my signal, out signal, in order to get result, but after a certain delay. signal1 <= '0' after 2…
Andry
  • 16,172
  • 27
  • 138
  • 246
2
votes
2 answers

Understanding types in SystemC

I am a beginner in SystemC programming and there is one thing I noticed (looking in the SystemC official documentation): all types that I used to deal with in VHDL simulations have not been "ported" to SystemC. I mean: Consider std_logic in the…
Andry
  • 16,172
  • 27
  • 138
  • 246
2
votes
1 answer

Clock type in SC_CTHREAD

I've read that SC_CTHREAD works only with bool, like: SC_MODULE(my_module){ sc_in clk; // ... void foo(); // ... SC_CTOR(my_module){ SC_CTHREAD(foo, clk.pos()); } } But what if I have sc_in_clk clk in my module, like it is in this…
ans
  • 378
  • 1
  • 5
  • 18
2
votes
2 answers

Event generation in systemc

I am trying to understand event generation in systemc. I found that it depends on the order of thread registration in constructor. #include
Rohit Bohara
  • 323
  • 4
  • 14
2
votes
3 answers

C++ Error: use of deleted function during constructor call of custom class

I have a custom class producer which inherits from SystemC class sc_module: class producer: public sc_module { public: int counter; sc_in clock; sc_out out; int speed; producer(sc_module_name…
goulashsoup
  • 2,639
  • 2
  • 34
  • 60
2
votes
2 answers

How can I check the difference between sc_buffer and sc_signal?

I would like to check the difference between using sc_buffer and sc_signal. I have coded a module which adds two random numbers and then I run two tests in parallel: one using sc_buffer and the other using sc_signal. Nevertheless, when I check with…
Marco
  • 391
  • 4
  • 18
2
votes
2 answers

SystemC - measure and include file parsing time in systemc simulation

I have a simple C++ function which parse CSV (10-10k rows) file line-by-line and insert each field in defined structure, array of structures to be more specific. Now I want to measure parsing time using systemc methods (without C++ utilities, e.g…
nervuzz
  • 416
  • 3
  • 10
2
votes
0 answers

Synthesizing SystemC with Vivado doesn't give desired VHDL signals

I am writing a project is systemC and i have a couple of sc_in and sc_out to communicate between my modules. When I synthesize the project, in the vhdl code produced each sc_in and sc_out creates a block of signals like…
PetrosM
  • 251
  • 3
  • 15
2
votes
1 answer

Installing systemc SCV library on x86-64 machine

When I tried to install the SCV library, I came accross with the following problem: "checking build system type... Invalid configuration x86_64-unknown-linux-gnu': machine x86_64-unknown' not recognized " I copied the 'config.guess' and 'config.sub'…
lukmac
  • 191
  • 1
  • 2
  • 9
1 2
3
18 19