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

How can I use an struct as a signal type in SystemC?

I'm trying to simulate in SystemC a block which adds the red component of two pixels P1 and P2, and always keeps the green and blue components of pixel P1. I have declared the pixel as an struct and its overload function in the following way: struct…
Marco
  • 391
  • 4
  • 18
0
votes
1 answer

systemc library can't be opened with vs 2013

I am new to systemc programming.For the installation, I followed this tutorial to install and startup. I am trying to build a simple main program. However I am getting the error error LNK1104: cannot open file "systemc.lib". Now with a simple…
akaAlso
  • 132
  • 1
  • 1
  • 8
0
votes
2 answers

LINK : fatal error LNK1561: entry point must be defined on SystemC on Visual Studio 2015

When trying to build a simple helloworld program, the next error shows up LINK : fatal error LNK1561: entry point must be defined I'm trying to use the systemc library in Visual Studio 2015, maybe thats the problem because, I couldn't find any…
0
votes
2 answers

Accellera SystemC error with a large number of SC_THREAD

In the context of a SystemC simulation with many SC_THREAD processes (> 32000), I am facing the following error with the Accellera 2.3.1 implementation on an Intel X86 platform running Ubuntu 15.04: sc_cor_qt.cpp:114: virtual void…
Manuel Selva
  • 18,554
  • 22
  • 89
  • 134
0
votes
2 answers

error: No match to call the 'module'

I am not able to initialize or call full_adder module for combining multiple full_adder. Getting error error: no match for call to ‘(full_adder) (sc_core::sc_signal_in_if >*, sc_core::sc_signal_in_if >*,…
Dilip Kumar
  • 1,736
  • 11
  • 22
0
votes
2 answers

Is it possible to report stack usage for each module during compile C++ code?

I am doing mixed language simulation with modelsim, part of the code is written in SystemC (C++), then I got stack overflow when I use the SystemC code. I am not sure how to trace this issue. Just want to check if it is possible to report the stack…
Enze Chi
  • 1,733
  • 17
  • 28
0
votes
1 answer

Does the Accellera SystemC Implementation incorrectly implement to_long()?

Consider the following SystemC code: #include #include "systemc.h" using namespace std; int sc_main(int argc, char* argv[]) { sc_bv<3> foo; operand_0 = "0d6"; cout << foo.to_long() << endl; // prints -2 return…
Holger Watt
  • 175
  • 8
0
votes
1 answer

Error C4716: 'operator<<': must return a value

I am struggling to get an appropriate return for this operator (it is not my code, just trying to correct it and I am not as good as I should be in C++ to correct it) can anybody help me with this, it is datatype class defined for high level design…
0
votes
1 answer

Error: Output file ./.noxim_explorer.tmp corrupted, noxim tool

I am using SystemC and Network-on-chip simulator called "Noxim", which i've heard is very smooth and simple. running make does not have problem However, I am getting error when i run ./noxim_explorer sim.cfg …
Deep
  • 1
  • 1
0
votes
3 answers

SystemC: SC_THREAD does not start

My simple "HelloWorld" program does not work. The programs prints the usual SystemC copyright notice, but not the "Hello World" string). If I write a similar program using SC_METHOD (removing wait calls), I can see the printed message. What causes…
0
votes
1 answer

Work around for default constructor requirement of vector?

I'm trying to write a model for a system using SystemC (a C++ library for systems modeling). My design consists of three main parts: a Server, an Environment, People objects and Robots. The environment and the server both need access to all the…
audiFanatic
  • 2,296
  • 8
  • 40
  • 56
0
votes
1 answer

C to Fpga error with LCD under Altera DE2-70 board

I tried to display ASCII on the LCD, I am using a DE2-70 board and Handel-C using the Altera DE2 function library. This is the code I am compiling: set clock = external "N2"; #include "DE2.hch" void main(void) { DE2_LCD_LINE line; line =…
user4259109
0
votes
3 answers

Passing string as template parameter in C++

I'm trying to pass a string as a C++ template parameter, but I can't seem to be able to get it to work. For the record, I'm working with the SystemC library (hence all the sc_xxx stuff). According to this answer, what I'm doing should work, but I…
audiFanatic
  • 2,296
  • 8
  • 40
  • 56
0
votes
1 answer

SystemC: channels vs port value update

While working on a SystemC project, I discovered that probably I have some confused ideas about signals and ports. Let's say I have something like this: //cell.hpp SC_MODULE(Cell) { sc_in > datain; sc_in > addr_en; …
Discipulus
  • 245
  • 1
  • 3
  • 13
0
votes
1 answer

Display an image on the screen during VLAB simulation

I am scripting a SystemC simulation demo under VLAB. How can I display an image on the screen, as one of the things the demo does at it runs? I tried opening a window and displaying an image using wx, but this required me to create a wxApp, which…
GreenAsJade
  • 14,459
  • 11
  • 63
  • 98