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
28
votes
8 answers

VHDL/Verilog related programming forums?

Hardware design with VHDL or Verilog is more like programming nowadays. However, I see SO members are not so actively talking about VHDL/Verilog programming. Is there any forum dealing with hardware design with Verilog/VHDL/SystemVerilog or SystemC?
prosseek
  • 182,215
  • 215
  • 566
  • 871
12
votes
4 answers

Using existing unit test frameworks with SystemC

I am working on a project in SystemC and want to incorporate unit testing. Is it possible to use existing unit test frameworks with SystemC? I ask this because it seems like the SystemC modules only get executed with the simulation kernel, and I…
Joe
  • 151
  • 1
  • 5
9
votes
2 answers

"sc_signal cannot have more than one driver" error, SystemC

I tried to test my environment with one of the examples I found on a website for SystemC (this one). Here is the code of the example: #include "scv.h" const unsigned ram_size = 256; class rw_task_if : virtual public sc_interface { public: …
tokyo
  • 328
  • 4
  • 12
9
votes
7 answers

Serialization of objects: no thread state can be involved, right?

I am looking hard at the basic principles of storing the state of an executing program to disk, and bringing it back in again. In the current design that we have, each object (which is a C-level thingy with function pointer lists, kind of low-level…
jakobengblom2
  • 5,531
  • 2
  • 25
  • 33
8
votes
1 answer

Setting up a SystemC project with CMake: undefined reference to `sc_core

I'm trying to build a simple hello world in SystemC with CMake. Here's the SystemC file main.cpp: #include using namespace std; SC_MODULE (hello_world) { SC_CTOR (hello_world) { } void say_hello() { cout << "Hello World…
Sadık
  • 4,249
  • 7
  • 53
  • 89
7
votes
2 answers

Converting Chisel to Vhdl and SystemC?

I have some question about Chisel conversion. I know it's theoretical but it would be nice if someone give his opinion. 1) I want to ask why Chisel does not focus on VHDL / SystemVerilog conversion. Although both Verilog and VHDL are same, in some…
ARK91
  • 373
  • 3
  • 13
7
votes
1 answer

Running Boost unit tests on different processes

I want to do unit testing in a SystemC program. The idea is to have multiple test suites with several tests in each suite. Each one of the tests would require resetting the SystemC framework (e.g., by calling sc_simcontext::reset()), but that is…
betabandido
  • 18,946
  • 11
  • 62
  • 76
5
votes
2 answers

Installing SystemC for VS2013

I am using Windows 10 64-bit machine with Visual Studio Professional 2013 and I want to install SystemC. I downloaded SystemC 2.3.1 and I tried following the "Installation notes" provided but they're slightly outdated. For one, it says "for VS 2005…
Javia1492
  • 862
  • 11
  • 28
5
votes
2 answers

Debugging Stack Corruption issue

I'm debugging an "Access violation" exception on a large application in C++ (Visual Studio 2015). The application is built from several libraries and the problem occurs on one of them (SystemC), although I suspect the source of the problem is…
Amir Gonnen
  • 3,525
  • 4
  • 32
  • 61
5
votes
1 answer

Why SystemC trace can't capture the last waveform?

Here is my program: #include int sc_main(int argc, char* argv[]) { sc_signal a, b, c, d; // trace file creation sc_trace_file *tf = sc_create_vcd_trace_file("test"); //tf->set_time_unit(1, SC_PS); …
swgchlry
  • 71
  • 4
4
votes
1 answer

How to simulate output delay using next_trigger() in SystemC?

I have been reading this upvoted answer on Stack Overflow: https://stackoverflow.com/a/26129960/12311164 It says that replacing wait(delay, units); in SC_THREAD to next_trigger(delay, units) in SC_METHOD works. But when I tried, it does not work. I…
user12311164
4
votes
3 answers

Systemc Error with the library

I installed the SystemC library 2.3.1 using this tutorial. I wrote this hello world example: //hello.cpp #include SC_MODULE (hello_world) { SC_CTOR (hello_world) { } void say_hello() { cout << ”Hello World systemc-2.3.0.\n”; …
4
votes
1 answer

How can I declare a destructor in SystemC?

I'm writing a module in SystemC where within the constructor I have a variable initialized with new: SC_CTOR(MY_MODULE) { ... ... my_matrix = new unsigned char [a*b]; ... ... } How can I declare the destructor to release the…
Marco
  • 391
  • 4
  • 18
4
votes
3 answers

Error: (E112) get interface failed: port is not bound - SystemC

My goal is to create an ALU that adds and subtracts with a barrelshifter alu.h #include "systemc.h" SC_MODULE(alu){ sc_in op; sc_in > a; sc_inout > b; sc_out > output; void alu_method(); SC_CTOR(alu)…
The Muffin Boy
  • 314
  • 4
  • 14
4
votes
1 answer

Defining custom constructor for a SystemC module

I have a SystemC module as below and I want to pass on "maps" to the constructor. How can I do it? struct Detector: sc_module { map int_map; SC_CTOR(Detector) { for (int i = 0 ; i<10; i++) { …
user3825711
  • 43
  • 1
  • 4
1
2 3
18 19