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

SystemC - How can I get the module name to which sc_signal connected?

I'd like to print out the name of sc_module to which sc_signal connected. How can I get the module name, "module_a" in the following code, from "sig_out"? #include "systemc.h" class sig_if : virtual public sc_interface { }; class my_sig : public…
Han
  • 625
  • 2
  • 7
  • 25
0
votes
1 answer

systemc constructor initialization is failing

#ifndef RAM_H #define RAM_H #include SC_MODULE(ram) { void ram_proc(); SC_HAS_PROCESS(ram); private: sc_clock clock; }; #endif then in the ram.cpp I have the following code #include "ram.h" ram::ram(sc_module_name name_):…
akaAlso
  • 132
  • 1
  • 1
  • 8
0
votes
1 answer

How to determine the sequencing of event execution in a SystemC simulation

As an example, say my code has three functions which are all sensitive to positive edge of the same clock. Is there a way to tell how a given SystemC simulator sequences the execution of these functions? I am using Cadence's IUS simulator. I…
Josina
  • 57
  • 2
0
votes
1 answer

SystemC Verification building error 'undefined reference to..'

I am having a problem with not being able to build any code that contains any usage of SCV functions. I am using Eclipse and Cygwin. This is a simple code that I am trying to build and run: #include int sc_main (int argc, char* argv[]) { //…
tokyo
  • 328
  • 4
  • 12
0
votes
1 answer

How to install SystemC on xcode

Is it possible to install SystemC on XCode? If so, how would I do it? Do I just need to set up some libraries and point xCode at them? I've set up openGL on xcode before but, I can't similar looking libraries for SystemC. I tried following the top…
Bren
  • 3,516
  • 11
  • 41
  • 73
0
votes
1 answer

SystemC sc_signal_resolved could not be resolved

I am using SystemC and Ubuntu 14.04 and I am trying to setup up Eclipse for a small SystemC project. I followed the the provided readme and the following tutorial here. The problem is that sc_signal_resolved is not being recognized. I have a syntax…
user4237435
  • 333
  • 1
  • 2
  • 12
0
votes
2 answers

How to create a custom channel in SystemC?

I am trying to create a custom channel in System C. Channel data structure is like following struct Command { int cmdType; int lba; double timestamp; int size; Command() { } Command(const int c, const int l, const double ts, const int sz)…
sbh
  • 407
  • 4
  • 13
0
votes
2 answers

How to log sc_logic values using semantic?

I need to convert this code: bool hw = (gpio_ctrl(idx) >> 5) & 1; uint8_t cnfg = (gpio_ctrl(idx) >> 3) & 3; sc_dt::sc_logic oe_n = Log_1; // Default disable sc_dt::sc_logic od = Log_Z; // Default disable DEBUG_PRINTF(("GPIO update_ouput: CTRL=0x%x…
GreenAsJade
  • 14,459
  • 11
  • 63
  • 98
0
votes
1 answer

UVM-SystemC library 'make check' error

I'm getting following error in make check inside objdir of uvm-systemc-1.0-alpha1 library. ../configure make make install commands works fine. Also, I've SystemC-2.3.1 installed and it works fine. Detailed log from make check makecheck.log …
MayurKubavat
  • 341
  • 4
  • 10
0
votes
1 answer

Mixing SystemC modules with Omnet++ modules

I'm interested to mix SystemC modules with Omnet++ modules. According to the Omnet++ manual, this feature is supported. However, I couldn't find any further documentation or examples. Can anyone help me with this procedure? How to enable this…
sefi
  • 101
  • 3
0
votes
2 answers

How to start a new iteration within a loop?

In the following SystemC SC_THREAD I'm trying to do the following: image_buffer is a 3 lines x 720 columns matrix which is filled with the bytes incoming from the port p_in. When the image_buffer has 2 lines and the first 5 bytes filled it must…
Marco
  • 391
  • 4
  • 18
0
votes
3 answers

How to manage counters within a for loop with a control signal in SystemC?

I'm writing a module in SystemC which basically has to work as follows: it receives a string of bytes through a port p_in and a control signal through the port h. The module must save the bytes within a matrix matrix just if the h signal is true.…
Marco
  • 391
  • 4
  • 18
0
votes
2 answers

UVM-SystemC Mac Compiler Linker Error

I'm trying to manually compile some UVM examples using clang++. UVM-SystemC-1.0 was installed successfully (it apparently also ran these examples as tests). However when I compile these examples using the command clang++…
mas
  • 345
  • 5
  • 18
0
votes
1 answer

"multiple definition of" message when trying to simulate a SystemC file

I'm trying to simulate a SystemC module which adds two pixels but when I compile the code I get the following error message: /tmp/ccb1wY9C.o: In function `sc_dt::sc_uint_base::length() const': Test/pixels.h:24: multiple definition of…
Marco
  • 391
  • 4
  • 18
0
votes
1 answer

UVM-SystemC MACOSX make error

I'm trying to run uvm-systemc on macosx. Link to download: http://accellera.org/images/downloads/drafts-review/uvm-systemc-1.0-alpha1.tar.gz In the install flow, ../configure works fine, but on make i get this error: Making all in macros CCLD …
mas
  • 345
  • 5
  • 18