Jump to content


  • Content count

  • Joined

  • Last visited

  1. 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?
  2. 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.
  3. 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>
  4. 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?
  5. 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.
  6. 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
  7. 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.
  8. 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() { }
  9. 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?
  10. 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)
  11. 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
  12. How to define a FIFO of custom structure

    Thank you, I really missed the point
  13. I want to define a FIFO of user-defined structures. The program below presents with message: no match for 'operator <<' If I change <Transfer> to <int>, int compiles fine. #ifndef scMWE_h #define scMWE_h #include <systemc> #include <iostream> typedef struct { int Select; int Content; } Transfer, *TransferPtr; SC_MODULE(scMWE) { scMWE(sc_core::sc_module_name nm); sc_core::sc_fifo<Transfer> from; }; #endif #include "scMWE.h" SC_HAS_PROCESS(scMWE); scMWE::scMWE(sc_core::sc_module_name nm) : sc_core::sc_module(nm) {}
  14. Hm, I am starting to be proud of my ability to hide so many mistakes in a short MWE. :) What is the reason that the compiler claims "invalid static_cast" rather than wrong signature? (the rest of mistakes is just a consequence of the first unfixed one)
  15. Here goes the code: #ifndef scMWE_h #define scMWE_h #include <systemc> #include <iostream> SC_MODULE(scMWE) { scMWE(sc_core::sc_module_name nm); void WritePseudo(int A ); sc_core::sc_fifo_in<int> in[4]; }; #endif #include "scMWE.h" SC_HAS_PROCESS(scMWE); scMWE::scMWE(sc_core::sc_module_name nm) : sc_core::sc_module(nm) { SC_METHOD(WritePseudo); // sensitive << in; } void scMWE:: WritePseudo(int A) { std::cout << "MWE:A" << A << std::endl; }