[77] | 1 | #ifndef morpheo_behavioural_core_multi_execute_loop_execute_loop_network_read_unit_to_execution_unit_Read_unit_to_Execution_unit_h |
---|
| 2 | #define morpheo_behavioural_core_multi_execute_loop_execute_loop_network_read_unit_to_execution_unit_Read_unit_to_Execution_unit_h |
---|
| 3 | |
---|
| 4 | /* |
---|
| 5 | * $Id: Read_unit_to_Execution_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 <list> |
---|
| 17 | #include "Common/include/ToString.h" |
---|
| 18 | #include "Common/include/Debug.h" |
---|
[78] | 19 | #include "Behavioural/include/Types.h" |
---|
| 20 | #include "Behavioural/include/Identification.h" |
---|
[77] | 21 | |
---|
| 22 | #include "Behavioural/Core/Multi_Execute_loop/Execute_loop/Network/Read_unit_to_Execution_unit/include/Parameters.h" |
---|
| 23 | #ifdef STATISTICS |
---|
| 24 | #include "Behavioural/include/Stat.h" |
---|
| 25 | #endif |
---|
| 26 | #include "Behavioural/include/Component.h" |
---|
| 27 | #ifdef VHDL |
---|
| 28 | #include "Behavioural/include/Vhdl.h" |
---|
| 29 | #endif |
---|
| 30 | #include "Behavioural/include/Usage.h" |
---|
| 31 | |
---|
| 32 | namespace morpheo { |
---|
| 33 | namespace behavioural { |
---|
| 34 | |
---|
| 35 | namespace core { |
---|
| 36 | namespace multi_execute_loop { |
---|
| 37 | namespace execute_loop { |
---|
| 38 | namespace network { |
---|
| 39 | namespace read_unit_to_execution_unit { |
---|
| 40 | |
---|
[88] | 41 | class destination_t |
---|
| 42 | { |
---|
| 43 | public : uint32_t grp; |
---|
| 44 | public : uint32_t elt; |
---|
| 45 | |
---|
| 46 | public : destination_t (uint32_t grp, uint32_t elt) |
---|
| 47 | { |
---|
| 48 | this->grp = grp; |
---|
| 49 | this->elt = elt; |
---|
| 50 | } |
---|
| 51 | }; |
---|
[77] | 52 | |
---|
| 53 | class Read_unit_to_Execution_unit |
---|
| 54 | #if SYSTEMC |
---|
| 55 | : public sc_module |
---|
| 56 | #endif |
---|
| 57 | { |
---|
| 58 | // -----[ fields ]---------------------------------------------------- |
---|
| 59 | // Parameters |
---|
| 60 | protected : const std::string _name; |
---|
| 61 | protected : const Parameters * _param; |
---|
| 62 | private : const Tusage_t _usage; |
---|
| 63 | |
---|
| 64 | #ifdef STATISTICS |
---|
| 65 | public : Stat * _stat; |
---|
| 66 | #endif |
---|
| 67 | |
---|
| 68 | public : Component * _component; |
---|
| 69 | private : Interfaces * _interfaces; |
---|
| 70 | |
---|
| 71 | #ifdef SYSTEMC |
---|
| 72 | // ~~~~~[ Interface ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
| 73 | // Interface |
---|
| 74 | public : SC_CLOCK * in_CLOCK ; |
---|
| 75 | public : SC_IN (Tcontrol_t) * in_NRESET ; |
---|
| 76 | |
---|
| 77 | // ~~~~~[ Interface "read_unit_out" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
[88] | 78 | public : SC_IN (Tcontrol_t ) *** in_READ_UNIT_OUT_VAL ;//[nb_read_unit][nb_read_unit_port] |
---|
| 79 | public : SC_OUT(Tcontrol_t ) *** out_READ_UNIT_OUT_ACK ;//[nb_read_unit][nb_read_unit_port] |
---|
| 80 | public : SC_IN (Tcontext_t ) *** in_READ_UNIT_OUT_CONTEXT_ID ;//[nb_read_unit][nb_read_unit_port] |
---|
| 81 | public : SC_IN (Tcontext_t ) *** in_READ_UNIT_OUT_FRONT_END_ID ;//[nb_read_unit][nb_read_unit_port] |
---|
| 82 | public : SC_IN (Tcontext_t ) *** in_READ_UNIT_OUT_OOO_ENGINE_ID ;//[nb_read_unit][nb_read_unit_port] |
---|
| 83 | public : SC_IN (Tpacket_t ) *** in_READ_UNIT_OUT_PACKET_ID ;//[nb_read_unit][nb_read_unit_port] |
---|
| 84 | public : SC_IN (Toperation_t ) *** in_READ_UNIT_OUT_OPERATION ;//[nb_read_unit][nb_read_unit_port] |
---|
| 85 | public : SC_IN (Ttype_t ) *** in_READ_UNIT_OUT_TYPE ;//[nb_read_unit][nb_read_unit_port] |
---|
[136] | 86 | public : SC_IN (Tcontrol_t ) *** in_READ_UNIT_OUT_CANCEL ;//[nb_read_unit][nb_read_unit_port] |
---|
[88] | 87 | public : SC_IN (Tlsq_ptr_t ) *** in_READ_UNIT_OUT_STORE_QUEUE_PTR_WRITE ;//[nb_read_unit][nb_read_unit_port] |
---|
[122] | 88 | public : SC_IN (Tlsq_ptr_t ) *** in_READ_UNIT_OUT_STORE_QUEUE_PTR_READ ;//[nb_read_unit][nb_read_unit_port] |
---|
| 89 | public : SC_IN (Tcontrol_t ) *** in_READ_UNIT_OUT_STORE_QUEUE_EMPTY ;//[nb_read_unit][nb_read_unit_port] |
---|
[88] | 90 | public : SC_IN (Tlsq_ptr_t ) *** in_READ_UNIT_OUT_LOAD_QUEUE_PTR_WRITE ;//[nb_read_unit][nb_read_unit_port] |
---|
| 91 | public : SC_IN (Tcontrol_t ) *** in_READ_UNIT_OUT_HAS_IMMEDIAT ;//[nb_read_unit][nb_read_unit_port] |
---|
| 92 | public : SC_IN (Tgeneral_data_t ) *** in_READ_UNIT_OUT_IMMEDIAT ;//[nb_read_unit][nb_read_unit_port] |
---|
| 93 | public : SC_IN (Tgeneral_data_t ) *** in_READ_UNIT_OUT_DATA_RA ;//[nb_read_unit][nb_read_unit_port] |
---|
| 94 | public : SC_IN (Tgeneral_data_t ) *** in_READ_UNIT_OUT_DATA_RB ;//[nb_read_unit][nb_read_unit_port] |
---|
| 95 | public : SC_IN (Tspecial_data_t ) *** in_READ_UNIT_OUT_DATA_RC ;//[nb_read_unit][nb_read_unit_port] |
---|
| 96 | public : SC_IN (Tcontrol_t ) *** in_READ_UNIT_OUT_WRITE_RD ;//[nb_read_unit][nb_read_unit_port] |
---|
| 97 | public : SC_IN (Tgeneral_address_t) *** in_READ_UNIT_OUT_NUM_REG_RD ;//[nb_read_unit][nb_read_unit_port] |
---|
| 98 | public : SC_IN (Tcontrol_t ) *** in_READ_UNIT_OUT_WRITE_RE ;//[nb_read_unit][nb_read_unit_port] |
---|
| 99 | public : SC_IN (Tspecial_address_t) *** in_READ_UNIT_OUT_NUM_REG_RE ;//[nb_read_unit][nb_read_unit_port] |
---|
[77] | 100 | |
---|
| 101 | // ~~~~~[ Interface "execute_unit_in" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
[88] | 102 | public : SC_OUT(Tcontrol_t ) *** out_EXECUTE_UNIT_IN_VAL ;//[nb_execute_unit][nb_execute_unit_port] |
---|
| 103 | public : SC_IN (Tcontrol_t ) *** in_EXECUTE_UNIT_IN_ACK ;//[nb_execute_unit][nb_execute_unit_port] |
---|
| 104 | public : SC_OUT(Tcontext_t ) *** out_EXECUTE_UNIT_IN_CONTEXT_ID ;//[nb_execute_unit][nb_execute_unit_port] |
---|
| 105 | public : SC_OUT(Tcontext_t ) *** out_EXECUTE_UNIT_IN_FRONT_END_ID ;//[nb_execute_unit][nb_execute_unit_port] |
---|
| 106 | public : SC_OUT(Tcontext_t ) *** out_EXECUTE_UNIT_IN_OOO_ENGINE_ID ;//[nb_execute_unit][nb_execute_unit_port] |
---|
| 107 | public : SC_OUT(Tpacket_t ) *** out_EXECUTE_UNIT_IN_PACKET_ID ;//[nb_execute_unit][nb_execute_unit_port] |
---|
| 108 | public : SC_OUT(Toperation_t ) *** out_EXECUTE_UNIT_IN_OPERATION ;//[nb_execute_unit][nb_execute_unit_port] |
---|
| 109 | public : SC_OUT(Ttype_t ) *** out_EXECUTE_UNIT_IN_TYPE ;//[nb_execute_unit][nb_execute_unit_port] |
---|
[136] | 110 | public : SC_OUT(Tcontrol_t ) *** out_EXECUTE_UNIT_IN_CANCEL ;//[nb_execute_unit][nb_execute_unit_port] |
---|
[88] | 111 | public : SC_OUT(Tlsq_ptr_t ) *** out_EXECUTE_UNIT_IN_STORE_QUEUE_PTR_WRITE;//[nb_execute_unit][nb_execute_unit_port] |
---|
[122] | 112 | public : SC_OUT(Tlsq_ptr_t ) *** out_EXECUTE_UNIT_IN_STORE_QUEUE_PTR_READ ;//[nb_execute_unit][nb_execute_unit_port] |
---|
| 113 | public : SC_OUT(Tcontrol_t ) *** out_EXECUTE_UNIT_IN_STORE_QUEUE_EMPTY ;//[nb_execute_unit][nb_execute_unit_port] |
---|
[88] | 114 | public : SC_OUT(Tlsq_ptr_t ) *** out_EXECUTE_UNIT_IN_LOAD_QUEUE_PTR_WRITE ;//[nb_execute_unit][nb_execute_unit_port] |
---|
| 115 | public : SC_OUT(Tcontrol_t ) *** out_EXECUTE_UNIT_IN_HAS_IMMEDIAT ;//[nb_execute_unit][nb_execute_unit_port] |
---|
| 116 | public : SC_OUT(Tgeneral_data_t ) *** out_EXECUTE_UNIT_IN_IMMEDIAT ;//[nb_execute_unit][nb_execute_unit_port] |
---|
| 117 | public : SC_OUT(Tgeneral_data_t ) *** out_EXECUTE_UNIT_IN_DATA_RA ;//[nb_execute_unit][nb_execute_unit_port] |
---|
| 118 | public : SC_OUT(Tgeneral_data_t ) *** out_EXECUTE_UNIT_IN_DATA_RB ;//[nb_execute_unit][nb_execute_unit_port] |
---|
| 119 | public : SC_OUT(Tspecial_data_t ) *** out_EXECUTE_UNIT_IN_DATA_RC ;//[nb_execute_unit][nb_execute_unit_port] |
---|
| 120 | public : SC_OUT(Tcontrol_t ) *** out_EXECUTE_UNIT_IN_WRITE_RD ;//[nb_execute_unit][nb_execute_unit_port] |
---|
| 121 | public : SC_OUT(Tgeneral_address_t) *** out_EXECUTE_UNIT_IN_NUM_REG_RD ;//[nb_execute_unit][nb_execute_unit_port] |
---|
| 122 | public : SC_OUT(Tcontrol_t ) *** out_EXECUTE_UNIT_IN_WRITE_RE ;//[nb_execute_unit][nb_execute_unit_port] |
---|
| 123 | public : SC_OUT(Tspecial_address_t) *** out_EXECUTE_UNIT_IN_NUM_REG_RE ;//[nb_execute_unit][nb_execute_unit_port] |
---|
[77] | 124 | |
---|
| 125 | // ~~~~~[ Component ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
| 126 | |
---|
| 127 | // ~~~~~[ Register ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
| 128 | |
---|
| 129 | // ~~~~~[ Internal ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
[88] | 130 | private : std::list<destination_t> *** _destination; // [nb_read_unit][nb_thread][nb_type]; |
---|
[77] | 131 | #endif |
---|
| 132 | |
---|
| 133 | // -----[ Methods ]--------------------------------------------------- |
---|
| 134 | |
---|
| 135 | #ifdef SYSTEMC |
---|
| 136 | SC_HAS_PROCESS (Read_unit_to_Execution_unit); |
---|
| 137 | #endif |
---|
| 138 | public : Read_unit_to_Execution_unit |
---|
| 139 | ( |
---|
| 140 | #ifdef SYSTEMC |
---|
| 141 | sc_module_name name, |
---|
| 142 | #else |
---|
| 143 | std::string name, |
---|
| 144 | #endif |
---|
| 145 | #ifdef STATISTICS |
---|
| 146 | morpheo::behavioural::Parameters_Statistics * param_statistics, |
---|
| 147 | #endif |
---|
| 148 | Parameters * param, |
---|
[82] | 149 | morpheo::behavioural::Tusage_t usage |
---|
[77] | 150 | ); |
---|
| 151 | public : ~Read_unit_to_Execution_unit (void); |
---|
| 152 | |
---|
| 153 | private : void allocation ( |
---|
| 154 | #ifdef STATISTICS |
---|
| 155 | morpheo::behavioural::Parameters_Statistics * param_statistics |
---|
| 156 | #else |
---|
| 157 | void |
---|
| 158 | #endif |
---|
| 159 | ); |
---|
| 160 | private : void deallocation (void); |
---|
| 161 | |
---|
| 162 | #ifdef SYSTEMC |
---|
| 163 | public : void transition (void); |
---|
| 164 | public : void genMealy (void); |
---|
| 165 | #endif |
---|
| 166 | |
---|
| 167 | #if VHDL |
---|
| 168 | public : void vhdl (void); |
---|
| 169 | private : void vhdl_declaration (Vhdl * & vhdl); |
---|
| 170 | private : void vhdl_body (Vhdl * & vhdl); |
---|
| 171 | #endif |
---|
| 172 | |
---|
| 173 | #ifdef STATISTICS |
---|
| 174 | public : void statistics_declaration (morpheo::behavioural::Parameters_Statistics * param_statistics); |
---|
| 175 | #endif |
---|
| 176 | #if defined(STATISTICS) or defined(VHDL_TESTBENCH) |
---|
| 177 | private : void end_cycle (void); |
---|
| 178 | #endif |
---|
| 179 | }; |
---|
| 180 | |
---|
| 181 | }; // end namespace read_unit_to_execution_unit |
---|
| 182 | }; // end namespace network |
---|
| 183 | }; // end namespace execute_loop |
---|
| 184 | }; // end namespace multi_execute_loop |
---|
| 185 | }; // end namespace core |
---|
| 186 | |
---|
| 187 | }; // end namespace behavioural |
---|
| 188 | }; // end namespace morpheo |
---|
| 189 | |
---|
| 190 | #endif |
---|