Jump to content

Copy sensitive for dynamic process


Hadrian2002

Recommended Posts

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

 

 

Link to post
Share on other sites

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

Link to post
Share on other sites
  • 2 weeks later...

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

Link to post
Share on other sites


 

 


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 ? 

Link to post
Share on other sites

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

Link to post
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...