source: trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/RegisterFile_Multi_Banked/include/Types.h @ 75

Last change on this file since 75 was 75, checked in by rosiere, 16 years ago

Update all component (except front_end) to :

  • new statistics model
  • no namespace std
File size: 1.4 KB
Line 
1#ifndef morpheo_behavioural_generic_registerfile_registerfile_multi_banked_Type_h
2#define morpheo_behavioural_generic_registerfile_registerfile_multi_banked_Type_h
3
4/*
5 * $Id$
6 *
7 * [ Description ]
8 *
9 */
10
11#include "Behavioural/include/Types.h"
12#include "Common/include/ToString.h"
13#include "Common/include/FromString.h"
14namespace morpheo                    {
15namespace behavioural {
16namespace generic {
17namespace registerfile {
18namespace registerfile_multi_banked {
19
20  typedef uint32_t Taddress_t;
21  typedef uint32_t Tdata_t;
22
23}; // end namespace registerfile_multi_banked
24}; // end namespace registerfile
25}; // end namespace generic
26}; // end namespace behavioural
27
28  typedef enum {PARTIAL_CROSSBAR,
29                FULL_CROSSBAR   } Tcrossbar_t;
30
31  template<> inline Tcrossbar_t fromString<Tcrossbar_t> (const std::string& x)
32  {
33    if ( (x.compare("0")                == 0) or
34         (x.compare("PARTIAL_CROSSBAR") == 0))
35      return PARTIAL_CROSSBAR;
36    if ( (x.compare("1")                == 0) or
37         (x.compare("FULL_CROSSBAR"   ) == 0))
38      return FULL_CROSSBAR;
39
40    throw (ErrorMorpheo ("<fromString> : Unknow string : \""+x+"\""));
41  };
42 
43  template<> inline std::string toString<Tcrossbar_t>   (const Tcrossbar_t& x)
44  {
45    std::ostringstream out;
46
47    if (x == PARTIAL_CROSSBAR)
48      out << "PARTIAL_CROSSBAR";
49    if (x == FULL_CROSSBAR)
50      out << "FULL_CROSSBAR";
51
52    return out.str();
53  };
54
55
56}; // end namespace morpheo             
57
58#endif
Note: See TracBrowser for help on using the repository browser.