Jump to content


  • Content count

  • Joined

  • Last visited

  • Days Won


AmeyaVS last won the day on June 1

AmeyaVS had the most liked content!


About AmeyaVS

  • Rank
    Advanced Member
  • Birthday 02/28/1989

Contact Methods

  • Skype

Profile Information

  • Gender
    Not Telling
  • Location

Recent Profile Visitors

1,156 profile views
  1. AmeyaVS

    VCD dump with Hierarchy systemc-2.3.2

    Hello @kjhyland, While adding signals using sc_trace did you provide the hierarchical names of the signals? Best Regards, Ameya Vikram Singh
  2. AmeyaVS

    make check return fail

    Hello @LookBad, Sorry, I don't have a macOS environment readily available with me. Maybe someone else might be able to help you with that, or better would be if you could use a Linux VM for exploration. Regards, Ameya Vikram Singh
  3. AmeyaVS

    How to update the signal writing with same value

    Hello @SANDESH M K, You are probably looking for sc_buffer<T>. sc_buffer will generate the event notification for every write performed. Hope it helps. Regards, Ameya Vikram Singh
  4. AmeyaVS

    make check return fail

    Hello @LookBad, Can you provide some environment details? e.g.: OS, Compiler version etc. Regards, Ameya Vikram Singh
  5. Hello @YashJ, It is expected behavior. Here is a brief explanation: //... // Find the inline comments: while(true){ wait(); //< Wait for default event sensitivty(static sensitive event!). In you case it is in.value_changed() cout<<"\nIN = "<<in.read()<<" TIME" <<sc_time_stamp()<<endl; inter.write(in.read()); //< Write to the inter signal -> which means schedule and event for updating the sc_signal. cout<<"\nInter before wait= "<<inter.read()<<endl; wait(10,SC_NS); //< Relinquish control to the SystemC scheduler -> perform evaluate and update phase for all event scheduled. (Change sensitivity to dynamic scheduled after 10 ns) out.write(inter.read()); //< inter has the new value assigned at 3 lines before this statement. cout<<"\nInter after wait= "<<inter.read()<<endl; cout<<"\nOUT = "<<out.read()<<" TIME" <<sc_time_stamp()<<endl; cout<<"\nIN when outed = "<<in.read()<<endl; } ///.... Hope it helps. Regards, Ameya Vikram Singh
  6. AmeyaVS

    SystemC basic tutorial and examples

    Hello @ajinkya_bankar, Can you let us know what all have you tried? and also, what is it you are looking at SystemC for RTL design or high-level modelling? Most of the examples though dated, require minimal changes to be fully functional, and you can quickly update them to Did you look at examples directory within the SystemC open source implementation available here. If you looking at SystemC RTL design then probably this book: SystemC Primer would be good though also a bit dated. In-case you are looking for using SystemC for high-level modelling your a find these references to be quite useful: SystemC: From Ground Up (Second Edition) SystemC Language Reference Manual(LRM) Hope these resources help. Regards, Ameya Vikram Singh
  7. Hello @sumit_tuwien, You can turn off the G++ extensions using the CMake command-line option: # Enable C++11 compilation flag # -DCMAKE_CXX_STANDARD=11 # Disable C++ Compiler Extensions # -DCMAKE_CXX_EXTENSIONS=OFF cmake -DCMAKE_CXX_STANDARD=11 -DCMAKE_CXX_EXTENSIONS=OFF -DCMAKE_INSTALL_PREFIX=<Path to install location> .. You can find a reference here. Can you also list the version and platform information of the tools you are using (clang, CMake, etc.)? Hope it helps. Regards, Ameya Vikram Singh
  8. AmeyaVS

    fifo example

    Hello @veeresh k, There are multiple issues in the sample code provided by you. Here are the heavily modified version: // main.cpp #include<systemc> //< Notice not systemc.h #include"head1.h" #include"head2.h" int sc_main(int argc, char* argv[]) { sc_core::sc_fifo<int> fifo(10); //< sc_core namespace specifier writer w("writer"); reader r("reader"); w.out(fifo); r.in(fifo); sc_start(1000, sc_core::SC_NS); //< Run simulation for a limited time since no stopping condition are provided upfront. Also time is also specified in sc_core namespace. return 0; } //head1.h // Notice the HEADER GUARD #ifndef HEAD1_H_ #define HEAD1_H_ // Changed the header file to systemc instead of systemc.h #include<systemc> SC_MODULE(reader) { // sc_fifo_in_if is a abstract class from which you cannot create an object. // sc_fifo_in is derived from the above class which actually implements the read method. sc_core::sc_fifo_in<int> in; void roperation() { int val; while (true) { wait(10, sc_core::SC_NS); // Time unit is defined in sc_core namespace. for (int i = 0; i <= 15; i++) { in.read(val); std::cout << val << std::endl; //< when using the systemc header you need to specify the std namespace. // Or you can use the statement after including all the header files: // using namespace std } } std::cout << "Availaible : " << in.num_available() << std::endl; //< Instead of num available it is num_available //< when using the systemc header you need to specify the std namespace. // Or you can use the statement after including all the header files: // using namespace std } SC_CTOR(reader) //< Your code mentions here writer the constructor name should be same as the class name. { SC_THREAD(roperation); //< Your code mentions woperation } }; #endif // HEAD1_H_ //head2.h // Refer the head1.h for similar details #ifndef HEAD2_H_ #define HEAD2_H_ #include<systemc> SC_MODULE(writer) { // Refer the head1.h for similar details sc_core::sc_fifo_out<int> out; void woperation() { int val = 0; while (true) { wait(10, sc_core::SC_NS); for (int i = 0; i <= 20; i++) { out.write(val++); } } } SC_CTOR(writer) { SC_THREAD(woperation); } }; #endif // HEAD2_H_ Here is a minimal makefile for building the example: CC=gcc CXX=g++ CXX_FLAGS= -g3 -Wall -c all: main.exe main.exe: main.o ${CXX} $< -o $@ -L${SYSTEMC_HOME}/lib-linux64 -L${SYSTEMC_HOME}/lib -lsystemc main.o: main.cpp head1.h head2.h ${CXX} ${CXX_FLAGS} -I${SYSTEMC_HOME}/include -o $@ $< clean: rm -rf main.o main.exe Note: For reference of the sc_fifo_in/out_if classes see here. For more details you can also refer to the SystemC LRM. Hope it helps. Regards, Ameya Vikram Singh
  9. AmeyaVS

    Systemc 2.3.2 Changes

    Hello @sumit_tuwien, You can find the necessary details from the SystemC sources. You can look into these files for more details: RELEASENOTES README NOTICE You can also compare the RELEASENOTES from previous releases. Regards, Ameya Vikram Singh
  10. Hello @vasu_c, Can you let us know what platform you are using for the AArch64 build? and also, if possible the ABI specifications of the GCC compiler as well? Thanks and Regards, Ameya Vikram Singh
  11. AmeyaVS

    clock generation in system c

    Hello @veeresh k, This example does not have a dedicated clock generator. // These statements are what driving the clock signal to with High time of 1 ns and low time of 1 ns. for (i=0;i<10;i++) { clock = 0; sc_start(1, SC_NS);// Run simulation for 1 ns. clock = 1; sc_start(1, SC_NS);// Run simulation for 1 ns. } What message you receive from the SystemC kernel refers to the timescale of 1 ps e.g.: Info: (I702) default timescale unit used for tracing: 1 ps You can get the SystemC API documentation for the sc_clock from here: SystemC sc_clock api reference. If you need a sample you can find a use-case reference here(though a little bit-dated): https://github.com/AmeyaVS/SystemC_ramblings/blob/ff1a111063842bfcd6f5de6bb3db74917dc6331c/src/03_fir/firsytemmain.cpp#L26 Hope it helps. Regards, Ameya Vikram Singh
  12. AmeyaVS

    How to create an array of sc_module objects

    Hello @Ganesan R, It seems you are trying to achieve the vector of vector instance, something like this: sc_vector < sc_vector < your module > > You can find necessary discussion on this here: http://forums.accellera.org/topic/5616-initialization-of-nested-sc_vector-sc_vector/ Without sample code it is very difficult to discern the scenario you are trying to replicate. Can you provide some minimal sample code? Regards, Ameya Vikram Singh
  13. Hi, It seems I have hit a bug in VCD tracing implementation in SystemC release 2.3.2. Here is the bracktrace captured in GDB: (minimal example available here: https://github.com/AmeyaVS/SystemC_ramblings/tree/dev) as one can observe the exception: SIGFPE in systemc-2.3.2/src/sysc/tracing/sc_trace_file_base.cpp:268 due to divide by zero error. GNU gdb (Ubuntu 8.1-0ubuntu3) Copyright (C) 2018 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html> This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details. This GDB was configured as "x86_64-linux-gnu". Type "show configuration" for configuration details. For bug reporting instructions, please see: <http://www.gnu.org/software/gdb/bugs/>. Find the GDB manual and other documentation resources online at: <http://www.gnu.org/software/gdb/documentation/>. For help, type "help". Type "apropos word" to search for commands related to "word"... Reading symbols from /home/ameya/Documents/demo/SystemC_ramblings/src/02_adder/build/tests/AdderTest/AdderTest.run...done. (gdb) r Starting program: /home/ameya/Documents/demo/SystemC_ramblings/src/02_adder/build/tests/AdderTest/AdderTest.run [Thread debugging using libthread_db enabled] Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1". SystemC 2.3.2-Accellera --- May 1 2018 16:30:17 Copyright (c) 1996-2017 by all Contributors, ALL RIGHTS RESERVED At time 0 s :: (a, b, cin): 100 (sum, carry_out): 00 At time 0 s :: (a, b, cin): 010 (sum, carry_out): 00 At time 0 s :: (a, b, cin): 110 (sum, carry_out): 10 At time 0 s :: (a, b, cin): 001 (sum, carry_out): 10 At time 0 s :: (a, b, cin): 101 (sum, carry_out): 11 At time 0 s :: (a, b, cin): 011 (sum, carry_out): 10 At time 0 s :: (a, b, cin): 111 (sum, carry_out): 00 At time 0 s :: (a, b, cin): 111 (sum, carry_out): 01 Info: /OSCI/SystemC: Simulation stopped by user. Program received signal SIGFPE, Arithmetic exception. 0x00007ffff7b57799 in sc_core::sc_trace_file_base::timestamp_in_trace_units (this=this@entry=0x5555557a3730, high=@0x7fffffffc658: 93824994651128, low=@0x7fffffffc660: 140737488346560) at /home/ameya/apps/src/systemc/systemc-2.3.2/src/sysc/tracing/sc_trace_file_base.cpp:268 268 unit_type unit_divisor = trace_unit_fs / kernel_unit_fs; (gdb) bt #0 0x00007ffff7b57799 in sc_core::sc_trace_file_base::timestamp_in_trace_units (this=this@entry=0x5555557a3730, high=@0x7fffffffc658: 93824994651128, low=@0x7fffffffc660: 140737488346560) at /home/ameya/apps/src/systemc/systemc-2.3.2/src/sysc/tracing/sc_trace_file_base.cpp:268 #1 0x00007ffff7b5d8a2 in sc_core::vcd_trace_file::get_time_stamp (this=this@entry=0x5555557a3730, now_units_high=@0x7fffffffc658: 93824994651128, now_units_low=@0x7fffffffc660: 140737488346560) at /home/ameya/apps/src/systemc/systemc-2.3.2/src/sysc/tracing/sc_vcd_trace.cpp:2086 #2 0x00007ffff7b5e242 in sc_core::vcd_trace_file::~vcd_trace_file (this=0x5555557a3730, __in_chrg=<optimized out>) at /home/ameya/apps/src/systemc/systemc-2.3.2/src/sysc/tracing/sc_vcd_trace.cpp:2145 #3 0x00007ffff7b5e319 in sc_core::vcd_trace_file::~vcd_trace_file (this=0x5555557a3730, __in_chrg=<optimized out>) at /home/ameya/apps/src/systemc/systemc-2.3.2/src/sysc/tracing/sc_vcd_trace.cpp:2153 #4 0x000055555555cfc1 in sc_main (argc=1, argv=0x5555557a2bf0) at /home/ameya/Documents/demo/SystemC_ramblings/src/02_adder/tests/AdderTest/src/full_adder_main.cpp:37 #5 0x00007ffff7b32e24 in sc_core::sc_elab_and_sim (argc=1, argv=<optimized out>) at /home/ameya/apps/src/systemc/systemc-2.3.2/src/sysc/kernel/sc_main_main.cpp:87 #6 0x00007ffff7097b97 in __libc_start_main (main=0x7ffff7aa1fa0 <main(int, char**)>, argc=1, argv=0x7fffffffddb8, init=<optimized out>, fini=<optimized out>, rtld_fini=<optimized out>, stack_end=0x7fffffffdda8) at ../csu/libc-start.c:310 #7 0x000055555555c08a in _start () (gdb) I seems to happen only when the simulation time is not progressing. One can apply the below patch to branch (dev) available under here for the following sub-directory: https://github.com/AmeyaVS/SystemC_ramblings/tree/dev/src/02_adder diff --git a/src/02_adder/tests/AdderTest/src/driver.cpp b/src/02_adder/tests/AdderTest/src/driver.cpp index e70aea1..26169b7 100644 --- a/src/02_adder/tests/AdderTest/src/driver.cpp +++ b/src/02_adder/tests/AdderTest/src/driver.cpp @@ -7,8 +7,14 @@ void driver::prc_driver() { d_a = pattern[0]; d_b = pattern[1]; d_cin = pattern[2]; - wait(5, sc_core::SC_NS); + //wait(5, sc_core::SC_NS); + wait(sc_core::SC_ZERO_TIME); pattern++; + if (pattern == 0) { + break; + } } + wait(sc_core::SC_ZERO_TIME); + sc_core::sc_stop(); } This behavior is not reproduced in SystemC release 2.3.1a. I will try to debug further and hopefully with probable fix. Regards, Ameya Vikram Singh
  14. AmeyaVS

    SystemC _ what is mean symbol "\" ??

    Hello @Hook, The \ character is an escape sequence in C/C++. Here is a reference https://en.m.wikipedia.org/wiki/Escape_sequences_in_C I would recommend that you brush up your skills on C++ before continuing further. I would recommend the book "The C++ Programming Language Book by Bjarne Stroustrup". Hope it helps. Regards, Ameya Vikram Singh
  15. AmeyaVS

    wait in SC_CTOR()

    Hello @SystemCInDepth, The wait() call can only be used in SC_THREAD/SC_CTHREAD registered processes in SystemC library. You are trying to call wait even before the elaboration happens and you have started the simulation. It would be better if you could go through the book: SystemC from Ground Up by David Black to have a better understanding. Hope it helps. Regards, Ameya Vikram Singh