Changeset 44 for trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/SelfTest/src/test.cpp
- Timestamp:
- Jul 17, 2007, 4:47:56 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/SelfTest/src/test.cpp
r43 r44 10 10 11 11 #include "Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/SelfTest/include/test.h" 12 #include " Include/Test.h"13 #include " Include/BitManipulation.h"12 #include "Common/include/Test.h" 13 #include "Common/include/BitManipulation.h" 14 14 void test (string name, 15 15 morpheo::behavioural::stage_1_ifetch::predictor::meta_predictor::two_level_branch_predictor::Parameters param) … … 132 132 sc_start(0); 133 133 134 NRESET->write(0); 135 sc_start(5); 136 NRESET->write(1); 137 134 138 for (uint32_t i=0; i<param._nb_prediction; i++) 135 139 PREDICT_VAL [i]->write(0); … … 156 160 uint32_t nb_reg_by_group = (1<<(param._pht_size_address-size_address_shift)); 157 161 162 // cout << "pht_size_address : " << param._pht_size_address << endl; 163 // cout << "size_address_shift : " << size_address_shift << endl; 164 // cout << "nb_group : " << nb_group << endl; 165 // cout << "nb_reg_by_group : " << nb_reg_by_group << endl; 166 158 167 cout << "{"+toString(static_cast<uint32_t>(sc_simulation_time()))+"} Init pht" << endl; 159 168 … … 168 177 for (uint32_t j=0; j<nb_reg_by_group; j++) 169 178 { 179 cout << "j : " << j << " on " << nb_reg_by_group << endl; 170 180 BRANCH_COMPLETE_ADDRESS [num_port_branch_complete]->write(j); 171 181 172 182 sc_start(1); 173 183 174 184 // wait ackwolegde 175 185 while (BRANCH_COMPLETE_ACK [num_port_branch_complete] -> read() == 0) 176 sc_start(1); 186 { 187 sc_start(1); 188 } 177 189 } 178 190 } … … 195 207 // wait ackwolegde 196 208 while (BRANCH_COMPLETE_ACK [num_port_branch_complete] -> read() == 0) 197 sc_start(1); 209 { 210 sc_start(1); 211 } 198 212 } 199 213 … … 225 239 // wait ackwolegde 226 240 while (PREDICT_ACK [num_port_predict] -> read() == 0) 227 sc_start(1); 241 { 242 sc_start(1); 243 } 228 244 PREDICT_ACK [num_port_predict ]->write(0); 229 245 … … 231 247 232 248 // Test 249 cout << "{"+toString(static_cast<uint32_t>(sc_simulation_time()))+"} Predict (Test) : " << endl; 233 250 if (param._have_bht) 234 TEST(Tbht_history_t,bht_history ,PREDICT_BHT_HISTORY[num_port_predict]->read()); 251 { 252 cout << "\tbht_history " << PREDICT_BHT_HISTORY[num_port_predict]->read() << endl; 253 TEST(Tbht_history_t,bht_history ,PREDICT_BHT_HISTORY[num_port_predict]->read()); 254 } 235 255 if (param._have_pht) 236 TEST(Tpht_history_t,pht_history[bht_history],PREDICT_PHT_HISTORY[num_port_predict]->read()); 256 { 257 cout << "\tpht_history " << PREDICT_PHT_HISTORY[num_port_predict]->read() << endl; 258 TEST(Tpht_history_t,pht_history[bht_history],PREDICT_PHT_HISTORY[num_port_predict]->read()); 259 } 237 260 238 261 // update … … 267 290 // wait ackwolegde 268 291 while (BRANCH_COMPLETE_ACK [num_port_branch_complete] -> read() == 0) 269 sc_start(1); 270 292 { 293 sc_start(1); 294 } 271 295 BRANCH_COMPLETE_VAL [num_port_branch_complete]->write(0); 272 296 }
Note: See TracChangeset
for help on using the changeset viewer.