source: trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Simulation.h

Last change on this file was 138, checked in by rosiere, 14 years ago

1) add counters_t type for interface
2) fix in check load in load_store_unit
3) add parameters (but not yet implemented)
4) change environment and add script (distcc_env.sh ...)
5) add warning if an unser change rename flag with l.mtspr instruction
6) ...

  • Property svn:keywords set to Id
File size: 2.8 KB
Line 
1#ifdef SYSTEMC
2#ifndef morpheo_behavioural_Simulation_h
3#define morpheo_behavioural_Simulation_h
4
5/*
6 * $Id: Simulation.h 138 2010-05-12 17:34:01Z rosiere $
7 *
8 * [ Description ]
9 *
10 */
11
12#include "Common/include/Debug.h"
13#include "Behavioural/include/Model.h"
14#include <stdint.h>
15#include <systemc.h>
16#include <vector>
17
18namespace morpheo              {
19namespace behavioural          {
20
21  typedef enum
22    {
23      ALL_THREAD,
24      EACH_THREAD_AND_CONTINUE,
25      EACH_THREAD_AND_STOP
26    } stop_type_t;
27
28  extern bool                _simulation_stop_exception;
29  extern double              _simulation_nb_cycle;
30  extern double              _simulation_nb_instruction;
31  extern std::vector<double> _simulation_nb_instruction_commited;
32  extern stop_type_t         _simulation_stop_type;
33  extern bool                _simulation_file_with_date;
34  extern bool                _simulation_file_with_pid ;
35 
36  extern Model               _model;
37
38  bool simulation_test_end (void);
39  void simulation_init     (double      nb_cycle,
40                            double      denug_nb_cycle,
41                            double      nb_instruction,
42                            stop_type_t stop_type,
43                            bool        file_with_date,
44                            bool        file_with_pid);
45}; // end namespace behavioural         
46
47  template<> inline std::string toString<morpheo::behavioural::stop_type_t>(const morpheo::behavioural::stop_type_t& x)
48  {
49    switch (x)
50      {
51      case morpheo::behavioural::ALL_THREAD               : return "all_thread"; break;
52      case morpheo::behavioural::EACH_THREAD_AND_CONTINUE : return "each_thread_and_continue"; break;
53      case morpheo::behavioural::EACH_THREAD_AND_STOP     : return "each_thread_and_stop"; break;
54      default : return ""; break;
55      }
56  };
57
58  template<> inline morpheo::behavioural::stop_type_t fromString<morpheo::behavioural::stop_type_t>(const std::string& x)
59  {
60    if ((x.compare(toString(static_cast<uint32_t>(morpheo::behavioural::ALL_THREAD))) == 0) or
61        (x.compare(toString(                      morpheo::behavioural::ALL_THREAD )) == 0))
62      return morpheo::behavioural::ALL_THREAD;
63
64    if ((x.compare(toString(static_cast<uint32_t>(morpheo::behavioural::EACH_THREAD_AND_CONTINUE))) == 0) or
65        (x.compare(toString(                      morpheo::behavioural::EACH_THREAD_AND_CONTINUE )) == 0))
66      return morpheo::behavioural::EACH_THREAD_AND_CONTINUE;
67
68    if ((x.compare(toString(static_cast<uint32_t>(morpheo::behavioural::EACH_THREAD_AND_STOP))) == 0) or
69        (x.compare(toString(                      morpheo::behavioural::EACH_THREAD_AND_STOP )) == 0))
70      return morpheo::behavioural::EACH_THREAD_AND_STOP;
71
72    throw (ERRORMORPHEO ("fromString","Unknow string : \""+x+"\""));
73  };
74
75}; // end namespace morpheo             
76
77#endif
78#endif
Note: See TracBrowser for help on using the repository browser.