source: trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Model.h @ 118

Last change on this file since 118 was 118, checked in by rosiere, 15 years ago

1) Stat List : scan all queue to find free register
2) Write_queue : test "genMealy" add bypass [0]
3) Functionnal_unit : add const parameters to add or not the pipeline_in
4) Load Store Unit : if load make an exception, free nb_check
5) Debug, change test to add model

  • Property svn:keywords set to Id
File size: 2.1 KB
Line 
1#ifndef morpheo_behavioural_Model_h
2#define morpheo_behavioural_Model_h
3
4/*
5 * $Id: Model.h 118 2009-05-20 22:01:32Z rosiere $
6 *
7 * [ Description ]
8 *
9 */
10
11#include "Common/include/ToString.h"
12#include "Common/include/FromString.h"
13#include "Common/include/ErrorMorpheo.h"
14#include <map>
15
16namespace morpheo              {
17namespace behavioural          {
18
19  typedef enum
20    {
21      MODEL_SYSTEMC,
22      MODEL_VHDL
23    } model_type_t;
24
25  typedef struct
26  {
27    model_type_t type ;
28    bool         debug;
29  } model_t;
30   
31  class Model
32  {
33  private : static const model_type_t default_type  = MODEL_SYSTEMC;
34  private : static const bool         default_debug = false;
35
36  private : std::map<std::string,model_t> models;
37
38  public  :               Model (void);
39  public  :              ~Model (void);
40  public  : void         set_model (std::string component, model_type_t type, bool debug);
41  public  : model_type_t get_type  (std::string component);
42  public  : bool         get_debug (std::string component);
43  public  : void         print     (void);
44  };
45 
46}; // end namespace behavioural         
47
48  template<> inline std::string toString<morpheo::behavioural::model_type_t>(const morpheo::behavioural::model_type_t& x)
49  {
50    switch (x)
51      {
52      case morpheo::behavioural::MODEL_SYSTEMC : return "systemc" ; break;
53      case morpheo::behavioural::MODEL_VHDL    : return "vhdl"    ; break;
54      default : return ""; break;
55      }
56  };
57
58  template<> inline morpheo::behavioural::model_type_t fromString<morpheo::behavioural::model_type_t>(const std::string& x)
59  {
60    if ( (x.compare(toString(static_cast<uint32_t>(morpheo::behavioural::MODEL_SYSTEMC))) == 0) or
61         (x.compare("model_systemc") == 0) or
62         (x.compare("systemc") == 0)
63         )
64      return morpheo::behavioural::MODEL_SYSTEMC;
65    if ( (x.compare(toString(static_cast<uint32_t>(morpheo::behavioural::MODEL_VHDL))) == 0) or
66         (x.compare("model_vhdl") == 0) or
67         (x.compare("vhdl") == 0))
68      return morpheo::behavioural::MODEL_VHDL;
69    throw (ERRORMORPHEO ("fromString","Unknow string : \""+x+"\"\n"));
70  };
71
72}; // end namespace morpheo             
73
74#endif
75
Note: See TracBrowser for help on using the repository browser.