Last change
on this file since 125 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
|
Line | |
---|
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" |
---|
10 | #include "Common/include/Systemc.h" |
---|
11 | #include "Common/include/ErrorMorpheo.h" |
---|
12 | |
---|
13 | namespace morpheo { |
---|
14 | namespace behavioural { |
---|
15 | |
---|
16 | bool simulation_test_end (void) |
---|
17 | { |
---|
18 | msgInformation("##########[ cycle %.0f ]\n",static_cast<double>(simulation_cycle())); |
---|
19 | |
---|
20 | // Test if a stop condition is activate |
---|
21 | if ((_simulation_nb_cycle == 0) and |
---|
22 | (_simulation_nb_instruction == 0) |
---|
23 | ) |
---|
24 | return false; |
---|
25 | |
---|
26 | bool end_cycle; |
---|
27 | bool end_inst ; |
---|
28 | |
---|
29 | if (_simulation_nb_cycle != 0) |
---|
30 | end_cycle = (_simulation_nb_cycle <= simulation_cycle()); |
---|
31 | else |
---|
32 | end_cycle = true; |
---|
33 | |
---|
34 | if (_simulation_nb_instruction != 0) |
---|
35 | { |
---|
36 | end_inst = true; |
---|
37 | |
---|
38 | std::vector<double>::iterator it=_simulation_nb_instruction_commited.begin(); |
---|
39 | |
---|
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; |
---|
49 | |
---|
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; |
---|
57 | } |
---|
58 | |
---|
59 | }; // end namespace behavioural |
---|
60 | }; // end namespace morpheo |
---|
61 | |
---|
62 | #endif |
---|
Note: See
TracBrowser
for help on using the repository browser.