Jump to content

All Activity

This stream auto-updates     

  1. Yesterday
  2. Actually in my experience mixing various C++ standard levels is not advisable as they imply changes in libstdc++ which may lead to all sort of issues. So my general recomendation is to have the same setting in all libraries. Hence this general apporach. And conan_set_std() conan_set_std() will set the standard level to C++14 in this example.
  3. Last week
  4. First of all, thank you for the quick and effective help. To be frank, I found the conan approach attractive because otherwise it is rather tedious to start up a new project; I guess the same feeling triggered you to assemble and publish the package. My naive idea was that both myself when I assemble a new working environment as well as my users installing the package on their own system, will set up the system using conan (i.e. we do not need to hunt down the individual packages, sometimes finding version compatibility problems), and after that we can rely on the CMake environment as before. That is I do not need conan in the followings, but I need it heavily when I start up. So, the ideal would be not a "CMake only" (where I DO NEED to deal with the packages and their dependencies), and not a "conan only" (where I come out from the normal CMake environment) handling. I would prefer the combined way. Maybe you should have a look at the the package and devote a couple of sentences in the readme file to this aspect. I think that what you call "conan-only" version, meets my needs (except that in the section "Build the project (it will download the needed libraries) and run it:" after cmake .. a make shall also be inserted). I think it is a very useful contribution, especially for the beginners and non-professional developers. I think, however, that every single development must start immediately at the very beginning with testing; so it would be great to complete this contribution with a testing example. I would suggest to make one more update. In the conanfile.txt you say [options] SystemC:stdcxx=14 and in CMakeLists.txt set(CMAKE_CXX_STANDARD 14) set(CMAKE_CXX_STANDARD_REQUIRED ON) set(CMAKE_CXX_EXTENSIONS OFF) find_package(SystemC REQUIRED) if(SystemC_FOUND) As the SystemC (AFAIK) defaults standard to '98 and it can be set independently; it may make confusion if you use this makefile with another sources, compiled independently (library version mismatch). In my own sources I use set (CMAKE_CXX_STANDARD ${SystemC_CXX_STANDARD} CACHE STRING "C++ standard to build all targets. Supported values are 98, 11, and 14.") of course after find_package(SystemCLanguage CONFIG REQUIRED) I think this can prevent some potential questions and bugs. (BTW: SystemC or SystemClanguage is the preferred utilization)
  5. Actually you need to add the library dirs to your cmake target liek this: link_directories(${CONAN_LIB_DIRS_GTEST}) add_executable(TransactionExample main.cpp) target_link_libraries(TransactionExample ${CONAN_LIBS}) Since the CMake setup in the example project is not 'conan only' things are a bit different (it can also be used with SYSTEMC_HOME env variable). If you rely entirely on conan you could simplify the CMakeLists.txt to cmake_minimum_required(VERSION 3.3) set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/cmake) include(Conan) project(TransactionExample CXX) setup_conan() conan_set_std() conan_global_flags() add_executable(TransactionExample main.cpp) conan_target_link_libraries(TransactionExample) I updated the README in the Quickstart Project accordingly
  6. Well, up to that point is everything fine. In the next step I attempt to add gtest using line gtest/1.8.1@bincrafters/stable The message is $ make [ 50%] Linking CXX executable bin/TransactionExample /usr/bin/ld: cannot find -lgmock_maind /usr/bin/ld: cannot find -lgmockd /usr/bin/ld: cannot find -lgtestd collect2: error: ld returned 1 exit status CMakeFiles/TransactionExample.dir/build.make:94: recipe for target 'bin/TransactionExample' failed make[2]: *** [bin/TransactionExample] Error 1 CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/TransactionExample.dir/all' failed make[1]: *** [CMakeFiles/TransactionExample.dir/all] Error 2 Makefile:83: recipe for target 'all' failed make: *** [all] Error 2 well, I understood that gmock is missing, but AFAIN since 1.8.0 it should come with gtest. In addition, the dependencies are about something similar. No difference if I use conan; somehow gtest depencence is missed.
  7. You should use SystemCVerification/2.0.1@minres/stable instead of 2.0.0a. As these are binary packages (with source) there are version dependencies. TLM2.0 is part of SystemC so it comes automatically with the SystemC package. Actually I might want to start with: git clone https://github.com/Minres/SystemC-Quickstart cd SystemC-Quickstart/ mkdir build cd build/ cmake .. make This is all you need to start developing based on SystemC. More details to be found in the README.md
  8. I recently discovered the conan-style install, but I have difficulties with using it. I started with the quickstart example. My conanfile.txt contains [requires] SystemC/2.3.3@minres/stable SystemCVerification/2.0.0a@minres/stable gtest/1.8.1@bincrafters/stable flex/2.6.4@bincrafters/stable qt5/5.13.0@bincrafters/stable and $ conan remote list conan-center: https://conan.bintray.com [Verify SSL: True] minres: https://api.bintray.com/conan/minres/conan-repo [Verify SSL: True] flex: https://github.com/bincrafters/conan-flex [Verify SSL: True] qt5: https://github.com/bincrafters/conan-qt [Verify SSL: True] gtest: https://github.com/bincrafters/conan-gtest [Verify SSL: True] Shall I do anything else? With this, I receive the message $ sudo conan install .. --build=missing Configuration: [settings] arch=x86_64 arch_build=x86_64 build_type=Release compiler=gcc compiler.libcxx=libstdc++ compiler.version=7 os=Linux os_build=Linux [options] [build_requires] [env] WARN: SystemCVerification/2.0.0a@minres/stable requirement SystemC/2.3.2@minres/stable overridden by your conanfile to SystemC/2.3.3@minres/stable flex/2.6.4@bincrafters/stable: Not found in local cache, looking in remotes... flex/2.6.4@bincrafters/stable: Trying with 'conan-center'... flex/2.6.4@bincrafters/stable: Trying with 'minres'... flex/2.6.4@bincrafters/stable: Trying with 'flex'... flex/2.6.4@bincrafters/stable: Trying with 'qt5'... flex/2.6.4@bincrafters/stable: Trying with 'gtest'... ERROR: Unable to find 'flex/2.6.4@bincrafters/stable' in remotes I.e. gtest can be installed with conan, the rest not ; the same happens with the command line $ conan install qt/5.13.0@bincrafters/stable Do I wrong something? BTW: I receive the message WARN: SystemCVerification/2.0.0a@minres/stable requirement SystemC/2.3.2@minres/stable overridden by your conanfile to SystemC/2.3.3@minres/stable Which is true, I really changed in the conanfile.txt to 2.3.3. Maybe SystemCVerification should be updated. Also, I wanted to install TLM. Does it have similar conan recipe and store?
  9. This is not official Accellera repository. But in case your company is Accellera member you can request access to Accellera UVM git repositories.
  10. Independently on thread evaluation order code will output 0x0. Because signal values are updated during "Update phase" of simulation. Check Section "4. Elaboration and simulation semantics" of SystemC standard.
  11. Master and Slave use same clock, so I think Slave need only care data_in. class slave : public sc_module { public: sc_in<bool> clk; sc_in<uint32_t> data_in; slave(sc_module_name name):clk("clk"),data_in("data_in"){ SC_HAS_PROCESS(slave); SC_METHOD(run); dont_initialize(); sensitive << data_in; } void run(){ cout<<hex<<data_in.read()<<endl; } ~slave(){ } }; or class slave : public sc_module { public: sc_in<bool> clk; sc_in<uint32_t> data_in; slave(sc_module_name name):clk("clk"),data_in("data_in"){ SC_HAS_PROCESS(slave); SC_THREAD(run); dont_initialize(); sensitive << data_in; } void run(){ cout<<hex<<data_in.read()<<endl; } ~slave(){ } };
  12. Hello In the following code, how I can make sure that slave thread get its turn after master so that slave gets the correct value. The below code output 0 instead of 0x11223344. In general how to make sure that the threads are executed in a specific order once a pos edge is detected. For example if we have 10 threads all are sensitive to posedge of the clock. How to make sure the threads are always executed in order 1,2,3,4,5,6,7,8,9,10 so that the behavior is deterministic. #include <iostream> #include "systemc.h" class master : public sc_module { public: sc_in<bool> clk; sc_out<uint32_t> data_out; master(sc_module_name name):clk("clk"),data_out("data_out"){ SC_HAS_PROCESS(master); SC_THREAD(run); } void run(){ wait(clk.posedge_event()); data_out.write(0x11223344); } ~master(){ } }; class slave : public sc_module { public: sc_in<bool> clk; sc_in<uint32_t> data_in; slave(sc_module_name name):clk("clk"),data_in("data_in"){ SC_HAS_PROCESS(slave); SC_THREAD(run); } void run(){ wait(clk.posedge_event()); cout<<hex<<data_in.read()<<endl; } ~slave(){ } }; class top : public sc_module{ public: master m; slave s; sc_clock clk; sc_signal<bool> valid; sc_signal<uint32_t> data; top(sc_module_name name):m("m"),s("s"),clk("clk",sc_time(5,SC_NS)),data("data"){ m.clk(clk); s.clk(clk); m.data_out(data); s.data_in(data); } ~top(){ } }; Thanks Khushi
  13. How are you doing end of test with UVM1.2 ? Setting up drain time (as shown below) used to work find till UVM1.1d as uvm run phase will get it's phase_done assigned to uvm_test_done, but that logic seems to be removed from uvm_phase.svh in uvm-1.2. http://blog.verificationgentleman.com/2016/03/an-overview-of-uvm-end-of-test-mechanisms.html class test_drain_time extends test; virtual function void end_of_elaboration_phase(uvm_phase phase); uvm_phase run_phase = uvm_run_phase::get(); run_phase.phase_done.set_drain_time(this, 16 * 2); endfunction // ... endclass Even using another approach mentioned in the same blog about using objection doesn't work anymore as phase_done for run_phase is not allocated and I see following error when it tries to raise/drop objections. uvm_test_top.m_env.m_scoreboard' attempted to drop an objection on 'run', however 'run' is not a task-based phase node! (This is a UVM_PHASE_IMP, you have to query the schedule to find the UVM_PHASE_NODE) virtual function void write_north(amiq_apb_pkg::amiq_apb_mon_item item); uvm_phase run_phase; super.write_north(item); if (num_seen_north_items % 2 == 1) return; run_phase = uvm_run_phase::get(); run_phase.raise_objection(this); endfunction
  14. Caution: SystemC Kernel is not thread-safe without taking special precautions. If you call into SystemC from outside the SystemC OS-thread, you may need to create a primitive channel utilizing async_request_update(). If on the other hand you are simply stalling SystemC from within, which is what I think is being stated, then you should be fine with simple std::mutex (not sc_core::sc_mutex which is only for use inside SystemC between SystemC internal "processes").
  15. Hmm, not sure if I understand you correctly. Your C++ code has an entry function, right? If you just call this entry function from a SC_THREAD it runs in a thread context and can call wait to let other parts of the simulation continue. The other option you have is to run your C++ code in a second (OS) thread, e.g. a std::thread. This allows to use the usual syncronization primitives of the OS like mutexes and alike. BR
  16. Background/Problem: I have some existing code in C++, that runs on my physical hardware that I would like to run within SystemC for testbenching. I would like as much of this code to be identical so the hardware tests match the TB tests. At the bottom level I am replacing my hardware read/write class (that interacts with hardware) with a systemC module that all other classes will inherit from. The code I have, that currently runs on hardware, is dependent on the fact that the process doesn't proceed until there is a return from the read() or write() functions. However, in order to interact with the systemC ports, I require the function to spawn a thread to handle this process and suspend the thread while modelsim processes the hardware. Without spawning a thread, I cannot do wait() or have sensitivity functionality. On the surface this seemed straightforward, however, since I do not want the C++ code to change, beyond adding a top level wrapper, I am running in to issues. First, when I have my C++ code call a function to spawn a thread to do a read/write transaction, I lose the ability to wait until that thread is finished. I could make the C++ code into sc_threads so I can use wait(), but that defeats the purpose of what I am trying to do, (keep all of the abstracted classes similar between hardware and tb). The only "solution" I can think, if you can call it that, is passing a variable by reference to this spawned thread, then having the process do a while(foo!=barr) until the thread signals it is finished by changing this variable. However I don't know if this is even viable, because in addition to wasting cycles, the spawned thread might not even be executed by the event scheduler in the systemC kernel. So I doubt this would work. My Questions: Is it possible to have a C++ function that is called normally wait until an SC_thread is finished? Is there a way to handle hardware interactions that require waiting without having to spawn or use a thread?
  17. Earlier
  18. Hi all, I have a question about behavior of uvm_sequence_base::kill method. In case of virtual (layered) sequence, how should be uvm_sequnce_base::start task invocation of lower layer sequences when uvm_sequece_base::kill method is invoked? Should be finished completely? Can be terminated suddenly? I attached an example code. If start task invocation of lower layer sequences should be finished completely, both of uvm_info within innter_sequence and uvm_info within outer_sequence should be displayed. However, when I executed this sample code with the latest VCS, uvm_info within innter_sequence was not displayed. Regards, Taichi Ishitani process_test_uvm.sv
  19. Are there any plans on continuing using the GitHub repository for such releases or has it been discontinued?
  20. The github repositories are the actively developed code for Accellera’s reference implementation (sourceforge was made read-only when github was spun up). That being said, github stores the active development for the reference implementation, not for the standard itself. The class reference (ie. The “Standard”), as well as the Accellera Reference Implementation are officially published on accellera.org: The UVM 1.2 Standard: http://accellera.org/images/downloads/standards/uvm/UVM_Class_Reference_Manual_1.2.pdf The UVM 1.2 Reference Implementation: http://accellera.org/images/downloads/standards/uvm/uvm-1.2.tar.gz
  21. The error looks like a 64-bit library issue with stdc++.
  22. It is my first time to install SCV. I have Systemc-2.3.3 installed successfully. when i did step6 on INSTALL 6. Compile the package. > gmake (or gmake debug to build debug version of library) Some Solaris systems are unable to compile SCV with optimization enabled (which it is by default). If you run into trouble, try configuring again with the "--disable-opt" option specified on the configure command line. I got below error. Not sure how to fix it Thanks /usr/bin/grep: /glad/common/pkgsData/gcc-v6.3.0p1/Linux/RHEL6.0-2013-x86_64/lib/../lib64/libstdc++.la: No such file or directory /usr/bin/sed: can't read /glad/common/pkgsData/gcc-v6.3.0p1/Linux/RHEL6.0-2013-x86_64/lib/../lib64/libstdc++.la: No such file or directory libtool: link: `/glad/common/pkgsData/gcc-v6.3.0p1/Linux/RHEL6.0-2013-x86_64/lib/../lib64/libstdc++.la' is not a valid libtool archive gmake[2]: *** [libscv.la] Error 1
  23. Thank you everybody for your replies. I ended up implementing new Clock based on the default sc_clock (which I found here). I figured that it would be more efficient if I stack to the default implementation, rather than a SC_MODULE with a SC_THREAD in it (not sure about it yet).
  24. I have a module which shapes the data and then dump into the memory module depending on if data input is more than Bandwidth. If data input is less than Bandwidth then it will bypass it that means no clock cycle wastage and the way to bypass is only if I can call the process of memory module from shaper module for writing the data. So, is it possible to do what I am thinking? or I can do the bypassing without calling the process of memory module?
  25. It looks like we need to sync with SystemC kernel once CPU access other models in the system. Anyway, we must balance simulation performance and correct model behavior.
  26. There are several ways to do this: you might use a different way to carry signals which are more TLM like. One option would be to use tlm_signal. The other common option is if your CPU writes into the register of your interrupt controller via TLM it carries the delay which is essentially the offset of the CPU local time to the SystemC kernel time. If you here just break the quantum and call a wait() so that the SystemC kernel can sync up and the signal change propagates you should be fine.
  27. deeku

    Modeling large memories in System-C

    If very small memory locations are used in entire memory (which is >8GB) you can use on demand paging where the memory is allocated in terms of pages whenever the page is not allocated for requested address. This enables allocate only pages whenever required. You can achieve overall good simulation speed. However in above mechanism if more and more pages allocated, the simulation speed will be downgraded or can crash also because of page allocation failure. In this case, memory can be implemented in file and using IO operations it can be accessed. With this simulation performance will be degraded but ensures simulation will not stop because of page allocation failure.
  1. Load more activity