Changeset 122 for trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Rename_unit/Register_translation_unit
- Timestamp:
- Jun 3, 2009, 10:15:51 AM (15 years ago)
- Location:
- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Rename_unit/Register_translation_unit
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Rename_unit/Register_translation_unit/Register_Address_Translation_unit/include/Register_Address_Translation_unit.h
r112 r122 100 100 public : SC_IN (Tgeneral_address_t) ** in_RETIRE_NUM_REG_RD_LOG ;//[nb_inst_retire] 101 101 public : SC_IN (Tspecial_address_t) ** in_RETIRE_NUM_REG_RE_LOG ;//[nb_inst_retire] 102 public : SC_IN (Tgeneral_address_t) ** in_RETIRE_NUM_REG_RD_PHY_ OLD;//[nb_inst_retire]103 public : SC_IN (Tspecial_address_t) ** in_RETIRE_NUM_REG_RE_PHY_ OLD;//[nb_inst_retire]102 public : SC_IN (Tgeneral_address_t) ** in_RETIRE_NUM_REG_RD_PHY_NEW;//[nb_inst_retire] 103 public : SC_IN (Tspecial_address_t) ** in_RETIRE_NUM_REG_RE_PHY_NEW;//[nb_inst_retire] 104 104 public : SC_OUT(Tcontrol_t ) ** out_RETIRE_RESTORE_RD_PHY_OLD;//[nb_inst_retire] 105 105 public : SC_OUT(Tcontrol_t ) ** out_RETIRE_RESTORE_RE_PHY_OLD;//[nb_inst_retire] … … 114 114 115 115 // ~~~~~[ Register ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 116 private : Tgeneral_address_t *** rat_gpr; //[nb_front_end][nb_context][nb_general_register_logic] 116 private : Tgeneral_address_t *** rat_gpr_not_speculative; //[nb_front_end][nb_context][nb_general_register_logic] 117 private : Tgeneral_address_t *** rat_gpr_speculative; //[nb_front_end][nb_context][nb_general_register_logic] 118 private : bool *** rat_gpr_speculative_valid; //[nb_front_end][nb_context][nb_general_register_logic] 117 119 private : bool *** rat_gpr_update_table; //[nb_front_end][nb_context][nb_general_register_logic] 118 private : Tspecial_address_t *** rat_spr; //[nb_front_end][nb_context][nb_special_register_logic] 120 121 private : Tspecial_address_t *** rat_spr_not_speculative; //[nb_front_end][nb_context][nb_special_register_logic] 122 private : Tspecial_address_t *** rat_spr_speculative; //[nb_front_end][nb_context][nb_special_register_logic] 123 private : bool *** rat_spr_speculative_valid; //[nb_front_end][nb_context][nb_special_register_logic] 119 124 private : bool *** rat_spr_update_table; //[nb_front_end][nb_context][nb_special_register_logic] 120 125 … … 123 128 private : Tcontrol_t * internal_INSERT_ACK; //[nb_inst_insert] 124 129 private : Tcontrol_t * internal_RETIRE_ACK; //[nb_inst_retire] 125 public : Tcontrol_t ** internal_RETIRE_EVENT_ACK ;//[nb_front_end][nb_context] 126 127 private : bool *** internal_rat_gpr_update_table; //[nb_front_end][nb_context][nb_general_register_logic] 128 private : bool *** internal_rat_spr_update_table; //[nb_front_end][nb_context][nb_special_register_logic] 129 public : Tcontrol_t * internal_RETIRE_RESTORE_RD_PHY_OLD;//[nb_inst_retire] 130 public : Tcontrol_t * internal_RETIRE_RESTORE_RE_PHY_OLD;//[nb_inst_retire] 130 private : Tcontrol_t ** internal_RETIRE_EVENT_ACK ;//[nb_front_end][nb_context] 131 132 private : bool *** internal_rat_gpr_update_table;//[nb_front_end][nb_context][nb_general_register_logic] 133 private : bool *** internal_rat_spr_update_table;//[nb_front_end][nb_context][nb_special_register_logic] 134 135 private : Tcontrol_t * internal_RETIRE_RESTORE ;//[nb_inst_retire] 136 private : Tcontrol_t * internal_RETIRE_RESTORE_RD_PHY_OLD;//[nb_inst_retire] 137 private : Tcontrol_t * internal_RETIRE_RESTORE_RE_PHY_OLD;//[nb_inst_retire] 131 138 132 139 #endif -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Rename_unit/Register_translation_unit/Register_Address_Translation_unit/src/Register_Address_Translation_unit.cpp
r106 r122 129 129 << (*(in_RENAME_NUM_REG_RE_LOG [i])); 130 130 } 131 for (uint32_t i=0; i<_param->_nb_front_end; ++i) 132 for (uint32_t j=0; j<_param->_nb_context[i]; ++j) 133 sensitive << (*(in_RETIRE_EVENT_VAL [i][j])) 134 << (*(in_RETIRE_EVENT_STATE [i][j])); 131 135 132 136 # ifdef SYSTEMCASS_SPECIFIC -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Rename_unit/Register_translation_unit/Register_Address_Translation_unit/src/Register_Address_Translation_unit_allocation.cpp
r112 r122 109 109 ALLOC1_SIGNAL_IN ( in_RETIRE_NUM_REG_RD_LOG ,"num_reg_rd_log" ,Tgeneral_address_t,_param->_size_general_register_logic); 110 110 ALLOC1_SIGNAL_IN ( in_RETIRE_NUM_REG_RE_LOG ,"num_reg_re_log" ,Tspecial_address_t,_param->_size_special_register_logic); 111 ALLOC1_SIGNAL_IN ( in_RETIRE_NUM_REG_RD_PHY_ OLD,"num_reg_rd_phy_old",Tgeneral_address_t,_param->_size_general_register);112 ALLOC1_SIGNAL_IN ( in_RETIRE_NUM_REG_RE_PHY_ OLD,"num_reg_re_phy_old",Tspecial_address_t,_param->_size_special_register);111 ALLOC1_SIGNAL_IN ( in_RETIRE_NUM_REG_RD_PHY_NEW,"num_reg_rd_phy_new",Tgeneral_address_t,_param->_size_general_register); 112 ALLOC1_SIGNAL_IN ( in_RETIRE_NUM_REG_RE_PHY_NEW,"num_reg_re_phy_new",Tspecial_address_t,_param->_size_special_register); 113 113 ALLOC1_SIGNAL_OUT(out_RETIRE_RESTORE_RD_PHY_OLD,"restore_rd_phy_old",Tcontrol_t ,1); 114 114 ALLOC1_SIGNAL_OUT(out_RETIRE_RESTORE_RE_PHY_OLD,"restore_re_phy_old",Tcontrol_t ,1); … … 136 136 ALLOC2(internal_RETIRE_EVENT_ACK ,Tcontrol_t,_param->_nb_front_end,_param->_nb_context[it1]); 137 137 138 ALLOC3(rat_gpr ,Tgeneral_address_t,_param->_nb_front_end,_param->_nb_context[it1],_param->_nb_general_register_logic); 139 ALLOC3(rat_spr ,Tspecial_address_t,_param->_nb_front_end,_param->_nb_context[it1],_param->_nb_special_register_logic); 140 ALLOC3(rat_gpr_update_table ,bool ,_param->_nb_front_end,_param->_nb_context[it1],_param->_nb_general_register_logic); 141 ALLOC3(rat_spr_update_table ,bool ,_param->_nb_front_end,_param->_nb_context[it1],_param->_nb_special_register_logic); 142 ALLOC3(internal_rat_gpr_update_table,bool ,_param->_nb_front_end,_param->_nb_context[it1],_param->_nb_general_register_logic); 143 ALLOC3(internal_rat_spr_update_table,bool ,_param->_nb_front_end,_param->_nb_context[it1],_param->_nb_special_register_logic); 138 ALLOC3(rat_gpr_not_speculative ,Tgeneral_address_t,_param->_nb_front_end,_param->_nb_context[it1],_param->_nb_general_register_logic); 139 ALLOC3(rat_gpr_speculative ,Tgeneral_address_t,_param->_nb_front_end,_param->_nb_context[it1],_param->_nb_general_register_logic); 140 ALLOC3(rat_gpr_speculative_valid,bool ,_param->_nb_front_end,_param->_nb_context[it1],_param->_nb_general_register_logic); 141 ALLOC3(rat_gpr_update_table ,bool ,_param->_nb_front_end,_param->_nb_context[it1],_param->_nb_general_register_logic); 142 143 ALLOC3(rat_spr_not_speculative ,Tspecial_address_t,_param->_nb_front_end,_param->_nb_context[it1],_param->_nb_special_register_logic); 144 ALLOC3(rat_spr_speculative ,Tspecial_address_t,_param->_nb_front_end,_param->_nb_context[it1],_param->_nb_special_register_logic); 145 ALLOC3(rat_spr_speculative_valid,bool ,_param->_nb_front_end,_param->_nb_context[it1],_param->_nb_special_register_logic); 146 ALLOC3(rat_spr_update_table ,bool ,_param->_nb_front_end,_param->_nb_context[it1],_param->_nb_special_register_logic); 144 147 148 ALLOC3(internal_rat_gpr_update_table,bool, _param->_nb_front_end,_param->_nb_context[it1],_param->_nb_general_register_logic); 149 ALLOC3(internal_rat_spr_update_table,bool, _param->_nb_front_end,_param->_nb_context[it1],_param->_nb_special_register_logic); 150 151 ALLOC1(internal_RETIRE_RESTORE ,Tcontrol_t,_param->_nb_inst_retire); 145 152 ALLOC1(internal_RETIRE_RESTORE_RD_PHY_OLD,Tcontrol_t,_param->_nb_inst_retire); 146 153 ALLOC1(internal_RETIRE_RESTORE_RE_PHY_OLD,Tcontrol_t,_param->_nb_inst_retire); -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Rename_unit/Register_translation_unit/Register_Address_Translation_unit/src/Register_Address_Translation_unit_deallocation.cpp
r112 r122 64 64 DELETE1_SIGNAL( in_RETIRE_NUM_REG_RD_LOG ,_param->_nb_inst_retire,_param->_size_general_register_logic); 65 65 DELETE1_SIGNAL( in_RETIRE_NUM_REG_RE_LOG ,_param->_nb_inst_retire,_param->_size_special_register_logic); 66 DELETE1_SIGNAL( in_RETIRE_NUM_REG_RD_PHY_ OLD,_param->_nb_inst_retire,_param->_size_general_register);67 DELETE1_SIGNAL( in_RETIRE_NUM_REG_RE_PHY_ OLD,_param->_nb_inst_retire,_param->_size_special_register);66 DELETE1_SIGNAL( in_RETIRE_NUM_REG_RD_PHY_NEW,_param->_nb_inst_retire,_param->_size_general_register); 67 DELETE1_SIGNAL( in_RETIRE_NUM_REG_RE_PHY_NEW,_param->_nb_inst_retire,_param->_size_special_register); 68 68 DELETE1_SIGNAL(out_RETIRE_RESTORE_RD_PHY_OLD,_param->_nb_inst_retire,1); 69 69 DELETE1_SIGNAL(out_RETIRE_RESTORE_RE_PHY_OLD,_param->_nb_inst_retire,1); … … 79 79 DELETE2(internal_RETIRE_EVENT_ACK ,_param->_nb_front_end,_param->_nb_context[it1]); 80 80 81 DELETE3(rat_gpr ,_param->_nb_front_end,_param->_nb_context[it1],_param->_nb_general_register_logic); 82 DELETE3(rat_spr ,_param->_nb_front_end,_param->_nb_context[it1],_param->_nb_special_register_logic); 81 DELETE3(rat_gpr_not_speculative ,_param->_nb_front_end,_param->_nb_context[it1],_param->_nb_general_register_logic); 82 DELETE3(rat_gpr_speculative ,_param->_nb_front_end,_param->_nb_context[it1],_param->_nb_general_register_logic); 83 DELETE3(rat_gpr_speculative_valid ,_param->_nb_front_end,_param->_nb_context[it1],_param->_nb_general_register_logic); 83 84 DELETE3(rat_gpr_update_table ,_param->_nb_front_end,_param->_nb_context[it1],_param->_nb_general_register_logic); 85 86 DELETE3(rat_spr_not_speculative ,_param->_nb_front_end,_param->_nb_context[it1],_param->_nb_special_register_logic); 87 DELETE3(rat_spr_speculative ,_param->_nb_front_end,_param->_nb_context[it1],_param->_nb_special_register_logic); 88 DELETE3(rat_spr_speculative_valid ,_param->_nb_front_end,_param->_nb_context[it1],_param->_nb_special_register_logic); 84 89 DELETE3(rat_spr_update_table ,_param->_nb_front_end,_param->_nb_context[it1],_param->_nb_special_register_logic); 90 85 91 DELETE3(internal_rat_gpr_update_table,_param->_nb_front_end,_param->_nb_context[it1],_param->_nb_general_register_logic); 86 92 DELETE3(internal_rat_spr_update_table,_param->_nb_front_end,_param->_nb_context[it1],_param->_nb_special_register_logic); 87 93 94 DELETE1(internal_RETIRE_RESTORE ,_param->_nb_inst_retire); 88 95 DELETE1(internal_RETIRE_RESTORE_RD_PHY_OLD,_param->_nb_inst_retire); 89 96 DELETE1(internal_RETIRE_RESTORE_RE_PHY_OLD,_param->_nb_inst_retire); 90 97 } 91 98 92 // ~~~~~[ Component ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~99 // ~~~~~[ Component ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 93 100 delete _component; 94 101 -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Rename_unit/Register_translation_unit/Register_Address_Translation_unit/src/Register_Address_Translation_unit_genMealy_rename.cpp
r100 r122 26 26 log_function(Register_Address_Translation_unit,FUNCTION,_name.c_str()); 27 27 28 if (PORT_READ(in_NRESET) != 0) 28 29 for (uint32_t i=0; i<_param->_nb_inst_insert; i++) 29 30 if (PORT_READ(in_RENAME_VAL [i])) // not in sensitive list : it's to have valide value to array access … … 33 34 Tcontext_t front_end_id = (_param->_have_port_front_end_id)?PORT_READ(in_RENAME_FRONT_END_ID [i]):0; 34 35 Tcontext_t context_id = (_param->_have_port_context_id )?PORT_READ(in_RENAME_CONTEXT_ID [i]):0; 36 bool have_event = (PORT_READ(in_RETIRE_EVENT_VAL [front_end_id][context_id]) and // always ack 37 (PORT_READ(in_RETIRE_EVENT_STATE [front_end_id][context_id]) == EVENT_STATE_EVENT)); 38 35 39 36 40 log_printf(TRACE,Register_Address_Translation_unit,FUNCTION," * front_end_id : %d",front_end_id); 37 41 log_printf(TRACE,Register_Address_Translation_unit,FUNCTION," * context_id : %d",context_id); 42 log_printf(TRACE,Register_Address_Translation_unit,FUNCTION," * have_event : %d",have_event); 38 43 39 44 Tgeneral_address_t num_reg_ra_log = PORT_READ(in_RENAME_NUM_REG_RA_LOG [i]); //%_param->_nb_general_register; … … 43 48 Tspecial_address_t num_reg_re_log = PORT_READ(in_RENAME_NUM_REG_RE_LOG [i]); //%_param->_nb_special_register; 44 49 45 Tgeneral_address_t num_reg_ra_phy = rat_gpr[front_end_id][context_id][num_reg_ra_log]; 46 Tgeneral_address_t num_reg_rb_phy = rat_gpr[front_end_id][context_id][num_reg_rb_log]; 47 Tspecial_address_t num_reg_rc_phy = rat_spr[front_end_id][context_id][num_reg_rc_log]; 48 Tgeneral_address_t num_reg_rd_phy_old= rat_gpr[front_end_id][context_id][num_reg_rd_log]; 49 Tspecial_address_t num_reg_re_phy_old= rat_spr[front_end_id][context_id][num_reg_re_log]; 50 // if rat_speculative is valid, 51 // then read rat_speculative have the most valid alias register 52 // else, they have an previous event, the rat_not_speculative have the valid register 53 54 Tgeneral_address_t num_reg_ra_phy = (rat_gpr_speculative_valid[front_end_id][context_id][num_reg_ra_log] and not have_event)?rat_gpr_speculative[front_end_id][context_id][num_reg_ra_log]:rat_gpr_not_speculative[front_end_id][context_id][num_reg_ra_log]; 55 Tgeneral_address_t num_reg_rb_phy = (rat_gpr_speculative_valid[front_end_id][context_id][num_reg_rb_log] and not have_event)?rat_gpr_speculative[front_end_id][context_id][num_reg_rb_log]:rat_gpr_not_speculative[front_end_id][context_id][num_reg_rb_log]; 56 Tspecial_address_t num_reg_rc_phy = (rat_spr_speculative_valid[front_end_id][context_id][num_reg_rc_log] and not have_event)?rat_spr_speculative[front_end_id][context_id][num_reg_rc_log]:rat_spr_not_speculative[front_end_id][context_id][num_reg_rc_log]; 57 Tgeneral_address_t num_reg_rd_phy_old= (rat_gpr_speculative_valid[front_end_id][context_id][num_reg_rd_log] and not have_event)?rat_gpr_speculative[front_end_id][context_id][num_reg_rd_log]:rat_gpr_not_speculative[front_end_id][context_id][num_reg_rd_log]; 58 Tspecial_address_t num_reg_re_phy_old= (rat_spr_speculative_valid[front_end_id][context_id][num_reg_re_log] and not have_event)?rat_spr_speculative[front_end_id][context_id][num_reg_re_log]:rat_spr_not_speculative[front_end_id][context_id][num_reg_re_log]; 50 59 51 60 log_printf(TRACE,Register_Address_Translation_unit,FUNCTION," * num_reg_ra : %d -> %d",num_reg_ra_log,num_reg_ra_phy ); … … 54 63 log_printf(TRACE,Register_Address_Translation_unit,FUNCTION," * num_reg_rd : %d -> %d",num_reg_rd_log,num_reg_rd_phy_old); 55 64 log_printf(TRACE,Register_Address_Translation_unit,FUNCTION," * num_reg_re : %d -> %d",num_reg_re_log,num_reg_re_phy_old); 56 57 65 58 66 PORT_WRITE(out_RENAME_NUM_REG_RA_PHY [i], num_reg_ra_phy ); -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Rename_unit/Register_translation_unit/Register_Address_Translation_unit/src/Register_Address_Translation_unit_genMealy_retire.cpp
r112 r122 26 26 log_function(Register_Address_Translation_unit,FUNCTION,_name.c_str()); 27 27 28 if (PORT_READ(in_NRESET) != 0) 29 { 28 30 // Init internal update table 29 31 for (uint32_t i=0; i<_param->_nb_front_end; i++) 30 32 for (uint32_t j=0; j<_param->_nb_context[i]; j++) 31 33 { 34 log_printf(TRACE,Register_Address_Translation_unit,FUNCTION," * init [%d][%d]",i,j); 35 32 36 // An event occure 33 37 // bool event = (PORT_READ(in_RETIRE_EVENT_STATE [i][j]) != EVENT_STATE_NO_EVENT); … … 35 39 (PORT_READ(in_RETIRE_EVENT_STATE [i][j]) == EVENT_STATE_EVENT)); 36 40 41 log_printf(TRACE,Register_Address_Translation_unit,FUNCTION," * reset_update_table : %d",reset_update_table); 42 37 43 // not event -> update_table == 1 -> always update 38 44 // event -> update_table and not reset 39 45 for (uint32_t k=0; k<_param->_nb_general_register_logic; ++k) 40 46 internal_rat_gpr_update_table [i][j][k] = // not event or 41 ( rat_gpr_update_table [i][j][k] and not reset_update_table);47 (not reset_update_table and rat_gpr_update_table [i][j][k]); 42 48 for (uint32_t k=0; k<_param->_nb_special_register_logic; ++k) 43 49 internal_rat_spr_update_table [i][j][k] = // not event or 44 ( rat_spr_update_table [i][j][k] and not reset_update_table);50 (not reset_update_table and rat_spr_update_table [i][j][k]); 45 51 } 46 47 52 48 53 // RETIRE is in order -> also don't need test if an instruction is valid … … 55 60 Tcontrol_t retire_restore_re_phy_old = false; 56 61 57 Tcontext_t front_end_id = (_param->_have_port_front_end_id)?PORT_READ(in_RETIRE_FRONT_END_ID [i]):0; 58 Tcontext_t context_id = (_param->_have_port_context_id )?PORT_READ(in_RETIRE_CONTEXT_ID [i]):0; 59 Tcontrol_t restore = (PORT_READ(in_RETIRE_EVENT_STATE [front_end_id][context_id]) != EVENT_STATE_NO_EVENT); 62 Tcontext_t front_end_id = (_param->_have_port_front_end_id)?PORT_READ(in_RETIRE_FRONT_END_ID [i]):0; 63 Tcontext_t context_id = (_param->_have_port_context_id )?PORT_READ(in_RETIRE_CONTEXT_ID [i]):0; 64 Tcontrol_t retire_restore = (PORT_READ(in_RETIRE_EVENT_STATE [front_end_id][context_id]) != EVENT_STATE_NO_EVENT); 65 66 log_printf(TRACE,Register_Address_Translation_unit,FUNCTION," * front_end_id : %d",front_end_id); 67 log_printf(TRACE,Register_Address_Translation_unit,FUNCTION," * context_id : %d",context_id ); 68 log_printf(TRACE,Register_Address_Translation_unit,FUNCTION," * restore : %d",retire_restore); 60 69 61 70 // Test if event -> need restore ? 62 if (re store)71 if (retire_restore) 63 72 { 64 log_printf(TRACE,Register_Address_Translation_unit,FUNCTION," * Have event"); 65 log_printf(TRACE,Register_Address_Translation_unit,FUNCTION," * front_end_id : %d",front_end_id); 66 log_printf(TRACE,Register_Address_Translation_unit,FUNCTION," * context_id : %d",context_id ); 73 log_printf(TRACE,Register_Address_Translation_unit,FUNCTION," * Have event"); 67 74 68 75 // Test and update update table … … 87 94 } 88 95 89 log_printf(TRACE,Register_Address_Translation_unit,FUNCTION," * restore_rd_phy_old : %d",retire_restore_rd_phy_old);90 log_printf(TRACE,Register_Address_Translation_unit,FUNCTION," * restore_re_phy_old : %d",retire_restore_re_phy_old);96 log_printf(TRACE,Register_Address_Translation_unit,FUNCTION," * restore_rd_phy_old : %d",retire_restore_rd_phy_old); 97 log_printf(TRACE,Register_Address_Translation_unit,FUNCTION," * restore_re_phy_old : %d",retire_restore_re_phy_old); 91 98 } 92 99 93 internal_RETIRE_RESTORE_RD_PHY_OLD[i] = retire_restore_rd_phy_old; 94 internal_RETIRE_RESTORE_RE_PHY_OLD[i] = retire_restore_re_phy_old; 100 internal_RETIRE_RESTORE [i] = retire_restore; 101 internal_RETIRE_RESTORE_RD_PHY_OLD [i] = retire_restore_rd_phy_old; 102 internal_RETIRE_RESTORE_RE_PHY_OLD [i] = retire_restore_re_phy_old; 95 103 96 PORT_WRITE(out_RETIRE_RESTORE_RD_PHY_OLD[i], internal_RETIRE_RESTORE_RD_PHY_OLD[i]); 97 PORT_WRITE(out_RETIRE_RESTORE_RE_PHY_OLD[i], internal_RETIRE_RESTORE_RE_PHY_OLD[i]); 98 PORT_WRITE(out_RETIRE_RESTORE [i], restore); 104 PORT_WRITE(out_RETIRE_RESTORE [i], internal_RETIRE_RESTORE [i]); 105 PORT_WRITE(out_RETIRE_RESTORE_RD_PHY_OLD[i], internal_RETIRE_RESTORE_RD_PHY_OLD [i]); 106 PORT_WRITE(out_RETIRE_RESTORE_RE_PHY_OLD[i], internal_RETIRE_RESTORE_RE_PHY_OLD [i]); 107 } 99 108 } 100 109 -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Rename_unit/Register_translation_unit/Register_Address_Translation_unit/src/Register_Address_Translation_unit_transition.cpp
r112 r122 34 34 for (uint32_t j=0; j<_param->_nb_context[i]; j++) 35 35 { 36 rat_gpr [i][j][0] = 0; 36 rat_gpr_not_speculative [i][j][0] = 0; 37 rat_gpr_speculative_valid [i][j][0] = false; 37 38 38 39 for (uint32_t k=1; k<_param->_nb_general_register_logic; k++) 39 40 { 40 rat_gpr [i][j][k] = gpr++; 41 // rat_gpr_update_table[i][j][k] = 0; 41 rat_gpr_not_speculative [i][j][k] = gpr++; 42 // rat_gpr_speculative [i][j][k] = gpr++; 43 rat_gpr_speculative_valid [i][j][k] = false; 44 // rat_gpr_update_table [i][j][k] = false; 42 45 } 43 46 for (uint32_t k=0; k<_param->_nb_special_register_logic; k++) 44 47 { 45 rat_spr [i][j][k] = spr++; 46 // rat_spr_update_table[i][j][k] = 0; 48 rat_spr_not_speculative [i][j][k] = spr++; 49 // rat_spr_speculative [i][j][k] = spr++; 50 rat_spr_speculative_valid [i][j][k] = false; 51 // rat_spr_update_table [i][j][k] = false; 47 52 } 48 53 } … … 53 58 54 59 // ===================================================== 60 // ====[ RETIRE_EVENT ]================================= 61 // ===================================================== 62 for (uint32_t i=0; i<_param->_nb_front_end; ++i) 63 for (uint32_t j=0; j<_param->_nb_context[i]; ++j) 64 if (PORT_READ(in_RETIRE_EVENT_VAL [i][j]) and internal_RETIRE_EVENT_ACK [i][j]) 65 // Test if event have just occure 66 if (PORT_READ(in_RETIRE_EVENT_STATE [i][j]) == EVENT_STATE_EVENT) 67 { 68 log_printf(TRACE,Register_Address_Translation_unit,FUNCTION," * Reset Update Table"); 69 70 // Reset update_table and validity table 71 for (uint32_t k=0; k<_param->_nb_general_register_logic; k++) 72 { 73 rat_gpr_update_table [i][j][k] = false; 74 rat_gpr_speculative_valid [i][j][k] = false; 75 } 76 for (uint32_t k=0; k<_param->_nb_special_register_logic; k++) 77 { 78 rat_spr_update_table [i][j][k] = false; 79 rat_spr_speculative_valid [i][j][k] = false; 80 } 81 } 82 83 // ===================================================== 55 84 // ====[ INSERT ]======================================= 56 85 // ===================================================== 57 86 // First : interface insert 87 // this instruction is speculative !!! 58 88 for (uint32_t i=0; i<_param->_nb_inst_insert; i++) 59 89 // Test transaction … … 64 94 Tcontext_t front_end_id = (_param->_have_port_front_end_id)?PORT_READ(in_RENAME_FRONT_END_ID [i]):0; 65 95 Tcontext_t context_id = (_param->_have_port_context_id )?PORT_READ(in_RENAME_CONTEXT_ID [i]):0; 66 67 log_printf(TRACE,Register_Address_Translation_unit,FUNCTION," * front_end : %d",front_end_id); 68 log_printf(TRACE,Register_Address_Translation_unit,FUNCTION," * context : %d",context_id); 96 Tcontrol_t write_rd = PORT_READ(in_INSERT_WRITE_RD [i]); 97 Tcontrol_t write_re = PORT_READ(in_INSERT_WRITE_RE [i]); 98 99 log_printf(TRACE,Register_Address_Translation_unit,FUNCTION," * front_end : %d",front_end_id); 100 log_printf(TRACE,Register_Address_Translation_unit,FUNCTION," * context : %d",context_id); 69 101 70 // Test if write 71 log_printf(TRACE,Register_Address_Translation_unit,FUNCTION," * write_rd : %d",PORT_READ(in_INSERT_WRITE_RD [i])); 72 if (PORT_READ(in_INSERT_WRITE_RD [i]) == 1) 73 { 74 log_printf(TRACE,Register_Address_Translation_unit,FUNCTION," * num_reg_rd_phy : %d",PORT_READ(in_INSERT_NUM_REG_RD_PHY [i])); 75 rat_gpr[front_end_id][context_id][PORT_READ(in_INSERT_NUM_REG_RD_LOG [i])] = PORT_READ(in_INSERT_NUM_REG_RD_PHY [i]); 76 } 77 78 log_printf(TRACE,Register_Address_Translation_unit,FUNCTION," * write_re : %d",PORT_READ(in_INSERT_WRITE_RE [i])); 79 if (PORT_READ(in_INSERT_WRITE_RE [i]) == 1) 80 { 81 log_printf(TRACE,Register_Address_Translation_unit,FUNCTION," * num_reg_re_phy : %d",PORT_READ(in_INSERT_NUM_REG_RE_PHY [i])); 82 rat_spr[front_end_id][context_id][PORT_READ(in_INSERT_NUM_REG_RE_LOG [i])] = PORT_READ(in_INSERT_NUM_REG_RE_PHY [i]); 102 // Test if write and modifie RAT 103 log_printf(TRACE,Register_Address_Translation_unit,FUNCTION," * write_rd : %d",write_rd); 104 if (write_rd == 1) 105 { 106 Tgeneral_address_t num_reg_rd_log = PORT_READ(in_INSERT_NUM_REG_RD_LOG [i]); 107 Tgeneral_address_t num_reg_rd_phy = PORT_READ(in_INSERT_NUM_REG_RD_PHY [i]); 108 109 log_printf(TRACE,Register_Address_Translation_unit,FUNCTION," * num_reg_rd_log : %d",num_reg_rd_log); 110 log_printf(TRACE,Register_Address_Translation_unit,FUNCTION," * num_reg_rd_phy : %d",num_reg_rd_phy); 111 112 rat_gpr_speculative [front_end_id][context_id][num_reg_rd_log] = num_reg_rd_phy; 113 rat_gpr_speculative_valid [front_end_id][context_id][num_reg_rd_log] = true; 114 } 115 116 log_printf(TRACE,Register_Address_Translation_unit,FUNCTION," * write_re : %d",write_re); 117 if (write_re == 1) 118 { 119 Tspecial_address_t num_reg_re_log = PORT_READ(in_INSERT_NUM_REG_RE_LOG [i]); 120 Tspecial_address_t num_reg_re_phy = PORT_READ(in_INSERT_NUM_REG_RE_PHY [i]); 121 122 log_printf(TRACE,Register_Address_Translation_unit,FUNCTION," * num_reg_re_log : %d",num_reg_re_log); 123 log_printf(TRACE,Register_Address_Translation_unit,FUNCTION," * num_reg_re_phy : %d",num_reg_re_phy); 124 125 rat_spr_speculative [front_end_id][context_id][num_reg_re_log] = num_reg_re_phy; 126 rat_spr_speculative_valid [front_end_id][context_id][num_reg_re_log] = true; 83 127 } 84 128 } 85 86 // =====================================================87 // ====[ RETIRE_EVENT ]=================================88 // =====================================================89 for (uint32_t i=0; i<_param->_nb_front_end; ++i)90 for (uint32_t j=0; j<_param->_nb_context[i]; ++j)91 if (PORT_READ(in_RETIRE_EVENT_VAL [i][j]) and internal_RETIRE_EVENT_ACK [i][j])92 // Test if event have just occure93 if (PORT_READ(in_RETIRE_EVENT_STATE [i][j]) == EVENT_STATE_EVENT)94 {95 log_printf(TRACE,Register_Address_Translation_unit,FUNCTION," * Reset Update Table");96 97 // Reset update_table98 for (uint32_t k=0; k<_param->_nb_general_register_logic; k++)99 rat_gpr_update_table [i][j][k] = 0;100 for (uint32_t k=0; k<_param->_nb_special_register_logic; k++)101 rat_spr_update_table [i][j][k] = 0;102 }103 129 104 130 // ===================================================== … … 117 143 // the retire interface became of the Re Order Buffer, also is in program sequence ! 118 144 119 Tcontext_t front_end_id = (_param->_have_port_front_end_id)?PORT_READ(in_RETIRE_FRONT_END_ID [i]):0; 120 Tcontext_t context_id = (_param->_have_port_context_id )?PORT_READ(in_RETIRE_CONTEXT_ID [i]):0; 121 Tevent_state_t event_state = PORT_READ(in_RETIRE_EVENT_STATE [front_end_id][context_id]); 122 123 log_printf(TRACE,Register_Address_Translation_unit,FUNCTION," * front_end_id : %d",front_end_id); 124 log_printf(TRACE,Register_Address_Translation_unit,FUNCTION," * context_id : %d",context_id); 125 log_printf(TRACE,Register_Address_Translation_unit,FUNCTION," * event_state : %d",event_state); 126 127 // if (event_state != EVENT_STATE_NO_EVENT) 128 // { 129 // Test if write and have not a previous update 130 if (PORT_READ(in_RETIRE_WRITE_RD [i]) == 1) 131 { 132 Tgeneral_address_t rd_log = PORT_READ(in_RETIRE_NUM_REG_RD_LOG [i]); 145 Tcontext_t front_end_id = (_param->_have_port_front_end_id)?PORT_READ(in_RETIRE_FRONT_END_ID [i]):0; 146 Tcontext_t context_id = (_param->_have_port_context_id )?PORT_READ(in_RETIRE_CONTEXT_ID [i]):0; 147 Tcontrol_t write_rd = PORT_READ(in_RETIRE_WRITE_RD [i]); 148 Tcontrol_t write_re = PORT_READ(in_RETIRE_WRITE_RE [i]); 149 Tcontrol_t restore = internal_RETIRE_RESTORE [i]; 150 151 log_printf(TRACE,Register_Address_Translation_unit,FUNCTION," * front_end_id : %d",front_end_id); 152 log_printf(TRACE,Register_Address_Translation_unit,FUNCTION," * context_id : %d",context_id ); 153 log_printf(TRACE,Register_Address_Translation_unit,FUNCTION," * restore : %d",restore ); 154 155 // Test if write and have not a previous update 156 log_printf(TRACE,Register_Address_Translation_unit,FUNCTION," * write_rd : %d",write_rd); 157 if (PORT_READ(in_RETIRE_WRITE_RD [i]) == 1) 158 { 159 Tgeneral_address_t num_reg_rd_log = PORT_READ(in_RETIRE_NUM_REG_RD_LOG [i]); 160 161 log_printf(TRACE,Register_Address_Translation_unit,FUNCTION," * num_reg_rd_log : %d",num_reg_rd_log ); 162 163 if (not restore) 164 { 165 Tgeneral_address_t num_reg_rd_phy_new = PORT_READ(in_RETIRE_NUM_REG_RD_PHY_NEW [i]); 166 167 log_printf(TRACE,Register_Address_Translation_unit,FUNCTION," * num_reg_rd_phy_new : %d",num_reg_rd_phy_new); 168 169 rat_gpr_not_speculative [front_end_id][context_id][num_reg_rd_log] = num_reg_rd_phy_new; 170 } 171 172 Tcontrol_t restore_rd = internal_RETIRE_RESTORE_RD_PHY_OLD [i]; 173 log_printf(TRACE,Register_Address_Translation_unit,FUNCTION," * restore_rd : %d",restore_rd ); 133 174 134 log_printf(TRACE,Register_Address_Translation_unit,FUNCTION," * retire RD"); 135 log_printf(TRACE,Register_Address_Translation_unit,FUNCTION," * rd_log : %d",rd_log); 136 137 // #ifdef DEBUG_TEST 138 // if (not (internal_RETIRE_RESTORE_RD_PHY_OLD [i] and ( (rat_gpr_update_table [front_end_id][context_id][rd_log] == 0)) and (event_state != EVENT_STATE_NO_EVENT))) 139 // throw ERRORMORPHEO(FUNCTION,toString(_("restore_rd_phy_old [%d] = %d, but rat_gpr_update_table[%d][%d][%d] = %d\n"), 140 // i,internal_RETIRE_RESTORE_RD_PHY_OLD [i], 141 // front_end_id,context_id,rd_log,rat_gpr_update_table [front_end_id][context_id][rd_log])); 142 // #endif 143 144 if (internal_RETIRE_RESTORE_RD_PHY_OLD [i]) 145 // if (rat_gpr_update_table [front_end_id][context_id][rd_log] == 0) 146 { 147 rat_gpr [front_end_id][context_id][rd_log] = PORT_READ(in_RETIRE_NUM_REG_RD_PHY_OLD [i]); 148 rat_gpr_update_table [front_end_id][context_id][rd_log] = 1; 149 } 150 } 151 152 if (PORT_READ(in_RETIRE_WRITE_RE [i]) == 1) 153 { 154 Tspecial_address_t re_log = PORT_READ(in_RETIRE_NUM_REG_RE_LOG [i]); 155 156 log_printf(TRACE,Register_Address_Translation_unit,FUNCTION," * retire RE"); 157 log_printf(TRACE,Register_Address_Translation_unit,FUNCTION," * re_log : %d",re_log); 158 159 // #ifdef DEBUG_TEST 160 // if (not (internal_RETIRE_RESTORE_RE_PHY_OLD [i] and ((rat_spr_update_table [front_end_id][context_id][re_log] == 0) and (event_state != EVENT_STATE_NO_EVENT)))) 161 // throw ERRORMORPHEO(FUNCTION,toString(_("restore_re_phy_old [%d] = %d, but rat_spr_update_table[%d][%d][%d] = %d\n"), 162 // i,internal_RETIRE_RESTORE_RE_PHY_OLD [i], 163 // front_end_id,context_id,re_log,rat_spr_update_table [front_end_id][context_id][re_log])); 164 // #endif 165 166 if (internal_RETIRE_RESTORE_RE_PHY_OLD [i]) 167 // if (rat_spr_update_table [front_end_id][context_id][re_log] == 0) 168 { 169 rat_spr [front_end_id][context_id][re_log] = PORT_READ(in_RETIRE_NUM_REG_RE_PHY_OLD [i]); 170 rat_spr_update_table [front_end_id][context_id][re_log] = 1; 171 } 172 } 173 // } 175 if (restore_rd) 176 rat_gpr_update_table [front_end_id][context_id][num_reg_rd_log] = true; 177 } 178 179 log_printf(TRACE,Register_Address_Translation_unit,FUNCTION," * write_re : %d",write_re); 180 if (PORT_READ(in_RETIRE_WRITE_RE [i]) == 1) 181 { 182 Tspecial_address_t num_reg_re_log = PORT_READ(in_RETIRE_NUM_REG_RE_LOG [i]); 183 184 log_printf(TRACE,Register_Address_Translation_unit,FUNCTION," * num_reg_re_log : %d",num_reg_re_log ); 185 186 if (not restore) 187 { 188 Tspecial_address_t num_reg_re_phy_new = PORT_READ(in_RETIRE_NUM_REG_RE_PHY_NEW [i]); 189 190 log_printf(TRACE,Register_Address_Translation_unit,FUNCTION," * num_reg_re_phy_new : %d",num_reg_re_phy_new); 191 192 rat_spr_not_speculative [front_end_id][context_id][num_reg_re_log] = num_reg_re_phy_new; 193 } 194 195 Tcontrol_t restore_re = internal_RETIRE_RESTORE_RE_PHY_OLD [i]; 196 log_printf(TRACE,Register_Address_Translation_unit,FUNCTION," * restore_re : %d",restore_re ); 197 198 if (restore_re) 199 rat_spr_update_table [front_end_id][context_id][num_reg_re_log] = true; 200 } 201 174 202 } 175 203 } … … 194 222 break; 195 223 else 196 str+=toString("GPR[%.4d] - %. 5d %.1d | ",index,rat_gpr[i][j][index],rat_gpr_update_table[i][j][index]);224 str+=toString("GPR[%.4d] - %.1d %.5d (%.5d) %.1d | ",index,rat_gpr_speculative_valid [i][j][index],rat_gpr_speculative [i][j][index],rat_gpr_not_speculative [i][j][index],rat_gpr_update_table[i][j][index]); 197 225 } 198 226 log_printf(TRACE,Register_Address_Translation_unit,FUNCTION," * %s",str.c_str()); … … 209 237 break; 210 238 else 211 str+=toString("SPR[%.4d] - %. 5d %.1d | ",index,rat_spr[i][j][index],rat_spr_update_table[i][j][index]);239 str+=toString("SPR[%.4d] - %.1d %.5d (%.5d) %.1d | ",index,rat_spr_speculative_valid [i][j][index],rat_spr_speculative [i][j][index],rat_spr_not_speculative [i][j][index],rat_spr_update_table[i][j][index]); 212 240 } 213 241 log_printf(TRACE,Register_Address_Translation_unit,FUNCTION," * %s",str.c_str()); … … 218 246 219 247 #ifdef DEBUG_TEST 220 if (1) 248 # if 1 249 { 250 for (uint32_t i=0; i<_param->_nb_front_end; ++i) 251 for (uint32_t j=0; j<_param->_nb_context[i]; ++j) 221 252 { 222 for (uint32_t i=0; i<_param->_nb_front_end; ++i) 223 for (uint32_t j=0; j<_param->_nb_context[i]; ++j) 224 { 225 for (uint32_t x=0; x<_param->_nb_general_register_logic; ++x) 226 for (uint32_t y=x+1; y<_param->_nb_general_register_logic; ++y) 227 if (rat_gpr[i][j][x] == rat_gpr[i][j][y]) 228 throw ERRORMORPHEO (FUNCTION,toString(_("In RAT, rat_gpr[%d][%d][%d] == rat_gpr[%d][%d][%d] == %d"),i,j,x,i,j,y,rat_gpr[i][j][x])); 229 for (uint32_t x=0; x<_param->_nb_special_register_logic; ++x) 230 for (uint32_t y=x+1; y<_param->_nb_special_register_logic; ++y) 231 if (rat_spr[i][j][x] == rat_spr[i][j][y]) 232 throw ERRORMORPHEO (FUNCTION,toString(_("In RAT, rat_spr[%d][%d][%d] == rat_spr[%d][%d][%d] == %d"),i,j,x,i,j,y,rat_spr[i][j][x])); 233 } 234 253 for (uint32_t x=0; x<_param->_nb_general_register_logic; ++x) 254 for (uint32_t y=x+1; y<_param->_nb_general_register_logic; ++y) 255 { 256 if (rat_gpr_speculative_valid [i][j][x] and 257 rat_gpr_speculative_valid [i][j][y] and 258 (rat_gpr_speculative[i][j][x] == rat_gpr_speculative[i][j][y])) 259 throw ERRORMORPHEO (FUNCTION,toString(_("In RAT, rat_gpr_speculative[%d][%d][%d] == rat_gpr_speculative[%d][%d][%d] == %d"),i,j,x,i,j,y,rat_gpr_speculative[i][j][x])); 260 if (rat_gpr_not_speculative[i][j][x] == rat_gpr_not_speculative[i][j][y]) 261 throw ERRORMORPHEO (FUNCTION,toString(_("In RAT, rat_gpr_not_speculative[%d][%d][%d] == rat_gpr_not_speculative[%d][%d][%d] == %d"),i,j,x,i,j,y,rat_gpr_not_speculative[i][j][x])); 262 263 } 264 for (uint32_t x=0; x<_param->_nb_special_register_logic; ++x) 265 for (uint32_t y=x+1; y<_param->_nb_special_register_logic; ++y) 266 { 267 if(rat_spr_speculative_valid [i][j][x] and 268 rat_spr_speculative_valid [i][j][y] and 269 (rat_spr_speculative[i][j][x] == rat_spr_speculative[i][j][y])) 270 throw ERRORMORPHEO (FUNCTION,toString(_("In RAT, rat_spr_speculative[%d][%d][%d] == rat_spr_speculative[%d][%d][%d] == %d"),i,j,x,i,j,y,rat_spr_speculative[i][j][x])); 271 if (rat_spr_not_speculative[i][j][x] == rat_spr_not_speculative[i][j][y]) 272 throw ERRORMORPHEO (FUNCTION,toString(_("In RAT, rat_spr_not_speculative[%d][%d][%d] == rat_spr_not_speculative[%d][%d][%d] == %d"),i,j,x,i,j,y,rat_spr_not_speculative[i][j][x])); 273 274 } 235 275 } 276 277 } 278 # endif 236 279 #endif 237 280 -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Rename_unit/Register_translation_unit/src/Register_translation_unit_allocation.cpp
r121 r122 361 361 PORT_MAP(_component,src , "in_RETIRE_"+toString(i)+"_NUM_REG_RE_LOG" , 362 362 dest, "in_RETIRE_"+toString(i)+"_NUM_REG_RE_LOG" ); 363 PORT_MAP(_component,src , "in_RETIRE_"+toString(i)+"_NUM_REG_RD_PHY_ OLD",364 dest, "in_RETIRE_"+toString(i)+"_NUM_REG_RD_PHY_ OLD");365 PORT_MAP(_component,src , "in_RETIRE_"+toString(i)+"_NUM_REG_RE_PHY_ OLD",366 dest, "in_RETIRE_"+toString(i)+"_NUM_REG_RE_PHY_ OLD");363 PORT_MAP(_component,src , "in_RETIRE_"+toString(i)+"_NUM_REG_RD_PHY_NEW", 364 dest, "in_RETIRE_"+toString(i)+"_NUM_REG_RD_PHY_NEW"); 365 PORT_MAP(_component,src , "in_RETIRE_"+toString(i)+"_NUM_REG_RE_PHY_NEW", 366 dest, "in_RETIRE_"+toString(i)+"_NUM_REG_RE_PHY_NEW"); 367 367 368 368 dest = _name+"_register_translation_unit_glue";
Note: See TracChangeset
for help on using the changeset viewer.