Last change
on this file since 136 was
124,
checked in by rosiere, 15 years ago
|
1) Add test and configuration
2) Fix Bug
3) Add log file in load store unit
4) Fix Bug in environment
|
-
Property svn:keywords set to
Id
|
File size:
1.4 KB
|
Rev | Line | |
---|
[88] | 1 | #ifdef SYSTEMC |
---|
| 2 | /* |
---|
| 3 | * $Id: Simulation_test_end.cpp 124 2009-06-17 12:11:25Z rosiere $ |
---|
| 4 | * |
---|
| 5 | * [ Description ] |
---|
| 6 | * |
---|
| 7 | */ |
---|
| 8 | |
---|
| 9 | #include "Behavioural/include/Simulation.h" |
---|
[113] | 10 | #include "Common/include/Systemc.h" |
---|
[124] | 11 | #include "Common/include/ErrorMorpheo.h" |
---|
[88] | 12 | |
---|
| 13 | namespace morpheo { |
---|
| 14 | namespace behavioural { |
---|
| 15 | |
---|
| 16 | bool simulation_test_end (void) |
---|
| 17 | { |
---|
[117] | 18 | msgInformation("##########[ cycle %.0f ]\n",static_cast<double>(simulation_cycle())); |
---|
[88] | 19 | |
---|
| 20 | // Test if a stop condition is activate |
---|
[110] | 21 | if ((_simulation_nb_cycle == 0) and |
---|
| 22 | (_simulation_nb_instruction == 0) |
---|
[88] | 23 | ) |
---|
| 24 | return false; |
---|
| 25 | |
---|
[110] | 26 | bool end_cycle; |
---|
| 27 | bool end_inst ; |
---|
[88] | 28 | |
---|
| 29 | if (_simulation_nb_cycle != 0) |
---|
[113] | 30 | end_cycle = (_simulation_nb_cycle <= simulation_cycle()); |
---|
[110] | 31 | else |
---|
| 32 | end_cycle = true; |
---|
[88] | 33 | |
---|
[110] | 34 | if (_simulation_nb_instruction != 0) |
---|
| 35 | { |
---|
| 36 | end_inst = true; |
---|
| 37 | |
---|
| 38 | std::vector<double>::iterator it=_simulation_nb_instruction_commited.begin(); |
---|
[88] | 39 | |
---|
[110] | 40 | // Scan all context and test if all can finish |
---|
| 41 | while (end_inst and it!=_simulation_nb_instruction_commited.end()) |
---|
| 42 | { |
---|
| 43 | end_inst &= (_simulation_nb_instruction <= *it); |
---|
| 44 | it ++; |
---|
| 45 | } |
---|
| 46 | } |
---|
| 47 | else |
---|
| 48 | end_inst = true; |
---|
[88] | 49 | |
---|
[124] | 50 | if (end_cycle and _simulation_stop_exception) |
---|
| 51 | { |
---|
| 52 | throw ErrorMorpheo(_("Maximal cycles Reached")); |
---|
| 53 | return false; |
---|
| 54 | } |
---|
| 55 | else |
---|
| 56 | return end_cycle and end_inst; |
---|
[88] | 57 | } |
---|
| 58 | |
---|
| 59 | }; // end namespace behavioural |
---|
| 60 | }; // end namespace morpheo |
---|
| 61 | |
---|
| 62 | #endif |
---|
Note: See
TracBrowser
for help on using the repository browser.