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

Writing the main program of a D flip-flop

I'm new to systemC programming i'm writing a D flip-flop but i couldn't find a way to write the main program and to enter signals (din , clock and dout in my case) : this is my code : #include "systemc.h" SC_MODULE(d_ff) { // on déclare le…
Amira Manai
  • 2,599
  • 8
  • 40
  • 60
-1
votes
1 answer

SystemC on MAC m1 with Vscode: Undefined symbols for architecture arm64

I am building systemC environment in Mac m1. I finished the whole process of systemC build and check and installation. All example cases passed in command line. However, when I tried to integrate the env into vscode per…
David Peng
  • 135
  • 9
-1
votes
1 answer

I'm trying to simulate 3 LED's with 2 switches using systemc

With 2 switches s1,s2 and 3 Lights l1 l2 l3. pressing s1 or s2 should switch on l1. Next step if I press s1, l1(off) and l2(on) or if I press s2, l1(off) and l3(on). Final state is on press of any switch the light which is on will be off and we are…
Itsme
  • 59
  • 6
-1
votes
1 answer

How to determine which port has invoked an sc_thread if the thread is sensitive to multiple ports in SystemC?

I have a thread which is sensitive to an array of ports. In this thread I want to find out which port had triggered this thread so that i can read the value of that port? Is there a way to determine this? Example code given below. What should be the…
jevita
  • 1
  • 3
-1
votes
1 answer

How to simulate output delay using sc_method but without using next_trigger() in SystemC?

SC_MODULE(example) { sc_in < int > a, b; sc_in < int > out Void process() { // Output delay implement here } SC_CTOR(example) { SC_METHOD(process); sensitivity << a << b; } };
anu ch
  • 1
-1
votes
1 answer

Error: (E107) bind interface to port failed: type mismatch on port 4 of module `simple_instance.data_in_reg'

i want to read bus in register_out and write to bus in register_in but i get type mismatch error on port4 of register_in Register.hpp file #pragma once #include #include"bus.hpp" class Register:public sc_module{ private: …
-1
votes
1 answer

SystemC undefined Symbol for architecture x86_64

I'm trying to run SystemC on XCode on mac (using the standard Clang compiler). Depending on the language dialect, I get different error messages. If I use C++14, I get the error No member named 'experimental' in namespace 'std' If I use the standard…
Schottky
  • 1,549
  • 1
  • 4
  • 19
-1
votes
2 answers

Verilog behavior of IF statement with invalid value in condition

If IF-statement in Verilog has invalid value in condition, only else branch is evaluated. (In simulation.) For example below in module SimpleIfStatement2b if a = 1'bx: b=0'b1 I was searching in Vegilog-2005 standard for this behavior and and can not…
Nic30g
  • 659
  • 6
  • 15
-1
votes
1 answer

SystemC Make Errors: Type Mismatch Member Assignment

Hello I am seeing some errors in my attempts to make a basic SystemC project. It looks like a slight mismatch of types, but I am not familiar enough with the types from the SystemC library to really know what the issue is. I have more or less taken…
John Frye
  • 255
  • 6
  • 22
-1
votes
2 answers

Function EVP_aes_256_ctr not found when compiling with OpenSSL on a Mac

I've been trying to compile some files using the "make" command on a directory. However, I keep getting this error: Sammys-MacBook-Pro:p1 AlphaMale$ make gcc -L/usr/local/lib/ -o kem-enc ske.o rsa.o kem-enc.o prf.o -lcrypto -lssl -lgmp Undefined…
Alpha sam
  • 11
  • 2
-1
votes
2 answers

UVM-SystemC example run script not working

I've developed a perl script to run UVM-SystemC example codes. #!/usr/bin/perl use warnings; use strict; sub main(); my $CLIBS = "\$SYSTEMC_HOME/lib-linux64"; my $UVMCLIBS = "\$UVMSYSTEMC_HOME/lib-linux64"; my $CINC =…
MayurKubavat
  • 341
  • 4
  • 10
-1
votes
1 answer

systemC : sc_time_stamp() comparing with an other variable

I have a problem with usinf sc_time_stamp() I want to do an operation (write the sentence below) just at the time = 20 so: 1t1 = sc_time_stamp(); if (t1.to_string() == "20" ) { cout<<"Current time is "<< t1 << endl; }1 but it does not work.
-1
votes
1 answer

C++/SystemC: Returning a specific range of values from an array in C++

Here's what I am trying. I have passed a structure to a function. In the function I store the values of structure in an array. While returning I want to send in only those values which are defined in the array based on a specific criteria. For…
Harish
  • 3
  • 3
-1
votes
2 answers

Code example for a TLM fifo

I am new to TLM. Someone can give me an example code for connecting two processes by a TLM fifo? Thank you
slayra
  • 106
  • 2
  • 9
-2
votes
0 answers

Error: Output file ./.noxim_explorer.tmp corrupted, Access Noxim

I am using SystemC and 3d-Network-on-chip simulator called "Access Noxim" I am getting error when i run ./noxim_explorer sim.cfg enter image description here the error cure when i modified the routing in sim.cfg file to tdar, whereas another routing…
1 2 3
18
19