Jump to content

Xesium

Members
  • Content Count

    9
  • Joined

  • Last visited

  1. Actually I found the answer to my question here: https://stackoverflow.com/questions/19227664/whats-the-c-idiom-equivalent-to-the-java-static-block There is a notion of static block that runs prior to all static variables' initializations. This helped solve the issue as I used the static block to set the time resolution.
  2. Very good point. If that's the case (which probably is), is there any way to ever setting time resolution? I knew the compiler would take space for global/static variables and will zero out that piece of memory. Didn't think constructors for those objects will be called prior to sc_main execution! Trying a piece of code and sounds like that's the case. So back to my question, how can I ever set the time resolution assuming that I can't change the current structure of the code?
  3. Hi, I have a complicated logger which uses sc_time().value() to print the value of the time. Currently everything is printed in ps resolution. My system at best runs in ms resolution. I want to change the time resolution using sc_set_time_resolution. So I put sc_set_time_resolution(1,sc_core::SC_MS); as the very first line in my sc_main(argc, argv). However the model fails in run-time due to "sc_time object(s) constructed". I'm not quite sure how on the very first line of sc_main() a sc_time object has been created. Any insight is very much appreciated. Also if my appr
  4. Thanks. That's an interesting idea. I ended up solving it a different way though. I decided to go away from explicit binding though. Basically ended developing a thin infrastructure layer on top of SystemC and define my own version of ports/exports where I can change the bindings on the fly. Of course I'm losing all the sanity checks and sophistication that is done on port/export bidings. If you think that's an exceptionally bad path to take please let me know. At this moment it's working for me but then if I realize that it's extremely error prone then I'd rather do the right thing.
  5. Thanks a lot David. Having been developing SystemC models for years, I cherish your insight. I have attached a sample of design I'm trying to model. Tasks T_A communicate with tasks T_B over a communication channel (depicted as FIFOs). The connections between T_A and T_Bs are changing. Communication Manager (depicted) manages how the connections should be changing. I can pull in the communication channels (FIFOs with added features) into the implementation of T_A or T_Bs but it's not a good representative of the actual system. I was hoping to keep them as separate entities (keep all
  6. hmm, sounds like I can't delete my previous response. Please see my following response:
  7. Thanks a lot. I hope there was a way to avoid hacky solutions. I know SystemC is heavily used for modeling SoCs (where things are pretty much fixed by design) but this is a real network-related use case which I could happily use SystemC to model.
  8. Hi guys I'm working on a simulation system that the connection between components changes during the execution of the system. First time I'm facing this issue and not quite sure if I can change module to module connections during run-time and dynamically. Any thoughts how I can do this in SystemC? Thanks
×
×
  • Create New...