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

UVM-SystemC compiling and linking using Eclipse and Cygwin

I am trying to use UVM-SystemC library in Eclipse and I managed to install it but I am having troubles connecting it. I try for example to write this piece of code: template class vip_driver : public uvm_driver { public: vip_if*…
tokyo
  • 328
  • 4
  • 12
1
vote
2 answers

Driving an sc_out from an sc_signal

Consider the following example, where one module's output (inner::out) is supposed to drive two outputs (outer::out and outer::out2) of the upper hierarchy level: #include SC_MODULE(inner) { sc_out out; SC_CTOR(inner) :…
rainer
  • 6,769
  • 3
  • 23
  • 37
1
vote
1 answer

Proper way to reset a SC_THREAD in SystemC from another process

If I have two threads in SystemC, A and B (both SC_THREAD), and I want thread A to stop executing (be reset) if a variable or event in B gets asserted, what is the proper way to accomplish this. Here is a more illustrative example: // Thread A: Data…
evilpascal
  • 117
  • 3
  • 12
1
vote
3 answers

Is it possible to use System C data types in C++ without the entire System C kernel?

System C provides arbitrary length integer types that can be manipulated either as numbers (i.e. with support for artihmetic) or as bit-vectors (i.e. with support for logic operations and working with sub-vectors). System C also provides support for…
Nathan Fellman
  • 122,701
  • 101
  • 260
  • 319
1
vote
2 answers

Does system C support tri-state logic?

Does System C support tri-state logic? That is, bits that can get 0, 1 or X, where X means "unknown"? If it does, does it also support vectors that can contain Xes, including logic and arithmetic operations?
Nathan Fellman
  • 122,701
  • 101
  • 260
  • 319
1
vote
3 answers

Can an inport be forwarded to an outport using signal w/o a method?

I have a SystemC module that implements a hardware block, where an input is directed as-is to the output (think for example about a non-inverting buffer). Say I defined: sc_in ip; sc_out op; Can I forward the input to the output with…
ysap
  • 7,723
  • 7
  • 59
  • 122
1
vote
1 answer

Managing signals within a testbench module in SystemC

I'm trying to simulate in SystemC a module with a CABA (Cycle Accurate / Bit Accurate) model which adds two numbers. It has the following signals: Module addition_CABA a: Input number for the addition. b: Input number for the addition. clk: Clock…
Marco
  • 391
  • 4
  • 18
1
vote
1 answer

step by step debugging error with vivado hls. systemC

I am using Vivado HLS and even though my project compiles and synthesizes without error, when I try the step by step debugging I get the following error after a couple of steps: Can't find a source file at …
PetrosM
  • 251
  • 3
  • 15
1
vote
1 answer

Using System C in Eclipse Luna

I want to install system c library in Eclipse Luna in Mac OS. I tried many solutions including: Project-> Properties->C++ General ->Paths and Symbols. I still can't use the include systemc.h. Please suggest another way of compiling system c code…
user12083
  • 35
  • 1
  • 9
1
vote
1 answer

SystemC on Mac error with Makefile

I need to start working on a project with SystemC. I managed to compile SystemC according to this instructions: how to use and install SystemC in terminal mac OS X? Afterwards I adjusted the SYSTEMC_HOME variable in Makefile.config to…
Ammar114
  • 35
  • 1
  • 5
1
vote
2 answers

How to connect SystemC model with SystemVerilog?

Say we have a SystemC model of decade counter and I want to verify SystemVerilog Counter RTL using SystemC model. How can we connect these two in SV/UVM based testbench so as to communicate between them.
MayurKubavat
  • 341
  • 4
  • 10
1
vote
0 answers

SystemC/TLM (C++) sharing memory pool; static members, static methods, Singleton or?

Context: I am writing a specific communication protocol to be used between TLM models (HW blocks described with SystemC and thus C++). TLM notion is not important, just note that this communication is mimicked by allocating objects, the generic…
Bertone
  • 756
  • 2
  • 9
  • 23
1
vote
0 answers

Trigger points in Code coverage using GNU libs GCOV, LCOV for SystemC?

I am using GNU Libs GCOV, and LCOV in SystemC for code coverage analysis. Everything works fine, but I was wondering if it's possible to have trigger points? just like oscilloscope has a trigger option, which captures the state at the trigger point.…
Muhammad Hassan
  • 501
  • 1
  • 4
  • 14
1
vote
1 answer

SystemC - Can I retrieve clock period from sc_in_clk port?

Can I retrieve the clock period through sc_port? The following code doesn't work. I'd like to call method period() defined in sc_clock. sc_in_clk clk; *clk.get_interface()->period();
Han
  • 625
  • 2
  • 7
  • 25
1
vote
1 answer

installing systemc on ubuntu

I am a beginner. I'm installing systemc231 on Ubuntu and I have done this: tar -xzvf systemc-2.3.1.tgz cd systemc-2.3.1 sudo mkdir /usr/local/systemc231 mkdir objdir cd objdir export cxx="" export cxx=g++ export cxx=clang++ setevn cxx…
maryam
  • 23
  • 1
  • 5