[88] | 1 | /* |
---|
| 2 | * $Id: Reexecute_unit_allocation.cpp 117 2009-05-16 14:42:39Z rosiere $ |
---|
| 3 | * |
---|
| 4 | * [ Description ] |
---|
| 5 | * |
---|
| 6 | */ |
---|
| 7 | |
---|
| 8 | #include "Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Reexecute_unit/include/Reexecute_unit.h" |
---|
| 9 | #include "Behavioural/include/Allocation.h" |
---|
| 10 | #include "Common/include/Max.h" |
---|
| 11 | |
---|
| 12 | namespace morpheo { |
---|
| 13 | namespace behavioural { |
---|
| 14 | namespace core { |
---|
| 15 | namespace multi_ooo_engine { |
---|
| 16 | namespace ooo_engine { |
---|
| 17 | namespace reexecute_unit { |
---|
| 18 | |
---|
| 19 | |
---|
| 20 | |
---|
| 21 | #undef FUNCTION |
---|
| 22 | #define FUNCTION "Reexecute_unit::allocation" |
---|
| 23 | void Reexecute_unit::allocation ( |
---|
| 24 | #ifdef STATISTICS |
---|
| 25 | morpheo::behavioural::Parameters_Statistics * param_statistics |
---|
| 26 | #else |
---|
| 27 | void |
---|
| 28 | #endif |
---|
| 29 | ) |
---|
| 30 | { |
---|
| 31 | log_begin(Reexecute_unit,FUNCTION); |
---|
| 32 | |
---|
| 33 | _component = new Component (_usage); |
---|
| 34 | |
---|
| 35 | Entity * entity = _component->set_entity (_name |
---|
| 36 | ,"Reexecute_unit" |
---|
| 37 | #ifdef POSITION |
---|
| 38 | ,COMBINATORY |
---|
| 39 | #endif |
---|
| 40 | ); |
---|
| 41 | |
---|
| 42 | _interfaces = entity->set_interfaces(); |
---|
| 43 | |
---|
| 44 | // ~~~~~[ Interface : "" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
| 45 | { |
---|
| 46 | Interface * interface = _interfaces->set_interface("" |
---|
| 47 | #ifdef POSITION |
---|
| 48 | ,IN |
---|
| 49 | ,SOUTH, |
---|
| 50 | _("Generalist interface") |
---|
| 51 | #endif |
---|
| 52 | ); |
---|
| 53 | |
---|
| 54 | in_CLOCK = interface->set_signal_clk ("clock" ,1, CLOCK_VHDL_YES); |
---|
| 55 | in_NRESET = interface->set_signal_in <Tcontrol_t> ("nreset",1, RESET_VHDL_YES); |
---|
| 56 | } |
---|
| 57 | |
---|
| 58 | // ~~~~~[ Interface "execute_loop" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
| 59 | { |
---|
[112] | 60 | ALLOC2_INTERFACE_BEGIN("execute_loop", IN, EAST, _("Instruction executed from execute_loop"),_param->_nb_execute_loop,_param->_nb_inst_execute[it1]); |
---|
[88] | 61 | |
---|
| 62 | _ALLOC2_VALACK_IN ( in_EXECUTE_LOOP_VAL ,VAL,_param->_nb_execute_loop,_param->_nb_inst_execute[it1]); |
---|
| 63 | _ALLOC2_VALACK_OUT(out_EXECUTE_LOOP_ACK ,ACK,_param->_nb_execute_loop,_param->_nb_inst_execute[it1]); |
---|
| 64 | _ALLOC2_SIGNAL_IN ( in_EXECUTE_LOOP_CONTEXT_ID ,"context_id" ,Tcontext_t ,_param->_size_context_id ,_param->_nb_execute_loop,_param->_nb_inst_execute[it1]); |
---|
| 65 | _ALLOC2_SIGNAL_IN ( in_EXECUTE_LOOP_FRONT_END_ID ,"front_end_id",Tcontext_t ,_param->_size_front_end_id,_param->_nb_execute_loop,_param->_nb_inst_execute[it1]); |
---|
| 66 | _ALLOC2_SIGNAL_IN ( in_EXECUTE_LOOP_PACKET_ID ,"packet_id" ,Tpacket_t ,_param->_size_rob_ptr ,_param->_nb_execute_loop,_param->_nb_inst_execute[it1]); |
---|
| 67 | // _ALLOC2_SIGNAL_IN ( in_EXECUTE_LOOP_OPERATION ,"operation" ,Toperation_t ,_param->_size_operation ,_param->_nb_execute_loop,_param->_nb_inst_execute[it1]); |
---|
| 68 | // _ALLOC2_SIGNAL_IN ( in_EXECUTE_LOOP_TYPE ,"type" ,Ttype_t ,_param->_size_type ,_param->_nb_execute_loop,_param->_nb_inst_execute[it1]); |
---|
| 69 | _ALLOC2_SIGNAL_IN ( in_EXECUTE_LOOP_FLAGS ,"flags" ,Tspecial_data_t ,_param->_size_special_data,_param->_nb_execute_loop,_param->_nb_inst_execute[it1]); |
---|
| 70 | _ALLOC2_SIGNAL_IN ( in_EXECUTE_LOOP_EXCEPTION ,"exception" ,Texception_t ,_param->_size_exception ,_param->_nb_execute_loop,_param->_nb_inst_execute[it1]); |
---|
| 71 | _ALLOC2_SIGNAL_IN ( in_EXECUTE_LOOP_NO_SEQUENCE ,"no_sequence" ,Tcontrol_t ,1 ,_param->_nb_execute_loop,_param->_nb_inst_execute[it1]); |
---|
[97] | 72 | _ALLOC2_SIGNAL_IN ( in_EXECUTE_LOOP_ADDRESS ,"address" ,Taddress_t ,_param->_size_instruction_address,_param->_nb_execute_loop,_param->_nb_inst_execute[it1]); |
---|
[88] | 73 | _ALLOC2_SIGNAL_IN ( in_EXECUTE_LOOP_DATA ,"data" ,Tgeneral_data_t ,_param->_size_general_data,_param->_nb_execute_loop,_param->_nb_inst_execute[it1]); |
---|
[112] | 74 | |
---|
| 75 | ALLOC2_INTERFACE_END(_param->_nb_execute_loop,_param->_nb_inst_execute[it1]); |
---|
[88] | 76 | } |
---|
| 77 | |
---|
| 78 | // ~~~~~[ Interface "commit" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
| 79 | { |
---|
[112] | 80 | ALLOC1_INTERFACE_BEGIN("commit",OUT,WEST, _("Instruction executed to Re Order Buffer"),_param->_nb_inst_commit); |
---|
[88] | 81 | |
---|
| 82 | ALLOC1_VALACK_OUT(out_COMMIT_VAL ,VAL); |
---|
| 83 | ALLOC1_VALACK_IN ( in_COMMIT_ACK ,ACK); |
---|
| 84 | ALLOC1_SIGNAL_OUT(out_COMMIT_WEN ,"wen" ,Tcontrol_t ,1); |
---|
[117] | 85 | // ALLOC1_SIGNAL_OUT(out_COMMIT_CONTEXT_ID ,"context_id" ,Tcontext_t ,_param->_size_context_id ); |
---|
| 86 | // ALLOC1_SIGNAL_OUT(out_COMMIT_FRONT_END_ID ,"front_end_id",Tcontext_t ,_param->_size_front_end_id); |
---|
[88] | 87 | ALLOC1_SIGNAL_OUT(out_COMMIT_PACKET_ID ,"packet_id" ,Tpacket_t ,_param->_size_rob_ptr ); |
---|
| 88 | // ALLOC1_SIGNAL_OUT(out_COMMIT_OPERATION ,"operation" ,Toperation_t ,_param->_size_operation ); |
---|
| 89 | // ALLOC1_SIGNAL_OUT(out_COMMIT_TYPE ,"type" ,Ttype_t ,_param->_size_type ); |
---|
| 90 | ALLOC1_SIGNAL_OUT(out_COMMIT_FLAGS ,"flags" ,Tspecial_data_t ,_param->_size_special_data); |
---|
| 91 | ALLOC1_SIGNAL_OUT(out_COMMIT_EXCEPTION ,"exception" ,Texception_t ,_param->_size_exception ); |
---|
| 92 | ALLOC1_SIGNAL_OUT(out_COMMIT_NO_SEQUENCE ,"no_sequence" ,Tcontrol_t ,1 ); |
---|
[97] | 93 | ALLOC1_SIGNAL_OUT(out_COMMIT_ADDRESS ,"address" ,Taddress_t ,_param->_size_instruction_address); |
---|
[88] | 94 | ALLOC1_SIGNAL_IN ( in_COMMIT_NUM_REG_RD ,"num_reg_rd" ,Tgeneral_address_t ,_param->_size_general_register); |
---|
[112] | 95 | |
---|
| 96 | ALLOC1_INTERFACE_END(_param->_nb_inst_commit); |
---|
[88] | 97 | } |
---|
| 98 | |
---|
| 99 | // ~~~~~[ Interface : "spr" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
| 100 | { |
---|
[112] | 101 | ALLOC1_INTERFACE_BEGIN("spr",OUT,EAST, _("Access to Special Register"), _param->_nb_inst_reexecute); |
---|
[88] | 102 | |
---|
| 103 | ALLOC1_VALACK_OUT(out_SPR_VAL ,VAL); |
---|
| 104 | ALLOC1_VALACK_IN ( in_SPR_ACK ,ACK); |
---|
| 105 | ALLOC1_SIGNAL_OUT(out_SPR_WEN ,"wen" ,Tcontrol_t ,1); |
---|
| 106 | ALLOC1_SIGNAL_OUT(out_SPR_CONTEXT_ID ,"context_id" ,Tcontext_t ,_param->_size_context_id ); |
---|
| 107 | ALLOC1_SIGNAL_OUT(out_SPR_FRONT_END_ID ,"front_end_id",Tcontext_t ,_param->_size_front_end_id); |
---|
| 108 | ALLOC1_SIGNAL_OUT(out_SPR_NUM_GROUP ,"num_group" ,Tspr_address_t ,_param->_size_special_address_group ); |
---|
| 109 | ALLOC1_SIGNAL_OUT(out_SPR_NUM_REG ,"num_reg" ,Tspr_address_t ,_param->_size_special_address_register); |
---|
| 110 | ALLOC1_SIGNAL_OUT(out_SPR_WDATA ,"wdata" ,Tspr_t ,_param->_size_spr); |
---|
| 111 | ALLOC1_SIGNAL_IN ( in_SPR_RDATA ,"rdata" ,Tspr_t ,_param->_size_spr); |
---|
| 112 | ALLOC1_SIGNAL_IN ( in_SPR_INVALID ,"invalid" ,Tcontrol_t ,1); |
---|
[112] | 113 | |
---|
| 114 | ALLOC1_INTERFACE_END(_param->_nb_inst_reexecute); |
---|
[88] | 115 | } |
---|
| 116 | |
---|
| 117 | // ~~~~~[ Interface : "reexecute_rob" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
| 118 | { |
---|
[112] | 119 | ALLOC1_INTERFACE_BEGIN("reexecute_rob", IN,EAST, _("Instruction reexecuted by the Re Order Buffer (Store head)"), _param->_nb_inst_reexecute); |
---|
[88] | 120 | |
---|
| 121 | ALLOC1_VALACK_IN ( in_REEXECUTE_ROB_VAL ,VAL); |
---|
| 122 | ALLOC1_VALACK_OUT(out_REEXECUTE_ROB_ACK ,ACK); |
---|
| 123 | ALLOC1_SIGNAL_IN ( in_REEXECUTE_ROB_CONTEXT_ID ,"context_id" ,Tcontext_t ,_param->_size_context_id); |
---|
| 124 | ALLOC1_SIGNAL_IN ( in_REEXECUTE_ROB_FRONT_END_ID ,"front_end_id" ,Tcontext_t ,_param->_size_front_end_id); |
---|
| 125 | ALLOC1_SIGNAL_IN ( in_REEXECUTE_ROB_PACKET_ID ,"packet_id" ,Tpacket_t ,_param->_size_rob_ptr ); |
---|
| 126 | ALLOC1_SIGNAL_IN ( in_REEXECUTE_ROB_OPERATION ,"operation" ,Toperation_t ,_param->_size_operation); |
---|
| 127 | ALLOC1_SIGNAL_IN ( in_REEXECUTE_ROB_TYPE ,"type" ,Ttype_t ,_param->_size_type); |
---|
| 128 | ALLOC1_SIGNAL_IN ( in_REEXECUTE_ROB_STORE_QUEUE_PTR_WRITE ,"store_queue_ptr_write",Tlsq_ptr_t ,_param->_size_store_queue_ptr); |
---|
[112] | 129 | |
---|
| 130 | ALLOC1_INTERFACE_END(_param->_nb_inst_reexecute); |
---|
[88] | 131 | } |
---|
| 132 | |
---|
| 133 | // ~~~~~[ Interface : "reexecute" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
| 134 | { |
---|
[112] | 135 | ALLOC1_INTERFACE_BEGIN("reexecute",OUT,SOUTH, _("Instruction reexecute, send at the issue_queue"), _param->_nb_inst_reexecute); |
---|
[88] | 136 | |
---|
| 137 | ALLOC1_VALACK_OUT(out_REEXECUTE_VAL ,VAL); |
---|
| 138 | ALLOC1_VALACK_IN ( in_REEXECUTE_ACK ,ACK); |
---|
[112] | 139 | ALLOC1_SIGNAL_OUT(out_REEXECUTE_CONTEXT_ID ,"context_id" ,Tcontext_t ,_param->_size_context_id ); |
---|
| 140 | ALLOC1_SIGNAL_OUT(out_REEXECUTE_FRONT_END_ID ,"front_end_id" ,Tcontext_t ,_param->_size_front_end_id ); |
---|
| 141 | ALLOC1_SIGNAL_OUT(out_REEXECUTE_PACKET_ID ,"packet_id" ,Tpacket_t ,_param->_size_rob_ptr ); |
---|
| 142 | ALLOC1_SIGNAL_OUT(out_REEXECUTE_OPERATION ,"operation" ,Toperation_t ,_param->_size_operation ); |
---|
| 143 | ALLOC1_SIGNAL_OUT(out_REEXECUTE_TYPE ,"type" ,Ttype_t ,_param->_size_type ); |
---|
| 144 | ALLOC1_SIGNAL_OUT(out_REEXECUTE_STORE_QUEUE_PTR_WRITE,"store_queue_ptr_write",Tlsq_ptr_t ,_param->_size_store_queue_ptr ); |
---|
| 145 | ALLOC1_SIGNAL_OUT(out_REEXECUTE_LOAD_QUEUE_PTR_WRITE ,"load_queue_ptr_write" ,Tlsq_ptr_t ,_param->_size_load_queue_ptr ); |
---|
| 146 | ALLOC1_SIGNAL_OUT(out_REEXECUTE_HAS_IMMEDIAT ,"has_immediat" ,Tcontrol_t ,1 ); |
---|
| 147 | ALLOC1_SIGNAL_OUT(out_REEXECUTE_IMMEDIAT ,"immediat" ,Tgeneral_data_t ,_param->_size_general_data ); |
---|
| 148 | ALLOC1_SIGNAL_OUT(out_REEXECUTE_READ_RA ,"read_ra" ,Tcontrol_t ,1 ); |
---|
| 149 | ALLOC1_SIGNAL_OUT(out_REEXECUTE_NUM_REG_RA ,"num_reg_ra" ,Tgeneral_address_t,_param->_size_general_register); |
---|
| 150 | ALLOC1_SIGNAL_OUT(out_REEXECUTE_READ_RB ,"read_rb" ,Tcontrol_t ,1 ); |
---|
| 151 | ALLOC1_SIGNAL_OUT(out_REEXECUTE_NUM_REG_RB ,"num_reg_rb" ,Tgeneral_address_t,_param->_size_general_register); |
---|
| 152 | ALLOC1_SIGNAL_OUT(out_REEXECUTE_READ_RC ,"read_rc" ,Tcontrol_t ,1 ); |
---|
| 153 | ALLOC1_SIGNAL_OUT(out_REEXECUTE_NUM_REG_RC ,"num_reg_rc" ,Tspecial_address_t,_param->_size_special_register); |
---|
| 154 | ALLOC1_SIGNAL_OUT(out_REEXECUTE_WRITE_RD ,"write_rd" ,Tcontrol_t ,1 ); |
---|
| 155 | ALLOC1_SIGNAL_OUT(out_REEXECUTE_NUM_REG_RD ,"num_reg_rd" ,Tgeneral_address_t,_param->_size_general_register); |
---|
| 156 | ALLOC1_SIGNAL_OUT(out_REEXECUTE_WRITE_RE ,"write_re" ,Tcontrol_t ,1 ); |
---|
| 157 | ALLOC1_SIGNAL_OUT(out_REEXECUTE_NUM_REG_RE ,"num_reg_re" ,Tspecial_address_t,_param->_size_special_register); |
---|
| 158 | |
---|
| 159 | ALLOC1_INTERFACE_END(_param->_nb_inst_reexecute); |
---|
[88] | 160 | } |
---|
| 161 | |
---|
| 162 | if (usage_is_set(_usage,USE_SYSTEMC)) |
---|
| 163 | { |
---|
| 164 | // ~~~~~[ Register ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
[112] | 165 | ALLOC1(_reexecute_queue ,std::list<entry_t *>,_param->_nb_bank); |
---|
[88] | 166 | |
---|
| 167 | // ~~~~~[ Internal ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
[112] | 168 | ALLOC1(internal_QUEUE_PUSH ,Tcontrol_t,_param->_nb_bank); |
---|
| 169 | ALLOC1(internal_QUEUE_NUM_EXECUTE_LOOP ,uint32_t ,_param->_nb_bank); |
---|
| 170 | ALLOC1(internal_QUEUE_NUM_INST_EXECUTE ,uint32_t ,_param->_nb_bank); |
---|
| 171 | ALLOC1(internal_QUEUE_NUM_INST_COMMIT ,uint32_t ,_param->_nb_bank); |
---|
| 172 | ALLOC1(internal_QUEUE_INFO ,info_t ,_param->_nb_bank); |
---|
| 173 | ALLOC1(internal_SPR_VAL ,Tcontrol_t,_param->_nb_inst_reexecute); |
---|
| 174 | ALLOC1(internal_REEXECUTE_ROB_ACK ,Tcontrol_t,_param->_nb_inst_reexecute); |
---|
| 175 | ALLOC1(internal_REEXECUTE_VAL ,Tcontrol_t,_param->_nb_inst_reexecute); |
---|
[88] | 176 | #ifdef STATISTICS |
---|
[112] | 177 | ALLOC1(internal_COMMIT_VAL ,Tcontrol_t,_param->_nb_inst_commit); |
---|
[88] | 178 | #endif |
---|
| 179 | } |
---|
| 180 | |
---|
| 181 | // ~~~~~[ Component ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
| 182 | _priority_execute_loop = new generic::priority::Priority (_name+"_priority_execute_loop", |
---|
| 183 | _param->_priority_execute_loop, |
---|
| 184 | _param->_load_balancing , |
---|
| 185 | _param->_nb_execute_loop, |
---|
| 186 | _param->_nb_inst_execute, |
---|
| 187 | _param->_nb_execute_loop_select); |
---|
| 188 | |
---|
| 189 | _priority_queue_in = new generic::priority::Priority (_name+"_priority_queue_in", |
---|
| 190 | _param->_priority_queue_in, |
---|
| 191 | _param->_nb_bank); |
---|
| 192 | |
---|
| 193 | #ifdef POSITION |
---|
| 194 | if (usage_is_set(_usage,USE_POSITION)) |
---|
| 195 | _component->generate_file(); |
---|
| 196 | #endif |
---|
| 197 | |
---|
| 198 | log_end(Reexecute_unit,FUNCTION); |
---|
| 199 | }; |
---|
| 200 | |
---|
| 201 | }; // end namespace reexecute_unit |
---|
| 202 | }; // end namespace ooo_engine |
---|
| 203 | }; // end namespace multi_ooo_engine |
---|
| 204 | }; // end namespace core |
---|
| 205 | |
---|
| 206 | }; // end namespace behavioural |
---|
| 207 | }; // end namespace morpheo |
---|