Changeset 110 for trunk/IPs/systemC/processor/Morpheo/Behavioural/src
- Timestamp:
- Feb 19, 2009, 5:31:47 PM (16 years ago)
- Location:
- trunk/IPs/systemC/processor/Morpheo/Behavioural/src
- Files:
-
- 1 deleted
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Simulation.cpp
r88 r110 13 13 namespace behavioural { 14 14 15 static bool simulation_initialized; 16 // static uint32_t _simulation_num_context_next; 17 double _simulation_nb_cycle; 18 // double _simulation_nb_instruction; 19 // std::vector<double> * _simulation_nb_instruction_commited; 20 21 // Simulation::Simulation (void): 22 // _num_context (_simulation_num_context_next) 23 // { 24 // // Test if is first context create 25 // if (_simulation_num_context_next == 0) 26 // _simulation_nb_instruction_commited = new std::vector<double>; 27 28 // _simulation_num_context_next ++; 29 // } 30 31 // Simulation::~Simulation (void) 32 // { 33 // _simulation_num_context_next --; 34 35 // // Test if is last context destroy 36 // if (_simulation_num_context_next == 0) 37 // delete _simulation_nb_instruction_commited; 38 // } 15 static bool simulation_initialized; 16 double _simulation_nb_cycle; 17 double _simulation_nb_instruction; 18 std::vector<double> _simulation_nb_instruction_commited; 39 19 40 20 void simulation_init (double nb_cycle, … … 43 23 if (not simulation_initialized) 44 24 { 45 // _simulation_num_context_next = 0;46 _simulation_nb_ cycle = nb_cycle;47 // _simulation_nb_instruction = nb_instruction;25 _simulation_nb_cycle = nb_cycle; 26 _simulation_nb_instruction = nb_instruction; 27 // _simulation_nb_instruction_commited = new std::vector<double>; 48 28 49 if (nb_instruction != 0)50 throw ERRORMORPHEO("simulation_init",_("Stop Condition on number instruction is not yet implemented"));51 52 29 simulation_initialized = true; 53 30 } … … 59 36 _simulation_nb_cycle = nb_cycle; 60 37 61 //if (_simulation_nb_instruction < nb_instruction)62 //_simulation_nb_instruction = nb_instruction;38 if (_simulation_nb_instruction < nb_instruction) 39 _simulation_nb_instruction = nb_instruction; 63 40 } 64 41 } -
trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Simulation_test_end.cpp
r88 r110 17 17 18 18 // Test if a stop condition is activate 19 if ((_simulation_nb_cycle == 0) //and20 //(_simulation_nb_instruction == 0)19 if ((_simulation_nb_cycle == 0) and 20 (_simulation_nb_instruction == 0) 21 21 ) 22 22 return false; 23 23 24 bool end_cycle = true;25 // bool end_inst = true;24 bool end_cycle; 25 bool end_inst ; 26 26 27 27 if (_simulation_nb_cycle != 0) 28 28 end_cycle = (_simulation_nb_cycle <= sc_simulation_time()); 29 else 30 end_cycle = true; 29 31 30 // if (_simulation_nb_instruction != 0) 31 // { 32 // std::vector<double>::iterator it=_simulation_nb_instruction_commited->begin(); 32 if (_simulation_nb_instruction != 0) 33 { 34 end_inst = true; 35 36 std::vector<double>::iterator it=_simulation_nb_instruction_commited.begin(); 33 37 34 // // Scan all context and test if all can finish 35 // while (end_inst and it!=_simulation_nb_instruction_commited->end()) 36 // { 37 // end_inst &= (*it <= _simulation_nb_instruction); 38 // it ++; 39 // } 40 // } 38 // Scan all context and test if all can finish 39 while (end_inst and it!=_simulation_nb_instruction_commited.end()) 40 { 41 end_inst &= (_simulation_nb_instruction <= *it); 42 it ++; 43 } 44 } 45 else 46 end_inst = true; 41 47 42 return end_cycle // and end_inst 43 ; 48 return end_cycle and end_inst; 44 49 } 45 50 -
trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Stat_alloc_operand.cpp
r81 r110 4 4 namespace morpheo { 5 5 namespace behavioural { 6 7 #undef FUNCTION 8 #define FUNCTION "Stat::alloc_operand" 6 9 counter_t * Stat::alloc_operand (counter_type_t type, std::string varname, std::string unit, std::string description) 7 10 { 8 11 if (not is_valid_var (varname)) 9 throw(ERRORMORPHEO( "Stat::alloc_operand",_("Variable is not valid.")));12 throw(ERRORMORPHEO(FUNCTION,toString(_("<%s> : Variable \"%s\" is not valid."),_name_instance.c_str(),varname.c_str()))); 10 13 11 14 counter_t * counter = new counter_t; -
trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Stat_create_expr.cpp
r85 r110 5 5 namespace behavioural { 6 6 7 #undef FUNCTION 8 #define FUNCTION "Stat::create_expr" 7 9 void Stat::create_expr (std::string varname, 8 10 std::string expr, … … 10 12 { 11 13 if (is_valid_var (varname)) 12 throw(ERRORMORPHEO( "Stat::create_expr",_("Variable is not valid.")));14 throw(ERRORMORPHEO(FUNCTION,toString(_("<%s> Variable \"%s\" is not valid."),_name_instance.c_str(),varname.c_str()))); 13 15 14 16 expr_t expression;
Note: See TracChangeset
for help on using the changeset viewer.