Jump to content


  • Content count

  • Joined

  • Last visited

About ashwathgan

  • Rank
    Advanced Member
  1. Future Work in SystemC

    Thanks Roman Papov
  2. Future Work in SystemC

    Hi all I did a project in SystemC. I was using SystemC threads and found them to be having a bottleneck due to wait statements due to context switching. So I was just interested to know what are the future works in store for SystemC?? Regards Ashwath
  3. Methods and Threads in same module

    Thanks Alan
  4. Hi all I was trying something like: SC_MODULE(A) { sc_out<bool> outP; bool var = false; void procc1() { outP.write(true); var = true; } void procc2() { while(some_condition) { if(var) { print something} wait(SC_ZER_TIME); } } constructor }; and I have another module which recives the output like: SC_MODULE(B ) { sc_in<>bool> inP; void procs3() { if(inP.read()) { print something }} constructor }; I elaborated in the order with A being instantated first and B being instantiated second. Hence, I could see the procc1() starting first. but what I then saw was that the thread procc2() was not executed, rather the procc3() from the module B was executed and then after that only procc2() got executyed. Is there any reason why the thread was ignored to be executed in the first place? Thanks
  5. Imeediate notification error

    Thanks a lot Ralph The information was very useful
  6. Imeediate notification error

    Thank you Ralph. I understand. But i want to achieve something like the following I have thread A which can start immediately after start of simulation(sc_start()) and it takes 5 time period to complete I have thread B which can also start immediately after start of simulation and takes 5 time period Though A and B can potentialy start and run at the same time, i wanted to achieve a random interleaving of both these threads . For example, thread A must start at 0 and run till 5 through wait(time_period,SC_NS) and again runs till 10ns. Till now b must be blocked, so now B blocks A and runs for number of times and A starts back again Regards Ashwath
  7. Imeediate notification error

    Hi all I have a SystemC thread. I create two instances of this thread in main ( so, now two threads are ready to run) What I tired was to randomize the execution order of these two threads, hence i used a event.notify() But when I do that, i get the warning "immediate Self Notification ignored" Where am I going wrong? thanks in advance regards Ashwath
  8. wait () vs wait (event)

    Hi Ralph Thanks for the explanation. I could understand it for wait (event) from your explanation. Is there any reason for order of execution of wait () as it executes in opposite order of wait (event) ?? Thanks
  9. wait () vs wait (event)

    Hi all I noticed a small behavioral pattern of both the above wait statements and I need a small help in understanding it I have a System C thread as follows: SC_MODULE(Task) { sc_out<bool> output .... .... wait (); ... ... SC_CTOR() { sensitive << event } SC_MODULE(Timer) { sc_in<bool> inp [1]; ..... ... event.notify(N, SC_NS); .... } sc_main() { Task* A = .... Task* B =..... } Now, the thing I observed during simulation is: 1. When I use wait (), first task A thread starts and encounters wait () and then Task B encounters wait (). Thus after the event gets triggered, task B wakes up first and then task A wakes up. 2. But when i use wait (event) instead of wait (), then it happens vice versa. that is, first task A wakes up and then task b wakes up after event is notified from timer mdoule. Why is this behaviour? Thanks in advance for any answer
  10. Shared Variables in SC_THREAD

    Thanks a lot sir. It worked
  11. wait() - performance Bottleneck

    Thanks a lot Alan
  12. wait() - performance Bottleneck

    Thanks a lot for the reply sir. Is there any important reason for the slowdown caused by "wait()"statement in addition to the context switching??
  13. Hi all I have a project where I create SystemC threads and they perform co operatively with wait(event) statement in two places of the algorithm. The algorithm works fine. But, the problem is when I run the algorithm for multiple times (like 1000 times), I could see a lot of time is consumed by the wait() statements. (I used a Visual Studio Community 2013 profiler) Is it a performance bottleneck if it runs for many times?? Sorry, if my question is abstract. I am happy to elaborate further if my question is not clear thanks
  14. Shared Variables in SC_THREAD

    Hi all If I have something like follows: SC_MODULE(Test) { ... int t1; // Want this variable to be shared void tesst() { t1 = t1 +2; } SC_CTOR(Test) { SC_THREAD(tesst) } And then I create two instances of Test as Test *t1 = new ....; Test *t2 = new ... Then , how can make the varible "t1"shared by both the instances/ threads? In other words, I want this variable to be updated by both the threads. Thanks
  15. Array of Ports

    Thanks a ton ralph. I am able to understand it now.