Jump to content

Matthias Jung

  • Content count

  • Joined

  • Last visited

  1. Kahn Process Networks (KPN) with SystemC

    I found a solution: https://github.com/tukl-msd/SCVP.artifacts/tree/master/kpn_artificial_deadlock Indeed it depends on the way how SystemC schedules the processes. Note that it may behave differently w.r.t. scheduling and therefore also w.r.t. FIFO sizes If you call wait(SC_ZERO_TIME) in between.
  2. Kahn Process Networks (KPN) with SystemC

    Dear Philipp, That is unfortunately not the case :( . When a process reads from a queue, the read is blocking. If the queue is empty, then the process will suspend until there is enough data in the queue. This allows even data dependent control flow or control flow depending on internal variables: process f(in int u, in int v, out int w) { int i; bool b = true; while (true) { i = b ? wait(u) : wait(w); printf("%i\n", i); send(i, w); b = !b; } } This is an example form Kahn's original paper in a C syntax. Alternately u and v is read. So it is not necessary that all incoming connections are required to fire the process. When a process blocks, the scheduler will not unblock the process until enough data becomes available on the blocking input port. Writes to the queues are non-blocking because the queue size is infinite. For the example that you show, you peek into the FIFOs which is not allowed for KPNs actually. Regards Matthias
  3. Hey, Kahn Process Networks are defined by the usage of unbounded FIFOs with blocking reads and non-blocking writes. I read on several sources that KPN with bounded FIFO size (i.e. blocking read and blocking write) can be implemented with SystemC (e.g. Grötker et al). It seams that the event based scheduler in SystemC behaves different like data-driven scheduler or a demand-driven for KPNs. I simulated the networks of Park's Dissertation shown on page 36 and 42 which should end up in an artificial deadlock (deadlock which occurs because of blocking write). A global artificial deadlock in SystemC would result in no scheduled events, and therefore, the simulation should be stopped. However, even with buffer size 1 for all FIFOs both examples from Park are continuing with execution: Page 63: http://www.edaplayground.com/x/6Mfi Page 42: http://www.edaplayground.com/x/4jLZ Note that edaplayground exits because of to much output. If you want to test it you better download it and run it on your PC. Apparently, the SystemC scheduler finds automatically a schedule for the KPN such that no artificial deadlocks occur. My question: is there an example where I could also see an artificial deadlock in SystemC? Thanks and Regards Matthias
  4. Question about cout and time

    Hey, is there a way or mechanism such that a cout or printf statement in an SC_METHOD is delayed to the last delta cycle before the time advances? Similar to the VCD traces? Such that only the last stable value is printed to the terminal. Regards Matthias
  5. Compiling SystemC on ARM

    In the context of the gem5 project we discovered that compiling SystemC does not work on ARM 64 bit (i.e. aarch64 has 64 bit longs). It can be fixed by adding this: https://gem5-review.googlesource.com/c/3462/1/ext/systemc/src/sysc/datatypes/int/sc_nbdefs.h Thank you and regards Matthias