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

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

1) Add modelsim simulation systemC
2) Modelsim cosimulation systemC / VHDL is not finish !!!! (cf execute_queue and write_unit)
3) Add multi architecture
5) Add template for comparator, multiplier and divider
6) Change Message
Warning) Various test macro have change, many selftest can't compile

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