[78] | 1 | /* |
---|
| 2 | * $Id: Rename_select_allocation.cpp 137 2010-02-16 12:35:48Z rosiere $ |
---|
| 3 | * |
---|
| 4 | * [ Description ] |
---|
| 5 | * |
---|
| 6 | */ |
---|
| 7 | |
---|
| 8 | #include "Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Rename_unit/Rename_select/include/Rename_select.h" |
---|
| 9 | #include "Behavioural/include/Allocation.h" |
---|
| 10 | |
---|
| 11 | namespace morpheo { |
---|
| 12 | namespace behavioural { |
---|
| 13 | namespace core { |
---|
| 14 | namespace multi_ooo_engine { |
---|
| 15 | namespace ooo_engine { |
---|
| 16 | namespace rename_unit { |
---|
| 17 | namespace rename_select { |
---|
| 18 | |
---|
| 19 | |
---|
| 20 | |
---|
| 21 | #undef FUNCTION |
---|
| 22 | #define FUNCTION "Rename_select::allocation" |
---|
| 23 | void Rename_select::allocation ( |
---|
| 24 | #ifdef STATISTICS |
---|
| 25 | morpheo::behavioural::Parameters_Statistics * param_statistics |
---|
| 26 | #else |
---|
| 27 | void |
---|
| 28 | #endif |
---|
| 29 | ) |
---|
| 30 | { |
---|
| 31 | log_printf(FUNC,Rename_select,FUNCTION,"Begin"); |
---|
| 32 | |
---|
| 33 | _component = new Component (_usage); |
---|
| 34 | |
---|
| 35 | Entity * entity = _component->set_entity (_name |
---|
| 36 | ,"Rename_select" |
---|
| 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 : "rename_in" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
| 59 | { |
---|
[112] | 60 | ALLOC2_INTERFACE_BEGIN("rename_in", IN, EAST, _("output of decod's stage"), _param->_nb_front_end, _param->_nb_inst_decod[it1]); |
---|
[78] | 61 | |
---|
[88] | 62 | _ALLOC2_VALACK_IN ( in_RENAME_IN_VAL ,VAL, _param->_nb_front_end, _param->_nb_inst_decod[it1]); |
---|
| 63 | _ALLOC2_VALACK_OUT(out_RENAME_IN_ACK ,ACK, _param->_nb_front_end, _param->_nb_inst_decod[it1]); |
---|
| 64 | _ALLOC2_SIGNAL_IN ( in_RENAME_IN_FRONT_END_ID ,"front_end_id" ,Tcontext_t ,_param->_size_front_end_id , _param->_nb_front_end, _param->_nb_inst_decod[it1]); |
---|
| 65 | _ALLOC2_SIGNAL_IN ( in_RENAME_IN_CONTEXT_ID ,"context_id" ,Tcontext_t ,_param->_size_context_id , _param->_nb_front_end, _param->_nb_inst_decod[it1]); |
---|
| 66 | _ALLOC2_SIGNAL_IN ( in_RENAME_IN_DEPTH ,"depth" ,Tdepth_t ,_param->_size_depth , _param->_nb_front_end, _param->_nb_inst_decod[it1]); |
---|
[137] | 67 | #ifdef STATISTICS |
---|
| 68 | _ALLOC2_SIGNAL_IN ( in_RENAME_IN_INSTRUCTION ,"instruction" ,uint32_t ,32 , _param->_nb_front_end, _param->_nb_inst_decod[it1]); |
---|
| 69 | #endif |
---|
[88] | 70 | _ALLOC2_SIGNAL_IN ( in_RENAME_IN_TYPE ,"type" ,Ttype_t ,_param->_size_type , _param->_nb_front_end, _param->_nb_inst_decod[it1]); |
---|
| 71 | _ALLOC2_SIGNAL_IN ( in_RENAME_IN_OPERATION ,"operation" ,Toperation_t ,_param->_size_operation , _param->_nb_front_end, _param->_nb_inst_decod[it1]); |
---|
| 72 | _ALLOC2_SIGNAL_IN ( in_RENAME_IN_NO_EXECUTE ,"no_execute" ,Tcontrol_t ,1 , _param->_nb_front_end, _param->_nb_inst_decod[it1]); |
---|
[123] | 73 | // _ALLOC2_SIGNAL_IN ( in_RENAME_IN_HAVE_EVENT ,"have_event" ,Tcontrol_t ,1 , _param->_nb_front_end, _param->_nb_inst_decod[it1]); |
---|
| 74 | _ALLOC2_SIGNAL_IN ( in_RENAME_IN_LAST_EVENT ,"last_event" ,Tcontrol_t ,1 , _param->_nb_front_end, _param->_nb_inst_decod[it1]); |
---|
[88] | 75 | _ALLOC2_SIGNAL_IN ( in_RENAME_IN_IS_DELAY_SLOT ,"is_delay_slot",Tcontrol_t ,1 , _param->_nb_front_end, _param->_nb_inst_decod[it1]); |
---|
[108] | 76 | #ifdef DEBUG |
---|
| 77 | _ALLOC2_SIGNAL_IN ( in_RENAME_IN_ADDRESS ,"address" ,Taddress_t ,_param->_size_instruction_address , _param->_nb_front_end, _param->_nb_inst_decod[it1]); |
---|
| 78 | #endif |
---|
[105] | 79 | _ALLOC2_SIGNAL_IN ( in_RENAME_IN_ADDRESS_NEXT ,"address_next" ,Taddress_t ,_param->_size_instruction_address , _param->_nb_front_end, _param->_nb_inst_decod[it1]); |
---|
[88] | 80 | _ALLOC2_SIGNAL_IN ( in_RENAME_IN_HAS_IMMEDIAT ,"has_immediat" ,Tcontrol_t ,1 , _param->_nb_front_end, _param->_nb_inst_decod[it1]); |
---|
| 81 | _ALLOC2_SIGNAL_IN ( in_RENAME_IN_IMMEDIAT ,"immediat" ,Tgeneral_data_t ,_param->_size_general_data , _param->_nb_front_end, _param->_nb_inst_decod[it1]); |
---|
| 82 | _ALLOC2_SIGNAL_IN ( in_RENAME_IN_READ_RA ,"read_ra" ,Tcontrol_t ,1 , _param->_nb_front_end, _param->_nb_inst_decod[it1]); |
---|
| 83 | _ALLOC2_SIGNAL_IN ( in_RENAME_IN_NUM_REG_RA ,"num_reg_ra" ,Tgeneral_address_t,_param->_size_general_register_logic, _param->_nb_front_end, _param->_nb_inst_decod[it1]); |
---|
| 84 | _ALLOC2_SIGNAL_IN ( in_RENAME_IN_READ_RB ,"read_rb" ,Tcontrol_t ,1 , _param->_nb_front_end, _param->_nb_inst_decod[it1]); |
---|
| 85 | _ALLOC2_SIGNAL_IN ( in_RENAME_IN_NUM_REG_RB ,"num_reg_rb" ,Tgeneral_address_t,_param->_size_general_register_logic, _param->_nb_front_end, _param->_nb_inst_decod[it1]); |
---|
| 86 | _ALLOC2_SIGNAL_IN ( in_RENAME_IN_READ_RC ,"read_rc" ,Tcontrol_t ,1 , _param->_nb_front_end, _param->_nb_inst_decod[it1]); |
---|
| 87 | _ALLOC2_SIGNAL_IN ( in_RENAME_IN_NUM_REG_RC ,"num_reg_rc" ,Tspecial_address_t,_param->_size_special_register_logic, _param->_nb_front_end, _param->_nb_inst_decod[it1]); |
---|
| 88 | _ALLOC2_SIGNAL_IN ( in_RENAME_IN_WRITE_RD ,"write_rd" ,Tcontrol_t ,1 , _param->_nb_front_end, _param->_nb_inst_decod[it1]); |
---|
| 89 | _ALLOC2_SIGNAL_IN ( in_RENAME_IN_NUM_REG_RD ,"num_reg_rd" ,Tgeneral_address_t,_param->_size_general_register_logic, _param->_nb_front_end, _param->_nb_inst_decod[it1]); |
---|
| 90 | _ALLOC2_SIGNAL_IN ( in_RENAME_IN_WRITE_RE ,"write_re" ,Tcontrol_t ,1 , _param->_nb_front_end, _param->_nb_inst_decod[it1]); |
---|
| 91 | _ALLOC2_SIGNAL_IN ( in_RENAME_IN_NUM_REG_RE ,"num_reg_re" ,Tspecial_address_t,_param->_size_special_register_logic, _param->_nb_front_end, _param->_nb_inst_decod[it1]); |
---|
[97] | 92 | _ALLOC2_SIGNAL_IN ( in_RENAME_IN_EXCEPTION_USE ,"exception_use",Texception_t ,_param->_size_exception_use , _param->_nb_front_end, _param->_nb_inst_decod[it1]); |
---|
[88] | 93 | _ALLOC2_SIGNAL_IN ( in_RENAME_IN_EXCEPTION ,"exception" ,Texception_t ,_param->_size_exception , _param->_nb_front_end, _param->_nb_inst_decod[it1]); |
---|
[112] | 94 | |
---|
| 95 | ALLOC2_INTERFACE_END(_param->_nb_front_end, _param->_nb_inst_decod[it1]); |
---|
[78] | 96 | } |
---|
| 97 | |
---|
| 98 | // ~~~~~[ Interface : "rename_out" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
| 99 | { |
---|
[112] | 100 | ALLOC1_INTERFACE_BEGIN("rename_out", IN, EAST, _("output of decod's stage"), _param->_nb_inst_rename); |
---|
[78] | 101 | |
---|
| 102 | ALLOC1_VALACK_OUT(out_RENAME_OUT_VAL ,VAL); |
---|
| 103 | ALLOC1_VALACK_IN ( in_RENAME_OUT_ACK ,ACK); |
---|
| 104 | ALLOC1_SIGNAL_OUT(out_RENAME_OUT_FRONT_END_ID ,"front_end_id" ,Tcontext_t ,_param->_size_front_end_id ); |
---|
| 105 | ALLOC1_SIGNAL_OUT(out_RENAME_OUT_CONTEXT_ID ,"context_id" ,Tcontext_t ,_param->_size_context_id ); |
---|
| 106 | ALLOC1_SIGNAL_OUT(out_RENAME_OUT_DEPTH ,"depth" ,Tdepth_t ,_param->_size_depth ); |
---|
[137] | 107 | #ifdef STATISTICS |
---|
| 108 | ALLOC1_SIGNAL_OUT(out_RENAME_OUT_INSTRUCTION ,"instruction" ,uint32_t ,32); |
---|
| 109 | #endif |
---|
[78] | 110 | ALLOC1_SIGNAL_OUT(out_RENAME_OUT_TYPE ,"type" ,Ttype_t ,_param->_size_type ); |
---|
| 111 | ALLOC1_SIGNAL_OUT(out_RENAME_OUT_OPERATION ,"operation" ,Toperation_t ,_param->_size_operation ); |
---|
[88] | 112 | ALLOC1_SIGNAL_OUT(out_RENAME_OUT_NO_EXECUTE ,"no_execute" ,Tcontrol_t ,1 ); |
---|
[123] | 113 | ALLOC1_SIGNAL_OUT(out_RENAME_OUT_LAST_EVENT ,"last_event" ,Tcontrol_t ,1 ); |
---|
[88] | 114 | ALLOC1_SIGNAL_OUT(out_RENAME_OUT_IS_DELAY_SLOT ,"is_delay_slot",Tcontrol_t ,1 ); |
---|
[108] | 115 | #ifdef DEBUG |
---|
| 116 | ALLOC1_SIGNAL_OUT(out_RENAME_OUT_ADDRESS ,"address" ,Taddress_t ,_param->_size_instruction_address ); |
---|
| 117 | #endif |
---|
[105] | 118 | ALLOC1_SIGNAL_OUT(out_RENAME_OUT_ADDRESS_NEXT ,"address_next" ,Taddress_t ,_param->_size_instruction_address ); |
---|
[78] | 119 | ALLOC1_SIGNAL_OUT(out_RENAME_OUT_HAS_IMMEDIAT ,"has_immediat" ,Tcontrol_t ,1 ); |
---|
| 120 | ALLOC1_SIGNAL_OUT(out_RENAME_OUT_IMMEDIAT ,"immediat" ,Tgeneral_data_t ,_param->_size_general_data ); |
---|
| 121 | ALLOC1_SIGNAL_OUT(out_RENAME_OUT_READ_RA ,"read_ra" ,Tcontrol_t ,1 ); |
---|
| 122 | ALLOC1_SIGNAL_OUT(out_RENAME_OUT_NUM_REG_RA ,"num_reg_ra" ,Tgeneral_address_t,_param->_size_general_register_logic); |
---|
| 123 | ALLOC1_SIGNAL_OUT(out_RENAME_OUT_READ_RB ,"read_rb" ,Tcontrol_t ,1 ); |
---|
| 124 | ALLOC1_SIGNAL_OUT(out_RENAME_OUT_NUM_REG_RB ,"num_reg_rb" ,Tgeneral_address_t,_param->_size_general_register_logic); |
---|
| 125 | ALLOC1_SIGNAL_OUT(out_RENAME_OUT_READ_RC ,"read_rc" ,Tcontrol_t ,1 ); |
---|
| 126 | ALLOC1_SIGNAL_OUT(out_RENAME_OUT_NUM_REG_RC ,"num_reg_rc" ,Tspecial_address_t,_param->_size_special_register_logic); |
---|
| 127 | ALLOC1_SIGNAL_OUT(out_RENAME_OUT_WRITE_RD ,"write_rd" ,Tcontrol_t ,1 ); |
---|
| 128 | ALLOC1_SIGNAL_OUT(out_RENAME_OUT_NUM_REG_RD ,"num_reg_rd" ,Tgeneral_address_t,_param->_size_general_register_logic); |
---|
| 129 | ALLOC1_SIGNAL_OUT(out_RENAME_OUT_WRITE_RE ,"write_re" ,Tcontrol_t ,1 ); |
---|
| 130 | ALLOC1_SIGNAL_OUT(out_RENAME_OUT_NUM_REG_RE ,"num_reg_re" ,Tspecial_address_t,_param->_size_special_register_logic); |
---|
[97] | 131 | ALLOC1_SIGNAL_OUT(out_RENAME_OUT_EXCEPTION_USE ,"exception_use",Texception_t ,_param->_size_exception_use ); |
---|
[88] | 132 | ALLOC1_SIGNAL_OUT(out_RENAME_OUT_EXCEPTION ,"exception" ,Texception_t ,_param->_size_exception ); |
---|
[112] | 133 | |
---|
| 134 | ALLOC1_INTERFACE_END(_param->_nb_inst_rename); |
---|
[78] | 135 | } |
---|
| 136 | |
---|
[108] | 137 | // ~~~~~[ Interface : "retire_event" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
| 138 | { |
---|
[112] | 139 | ALLOC2_INTERFACE_BEGIN("retire_event", IN,NORTH, _("Retire event"), _param->_nb_front_end, _param->_nb_context[it1]); |
---|
[108] | 140 | |
---|
[123] | 141 | // _ALLOC2_SIGNAL_IN ( in_RETIRE_EVENT_FLUSH ,"flush" ,Tcontrol_t ,1 , _param->_nb_front_end, _param->_nb_context[it1]); |
---|
[122] | 142 | _ALLOC2_SIGNAL_IN ( in_RETIRE_EVENT_STOP ,"stop" ,Tcontrol_t ,1 , _param->_nb_front_end, _param->_nb_context[it1]); |
---|
[112] | 143 | |
---|
| 144 | ALLOC2_INTERFACE_END(_param->_nb_front_end, _param->_nb_context[it1]); |
---|
[108] | 145 | } |
---|
| 146 | |
---|
[78] | 147 | // ~~~~~[ Component ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
[88] | 148 | _priority = new generic::priority::Priority (_name+"_priority" , |
---|
| 149 | _param->_priority , |
---|
| 150 | _param->_load_balancing, |
---|
| 151 | _param->_nb_front_end , |
---|
| 152 | _param->_nb_inst_decod , |
---|
| 153 | _param->_nb_front_end_select); |
---|
[78] | 154 | |
---|
| 155 | #ifdef POSITION |
---|
[88] | 156 | if (usage_is_set(_usage,USE_POSITION)) |
---|
| 157 | _component->generate_file(); |
---|
[78] | 158 | #endif |
---|
| 159 | |
---|
| 160 | log_printf(FUNC,Rename_select,FUNCTION,"End"); |
---|
| 161 | }; |
---|
| 162 | |
---|
| 163 | }; // end namespace rename_select |
---|
| 164 | }; // end namespace rename_unit |
---|
| 165 | }; // end namespace ooo_engine |
---|
| 166 | }; // end namespace multi_ooo_engine |
---|
| 167 | }; // end namespace core |
---|
| 168 | |
---|
| 169 | }; // end namespace behavioural |
---|
| 170 | }; // end namespace morpheo |
---|