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: Types.h 82 2008-05-01 16:48:45Z rosiere $ |
---|
6 | * |
---|
7 | * [ Description ] |
---|
8 | * |
---|
9 | */ |
---|
10 | |
---|
11 | #include "Behavioural/include/Types.h" |
---|
12 | #include "Common/include/ToString.h" |
---|
13 | #include "Common/include/FromString.h" |
---|
14 | namespace morpheo { |
---|
15 | namespace behavioural { |
---|
16 | namespace generic { |
---|
17 | namespace registerfile { |
---|
18 | namespace 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 |
---|