Jump to content

katang

Members
  • Content Count

    107
  • 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. 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
×
×
  • Create New...