Jump to content


  • Content Count

  • Joined

  • Last visited

  1. plafratt

    waiting on an array of events

    Is there a preferred way of adding an event to the static sensitivity list for a single wait? I think it would be possible by ORing the static sensitivity list with another event, and sending the result to a wait. The problem is that I don't see an accessor function for a thread's sensitivity list. I guess one approach is to hard-code an sc_event_or_list that includes the static sensitivity list, but that seems a little clunky. sc_event_or_list or_list; for (int i=0; i< 100; i++) or_list |= my_array_of_100_events; or_list |= new_event; wait( or_list ); Is there a better way to add an event to the sensitivity list for a single wait? Thanks, Patrick
  2. Philipp, Thanks for the response. This is very helpful. This makes sense now. I had noticed the use of the dereference operator, and it had caught my attention since the initiator_socket hadn't been declared as a pointer. But it didn't occur to me to look into that further. I think perhaps I was too distracted with my search through the inheritance hierarchy. Thanks again, Patrick
  3. I am a bit confused by the usage of the b_transport function in the file examples/tlm/common/src/lt_initiator.cpp. The lt_initiator class has a simple_socket_initiator member that is calling the b_transport function, and I’m trying to figure out how the simple_socket_initiator class is getting access to this function. The only connection in the inheritance hierarchy I’ve been able to find between simple_socket_initiator and the b_transport function is a distant link through a friend declaration in the tlm_base_target_initiator class. I’ve drawn a diagram showing this connection. This diagram is attached. I could be wrong, but I don’t think that this connection would allow the simple_socket_initiator to access b_transport. I am lead to the conclusion that I think there is some other connection between simple_socket_initiator and b_transport that I am not seeing. At runtime, simple_socket_initiator’s b_transport function call is getting resolved to simple_target_socket’s implementation. I’m just not sure how this resolution is happening. Any help anyone can offer is appreciated.
  4. plafratt

    Advtanges of TLM

    I just found this discussion on this topic, which was very helpful. However, any additional thoughts that anyone might have on the topic are appreciated.
  5. Hello, In my previous modelling efforts with SystemC, I have, in general, used SystemC FIFOs for communication in abstract models. I have learned the basics of TLM and gone through a couple of examples, but it isn't clear to me what the advantages are of TLM over FIFOs. Someone has explained to me that there are performance advantages of TLM. However, for my purposes, I am not so concerned with performance. Does anyone have a reference that presents the advantages of TLM over more conventional communication mechanisms in SystemC? Any help is appreciated. Thanks, Patrick
  6. plafratt

    Parallel Simulation

    Jens, Sumit- I haven't tried what Jens has proposed with OpenMP, so I can't speak from experience. However, my understanding is that Jens is perhaps not trying to parallelize a single call to sc_main, but rather trying something akin to creating multiple processes, each from its own sc_main. If each sc_main is isolated from the others, perhaps each could have its own elaboration. This seems to me like something that might be feasible. However, I would not think that SystemC's internal processes (i.e. sc_methods, sc_threads, etc.) could be synchronized across processes in such an environment. Regards, Patrick
  7. I am learning about TLM to determine its feasibility for modeling component interfaces among modules that aren't modeled in SystemC. That is, I want to use TLM to model interfaces among components modeled with, say, C++ and/or VHDL. I want to be able to leave out sc_main and sc_start completely. Is TLM useful in such a context, or does it require the use of sc_main and sc_start? Thanks, Patrick
  8. plafratt

    Parallel Simulation

    Thank you for the responses, everyone. This is quite helpful. I will keep an eye out for ongoing efforts to parallelize SystemC. Regards, Patrick
  9. plafratt

    Parallel Simulation

    I am interested in learning whether SystemC supports parallel simulation - that is, utilizing multicore processor or multiprocessor systems to speed up simulations. I see in the SystemC 2.1 Features document the specification of a function sc_spawn. Does this function spawn an new Linux process? Near the end of the Features document, there is mention of thread support based on Posix threads. Does building SystemC with pthreads enabled allow for multi-threaded simulations? If so, is a thread created for each SC_THREAD and SC_METHOD, or is some other approach used? Any help is appreciated. Patrick