Jump to content


  • Content Count

  • Joined

  • Last visited

  • Days Won


Everything posted by AmeyaVS

  1. Hello @wasim6691, With the current implementation of the SystemC library available on the Accellera website, once the simulation has been started using sc_start you cannot dynamically change the number of modules instantiated. I would once again refer the comment from @maehne, that you need to get your basics right for SystemC before continuing further on your project. Regards, Ameya Vikram Singh
  2. Hello @Ganesan R, What are the possible values of m and n?(It seems to take default value of 0) For array of SystemC objects there is a construct available for such purposes: sc_vector. Try search here in the forums to find the necessary discussions. e.g.: http://forums.accellera.org/topic/5775-vector-of-modules-errors/?tab=comments#comment-14006 Hope it helps. Regards, Ameya Vikram Singh
  3. Hello @ANKUR SAINI, You can find a snippet of build script for SystemC library installation here: https://github.com/AmeyaVS/SystemC_ramblings/blob/master/resources/build.sh Note: You will need CMake and a C++11 enabled compiler for building the SystemC library with the script provided above. Let me know if it helps. Regards, Ameya Vikram Singh
  4. Hello @shanh, What compiler version are you using? Can you share the build verbose logs? Best Regards, Ameya Vikram Singh
  5. Hello @shanh, When you are linking your application/library to SystemC library you need to specify the C++ standard flags: // For G++ C++11 g++ -std=c++11 // For G++ C++14 g++ -std=c++14 You add these options to the build system configuration options for your application/library build. Regards, Ameya Vikram Singh
  6. Hello @Philipp A Hartmann, Following is my testing development environment: Platform: Cygwin 64-Bit GCC Version: 6.4.0-5 And I have attached the verbose logs for build. I tried your suggestions for wrapping the specialization of the cci_value_converter class with the CCI namespace in the ex16_User_Defined_Data_Type and it seems to fix the issue. Also for the ex07_Parameter_Information example the following patch fixes the issue currently on Cygwin 64-bit. diff --git a/examples/ex07_Parameter_Information/ex07_Parameter_Information.cpp b/examples/ex07_Parameter_Information/ex07_Parameter_Information.cpp index 1326be0..46fa307 100644 --- a/examples/ex07_Parameter_Information/ex07_Parameter_Information.cpp +++ b/examples/ex07_Parameter_Information/ex07_Parameter_Information.cpp @@ -106,7 +106,7 @@ int sc_main(int sc_argc, char* sc_argv[]) { ex07_observer observer_class("observer"); // Simulation time - sc_core::sc_start(30.0, sc_core::SC_NS); + ::sc_core::sc_start(30.0, sc_core::SC_NS); return EXIT_SUCCESS; } // End of sc_main diff --git a/examples/ex16_User_Defined_Data_Type/ex16_user_datatype.h b/examples/ex16_User_Defined_Data_Type/ex16_user_datatype.h index 471fe41..6ec2cc8 100644 --- a/examples/ex16_User_Defined_Data_Type/ex16_user_datatype.h +++ b/examples/ex16_User_Defined_Data_Type/ex16_user_datatype.h @@ -76,8 +76,9 @@ struct route_table_ut { }; // add support for cci_value and JSON (de)serialization +CCI_OPEN_NAMESPACE_ template<> -struct cci::cci_value_converter< route_table_ut > +struct cci_value_converter< route_table_ut > { typedef route_table_ut type; static bool pack( cci_value::reference dst, type const & src ) @@ -105,6 +106,7 @@ struct cci::cci_value_converter< route_table_ut > return false; } }; +CCI_CLOSE_NAMESPACE_ // Overload stream insertion operator of C++ std::ostream& operator <<(std::ostream& os, const route_table_ut& ud) You can also have a look into the verify logs after introducing these fixes. I will also try to build and test on other environments and provide other feedback for the CCI release. Thanks and Regards, Ameya Vikram Singh verifyVerboseLogs.tar.xz verifyFixedLogs.tar.xz Update: Only for the ex16_User_Defined_Data_Type I need to make changes on Linux 64-Bit with g++(5.4.0 C++11 enabled).
  7. Hi, I tried using the SystemC CCI draft release.(cci-0.9.0_pub_rev_20171219.tgz) Currently the following examples fail to compile: ex07_Parameter_Information ex16_User_Defined_Data_Type Please find the failure logs attached. I have also noticed that the CCI source contains systemc.h (src/cci_core/systemc.h)header file, from a cursory look it looks as if a wrapper around the header file (systemc) from SystemC library. Would it cause build issues when using SystemC CCI with legacy models which includes the systemc.h header file? Thanks and Regards, Ameya Vikram Singh verifyLogs.tar.xz
  8. Hello @fdoucet, What your are trying to do here in this specific scenario is known as dynamic sensitivity. Dynamic sensitivity replaces the default sensitivity of the registered SystemC process, once the event it triggered the default sensitivity would be restored for the corresponding process. Here is a reference to the discussion before in this forum: http://forums.accellera.org/topic/1210-static-and-dynamic-sensitivity/ Hope it helps Regards, Ameya Vikram Singh
  9. Hello @wasim6691, I totally agree with @David Black, Can you provide a minimal example of what your are trying to achieve? From your minimal description all I could figure out are the following scenarios: You are not generating enough transactions/events in your simulation models and the simulation is exiting with the error message: Stopping simulation due to starvation You are yourself stopping the simulation with a call to sc_stop() before the next iteration can begin. Post more details about the issue you are facing so that more community members can help you figure it out faster. Regards, Ameya Vikram Singh
  10. Hello @Ganesan R, Since it is usual C++ code. You just need to define it as in C++. For e.g.: #include "NAME.h" SC_HAS_PROCESS(NAME); NAME::NAME(sc_core::sc_module_name nm) //< Added sc_core namespace resolution. : sc_core::sc_module(nm) //< Added sc_core namespace resolution. {} ////////////////////////////// // Check below ///////////////////////////// NAME::~NAME() { // You Destructor body } Hope it helps. Regards, Ameya Vikram Singh
  11. Hi @wasim6691, Here is a small set of questions if you can provide some answers it would be helpful: Can you provide details about the development environment?(Linux/Windows) How are you setting up the stack size? Can you modify your code to use dynamically allocated array just for the sake of modelling? Regards, Ameya Vikram Singh
  12. Hello @Matthias Jung, Can you post the version of the g++ compiler? Also using the bash shell of the MinGW environment post the output of the following command: # Note provide the full path to SystemC static library nm -C <full_path_to_libsystemc.a> | grep sc_api_version Regards, Ameya Vikram Singh
  13. Hi @Matthias Jung, You should use cmake generator provided from MinGW package manager. In-case you are using the version from CMake official release then you would need to add the MinGW utilities to the system PATH environment variable. set MINGW_HOME=<PATH to MINGWROOT> set PATH=%PATH%:%MINGW_HOME%/bin # Check if you have make available on the cmd.exe make --version # Check if gcc/g++ is available on the cmd.exe gcc --version g++ --version # Configure CMake to use the make file generator on the configuer step in SystemC build directory. cmake -G "MinGW Makefiles" -DCMAKE_EXPORT_COMPILE_COMMANDS=ON .. # or in-case the previous one doesn't work. cmake -G "MSYS Makefiles" -DCMAKE_EXPORT_COMPILE_COMMANDS=ON .. Note: To find the list of supported generator from CMake you can use this command: cmake -G --help Update: Here is the official documentation on the CMake Makefile Generator: https://cmake.org/cmake/help/latest/generator/MinGW Makefiles.html#generator:MinGW Makefiles Regards, Ameya Vikram Singh
  14. Hello @Matthias Jung, It seems you are missing some of the compiler definition flags for the build: -DSC_BUILD ... etc. You can get the set of compiler flags for the SystemC library from the CMake generator(Only works with Makefile generator). # Using CMake to create compile_commands.json # SYSTEMC_SRC: SystemC source directory. cd $<SYSTEMC_SRC> # Create a build directory mkdir build cd build # Run CMake configuration for Make file generator. cmake -DCMAKE_EXPORT_COMPILE_COMMANDS=ON .. Note: Also the quick thread library for user space thread support will not work on Windows since it is compatible only on Linux systems. Regards, Ameya Vikram Singh
  15. Hello @Uzmeed, You are assigning multiple values in the PS_reg in the same delta cycle in SC_METHOD. It is better that you refer for SystemC LRM (refer: here) sections: 5.2.9, 5.2.10, 5.2.11 specifically to know about the differences in different processes in SystemC. Regards, Ameya Vikram Singh
  16. What is the type of cmd_t in cmd.h line 6? Regards, Ameya Vikram Singh
  17. Hello @Uzmeed, I cannot really know what you are doing here (main.cpp line 9) without the source code. Do you really need to use such a heavy weight tool (Vivado HLS) for exploration? I would recommend that you first try to use the basic tools for developing SystemC models (some of them listed here): C++ Compiler/Debugger: GCC, Clang and MSVC. SystemC proof of concept simulation code: http://www.accellera.org/downloads/standards/systemc Then move onto to the tools when you have mastered the basics. Regards, Ameya Vikram Singh
  18. Hello @Uzmeed, In you attachements you are missing the header file: file.h Which seems to re-declare: enum state class cmd You are also missing the include guard in your arith.h and cmd.h header file. You can see the possible solution here: //////////////////////////// // Observe these added lines #ifndef ARITH_H_ #define ARITH_H_ //////////////////////////// #include "systemc.h" #include "file.h" SC_MODULE(arith){ sc_port<sc_fifo_in_if<cmd> > data_in; sc_port<sc_fifo_out_if<cmd> > data_out; sc_fifo<cmd> result_buffer; void write_result (cmd&, sc_int<64>&); void return_proc(); void arith_proc(); SC_CTOR(arith) { SC_THREAD(return_proc); SC_THREAD(arith_proc); } }; //////////////////////////// // Observe these added lines #endif // ARITH_H_ //////////////////////////// I think you should probably start by learning C++, you can find excellent tutorials online (some of them mentioned below): C++ Standard Tutorials http://www.cplusplus.com/ Regards, Ameya Vikram Singh
  19. 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
  20. 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
  21. 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
  22. 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
  23. 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
  24. 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
  25. 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
  • Create New...