Jump to content

ashwathgan

Members
  • Content Count

    30
  • Joined

  • Last visited

Everything posted by ashwathgan

  1. 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
  2. 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() s
  3. Thanks a lot Ralph The information was very useful
  4. 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
  5. 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
  6. 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
  7. 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 () an
  8. 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??
  9. 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
  10. 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
  11. Thanks a ton ralph. I am able to understand it now.
  12. Hi I just have one more doubt, Is it only because array of ports is not default constructable, copyable etc it is resulting in slower performance? And how sc_vector is more sophesticated than the array of ports in case of simulation speed? Im sorry for the stupid questions, but I just wanted a clear understanding.
  13. Hi Ralph Thanks a lot I will look into it.
  14. Hi all, I have a following design: I have created a the following Module (in SystemC) Task Module: (Thread) This module gets the load of each task, calculate the remaining time, stores the remaining Time in a global "list" called "ActivationTimings" and sends a signal to Timer Module Timer Module This Module recieves signal from all the task and choose the minimum value from the "ActivationTiming"and advances the Time through event. And the Task Module is sensitive to the event The above things happens till the remaining times of all tasks are zero. Since
  15. You are wonder Sir Thanks a lot. It worked. I will try with vectors now.
  16. Thanks a lot Sir. It cleared many of my doubts: I have one last doubt Now I have my main lik as follows: int sc_main(int argc, char* argv[]) { Manager*M1 = new Manager("Sys", "A", State::NOT_READY, 100, 1); Manager*M2 = new Manager("Mys", "B", State::NOT_READY, 20,1); sc_signal<bool> timing[1]; M1->calculateTime(timing[0]); M2->calculateTime(timing[1]); // Im confused about how to connect here with the Timer module as my code crashes at this Timer binding Timer T("timer"); for (int z = 0; z < 1; z++) { T.Timecal[z](timing[z]); } sc_start();
  17. int sc_main(int argc, char* argv[]) { // Manager(Module Name, Task Name, Initial State, Load, Speed) Manager*M1 = new Manager("Sys","A",State::NOT_READY,100,1); Manager*M2 = new Manager("Mys", "B", State::NOT_READY, 20,1); sc_signal<bool> timing; M1->calculateTime(timing); M2->calculateTime(timing); Timer T("timer"); T.Timecal(timing); sc_start(); system("PAUSE"); return(0); }
  18. Hi all I am trying to build a Statemachinefor different tasks that is given as input: To be more specific, i have different states like Not_ready, ready, running which would do some operations and advance the time respectively I have something like this: class StateMachine: public sc_module { enum state {NotREAdy, ready,..} sc_out<bool> out; void perform { switch (state) { case Not_ready: ... Do something and update state value to "ready" case Ready : Do something and update state value to "running" case Rnning : do some calculation and wait fo
  19. My Bad, I forgot to add the proper parameters in the constructor and completly overlooked it. its fixed. Thanks
  20. Nope, it is a normal C++ class
  21. Hi I have two modules and they look as follows: class Derived: public Base,public sc_module { ... .... ... Derived(sc_module_name name):sc_module(name){} }; SC_MODULE(Mysystem) { .... ..... SC_CTOR(Mysystem) {} }; int sc_main(...) { Mysystem MS("mine"); Derived D("derived"); sc_start(); } I get error: <E533> module name stack is empty : did you forget to add a parameter to your module constructor? Why it is showing this error though i provide a module name for "Derived"class?? No
×
×
  • Create New...