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

What is the Hardware synthesized for << operator

I have recently started working on HDL , while going through right/left shift operators what i have studied in my school was they are continous D FlipFlops that shift data bit by bit to result the output. I assumed same will be done over while…
0
votes
1 answer

Member of b object can't write in SystemC

I got this error on SystemC, and I don't understand why. The error is: 'write': is not a member of 'sc_core::sc_in' ConsoleApplication1 'write': is not a member of 'sc_core::sc_in' class "sc_core::sc_in" has no member "write" class…
user13626458
  • 3
  • 1
  • 3
0
votes
1 answer

I got error to set up systemC2.3.3 with visual studio 2017

as I stated in the title I got a problem on setting up systemC on my windows pc. So I followed exactly step by step from this link Installing SystemC for VS2013 yet still fail. So I compile my error picture with this question bellow. enter image…
user13626458
  • 3
  • 1
  • 3
0
votes
1 answer

SC_METHOD in custom constructor

In my custom constructor i want to use SC_METHOD: class host_command : public sc_module, public bus_if { public: // sc_out out_packet; sc_buffer out_packet; host_command(char *name, unsigned int limit) :…
TheDoctor
  • 2,362
  • 4
  • 22
  • 39
0
votes
1 answer

Error: (E112) get interface failed: port is not bound: port 'server.outgoin1' (sc_out)

I can't seem to figure out why I am getting the error. server.cpp #include "systemc.h" SC_MODULE(server){ sc_in begin1, begin2, begin3, end1, end2, end3, incoming1, incoming2, incoming3; sc_out free, outgoing1, outgoing2,…
Yash Jain
  • 442
  • 7
  • 19
0
votes
1 answer

Why am I getting a segmentation fault (core dumped) in systemC?

I can't figure out why I'm getting segmentation fault in systemC. I have no clue why I'm getting those errors. Maybe it has something to do with how I'm calling the functions? The server has three processes: Receive, update, and transmit. A server…
Yash Jain
  • 442
  • 7
  • 19
0
votes
1 answer

can't understand systemc '<<' operation

im looking 'risc-cpu' code which is in systemc library(specifically 'example' folder) but i can't understand what << operation in main.cpp is. in main.cpp they instantiate each module and do << operation with many sc_signal variable. i think it's…
이승수
  • 9
  • 3
0
votes
2 answers

SystemC cannot use "+" "-" operators in visual studio 2019

enter image description here I am trying to build the counter, when the "dec1" signal is high, the 8-bit unsign integer counter will decrese by 1. I am using visual sidio 2019 to complie the counter.cpp file, and "Hello worlds" .cpp is successful to…
Lu Cao
  • 1
  • 1
0
votes
1 answer

Delay in bitvector Output assignment

I am a beginner in SystemC, and I really need your help in solving a timing issue. Please find the stimuli.h code below, SC_MODULE(datagen) { public: sc_out> busin_o; SC_CTOR(datagen); /*private:*/ void…
Kishore
  • 11
  • 2
0
votes
1 answer

Automatic warning on fixed point overflow in SystemC

Is there a way i can enable an automatic warning for my SystemC simulation whenever a fixed point variable overflows? I already discovered the overflow_flag() function, but that one have to be check manually for every time i write to a signal in my…
Matombo
  • 77
  • 1
  • 9
0
votes
1 answer

Is it possible to bind the output of a submodule to two different output ports?

I am trying to make a circuit which computes the carries for an addition. In this piece of code, I would like to connect the output port rOut of the submodule pg to two output ports (rOut and carries[0]) of the parent module, so both get the same…
Clematrics
  • 15
  • 8
0
votes
1 answer

Is there a simple systemc channel with a blocking write and read function?

I'm looking for a simple channel to use in system-c between sc_modules for the purpose of hardware modelling. The functionality I'm looking for is basically an sc_fifo with size 0. A write should be blocking until the other side does a read. And a…
0
votes
1 answer

Port not bound SystemC (E112)

I am trying to implement a producer (master) speaking to a memory element (slave) through the memory controller (which implements the interface simple_mem_interface). Note: Some functions details and include statements are not fully mentioned in the…
Jack
  • 31
  • 4
0
votes
1 answer

I want to make instance with array in SystemC

I want to make instance with array in SystemC. I want to write as follows: module name = new module[10]; or for(int i = 0; i < 10; i++){ module name[i]("any names") } However, I did this, the compiler said: error: no matching function for call…
Hero
  • 3
  • 1
0
votes
1 answer

One clock cycle delay in communication between one SC_CTHREAD and another SC_CTHREAD

I am trying to model a simple direct mapped cache with main memory module which is an sc_cthread and a main memory state machine which also an SC_CTHREAD. I am observing one clock cycle delay from writing to a signal from my main memory module and…
Dan
  • 3
  • 2