1 | #ifndef morpheo_behavioural_generic_registerfile_registerfile_multi_banked_registerfile_multi_banked_glue_Parameters_h |
---|
2 | #define morpheo_behavioural_generic_registerfile_registerfile_multi_banked_registerfile_multi_banked_glue_Parameters_h |
---|
3 | |
---|
4 | /* |
---|
5 | * $Id$ |
---|
6 | * |
---|
7 | * [ Description ] |
---|
8 | * |
---|
9 | */ |
---|
10 | |
---|
11 | #include "Include/Debug.h" |
---|
12 | #include "Include/FromString.h" |
---|
13 | #include "Behavioural/include/Parameters.h" |
---|
14 | #include <math.h> |
---|
15 | |
---|
16 | namespace morpheo { |
---|
17 | |
---|
18 | typedef enum {PARTIAL_CROSSBAR, |
---|
19 | FULL_CROSSBAR } Tcrossbar_t; |
---|
20 | |
---|
21 | template<> inline Tcrossbar_t fromString<Tcrossbar_t> (const std::string& x) |
---|
22 | { |
---|
23 | if ( (x.compare("0") == 0) or |
---|
24 | (x.compare("PARTIAL_CROSSBAR") == 0)) |
---|
25 | return PARTIAL_CROSSBAR; |
---|
26 | if ( (x.compare("1") == 0) or |
---|
27 | (x.compare("FULL_CROSSBAR" ) == 0)) |
---|
28 | return FULL_CROSSBAR; |
---|
29 | |
---|
30 | throw (ErrorMorpheo ("<fromString> : Unknow string : \""+x+"\"")); |
---|
31 | } |
---|
32 | |
---|
33 | template<> inline std::string toString<Tcrossbar_t> (const Tcrossbar_t& x) |
---|
34 | { |
---|
35 | ostringstream out; |
---|
36 | |
---|
37 | if (x == PARTIAL_CROSSBAR) |
---|
38 | out << "PARTIAL_CROSSBAR"; |
---|
39 | if (x == FULL_CROSSBAR) |
---|
40 | out << "FULL_CROSSBAR"; |
---|
41 | |
---|
42 | return out.str(); |
---|
43 | } |
---|
44 | |
---|
45 | namespace behavioural { |
---|
46 | namespace generic { |
---|
47 | namespace registerfile{ |
---|
48 | namespace registerfile_multi_banked { |
---|
49 | namespace registerfile_multi_banked_glue { |
---|
50 | |
---|
51 | class Parameters : public morpheo::behavioural::Parameters |
---|
52 | { |
---|
53 | //-----[ fields ]------------------------------------------------------------ |
---|
54 | public : const uint32_t _nb_port_read ; |
---|
55 | public : const uint32_t _nb_port_write ; |
---|
56 | public : const uint32_t _size_address ; |
---|
57 | public : const uint32_t _size_word ; |
---|
58 | public : const uint32_t _nb_bank ; |
---|
59 | public : const uint32_t _nb_port_read_by_bank ; |
---|
60 | public : const uint32_t _nb_port_write_by_bank; |
---|
61 | public : const Tcrossbar_t _crossbar ; |
---|
62 | |
---|
63 | public : const uint32_t _shift_address ; |
---|
64 | |
---|
65 | public : uint32_t * _link_port_read ; |
---|
66 | public : uint32_t * _link_port_write ; |
---|
67 | |
---|
68 | public : uint32_t * _nb_port_select_by_bank_read_port ; |
---|
69 | public : uint32_t * _nb_port_select_by_bank_write_port; |
---|
70 | |
---|
71 | //-----[ methods ]----------------------------------------------------------- |
---|
72 | public : Parameters (uint32_t nb_port_read , |
---|
73 | uint32_t nb_port_write , |
---|
74 | uint32_t size_address , |
---|
75 | uint32_t size_word , |
---|
76 | uint32_t nb_bank , |
---|
77 | uint32_t nb_port_read_by_bank , |
---|
78 | uint32_t nb_port_write_by_bank, |
---|
79 | Tcrossbar_t crossbar ); |
---|
80 | |
---|
81 | public : Parameters (Parameters & param) ; |
---|
82 | public : ~Parameters () ; |
---|
83 | |
---|
84 | public : string msg_error (void); |
---|
85 | |
---|
86 | public : string print (uint32_t depth); |
---|
87 | public : friend ostream& operator<< (ostream& output_stream, |
---|
88 | morpheo::behavioural::generic::registerfile::registerfile_multi_banked::registerfile_multi_banked_glue::Parameters & x); |
---|
89 | }; |
---|
90 | |
---|
91 | }; // end namespace registerfile_multi_banked_glue |
---|
92 | }; // end namespace registerfile_multi_banked |
---|
93 | }; // end namespace registerfile |
---|
94 | }; // end namespace generic |
---|
95 | |
---|
96 | }; // end namespace behavioural |
---|
97 | }; // end namespace morpheo |
---|
98 | |
---|
99 | #endif |
---|