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

Initialize array of non-copyable non-movable objects in another objects constructor

This question pertains to both array initialization and SystemC module hierarchies. I have a class that is non-copyable, non-movable, and no default constructor: class Object : public sc_module { public: Object(string name, Configuration…
sheridp
  • 1,386
  • 1
  • 11
  • 24
1
vote
1 answer

SC_METHOD Exception

I'm trying to use a SC_METHOD in my simulation. Here is the code: gcrypt::gcrypt(sc_module_name name): gcrypt_base(name) { SC_METHOD(on_clock_update); sensitive << clock; dont_initialize(); }; void gcrypt::on_clock_update() { …
C.Mi
  • 37
  • 9
1
vote
1 answer

Declare vector of SystemC type sc_fix

I am trying to make a std::vector of type sc_fix . I know that I can make std::vector> name; . However I would like to use the non-template version sc_fixed. However I am not sure how to instantiate this vector and set the…
Tropical_Peach
  • 1,143
  • 3
  • 16
  • 29
1
vote
1 answer

Error in systemc for vcd file

I have written a code and trying to generate vcd file in systemc, but I had a error that I can't fix. // File : pe_main.cpp #include "driver.h" #include "monitor.h" #include "pe.h" #include "systemc.h" int sc_main(int argc , char *argv[] ) { …
user8494114
1
vote
3 answers

SystemC: Multiple module implementations in single cpp file

Edit: Solution found by moving the SC_HAS_PROCESS(Module); statements from the .cpp file into the class definition in the header file. I am writing a module in SystemC which has small sub-modules. I would like to keep all of the declarations in a…
1
vote
1 answer

How SC_CTOR works in SystemC

In SystemC module constructor can be defined using SC_CTOR macro: #define SC_MODULE(user_module_name) \ struct user_module_name : ::sc_core::sc_module #define SC_CTOR(user_module_name) \ typedef…
anshkun
  • 105
  • 1
  • 12
1
vote
1 answer

Multiples modules reading same fifo

Is it possible to instantiate multiple modules to read from the same fifo assuming they are not reading at the same time, but take turns?? For example: int _tmain(int argc, _TCHAR* argv[]) { sc_fifo PacketTx(24); sc_fifo
Javia1492
  • 862
  • 11
  • 28
1
vote
1 answer

fatal error: systemc.h: No such file or directory

i am trying to build a project in Eclipse, which looks something like this: #include #include int sc_main() { ... } and I gat this error message: make all Building file: ../src/main.cpp Invoking: GCC C++ Compiler g++…
ArcaGraphy
  • 53
  • 3
  • 11
1
vote
1 answer

Project with multiple SystemC Simulations leads to an exception

In my project there are several functions which perform SystemC simulations (each has its own declaration prelude and sc_start()). So they are constructed as follows: // first Simulation: sc_signal s1_sim1; .. ControlFoo *cf = new…
Bowers
  • 836
  • 8
  • 20
1
vote
2 answers

Can SystemC diplay circuits as a drawing?

I need to design some digital circuits , but it kills me drawing them by hand. I've searched a easier way to do them, and found VHDL and what's more interesting SystemC. The last one is pretty nice and easy to understand but i need to be able to…
ilcredo
  • 785
  • 2
  • 7
  • 17
1
vote
2 answers

Generating out of a C program: Component diagram, SYSML and SystemC

I have a C project. It has been imported to Rhapsody 8.2. Now I want to generate: Component diagram. Structural diagram. Dataflow. UML SystemC How to do that? Thanks in advance Amnon
1
vote
1 answer

SystemC: How can I trace all signals in module hierarchy?

I want to trace all signals in my design to VCD file. Is possible to automate this process? I don't want add each signal to trace manually ( with sc_trace (..) )
random
  • 3,868
  • 3
  • 22
  • 39
1
vote
1 answer

convert fifo systemC program to PROMELA language with safety properties and liveness property

please i am a biginner on tihs domain how can i convert a classical example FIFO written in systemC code to PROMELA language with properties in LTL satisfy the following three properties: Mutual exclusion: The producer and consumer processes never…
lamia
  • 31
  • 6
1
vote
2 answers

SystemC Seg Fault on sc_core::sc_in::read()

I am having a repeating seg fault while using SystemC. During initialization I set a value to 0. During operation of a testbench I am setting this value to 1 in a module (proc). This is a sc_signal variable that is attached to a port of another…
spellman23
  • 31
  • 4
1
vote
1 answer

How to get the time of the next event in SystemC

Is there a function in SystemC which returns the time of the next event? Or if does not exist, then how to implement it? For example I have clock model with 1 MHz frequency and I run the model with sc_start(100, SC_NS). The next scheduled event is…
jsmith
  • 127
  • 2
  • 13