Jump to content


  • Content Count

  • Joined

  • Last visited

Everything posted by katang

  1. I need to recompile my app , because I need to use a library that actively uses some features of C++17. However, when I attempt to use it, I receive messages SystemC/2.3.3@minres/stable: Trying with 'minres'... Downloading conanmanifest.txt Downloading conanfile.py SystemC/2.3.3@minres/stable: Downloaded recipe revision 0 ERROR: SystemC/2.3.3@minres/stable: '17' is not a valid 'options.stdcxx' value. Possible values are ['11', '14', '98'] (I would be happy with 14, but that author was not)
  2. I am trying to figure out what module fired. My idea is shown below: the main program runs till the next event, and stops. At that point, I guess, there is no "current_process", so the lines in the comment do not work. Is there something similar for "past_process"? while(sc_pending_activity_at_future_time()) { sc_start( sc_time_to_pending_activity() ); // Run up to the next activity} /* sc_process_handle T = sc_get_current_process_handle(); sc_object* P = T.get_parent_object(); sc_object *Q = sc_get_current_process_b()->get_parent
  3. Hm. You are voting for quasi-asynchronous operation? I like the idea. Not only because of context switching. I'll learn it. Thank you. So you say, there is no better idea, than to set a flag around notify(), and use that to distinguish the citizens? I think I understand sc_pending_activity_at_future_time() and sc_pending_activity_at_current_time() but, just for my curiosity: how can a clock influence sc_pending_activity()
  4. I want to run my simulation (a clocked design) event-by-event, but do not want to see the clock events. In my design I set a flag upon receiving a clock signal, so in this way I can distinguish the "clock-only" events. However, two more events are also attached to the clock. I have a 15 ns wait in my "design", and I have output such as 14 ns Current Pending Future Pending 14 ns Current Pending Future Pending 14 ns Time Current NOT Pending Future Pending 14050 ps Current Pending Future Pending 14050 ps Current Pending Future Pending 14050 ps Time Current NOT Pending Future Pending
  5. I have a processor-like construction, and the execution time is simulated in the model using wait(time), i.e. I indend to provide the simulated execution time as argument of sc_start(), to imitate step-wise execution. Can I be sure, that in the model, the simulation will stop 'after' executing the simulated instruction; that is, reaching limiting time will terminate execution at the very end of the delta cycle? The other possibility that timeout is only one of the events, and by chance, it can be NOT the last. BTW: as I understood, a second sc_start() will continue sim
  6. In my main program, I have declared sc_signal<bool, SC_MANY_WRITERS> main_full("full"); later I attempt to bind it as main_fifo1.fifo_full(main_full); but my compiler keeps saying no match for call to ‘(sc_core::sc_signal<bool, (sc_core::sc_writer_policy)1>) (sc_core::sc_signal<bool, (sc_core::sc_writer_policy)1>&)’ My other module declares sc_signal<bool, SC_MANY_WRITERS> fifo_full; With the other policy, I have no problem with binding. What do I wrong?
  7. I want to share some modules; something similar to when HW threads share the same physical core, but they run different SW threads. My idea is that I need vectors of events and data structures. When using static threads, I cannot change simply and safely the thread, and actually, I need to repeat the code for the threads., Even if I use dynamic threads, and can have parameters, the processes must be distinguished and I need several handles. I would need something as when an item on an event vector sends notification, the shared common code receives the index of the item in
  8. Concerning the waiting: the next_trigger header tells next_trigger() uses all the syntax of wait(), and behaves as if the actual process of "waiting" occurs after the method exits. The next sentence gives a hint, that it "may gain the effect of a wait" but does tell that ! ONLY if I use it in a state machine!. By using a state variable member in the module class, a method may gain the effect of a wait as illustrated in the following example. example code tells // Wait 1 ns similar to Verilog #1 next_trigger(1,SC_NS); Thanks for the explanation. When one s
  9. I am not sure, but: with the construction SC_THREAD(Thread_node); // PROBLEMATIC LINE dont_initialize(); you say that "I have a thread, that is not sensitive to any event (==cannot be started later), and should not be started at the beginning. Maybe the kernel is not prepared for such a request. Concerning "to instantiate a arbitrary number of processes": you probably have some upper limit on the number of processes, so you can instantiate that maximum number of modules, and than later you limit the actual (active) modules in the simulation to the random value you genera
  10. SC started @ 0 s External host thread initial processing Before Event 1 notified from an external host thread ThreadSafeNotify called @ 0 s After Event 1 notified from an external host thread Event 2 notified from an external host thread ThreadSafeNotify called @ 0 s ThreadSafeUpdate called @ 0 s Got event in triggered @ 0 s Got event after next_trigger(10,SC_NS) @ 0 s Got event in triggered again @ 0 s Initializing main() @ 0 s Wait event in main() @ 15 ns SC returned Maybe this issue deserves a separate thread. The output shows, that the time passes only in thread but not method, or
  11. I wonder what is wrong with using usleep(). If I replace it with a dummy cycle, my output is as shown below Interestingly/importantly: 1/ Initializing main() appears where I expected, and correspondingly the event is received also in main(). However, this seems to be a random event; most of the outputs show that main() is intialized only !after! the events serviced, see the 2nd output. 2/ Event2 is sent and received as expected, but 'main()' persist hiding Maybe async_request_update() was not designed to be used right at the beginning of the simulation and somet
  12. I am getting confused. My output is SC started External host thread started Before Event 1 notified from an external host thread ThreadSafeNotify called After Event 1 notified from an external host thread ThreadSafeUpdate called Got event in triggered Got event after next_trigger Got event in triggered again Initializing main() SC returned I expected 1/ main() is executed before anything starts 2/ also the "After usleep" and "Event 2" messages appear #include <systemc> #include <pthread.h> #include <unistd.h> using namespace sc_core; class ThreadSaf
  13. Sorry, I noticed that I did not insert the new source code So, the output again is SC started SC first event notified ThreadSafeNotify called External host thread started Event 1 notified from an external host thread ThreadSafeNotify called ThreadSafeUpdate called Got event in triggered SC returned I am missing 1/ why the "Event2 notified" line is missing (the thread should terminate only after printing it) As the output is prompt, I guess the thread terminates before reaching printing The update() is called after the second notify(); I expected it is called after th
  14. It looks like I could not understand some essential points of async_request_update() In the sample program below (if the usleep in externalHostThread is commented out, the output is) SC first event notified ThreadSafeNotify called External host thread started Event 1 notified from an external host thread ThreadSafeNotify called Event 2 notified from an external host thread ThreadSafeNotify called ThreadSafeUpdate called Got event in triggered SC returned if it is uncommented, the output is SC started SC first event notified ThreadSafeNotify called External host thread
  15. I have found a complete code example (the location is shown at the bottom), that operates with wait(time); the method proposed by David Black, too. The source code argumentation seems to be reasonable, and the example works with the vast sleep times. It seems to me that for some reason the waiting does not work: the timing of the event makes the synchronization, rather than the event notification sent after the timing is over. The code below produces the output SC started External host thread started Done 1 Done 2 Done 3 Event 1 notified from an external host thread Event 2 notified from
  16. 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.
  17. 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
  18. 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 e
  19. 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
  20. 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
  21. It is defined as #define SCTIME_CLOCKTIME sc_time(100,sc_core::SC_PS)
  22. Sorry. The question was bad. I meant that the self-notification is delayed, so it is not immediate any more. Do I miss something?
  23. 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, w
  24. 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 🙂
  25. 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.
  • Create New...