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

systemC Error: No instance of constructor "BlackBox ... etc

I'm trying to make a module in SystemC but have to struggle with this error. Error: No instance of constructor "BlackBox::BlackBox with[R=1, expR =3, C=5, expC=-6, T=1, expT=-1]" matches the argument list I dont know where is the problem. It…
1
vote
2 answers

please help explain this code for semaphore channel in SystemC

Recently, I am studying systemc and have a question on semaphore channel. I found an example on asic world (http://www.asic-world.com/systemc/channels3.html) but have a little confused. At the first 1ns for this example, the first process…
Wayne
  • 33
  • 1
  • 2
  • 9
1
vote
1 answer

SystemC IDE out of the box without compiling lib for windows and mac?

Is there an IDE with SystemC out of the box without compiling the lib for windows AND mac? Looking for a download, but can't find. Why everybody needs to compile it on its own? Thanks
Danny Archer
  • 215
  • 4
  • 12
1
vote
2 answers

SystemC with c++ - how to print a sc_bigint variable?

I have a variable declared as so: sc_bigint<88> x I want to use fprintf to print it to a file, but this produces an error. I am able to print the variable using cout, but I need to print it to a specific file I have opened. Any ideas how to do…
1
vote
2 answers

SC_THREAD does not get triggered by its sensitivity list

I am developing a simple NAND module in SystemC. By specification, it should have a 4 ns delay so I tried to describe it with a process with a "wait" statement and SC_THREAD, as follows: //file: nand.h #include "systemc.h" SC_MODULE(nand2){ …
1
vote
1 answer

JNI calls don't work within SystemC sc_core::sc_start() call

When using JNI within SystemC I face a very strange issue I can't explain myself. Just some information on my used environment: I am currently developing on a 12.04 ubuntu with openjdk-6 and openjdk-7 installed. The issue reproduces with both…
pproksch
  • 206
  • 3
  • 9
1
vote
1 answer

System C - Reading in data bus one bit at a time

I have a simple block written in System C that takes in two 10x10 arrays, and performs matrix multiplication on them to produce a 10x1 output. The issue I am having is that these 10x10 arrays are actually stored as "doubles" so the data coming into…
user1220086
  • 215
  • 1
  • 3
  • 14
1
vote
1 answer

GDB: stepping into a library

Runnning my application I get a Segmentation fault. I ran gdb to check where my code was failing but I get the following output: Program received signal SIGSEGV, Segmentation fault. 0x39ca8000 in ?? () (gdb) bt #0 0x39ca8000 in ?? () #1 …
makeMonday
  • 2,303
  • 4
  • 25
  • 43
1
vote
0 answers

How to setup a controller module to send/recieve events/notifications to/from multiple instances of another module in SystemC?

I have two modules written in SystemC, the first is called "worker" the other "boss". In sc_main, I dynamically generate a random number of workers. I want each to notify the boss module that it has started/finished working. At the same time I want…
The Byzantine
  • 619
  • 1
  • 6
  • 21
1
vote
1 answer

Setting the vector length in SystemC with a received parameter

Im making a xor gate in SystemC, from the binding of four NAND gates. I want the module to receive a vector of N bits, where N is passed as parameter. I should be able to perform & and not bitwise operations (for the NAND gate). The best solution…
Nicolás Arias
  • 1,053
  • 1
  • 12
  • 29
1
vote
1 answer

SystemC how to get interactive user input

I would like to take commands interactively from a user from standard input in a SystemC simulation. I am using Mentor Questa and it seems that nothing from cout is printed to prompt the user (even with a flush immediately after the stream to…
dcdo
  • 161
  • 1
  • 6
1
vote
1 answer

Conversion from SystemC to VHDL or Verilog

I designed a circuit using RTL SystemC library. This circuit works fine and I can simulate it properly. Now I want to deploy it into an FPGA and I'm looking for a way to convert my SystemC code into VHDL or Verilog in order to use it in Xilinx…
progmaster
  • 33
  • 1
  • 5
1
vote
1 answer

Using SystemC in Visual Studio 2010

I am new to SystemC and I just compiled it for using it with VS2010 using this tutorial. But when I tried to debug the following program: #include SC_MODULE (systemcTest) { SC_CTOR (systemcTest) { } void say_hello() { cout <<…
Animesh Pandey
  • 5,900
  • 13
  • 64
  • 130
1
vote
1 answer

No matching function for call to sc_trace when using std::string with sc_signal

I am using systemc to do the simulation and I got an error message telling that g++ -I/opt/Xilinx-14.2/Vivado_HLS/2012.2/Linux_x86_64/tools/systemc/include/ -o testBench.exe testBench.cc…
1
vote
2 answers

Send event trigger to a module in SystemC

What I want to do feels like sending av event from one module to another (like pressing a button). But as I have searched it seems that it should be done in an other way becuase I haven't found any standard way to send av event…
Moberg
  • 5,253
  • 4
  • 38
  • 54