1 | #ifndef morpheo_behavioural_core_multi_front_end_front_end_decod_unit_decod_queue_Types_h |
---|
2 | #define morpheo_behavioural_core_multi_front_end_front_end_decod_unit_decod_queue_Types_h |
---|
3 | |
---|
4 | /* |
---|
5 | * $Id: Types.h 112 2009-03-18 22:36:26Z rosiere $ |
---|
6 | * |
---|
7 | * [ Description ] |
---|
8 | * |
---|
9 | */ |
---|
10 | |
---|
11 | #include "Behavioural/include/Types.h" |
---|
12 | #include "Behavioural/include/Allocation.h" |
---|
13 | |
---|
14 | namespace morpheo { |
---|
15 | namespace behavioural { |
---|
16 | namespace core { |
---|
17 | namespace multi_front_end { |
---|
18 | namespace front_end { |
---|
19 | namespace decod_unit { |
---|
20 | namespace decod_queue { |
---|
21 | |
---|
22 | typedef enum |
---|
23 | { |
---|
24 | DECOD_QUEUE_SCHEME_ONE_FIFO // One fifo with a instruction bundle per slot ( internal fragmentation) |
---|
25 | ,DECOD_QUEUE_SCHEME_MULTI_FIFO // One fifo per instruction. Rename in order (no internal fragmentation) |
---|
26 | } Tdecod_queue_scheme_t; |
---|
27 | |
---|
28 | class decod_queue_entry_t |
---|
29 | { |
---|
30 | private: const uint32_t _nb_inst ; |
---|
31 | |
---|
32 | public : Tcontrol_t * _val ; |
---|
33 | public : Tcontext_t * _context_id ; |
---|
34 | public : Tdepth_t * _depth ; |
---|
35 | public : Ttype_t * _type ; |
---|
36 | public : Toperation_t * _operation ; |
---|
37 | public : Tcontrol_t * _no_execute ; |
---|
38 | public : Tcontrol_t * _is_delay_slot ; |
---|
39 | #ifdef DEBUG |
---|
40 | public : Tgeneral_data_t * _address ; |
---|
41 | #endif |
---|
42 | public : Tgeneral_data_t * _address_next ; |
---|
43 | public : Tcontrol_t * _has_immediat ; |
---|
44 | public : Tgeneral_data_t * _immediat ; |
---|
45 | public : Tcontrol_t * _read_ra ; |
---|
46 | public : Tgeneral_address_t * _num_reg_ra ; |
---|
47 | public : Tcontrol_t * _read_rb ; |
---|
48 | public : Tgeneral_address_t * _num_reg_rb ; |
---|
49 | public : Tcontrol_t * _read_rc ; |
---|
50 | public : Tspecial_address_t * _num_reg_rc ; |
---|
51 | public : Tcontrol_t * _write_rd ; |
---|
52 | public : Tgeneral_address_t * _num_reg_rd ; |
---|
53 | public : Tcontrol_t * _write_re ; |
---|
54 | public : Tspecial_address_t * _num_reg_re ; |
---|
55 | public : Texception_t * _exception_use ; |
---|
56 | public : Texception_t * _exception ; |
---|
57 | |
---|
58 | public : decod_queue_entry_t (uint32_t nb_inst): |
---|
59 | _nb_inst (nb_inst) |
---|
60 | { |
---|
61 | ALLOC1(_val ,Tcontrol_t ,_nb_inst); |
---|
62 | ALLOC1(_context_id ,Tcontext_t ,_nb_inst); |
---|
63 | ALLOC1(_depth ,Tdepth_t ,_nb_inst); |
---|
64 | ALLOC1(_type ,Ttype_t ,_nb_inst); |
---|
65 | ALLOC1(_operation ,Toperation_t ,_nb_inst); |
---|
66 | ALLOC1(_no_execute ,Tcontrol_t ,_nb_inst); |
---|
67 | ALLOC1(_is_delay_slot ,Tcontrol_t ,_nb_inst); |
---|
68 | #ifdef DEBUG |
---|
69 | ALLOC1(_address ,Tgeneral_data_t ,_nb_inst); |
---|
70 | #endif |
---|
71 | ALLOC1(_address_next ,Tgeneral_data_t ,_nb_inst); |
---|
72 | ALLOC1(_has_immediat ,Tcontrol_t ,_nb_inst); |
---|
73 | ALLOC1(_immediat ,Tgeneral_data_t ,_nb_inst); |
---|
74 | ALLOC1(_read_ra ,Tcontrol_t ,_nb_inst); |
---|
75 | ALLOC1(_num_reg_ra ,Tgeneral_address_t ,_nb_inst); |
---|
76 | ALLOC1(_read_rb ,Tcontrol_t ,_nb_inst); |
---|
77 | ALLOC1(_num_reg_rb ,Tgeneral_address_t ,_nb_inst); |
---|
78 | ALLOC1(_read_rc ,Tcontrol_t ,_nb_inst); |
---|
79 | ALLOC1(_num_reg_rc ,Tspecial_address_t ,_nb_inst); |
---|
80 | ALLOC1(_write_rd ,Tcontrol_t ,_nb_inst); |
---|
81 | ALLOC1(_num_reg_rd ,Tgeneral_address_t ,_nb_inst); |
---|
82 | ALLOC1(_write_re ,Tcontrol_t ,_nb_inst); |
---|
83 | ALLOC1(_num_reg_re ,Tspecial_address_t ,_nb_inst); |
---|
84 | ALLOC1(_exception_use ,Texception_t ,_nb_inst); |
---|
85 | ALLOC1(_exception ,Texception_t ,_nb_inst); |
---|
86 | |
---|
87 | for (uint32_t i=0; i<_nb_inst; i++) |
---|
88 | _val [i]=0; // default : not valid |
---|
89 | } |
---|
90 | |
---|
91 | public : ~decod_queue_entry_t (void) |
---|
92 | { |
---|
93 | DELETE1(_val ,_nb_inst); |
---|
94 | DELETE1(_context_id ,_nb_inst); |
---|
95 | DELETE1(_depth ,_nb_inst); |
---|
96 | DELETE1(_type ,_nb_inst); |
---|
97 | DELETE1(_operation ,_nb_inst); |
---|
98 | DELETE1(_no_execute ,_nb_inst); |
---|
99 | DELETE1(_is_delay_slot ,_nb_inst); |
---|
100 | #ifdef DEBUG |
---|
101 | DELETE1(_address ,_nb_inst); |
---|
102 | #endif |
---|
103 | DELETE1(_address_next ,_nb_inst); |
---|
104 | DELETE1(_has_immediat ,_nb_inst); |
---|
105 | DELETE1(_immediat ,_nb_inst); |
---|
106 | DELETE1(_read_ra ,_nb_inst); |
---|
107 | DELETE1(_num_reg_ra ,_nb_inst); |
---|
108 | DELETE1(_read_rb ,_nb_inst); |
---|
109 | DELETE1(_num_reg_rb ,_nb_inst); |
---|
110 | DELETE1(_read_rc ,_nb_inst); |
---|
111 | DELETE1(_num_reg_rc ,_nb_inst); |
---|
112 | DELETE1(_write_rd ,_nb_inst); |
---|
113 | DELETE1(_num_reg_rd ,_nb_inst); |
---|
114 | DELETE1(_write_re ,_nb_inst); |
---|
115 | DELETE1(_num_reg_re ,_nb_inst); |
---|
116 | DELETE1(_exception_use ,_nb_inst); |
---|
117 | DELETE1(_exception ,_nb_inst); |
---|
118 | } |
---|
119 | }; |
---|
120 | |
---|
121 | }; // end namespace decod_queue |
---|
122 | }; // end namespace decod_unit |
---|
123 | }; // end namespace front_end |
---|
124 | }; // end namespace multi_front_end |
---|
125 | }; // end namespace core |
---|
126 | }; // end namespace behavioural |
---|
127 | |
---|
128 | template<> inline std::string toString<morpheo::behavioural::core::multi_front_end::front_end::decod_unit::decod_queue::Tdecod_queue_scheme_t>(const morpheo::behavioural::core::multi_front_end::front_end::decod_unit::decod_queue::Tdecod_queue_scheme_t& x) |
---|
129 | { |
---|
130 | switch (x) |
---|
131 | { |
---|
132 | case morpheo::behavioural::core::multi_front_end::front_end::decod_unit::decod_queue::DECOD_QUEUE_SCHEME_ONE_FIFO : return "one_fifo" ; break; |
---|
133 | case morpheo::behavioural::core::multi_front_end::front_end::decod_unit::decod_queue::DECOD_QUEUE_SCHEME_MULTI_FIFO : return "multi_fifo"; break; |
---|
134 | default : return ""; break; |
---|
135 | } |
---|
136 | }; |
---|
137 | |
---|
138 | template<> inline morpheo::behavioural::core::multi_front_end::front_end::decod_unit::decod_queue::Tdecod_queue_scheme_t fromString<morpheo::behavioural::core::multi_front_end::front_end::decod_unit::decod_queue::Tdecod_queue_scheme_t>(const std::string& x) |
---|
139 | { |
---|
140 | if ( (x.compare(toString(static_cast<uint32_t>(morpheo::behavioural::core::multi_front_end::front_end::decod_unit::decod_queue::DECOD_QUEUE_SCHEME_ONE_FIFO ))) == 0) or |
---|
141 | (x.compare("one_fifo") == 0)) |
---|
142 | return morpheo::behavioural::core::multi_front_end::front_end::decod_unit::decod_queue::DECOD_QUEUE_SCHEME_ONE_FIFO; |
---|
143 | if ( (x.compare(toString(static_cast<uint32_t>(morpheo::behavioural::core::multi_front_end::front_end::decod_unit::decod_queue::DECOD_QUEUE_SCHEME_MULTI_FIFO))) == 0) or |
---|
144 | (x.compare("multi_fifo") == 0)) |
---|
145 | return morpheo::behavioural::core::multi_front_end::front_end::decod_unit::decod_queue::DECOD_QUEUE_SCHEME_MULTI_FIFO; |
---|
146 | |
---|
147 | throw (ErrorMorpheo ("<fromString> : Unknow string : \""+x+"\"")); |
---|
148 | }; |
---|
149 | |
---|
150 | |
---|
151 | }; // end namespace morpheo |
---|
152 | |
---|
153 | #endif |
---|