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

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

1) Stat_list : fix retire old and new register bug
2) Stat_list : remove read_counter and valid flag, because validation of destination is in retire step (not in commit step)
3) Model : add class Model (cf Morpheo.sim)
4) Allocation : alloc_interface_begin and alloc_interface_end to delete temporary array.
5) Script : add distexe.sh
6) Add Comparator, Multiplier, Divider. But this component are not implemented
7) Software : add Dhrystone

  • Property svn:keywords set to Id
File size: 1.7 KB
Line 
1#ifndef morpheo_behavioural_Model_h
2#define morpheo_behavioural_Model_h
3
4/*
5 * $Id: Model.h 112 2009-03-18 22:36:26Z 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  };
43 
44}; // end namespace behavioural         
45
46  template<> inline morpheo::behavioural::model_type_t fromString<morpheo::behavioural::model_type_t>(const std::string& x)
47  {
48    if ( (x.compare(toString(static_cast<uint32_t>(morpheo::behavioural::MODEL_SYSTEMC))) == 0) or
49         (x.compare("model_systemc") == 0) or
50         (x.compare("systemc") == 0)
51         )
52      return morpheo::behavioural::MODEL_SYSTEMC;
53    if ( (x.compare(toString(static_cast<uint32_t>(morpheo::behavioural::MODEL_VHDL))) == 0) or
54         (x.compare("model_vhdl") == 0) or
55         (x.compare("vhdl") == 0))
56      return morpheo::behavioural::MODEL_VHDL;
57    throw (ERRORMORPHEO ("fromString","Unknow string : \""+x+"\"\n"));
58  };
59
60}; // end namespace morpheo             
61
62#endif
63
Note: See TracBrowser for help on using the repository browser.