Changeset 42 for trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/src
- Timestamp:
- Jul 5, 2007, 5:50:19 PM (17 years ago)
- Location:
- trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/src
- Files:
-
- 2 deleted
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/src/Two_Level_Branch_Predictor.cpp
r5 r42 33 33 log_printf(FUNC,Two_Level_Branch_Predictor,"Two_Level_Branch_Predictor","Begin"); 34 34 35 #ifdef SYSTEMC 36 allocation (); 37 #endif 38 35 39 #ifdef STATISTICS 36 40 // Allocation of statistics … … 38 42 param_statistics , 39 43 param); 40 #endif41 42 #ifdef VHDL_TESTBENCH43 // Creation of a testbench44 // -> port45 // -> clock's signals46 _vhdl_testbench = new Vhdl_Testbench (_name);47 vhdl_testbench_port ();48 _vhdl_testbench->set_clock ("in_CLOCK",true);49 44 #endif 50 45 … … 55 50 56 51 #ifdef SYSTEMC 57 allocation ();58 59 52 #if (defined(STATISTICS) || defined (VHDL_TESTBENCH)) 60 53 SC_METHOD (transition); … … 79 72 log_printf(FUNC,Two_Level_Branch_Predictor,"~Two_Level_Branch_Predictor","Begin"); 80 73 81 #ifdef VHDL_TESTBENCH82 // generate the test bench83 _vhdl_testbench->generate_file();84 delete _vhdl_testbench;85 #endif86 87 74 #ifdef STATISTICS 88 75 _stat->generate_file(statistics(0)); -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/src/Two_Level_Branch_Predictor_allocation.cpp
r15 r42 22 22 log_printf(FUNC,Two_Level_Branch_Predictor,"allocation","Begin"); 23 23 24 in_CLOCK = new SC_CLOCK ("in_CLOCK"); 25 in_NRESET = new SC_IN (Tcontrol_t) ("in_NRESET"); 24 _component = new Component (); 25 26 Entity * entity = _component->set_entity (_name 27 ,"Two_Level_Branch_Predictor" 28 #ifdef POSITION 29 ,MIXTE 30 #endif 31 ); 32 33 _interfaces = entity->set_interfaces(); 34 35 // ~~~~~[ Interface : "" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 36 { 37 Interface * interface = _interfaces->set_interface("" 38 #ifdef POSITION 39 , IN 40 , SOUTH 41 , "Generalist interface" 42 #endif 43 ); 44 45 in_CLOCK = interface->set_signal_clk ("clock" ,1); 46 in_NRESET = interface->set_signal_in <Tcontrol_t> ("nreset",1,RESET_VHDL_YES); 47 } 48 49 // ~~~~~[ Interface : "predict" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 26 50 27 51 in_PREDICT_VAL = new SC_IN (Tcontrol_t) * [_param._nb_prediction ]; … … 32 56 if (_param._have_pht) 33 57 out_PREDICT_PHT_HISTORY = new SC_OUT(Tpht_history_t) * [_param._nb_prediction ]; 34 if (_param._have_bht)35 {36 signal_PREDICT_BHT_ACK = new SC_SIGNAL(Tcontrol_t) * [_param._nb_prediction];37 signal_PREDICT_BHT_ADDRESS = new SC_SIGNAL(Taddress_t) * [_param._nb_prediction];38 }39 if (_param._have_pht)40 {41 signal_PREDICT_PHT_ACK = new SC_SIGNAL(Tcontrol_t) * [_param._nb_prediction];42 signal_PREDICT_PHT_ADDRESS = new SC_SIGNAL(Taddress_t) * [_param._nb_prediction];43 }44 58 45 59 for (uint32_t i=0; i<_param._nb_prediction; i++) 46 60 { 47 rename = "in_PREDICT_VAL_" +toString(i); 48 in_PREDICT_VAL [i] = new SC_IN (Tcontrol_t) (rename.c_str()); 49 50 rename = "out_PREDICT_ACK_" +toString(i); 51 out_PREDICT_ACK [i] = new SC_OUT(Tcontrol_t) (rename.c_str()); 52 53 rename = "in_PREDICT_ADDRESS_" +toString(i); 54 in_PREDICT_ADDRESS [i] = new SC_IN (Taddress_t) (rename.c_str()); 55 61 Interface_fifo * interface = _interfaces->set_interface("predict_"+toString(i) 62 #ifdef POSITION 63 , IN 64 , WEST 65 , "Interface Predict" 66 #endif 67 ); 68 69 in_PREDICT_VAL [i] = interface->set_signal_valack_in ("val" , VAL); 70 out_PREDICT_ACK [i] = interface->set_signal_valack_out ("ack" , ACK); 71 in_PREDICT_ADDRESS [i] = interface->set_signal_in <Taddress_t> ("address", _param._size_address); 56 72 if (_param._have_bht) 57 { 58 rename = "out_PREDICT_BHT_HISTORY_"+toString(i); 59 out_PREDICT_BHT_HISTORY [i] = new SC_OUT(Tbht_history_t) (rename.c_str()); 60 } 61 73 out_PREDICT_BHT_HISTORY [i] = interface->set_signal_out <Tbht_history_t> ("bht_history", _param._bht_size_shifter); 62 74 if (_param._have_pht) 63 { 64 rename = "out_PREDICT_PHT_HISTORY_"+toString(i); 65 out_PREDICT_PHT_HISTORY [i] = new SC_OUT(Tpht_history_t) (rename.c_str()); 66 } 67 68 if (_param._have_bht) 69 { 70 rename = "signal_PREDICT_BHT_ACK_" +toString(i); 71 signal_PREDICT_BHT_ACK [i] = new SC_SIGNAL(Tcontrol_t) (rename.c_str()); 72 73 rename = "signal_PREDICT_BHT_ADDRESS_"+toString(i); 74 signal_PREDICT_BHT_ADDRESS [i] = new SC_SIGNAL(Taddress_t) (rename.c_str()); 75 } 76 77 if (_param._have_pht) 78 { 79 rename = "signal_PREDICT_PHT_ACK_" +toString(i); 80 signal_PREDICT_PHT_ACK [i] = new SC_SIGNAL(Tcontrol_t) (rename.c_str()); 81 82 rename = "signal_PREDICT_PHT_ADDRESS_"+toString(i); 83 signal_PREDICT_PHT_ADDRESS [i] = new SC_SIGNAL(Taddress_t) (rename.c_str()); 84 } 85 } 75 out_PREDICT_PHT_HISTORY [i] = interface->set_signal_out <Tpht_history_t> ("pht_history", _param._pht_size_counter); 76 } 77 78 // ~~~~~[ Interface : "branch_complete" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 86 79 87 80 in_BRANCH_COMPLETE_VAL = new SC_IN (Tcontrol_t) * [_param._nb_branch_complete]; … … 93 86 in_BRANCH_COMPLETE_PHT_HISTORY = new SC_IN (Tpht_history_t) * [_param._nb_branch_complete]; 94 87 in_BRANCH_COMPLETE_DIRECTION = new SC_IN (Tcontrol_t) * [_param._nb_branch_complete]; 95 if (_param._have_bht)96 {97 signal_BRANCH_COMPLETE_BHT_ACK = new SC_SIGNAL(Tcontrol_t) * [_param._nb_branch_complete];98 signal_BRANCH_COMPLETE_BHT_ADDRESS = new SC_SIGNAL(Taddress_t) * [_param._nb_branch_complete];99 }100 if (_param._have_pht)101 {102 signal_BRANCH_COMPLETE_PHT_ACK = new SC_SIGNAL(Tcontrol_t) * [_param._nb_branch_complete];103 signal_BRANCH_COMPLETE_PHT_ADDRESS = new SC_SIGNAL(Taddress_t) * [_param._nb_branch_complete];104 }105 88 106 89 for (uint32_t i=0; i<_param._nb_branch_complete; i++) 107 90 { 108 rename = "in_BRANCH_COMPLETE_VAL_" +toString(i); 109 in_BRANCH_COMPLETE_VAL [i] = new SC_IN (Tcontrol_t) (rename.c_str()); 110 111 rename = "out_BRANCH_COMPLETE_ACK_" +toString(i); 112 out_BRANCH_COMPLETE_ACK [i] = new SC_OUT(Tcontrol_t) (rename.c_str()); 113 114 rename = "in_BRANCH_COMPLETE_ADDRESS_" +toString(i); 115 in_BRANCH_COMPLETE_ADDRESS [i] = new SC_IN (Taddress_t) (rename.c_str()); 116 91 in_BRANCH_COMPLETE_VAL [i] = new interface->set_signal_valack_in ("val" , VAL); 92 out_BRANCH_COMPLETE_ACK [i] = new interface->set_signal_valack_out ("ack" , ACK); 93 in_BRANCH_COMPLETE_ADDRESS [i] = new interface->set_signal_in <Taddress_t > ("address" , _param._size_address); 117 94 if (_param._have_bht) 118 { 119 rename = "in_BRANCH_COMPLETE_BHT_HISTORY_"+toString(i); 120 in_BRANCH_COMPLETE_BHT_HISTORY [i] = new SC_IN (Tbht_history_t) (rename.c_str()); 121 } 95 in_BRANCH_COMPLETE_BHT_HISTORY [i] = new interface->set_signal_in <Tbht_history_t> ("bht_history", _param._bht_size_shifter); 122 96 if (_param._have_pht) 123 { 124 rename = "in_BRANCH_COMPLETE_PHT_HISTORY_"+toString(i); 125 in_BRANCH_COMPLETE_PHT_HISTORY [i] = new SC_IN (Tpht_history_t) (rename.c_str()); 126 } 127 rename = "in_BRANCH_COMPLETE_DIRECTION_" +toString(i); 128 in_BRANCH_COMPLETE_DIRECTION [i] = new SC_IN (Tcontrol_t) (rename.c_str()); 129 if (_param._have_bht) 130 { 131 rename = "signal_BRANCH_COMPLETE_BHT_ACK_" +toString(i); 132 signal_BRANCH_COMPLETE_BHT_ACK [i] = new SC_SIGNAL(Tcontrol_t) (rename.c_str()); 133 134 rename = "signal_BRANCH_COMPLETE_BHT_ADDRESS_"+toString(i); 135 signal_BRANCH_COMPLETE_BHT_ADDRESS [i] = new SC_SIGNAL(Taddress_t) (rename.c_str()); 136 } 137 if (_param._have_pht) 138 { 139 rename = "signal_BRANCH_COMPLETE_PHT_ACK_" +toString(i); 140 signal_BRANCH_COMPLETE_PHT_ACK [i] = new SC_SIGNAL(Tcontrol_t) (rename.c_str()); 141 142 rename = "signal_BRANCH_COMPLETE_PHT_ADDRESS_"+toString(i); 143 signal_BRANCH_COMPLETE_PHT_ADDRESS [i] = new SC_SIGNAL(Taddress_t) (rename.c_str()); 144 } 97 in_BRANCH_COMPLETE_PHT_HISTORY [i] = new interface->set_signal_in <Tpht_history_t> ("pht_history", _param._pht_size_counter); 98 in_BRANCH_COMPLETE_DIRECTION [i] = new interface->set_signal_in <Tcontrol_t > ("direction" , 1); 145 99 } 146 100 … … 152 106 { 153 107 name_component = _name+"_Branch_History_Table"; 154 155 log_printf(INFO,Two_Level_Branch_Predictor,"allocation","Allocation : %s",name_component.c_str()); 156 157 component_Branch_History_Table = new morpheo::behavioural::stage_1_ifetch::predictor::meta_predictor::two_level_branch_predictor::branch_history_table ::Branch_History_Table (name_component.c_str() , 108 109 component_Branch_History_Table = new morpheo::behavioural::stage_1_ifetch::predictor::meta_predictor::two_level_branch_predictor::branch_history_table ::Branch_History_Table (name_component.c_str() 158 110 #ifdef STATISTICS 159 _param_statistics , 160 #endif 161 *(_param._param_branch_history_table)); 162 163 // Instantiation 164 (*(component_Branch_History_Table->in_CLOCK )) (*(in_CLOCK )); 165 (*(component_Branch_History_Table->in_NRESET)) (*(in_NRESET)); 166 167 for (uint32_t i=0; i<_param._nb_prediction; i++) 168 { 169 (*(component_Branch_History_Table-> in_PREDICT_VAL [i])) (*( in_PREDICT_VAL [i])); 170 (*(component_Branch_History_Table->out_PREDICT_ACK [i])) (*(signal_PREDICT_BHT_ACK [i])); 171 (*(component_Branch_History_Table-> in_PREDICT_ADDRESS [i])) (*(signal_PREDICT_BHT_ADDRESS [i])); 172 (*(component_Branch_History_Table->out_PREDICT_HISTORY [i])) (*( out_PREDICT_BHT_HISTORY [i])); 173 } 174 175 for (uint32_t i=0; i<_param._nb_branch_complete; i++) 176 { 177 (*(component_Branch_History_Table-> in_BRANCH_COMPLETE_VAL [i])) (*( in_BRANCH_COMPLETE_VAL [i])); 178 (*(component_Branch_History_Table->out_BRANCH_COMPLETE_ACK [i])) (*(signal_BRANCH_COMPLETE_BHT_ACK [i])); 179 (*(component_Branch_History_Table-> in_BRANCH_COMPLETE_ADDRESS [i])) (*(signal_BRANCH_COMPLETE_BHT_ADDRESS [i])); 180 (*(component_Branch_History_Table-> in_BRANCH_COMPLETE_HISTORY [i])) (*( in_BRANCH_COMPLETE_BHT_HISTORY [i])); 181 (*(component_Branch_History_Table-> in_BRANCH_COMPLETE_DIRECTION [i])) (*( in_BRANCH_COMPLETE_DIRECTION [i])); 182 } 183 } 184 111 ,_param_statistics 112 #endif 113 ,*(_param._param_counter)); 114 115 _component->set_component (component_Branch_History_Table->_component 116 #ifdef POSITION 117 , 75 118 , 25 119 , 10 120 , 10 121 #endif 122 ); 123 } 124 185 125 // =====[ component_Pattern_History_Table ]=========================== 186 126 if (_param._have_pht) … … 188 128 name_component = _name+"_Pattern_History_Table"; 189 129 190 log_printf(INFO,Two_Level_Branch_Predictor,"allocation","Allocation : %s",name_component.c_str()); 191 192 component_Pattern_History_Table = new morpheo::behavioural::stage_1_ifetch::predictor::meta_predictor::two_level_branch_predictor::pattern_history_table::Pattern_History_Table (name_component.c_str() , 130 component_Pattern_History_Table = new morpheo::behavioural::stage_1_ifetch::predictor::meta_predictor::two_level_branch_predictor::pattern_history_table ::Pattern_History_Table (name_component.c_str() 193 131 #ifdef STATISTICS 194 _param_statistics , 195 #endif 196 *(_param._param_pattern_history_table)); 197 198 // Instantiation 199 (*(component_Pattern_History_Table->in_CLOCK)) (*(in_CLOCK)); 200 (*(component_Pattern_History_Table->in_NRESET)) (*(in_NRESET)); 201 132 ,_param_statistics 133 #endif 134 ,*(_param._param_counter)); 135 136 _component->set_component (component_Pattern_History_Table->_component 137 #ifdef POSITION 138 , 75 139 , 75 140 , 10 141 , 10 142 #endif 143 ); 144 } 145 146 // =====[ component_Two_Level_Branch_Predictor_Glue ]================= 147 148 name_component = _name+"_Two_Level_Branch_Predictor_Glue"; 149 150 component_Two_Level_Branch_Predictor_Glue = new morpheo::behavioural::stage_1_ifetch::predictor::meta_predictor::two_level_branch_predictor::two_level_branch_predictor_glue::Two_Level_Branch_Predictor_Glue (name_component.c_str() 151 #ifdef STATISTICS 152 ,_param_statistics 153 #endif 154 ,*(_param._param_counter)); 155 156 _component->set_component (component_Pattern_History_Table->_component 157 #ifdef POSITION 158 , 50 159 , 75 160 , 10 161 , 10 162 #endif 163 ); 164 165 // ~~~~~[ Component - Instanciation ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 166 167 // =====[ component_Branch_History_Table - Instanciation ]============ 168 if (_param._have_bht) 169 { 170 #ifdef POSITION 171 _component->interface_map (_name+"_Branch_History_Table","", 172 _name ,""); 173 #endif 174 175 _component->port_map(_name+"_Branch_History_Table", "in_CLOCK" , _name,"in_CLOCK" ); 176 _component->port_map(_name+"_Branch_History_Table", "in_NRESET", _name,"in_NRESET"); 177 202 178 for (uint32_t i=0; i<_param._nb_prediction; i++) 203 179 { 204 (*(component_Pattern_History_Table-> in_PREDICT_VAL [i])) (*( in_PREDICT_VAL [i])); 205 (*(component_Pattern_History_Table->out_PREDICT_ACK [i])) (*(signal_PREDICT_PHT_ACK [i])); 206 (*(component_Pattern_History_Table-> in_PREDICT_ADDRESS [i])) (*(signal_PREDICT_PHT_ADDRESS [i])); 207 (*(component_Pattern_History_Table->out_PREDICT_HISTORY [i])) (*( out_PREDICT_PHT_HISTORY [i])); 180 #ifdef POSITION 181 _component->interface_map (_name+"_Branch_History_Table","predict_"+toString(i), 182 _name ,"predict_"+toString(i)); 183 #endif 184 _component->port_map(_name+"_Branch_History_Table", "in_PREDICT_"+toString(i)+"_VAL" , _name , "in_PREDICT_"+toString(i)+"_VAL" ); 185 _component->port_map(_name+"_Branch_History_Table","out_PREDICT_"+toString(i)+"_ACK" , _name+"_Two_Level_Branch_Predictor_Glue", "in_PREDICT_"+toString(i)+"_BHT_ACK" ); 186 _component->port_map(_name+"_Branch_History_Table", "in_PREDICT_"+toString(i)+"_ADDRESS", _name+"_Two_Level_Branch_Predictor_Glue","out_PREDICT_"+toString(i)+"_BHT_ADDRESS"); 187 _component->port_map(_name+"_Branch_History_Table","out_PREDICT_"+toString(i)+"_HISTORY", _name ,"out_PREDICT_"+toString(i)+"_BHT_HISTORY"); 208 188 } 209 189 210 190 for (uint32_t i=0; i<_param._nb_branch_complete; i++) 211 191 { 212 (*(component_Pattern_History_Table-> in_BRANCH_COMPLETE_VAL [i])) (*( in_BRANCH_COMPLETE_VAL [i])); 213 (*(component_Pattern_History_Table->out_BRANCH_COMPLETE_ACK [i])) (*(signal_BRANCH_COMPLETE_PHT_ACK [i])); 214 (*(component_Pattern_History_Table-> in_BRANCH_COMPLETE_ADDRESS [i])) (*(signal_BRANCH_COMPLETE_PHT_ADDRESS [i])); 215 (*(component_Pattern_History_Table-> in_BRANCH_COMPLETE_HISTORY [i])) (*( in_BRANCH_COMPLETE_PHT_HISTORY [i])); 216 (*(component_Pattern_History_Table-> in_BRANCH_COMPLETE_DIRECTION [i])) (*( in_BRANCH_COMPLETE_DIRECTION [i])); 217 } 218 } 219 220 // =====[ component_Two_Level_Branch_Predictor_Glue ]=========================== 221 name_component = _name+"_Two_Level_Branch_Predictor_Glue"; 222 223 log_printf(INFO,Two_Level_Branch_Predictor,"allocation","Allocation : %s",name_component.c_str()); 224 225 component_Two_Level_Branch_Predictor_Glue = new morpheo::behavioural::stage_1_ifetch::predictor::meta_predictor::two_level_branch_predictor::two_level_branch_predictor_glue::Two_Level_Branch_Predictor_Glue (name_component.c_str() , 226 #ifdef STATISTICS 227 _param_statistics , 228 #endif 229 *(_param._param_two_level_branch_predictor_glue)); 230 231 // Instantiation 232 #if defined(STATISTICS) or defined(VHDL_TESTBENCH) 233 (*(component_Two_Level_Branch_Predictor_Glue->in_CLOCK)) (*(in_CLOCK)); 234 #endif 235 for (uint32_t i=0; i<_param._nb_prediction; i++) 236 { 192 #ifdef POSITION 193 _component->interface_map (_name+"_Branch_History_Table","branch_complete_"+toString(i), 194 _name ,"branch_complete_"+toString(i)); 195 #endif 196 _component->port_map(_name+"_Branch_History_Table", "in_BRANCH_COMPLETE_"+toString(i)+"_VAL" , _name , "in_BRANCH_COMPLETE_"+toString(i)+"_VAL" ); 197 _component->port_map(_name+"_Branch_History_Table","out_BRANCH_COMPLETE_"+toString(i)+"_ACK" , _name+"_Two_Level_Branch_Predictor_Glue", "in_BRANCH_COMPLETE_"+toString(i)+"_BHT_ACK" ); 198 _component->port_map(_name+"_Branch_History_Table", "in_BRANCH_COMPLETE_"+toString(i)+"_ADDRESS" , _name+"_Two_Level_Branch_Predictor_Glue","out_BRANCH_COMPLETE_"+toString(i)+"_BHT_ADDRESS" ); 199 _component->port_map(_name+"_Branch_History_Table", "in_BRANCH_COMPLETE_"+toString(i)+"_HISTORY" , _name , "in_BRANCH_COMPLETE_"+toString(i)+"_BHT_HISTORY" ); 200 _component->port_map(_name+"_Branch_History_Table", "in_BRANCH_COMPLETE_"+toString(i)+"_DIRECTION", _name , "in_BRANCH_COMPLETE_"+toString(i)+"_DIRECTION" ); 201 } 202 } 203 204 // =====[ component_Pattern_History_Table - Instanciation ]=========== 205 if (_param._have_pht) 206 { 207 #ifdef POSITION 208 _component->interface_map (_name+"_Pattern_History_Table","", 209 _name ,""); 210 #endif 211 212 _component->port_map(_name+"_Pattern_History_Table", "in_CLOCK" , _name,"in_CLOCK" ); 213 _component->port_map(_name+"_Pattern_History_Table", "in_NRESET", _name,"in_NRESET"); 214 215 for (uint32_t i=0; i<_param._nb_prediction; i++) 216 { 217 #ifdef POSITION 218 _component->interface_map (_name+"_Pattern_History_Table","predict_"+toString(i), 219 _name ,"predict_"+toString(i)); 220 #endif 221 _component->port_map(_name+"_Pattern_History_Table", "in_PREDICT_"+toString(i)+"_VAL" , _name , "in_PREDICT_"+toString(i)+"_VAL" ); 222 _component->port_map(_name+"_Pattern_History_Table","out_PREDICT_"+toString(i)+"_ACK" , _name+"_Two_Level_Branch_Predictor_Glue", "in_PREDICT_"+toString(i)+"_PHT_ACK" ); 223 _component->port_map(_name+"_Pattern_History_Table", "in_PREDICT_"+toString(i)+"_ADDRESS", _name+"_Two_Level_Branch_Predictor_Glue","out_PREDICT_"+toString(i)+"_PHT_ADDRESS"); 224 _component->port_map(_name+"_Pattern_History_Table","out_PREDICT_"+toString(i)+"_HISTORY", _name ,"out_PREDICT_"+toString(i)+"_PHT_HISTORY"); 225 } 226 227 for (uint32_t i=0; i<_param._nb_branch_complete; i++) 228 { 229 #ifdef POSITION 230 _component->interface_map (_name+"_Pattern_History_Table","branch_complete_"+toString(i), 231 _name ,"branch_complete_"+toString(i)); 232 #endif 233 _component->port_map(_name+"_Pattern_History_Table", "in_BRANCH_COMPLETE_"+toString(i)+"_VAL" , _name , "in_BRANCH_COMPLETE_"+toString(i)+"_VAL" ); 234 _component->port_map(_name+"_Pattern_History_Table","out_BRANCH_COMPLETE_"+toString(i)+"_ACK" , _name+"_Two_Level_Branch_Predictor_Glue", "in_BRANCH_COMPLETE_"+toString(i)+"_PHT_ACK" ); 235 _component->port_map(_name+"_Pattern_History_Table", "in_BRANCH_COMPLETE_"+toString(i)+"_ADDRESS" , _name+"_Two_Level_Branch_Predictor_Glue","out_BRANCH_COMPLETE_"+toString(i)+"_PHT_ADDRESS" ); 236 _component->port_map(_name+"_Pattern_History_Table", "in_BRANCH_COMPLETE_"+toString(i)+"_HISTORY" , _name , "in_BRANCH_COMPLETE_"+toString(i)+"_PHT_HISTORY" ); 237 _component->port_map(_name+"_Pattern_History_Table", "in_BRANCH_COMPLETE_"+toString(i)+"_DIRECTION", _name , "in_BRANCH_COMPLETE_"+toString(i)+"_DIRECTION" ); 238 } 239 } 240 241 // =====[ component_Two_Level_Branch_Predictor_Glue - Instanciation ]= 242 #ifdef POSITION 243 _component->interface_map (_name+"_Two_Level_Branch_Predictor_Glue","", 244 _name ,""); 245 #endif 246 _component->port_map(_name+"_Two_Level_Branch_Predictor_Glue", "in_CLOCK" , _name,"in_CLOCK" ); 247 _component->port_map(_name+"_Two_Level_Branch_Predictor_Glue", "in_NRESET", _name,"in_NRESET"); 248 249 for (uint32_t i=0; i<_param._nb_prediction; i++) 250 { 237 251 if (_param._have_bht) 238 252 { 239 (*(component_Two_Level_Branch_Predictor_Glue-> in_PREDICT_BHT_ACK [i])) (*(signal_PREDICT_BHT_ACK [i])); 240 (*(component_Two_Level_Branch_Predictor_Glue->out_PREDICT_BHT_ADDRESS [i])) (*(signal_PREDICT_BHT_ADDRESS [i])); 241 } 242 if (_param._have_pht) 243 { 244 (*(component_Two_Level_Branch_Predictor_Glue-> in_PREDICT_PHT_ACK [i])) (*(signal_PREDICT_PHT_ACK [i])); 245 (*(component_Two_Level_Branch_Predictor_Glue->out_PREDICT_PHT_ADDRESS [i])) (*(signal_PREDICT_PHT_ADDRESS [i])); 246 } 247 if (_param._have_bht and _param._have_pht) 248 { 249 (*(component_Two_Level_Branch_Predictor_Glue-> in_PREDICT_BHT_HISTORY [i])) (*( out_PREDICT_BHT_HISTORY [i])); 250 } 251 (*(component_Two_Level_Branch_Predictor_Glue->out_PREDICT_ACK [i])) (*( out_PREDICT_ACK [i])); 252 (*(component_Two_Level_Branch_Predictor_Glue-> in_PREDICT_ADDRESS [i])) (*( in_PREDICT_ADDRESS [i])); 253 } 253 _component->port_map(_name+"_Two_Level_Branch_Predictor_Glue", "in_PREDICT_"+toString(i)+"_BHT_ACK" , _name+"_Branch_History_Table" , "out_PREDICT_"+toString(i)+"_BHT_ACK" ); 254 _component->port_map(_name+"_Two_Level_Branch_Predictor_Glue", "out_PREDICT_"+toString(i)+"_BHT_ADDRESS", _name+"_Branch_History_Table" , "in_PREDICT_"+toString(i)+"_BHT_ADDRESS"); 255 } 256 if (_param._have_pht) 257 { 258 _component->port_map(_name+"_Two_Level_Branch_Predictor_Glue", "in_PREDICT_"+toString(i)+"_PHT_ACK" , _name+"_Pattern_History_Table", "out_PREDICT_"+toString(i)+"_PHT_ACK" ); 259 _component->port_map(_name+"_Two_Level_Branch_Predictor_Glue", "out_PREDICT_"+toString(i)+"_PHT_ADDRESS", _name+"_Pattern_History_Table", "in_PREDICT_"+toString(i)+"_PHT_ADDRESS"); 260 } 261 if (_param._have_bht and _param._have_pht) 262 _component->port_map(_name+"_Two_Level_Branch_Predictor_Glue", "in_PREDICT_"+toString(i)+"_BHT_HISTORY" , _name , "in_PREDICT_"+toString(i)+"_BHT_HISTORY"); 263 _component->port_map(_name+"_Two_Level_Branch_Predictor_Glue","out_PREDICT_"+toString(i)+"_ACK" , _name ,"out_PREDICT_"+toString(i)+"_ACK"); 264 _component->port_map(_name+"_Two_Level_Branch_Predictor_Glue", "in_PREDICT_"+toString(i)+"_ADDRESS" , _name , "in_PREDICT_"+toString(i)+"_ADDRESS"); 265 } 254 266 255 267 for (uint32_t i=0; i<_param._nb_branch_complete; i++) … … 257 269 if (_param._have_bht) 258 270 { 259 (*(component_Two_Level_Branch_Predictor_Glue-> in_BRANCH_COMPLETE_BHT_ACK [i])) (*(signal_BRANCH_COMPLETE_BHT_ACK [i])); 260 (*(component_Two_Level_Branch_Predictor_Glue->out_BRANCH_COMPLETE_BHT_ADDRESS [i])) (*(signal_BRANCH_COMPLETE_BHT_ADDRESS [i])); 261 } 262 if (_param._have_pht) 263 { 264 (*(component_Two_Level_Branch_Predictor_Glue-> in_BRANCH_COMPLETE_PHT_ACK [i])) (*(signal_BRANCH_COMPLETE_PHT_ACK [i])); 265 (*(component_Two_Level_Branch_Predictor_Glue->out_BRANCH_COMPLETE_PHT_ADDRESS [i])) (*(signal_BRANCH_COMPLETE_PHT_ADDRESS [i])); 266 } 267 if (_param._have_bht and _param._have_pht) 268 { 269 (*(component_Two_Level_Branch_Predictor_Glue-> in_BRANCH_COMPLETE_BHT_HISTORY [i])) (*( in_BRANCH_COMPLETE_BHT_HISTORY [i])); 270 } 271 (*(component_Two_Level_Branch_Predictor_Glue->out_BRANCH_COMPLETE_ACK [i])) (*( out_BRANCH_COMPLETE_ACK [i])); 272 (*(component_Two_Level_Branch_Predictor_Glue-> in_BRANCH_COMPLETE_ADDRESS [i])) (*( in_BRANCH_COMPLETE_ADDRESS [i])); 271 _component->port_map(_name+"_Two_Level_Branch_Predictor_Glue", "in_BRANCH_COMPLETE_"+toString(i)+"_BHT_ACK" , _name+"_Branch_History_Table" , "out_BRANCH_COMPLETE_"+toString(i)+"_BHT_ACK" ); 272 _component->port_map(_name+"_Two_Level_Branch_Predictor_Glue", "out_BRANCH_COMPLETE_"+toString(i)+"_BHT_ADDRESS", _name+"_Branch_History_Table" , "in_BRANCH_COMPLETE_"+toString(i)+"_BHT_ADDRESS"); 273 } 274 if (_param._have_pht) 275 { 276 _component->port_map(_name+"_Two_Level_Branch_Predictor_Glue", "in_BRANCH_COMPLETE_"+toString(i)+"_PHT_ACK" , _name+"_Pattern_History_Table", "out_BRANCH_COMPLETE_"+toString(i)+"_PHT_ACK" ); 277 _component->port_map(_name+"_Two_Level_Branch_Predictor_Glue", "out_BRANCH_COMPLETE_"+toString(i)+"_PHT_ADDRESS", _name+"_Pattern_History_Table", "in_BRANCH_COMPLETE_"+toString(i)+"_PHT_ADDRESS"); 278 } 279 if (_param._have_bht and _param._have_pht) 280 _component->port_map(_name+"_Two_Level_Branch_Predictor_Glue", "in_BRANCH_COMPLETE_"+toString(i)+"_BHT_HISTORY" , _name , "in_BRANCH_COMPLETE_"+toString(i)+"_BHT_HISTORY"); 281 _component->port_map(_name+"_Two_Level_Branch_Predictor_Glue","out_BRANCH_COMPLETE_"+toString(i)+"_ACK" , _name ,"out_BRANCH_COMPLETE_"+toString(i)+"_ACK"); 282 _component->port_map(_name+"_Two_Level_Branch_Predictor_Glue", "in_BRANCH_COMPLETE_"+toString(i)+"_ADDRESS" , _name , "in_BRANCH_COMPLETE_"+toString(i)+"_ADDRESS"); 273 283 } 274 284 285 #ifdef POSITION 286 _component->generate_file(); 287 #endif 288 275 289 log_printf(FUNC,Two_Level_Branch_Predictor,"allocation","End"); 276 290 }; 291 292 293 294 295 296 297 298 // void Two_Level_Branch_Predictor::allocation (void) 299 // { 300 // string rename; 301 302 // log_printf(FUNC,Two_Level_Branch_Predictor,"allocation","Begin"); 303 304 // _component = new Component (); 305 306 // Entity * entity = _component->set_entity (_name 307 // #ifdef POSITION 308 // ,"Two_Level_Branch_Predictor" 309 // ,MIXTE 310 // #endif 311 // ); 312 313 // _interfaces = entity->set_interfaces(); 314 315 // // ~~~~~[ Interface : "" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 316 // { 317 // Interface * interface = _interfaces->set_interface("" 318 // #ifdef POSITION 319 // , IN 320 // , SOUTH 321 // , "Generalist interface" 322 // #endif 323 // ); 324 325 // in_CLOCK = interface->set_signal_clk ("clock" ,1); 326 // in_NRESET = interface->set_signal_in <Tcontrol_t> ("nreset",1,RESET_VHDL_YES); 327 // } 328 329 // // ~~~~~[ Interface : "predict" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 330 331 // in_PREDICT_VAL = new SC_IN (Tcontrol_t) * [_param._nb_prediction ]; 332 // out_PREDICT_ACK = new SC_OUT(Tcontrol_t) * [_param._nb_prediction ]; 333 // in_PREDICT_ADDRESS = new SC_IN (Taddress_t) * [_param._nb_prediction ]; 334 // if (_param._have_bht) 335 // out_PREDICT_BHT_HISTORY = new SC_OUT(Tbht_history_t) * [_param._nb_prediction ]; 336 // if (_param._have_pht) 337 // out_PREDICT_PHT_HISTORY = new SC_OUT(Tpht_history_t) * [_param._nb_prediction ]; 338 // // if (_param._have_bht) 339 // // { 340 // // signal_PREDICT_BHT_ACK = new SC_SIGNAL(Tcontrol_t) * [_param._nb_prediction]; 341 // // signal_PREDICT_BHT_ADDRESS = new SC_SIGNAL(Taddress_t) * [_param._nb_prediction]; 342 // // } 343 // // if (_param._have_pht) 344 // // { 345 // // signal_PREDICT_PHT_ACK = new SC_SIGNAL(Tcontrol_t) * [_param._nb_prediction]; 346 // // signal_PREDICT_PHT_ADDRESS = new SC_SIGNAL(Taddress_t) * [_param._nb_prediction]; 347 // // } 348 349 // for (uint32_t i=0; i<_param._nb_prediction; i++) 350 // { 351 // rename = "in_PREDICT_VAL_" +toString(i); 352 // in_PREDICT_VAL [i] = new SC_IN (Tcontrol_t) (rename.c_str()); 353 354 // rename = "out_PREDICT_ACK_" +toString(i); 355 // out_PREDICT_ACK [i] = new SC_OUT(Tcontrol_t) (rename.c_str()); 356 357 // rename = "in_PREDICT_ADDRESS_" +toString(i); 358 // in_PREDICT_ADDRESS [i] = new SC_IN (Taddress_t) (rename.c_str()); 359 360 // if (_param._have_bht) 361 // { 362 // rename = "out_PREDICT_BHT_HISTORY_"+toString(i); 363 // out_PREDICT_BHT_HISTORY [i] = new SC_OUT(Tbht_history_t) (rename.c_str()); 364 // } 365 366 // if (_param._have_pht) 367 // { 368 // rename = "out_PREDICT_PHT_HISTORY_"+toString(i); 369 // out_PREDICT_PHT_HISTORY [i] = new SC_OUT(Tpht_history_t) (rename.c_str()); 370 // } 371 372 // // if (_param._have_bht) 373 // // { 374 // // rename = "signal_PREDICT_BHT_ACK_" +toString(i); 375 // // signal_PREDICT_BHT_ACK [i] = new SC_SIGNAL(Tcontrol_t) (rename.c_str()); 376 377 // // rename = "signal_PREDICT_BHT_ADDRESS_"+toString(i); 378 // // signal_PREDICT_BHT_ADDRESS [i] = new SC_SIGNAL(Taddress_t) (rename.c_str()); 379 // // } 380 381 // // if (_param._have_pht) 382 // // { 383 // // rename = "signal_PREDICT_PHT_ACK_" +toString(i); 384 // // signal_PREDICT_PHT_ACK [i] = new SC_SIGNAL(Tcontrol_t) (rename.c_str()); 385 386 // // rename = "signal_PREDICT_PHT_ADDRESS_"+toString(i); 387 // // signal_PREDICT_PHT_ADDRESS [i] = new SC_SIGNAL(Taddress_t) (rename.c_str()); 388 // // } 389 // } 390 391 // in_BRANCH_COMPLETE_VAL = new SC_IN (Tcontrol_t) * [_param._nb_branch_complete]; 392 // out_BRANCH_COMPLETE_ACK = new SC_OUT(Tcontrol_t) * [_param._nb_branch_complete]; 393 // in_BRANCH_COMPLETE_ADDRESS = new SC_IN (Taddress_t) * [_param._nb_branch_complete]; 394 // if (_param._have_bht) 395 // in_BRANCH_COMPLETE_BHT_HISTORY = new SC_IN (Tbht_history_t) * [_param._nb_branch_complete]; 396 // if (_param._have_pht) 397 // in_BRANCH_COMPLETE_PHT_HISTORY = new SC_IN (Tpht_history_t) * [_param._nb_branch_complete]; 398 // in_BRANCH_COMPLETE_DIRECTION = new SC_IN (Tcontrol_t) * [_param._nb_branch_complete]; 399 // // if (_param._have_bht) 400 // // { 401 // // signal_BRANCH_COMPLETE_BHT_ACK = new SC_SIGNAL(Tcontrol_t) * [_param._nb_branch_complete]; 402 // // signal_BRANCH_COMPLETE_BHT_ADDRESS = new SC_SIGNAL(Taddress_t) * [_param._nb_branch_complete]; 403 // // } 404 // // if (_param._have_pht) 405 // // { 406 // // signal_BRANCH_COMPLETE_PHT_ACK = new SC_SIGNAL(Tcontrol_t) * [_param._nb_branch_complete]; 407 // // signal_BRANCH_COMPLETE_PHT_ADDRESS = new SC_SIGNAL(Taddress_t) * [_param._nb_branch_complete]; 408 // // } 409 410 // for (uint32_t i=0; i<_param._nb_branch_complete; i++) 411 // { 412 // rename = "in_BRANCH_COMPLETE_VAL_" +toString(i); 413 // in_BRANCH_COMPLETE_VAL [i] = new SC_IN (Tcontrol_t) (rename.c_str()); 414 415 // rename = "out_BRANCH_COMPLETE_ACK_" +toString(i); 416 // out_BRANCH_COMPLETE_ACK [i] = new SC_OUT(Tcontrol_t) (rename.c_str()); 417 418 // rename = "in_BRANCH_COMPLETE_ADDRESS_" +toString(i); 419 // in_BRANCH_COMPLETE_ADDRESS [i] = new SC_IN (Taddress_t) (rename.c_str()); 420 421 // if (_param._have_bht) 422 // { 423 // rename = "in_BRANCH_COMPLETE_BHT_HISTORY_"+toString(i); 424 // in_BRANCH_COMPLETE_BHT_HISTORY [i] = new SC_IN (Tbht_history_t) (rename.c_str()); 425 // } 426 // if (_param._have_pht) 427 // { 428 // rename = "in_BRANCH_COMPLETE_PHT_HISTORY_"+toString(i); 429 // in_BRANCH_COMPLETE_PHT_HISTORY [i] = new SC_IN (Tpht_history_t) (rename.c_str()); 430 // } 431 // rename = "in_BRANCH_COMPLETE_DIRECTION_" +toString(i); 432 // in_BRANCH_COMPLETE_DIRECTION [i] = new SC_IN (Tcontrol_t) (rename.c_str()); 433 // // if (_param._have_bht) 434 // // { 435 // // rename = "signal_BRANCH_COMPLETE_BHT_ACK_" +toString(i); 436 // // signal_BRANCH_COMPLETE_BHT_ACK [i] = new SC_SIGNAL(Tcontrol_t) (rename.c_str()); 437 438 // // rename = "signal_BRANCH_COMPLETE_BHT_ADDRESS_"+toString(i); 439 // // signal_BRANCH_COMPLETE_BHT_ADDRESS [i] = new SC_SIGNAL(Taddress_t) (rename.c_str()); 440 // // } 441 // // if (_param._have_pht) 442 // // { 443 // // rename = "signal_BRANCH_COMPLETE_PHT_ACK_" +toString(i); 444 // // signal_BRANCH_COMPLETE_PHT_ACK [i] = new SC_SIGNAL(Tcontrol_t) (rename.c_str()); 445 446 // // rename = "signal_BRANCH_COMPLETE_PHT_ADDRESS_"+toString(i); 447 // // signal_BRANCH_COMPLETE_PHT_ADDRESS [i] = new SC_SIGNAL(Taddress_t) (rename.c_str()); 448 // // } 449 // } 450 451 // // ~~~~~[ Component ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 452 // string name_component; 453 454 // // =====[ component_Branch_History_Table ]============================ 455 // if (_param._have_bht) 456 // { 457 // name_component = _name+"_Branch_History_Table"; 458 459 // log_printf(INFO,Two_Level_Branch_Predictor,"allocation","Allocation : %s",name_component.c_str()); 460 461 // component_Branch_History_Table = new morpheo::behavioural::stage_1_ifetch::predictor::meta_predictor::two_level_branch_predictor::branch_history_table ::Branch_History_Table (name_component.c_str() , 462 // #ifdef STATISTICS 463 // _param_statistics , 464 // #endif 465 // *(_param._param_branch_history_table)); 466 467 // // Instantiation 468 // (*(component_Branch_History_Table->in_CLOCK )) (*(in_CLOCK )); 469 // (*(component_Branch_History_Table->in_NRESET)) (*(in_NRESET)); 470 471 // for (uint32_t i=0; i<_param._nb_prediction; i++) 472 // { 473 // (*(component_Branch_History_Table-> in_PREDICT_VAL [i])) (*( in_PREDICT_VAL [i])); 474 // (*(component_Branch_History_Table->out_PREDICT_ACK [i])) (*(signal_PREDICT_BHT_ACK [i])); 475 // (*(component_Branch_History_Table-> in_PREDICT_ADDRESS [i])) (*(signal_PREDICT_BHT_ADDRESS [i])); 476 // (*(component_Branch_History_Table->out_PREDICT_HISTORY [i])) (*( out_PREDICT_BHT_HISTORY [i])); 477 // } 478 479 // for (uint32_t i=0; i<_param._nb_branch_complete; i++) 480 // { 481 // (*(component_Branch_History_Table-> in_BRANCH_COMPLETE_VAL [i])) (*( in_BRANCH_COMPLETE_VAL [i])); 482 // (*(component_Branch_History_Table->out_BRANCH_COMPLETE_ACK [i])) (*(signal_BRANCH_COMPLETE_BHT_ACK [i])); 483 // (*(component_Branch_History_Table-> in_BRANCH_COMPLETE_ADDRESS [i])) (*(signal_BRANCH_COMPLETE_BHT_ADDRESS [i])); 484 // (*(component_Branch_History_Table-> in_BRANCH_COMPLETE_HISTORY [i])) (*( in_BRANCH_COMPLETE_BHT_HISTORY [i])); 485 // (*(component_Branch_History_Table-> in_BRANCH_COMPLETE_DIRECTION [i])) (*( in_BRANCH_COMPLETE_DIRECTION [i])); 486 // } 487 // } 488 489 // // =====[ component_Pattern_History_Table ]=========================== 490 // if (_param._have_pht) 491 // { 492 // name_component = _name+"_Pattern_History_Table"; 493 494 // log_printf(INFO,Two_Level_Branch_Predictor,"allocation","Allocation : %s",name_component.c_str()); 495 496 // component_Pattern_History_Table = new morpheo::behavioural::stage_1_ifetch::predictor::meta_predictor::two_level_branch_predictor::pattern_history_table::Pattern_History_Table (name_component.c_str() , 497 // #ifdef STATISTICS 498 // _param_statistics , 499 // #endif 500 // *(_param._param_pattern_history_table)); 501 502 // // Instantiation 503 // (*(component_Pattern_History_Table->in_CLOCK)) (*(in_CLOCK)); 504 // (*(component_Pattern_History_Table->in_NRESET)) (*(in_NRESET)); 505 506 // for (uint32_t i=0; i<_param._nb_prediction; i++) 507 // { 508 // (*(component_Pattern_History_Table-> in_PREDICT_VAL [i])) (*( in_PREDICT_VAL [i])); 509 // (*(component_Pattern_History_Table->out_PREDICT_ACK [i])) (*(signal_PREDICT_PHT_ACK [i])); 510 // (*(component_Pattern_History_Table-> in_PREDICT_ADDRESS [i])) (*(signal_PREDICT_PHT_ADDRESS [i])); 511 // (*(component_Pattern_History_Table->out_PREDICT_HISTORY [i])) (*( out_PREDICT_PHT_HISTORY [i])); 512 // } 513 514 // for (uint32_t i=0; i<_param._nb_branch_complete; i++) 515 // { 516 // (*(component_Pattern_History_Table-> in_BRANCH_COMPLETE_VAL [i])) (*( in_BRANCH_COMPLETE_VAL [i])); 517 // (*(component_Pattern_History_Table->out_BRANCH_COMPLETE_ACK [i])) (*(signal_BRANCH_COMPLETE_PHT_ACK [i])); 518 // (*(component_Pattern_History_Table-> in_BRANCH_COMPLETE_ADDRESS [i])) (*(signal_BRANCH_COMPLETE_PHT_ADDRESS [i])); 519 // (*(component_Pattern_History_Table-> in_BRANCH_COMPLETE_HISTORY [i])) (*( in_BRANCH_COMPLETE_PHT_HISTORY [i])); 520 // (*(component_Pattern_History_Table-> in_BRANCH_COMPLETE_DIRECTION [i])) (*( in_BRANCH_COMPLETE_DIRECTION [i])); 521 // } 522 // } 523 524 // // =====[ component_Two_Level_Branch_Predictor_Glue ]=========================== 525 // name_component = _name+"_Two_Level_Branch_Predictor_Glue"; 526 527 // log_printf(INFO,Two_Level_Branch_Predictor,"allocation","Allocation : %s",name_component.c_str()); 528 529 // component_Two_Level_Branch_Predictor_Glue = new morpheo::behavioural::stage_1_ifetch::predictor::meta_predictor::two_level_branch_predictor::two_level_branch_predictor_glue::Two_Level_Branch_Predictor_Glue (name_component.c_str() , 530 // #ifdef STATISTICS 531 // _param_statistics , 532 // #endif 533 // *(_param._param_two_level_branch_predictor_glue)); 534 535 // // Instantiation 536 // #if defined(STATISTICS) or defined(VHDL_TESTBENCH) 537 // (*(component_Two_Level_Branch_Predictor_Glue->in_CLOCK)) (*(in_CLOCK)); 538 // #endif 539 // for (uint32_t i=0; i<_param._nb_prediction; i++) 540 // { 541 // if (_param._have_bht) 542 // { 543 // (*(component_Two_Level_Branch_Predictor_Glue-> in_PREDICT_BHT_ACK [i])) (*(signal_PREDICT_BHT_ACK [i])); 544 // (*(component_Two_Level_Branch_Predictor_Glue->out_PREDICT_BHT_ADDRESS [i])) (*(signal_PREDICT_BHT_ADDRESS [i])); 545 // } 546 // if (_param._have_pht) 547 // { 548 // (*(component_Two_Level_Branch_Predictor_Glue-> in_PREDICT_PHT_ACK [i])) (*(signal_PREDICT_PHT_ACK [i])); 549 // (*(component_Two_Level_Branch_Predictor_Glue->out_PREDICT_PHT_ADDRESS [i])) (*(signal_PREDICT_PHT_ADDRESS [i])); 550 // } 551 // if (_param._have_bht and _param._have_pht) 552 // { 553 // (*(component_Two_Level_Branch_Predictor_Glue-> in_PREDICT_BHT_HISTORY [i])) (*( out_PREDICT_BHT_HISTORY [i])); 554 // } 555 // (*(component_Two_Level_Branch_Predictor_Glue->out_PREDICT_ACK [i])) (*( out_PREDICT_ACK [i])); 556 // (*(component_Two_Level_Branch_Predictor_Glue-> in_PREDICT_ADDRESS [i])) (*( in_PREDICT_ADDRESS [i])); 557 // } 558 559 // for (uint32_t i=0; i<_param._nb_branch_complete; i++) 560 // { 561 // if (_param._have_bht) 562 // { 563 // (*(component_Two_Level_Branch_Predictor_Glue-> in_BRANCH_COMPLETE_BHT_ACK [i])) (*(signal_BRANCH_COMPLETE_BHT_ACK [i])); 564 // (*(component_Two_Level_Branch_Predictor_Glue->out_BRANCH_COMPLETE_BHT_ADDRESS [i])) (*(signal_BRANCH_COMPLETE_BHT_ADDRESS [i])); 565 // } 566 // if (_param._have_pht) 567 // { 568 // (*(component_Two_Level_Branch_Predictor_Glue-> in_BRANCH_COMPLETE_PHT_ACK [i])) (*(signal_BRANCH_COMPLETE_PHT_ACK [i])); 569 // (*(component_Two_Level_Branch_Predictor_Glue->out_BRANCH_COMPLETE_PHT_ADDRESS [i])) (*(signal_BRANCH_COMPLETE_PHT_ADDRESS [i])); 570 // } 571 // if (_param._have_bht and _param._have_pht) 572 // { 573 // (*(component_Two_Level_Branch_Predictor_Glue-> in_BRANCH_COMPLETE_BHT_HISTORY [i])) (*( in_BRANCH_COMPLETE_BHT_HISTORY [i])); 574 // } 575 // (*(component_Two_Level_Branch_Predictor_Glue->out_BRANCH_COMPLETE_ACK [i])) (*( out_BRANCH_COMPLETE_ACK [i])); 576 // (*(component_Two_Level_Branch_Predictor_Glue-> in_BRANCH_COMPLETE_ADDRESS [i])) (*( in_BRANCH_COMPLETE_ADDRESS [i])); 577 // } 578 579 // log_printf(FUNC,Two_Level_Branch_Predictor,"allocation","End"); 580 // }; 277 581 278 582 }; // end namespace two_level_branch_predictor -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/src/Two_Level_Branch_Predictor_deallocation.cpp
r15 r42 23 23 delete in_NRESET; 24 24 25 for (uint32_t i=0; i<_param._nb_prediction; i++) 26 { 27 delete in_PREDICT_VAL [i]; 28 delete out_PREDICT_ACK [i]; 29 delete in_PREDICT_ADDRESS [i]; 30 if (_param._have_bht) 31 delete out_PREDICT_BHT_HISTORY [i]; 32 if (_param._have_pht) 33 delete out_PREDICT_PHT_HISTORY [i]; 34 if (_param._have_bht) 35 { 36 delete signal_PREDICT_BHT_ACK [i]; 37 delete signal_PREDICT_BHT_ADDRESS [i]; 38 } 39 if (_param._have_pht) 40 { 41 delete signal_PREDICT_PHT_ACK [i]; 42 delete signal_PREDICT_PHT_ADDRESS [i]; 43 } 25 delete [] in_PREDICT_VAL ; 26 delete [] out_PREDICT_ACK ; 27 delete [] in_PREDICT_ADDRESS ; 28 if (_param._have_bht) 29 delete [] out_PREDICT_BHT_HISTORY; 30 if (_param._have_pht) 31 delete [] out_PREDICT_PHT_HISTORY; 44 32 45 } 46 47 delete in_PREDICT_VAL ; 48 delete out_PREDICT_ACK ; 49 delete in_PREDICT_ADDRESS ; 33 delete [] in_BRANCH_COMPLETE_VAL ; 34 delete [] out_BRANCH_COMPLETE_ACK ; 35 delete [] in_BRANCH_COMPLETE_ADDRESS ; 50 36 if (_param._have_bht) 51 delete out_PREDICT_BHT_HISTORY;37 delete [] in_BRANCH_COMPLETE_BHT_HISTORY; 52 38 if (_param._have_pht) 53 delete out_PREDICT_PHT_HISTORY; 54 if (_param._have_bht) 55 { 56 delete signal_PREDICT_BHT_ACK ; 57 delete signal_PREDICT_BHT_ADDRESS; 58 } 59 if (_param._have_pht) 60 { 61 delete signal_PREDICT_PHT_ACK ; 62 delete signal_PREDICT_PHT_ADDRESS; 63 } 64 65 for (uint32_t i=0; i<_param._nb_branch_complete; i++) 66 { 67 delete in_BRANCH_COMPLETE_VAL [i]; 68 delete out_BRANCH_COMPLETE_ACK [i]; 69 delete in_BRANCH_COMPLETE_ADDRESS [i]; 70 if (_param._have_bht) 71 delete in_BRANCH_COMPLETE_BHT_HISTORY [i]; 72 if (_param._have_pht) 73 delete in_BRANCH_COMPLETE_PHT_HISTORY [i]; 74 delete in_BRANCH_COMPLETE_DIRECTION [i]; 75 if (_param._have_bht) 76 { 77 delete signal_BRANCH_COMPLETE_BHT_ACK [i]; 78 delete signal_BRANCH_COMPLETE_BHT_ADDRESS [i]; 79 } 80 if (_param._have_pht) 81 { 82 delete signal_BRANCH_COMPLETE_PHT_ACK [i]; 83 delete signal_BRANCH_COMPLETE_PHT_ADDRESS [i]; 84 } 85 } 86 87 delete in_BRANCH_COMPLETE_VAL ; 88 delete out_BRANCH_COMPLETE_ACK ; 89 delete in_BRANCH_COMPLETE_ADDRESS ; 90 if (_param._have_bht) 91 delete in_BRANCH_COMPLETE_BHT_HISTORY; 92 if (_param._have_pht) 93 delete in_BRANCH_COMPLETE_PHT_HISTORY; 94 delete in_BRANCH_COMPLETE_DIRECTION ; 95 if (_param._have_bht) 96 { 97 delete signal_BRANCH_COMPLETE_BHT_ACK ; 98 delete signal_BRANCH_COMPLETE_BHT_ADDRESS; 99 } 100 if (_param._have_pht) 101 { 102 delete signal_BRANCH_COMPLETE_PHT_ACK ; 103 delete signal_BRANCH_COMPLETE_PHT_ADDRESS; 104 } 39 delete [] in_BRANCH_COMPLETE_PHT_HISTORY; 40 delete [] in_BRANCH_COMPLETE_DIRECTION ; 105 41 106 42 // ~~~~~[ Component ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ … … 111 47 delete component_Pattern_History_Table; 112 48 delete component_Two_Level_Branch_Predictor_Glue; 49 delete _component; 113 50 114 51 log_printf(FUNC,Two_Level_Branch_Predictor,"deallocation","End"); -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/src/Two_Level_Branch_Predictor_vhdl.cpp
r3 r42 21 21 { 22 22 log_printf(FUNC,Two_Level_Branch_Predictor,"vhdl","Begin"); 23 Vhdl vhdl (_name);23 Vhdl * vhdl = new Vhdl (_name); 24 24 25 vhdl .set_library_work (_name + "_Pack");25 vhdl->set_library_work (_name + "_Pack"); 26 26 if (_param._have_bht) 27 vhdl .set_library_work (_name + "_Branch_History_Table_Pack");27 vhdl->set_library_work (_name + "_Branch_History_Table_Pack"); 28 28 if (_param._have_pht) 29 vhdl .set_library_work (_name + "_Pattern_History_Table_Pack");30 vhdl .set_library_work (_name + "_Two_Level_Branch_Predictor_Glue_Pack");29 vhdl->set_library_work (_name + "_Pattern_History_Table_Pack"); 30 vhdl->set_library_work (_name + "_Two_Level_Branch_Predictor_Glue_Pack"); 31 31 32 32 vhdl_port (vhdl); … … 34 34 vhdl_body (vhdl); 35 35 36 vhdl.generate_file(); 36 vhdl->generate_file(); 37 38 delete vhdl; 39 37 40 log_printf(FUNC,Two_Level_Branch_Predictor,"vhdl","End"); 38 41 -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/src/Two_Level_Branch_Predictor_vhdl_body.cpp
r15 r42 17 17 18 18 19 void Two_Level_Branch_Predictor::vhdl_body (Vhdl & vhdl)19 void Two_Level_Branch_Predictor::vhdl_body (Vhdl * & vhdl) 20 20 { 21 21 log_printf(FUNC,Two_Level_Branch_Predictor,"vhdl_body","Begin"); -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/src/Two_Level_Branch_Predictor_vhdl_declaration.cpp
r3 r42 17 17 18 18 19 void Two_Level_Branch_Predictor::vhdl_declaration (Vhdl & vhdl)19 void Two_Level_Branch_Predictor::vhdl_declaration (Vhdl * & vhdl) 20 20 { 21 21 log_printf(FUNC,Two_Level_Branch_Predictor,"vhdl_declaration","Begin"); … … 25 25 if (_param._have_bht) 26 26 { 27 vhdl .set_signal ("signal_PREDICT_BHT_ACK_"+toString(i), 1);28 vhdl .set_signal ("signal_PREDICT_BHT_ADDRESS_"+toString(i), _param._bht_size_address);29 vhdl .set_signal ("signal_PREDICT_BHT_HISTORY_"+toString(i), _param._bht_size_shifter);27 vhdl->set_signal ("signal_PREDICT_BHT_ACK_"+toString(i), 1); 28 vhdl->set_signal ("signal_PREDICT_BHT_ADDRESS_"+toString(i), _param._bht_size_address); 29 vhdl->set_signal ("signal_PREDICT_BHT_HISTORY_"+toString(i), _param._bht_size_shifter); 30 30 } 31 31 if (_param._have_pht) 32 32 { 33 vhdl .set_signal ("signal_PREDICT_PHT_ACK_"+toString(i), 1);34 vhdl .set_signal ("signal_PREDICT_PHT_ADDRESS_"+toString(i), _param._pht_size_address);33 vhdl->set_signal ("signal_PREDICT_PHT_ACK_"+toString(i), 1); 34 vhdl->set_signal ("signal_PREDICT_PHT_ADDRESS_"+toString(i), _param._pht_size_address); 35 35 } 36 36 } … … 40 40 if (_param._have_bht) 41 41 { 42 vhdl .set_signal ("signal_BRANCH_COMPLETE_BHT_ACK_"+toString(i), 1);43 vhdl .set_signal ("signal_BRANCH_COMPLETE_BHT_ADDRESS_"+toString(i), _param._bht_size_address);42 vhdl->set_signal ("signal_BRANCH_COMPLETE_BHT_ACK_"+toString(i), 1); 43 vhdl->set_signal ("signal_BRANCH_COMPLETE_BHT_ADDRESS_"+toString(i), _param._bht_size_address); 44 44 } 45 45 if (_param._have_pht) 46 46 { 47 vhdl .set_signal ("signal_BRANCH_COMPLETE_PHT_ACK_"+toString(i), 1);48 vhdl .set_signal ("signal_BRANCH_COMPLETE_PHT_ADDRESS_"+toString(i), _param._pht_size_address);47 vhdl->set_signal ("signal_BRANCH_COMPLETE_PHT_ACK_"+toString(i), 1); 48 vhdl->set_signal ("signal_BRANCH_COMPLETE_PHT_ADDRESS_"+toString(i), _param._pht_size_address); 49 49 } 50 50 } -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/src/Two_Level_Branch_Predictor_vhdl_port.cpp
r15 r42 16 16 namespace two_level_branch_predictor { 17 17 18 void Two_Level_Branch_Predictor::vhdl_port (Vhdl & vhdl)18 void Two_Level_Branch_Predictor::vhdl_port (Vhdl * & vhdl) 19 19 { 20 20 log_printf(FUNC,Two_Level_Branch_Predictor,"vhdl_port","Begin"); 21 21 22 vhdl.set_port (" in_CLOCK ", IN, 1); 23 vhdl.set_port (" in_NRESET", IN, 1); 24 25 for (uint32_t i=0; i<_param._nb_prediction; i++) 26 { 27 vhdl.set_port (" in_PREDICT_VAL_"+toString(i)+" ", IN, 1); 28 vhdl.set_port ("out_PREDICT_ACK_"+toString(i)+" ",OUT, 1); 29 vhdl.set_port (" in_PREDICT_ADDRESS_"+toString(i)+" ", IN,_param._size_address); 30 if (_param._have_bht) 31 vhdl.set_port ("out_PREDICT_BHT_HISTORY_"+toString(i)+" ",OUT,_param._bht_size_shifter); 32 if (_param._have_pht) 33 vhdl.set_port ("out_PREDICT_PHT_HISTORY_"+toString(i)+" ",OUT,_param._pht_size_counter); 34 } 35 36 for (uint32_t i=0; i<_param._nb_branch_complete; i++) 37 { 38 vhdl.set_port (" in_BRANCH_COMPLETE_VAL_"+toString(i)+" ", IN, 1); 39 vhdl.set_port ("out_BRANCH_COMPLETE_ACK_"+toString(i)+" ",OUT, 1); 40 vhdl.set_port (" in_BRANCH_COMPLETE_ADDRESS_"+toString(i)+" ", IN,_param._size_address); 41 if (_param._have_bht) 42 vhdl.set_port (" in_BRANCH_COMPLETE_BHT_HISTORY_"+toString(i)+"", IN,_param._bht_size_shifter); 43 if (_param._have_pht) 44 vhdl.set_port (" in_BRANCH_COMPLETE_PHT_HISTORY_"+toString(i)+"", IN,_param._pht_size_counter); 45 vhdl.set_port (" in_BRANCH_COMPLETE_DIRECTION_"+toString(i)+" ", IN, 1); 46 } 22 _interfaces->set_port(vhdl); 47 23 48 24 log_printf(FUNC,Two_Level_Branch_Predictor,"vhdl_port","End"); -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/src/Two_Level_Branch_Predictor_vhdl_testbench_transition.cpp
r15 r42 21 21 log_printf(FUNC,Two_Level_Branch_Predictor,"vhdl_testbench_transition","Begin"); 22 22 23 #ifndef SYSTEMCASS_SPECIFIC 24 sc_cycle(0); 25 #endif 23 sc_start(0); 26 24 27 _vhdl_testbench->add_input (PORT_READ( in_NRESET)); 28 29 // In order with file Two_Level_Branch_Predictor_vhdl_testbench_port.cpp 30 // Warning : if a output depend of a subcomponent, take directly the port of subcomponent 31 // (because we have no control on the ordonnancer's policy) 32 33 for (uint32_t i=0; i<_param._nb_prediction; i++) 34 { 35 _vhdl_testbench->add_input (PORT_READ( in_PREDICT_VAL [i])); 36 _vhdl_testbench->add_output(PORT_READ(component_Two_Level_Branch_Predictor_Glue-> 37 out_PREDICT_ACK [i])); 38 _vhdl_testbench->add_input (PORT_READ( in_PREDICT_ADDRESS [i])); 39 if (_param._have_bht) 40 _vhdl_testbench->add_output(PORT_READ(component_Branch_History_Table -> 41 component_RegisterFile -> 42 out_READ_DATA [i])); 43 if (_param._have_pht) 44 _vhdl_testbench->add_output(PORT_READ(component_Pattern_History_Table -> 45 component_RegisterFile -> 46 out_READ_DATA [i])); 47 } 48 49 for (uint32_t i=0; i<_param._nb_branch_complete; i++) 50 { 51 _vhdl_testbench->add_input (PORT_READ( in_BRANCH_COMPLETE_VAL [i])); 52 _vhdl_testbench->add_output(PORT_READ(component_Two_Level_Branch_Predictor_Glue-> 53 out_BRANCH_COMPLETE_ACK [i])); 54 _vhdl_testbench->add_input (PORT_READ( in_BRANCH_COMPLETE_ADDRESS [i])); 55 if (_param._have_bht) 56 _vhdl_testbench->add_input (PORT_READ( in_BRANCH_COMPLETE_BHT_HISTORY [i])); 57 if (_param._have_pht) 58 _vhdl_testbench->add_input (PORT_READ( in_BRANCH_COMPLETE_PHT_HISTORY [i])); 59 _vhdl_testbench->add_input (PORT_READ( in_BRANCH_COMPLETE_DIRECTION [i])); 60 } 61 62 // add_test : 63 // - True : the cycle must be compare with the output of systemC 64 // - False : no test 65 _vhdl_testbench->add_test(true); 66 67 _vhdl_testbench->new_cycle (); // always at the end 25 _interfaces->testbench(); 68 26 69 27 log_printf(FUNC,Two_Level_Branch_Predictor,"vhdl_testbench_transition","End");
Note: See TracChangeset
for help on using the changeset viewer.