Jump to content


  • Content Count

  • Joined

  • Last visited

  • Days Won


Everything posted by maehne

  1. No, unfortunately not yet. Due to the summer vacation period, no one found yet the time to investigate and find a potential fix for that issue.
  2. Each port of a module needs to be bound to some channel -- in your case of type sc_signal_rv<W> (see IEEE Std 1666-2011, clause 6.17). In you example, you would do this binding in sc_main(). However, you model lacks also stimuli generation. You seem to be just starting with C++ and SystemC: I suggest to read first a good book on C++ and SystemC before trying to write your own models. E.g., check out isocpp.org/get-starte, Doulos, and "SystemC: From the Ground Up, Second Edition".
  3. As you already found out, sc_get_current_process_handle() is not suitable, which is confirmed by IEEE Std 1666-2011, clause 5.6.7: "When called from sc_main during simulation, sc_get_current_process_handle shall return an invalid handle." To my knowledge, the standard does not define a function, which would return directly the information you want to obtain. I would suggest to augment your models with suitable logging code, which might be conditionally activated once your simulation enters an interesting phase. Logging could be done in the simplest case to the console or you might hand the inf
  4. I am not aware of a widely used free PSL implementation for SystemC. However, you can find some research papers discussing using PSL together with SystemC, e.g.: Ali Habibi, et al.: Assertion Based Verification of PSL for SystemC Designs, IEEE, 2004. Wolfgang Ecker, et al.: Implementation of a SystemC Assertion Library, Design & Reuse.
  5. Yes, the simplest way is to write the desired initial bool value to the bound signal using the signal’s write() member function (see IEEE Std 1666-2011, clause 6.4.4), e.g., from sc_main() before starting your simulation with sc_start().
  6. Thanks @Lukas Steiner for reporting this issue! I have forwarded it to the SystemC LWG for investigation.
  7. Thanks @mo_ayman for all the additional information and minimal example demonstrating the problem! Have you tried to reach out to the developers of mingw-w64 and of MSYS2? Over the years, quite some issues were raised relating to exception handling for both projects. The minimal example, which you provide, should be useful to debug it on the mingw-w64 and MSYS2 side. Indeed, QuickThreads is becoming a maintenance burden, as it is abandoned upstream for many years and few people are knowledgeable about its working. Porting it to new platforms has always been a headache. Maybe, this part of
  8. User @mo_ayman posted on 2020-07-15 on the SystemC forum about his effort to fix QuickThreads on Win64. He has created a branch on GitHub containing the current state of his fixes, which is based on SystemC 2.3.2.
  9. @Matthias Jung may be interested in your fixes, as he also stumbled on this issue. He also created a GitHub issue on the official public GitHub repository of the SystemC proof-of-concept implementation.
  10. For the record, @mo_ayman posted about the current state of his fixes to QuickThreads on Win64 in this separate thread.
  11. Thanks @mo_ayman for all your effort in trying to fix QuickThreads on the 64-bit Windows platforms and sharing the current state of your fixes with us! Indeed, SystemC should default to use WinFibers on the Windows platform. Historically, this was only reflected in the MSVC project files, but not in the configure.ac files, as the latter would only work in Unix environments. Much is also handled in the source code itself using conditional compilation based on compiler/platform-specific preprocessor definitions. Cygwin as a POSIX environment for Windows was always a special case, which I got the
  12. Thanks for reporting this issue for the edge case INT64_MIN! I have forwarded it to the SystemC LWG for investigation.
  13. Any two-dimensional array a2d[rows][cols] can be mapped to a one-dimensional array a1d[rows*cols]. Accessing an individual element using row and col requires just mapping the coordinate to the equivalent one-dimensional index i = row * cols + col. If you want to use a nested sc_vector< sc_vector<rc> >, you should adapt the code @Philipp A Hartmann suggested in the second thread, which you mentioned. @T. Zimmermann provided a working example in the same same thread. However, it is not making use of lambda functions to further compact the code. As I wrote in the same thread, you
  14. The primary reason is that the SystemC Proof-of-Concept (PoC) implementation uses some global data structures, which get constructed during elaboration, which are not fully cleaned up when sc_stop() is called. These data structures are only freed by the OS when the application quits. There have been some efforts improve the PoC implementation in this area, but these are currently stalled. Unfortunately, partially due to bad code examples, bad habits, and laziness, many SystemC models also not cleanly deallocate their dynamically allocated resources, as they still use manual resource allocation
  15. @David Black answered this above: The sc_signal_in_if provides member function event(), which "shall return the value true if and only if the value of the channel was written or modified in the immediately preceding delta cycle and at the current simulation time." [IEEE Std 1666-2011, clause 6.13]. I.e., instead of accessing the event and calling triggered(), you could directly call port->event() to check whether an event happened.
  16. Your questions are answered by clause "Function sc_start" in IEEE Std 1666-2011: More details on the simulation cycle, you can find in clause 4.2 "Simulation". Yes, see clause of IEEE Std 1666-2011: Clause 4.5.7 of IEEE Std 1666-2011 lists functions to detect pending activity: sc_pending_activity_at_current_time(), sc_pending_activity_at_future_time(), sc_pending_activity(), and sc_time_to_pending_activity().
  17. The paper on gSysC suggests that it implements a loose coupling by only deriving from the corresponding SystemC ports and signals (Figure 3) and controlling the simulation by calls to sc_start() (section 4). Since the semantics of the ports, signals, and sc_start are still quite similar in IEEE Std 1666-2011 and its proof-of-concept implementation SystemC 2.3.3, it should not be too hard to update this coupling interface to SystemC. If I remember correctly SystemC 2.0.1 did not yet use namespaces and gSysC doesn't seem to use them either. Just using <systemc.h> instead of <systemc>
  18. You cannot bind a signal to another signal. Instead, you have to bind one or more matching ports to your signal. Your sc_signal<bool, SC_MANY_WRITERS> implements sc_signal_inout_if<bool>. Therefore, ports of type sc_in<bool>, sc_out<bool>, and sc_inout<bool> may be bound to that signal. Due you specified the SC_MANY_WRITERS policy, There won't be an error to write to that signal from more than one processes during any given evaluation phase (see clause 6.4.4 of IEEE Std 1666-2011). So, declare fifo_full to be of type sc_out<bool>. Then, binding that port to
  19. I have no experience with the emscripten platform. However, the proof-of-concept implementation uses by default QuickThreads to implement co-routines for enabling SC_METHODs and SC_THREADs, which uses platform-specific assembly code. You may have more success using POSIX threads (Pthreads), which seems to be supported by emscripten. You can find detailed build instructions for SystemC in the INSTALL.md file.
  20. I agree with @AmeyaVS that it would help if you could share the current state of your modifications in form of a .diff file in this forum or as a work-in-progress pull request on the public SystemC repository on GitHub. Then more people can have a look to maybe suggest a fix for the second half of the issue. It would be great if this long-standing issue regarding QuickThreads on Cygwin64 could be finally fixed.
  21. One good resource for understanding the fundamental concepts of SystemC is "SystemC from the Ground Up", 2nd edition, Springer by David Black et al. Of course, IEEE Std. 1666-2011 is the definitive source to be consulted for any semantic details.
  22. Check clause 5.11 of IEEE Std 1666-2011 for the member functions of the sc_time class. sc_time::value() will return the underlying integer representation of the time value, which has to be interpreted together with the set discrete time resolution. sc_time::to_seconds() returns a double value representing the time value in seconds.
  23. maehne


    Yes, you can simply download and build the proof-of-concept implementation of SystemC by following the contained INSTALL instructions. You just need to install Xcode and its command line tools. Instead of the GNU-autotools-based build system, you may also use CMake to set up the build. You can display VCD trace files with GTKwave.
  24. Could you please be more specific and post the error messages, you are receiving when building SystemC 2.3.3 with VS 2019? Also, have you tried it with the most recent development state from the public SystemC Git repository of Accellera?
  • Create New...