Hadrian2002 Posted August 26, 2013 Report Share Posted August 26, 2013 Hi, i'm trying to analyse automatically a sc_module and generate for every registered process a dynamic process, which have the same static sensibility as the corresponding static process. I have managed to extract all process handles of a module, but I find no proper solution to copy the sensitive variable, or extract the triggering events of a process. My goal is, that the sc_module will not to be changed for this, if it is possible. I need it especially for SC_METHODs and SC_THREADs thanks in advance Quote Link to comment Share on other sites More sharing options...
Philipp A Hartmann Posted August 27, 2013 Report Share Posted August 27, 2013 IIRC, there is no standardized API to extract the (static) sensitivity of a process. On the other hand, since both SC_THREAD and SC_METHOD processes may use dynamic sensitivity in their process bodies, I'm not sure what problem this would actually solve (except for documentation purposes). What do you want to achieve? Greetings from Oldenburg, Philipp Quote Link to comment Share on other sites More sharing options...
Hadrian2002 Posted September 5, 2013 Author Report Share Posted September 5, 2013 Hi, my goal is somehow to create a scheduler for SC_METHODS, which needs only a few changes to a functional model. I'm spawning for every SC_METHOD a process, which waits on the same inputs, and mark this process as ready for execution. If the scheduler decides to schedule a specific SC_METHOD, the METHOD is resumed and after that suspended. My first attempt will use small modifications to the functional model, but I tried to remove that. kind regards Quote Link to comment Share on other sites More sharing options...
dakupoto Posted September 6, 2013 Report Share Posted September 6, 2013 Hi, i'm trying to analyse automatically a sc_module and generate for every registered process a dynamic process, which have the same static sensibility as the corresponding static process. I have managed to extract all process handles of a module, but I find no proper solution to copy the sensitive variable, or extract the triggering events of a process. My goal is, that the sc_module will not to be changed for this, if it is possible. I need it especially for SC_METHODs and SC_THREADs thanks in advance This is a question for all the SystemC gurus. I am a bit confused by the statement: "a dynamic process, which have the same static sensibility as the corresponding static process." How could a dynamic process have a "static" sensitivity ? Quote Link to comment Share on other sites More sharing options...
Hadrian2002 Posted September 6, 2013 Author Report Share Posted September 6, 2013 It is possible to pass a sc_event_list to the sc_spawn method, so this dynamic process ( dynamic in sense of creation while simulation and not in elaboration like normal processes) have the same static sensitivity Quote Link to comment Share on other sites More sharing options...
Philipp A Hartmann Posted September 6, 2013 Report Share Posted September 6, 2013 my goal is somehow to create a scheduler for SC_METHODS, which needs only a few changes to a functional model. I'm spawning for every SC_METHOD a process, which waits on the same inputs, and mark this process as ready for execution. If the scheduler decides to schedule a specific SC_METHOD, the METHOD is resumed and after that suspended. My first attempt will use small modifications to the functional model, but I tried to remove that. As said in my initial reply, you wouldn't be able to catch any dynamic sensitivity (next_trigger) with this approach. Secondly, how do you implement the suspension of the method "afterwards"? During the following update phase? This wouldn't catch any following immediate notifications of the "scheduled method" in the current evaluation phase. There are more fundamental problems to solve than "just" copying the static sensitivity. I would suggest to wrap the user function call in a helper function containing the interaction with your scheduler class, instead of using the process control statements. Alternatively, you can add a separate statement to mark a method as schedulable (but this would still not catch dynamic sensitivity in the user method): SC_METHOD( user_method ); schedulable(); sensitive << ...; // put _after_ schedulable() statement! // add to some base class, could eventually be implemented as a free function as well void schedulable() { // pseudo code static std::map<sc_process_handle, sc_event*> ev_map; // put in the scheduler sc_process_handle h = sc_get_current_process_handle(); sensitive << *(ev_map[h] = new sc_event); dont_initialize(); // create wrapper method SC_METHOD( sensitivity_method ); // mark "h" as runnable here // senstitivity in user code again } Greetings from Oldenburg, Philipp maehne 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.