[55] | 1 | #ifndef morpheo_behavioural_core_multi_execute_loop_execute_loop_multi_read_unit_read_unit_reservation_station_Reservation_station_h |
---|
| 2 | #define morpheo_behavioural_core_multi_execute_loop_execute_loop_multi_read_unit_read_unit_reservation_station_Reservation_station_h |
---|
| 3 | |
---|
| 4 | /* |
---|
| 5 | * $Id: Reservation_station.h 82 2008-05-01 16:48:45Z rosiere $ |
---|
| 6 | * |
---|
[76] | 7 | * [ Description ] |
---|
[55] | 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 | |
---|
[69] | 19 | #ifndef SYSTEMC_VHDL_COMPATIBILITY |
---|
[56] | 20 | #include "Behavioural/Generic/Queue_Control/include/Queue_Control.h" |
---|
[69] | 21 | #endif |
---|
[55] | 22 | #include "Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Read_unit/Read_unit/Reservation_station/include/Parameters.h" |
---|
[82] | 23 | #include "Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Read_unit/Read_unit/Reservation_station/include/Types.h" |
---|
[55] | 24 | #ifdef STATISTICS |
---|
[75] | 25 | #include "Behavioural/include/Stat.h" |
---|
[55] | 26 | #endif |
---|
| 27 | #include "Behavioural/include/Component.h" |
---|
| 28 | #ifdef VHDL |
---|
| 29 | #include "Behavioural/include/Vhdl.h" |
---|
| 30 | #endif |
---|
[82] | 31 | #include "Behavioural/include/Usage.h" |
---|
[55] | 32 | |
---|
| 33 | namespace morpheo { |
---|
| 34 | namespace behavioural { |
---|
| 35 | namespace core { |
---|
| 36 | namespace multi_execute_loop { |
---|
| 37 | namespace execute_loop { |
---|
| 38 | namespace multi_read_unit { |
---|
| 39 | namespace read_unit { |
---|
| 40 | namespace reservation_station { |
---|
| 41 | |
---|
| 42 | class Reservation_station |
---|
| 43 | #if SYSTEMC |
---|
| 44 | : public sc_module |
---|
| 45 | #endif |
---|
| 46 | { |
---|
[76] | 47 | // -----[ fields ]---------------------------------------------------- |
---|
[55] | 48 | // Parameters |
---|
[82] | 49 | protected : const std::string _name; |
---|
[55] | 50 | protected : const Parameters * _param; |
---|
[82] | 51 | private : const Tusage_t _usage; |
---|
[55] | 52 | |
---|
| 53 | #ifdef STATISTICS |
---|
[75] | 54 | public : Stat * _stat; |
---|
[55] | 55 | #endif |
---|
| 56 | |
---|
| 57 | public : Component * _component; |
---|
| 58 | private : Interfaces * _interfaces; |
---|
| 59 | |
---|
| 60 | #ifdef SYSTEMC |
---|
[76] | 61 | // ~~~~~[ Interface ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
[55] | 62 | // Interface |
---|
| 63 | public : SC_CLOCK * in_CLOCK ; |
---|
| 64 | public : SC_IN (Tcontrol_t) * in_NRESET ; |
---|
| 65 | |
---|
[76] | 66 | // ~~~~~[ Interface "insert" ]~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
[69] | 67 | public : SC_IN (Tcontrol_t ) * in_INSERT_VAL ; |
---|
| 68 | public : SC_OUT(Tcontrol_t ) * out_INSERT_ACK ; |
---|
| 69 | public : SC_IN (Tcontext_t ) * in_INSERT_CONTEXT_ID ; |
---|
| 70 | public : SC_IN (Tcontext_t ) * in_INSERT_FRONT_END_ID ; |
---|
| 71 | public : SC_IN (Tcontext_t ) * in_INSERT_OOO_ENGINE_ID ; |
---|
| 72 | public : SC_IN (Tpacket_t ) * in_INSERT_ROB_ID ; |
---|
| 73 | public : SC_IN (Toperation_t ) * in_INSERT_OPERATION ; |
---|
| 74 | public : SC_IN (Ttype_t ) * in_INSERT_TYPE ; |
---|
[76] | 75 | public : SC_IN (Tlsq_ptr_t ) * in_INSERT_STORE_QUEUE_PTR_WRITE; |
---|
| 76 | public : SC_IN (Tlsq_ptr_t ) * in_INSERT_LOAD_QUEUE_PTR_WRITE ; |
---|
[69] | 77 | public : SC_IN (Tcontrol_t ) * in_INSERT_HAS_IMMEDIAT ; |
---|
| 78 | public : SC_IN (Tgeneral_data_t ) * in_INSERT_IMMEDIAT ; |
---|
| 79 | //public : SC_IN (Tcontrol_t ) * in_INSERT_READ_RA ; |
---|
| 80 | public : SC_IN (Tgeneral_address_t) * in_INSERT_NUM_REG_RA ; |
---|
| 81 | public : SC_IN (Tcontrol_t ) * in_INSERT_DATA_RA_VAL ; |
---|
| 82 | public : SC_IN (Tgeneral_data_t ) * in_INSERT_DATA_RA ; |
---|
| 83 | //public : SC_IN (Tcontrol_t ) * in_INSERT_READ_RB ; |
---|
| 84 | public : SC_IN (Tgeneral_address_t) * in_INSERT_NUM_REG_RB ; |
---|
| 85 | public : SC_IN (Tcontrol_t ) * in_INSERT_DATA_RB_VAL ; |
---|
| 86 | public : SC_IN (Tgeneral_data_t ) * in_INSERT_DATA_RB ; |
---|
| 87 | //public : SC_IN (Tcontrol_t ) * in_INSERT_READ_RC ; |
---|
| 88 | public : SC_IN (Tspecial_address_t) * in_INSERT_NUM_REG_RC ; |
---|
| 89 | public : SC_IN (Tcontrol_t ) * in_INSERT_DATA_RC_VAL ; |
---|
| 90 | public : SC_IN (Tspecial_data_t ) * in_INSERT_DATA_RC ; |
---|
| 91 | public : SC_IN (Tcontrol_t ) * in_INSERT_WRITE_RD ; |
---|
| 92 | public : SC_IN (Tgeneral_address_t) * in_INSERT_NUM_REG_RD ; |
---|
| 93 | public : SC_IN (Tcontrol_t ) * in_INSERT_WRITE_RE ; |
---|
| 94 | public : SC_IN (Tspecial_address_t) * in_INSERT_NUM_REG_RE ; |
---|
[55] | 95 | |
---|
[76] | 96 | // ~~~~~[ Interface "retire" ]~~~~~~~~~~~~~~~~~~~~~~~ |
---|
[69] | 97 | public : SC_OUT(Tcontrol_t ) ** out_RETIRE_VAL ; |
---|
| 98 | public : SC_IN (Tcontrol_t ) ** in_RETIRE_ACK ; |
---|
| 99 | public : SC_OUT(Tcontext_t ) ** out_RETIRE_CONTEXT_ID ; |
---|
| 100 | public : SC_OUT(Tcontext_t ) ** out_RETIRE_FRONT_END_ID ; |
---|
| 101 | public : SC_OUT(Tcontext_t ) ** out_RETIRE_OOO_ENGINE_ID ; |
---|
| 102 | public : SC_OUT(Tpacket_t ) ** out_RETIRE_ROB_ID ; |
---|
| 103 | public : SC_OUT(Toperation_t ) ** out_RETIRE_OPERATION ; |
---|
| 104 | public : SC_OUT(Ttype_t ) ** out_RETIRE_TYPE ; |
---|
[76] | 105 | public : SC_OUT(Tlsq_ptr_t ) ** out_RETIRE_STORE_QUEUE_PTR_WRITE; |
---|
| 106 | public : SC_OUT(Tlsq_ptr_t ) ** out_RETIRE_LOAD_QUEUE_PTR_WRITE ; |
---|
[69] | 107 | public : SC_OUT(Tcontrol_t ) ** out_RETIRE_HAS_IMMEDIAT ; |
---|
| 108 | public : SC_OUT(Tgeneral_data_t ) ** out_RETIRE_IMMEDIAT ; |
---|
| 109 | public : SC_OUT(Tgeneral_data_t ) ** out_RETIRE_DATA_RA ; |
---|
| 110 | public : SC_OUT(Tgeneral_data_t ) ** out_RETIRE_DATA_RB ; |
---|
| 111 | public : SC_OUT(Tspecial_data_t ) ** out_RETIRE_DATA_RC ; |
---|
| 112 | public : SC_OUT(Tcontrol_t ) ** out_RETIRE_WRITE_RD ; |
---|
| 113 | public : SC_OUT(Tgeneral_address_t) ** out_RETIRE_NUM_REG_RD ; |
---|
| 114 | public : SC_OUT(Tcontrol_t ) ** out_RETIRE_WRITE_RE ; |
---|
| 115 | public : SC_OUT(Tspecial_address_t) ** out_RETIRE_NUM_REG_RE ; |
---|
[55] | 116 | |
---|
[76] | 117 | // ~~~~~[ Interface "gpr_write" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
[55] | 118 | |
---|
[69] | 119 | public : SC_IN (Tcontrol_t ) ** in_GPR_WRITE_VAL ; // val and ack |
---|
| 120 | public : SC_IN (Tcontext_t ) ** in_GPR_WRITE_OOO_ENGINE_ID; |
---|
| 121 | public : SC_IN (Tgeneral_address_t) ** in_GPR_WRITE_NUM_REG ; |
---|
| 122 | public : SC_IN (Tgeneral_data_t ) ** in_GPR_WRITE_DATA ; |
---|
[55] | 123 | |
---|
[76] | 124 | // ~~~~~[ Interface "spr_write" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
[55] | 125 | |
---|
[69] | 126 | public : SC_IN (Tcontrol_t ) ** in_SPR_WRITE_VAL ; // val and ack |
---|
| 127 | public : SC_IN (Tcontext_t ) ** in_SPR_WRITE_OOO_ENGINE_ID; |
---|
| 128 | public : SC_IN (Tspecial_address_t) ** in_SPR_WRITE_NUM_REG ; |
---|
| 129 | public : SC_IN (Tspecial_data_t ) ** in_SPR_WRITE_DATA ; |
---|
[55] | 130 | |
---|
[76] | 131 | // ~~~~~[ Interface "bypass_write" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
[55] | 132 | |
---|
[69] | 133 | public : SC_IN (Tcontext_t ) ** in_BYPASS_WRITE_OOO_ENGINE_ID ; |
---|
| 134 | public : SC_IN (Tcontrol_t ) ** in_BYPASS_WRITE_GPR_VAL ; |
---|
| 135 | public : SC_IN (Tgeneral_address_t) ** in_BYPASS_WRITE_GPR_NUM_REG ; // RD |
---|
| 136 | public : SC_IN (Tgeneral_data_t ) ** in_BYPASS_WRITE_GPR_DATA ; |
---|
| 137 | public : SC_IN (Tcontrol_t ) ** in_BYPASS_WRITE_SPR_VAL ; |
---|
| 138 | public : SC_IN (Tspecial_address_t) ** in_BYPASS_WRITE_SPR_NUM_REG ; // RE |
---|
| 139 | public : SC_IN (Tspecial_data_t ) ** in_BYPASS_WRITE_SPR_DATA ; |
---|
[55] | 140 | |
---|
[76] | 141 | // ~~~~~[ Interface "bypass_memory" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
[55] | 142 | |
---|
[69] | 143 | public : SC_IN (Tcontrol_t ) ** in_BYPASS_MEMORY_VAL ; |
---|
| 144 | public : SC_IN (Tcontext_t ) ** in_BYPASS_MEMORY_OOO_ENGINE_ID; |
---|
| 145 | public : SC_IN (Tgeneral_address_t) ** in_BYPASS_MEMORY_NUM_REG ; |
---|
| 146 | public : SC_IN (Tgeneral_data_t ) ** in_BYPASS_MEMORY_DATA ; |
---|
[55] | 147 | |
---|
| 148 | |
---|
[76] | 149 | // ~~~~~[ Component ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
[55] | 150 | |
---|
[76] | 151 | // ~~~~~[ Register ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
[55] | 152 | |
---|
[76] | 153 | // ~~~~~[ Internal ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
[69] | 154 | #ifdef SYSTEMC_VHDL_COMPATIBILITY |
---|
| 155 | protected : bool * _queue_valid; |
---|
| 156 | protected : uint32_t internal_INSERT_SLOT; |
---|
| 157 | #else |
---|
[56] | 158 | protected : morpheo::behavioural::generic::queue_control::Queue_Control * _queue_control; |
---|
[69] | 159 | #endif |
---|
[55] | 160 | protected : Treservation_station_entry_t * _queue; |
---|
| 161 | |
---|
[69] | 162 | protected : Tcontrol_t internal_INSERT_ACK; |
---|
| 163 | protected : Tcontrol_t * internal_RETIRE_VAL; |
---|
| 164 | protected : uint32_t * internal_RETIRE_SLOT; |
---|
[55] | 165 | #endif |
---|
| 166 | |
---|
[76] | 167 | // -----[ methods ]--------------------------------------------------- |
---|
[55] | 168 | |
---|
| 169 | #ifdef SYSTEMC |
---|
| 170 | SC_HAS_PROCESS (Reservation_station); |
---|
| 171 | #endif |
---|
| 172 | public : Reservation_station ( |
---|
| 173 | #ifdef SYSTEMC |
---|
[75] | 174 | sc_module_name name, |
---|
[55] | 175 | #else |
---|
[75] | 176 | string name, |
---|
[55] | 177 | #endif |
---|
| 178 | #ifdef STATISTICS |
---|
[75] | 179 | morpheo::behavioural::Parameters_Statistics * param_statistics, |
---|
[55] | 180 | #endif |
---|
[82] | 181 | Parameters * param, |
---|
| 182 | morpheo::behavioural::Tusage_t usage ); |
---|
| 183 | |
---|
[55] | 184 | public : ~Reservation_station (void); |
---|
| 185 | |
---|
| 186 | #ifdef SYSTEMC |
---|
| 187 | private : void allocation (void); |
---|
| 188 | private : void deallocation (void); |
---|
| 189 | |
---|
| 190 | public : void transition (void); |
---|
| 191 | public : void genMoore (void); |
---|
| 192 | #endif |
---|
[75] | 193 | |
---|
[55] | 194 | #ifdef STATISTICS |
---|
[75] | 195 | public : void statistics_declaration (morpheo::behavioural::Parameters_Statistics * param_statistics); |
---|
[55] | 196 | #endif |
---|
| 197 | |
---|
| 198 | #if VHDL |
---|
| 199 | public : void vhdl (void); |
---|
| 200 | private : void vhdl_declaration (Vhdl * & vhdl); |
---|
| 201 | private : void vhdl_body (Vhdl * & vhdl); |
---|
| 202 | #endif |
---|
| 203 | |
---|
[75] | 204 | #if defined(STATISTICS) or defined(VHDL_TESTBENCH) |
---|
[69] | 205 | private : void end_cycle (void); |
---|
[75] | 206 | #endif |
---|
[55] | 207 | }; |
---|
| 208 | |
---|
| 209 | }; // end namespace reservation_station |
---|
| 210 | }; // end namespace read_unit |
---|
| 211 | }; // end namespace multi_read_unit |
---|
| 212 | }; // end namespace execute_loop |
---|
| 213 | }; // end namespace multi_execute_loop |
---|
| 214 | }; // end namespace core |
---|
| 215 | |
---|
| 216 | }; // end namespace behavioural |
---|
| 217 | }; // end namespace morpheo |
---|
| 218 | |
---|
| 219 | #endif |
---|