1 | #ifndef morpheo_behavioural_core_multi_execute_loop_execute_loop_register_unit_Register_unit_h |
---|
2 | #define morpheo_behavioural_core_multi_execute_loop_execute_loop_register_unit_Register_unit_h |
---|
3 | |
---|
4 | /* |
---|
5 | * $Id: Register_unit.h 136 2009-10-20 18:52:15Z rosiere $ |
---|
6 | * |
---|
7 | * [ Description ] |
---|
8 | * |
---|
9 | */ |
---|
10 | |
---|
11 | #ifdef SYSTEMC |
---|
12 | #include "systemc.h" |
---|
13 | #endif |
---|
14 | |
---|
15 | #include <iostream> |
---|
16 | #include "Common/include/ToString.h" |
---|
17 | #include "Common/include/Debug.h" |
---|
18 | #include "Behavioural/include/Types.h" |
---|
19 | |
---|
20 | // Internal Component |
---|
21 | #include "Behavioural/Generic/RegisterFile/include/RegisterFile.h" |
---|
22 | #include "Behavioural/Core/Multi_Execute_loop/Execute_loop/Register_unit/Register_unit_Glue/include/Register_unit_Glue.h" |
---|
23 | |
---|
24 | #include "Behavioural/Core/Multi_Execute_loop/Execute_loop/Register_unit/include/Parameters.h" |
---|
25 | #ifdef STATISTICS |
---|
26 | #include "Behavioural/include/Stat.h" |
---|
27 | #endif |
---|
28 | #include "Behavioural/include/Component.h" |
---|
29 | #ifdef VHDL |
---|
30 | #include "Behavioural/include/Vhdl.h" |
---|
31 | #endif |
---|
32 | #include "Behavioural/include/Usage.h" |
---|
33 | |
---|
34 | namespace morpheo { |
---|
35 | namespace behavioural { |
---|
36 | namespace core { |
---|
37 | namespace multi_execute_loop { |
---|
38 | namespace execute_loop { |
---|
39 | namespace register_unit { |
---|
40 | |
---|
41 | |
---|
42 | class Register_unit |
---|
43 | #if SYSTEMC |
---|
44 | : public sc_module |
---|
45 | #endif |
---|
46 | { |
---|
47 | // -----[ fields ]---------------------------------------------------- |
---|
48 | // Parameters |
---|
49 | protected : const std::string _name; |
---|
50 | protected : const Parameters * _param; |
---|
51 | private : const Tusage_t _usage; |
---|
52 | |
---|
53 | #ifdef STATISTICS |
---|
54 | public : Stat * _stat; |
---|
55 | #endif |
---|
56 | |
---|
57 | public : Component * _component; |
---|
58 | private : Interfaces * _interfaces; |
---|
59 | |
---|
60 | #ifdef SYSTEMC |
---|
61 | // ~~~~~[ Interface ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
62 | // Interface |
---|
63 | public : SC_CLOCK * in_CLOCK ; |
---|
64 | public : SC_IN (Tcontrol_t) * in_NRESET ; |
---|
65 | |
---|
66 | // ~~~~~[ Interface "gpr_read" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
67 | public : SC_IN (Tcontrol_t ) ** in_GPR_READ_VAL ; |
---|
68 | public : SC_OUT(Tcontrol_t ) ** out_GPR_READ_ACK ; |
---|
69 | public : SC_IN (Tcontext_t ) ** in_GPR_READ_OOO_ENGINE_ID ; |
---|
70 | public : SC_IN (Tgeneral_address_t) ** in_GPR_READ_NUM_REG ; |
---|
71 | public : SC_OUT(Tgeneral_data_t ) ** out_GPR_READ_DATA ; |
---|
72 | public : SC_OUT(Tcontrol_t ) ** out_GPR_READ_DATA_VAL ; |
---|
73 | |
---|
74 | // ~~~~~[ Interface "gpr_write" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
75 | public : SC_IN (Tcontrol_t ) ** in_GPR_WRITE_VAL ; |
---|
76 | public : SC_OUT(Tcontrol_t ) ** out_GPR_WRITE_ACK ; |
---|
77 | public : SC_IN (Tcontext_t ) ** in_GPR_WRITE_OOO_ENGINE_ID ; |
---|
78 | public : SC_IN (Tgeneral_address_t) ** in_GPR_WRITE_NUM_REG ; |
---|
79 | public : SC_IN (Tgeneral_data_t ) ** in_GPR_WRITE_DATA ; |
---|
80 | |
---|
81 | // ~~~~~[ Interface "spr_read" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
82 | public : SC_IN (Tcontrol_t ) ** in_SPR_READ_VAL ; |
---|
83 | public : SC_OUT(Tcontrol_t ) ** out_SPR_READ_ACK ; |
---|
84 | public : SC_IN (Tcontext_t ) ** in_SPR_READ_OOO_ENGINE_ID ; |
---|
85 | public : SC_IN (Tspecial_address_t) ** in_SPR_READ_NUM_REG ; |
---|
86 | public : SC_OUT(Tspecial_data_t ) ** out_SPR_READ_DATA ; |
---|
87 | public : SC_OUT(Tcontrol_t ) ** out_SPR_READ_DATA_VAL ; |
---|
88 | |
---|
89 | // ~~~~~[ Interface "spr_write" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
90 | public : SC_IN (Tcontrol_t ) ** in_SPR_WRITE_VAL ; |
---|
91 | public : SC_OUT(Tcontrol_t ) ** out_SPR_WRITE_ACK ; |
---|
92 | public : SC_IN (Tcontext_t ) ** in_SPR_WRITE_OOO_ENGINE_ID ; |
---|
93 | public : SC_IN (Tspecial_address_t) ** in_SPR_WRITE_NUM_REG ; |
---|
94 | public : SC_IN (Tspecial_data_t ) ** in_SPR_WRITE_DATA ; |
---|
95 | |
---|
96 | // ~~~~~[ Interface "issue" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
97 | public : SC_IN (Tcontrol_t ) ** in_ISSUE_VAL ; |
---|
98 | public : SC_OUT(Tcontrol_t ) ** out_ISSUE_ACK ; |
---|
99 | public : SC_IN (Tcontext_t ) ** in_ISSUE_OOO_ENGINE_ID ; |
---|
100 | public : SC_IN (Tcontrol_t ) ** in_ISSUE_RD_USE ; |
---|
101 | public : SC_IN (Tgeneral_address_t) ** in_ISSUE_RD_NUM_REG ; // use=1 : status[num_reg]<- 0 |
---|
102 | public : SC_IN (Tcontrol_t ) ** in_ISSUE_RE_USE ; |
---|
103 | public : SC_IN (Tspecial_address_t) ** in_ISSUE_RE_NUM_REG ; |
---|
104 | |
---|
105 | // // ~~~~~[ Interface "insert_rob" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
106 | // public : SC_IN (Tcontrol_t ) *** in_INSERT_ROB_VAL ; |
---|
107 | // public : SC_OUT(Tcontrol_t ) *** out_INSERT_ROB_ACK ; |
---|
108 | // public : SC_IN (Tcontrol_t ) *** in_INSERT_ROB_RD_USE ; |
---|
109 | // public : SC_IN (Tgeneral_address_t) *** in_INSERT_ROB_RD_NUM_REG ; // use=1 : status[num_reg]<- 0 |
---|
110 | // public : SC_IN (Tcontrol_t ) *** in_INSERT_ROB_RE_USE ; |
---|
111 | // public : SC_IN (Tspecial_address_t) *** in_INSERT_ROB_RE_NUM_REG ; |
---|
112 | |
---|
113 | // // ~~~~~[ Interface "retire_rob" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
114 | // public : SC_IN (Tcontrol_t ) *** in_RETIRE_ROB_VAL ; |
---|
115 | // public : SC_OUT(Tcontrol_t ) *** out_RETIRE_ROB_ACK ; |
---|
116 | // public : SC_IN (Tcontrol_t ) *** in_RETIRE_ROB_RD_OLD_USE ; |
---|
117 | // public : SC_IN (Tgeneral_address_t) *** in_RETIRE_ROB_RD_OLD_NUM_REG ; // old_use=1 : status[old_num_reg]<- 0 |
---|
118 | // public : SC_IN (Tcontrol_t ) *** in_RETIRE_ROB_RD_NEW_USE ; |
---|
119 | // public : SC_IN (Tgeneral_address_t) *** in_RETIRE_ROB_RD_NEW_NUM_REG ; // new_use=1 : status[new_num_reg]<- 1 |
---|
120 | // public : SC_IN (Tcontrol_t ) *** in_RETIRE_ROB_RE_OLD_USE ; |
---|
121 | // public : SC_IN (Tspecial_address_t) *** in_RETIRE_ROB_RE_OLD_NUM_REG ; |
---|
122 | // public : SC_IN (Tcontrol_t ) *** in_RETIRE_ROB_RE_NEW_USE ; |
---|
123 | // public : SC_IN (Tspecial_address_t) *** in_RETIRE_ROB_RE_NEW_NUM_REG ; |
---|
124 | |
---|
125 | // ~~~~~[ Component ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
126 | protected : morpheo::behavioural::generic::registerfile::RegisterFile::RegisterFile ** component_gpr ; |
---|
127 | protected : morpheo::behavioural::generic::registerfile::RegisterFile::RegisterFile ** component_gpr_status; |
---|
128 | protected : morpheo::behavioural::generic::registerfile::RegisterFile::RegisterFile ** component_spr ; |
---|
129 | protected : morpheo::behavioural::generic::registerfile::RegisterFile::RegisterFile ** component_spr_status; |
---|
130 | |
---|
131 | // protected : morpheo::behavioural::generic::registerfile::registerfile_multi_banked::RegisterFile_Multi_Banked::RegisterFile_Multi_Banked ** component_gpr ; |
---|
132 | // protected : morpheo::behavioural::generic::registerfile::registerfile_monolithic ::RegisterFile_Monolithic ::RegisterFile_Monolithic ** component_gpr_status; |
---|
133 | // protected : morpheo::behavioural::generic::registerfile::registerfile_multi_banked::RegisterFile_Multi_Banked::RegisterFile_Multi_Banked ** component_spr ; |
---|
134 | // protected : morpheo::behavioural::generic::registerfile::registerfile_monolithic ::RegisterFile_Monolithic ::RegisterFile_Monolithic ** component_spr_status; |
---|
135 | |
---|
136 | protected : morpheo::behavioural::core::multi_execute_loop::execute_loop::register_unit::register_unit_glue::Register_unit_Glue::Register_unit_Glue * component_glue ; |
---|
137 | |
---|
138 | // ~~~~~[ Register ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
139 | |
---|
140 | // ~~~~~[ Internal ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
141 | #endif |
---|
142 | |
---|
143 | // -----[ methods ]--------------------------------------------------- |
---|
144 | |
---|
145 | #ifdef SYSTEMC |
---|
146 | SC_HAS_PROCESS (Register_unit); |
---|
147 | #endif |
---|
148 | public : Register_unit |
---|
149 | ( |
---|
150 | #ifdef SYSTEMC |
---|
151 | sc_module_name name, |
---|
152 | #else |
---|
153 | std::string name, |
---|
154 | #endif |
---|
155 | #ifdef STATISTICS |
---|
156 | morpheo::behavioural::Parameters_Statistics * param_statistics, |
---|
157 | #endif |
---|
158 | Parameters * param, |
---|
159 | morpheo::behavioural::Tusage_t usage |
---|
160 | ); |
---|
161 | public : ~Register_unit (void); |
---|
162 | |
---|
163 | private : void allocation ( |
---|
164 | #ifdef STATISTICS |
---|
165 | morpheo::behavioural::Parameters_Statistics * param_statistics |
---|
166 | #else |
---|
167 | void |
---|
168 | #endif |
---|
169 | ); |
---|
170 | private : void deallocation (void); |
---|
171 | |
---|
172 | #ifdef SYSTEMC |
---|
173 | //#if defined(STATISTICS) or defined(VHDL_TESTBENCH) |
---|
174 | public : void transition (void); |
---|
175 | //#endif |
---|
176 | #endif |
---|
177 | |
---|
178 | #if VHDL |
---|
179 | public : void vhdl (void); |
---|
180 | private : void vhdl_declaration (Vhdl * & vhdl); |
---|
181 | private : void vhdl_body (Vhdl * & vhdl); |
---|
182 | #endif |
---|
183 | |
---|
184 | #ifdef STATISTICS |
---|
185 | public : void statistics_declaration (morpheo::behavioural::Parameters_Statistics * param_statistics); |
---|
186 | #endif |
---|
187 | #if defined(STATISTICS) or defined(VHDL_TESTBENCH) |
---|
188 | private : void end_cycle (void); |
---|
189 | #endif |
---|
190 | }; |
---|
191 | |
---|
192 | |
---|
193 | }; // end namespace register_unit |
---|
194 | }; // end namespace execute_loop |
---|
195 | }; // end namespace multi_execute_loop |
---|
196 | }; // end namespace core |
---|
197 | |
---|
198 | }; // end namespace behavioural |
---|
199 | }; // end namespace morpheo |
---|
200 | |
---|
201 | #endif |
---|