Jump to content

katang

Members
  • Content count

    42
  • Joined

  • Last visited

  1. Is some situations (say when simulating memory access) using simple clocking is in most cases just wasting time during simulation, only a small fraction of invocations results in real action. From this point on, it would be advantageous to use next_trigger(). Some other modules, however, make actions on every clock tick. Is there any way to distinguish whether a member function is called as the result of the Clock or next_trigger()? What happens if I mix them? (I mean using one for one module and another for another module) I guess that using Clock is synthesizable, and next_trigger() is not. Is there some standard methodology to develop a source that supports both? (BTW: is there some support in SystemC which supports using synthesizable constructions only? I mean it flags non-synthetizable constructs with a warning?)
  2. What is exactly the relation and the efficiency of SC_THREAD, SC_METHOD and system thread? I am making a simulator, where both the exact timing and the execution speed counts. I addition, I might need a separate Qt5 GUI thread. What are the means either in Qt5 or SystemC to support those synchronization requirements?
  3. I am attempting to make an application where the engine runs a SystemC model, and its state is displayed for the user though a Qt5 GUI. The GUI can run in a stepwise mode (i.e. the user can stop at some breakpoints and browse actual status), or run continuously. I.e. i have two event queues which should be synchronized. How can i flush the events and synchronize the two queues, in order to display a consistent state? Is there any difference if I call sc_start() in sc_main(), before or after mainWin.show(); or inside mainWin?
  4. I want to test the basic functionality of my design with gtest. It does not have yet the SystemC functionality, but heavily uses SystemC modules and data structures. I create a fresh copy of my top-level module for the individual gtests, and receive tons of warnings that I already defined an module with that name. It is harmless, but annoying. Any idea, how can I suppress it?
  5. Left shift with zero results in

    Sorry for bothering you. I named it as MASK_WIDTH and set it as MASK_MAXIMUM_VALUE. Later I believed to myself that the definition was really a width.
  6. Left shift with zero results in

    In a config file, I have #define CORE_BUS_WIDTH 5 In my SC_MODULE I have // sc_dt::sc_uint<CORE_BUS_WIDTH> int mID; ///< internal ID (sequence number) of the core Changing the data type from int to sc_unit provokes the error message, with all others unchanged. Works also with line sc_dt::sc_uint<5>
  7. In my program, I have a member variable sc_dt::sc_uint<MASK_WIDTH> mymask; ///< One-hot bitmask corresponding to ID In my constructor, I can initialize that variable like mymask(ID ? 1 << ID : 1) because using only mymask(1 << ID ) SC library results in Error: (E5) out of bounds: sc_uint[_base] initialization: length = -2147483648 violates 1 <= length <= 64 In file: ../../../../src/sysc/datatypes/int/sc_uint_base.cpp:342 I see nothing against shifting a value by zero position. Is there any deeper reason?
  8. A strange SystemC warning

    Well, I was sure the problem is in my code. I only was wondering that the warning repeats the same string, always one character shorter.
  9. I receive a kind of strange warning: the same runtime warning repeats, next time one character shorter, as long as the length of the path in message lasts. Like the fragment shown below. However, the test runs file. Since in the message only SystemC files are referred to, I have no idea what could be the reason. (Honestly, if it would be the task to program by intention something like this, I would be in serious trouble). Any idea, what and where to look for? The call scMod(/*"My_Name_"+ char(ID+'A')) results in what shown, (0<=ID<= 16) The call scMod("My_Name_") runs fine. (scMod is a SystemC module) Do I something illegal? Warning: (W506) illegal characters: include/sysc/communication/sc_port.h substituted by include/sysc/communication/sc_port_h In file: ../../../../src/sysc/kernel/sc_object.cpp:264 Warning: (W506) illegal characters: nclude/sysc/communication/sc_port.h substituted by nclude/sysc/communication/sc_port_h In file: ../../../../src/sysc/kernel/sc_object.cpp:264 Warning: (W506) illegal characters: clude/sysc/communication/sc_port.h substituted by clude/sysc/communication/sc_port_h In file: ../../../../src/sysc/kernel/sc_object.cpp:264 Starts with Warning: (W506) illegal characters: /usr/local/systemc231a/include/sysc/communication/sc_port.h substituted by /usr/local/systemc231a/include/sysc/communication/sc_port_h In file: ../../../../src/sysc/kernel/sc_object.cpp:264 ends with Warning: (W506) illegal characters: /sysc/communication/sc_port.h substituted by /sysc/communication/sc_port_h In file: ../../../../src/sysc/kernel/sc_object.cpp:264
  10. Risc_Cpu

    Concerning SoCLib, could you please offer a good tutorial (I mean other than the two provided under this title)? Even I was not able to find out what that library is exactly good for. It is OK, that some files were touched last time nearly 10 years ago, that the documentation is half French/half English, usually the /doc subdirs are empty, the source files do not contain any useful comments, etc. Even with a good starting point, it is a kind of reverse engineering, without it is hopeless. To use some IPs with some of my new own IPs, it is mission impossible.
  11. What is illegal in what I am trying to do? #include "systemc.h" SC_MODULE (BIT_ADDER) { SC_CTOR (BIT_ADDER) { SC_METHOD (process); } void process(); }; class testbench: sc_core::sc_module { public: testbench(sc_core::sc_module_name nm); virtual void test(void) = 0; }; class testbench_adder: public testbench, BIT_ADDER { public: testbench_adder(sc_core::sc_module_name nm); void test(); }; void BIT_ADDER::process() {} SC_HAS_PROCESS(testbench); testbench::testbench(sc_core::sc_module_name nm) : sc_core::sc_module(nm) {} SC_HAS_PROCESS(testbench_adder); testbench_adder::testbench_adder(sc_core::sc_module_name nm) : testbench::testbench(nm), BIT_ADDER("UUT") { SC_THREAD(test); } void testbench_adder::test() { }
  12. I am working in a CMake environment, compiling, building, documenting and packaging my app. It works fine, except when SystemC is involved. The other libraries, including flex, Qt, gtest, etc. do not cause similar messages. The other options work fine also for SystemC, but when attempting to make a Debian package, I receive the message CPack: Create package CPackDeb: - Generating dependency list CMake Error at /usr/share/cmake-3.5/Modules/CPackDeb.cmake:530 (message): CPackDeb: dpkg-shlibdeps: 'dpkg-shlibdeps: warning: binaries to analyze should already be installed in their package's directory dpkg-shlibdeps: error: couldn't find library libsystemc-2.3.1.so needed What is special with SystemC, or what do I wrong?
  13. I want to make some static testing (like complex submodule names are properly assembled or some utility modules work as expected), SystemC unrelated, using gtest. In the SetUp() and TearDown() methods I define individual environments for the individual tests. I receive tons of messages that the object already defined. What is true, but I want exactly test different instances. Can I reset SystemC somehow or switch off registering the objects when unit testing? (I say again, it is not SystemC related functionality, but embedded in mainly SystemC source files)
  14. How to define a FIFO of custom structure

    In my enhanced version, the compiler said the operator must take exactly one argument. I really cannot find out why. #ifndef scMWE_h #define scMWE_h #include <systemc> #include <iostream> struct Transfer_Type { int Select; int Content; std::ostream& operator << (std::ostream& os, const Transfer_Type& I) { return os; } }; SC_MODULE(scMWE) { scMWE(sc_core::sc_module_name nm); sc_core::sc_fifo<Transfer_Type> from; }; #endif
  15. How to define a FIFO of custom structure

    Thank you, I really missed the point
×