Jump to content


  • Content count

  • Joined

  • Last visited

  • Days Won


AmeyaVS last won the day on November 23

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

655 profile views
  1. makefile SystemC

    Hello @olá, Can you post some details of what you have tried till now? Have your tried searching for Makefile tutorials? I would recommend using CMake for creating SystemC projects as it would provide you the best possible support for cross-platform development. Regards, Ameya Vikram Singh
  2. Hello @Edward1110, Firstly why are you trying to compile a header file with missing definition of the method "pc_main". Can you post the exact error log that you get from the console output while running the command?(Use the code block to post the console output.) Here is the output from the command on my system:(Kindly Note I am using CMake to build the SystemC library.) // Command executed: // $ g++ -I. -I$SYSTEMC_HOME/include -L. -L$SYSTEMC_HOME/lib -Wl,-rpath=$SYSTEMC_HOME/lib -o hello pc.h -lsystemc -lm pc.h:10:19: error: ‘jump_addr’ was not declared in this scope sc_in<sc_lv<12>> jump_addr; ^ pc.h:10:19: error: template argument 1 is invalid pc.h:10:8: error: template argument 1 is invalid sc_in<sc_lv<12>> jump_addr; ^ pc.h:11:19: error: ‘branch_length’ was not declared in this scope sc_in<sc_bv<12>> branch_length; ^ pc.h:11:19: error: template argument 1 is invalid pc.h:11:8: error: template argument 1 is invalid sc_in<sc_bv<12>> branch_length; ^ pc.h:13:20: error: ‘pc_o’ was not declared in this scope sc_out<sc_bv<12>> pc_o; ^ pc.h:13:20: error: template argument 1 is invalid pc.h:13:9: error: template argument 1 is invalid sc_out<sc_bv<12>> pc_o; Note: Beggining SystemC-2.3.2 release now it is mandatory to provide the C++ compiler standard flag for compiling the SystemC model code. // Command Executed //////////////////////////////////////////// // Notice the -std=c++11 compiler flag. // $ g++ -I. -I$SYSTEMC_HOME/include -L. -L$SYSTEMC_HOME/lib -Wl,-rpath=$SYSTEMC_HOME/lib -std=c++11 -o hello pc.h -lsystemc -lm /home/ameya/apps/systemc-2.3.2/lib/libsystemc.so: undefined reference to `sc_main' collect2: error: ld returned 1 exit status If you need some demo example on how to use the CMake for building SystemC project you can look into the SystemC examples folder or for much simple example here. Let me know if this helps. Regards, Ameya Vikram Singh
  3. Hello @enchanter, After looking into the sources of the UVM-SystemC draft release available here. In the following file under: src/uvmsc/base/uvm_root.cpp, line number 150. Internally the UVM-SystemC class calls the sc_start() function without any parameter to actually kick start the SystemC simulation. Which executes the simulation till events are generated and queued, in your case with clocks the events would always be generated. You could create your own function which reproduces the same behavior in the run_test() method of the uvm_root class, or better would be to extend the uvm_root class to suite your needs. Here is the code snippet from the UVM-SytemC sources: // File: src/uvmsc/base/uvm_root.cpp // Line number: 127 void uvm_root::run_test( const std::string& test_name ) { //disable SystemC messages sc_core::sc_report_handler::set_actions("/OSCI/SystemC", sc_core::SC_DO_NOTHING); // check and register test object m_register_test(test_name); // start objection mechanism fired as spawned process sc_process_handle m_init_objections_proc = sc_spawn(sc_bind(&uvm_objection::m_init_objections), "m_init_objections_proc"); uvm_phase::m_register_phases(); phases_registered = true; // call build and connect phase uvm_phase::m_prerun_phases(); // start simulation (of run-phases) here. try { ///////////////////////////////// sc_core::sc_start(); //<<<<<<< Run simulation forever or until events exists. } //////////////////////////////// catch( const std::exception& e ) { std::cerr << e.what() << std::endl; exit(1); // TODO exit program with error code? } // TODO: move post-run phases to here? Currently they are part of the simulation if (m_finish_on_completion) sc_core::sc_stop(); } Hope this helps. Thanks and Regards, Ameya Vikram Singh
  4. Hello @enchanter, Can you try using sc_start with some appropriate time-period? Update: with sc_clock e.g.: // Run the simulation till 100 seconds. sc_start(100, SC_SEC); // Stop the simulation. sc_stop(); Disclaimer: Currently I do-not have experience much with UVM-SystemC. Regards, Ameya Vikram Singh
  5. Hello @rayzekus, Thank you for the update. It's a personal preference in my judgement, but I work on most compilers(GCC, Clang, MSVC, etc.) Regarding using G++ on Cygwin has it's own problems of performance hit due to emulating the Linux/POSIX environment. Regards, Ameya Vikram Singh
  6. problems regresson tests

    Hello @olá, Currently the library built with Cygwin is not directly compatible with the Visual Studio setup. You can build the SystemC library using CMake and Visual Studio Compiler like this: // extract the systemc library //////////////////////////////////////// // vvvvvvvvvvv Important vvvvvvvvvvvvvvvv // open the Visual Studio Command Prompt. // Ensure you have CMake installed and in the PATH environment variable. ///////////////////////////////////////// // cd to systemc library extracted location. // Create a build directory mkdir build // Change into the build directory. cd build // Run CMake configuration // Check the CMake documentation for the Correct Visual Studio Generator Value. cmake -G "Visual Studio 14 2015 Win64" .. // Run the build cmake --build . --config Debug // Open the SystemCLanguage.sln file in the Visual Studio chosen previously. Note: In-case you are completely developing in Cygwin environment you can follow the same steps to build SystemC library and run the regression suite as in a Linux environment. You need to enable pthreads in the SystemC configuration, since the QuickThreads implementation is currently broken in Cygwin 64-bit environment. Best Regards, Ameya Vikram Singh
  7. Hello @rayzekus, I tried your source code with slight modifications(no functional changes) on Linux and it is working as it is. I think due to the nature of Cygwin Environment which creates a emulated POSIX layer is not fully compliant. Even I have faced similar issue regarding random function but it was sometime back and I had then moved onto using other random number generator. Just a quick question about the SystemC library configuration did you enable the "pthreads" option for compiling on Cygwin? Best Regards, Ameya Vikram Singh
  8. Hi @rayzekus, Can you post details about your build environment? (e.g: Which OS and Which Compiler and also the configuration used to Create SystemC library) As per the info available here. It looks like the data race condition is getting triggered. I would not trust the libraries when utilizing any C based API's from C++. I also tried your code locally on my system, and even I am getting the random number generated. Also you are missing the following headers in your files: // In File sc_main.cpp // For srand declaration. #include <cstdlib> // For time() #include <ctime> // In file foo_drvr.h // For rand() function. #include <cstdilb> I would suggest you look into another random number generator such as boost::random, or if you are on Linux System you can also look into /dev/random or /dev/urandom files which are used for these purposes. Best Regards, Ameya VIkram Singh
  9. Execution Trace Generation

    Hello @R.Adiga, I have developed something similar you can have a look here: https://github.com/AmeyaVS/trace-ninja (Still under development but basic functionality implemented for getting traces). If you are developing on Linux I would suggest of having a look here: https://github.com/namhyung/uftrace , which offers much better tracing capabilities and lower latencies. Both the methodologies are dependent on using GCC toolchain for building the SystemC library. The only advantage you get on using my project is that it would work under Cygwin/Windows with GCC compiler (Not tested under MinGW). Regards, Ameya Vikram Singh
  10. Temporal Decoupling

    Hi @darshanKM, This is a discussion forum, not your homework/assignment discussion platform. It would be better if you could show what you came up with and discuss anything that you are not able to understand. I would recommend exploring the SystemC documentation directory(i.e. docs directory when you would have installed the SystemC library or when you downloaded the SystemC library sources.). Regards, Ameya Vikram Singh
  11. systemC design

    Hello @yosri ben salah, As far as my experience is OpenCV image processing algorithms cannot be directly translated to synthesized design. It would involve manual translation of the algorithms in it's current form, but the work is progressing as mentioned here about utilizing the FPGA's. Regards, Ameya Vikram Singh
  12. Hi @Roman Popov, It is quite possible to have multiple installations of SystemC library. This is what I have in my development environment setup: # SystemC debug installation directory. $HOME/apps/systemc-2.3.1a_debug # SystemC release installation directory. $HOME/apps/systemc-2.3.1a_release I currently use a shell script to switch between the environments but it is quite easy to add the condition in CMakeLists.txt/FindSystemCLanguage.cmake script to support such behaviour. Regards, Ameya Vikram Singh
  13. How to define a FIFO of custom structure

    Hello @katang, You need to declare the method as a friend method and the definition has to be moved to corresponding source file. For e.g.: // scMWE.h #ifndef scMWE_h #define scMWE_h #include <systemc> #include <iostream> struct Transfer_Type { int Select; int Content; friend std::ostream& operator << (std::ostream& os, const Transfer_Type& I); //< Declaration for the friend method. }; SC_MODULE(scMWE) { scMWE(sc_core::sc_module_name nm); sc_core::sc_fifo<Transfer_Type> from; }; #endif scMwe.cpp: // scMWE.cpp #include "scMWE.h" // Definition for the friend method. std::ostream& operator << (std::ostream& os, const Transfer_Type& I) { return os; } Hope it helps. Regards, Ameya Vikram Singh
  14. Hello @katang, Can you provide the minimal code which reproduces this behaviour? Regards, Ameya Vikram Singh
  15. systemC

    @yosri ben salah, Unable to open the attachment. Kindly provide the necessary context for the attachment. What exactly is it providing for this discussion? Regards, Ameya Vikram Singh