[78] | 1 | #ifndef morpheo_behavioural_core_multi_ooo_engine_ooo_engine_rename_unit_load_store_pointer_unit_Load_Store_pointer_unit_h |
---|
| 2 | #define morpheo_behavioural_core_multi_ooo_engine_ooo_engine_rename_unit_load_store_pointer_unit_Load_Store_pointer_unit_h |
---|
| 3 | |
---|
| 4 | /* |
---|
| 5 | * $Id: Load_Store_pointer_unit.h 131 2009-07-08 18:40:08Z 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/Core/Multi_OOO_Engine/OOO_Engine/Rename_unit/Load_Store_pointer_unit/include/Types.h" |
---|
| 19 | |
---|
| 20 | #include "Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Rename_unit/Load_Store_pointer_unit/include/Parameters.h" |
---|
| 21 | #ifdef STATISTICS |
---|
| 22 | #include "Behavioural/include/Stat.h" |
---|
| 23 | #endif |
---|
| 24 | #include "Behavioural/include/Component.h" |
---|
| 25 | #ifdef VHDL |
---|
| 26 | #include "Behavioural/include/Vhdl.h" |
---|
| 27 | #endif |
---|
| 28 | #include "Behavioural/include/Usage.h" |
---|
| 29 | |
---|
| 30 | namespace morpheo { |
---|
| 31 | namespace behavioural { |
---|
| 32 | |
---|
| 33 | namespace core { |
---|
| 34 | namespace multi_ooo_engine { |
---|
| 35 | namespace ooo_engine { |
---|
| 36 | namespace rename_unit { |
---|
| 37 | namespace load_store_pointer_unit { |
---|
| 38 | |
---|
| 39 | |
---|
| 40 | class Load_Store_pointer_unit |
---|
| 41 | #if SYSTEMC |
---|
| 42 | : public sc_module |
---|
| 43 | #endif |
---|
| 44 | { |
---|
| 45 | // -----[ fields ]---------------------------------------------------- |
---|
| 46 | // Parameters |
---|
| 47 | protected : const std::string _name; |
---|
| 48 | protected : const Parameters * _param; |
---|
| 49 | private : const Tusage_t _usage; |
---|
| 50 | |
---|
| 51 | #ifdef STATISTICS |
---|
| 52 | public : Stat * _stat; |
---|
| 53 | #endif |
---|
| 54 | |
---|
| 55 | public : Component * _component; |
---|
| 56 | private : Interfaces * _interfaces; |
---|
| 57 | |
---|
| 58 | #ifdef SYSTEMC |
---|
| 59 | // ~~~~~[ Interface ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
| 60 | // ~~~~~[ Interface : "" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
| 61 | public : SC_CLOCK * in_CLOCK ; |
---|
| 62 | public : SC_IN (Tcontrol_t) * in_NRESET ; |
---|
| 63 | |
---|
| 64 | // ~~~~~[ Interface : "insert" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
| 65 | public : SC_IN (Tcontrol_t ) ** in_INSERT_VAL ; // [nb_inst_insert] |
---|
| 66 | public : SC_OUT(Tcontrol_t ) ** out_INSERT_ACK ; // [nb_inst_insert] |
---|
| 67 | public : SC_IN (Tcontext_t ) ** in_INSERT_FRONT_END_ID ; // [nb_inst_insert] |
---|
| 68 | public : SC_IN (Tcontext_t ) ** in_INSERT_CONTEXT_ID ; // [nb_inst_insert] |
---|
| 69 | public : SC_IN (Ttype_t ) ** in_INSERT_TYPE ; // [nb_inst_insert] |
---|
| 70 | public : SC_IN (Toperation_t ) ** in_INSERT_OPERATION ; // [nb_inst_insert] |
---|
| 71 | public : SC_OUT(Tlsq_ptr_t ) ** out_INSERT_STORE_QUEUE_PTR_WRITE; // [nb_inst_insert] |
---|
[122] | 72 | public : SC_OUT(Tlsq_ptr_t ) ** out_INSERT_STORE_QUEUE_PTR_READ ; // [nb_inst_insert] |
---|
| 73 | public : SC_OUT(Tcontrol_t ) ** out_INSERT_STORE_QUEUE_EMPTY ; // [nb_inst_insert] |
---|
[78] | 74 | public : SC_OUT(Tlsq_ptr_t ) ** out_INSERT_LOAD_QUEUE_PTR_WRITE ; // [nb_inst_insert] |
---|
| 75 | |
---|
| 76 | // ~~~~~[ Interface : "retire" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
| 77 | public : SC_IN (Tcontrol_t ) ** in_RETIRE_VAL ; // [nb_inst_retire] |
---|
| 78 | public : SC_OUT(Tcontrol_t ) ** out_RETIRE_ACK ; // [nb_inst_retire] |
---|
| 79 | public : SC_IN (Tcontext_t ) ** in_RETIRE_FRONT_END_ID ; // [nb_inst_retire] |
---|
| 80 | public : SC_IN (Tcontext_t ) ** in_RETIRE_CONTEXT_ID ; // [nb_inst_retire] |
---|
[88] | 81 | //public : SC_IN (Ttype_t ) ** in_RETIRE_TYPE ; // [nb_inst_retire] |
---|
| 82 | //public : SC_IN (Toperation_t ) ** in_RETIRE_OPERATION ; // [nb_inst_retire] |
---|
| 83 | public : SC_IN (Tcontrol_t ) ** in_RETIRE_USE_STORE_QUEUE ; // [nb_inst_retire] |
---|
| 84 | public : SC_IN (Tcontrol_t ) ** in_RETIRE_USE_LOAD_QUEUE ; // [nb_inst_retire] |
---|
[78] | 85 | public : SC_IN (Tlsq_ptr_t ) ** in_RETIRE_STORE_QUEUE_PTR_WRITE; // [nb_inst_retire] |
---|
| 86 | public : SC_IN (Tlsq_ptr_t ) ** in_RETIRE_LOAD_QUEUE_PTR_WRITE ; // [nb_inst_retire] |
---|
| 87 | |
---|
[122] | 88 | // ~~~~~[ Interface "retire_event" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
| 89 | public : SC_IN (Tcontrol_t ) *** in_RETIRE_EVENT_VAL ;//[nb_front_end][nb_context] |
---|
| 90 | public : SC_OUT(Tcontrol_t ) *** out_RETIRE_EVENT_ACK ;//[nb_front_end][nb_context] |
---|
| 91 | public : SC_IN (Tevent_state_t ) *** in_RETIRE_EVENT_STATE ;//[nb_front_end][nb_context] |
---|
| 92 | |
---|
[78] | 93 | // ~~~~~[ Component ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
| 94 | |
---|
| 95 | // ~~~~~[ Register ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
[122] | 96 | private : Tlsq_ptr_t * reg_STORE_QUEUE_PTR_WRITE; // [nb_load_store_queue] |
---|
| 97 | private : Tlsq_ptr_t ** reg_STORE_QUEUE_PTR_READ ; // [nb_front_end][nb_context] |
---|
| 98 | private : bool ** reg_STORE_QUEUE_EMPTY ; // [nb_front_end][nb_context] |
---|
| 99 | private : bool ** reg_STORE_QUEUE_USE ; // [nb_load_store_queue][size_store_queue] |
---|
| 100 | private : Tlsq_ptr_t * reg_STORE_QUEUE_NB_USE ; // [nb_load_store_queue] |
---|
| 101 | private : Tlsq_ptr_t * reg_LOAD_QUEUE_PTR_WRITE ; // [nb_load_store_queue] |
---|
| 102 | private : bool ** reg_LOAD_QUEUE_USE ; // [nb_load_store_queue][size_load_queue] |
---|
[78] | 103 | |
---|
| 104 | // ~~~~~[ Internal ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
[122] | 105 | private : Tcontrol_t * internal_INSERT_ACK ; // [nb_inst_insert] |
---|
| 106 | private : operation_use_t * internal_INSERT_OPERATION_USE; // [nb_inst_insert] |
---|
| 107 | private : uint32_t * internal_INSERT_LSQ ; // [nb_inst_insert] |
---|
| 108 | private : Tlsq_ptr_t * internal_INSERT_PTR ; // [nb_inst_insert] |
---|
[78] | 109 | |
---|
[122] | 110 | private : Tcontrol_t * internal_RETIRE_ACK ; // [nb_inst_retire] |
---|
| 111 | private : operation_use_t * internal_RETIRE_OPERATION_USE; // [nb_inst_retire] |
---|
| 112 | private : uint32_t * internal_RETIRE_LSQ ; // [nb_inst_retire] |
---|
| 113 | private : Tlsq_ptr_t * internal_RETIRE_PTR ; // [nb_inst_retire] |
---|
| 114 | private : Tcontrol_t ** internal_RETIRE_EVENT_ACK ;//[nb_front_end][nb_context] |
---|
[78] | 115 | |
---|
| 116 | #endif |
---|
| 117 | |
---|
| 118 | // -----[ Methods ]--------------------------------------------------- |
---|
| 119 | |
---|
| 120 | #ifdef SYSTEMC |
---|
| 121 | SC_HAS_PROCESS (Load_Store_pointer_unit); |
---|
| 122 | #endif |
---|
| 123 | public : Load_Store_pointer_unit |
---|
| 124 | ( |
---|
| 125 | #ifdef SYSTEMC |
---|
| 126 | sc_module_name name, |
---|
| 127 | #else |
---|
| 128 | std::string name, |
---|
| 129 | #endif |
---|
| 130 | #ifdef STATISTICS |
---|
| 131 | morpheo::behavioural::Parameters_Statistics * param_statistics, |
---|
| 132 | #endif |
---|
| 133 | Parameters * param, |
---|
[82] | 134 | morpheo::behavioural::Tusage_t usage |
---|
[78] | 135 | ); |
---|
| 136 | public : ~Load_Store_pointer_unit (void); |
---|
| 137 | |
---|
| 138 | private : void allocation ( |
---|
| 139 | #ifdef STATISTICS |
---|
| 140 | morpheo::behavioural::Parameters_Statistics * param_statistics |
---|
| 141 | #else |
---|
| 142 | void |
---|
| 143 | #endif |
---|
| 144 | ); |
---|
| 145 | private : void deallocation (void); |
---|
| 146 | |
---|
| 147 | #ifdef SYSTEMC |
---|
[131] | 148 | public : void constant (void); |
---|
[78] | 149 | public : void transition (void); |
---|
| 150 | public : void genMealy_insert (void); |
---|
| 151 | public : void genMealy_retire (void); |
---|
| 152 | #endif |
---|
| 153 | |
---|
| 154 | #if VHDL |
---|
| 155 | public : void vhdl (void); |
---|
| 156 | private : void vhdl_declaration (Vhdl * & vhdl); |
---|
| 157 | private : void vhdl_body (Vhdl * & vhdl); |
---|
| 158 | #endif |
---|
| 159 | |
---|
| 160 | #ifdef STATISTICS |
---|
| 161 | public : void statistics_declaration (morpheo::behavioural::Parameters_Statistics * param_statistics); |
---|
| 162 | #endif |
---|
| 163 | #if defined(STATISTICS) or defined(VHDL_TESTBENCH) |
---|
| 164 | private : void end_cycle (void); |
---|
| 165 | #endif |
---|
| 166 | }; |
---|
| 167 | |
---|
| 168 | }; // end namespace load_store_pointer_unit |
---|
| 169 | }; // end namespace rename_unit |
---|
| 170 | }; // end namespace ooo_engine |
---|
| 171 | }; // end namespace multi_ooo_engine |
---|
| 172 | }; // end namespace core |
---|
| 173 | |
---|
| 174 | }; // end namespace behavioural |
---|
| 175 | }; // end namespace morpheo |
---|
| 176 | |
---|
| 177 | #endif |
---|