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
2
votes
1 answer

What is the equivalent in SystemC to verilog wire?

I'm converting some verilog code to SC. Here is a case made me confused: In verilog, a continuous assignment such as: wire a; assign a =1; Where a will get 1 immediately after the assignment. If we write it in SC: sc_signal
swgchlry
  • 71
  • 4
2
votes
0 answers

Nirgam runtime error using SystemC in Mac OS X

I am running the nirgam 3.0, which is a open source SystemC based NoC simulator in my MacBook(Mac OS X 10.10). I successfully compile the nirgam source code, but when is try to run it, it throws the "segmentation fault" as showing: ╰─$ ./nirgam …
maxisacoder
  • 1,709
  • 2
  • 13
  • 18
2
votes
2 answers

Jinja2 ASCII to String

I had this line in my Jinja2 template: {% for type in types %} top -> {{(loop.index0 + 'a')|string}}(var{{loop.index0}}); {% endfor %} where types is a list of various types in C++ that is used elsewhere in the template and the output is part…
Leon He
  • 41
  • 1
  • 2
2
votes
1 answer

making the switch case in switch case statements a port in systemc

I am trying to use a switch case statement in systemc and I want the case to be a port of data type int. The code I have created is as follows: #ifndef TRAFFIC_H_ #define TRAFFIC_H_ #include SC_MODULE(traffic){ sc_innext;…
Gathu
  • 23
  • 6
2
votes
1 answer

wrong number of template arguments

I dont have much experience in cpp, let alone systemc. Why doenst this work? sc_in> a,b; adder.cpp:5: error: ‘a’ was not declared in this scope adder.cpp:5: error: ‘b’ was not declared in this scope adder.cpp:5: error: wrong number…
2
votes
3 answers

how to use and install SystemC in terminal mac OS X?

how to use and install SystemC in terminal mac OS X? I tried the Logic poet application, But i use os x 10.10 so it doesn't work. so i want to know how can i compile and execute SystemC in terminal. I could't find the detail of SystemC in…
SunKyu Lee
  • 21
  • 1
  • 2
2
votes
1 answer

SystemC running inside a virtual machine, timing issues or corrupt results?

Is it ok to run a SystemC based simulation on a guest OS inside a virtual machine? Can simulation time be affected by this? I know that SystemC time is simulated and not actually tied to hardware timers. And will running dozens of instances of…
The Byzantine
  • 619
  • 1
  • 6
  • 21
2
votes
1 answer

How to tell whether elaboration has completed at a breakpoint?

When I hit a breakpoint in a VLAB script, how can I find out if I have caused elaboration to finish or not, yet? My script reaches a statement that raises an error: Error: (E529) insert module failed: elaboration done (The command that causes this…
GreenAsJade
  • 14,459
  • 11
  • 63
  • 98
2
votes
2 answers

Common header file between SystemC and Verilog

I have an application that uses Verilog and C (SystemC to be precise). I wanted to see if there was a way to have a common header file that can be used across the entire application ? Such that: #define FOO 4 doesnt have to be repeated in another…
boffin
  • 639
  • 2
  • 13
  • 26
2
votes
1 answer

How to remove SystemC startup text

I wish to remove the following message at the startup of any systemc simulation: "SystemC 2.3.0-ASI --- Jun 18 2013 16:21:08 Copyright (c) 1996-2012 by all Contributors, ALL RIGHTS RESERVED" Do you know where is this being…
VindRaider
  • 51
  • 7
2
votes
1 answer

Reading a file and passing it through port

I am writing some code that requires me to read a file and then use it as input to the SystemC module. What this means is that I should read a file, say, abc.xxx, and then send its content in the binary form to a port (another way to interpret this:…
Sam29
  • 179
  • 3
  • 9
2
votes
2 answers

What are the delta cycle and delta notification in SystemC?

In SystemC, there is a kind of notification called delta notification, which can be called in the following two methods. event.notify(SC_ZERO_TIME); or event.notify(0, SC_NS); It defines that in a delta notification call, processes sensitive to…
Han
  • 397
  • 1
  • 6
  • 18
2
votes
2 answers

Will SC_THREAD in SystemC create a real thread?

I debugged following code in Visual Studio 2008 (64 bit) by setting break point at the start of do_test1 and do_test2, to my suprise, the code is running in the same thread of the sc_main function. I didn't debug in Linux environment. However, by…
milesma
  • 1,561
  • 1
  • 15
  • 37
2
votes
0 answers

SC_THREAD dynamically sensitive to port toggle?

Is there an elegant way to wait on a port trigger (toggle) rather than an event inside a SC_THREAD? In other words, I want a thread in Module B to be dynamically triggered based on a toggle on a port from Module A. My current method is to generate…
zehawk
  • 210
  • 1
  • 10
2
votes
2 answers

Threads and clocked threads in SystemC

While reading about the threads in SystemC, it is said that while(true) loop must be used inside the functions. Why is it so? Can you please see the example code given below and explain why the while loop is used for threads and wait() command is…
aram
  • 71
  • 1
  • 10