[88] | 1 | #ifdef SYSTEMC |
---|
| 2 | /* |
---|
| 3 | * $Id: Simulation.cpp 88 2008-12-10 18:31:39Z rosiere $ |
---|
| 4 | * |
---|
| 5 | * [ Description ] |
---|
| 6 | * |
---|
| 7 | */ |
---|
| 8 | |
---|
| 9 | #include "Behavioural/include/Simulation.h" |
---|
| 10 | #include "Common/include/ErrorMorpheo.h" |
---|
| 11 | |
---|
| 12 | namespace morpheo { |
---|
| 13 | namespace behavioural { |
---|
| 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 | // } |
---|
| 39 | |
---|
| 40 | void simulation_init (double nb_cycle, |
---|
| 41 | double nb_instruction) |
---|
| 42 | { |
---|
| 43 | if (not simulation_initialized) |
---|
| 44 | { |
---|
| 45 | // _simulation_num_context_next = 0; |
---|
| 46 | _simulation_nb_cycle = nb_cycle ; |
---|
| 47 | // _simulation_nb_instruction = nb_instruction; |
---|
| 48 | |
---|
| 49 | if (nb_instruction != 0) |
---|
| 50 | throw ERRORMORPHEO("simulation_init",_("Stop Condition on number instruction is not yet implemented")); |
---|
| 51 | |
---|
| 52 | simulation_initialized = true; |
---|
| 53 | } |
---|
| 54 | else |
---|
| 55 | { |
---|
| 56 | msg_printf(WARNING,_("Multi instance of Morpheo : stop condition, take the highest.")); |
---|
| 57 | |
---|
| 58 | if (_simulation_nb_cycle < nb_cycle) |
---|
| 59 | _simulation_nb_cycle = nb_cycle; |
---|
| 60 | |
---|
| 61 | // if (_simulation_nb_instruction < nb_instruction) |
---|
| 62 | // _simulation_nb_instruction = nb_instruction; |
---|
| 63 | } |
---|
| 64 | } |
---|
| 65 | |
---|
| 66 | }; // end namespace behavioural |
---|
| 67 | }; // end namespace morpheo |
---|
| 68 | |
---|
| 69 | #endif |
---|