Jump to content

Philipp A Hartmann

  • Content Count

  • Joined

  • Last visited

  • Days Won


Everything posted by Philipp A Hartmann

  1. Philipp A Hartmann

    segmentation fault with async_reset_signal_is()

    Hi Avihai, I can confirm this behavior with the latest SystemC 2.3.2 pre-release and would classify this as a bug. As a short-term workaround, you can mark affected threads with dont_initialize(), which happens not to trigger this misbehavior: SC_THREAD(thread1); sensitive << thread1_event; async_reset_signal_is(reset_in,true); dont_initialize(); // avoid crash when starting in reset state I'll forward this issue to the Language Working Group for further analysis. Greetings from Duisburg, Phiipp
  2. Philipp A Hartmann

    Left shift with zero results in

    Can you please post a complete, self-contained example to demonstrate the issue? Reading your post, I still cannot infer what actual values, types, ... are involved and not even where you changed the "line" to sc_uint<5>. The following code works for me: #include <systemc> int sc_main (int, char *[]) { using namespace sc_dt; #define CORE_BUS_WIDTH 5 #define MASK_WIDTH 32 { sc_uint<CORE_BUS_WIDTH> id; sc_uint<MASK_WIDTH> mask(1 << id); std::cout << "id=" << id << "\t- mask=" << mask.to_string(SC_BIN) << std::endl; } { sc_uint<CORE_BUS_WIDTH> id(-1); sc_uint<MASK_WIDTH> mask(1 << id); std::cout << "id=" << id << "\t- mask=" << mask.to_string(SC_BIN) << std::endl; } return 0; } From your original error message, it looks more like an issue with MASK_WIDTH or CORE_BUS_WIDTH to me. Do you see any compiler warnings? Hope that helps, Philipp
  3. Philipp A Hartmann

    Left shift with zero results in

    Shifting by zero should of course be supported. Can you provide a self-contained example demonstrating the problem? Instead, the error message indicates, that you try to create an sc_uint<-2147483648> (or rather an sc_uint_base with the dynamic width of this value, e.g.), which is not allowed. What's the definition of MASK_WIDTH? What's the definition of ID? Hope that helps, Philipp
  4. Philipp A Hartmann

    debug problem systemc

    The error message is an indication, that you might miss the /vmg switch in your the MSVC project. Quoting from the SystemC INSTALL file (emphasis mine): Hope that helps, Philipp
  5. Philipp A Hartmann

    Usage of Sc_event_or_list

    Yes, there is currently no explicit function for this. But you can assign an empty one first: _orEvents = sc_event_or_list(); There is a caveat that this might break processes that are currently waiting for the previous elements in the list. But if you're sure that nothing is currently waiting of the list, the above example Should Work™. Hope that (still) helps, Philipp
  6. Philipp A Hartmann

    SystemC Evolution Day 2017

    Bump thread to the top: Don't forget to submit your proposals! :-)
  7. Philipp A Hartmann

    SystemC Evolution Day 2017

    SystemC Evolution Day 2017 Workshop on the evolution of SystemC standards Wednesday, October 18, 2017 Munich, Germany Summary SystemC Evolution Day is a full-day technical workshop on the evolution of SystemC standards to advance the SystemC ecosystem. This is the second event after a successful first edition in May 2016. In several in-depth sessions, current and future standardization topics around SystemC will be discussed in order to accelerate their progress for Accellera and IEEE standard’s inclusion. SystemC Evolution Day is intended as a lean, user-centric, hands-on forum bringing together the experts from the SystemC user community and the Accellera Working Groups to advance SystemC standards in a full-day workshop. Date / Time: October 18, 2017 (day after DVCon Europe 2017) | 10:00am - 6:00pm Location: Technical University of Munich, City Campus | Arcisstraße 21, 80333 Munich, Germany Registration: Required, but free of charge. Register here > Submissions / Questions: Email systemc-evolution-day@lists.accellera.org Organization Team: Philipp A Hartmann, Intel; Oliver Bell, Intel; Martin Barnasconi, NXP; Matthias Bauer, Infineon; Thomas Kruse, Infineon Call for Contributions In the morning, a series of lightning talks are planned, covering concrete, but smaller standardization proposals as well as introducing new standardization needs around SystemC. For each of these short presentations, time for an interactive discussion will be included to gather feedback and support and for identifying the next steps towards standardization. In the afternoon, in-depth topic sessions are planned again, enabling a 90-minute detailed and interactive technical discussion on the most significant ongoing and future topics around SystemC standardization. If you are interested in championing a topic for an afternoon session or presenting your favorite extension to the SystemC community as part of a lightning talk, please send a title and abstract with up-to 100-words (lightning talks) or 400 words (topic session) by end of June to systemc-evolution-day@lists.accellera.org. You will receive a notification of acceptance by September at the latest. Important dates: June 30, 2017 – Proposal abstract submission deadline September 1, 2017 – Notification of acceptance September 15, 2017 – Announcement of the program
  8. Philipp A Hartmann

    multiple b_transport methods

    You can chose whatever name you want in the target. You just register them to different sockets: // register different functions for each socket socket1.register_b_transport(this, &target::first_b_transport); socket2.register_b_transport(this, &target::second_b_transport); // in testbench, call b_transport on different sockets (assuming init_socket1/2 bound to target->socket1/2) init_socket1->b_transport(...); // will call target::first_b_transport init_socket2->b_transport(...); // will call target::second_b_transport /Philipp
  9. Philipp A Hartmann

    multiple b_transport methods

    But the above code should work. Just call "b_transport" (not "first_b_transport" and "second_b_transport") from your testbench. /Philipp
  10. Philipp A Hartmann

    multiple b_transport methods

    Why do you try to call b_transport_2(...) anywhere in your code? How do you register these functions to the simple socket? /Philipp
  11. Philipp A Hartmann

    implementing a fair mutex

    Your current implementation still depends on the scheduling order of the simulation kernel: If the mutex is not locked, the first scheduled process will obtain the lock, irrespectively of any current or future locking attempts in the same evaluation phase. For example, if one process repeatedly tries to lock the mutex directly after releasing it, the lock will be granted, even if there are other processes already waiting: void procA() { while(true) { mtx.lock(); // do some work wait( 10, sc_core::SCNS ); mtx.unlock(); // will get the lock back again immediately! } } void procB { // ask for the lock slightly later wait( 5, sc_core::SC_NS ); // continue as procA procA(); } In order to fix it, you'll at least need to check the queue before granting the lock (untested): while (s_queue.front() != sc_get_current_process_b() || in_use()) { sc_core::wait(m_free); } That said, you should not be using the implementation-defined sc_process_b class and use sc_process_handle and sc_get_current_process_handle() instead, to be more standards-compliant. Hope that helps, Philipp
  12. Philipp A Hartmann

    multiple b_transport methods

    Hi Veena, When you use simple_target_socket instances as described in the snippet above, you still call the normal b_transport on the initiator side. Can you show more context of the problem? Greetings from Duisburg, Philipp
  13. Hard to tell without details about what exact cast (i.e. between which types) is invalid. My guess would be the use of an array instead of the individual ports. /Philipp
  14. Third point: You're using a C-style array of ports, which won't work either. You should use an sc_vector (to name your ports) and use a loop to add the sensitivity (if you want to be sensitive to all ports in the vector): // change member sc_core::sc_vector< sc_core::sc_fifo_in<int> > in; // constructor scMWE::scMWE(sc_core::sc_module_name nm) : sc_core::sc_module(nm) , in("in", 4) // initialize vector { SC_METHOD(WritePseudo); for( auto& in_x : in ) // or a plain loop over the elements, if you don't have C++11 sensitive << in_x.data_written(); } /Philipp
  15. Oh, and I just realized, that your in port is an sc_fifo_in<int>, which doesn't have a default event (IIRC). You probably want to use the data_written event finder instead: sensitive << in.data_written(); Hope that helps as well, Philipp
  16. Hi Katang, your process function takes a parameter (int A). This is not supported for SC_METHOD et.al. Hope that helps, Philipp
  17. Philipp A Hartmann

    Clocked thread SC_CTHREAD exclusion during initialization phase

    No. These process flavors are subject to the dont_initialize() setting. See IEEE 1666-2011,, step (b): Greetings from Duisburg, Philipp
  18. Philipp A Hartmann

    Clocked thread SC_CTHREAD exclusion during initialization phase

    Because clocked threads are sensitive to an explicit clock. This clock does not have to be active during the start of the simulation. Greetings from Duisburg, Philipp
  19. Philipp A Hartmann

    Dynamic processes and initialization phase

    Yes, creating a process with dont_initialize() set just keeps it off the runnable queue until it is triggered by its static sensitivity (or through an explicit reset() on a process handle of it). Without dont_initialize(), static process are marked as runnable during the initialization phase, while dynamic processes are made runnable immediately (i.e. in the current/next evaluation phase). Hope that helps, Philipp
  20. Hi Antonio, as I understand it, the SystemC AMS proof-of-concept implementation is now provided by COSEDA, see http://www.coseda-tech.com/systemc-ams-proof-of-concept Hope that helps, Philipp
  21. Philipp A Hartmann

    Scope of SC_HAS_PROCESS

    Recommended practice is to put SC_HAS_PROCESS within the scope of the module itself: SC_MODULE(Module) { SC_HAS_PROCESS(Module); // ... }; Hope that helps, Philipp
  22. Philipp A Hartmann

    How to implement parent-child relationship?

    For an up-to-date documentation of SystemC, please refer to the IEEE Std. 1666-2011, available free of charge (thanks to the Accellera Systems Initiative) from http://standards.ieee.org/getieee/1666/download/1666-2011.pdf.
  23. Philipp A Hartmann

    systemC on visual studio 2015

    Try using the current public review release of SystemC 2.3.2 (see the following announcement): This version has been tested successfully on Visual Studio 2015. Hope that helps, Philipp
  24. Philipp A Hartmann

    SystemC 2.3.2 Public Review Now Open

    Hi Ameya, thanks for testing the 2.3.2 public review release! You mentioned, that you saw 15 errors when running the regressions on your platform? Would it be possible to share the list of failing tests and your platform/compiler versions? As you may have seen, I have opened a new topic about your C++ standard question here: Thanks for the analysis and the reporting of the issue. I have prepared a fix for the 2.3.2 final release which avoids the need for the synthesis of the ..._FILTER variable in test script. Instead, the optional filter is substituted directly from within the Makefile and GNU make supports variables starting with a digit. This topic is under discussion since quite some time both inside and outside of Accellera. The best option to contribute patches/fixes to the SystemC proof-of-concept implementations is of course to join the corresponding Accellera Working Groups. If this is not an option, let's continue to use this community forum for public discussions around SystemC and its proof-of-concept implementation. Greetings from Duisburg, Philipp
  25. Philipp A Hartmann

    Fail to install SystemC 2.3.1 on OpenSUSE Tumbleweed

    Hi Ahmed, apologies for the late reply. This is indeed an surprising behavior on your system. It seems the default "--libdir" setting from Autoconf is different on your platform - which is not expected. Can you please post the output of running ../configure --help In order to create the canonical "classic installation layout" of SystemC, you can override the --libdir default via (please note the single quotes): ../configure --libdir='${prefix}/lib' I'll look into the TESTNAME incompatibility for the final 2.3.2 release as well. Thanks and Greetings from Duisburg, Philipp