Jump to content

mladia

Members
  • Content Count

    2
  • Joined

  • Last visited

  1. I am working on a bigger projects for simulation of a computer architecture. I have provided the a minimal example int sc_main(): sc_signal<bool> task_finished[ 16 ] std::vector< PipelineLeon* > pipelines( 16 , NULL ); for( vector< cpu_spec >::iterator it = cpu_list->begin(); cpu_list->end() != it; ++it ) { //init pipeline //... pipeline->task_finished( task_finished[ it->cpu_index ]); } TaskSchedulerTemplate* task_scheduler = create_new_scheduler("Task-Scheduler", &pipelines); pipeline_leon.h: class PipelineLeon : public sc_core::sc_module { public: TaskSchedulerTemplate *task_scheduler sc_out <bool> task_finished; SC_HAS_PROCESS( PipelineLeon ); finish_syscall( int exit_state ); } pipeline_leon.cpp: //gets called sometime during the simulation void PipelineLeon::finish_syscall( int exit_state ) { task_schdeduler->trigger(); task_finished->write(true); } task_scheduler.h: class TaskSchedulerTemplate : public sc_core::sc_module { public: sc_in<bool> * task_finished; SC_HAS_PROCESS( TaskSchedulerTemplate ); task_finished_action(); TaskSchedulerTemplate( sc_module_name name, std::vector<PipelineLeon*> * pipelines); inline virtual void trigger() { trigger_task_scheduler.notify( SC_ZERO_TIME ); sc_event_queue trigger_task_scheduler; schedule_task(); } // calling basically TaskSchedulerTemplate TaskSchedulerTemplate* create_new_scheduler( sc_module_name name, std::vector <PipelineLeon*> * _pipelines ); task_scheduler.cpp: TaskSchedulerTemplate::TaskSchedulerTemplate(sc_module_name name, std::vector<PipelineLeon*> * _pipelines) : sc_module(name), pipelines(_pipelines) { SC_METHOD( schedule_task ); sensitive << trigger_task_scheduler; dont_initialize(); task_finished = new sc_in <bool> [number_of_pipelines]; for (vector<PipelineLeon*>::iterator pipeline = pipelines->begin() ; pipeline != pipelines->end() ; pipeline++ ){ task_finished[ (*pipeline)->get_cpu_index() ]( (*pipeline)->task_finished ); } SC_METHOD(task_finished_action); for (int i = 0; i< number_of_pipelines; i++) { sensitive << task_finished[i].pos(); } dont_initialize(); } There are more pipelines and every one of them has this port task_finished, which is connected in the task_scheduler. Everything compiles properly. The problem is that the method task_finished_action does not get called at all, when finish_syscall is executed. What am I missing. This should work like that, right?
×
×
  • Create New...