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
2 answers

Instruction set simulator(SystemC) for MIPS architecture

Does anybody know if there is a open source MIPS instruction set simulator (in C++ or SystemC preferably)? I googled dozens of links and there is just no open ISS of MIPS cpu. Then only ones I know for now is Plasma CPU, which implements only a…
lukmac
  • 4,617
  • 8
  • 33
  • 34
1
vote
4 answers

verilog or systemc for testbench

I am assigned with the task of verifying some verilog based RTL code. Now, coding the RTL testbench using verilog seems to be very difficult (for me). So I would like to try one of the following. - Try providing a PLI interface to the RTL and…
Alphaneo
  • 12,079
  • 22
  • 71
  • 89
1
vote
0 answers

TLM-2.0 and SystemC-2.3.3 version

I followed the Doulos tutorial for the development of a simple bus-based master/slave communication system. My problem is that my code compiles perfectly with version 2.3.2 of SystemC but when I upgraded to version 2.3.3, I got the following…
1
vote
1 answer

Prevent SC_METHOD from executing without event/trigger

My method fsm1 executes once even without event and therefore id1_cmd.read() and id1_value.read() contain 0 and not the correct values. //------------------------------------------------------------------ // Method: control::fsm1() // Parameter:…
TheDoctor
  • 2,362
  • 4
  • 22
  • 39
1
vote
1 answer

Problems handling sc_logic values in SystemC

I'm writing an application in order to simulate a hardware system using SystemC libraries. My problem is handling the sc_logic type. Consider a simple module SC_MODULE(MyModule) { sc_in_clk clk; sc_out outsig; void…
Andry
  • 16,172
  • 27
  • 138
  • 246
1
vote
0 answers

SystemC - building but not running

I have recently started learning systemC and have got a problem simulating the FIFO module I have written. The code actually compiles without any error/warning but when I run the simulation, I don't get the expected output. I have uploaded the code…
M.X
  • 195
  • 3
  • 12
1
vote
1 answer

SystemC- sensitivity list

I have recently started learning SystemC and I have got an error with sensitivity list in "SC_METHOD". I am trying to implement a fifo and the error corresponds to following part of the code: SC_MODULE(fifo){ ... int rd_addr,…
M.X
  • 195
  • 3
  • 12
1
vote
2 answers

How to use in multiple inheritance an abstract method

It looks like that there is something that I don't understand about multiple inheritance and abstract methods. I am implementing some hardware functionality in SystemC, with multiple target HWs. I have two different levels of software…
katang
  • 2,474
  • 5
  • 24
  • 48
1
vote
1 answer

Transmitting floating-point numbers over a TLM port from SystemVerilog to SystemC

I implemented a specific filter in C/C++, "encapsulated" in a SystemC-Module. I want to use this filter in my actual verification environment (VE), which is based on SystemVerilog. To transfer data from and to the filter, I want to implement a…
Daiz
  • 357
  • 1
  • 3
  • 20
1
vote
0 answers

Changing signal on every posedge of clock in SC_THREAD

I want to implement module, which when is called to work changes signal x the way below: 1 clk pos.edge : x = 0 // 1st phase 2 clk pos.edge : x = 0 // 2nd phase 3 clk pos.edge : x = 1 // 3rd phase And then stops until called again. I have function…
ans
  • 378
  • 1
  • 5
  • 18
1
vote
1 answer

Systemc - Rounding off sc_time to nearest 10th SC_NS

I am trying to round off the sc_time to the nearest 10 nanoseconds. / is overloaded so it is possible to divide two sc_time. * is also overloaded with a sc_time and a double value. For this code, I am getting 6 and not 10. #include…
Zeeshan Hayat
  • 401
  • 6
  • 13
1
vote
1 answer

sc_spawn and other process [SystemC]

Can you explain the difference between sc_spawn and another process (SC_METHOD, SC_THREAD, SC_CTHREAD )? Thanks all. Hook
user9591186
1
vote
0 answers

Compile and use System C under Windows 10 Ubuntu bash

I've been trying to compile a simple System C executable under windows 10 bash without success, after some search, I've found this link: http://topazus-dev.blogspot.com/2016/06/systemc-on-windows-using-bash-on-windows.html Explaining that dynamic…
Falconal
  • 67
  • 1
  • 2
  • 7
1
vote
1 answer

SystemC sc_uint from String Object

I've started using SystemC recently and wanted to write a simple program that reads numbers from a file in the SystemC string format and converts them into sc_uint types. Somehow the simple program always fails during the conversion The…
mdxg
  • 11
  • 3
1
vote
1 answer

assign sc_logic to sc_lv[i] - SystemC

I am working on a small project in SystemC and got stocked in filling a sc_lv (logic vector) with values from a sc_logic. So: #include #include "fullAdder.h" SC_MODULE(eightBitAdder) { public: fullAdder *fullAdder_p; …
ArcaGraphy
  • 53
  • 3
  • 11