Jump to content

katang

Members
  • Content Count

    92
  • Joined

  • Last visited

About katang

  • Rank
    Advanced Member

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. So you say that rather than stalling in SystemC, I need to wait for a SystemC event generated by the GUI? then the SystemC thread can emit a signal, and the two guys can ping-pong with the signals? It sounds good, thank you. That is, as @David Blacksuggested, I shall use the async_request_update() method from the thread, running SystemC? Is some sample around? in the book and the examples I do not find a call like this.
  2. My case is less complex. I am aware of that this process is not that process, and this scheduler is not that scheduler. My intention is exactly just to stall SystemC at some point of execution, and just to read some variables for displaying it in the GUI. I am interested in sc_time only from the aspect to display it in the GUI. I do not want any other communication, than emitting a message that SystemC stalled, then -- after finishing the GUI update -- to resume it. A kind of breakpoint. In the same way as used in a debugger. To resume, I can ask the thread to send a message. I wonder if I can stall SystemC safely, without interfering with anything. Maybe SC_ZERO_TIME solves the problem; however the simulation itself also uses SC_ZERO_TIME in some cases; so they may interfere; I need to check. I do not want to use non-zero time as it falsifies the simulation time, which is also important.
  3. As I mentioned in a previous post, I want to display the state of the simulated object in a GUI thread, while the simulation thread is suspended. Can I do that in an elegant way? I mean, that if I am after receiving my event, the event queue is empty, so the simulation stops immediately. If I suspend it before triggering the event, then the event queue is empty again; so my waiting terminates again. If I trigger the event first, then I stop at a wait(resume-event), the simulation goes to serve the event first, I wanted to stop at; and comes back to my wait(resume-event), and since the event queue is empty, stops again. I guess I need to forcefully prevent taking out the event before the GUI thread returned a resume_event. How can I do that?
  4. I have an educational-purpose GUI that displays the results of the simulation. The simulation is started in the run() method of a Qt5 thread. 1./ At some checkpoints the simulation suspends itself (receives an event, but does not execute it until the GUI sends a resume message), and the GUI can display whatever it wants. I wonder if I need to make any special trick because the GUI and the simulation are in different threads? (As I understood, the engine is just waiting, hopefully nothing happens that would interfere with the threading. I would prefer reading some values directly, just to display them, and avoid sending messages, if not absolutely needed.) 2./ As it is a kind of debugger, it may happen that the user terminates the simulation in a way that the simulation is still waiting for a resume message, but instead a new 'start' message arrives. What is the preferred way of quietly killing the engine? Is it OK, if I terminate and re-start the Qt thread?
  5. I am trying to assemble a package from my app. I builds and executes fine. All other 'make XX' commands work OK, except that when I attempt 'make package', it throws the error message CPackDeb: - Generating dependency list CMake Error at /usr/share/cmake-3.10/Modules/CPackDeb.cmake:709 (message): CPackDeb: dpkg-shlibdeps: 'dpkg-shlibdeps: error: cannot find library libsystemc.so.2.3 needed by I do have libsystemc.so.2.3.3 in my /opt/systemc/lib, and have a libsystemc.so.2.3 to it. The message comes from if(NOT SHLIBDEPS_RESULT EQUAL 0) message (FATAL_ERROR "CPackDeb: dpkg-shlibdeps: '${SHLIBDEPS_ERROR}';\n" Given that during building and running everything works OK (i.e. the library found, I guess that it is in the right place), I have no idea whether it is my dust, or CMake/SystemC? Maybe CPackDeb is looking for it on some other place?
  6. It is defined as #define SCTIME_CLOCKTIME sc_time(100,sc_core::SC_PS)
  7. Sorry. The question was bad. I meant that the self-notification is delayed, so it is not immediate any more. Do I miss something?
  8. I am using a FIFO in my design and in some cases I need to push back the slightly modified content to the FIFO. I understand that sending immediate self-notification should be avoided. To do so, I modified the sample FIFO code as void write(FIFO_t* c) { if (num_elements == max) wait(FIFO_read_event); data[(first + num_elements) % max] = c; ++ num_elements; // wait(SCTIME_CLOCKTIME); // Avoid immediate notification FIFO_write_event.notify(SCTIME_CLOCKTIME); } In the combination shown above, I receive no warning. However, when I define the notification time by the wait() (now commented out) and notify() brackets are empty, I receive the warning Warning: (W536) immediate self-notification ignored as of IEEE 1666-2011: My guess was that the two cases are equivalent. What is the difference? Maybe only the syntax is checked and not the time difference?
  9. You are absolutely right, thank you. From point of view of programming, it is OK. Till now, however, I never thought about ports that one create them with new 🙂
  10. Sorry, I forgot to mention: I have a master port, like this sc_port<scBus_blocking_if> bus_port; If I understand the point correctly, I shall use pointer, that (still within the constructor) I can change from the default null.
  11. I have some modules of the same class, and only part of the instances needs access to a certain bus, the others should not be linked to the bus. Of course I know during the setup phase, which ones should and which ones should not. The ones that should connect, I can connect, it works fine. At the same time, for the others, I would like to tell the ports they should not be connected. Is there some method to do so (i.e. I want to avoid 'complete binding failed', not more) . Or, shall I subclass a new module class for those modules, with the only difference that they have an extra port? Or, shall I give those modules a very low priority (they surely will not use the bus), and connect them formally to the bus? (maybe it causes unneeded wiring) I.e.
  12. 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)
  13. 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.
  14. 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?
  15. I have found in the examples of the SCFTGU book examples "a heartbeat function similar to a clock except it is more efficient than an sc_signal<bool>." It is used in one of the examples of the next chapter, but not at all in later examples, like the ones appended to 2.3.3. Is there any specific reason of it? Also, if defines only posedge_event() ; Can it be used in the simple_bus example, where negedge is also used?
×
×
  • Create New...