source: trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Simulation.cpp @ 124

Last change on this file since 124 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: 2.5 KB
Line 
1#ifdef SYSTEMC
2/*
3 * $Id: Simulation.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/ErrorMorpheo.h"
11
12namespace morpheo              {
13namespace behavioural          {
14
15  static bool          simulation_initialized;
16  bool                _simulation_stop_exception;
17  double              _simulation_nb_cycle;
18  double              _simulation_nb_instruction;
19  std::vector<double> _simulation_nb_instruction_commited;
20  bool                _simulation_file_with_date;
21  bool                _simulation_file_with_pid ;
22
23  Model               _model;
24
25  void simulation_init (double nb_cycle,
26                        double debug_nb_cycle,
27                        double nb_instruction,
28                        bool   file_with_date,
29                        bool   file_with_pid )
30  {
31    if (not simulation_initialized)
32      {
33        if (debug_nb_cycle == 0)
34          {
35            _simulation_nb_cycle                = nb_cycle;
36            _simulation_stop_exception          = false;
37          }
38        else
39          {
40            _simulation_nb_cycle                = (debug_nb_cycle<nb_cycle)?debug_nb_cycle:nb_cycle;
41            _simulation_stop_exception          = (debug_nb_cycle<nb_cycle);
42          }
43
44        _simulation_nb_instruction          = nb_instruction;
45//      _simulation_nb_instruction_commited = new std::vector<double>;
46        _simulation_file_with_date          = file_with_date;
47        _simulation_file_with_pid           = file_with_pid ;
48
49        simulation_initialized = true;
50      }
51    else
52      {
53        msg_printf(WARNING,_("Multi instance of Morpheo : stop condition, take the highest."));
54
55        if (//(_simulation_nb_cycle == 0) or
56            (_simulation_nb_cycle < debug_nb_cycle))
57          {
58            _simulation_nb_cycle       = debug_nb_cycle;
59            _simulation_stop_exception = true;
60          }
61
62        if (//(_simulation_nb_cycle == 0) or
63            (_simulation_nb_cycle < nb_cycle))
64          {
65            _simulation_nb_cycle       = nb_cycle;
66            _simulation_stop_exception = false;
67          }
68       
69        if (//(_simulation_nb_instruction == 0) or
70            (_simulation_nb_instruction < nb_instruction))
71          _simulation_nb_instruction = nb_instruction;
72
73        _simulation_file_with_date          |= file_with_date;
74        _simulation_file_with_pid           |= file_with_pid ;
75      }
76  }
77   
78}; // end namespace behavioural         
79}; // end namespace morpheo             
80
81#endif
Note: See TracBrowser for help on using the repository browser.