Jump to content

All Activity

This stream auto-updates     

  1. Today
  2. inclusion of busDefinition in Component

    Hello Ritu, You cannot specify paths in IP-XACT XML files. The referencing is done through VLNV identifiers. The VLNV reference in a busType in a component bus interface must match with the VLNV identifier of a bus definition. How you load these two XML files in a tool is outside of the standard and is tool specific. I do not know which tool you are using but it should not matter where the IP-XACT XML files are located on your file system. Best regards, Erwin
  3. Hi, I might be asking very basic question as I have just started with IP-XACT. When I try reading the component file in my tool and the busdefinition is in some other directory it throws an error saying this data with VLNV couldn't found, How Do I include the busdefinition xml in component xml? Thanks
  4. hello, again - its hard to suggest something if you cannot clarify what you mean with 'kill'. this could a everything from - killing via 'kill -9' on the os level (or via signals to the simulator) - $stop,$finish and friends - via calls to uvm api methods - through phase operations/jumps - through a message causing the simulation to end - through a 'coded' natural end - through an end of event (by "killing" the clock) - through an end caused by external code .... /uwe
  5. Yesterday
  6. Hi, Yes, I know how they are killing it, but I cannot access those variables as they are neither being stored in the config_db or are being exported. But, even if the sim is getting killed, why is the report_phase not being executed. Instead, I tried one experiment, where I'm trying to store my counters in config_db in the run_phase & in some other monitor I'm trying to get them so that I can print it. Setting in my monitor as : uvm_config_db#(int)::set(this, "counter", counter); Trying to get the counter in another monitor's run_phase as : uvm_config_db#(int)::get(uvm_root::get(), "*", "counter", counter). But the value is being read as 0, as in why is it not getting updated.
  7. 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
  8. Hi all, I just installed systemc on my new computer with ubuntu. And I tried to run the code I wrote before which work perfectly fine on my other computer with Ubuntu. But I got the error: ''jump_addr' was not declared in this scope for all my ports and arguments with 'sc_bv' and 'sc_lv' type. Anyone knows what is going on, am I missing some thing in my system? export SYSTEMC_HOME=/usr/local/systemc-2.3.2/ g++ -I. -I$SYSTEMC_HOME/include -L. -L$SYSTEMC_HOME/lib-linux64 -Wl,-rpath=$SYSTEMC_HOME/lib-linux64 -o hello pc.h -lsystemc -lm that is the command I used I tried to run several different code, all of them doesn't work, I also tried to install different versions of systemc but the problem still exist. anyway I put one of the codes in the attachment regards, Edward pc.h
  9. hi to answer the question we need to know 'how' your test is 'killed'. what mechanism is used to terminate? /uwe
  10. Last week
  11. Hi all, I have a couple of counters in my monitor's run_phase which I'm trying to print in the report_phase. But, the test itself is being killed (I cannot edit the file which is killing the test) which my monitor is still in the run_phase & hence the counters aren't being printed. Is there any way to enforce the report_phase to be run/ any way to call the report_phase from within the monitor file ?
  12. If a DUT contains asynchronous reset, whether i can include the reset in the separate interface & instantiate in the TOP module of the test_bench?
  13. Thank you sir @StS, It worked. I can install the scv and run the example. Looking foward for the SCV upcoming release.
  14. Unit testing with gtest

    You must create all necessary SystemC signals, SystemC modules and make connection between them before you run any test in gtest. This require to create own gtest_main.cc implementation. Naturally in SystemC you must put everything in sc_main() function. For this, I would use registry design pattern. First create registry class (registry + factory + singleton). This class will be responsible for storing registered constructors using dynamic allocation with new and smart pointer in lambda expression (see factory::add class). Create all objects using factory::create() method before running all tests. Then you can get object using factory::get() method in you test execution. factory.hpp #ifndef FACTORY_HPP #define FACTORY_HPP #include <map> #include <string> #include <memory> #include <functional> class factory { public: static factory& get_instance(); template<typename T, typename ...Args> class add { public: add(Args&&... args); add(const std::string& name, Args&&... args); }; template<typename T> static T* get(const std::string& name = ""); void create(); void destroy(); private: using destructor = std::function<void(void*)>; using object = std::unique_ptr<void, destructor>; using constructor = std::function<object(void)>; factory(); factory(const factory& other) = delete; factory& operator=(const factory& other) = delete; void add_object(const std::string& name, constructor create); void* get_object(const std::string& name); std::map<std::string, constructor> m_constructors; std::map<std::string, object> m_objects; }; template<typename T, typename ...Args> factory::add<T, Args...>::add(Args&&... args) { add("", args...); } template<typename T, typename ...Args> factory::add<T, Args...>::add(const std::string& name, Args&&... args) { factory::get_instance().add_object(name, [args...] () -> object { return object{ new T(std::forward<Args>(args)...), [] (void* obj) { delete static_cast<T*>(obj); } }; } ); } template<typename T> auto factory::get(const std::string& name) -> T* { return static_cast<T*>(factory::get_instance().get_object(name)); } #endif /* FACTORY_HPP */ factory.cpp #include "factory.hpp" #include <stdexcept> auto factory::get_instance() -> factory& { static factory instance{}; return instance; } factory::factory() : m_constructors{}, m_objects{} { } void factory::create() { for (const auto& item : m_constructors) { m_objects[item.first] = item.second(); } } void factory::destroy() { m_objects.clear(); } void factory::add_object(const std::string& name, constructor create) { auto it = m_constructors.find(name); if (it == m_constructors.cend()) { m_constructors[name] = create; } else { throw std::runtime_error("factory::add(): " + name + " object already exist in factory"); } } auto factory::get_object(const std::string& name) -> void* { auto it = m_objects.find(name); if (it == m_objects.cend()) { throw std::runtime_error("factory::get(): " + name + " object doesn't exist in factory"); } return it->second.get(); } Create your own version of gtest_main.cc implementation. Call factory::create() method to create all SystemC signals and SystemC modules before running any tests RUN_ALL_TESTS(). Because factory class is a singleton design pattern, call factory::destroy() method after finishing all tests to destroy all created SystemC objects. main.cpp #include "factory.hpp" #include <systemc> #include <gtest/gtest.h> int sc_main(int argc, char* argv[]) { factory::get_instance().create(); testing::InitGoogleTest(&argc, argv); int status = RUN_ALL_TESTS(); factory::get_instance().destroy(); return status; } Then define dut class in your test than will create SystemC signals and SystemC modules. In constructor do connection between created SystemC signals and modules. Register defined dut class to registry object using global constructor like this factory::add<dut> g. After than you can get your dut object using simple factory::get<dut>() method. test.cpp #include "my_module.h" #include "factory.hpp" #include <gtest/gtest.h> #include <systemc> class dut { public: sc_core::sc_clock aclk{"aclk"}; sc_core::sc_signal<bool> areset_n{"areset_n"}; sc_core::sc_signal<bool> in{"in"}; sc_core::sc_signal<bool> out{"out"}; dut() { m_dut.aclk(aclk); m_dut.areset_n(areset_n); m_dut.in(in); m_dut.out(out); } private: my_module m_dut{"my_module"}; }; static factory::add<dut> g; TEST(my_module, simple) { auto test = factory::get<dut>(); test->areset_n = 0; test->in = 0; sc_start(3, SC_NS); test->areset_n = 1; test->in = 1; sc_start(3, SC_NS); EXPECT_TRUE(test->out.read()); } For more inspiration, you can check my logic library for SystemC verification: https://github.com/tymonx/logic
  15. how to implement delay in systemC?

    No, it will be using event one way or another. Verilog implementation most likely also uses even queue under the hood. It just has a more pretty syntax for it.
  16. Hi all, is there any way to implement the intra assignment delay in systemC without using sc_event()? for example : in verilog we write out = #10 in1 + in2; // intra assignment delay. how would i implement the same in systemC? regards, jatin
  17. How to model a delay line in SystemC

    Hi Roman Popov, is there any way to implement the intra assignment delay without using sc_event()? regards jatin
  18. That is a great news. Will this time add some examples about how to driving clock/reset signal as I ask in this post?
  19. Profiling SystemC using gprof

    Thank you very much!
  20. We are working on releasing an compatibility update rather soon, probably this year.
  21. Hi Aixeta, this is already fixed in the upcoming release of the SCV. Meanwhile you can workaround by casting directly to sc_logic: sc_dt::sc_logic_value_t(this->_get_instance()->get_bit(i))
  22. Hi there, I have an exact same problem with Sephan, when i ran "make' command after do the config the error said like "error: cannot convert 'sc_dt::sc_bv_base::value_type {aka bool}' to 'sc_dt::sc_logic_value_t' in return { this->initialize(); return this->_get_instance()->get_bit(i); } \" I'm using centOS 7 3.10.0-693.5.2.el7.x86_64 and GCC Version gcc version 4.8.5 20150623 (Red Hat 4.8.5-16) (GCC) The scv that i used was "scv-2.0.0a-20161019 " Do you have any suggestion? here the full output making all in sis make[4]: Entering directory `/usr/local/scv-2.0.0/objdir/src/cudd/2.3.0/sis' make[4]: Nothing to be done for `all'. make[4]: Leaving directory `/usr/local/scv-2.0.0/objdir/src/cudd/2.3.0/sis' make[4]: Entering directory `/usr/local/scv-2.0.0/objdir/src/cudd/2.3.0' make[4]: Nothing to be done for `all-am'. make[4]: Leaving directory `/usr/local/scv-2.0.0/objdir/src/cudd/2.3.0' make[3]: Leaving directory `/usr/local/scv-2.0.0/objdir/src/cudd/2.3.0' make[3]: Entering directory `/usr/local/scv-2.0.0/objdir/src/cudd' make[3]: Nothing to be done for `all-am'. make[3]: Leaving directory `/usr/local/scv-2.0.0/objdir/src/cudd' make[2]: Leaving directory `/usr/local/scv-2.0.0/objdir/src/cudd' Making all in scv make[2]: Entering directory `/usr/local/scv-2.0.0/objdir/src/scv' /bin/sh ../../libtool --tag=CXX --mode=compile g++ -DHAVE_CONFIG_H -I. -I../../../src/scv -I../../config -I../../src -I../../../src -I../../../src/cudd/2.3.0/cudd -I../../../src/cudd/2.3.0/obj -I../../../src/cudd/2.3.0/util -I../../../src/cudd/2.3.0/mtr -I../../../src/cudd/2.3.0/st -I/usr/local/systemc-2.3.2/include -Wall -Wformat -O2 -g -MT libscv_la-scv_constraint.lo -MD -MP -MF .deps/libscv_la-scv_constraint.Tpo -c -o libscv_la-scv_constraint.lo `test -f 'scv_constraint.cpp' || echo '../../../src/scv/'`scv_constraint.cpp libtool: compile: g++ -DHAVE_CONFIG_H -I. -I../../../src/scv -I../../config -I../../src -I../../../src -I../../../src/cudd/2.3.0/cudd -I../../../src/cudd/2.3.0/obj -I../../../src/cudd/2.3.0/util -I../../../src/cudd/2.3.0/mtr -I../../../src/cudd/2.3.0/st -I/usr/local/systemc-2.3.2/include -Wall -Wformat -O2 -g -MT libscv_la-scv_constraint.lo -MD -MP -MF .deps/libscv_la-scv_constraint.Tpo -c ../../../src/scv/scv_constraint.cpp -fPIC -DPIC -o .libs/libscv_la-scv_constraint.o In file included from ../../../src/scv/scv_introspection.h:625:0, from ../../../src/scv/scv_constraint.h:65, from ../../../src/scv/scv_constraint.cpp:43: ../../../src/scv/_scv_introspection.h: In member function 'sc_dt::sc_logic_value_t scv_extensions<sc_dt::sc_bv_base>::get_bit(int) const': ../../../src/scv/_scv_introspection.h:552:66: error: cannot convert 'sc_dt::sc_bv_base::value_type {aka bool}' to 'sc_dt::sc_logic_value_t' in return { this->initialize(); return this->_get_instance()->get_bit(i); } \ ^ ../../../src/scv/_scv_introspection.h:573:3: note: in expansion of macro '_SCV_BIT_BASE_INTERFACE' _SCV_BIT_BASE_INTERFACE(type_name) \ ^ ../../../src/scv/_scv_introspection.h:577:1: note: in expansion of macro '_SCV_TAG_FINAL_COMPONENT' _SCV_TAG_FINAL_COMPONENT(sc_bv_base); ^ make[2]: *** [libscv_la-scv_constraint.lo] Error 1 make[2]: Leaving directory `/usr/local/scv-2.0.0/objdir/src/scv' make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory `/usr/local/scv-2.0.0/objdir/src' make: *** [all-recursive] Error 1
  23. Profiling SystemC using gprof

    https://stackoverflow.com/questions/23407635/append-compile-flags-to-cflags-and-cxxflags-while-configuration-make
  24. Hello, I am using SystemC 2.3.0. I am wondering how I can profile the SystemC library. I found we can use options like "--enable-debug" and "--disable-optimize" for debugging and optimization, respectively, but I was unable to find such an option to enable profiling. I need to use gprof and pass "-pg" options when building SystemC. Any help is greatly appreciated! Thank you in advance.
  25. buildCommand for c/c++ object file

    That's because -c and -o are redundant in this particular case of the g++ command. The target is already given by <ipxact:targetname> while the source file is given by <ipxact:file>
  26. Delta Cycle and concurrency

    Thanks for the suggestion, Raph. Will have a look. Jocelyn
  27. Earlier
  28. Delta Cycle and concurrency

    Hi. Maybe you should have a look at SystemC AMS. It offers the TDF (timed data flow) model of computation. It follows the data flow concept, i.e. you have a cluster of blocks; the solver defines an order of evaluation of each block; and in every time step, the blocks (or modules) are evaluated in that order. The output of one block is immediately visible at the input of the following block. Greetings Ralph
  29. Delta Cycle and concurrency

    The consumer should never block in my case. Reading twice a shared variable which has only been written once should not block the reader...
  1. Load more activity
×