Changeset 44 for trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Meta_Predictor_Glue
- Timestamp:
- Jul 17, 2007, 4:47:56 PM (17 years ago)
- Location:
- trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Meta_Predictor_Glue
- Files:
-
- 1 added
- 3 deleted
- 13 edited
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Meta_Predictor_Glue/SelfTest/config0.cfg
r43 r44 13 13 0 1 +1 # predictor_2_have_pht 14 14 4 4 +1 # predictor_2_pht_size_counter 15 1 1+1 # nb_prediction16 1 1+1 # nb_branch_complete15 2 2 +1 # nb_prediction 16 2 2 +1 # nb_branch_complete -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Meta_Predictor_Glue/SelfTest/src/test.cpp
r5 r44 10 10 11 11 #include "Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Meta_Predictor_Glue/SelfTest/include/test.h" 12 #include " Include/Test.h"12 #include "Common/include/Test.h" 13 13 14 14 void test (string name, … … 28 28 *********************************************************************/ 29 29 sc_clock * CLOCK; 30 sc_signal<Tcontrol_t> * NRESET; 30 31 31 32 // Interface Predict … … 65 66 66 67 #if defined(STATISTICS) or defined(VHDL_TESTBENCH) 67 CLOCK = new sc_clock ("clock", 1.0, 0.5); 68 CLOCK = new sc_clock ("clock", 1.0, 0.5); 69 NRESET = new sc_signal<Tcontrol_t> ("nreset"); 68 70 #endif 69 71 … … 170 172 #if defined(STATISTICS) or defined(VHDL_TESTBENCH) 171 173 (*(_Meta_Predictor_Glue->in_CLOCK)) (*(CLOCK)); 174 (*(_Meta_Predictor_Glue->in_NRESET)) (*(NRESET)); 172 175 #endif 173 176 … … 252 255 253 256 sc_start(0); 254 _Meta_Predictor_Glue->vhdl_testbench_label("Initialisation");255 257 cout << "{"+toString(static_cast<uint32_t>(sc_simulation_time()))+"} Initialisation" << endl; 256 258 259 NRESET->write(0); 260 sc_start(5); 261 NRESET->write(1); 257 262 // No need initialisation 258 263 259 _Meta_Predictor_Glue->vhdl_testbench_label("Loop of Test");260 264 cout << "{"+toString(static_cast<uint32_t>(sc_simulation_time()))+"} Loop of Test" << endl; 261 265 … … 282 286 //uint32_t shift_6 = shift_5 + _param._predictor_2_pht_size_counter; 283 287 288 cout << "shift_0 : " << shift_0 << endl; 289 cout << "shift_1 : " << shift_1 << endl; 290 cout << "shift_2 : " << shift_2 << endl; 291 cout << "shift_3 : " << shift_3 << endl; 292 cout << "shift_4 : " << shift_4 << endl; 293 cout << "shift_5 : " << shift_5 << endl; 294 284 295 for (uint32_t iteration=0; iteration<NB_ITERATION; iteration ++) 285 296 { 286 _Meta_Predictor_Glue->vhdl_testbench_label("Iteration "+toString(iteration));287 297 288 298 for (uint32_t i=0; i<_param._nb_prediction; i++) … … 365 375 BRANCH_COMPLETE_PREDICTOR_2_ACK [i] ->write (predictor_2_ack); 366 376 367 branch_complete_predictor_0_bht_history [i] = rand() % ( _param._predictor_0_bht_size_shifter+1);368 branch_complete_predictor_0_pht_history [i] = rand() % ( _param._predictor_0_pht_size_counter+1);369 branch_complete_predictor_1_bht_history [i] = rand() % ( _param._predictor_1_bht_size_shifter+1);370 branch_complete_predictor_1_pht_history [i] = rand() % ( _param._predictor_1_pht_size_counter+1);371 branch_complete_predictor_2_bht_history [i] = rand() % ( _param._predictor_2_bht_size_shifter+1);372 branch_complete_predictor_2_pht_history [i] = rand() % ( _param._predictor_2_pht_size_counter+1);377 branch_complete_predictor_0_bht_history [i] = rand() % (1<<_param._predictor_0_bht_size_shifter); 378 branch_complete_predictor_0_pht_history [i] = rand() % (1<<_param._predictor_0_pht_size_counter); 379 branch_complete_predictor_1_bht_history [i] = rand() % (1<<_param._predictor_1_bht_size_shifter); 380 branch_complete_predictor_1_pht_history [i] = rand() % (1<<_param._predictor_1_pht_size_counter); 381 branch_complete_predictor_2_bht_history [i] = rand() % (1<<_param._predictor_2_bht_size_shifter); 382 branch_complete_predictor_2_pht_history [i] = rand() % (1<<_param._predictor_2_pht_size_counter); 373 383 374 BRANCH_COMPLETE_HISTORY [i]->write((branch_complete_predictor_0_bht_history [i] << shift_0) | 375 (branch_complete_predictor_0_pht_history [i] << shift_1) | 376 (branch_complete_predictor_1_bht_history [i] << shift_2) | 377 (branch_complete_predictor_1_pht_history [i] << shift_3) | 378 (branch_complete_predictor_2_bht_history [i] << shift_4) | 379 (branch_complete_predictor_2_pht_history [i] << shift_5) ); 384 Thistory_t history = ((branch_complete_predictor_0_bht_history [i] << shift_0) | 385 (branch_complete_predictor_0_pht_history [i] << shift_1) | 386 (branch_complete_predictor_1_bht_history [i] << shift_2) | 387 (branch_complete_predictor_1_pht_history [i] << shift_3) | 388 (branch_complete_predictor_2_bht_history [i] << shift_4) | 389 (branch_complete_predictor_2_pht_history [i] << shift_5) ); 390 391 BRANCH_COMPLETE_HISTORY [i]->write (history); 392 393 cout << "<test> [" << i << "] : " << endl 394 << hex 395 << " * " << history << endl 396 << " - " << branch_complete_predictor_0_bht_history [i] << endl 397 << " - " << branch_complete_predictor_0_pht_history [i] << endl 398 << " - " << branch_complete_predictor_1_bht_history [i] << endl 399 << " - " << branch_complete_predictor_1_pht_history [i] << endl 400 << " - " << branch_complete_predictor_2_bht_history [i] << endl 401 << " - " << branch_complete_predictor_2_pht_history [i] << endl 402 << dec; 380 403 381 404 Tcontrol_t direction_0 = ((_param._predictor_0_have_pht)?(branch_complete_predictor_0_pht_history [i] >> (_param._predictor_0_pht_size_counter-1)):(branch_complete_predictor_0_bht_history [i] >> (_param._predictor_0_bht_size_shifter-1)))&1; -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Meta_Predictor_Glue/include/Meta_Predictor_Glue.h
r5 r44 14 14 15 15 #include <iostream> 16 #include " Include/ToString.h"17 #include " Include/Debug.h"16 #include "Common/include/ToString.h" 17 #include "Common/include/Debug.h" 18 18 19 19 #include "Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Meta_Predictor_Glue/include/Parameters.h" … … 25 25 #include "Behavioural/include/Vhdl.h" 26 26 #endif 27 #ifdef VHDL_TESTBENCH 28 #include "Behavioural/include/Vhdl_Testbench.h" 29 #endif 27 #include "Behavioural/include/Component.h" 30 28 31 29 using namespace std; … … 57 55 #endif 58 56 59 #ifdef VHDL_TESTBENCH 60 private : Vhdl_Testbench * _vhdl_testbench; 61 #endif 57 public : Component * _component; 58 private : Interfaces * _interfaces; 62 59 63 60 #ifdef SYSTEMC … … 65 62 // Interface 66 63 public : SC_CLOCK * in_CLOCK ; 64 public : SC_IN (Tcontrol_t) * in_NRESET ; 67 65 68 66 // Interface Predict … … 146 144 #if VHDL 147 145 public : void vhdl (void); 148 private : void vhdl_port (Vhdl & vhdl); 149 private : void vhdl_declaration (Vhdl & vhdl); 150 private : void vhdl_body (Vhdl & vhdl); 146 private : void vhdl_declaration (Vhdl * & vhdl); 147 private : void vhdl_body (Vhdl * & vhdl); 151 148 #endif 152 153 149 #ifdef VHDL_TESTBENCH 154 private : void vhdl_testbench_port (void);155 150 private : void vhdl_testbench_transition (void); 156 151 #endif 157 public : void vhdl_testbench_label (string label);158 152 }; 159 153 -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Meta_Predictor_Glue/include/Parameters.h
r5 r44 9 9 */ 10 10 11 #include " Include/Debug.h"11 #include "Common/include/Debug.h" 12 12 #include "Behavioural/include/Parameters.h" 13 13 #include <math.h> -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Meta_Predictor_Glue/include/Statistics.h
r4 r44 10 10 */ 11 11 12 #include " Include/Debug.h"12 #include "Common/include/Debug.h" 13 13 #include "Behavioural/include/Statistics.h" 14 14 #include "Behavioural/include/Parameters_Statistics.h" -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Meta_Predictor_Glue/include/Types.h
r4 r44 10 10 */ 11 11 12 #include " Include/Types.h"12 #include "Common/include/Types.h" 13 13 14 14 namespace morpheo { -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Meta_Predictor_Glue/src/Meta_Predictor_Glue.cpp
r5 r44 33 33 log_printf(FUNC,Meta_Predictor_Glue,"Meta_Predictor_Glue","Begin"); 34 34 35 log_printf(INFO,Meta_Predictor_Glue,"Meta_Predictor_Glue","Allocation"); 36 allocation (); 37 35 38 #ifdef STATISTICS 36 39 log_printf(INFO,Meta_Predictor_Glue,"Meta_Predictor_Glue","Allocation of statistics"); … … 42 45 #endif 43 46 44 #ifdef VHDL_TESTBENCH45 // Creation of a testbench46 // -> port47 // -> clock's signals48 log_printf(INFO,Meta_Predictor_Glue,"Meta_Predictor_Glue","Creation of a testbench");49 _vhdl_testbench = new Vhdl_Testbench (_name);50 vhdl_testbench_port ();51 _vhdl_testbench->set_clock ("in_CLOCK",false);52 #endif53 54 47 #ifdef VHDL 55 48 // generate the vhdl … … 59 52 60 53 #ifdef SYSTEMC 61 log_printf(INFO,Meta_Predictor_Glue,"Meta_Predictor_Glue","Allocation");62 allocation ();63 64 54 #if defined(STATISTICS) or defined(VHDL_TESTBENCH) 65 55 log_printf(INFO,Meta_Predictor_Glue,"Meta_Predictor_Glue","method - transition"); … … 259 249 log_printf(FUNC,Meta_Predictor_Glue,"~Meta_Predictor_Glue","Begin"); 260 250 261 #ifdef VHDL_TESTBENCH262 log_printf(INFO,Meta_Predictor_Glue,"~Meta_Predictor_Glue","Generate Testbench");263 // generate the test bench264 _vhdl_testbench->generate_file();265 delete _vhdl_testbench;266 #endif267 268 251 #ifdef STATISTICS 269 252 log_printf(INFO,Meta_Predictor_Glue,"~Meta_Predictor_Glue","Generate Statistics"); -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Meta_Predictor_Glue/src/Meta_Predictor_Glue_allocation.cpp
r5 r44 23 23 log_printf(FUNC,Meta_Predictor_Glue,"allocation","Begin"); 24 24 25 #if defined(STATISTICS) or defined(VHDL_TESTBENCH) 26 in_CLOCK = new SC_CLOCK ("in_CLOCK"); 27 #endif 28 29 // Interface Predict 25 _component = new Component (); 26 27 Entity * entity = _component->set_entity (_name 28 ,"Two_Level_Branch_Predictor_Glue" 29 #ifdef POSITION 30 ,COMBINATORY 31 #endif 32 ); 33 34 _interfaces = entity->set_interfaces(); 35 36 // ~~~~~[ Interface : "" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 37 { 38 Interface * interface = _interfaces->set_interface("" 39 #ifdef POSITION 40 , IN 41 , SOUTH 42 , "Generalist interface" 43 #endif 44 ); 45 46 in_CLOCK = interface->set_signal_clk ("clock" ,1,CLOCK_VHDL_NO); 47 in_NRESET = interface->set_signal_in <Tcontrol_t> ("nreset",1,RESET_VHDL_NO); 48 } 49 50 51 // ~~~~~[ Interface : "Predict" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 30 52 31 53 if (_param._have_meta_predictor) … … 56 78 for (uint32_t i=0; i<_param._nb_prediction; i++) 57 79 { 58 if (_param._have_meta_predictor) 59 { 60 rename = " in_PREDICT_PREDICTOR_0_ACK_" +toString(i); 61 in_PREDICT_PREDICTOR_0_ACK [i] = new SC_IN (Tcontrol_t) (rename.c_str()); 80 Interface_fifo * interface = _interfaces->set_interface("predict_"+toString(i) 81 #ifdef POSITION 82 , IN 83 , WEST 84 , "Interface Predict" 85 #endif 86 ); 87 88 if (_param._have_meta_predictor) 89 { 90 in_PREDICT_PREDICTOR_0_ACK [i] = interface->set_signal_in <Tcontrol_t> ("predictor_0_ack" , 1); 91 in_PREDICT_PREDICTOR_1_ACK [i] = interface->set_signal_in <Tcontrol_t> ("predictor_1_ack" , 1); 92 } 93 in_PREDICT_PREDICTOR_2_ACK [i] = interface->set_signal_in <Tcontrol_t> ("predictor_2_ack" , 1); 62 94 63 rename = " in_PREDICT_PREDICTOR_1_ACK_" +toString(i); 64 in_PREDICT_PREDICTOR_1_ACK [i] = new SC_IN (Tcontrol_t) (rename.c_str()); 65 } 66 rename = " in_PREDICT_PREDICTOR_2_ACK_" +toString(i); 67 in_PREDICT_PREDICTOR_2_ACK [i] = new SC_IN (Tcontrol_t) (rename.c_str()); 68 69 rename = "out_PREDICT_ACK_" +toString(i); 70 out_PREDICT_ACK [i] = new SC_OUT(Tcontrol_t) (rename.c_str()); 95 out_PREDICT_ACK [i] = interface->set_signal_out <Tcontrol_t> ("ack" , 1); 71 96 72 97 if (_param._have_meta_predictor) 73 98 { 74 99 if (_param._predictor_0_have_bht) 75 { 76 rename = " in_PREDICT_PREDICTOR_0_BHT_HISTORY_"+toString(i); 77 in_PREDICT_PREDICTOR_0_BHT_HISTORY [i] = new SC_IN (Tbht_history_t) (rename.c_str()); 78 } 100 in_PREDICT_PREDICTOR_0_BHT_HISTORY [i] = interface->set_signal_in <Tbht_history_t> ("predictor_0_bht_history", _param._predictor_0_bht_size_shifter); 79 101 if (_param._predictor_0_have_pht) 80 { 81 rename = " in_PREDICT_PREDICTOR_0_PHT_HISTORY_"+toString(i); 82 in_PREDICT_PREDICTOR_0_PHT_HISTORY [i] = new SC_IN (Tpht_history_t) (rename.c_str()); 83 } 102 in_PREDICT_PREDICTOR_0_PHT_HISTORY [i] = interface->set_signal_in <Tpht_history_t> ("predictor_0_pht_history", _param._predictor_0_pht_size_counter); 84 103 if (_param._predictor_1_have_bht) 85 { 86 rename = " in_PREDICT_PREDICTOR_1_BHT_HISTORY_"+toString(i); 87 in_PREDICT_PREDICTOR_1_BHT_HISTORY [i] = new SC_IN (Tbht_history_t) (rename.c_str()); 88 } 104 in_PREDICT_PREDICTOR_1_BHT_HISTORY [i] = interface->set_signal_in <Tbht_history_t> ("predictor_1_bht_history", _param._predictor_1_bht_size_shifter); 89 105 if (_param._predictor_1_have_pht) 90 { 91 rename = " in_PREDICT_PREDICTOR_1_PHT_HISTORY_"+toString(i); 92 in_PREDICT_PREDICTOR_1_PHT_HISTORY [i] = new SC_IN (Tpht_history_t) (rename.c_str()); 93 } 106 in_PREDICT_PREDICTOR_1_PHT_HISTORY [i] = interface->set_signal_in <Tpht_history_t> ("predictor_1_pht_history", _param._predictor_1_pht_size_counter); 94 107 } 95 108 if (_param._predictor_2_have_bht) 96 { 97 rename = " in_PREDICT_PREDICTOR_2_BHT_HISTORY_"+toString(i); 98 in_PREDICT_PREDICTOR_2_BHT_HISTORY [i] = new SC_IN (Tbht_history_t) (rename.c_str()); 99 } 109 in_PREDICT_PREDICTOR_2_BHT_HISTORY [i] = interface->set_signal_in <Tbht_history_t> ("predictor_2_bht_history", _param._predictor_2_bht_size_shifter); 100 110 if (_param._predictor_2_have_pht) 101 { 102 rename = " in_PREDICT_PREDICTOR_2_PHT_HISTORY_"+toString(i); 103 in_PREDICT_PREDICTOR_2_PHT_HISTORY [i] = new SC_IN (Tpht_history_t) (rename.c_str()); 104 } 105 rename = "out_PREDICT_HISTORY_" +toString(i); 106 out_PREDICT_HISTORY [i] = new SC_OUT(Thistory_t) (rename.c_str()); 107 108 rename = "out_PREDICT_DIRECTION_" +toString(i); 109 out_PREDICT_DIRECTION [i] = new SC_OUT(Tcontrol_t) (rename.c_str()); 110 } 111 112 // Interface Branch_complete 111 in_PREDICT_PREDICTOR_2_PHT_HISTORY [i] = interface->set_signal_in <Tpht_history_t> ("predictor_2_pht_history", _param._predictor_2_pht_size_counter); 112 out_PREDICT_HISTORY [i] = interface->set_signal_out <Thistory_t> ("history" , _param._size_history); 113 out_PREDICT_DIRECTION [i] = interface->set_signal_out <Tcontrol_t> ("direction" , 1); 114 } 115 116 // ~~~~~[ Interface : "branch_complete" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 113 117 114 118 if (_param._have_meta_predictor) … … 145 149 for (uint32_t i=0; i<_param._nb_branch_complete; i++) 146 150 { 147 if (_param._have_meta_predictor) 148 { 149 rename = " in_BRANCH_COMPLETE_VAL_" +toString(i); 150 in_BRANCH_COMPLETE_VAL [i] = new SC_IN (Tcontrol_t) (rename.c_str()); 151 152 rename = "out_BRANCH_COMPLETE_PREDICTOR_2_VAL_" +toString(i); 153 out_BRANCH_COMPLETE_PREDICTOR_2_VAL [i] = new SC_OUT(Tcontrol_t) (rename.c_str()); 154 155 rename = " in_BRANCH_COMPLETE_PREDICTOR_0_ACK_" +toString(i); 156 in_BRANCH_COMPLETE_PREDICTOR_0_ACK [i] = new SC_IN (Tcontrol_t) (rename.c_str()); 157 158 rename = " in_BRANCH_COMPLETE_PREDICTOR_1_ACK_" +toString(i); 159 in_BRANCH_COMPLETE_PREDICTOR_1_ACK [i] = new SC_IN (Tcontrol_t) (rename.c_str()); 160 } 161 rename = " in_BRANCH_COMPLETE_PREDICTOR_2_ACK_" +toString(i); 162 in_BRANCH_COMPLETE_PREDICTOR_2_ACK [i] = new SC_IN (Tcontrol_t) (rename.c_str()); 163 164 rename = "out_BRANCH_COMPLETE_ACK_" +toString(i); 165 out_BRANCH_COMPLETE_ACK [i] = new SC_OUT(Tcontrol_t) (rename.c_str()); 166 151 Interface_fifo * interface = _interfaces->set_interface("branch_complete_"+toString(i) 152 #ifdef POSITION 153 , IN 154 , EAST 155 , "Interface branch complete" 156 #endif 157 ); 158 159 if (_param._have_meta_predictor) 160 { 161 in_BRANCH_COMPLETE_VAL [i] = interface->set_signal_in <Tcontrol_t> ("val" , 1); 162 out_BRANCH_COMPLETE_PREDICTOR_2_VAL [i] = interface->set_signal_out <Tcontrol_t> ("predictor_2_val", 1); 163 in_BRANCH_COMPLETE_PREDICTOR_0_ACK [i] = interface->set_signal_in <Tcontrol_t> ("predictor_0_ack", 1); 164 in_BRANCH_COMPLETE_PREDICTOR_1_ACK [i] = interface->set_signal_in <Tcontrol_t> ("predictor_1_ack", 1); 165 } 166 in_BRANCH_COMPLETE_PREDICTOR_2_ACK [i] = interface->set_signal_in <Tcontrol_t> ("predictor_2_ack" , 1); 167 out_BRANCH_COMPLETE_ACK [i] = interface->set_signal_out <Tcontrol_t> ("ack" , 1); 167 168 if (_param._have_meta_predictor) 168 169 { 169 170 if (_param._predictor_0_have_bht) 170 { 171 rename = "out_BRANCH_COMPLETE_PREDICTOR_0_BHT_HISTORY_"+toString(i); 172 out_BRANCH_COMPLETE_PREDICTOR_0_BHT_HISTORY [i] = new SC_OUT(Tbht_history_t) (rename.c_str()); 173 } 171 out_BRANCH_COMPLETE_PREDICTOR_0_BHT_HISTORY [i] = interface->set_signal_out <Tbht_history_t> ("predictor_0_bht_history" , _param._predictor_0_bht_size_shifter ); 174 172 if (_param._predictor_0_have_pht) 175 { 176 rename = "out_BRANCH_COMPLETE_PREDICTOR_0_PHT_HISTORY_"+toString(i); 177 out_BRANCH_COMPLETE_PREDICTOR_0_PHT_HISTORY [i] = new SC_OUT(Tpht_history_t) (rename.c_str()); 178 } 173 out_BRANCH_COMPLETE_PREDICTOR_0_PHT_HISTORY [i] = interface->set_signal_out <Tpht_history_t> ("predictor_0_pht_history" , _param._predictor_0_pht_size_counter); 179 174 if (_param._predictor_1_have_bht) 180 { 181 rename = "out_BRANCH_COMPLETE_PREDICTOR_1_BHT_HISTORY_"+toString(i); 182 out_BRANCH_COMPLETE_PREDICTOR_1_BHT_HISTORY [i] = new SC_OUT(Tbht_history_t) (rename.c_str()); 183 } 175 out_BRANCH_COMPLETE_PREDICTOR_1_BHT_HISTORY [i] = interface->set_signal_out <Tbht_history_t> ("predictor_1_bht_history" , _param._predictor_1_bht_size_shifter ); 184 176 if (_param._predictor_1_have_pht) 185 { 186 rename = "out_BRANCH_COMPLETE_PREDICTOR_1_PHT_HISTORY_"+toString(i); 187 out_BRANCH_COMPLETE_PREDICTOR_1_PHT_HISTORY [i] = new SC_OUT(Tpht_history_t) (rename.c_str()); 188 } 177 out_BRANCH_COMPLETE_PREDICTOR_1_PHT_HISTORY [i] = interface->set_signal_out <Tpht_history_t> ("predictor_1_pht_history" , _param._predictor_1_pht_size_counter ); 189 178 } 190 179 if (_param._predictor_2_have_bht) 191 { 192 rename = "out_BRANCH_COMPLETE_PREDICTOR_2_BHT_HISTORY_"+toString(i); 193 out_BRANCH_COMPLETE_PREDICTOR_2_BHT_HISTORY [i] = new SC_OUT(Tbht_history_t) (rename.c_str()); 194 } 180 out_BRANCH_COMPLETE_PREDICTOR_2_BHT_HISTORY [i] = interface->set_signal_out <Tbht_history_t> ("predictor_2_bht_history" , _param._predictor_2_bht_size_shifter); 195 181 if (_param._predictor_2_have_pht) 196 { 197 rename = "out_BRANCH_COMPLETE_PREDICTOR_2_PHT_HISTORY_"+toString(i); 198 out_BRANCH_COMPLETE_PREDICTOR_2_PHT_HISTORY [i] = new SC_OUT(Tpht_history_t) (rename.c_str()); 199 } 200 rename = " in_BRANCH_COMPLETE_HISTORY_" +toString(i); 201 in_BRANCH_COMPLETE_HISTORY [i] = new SC_IN (Thistory_t) (rename.c_str()); 202 203 if (_param._have_meta_predictor) 204 { 205 rename = " in_BRANCH_COMPLETE_DIRECTION_" +toString(i); 206 in_BRANCH_COMPLETE_DIRECTION [i] = new SC_IN (Tcontrol_t) (rename.c_str()); 207 208 rename = "out_BRANCH_COMPLETE_PREDICTOR_2_DIRECTION_" +toString(i); 209 out_BRANCH_COMPLETE_PREDICTOR_2_DIRECTION [i] = new SC_OUT(Tcontrol_t) (rename.c_str()); 182 out_BRANCH_COMPLETE_PREDICTOR_2_PHT_HISTORY [i] = interface->set_signal_out <Tpht_history_t> ("predictor_2_pht_history" , _param._predictor_2_pht_size_counter); 183 in_BRANCH_COMPLETE_HISTORY [i] = interface->set_signal_in <Thistory_t> ("history" , _param._size_history); 184 if (_param._have_meta_predictor) 185 { 186 in_BRANCH_COMPLETE_DIRECTION [i] = interface->set_signal_in <Tcontrol_t> ("direction" , 1); 187 out_BRANCH_COMPLETE_PREDICTOR_2_DIRECTION [i] = interface->set_signal_out <Tcontrol_t> ("predictor_2_direction" , 1); 210 188 } 211 189 } 212 190 // ~~~~~[ Component ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 191 192 #ifdef POSITION 193 _component->generate_file(); 194 #endif 213 195 214 196 log_printf(FUNC,Meta_Predictor_Glue,"allocation","End"); -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Meta_Predictor_Glue/src/Meta_Predictor_Glue_deallocation.cpp
r5 r44 21 21 log_printf(FUNC,Meta_Predictor_Glue,"deallocation","Begin"); 22 22 23 #if defined(STATISTICS) or defined(VHDL_TESTBENCH) 24 delete in_CLOCK; 25 #endif 26 27 // Interface Predict 28 for (uint32_t i=0; i<_param._nb_prediction; i++) 29 { 30 if (_param._have_meta_predictor) 31 { 32 delete in_PREDICT_PREDICTOR_0_ACK [i]; 33 delete in_PREDICT_PREDICTOR_1_ACK [i]; 34 } 35 delete in_PREDICT_PREDICTOR_2_ACK [i]; 36 delete out_PREDICT_ACK [i]; 37 if (_param._have_meta_predictor) 38 { 39 if (_param._predictor_0_have_bht) 40 delete in_PREDICT_PREDICTOR_0_BHT_HISTORY [i]; 41 if (_param._predictor_0_have_pht) 42 delete in_PREDICT_PREDICTOR_0_PHT_HISTORY [i]; 43 if (_param._predictor_1_have_bht) 44 delete in_PREDICT_PREDICTOR_1_BHT_HISTORY [i]; 45 if (_param._predictor_1_have_pht) 46 delete in_PREDICT_PREDICTOR_1_PHT_HISTORY [i]; 47 } 48 if (_param._predictor_2_have_bht) 49 delete in_PREDICT_PREDICTOR_2_BHT_HISTORY [i]; 50 if (_param._predictor_2_have_pht) 51 delete in_PREDICT_PREDICTOR_2_PHT_HISTORY [i]; 52 delete out_PREDICT_HISTORY [i]; 53 delete out_PREDICT_DIRECTION [i]; 54 } 23 delete in_CLOCK; 24 delete in_NRESET; 55 25 56 26 if (_param._have_meta_predictor) 57 27 { 58 delete in_PREDICT_PREDICTOR_0_ACK;59 delete in_PREDICT_PREDICTOR_1_ACK;28 delete [] in_PREDICT_PREDICTOR_0_ACK; 29 delete [] in_PREDICT_PREDICTOR_1_ACK; 60 30 } 61 delete in_PREDICT_PREDICTOR_2_ACK;62 delete out_PREDICT_ACK ;31 delete [] in_PREDICT_PREDICTOR_2_ACK; 32 delete [] out_PREDICT_ACK ; 63 33 if (_param._have_meta_predictor) 64 34 { 65 35 if (_param._predictor_0_have_bht) 66 delete in_PREDICT_PREDICTOR_0_BHT_HISTORY;36 delete [] in_PREDICT_PREDICTOR_0_BHT_HISTORY; 67 37 if (_param._predictor_0_have_pht) 68 delete in_PREDICT_PREDICTOR_0_PHT_HISTORY;38 delete [] in_PREDICT_PREDICTOR_0_PHT_HISTORY; 69 39 if (_param._predictor_1_have_bht) 70 delete in_PREDICT_PREDICTOR_1_BHT_HISTORY;40 delete [] in_PREDICT_PREDICTOR_1_BHT_HISTORY; 71 41 if (_param._predictor_1_have_pht) 72 delete in_PREDICT_PREDICTOR_1_PHT_HISTORY ;42 delete [] in_PREDICT_PREDICTOR_1_PHT_HISTORY ; 73 43 } 74 44 if (_param._predictor_2_have_bht) 75 delete in_PREDICT_PREDICTOR_2_BHT_HISTORY ;45 delete [] in_PREDICT_PREDICTOR_2_BHT_HISTORY ; 76 46 if (_param._predictor_2_have_pht) 77 delete in_PREDICT_PREDICTOR_2_PHT_HISTORY ; 78 delete out_PREDICT_HISTORY ; 79 delete out_PREDICT_DIRECTION ; 80 81 // Interface Branch_complete 82 for (uint32_t i=0; i<_param._nb_branch_complete; i++) 83 { 84 if (_param._have_meta_predictor) 85 { 86 delete in_BRANCH_COMPLETE_VAL [i]; 87 delete out_BRANCH_COMPLETE_PREDICTOR_2_VAL [i]; 88 89 delete in_BRANCH_COMPLETE_PREDICTOR_0_ACK [i]; 90 delete in_BRANCH_COMPLETE_PREDICTOR_1_ACK [i]; 91 } 92 delete in_BRANCH_COMPLETE_PREDICTOR_2_ACK [i]; 93 delete out_BRANCH_COMPLETE_ACK [i]; 94 95 if (_param._have_meta_predictor) 96 { 97 if (_param._predictor_0_have_bht) 98 delete out_BRANCH_COMPLETE_PREDICTOR_0_BHT_HISTORY [i]; 99 if (_param._predictor_0_have_pht) 100 delete out_BRANCH_COMPLETE_PREDICTOR_0_PHT_HISTORY [i]; 101 if (_param._predictor_1_have_bht) 102 delete out_BRANCH_COMPLETE_PREDICTOR_1_BHT_HISTORY [i]; 103 if (_param._predictor_1_have_pht) 104 delete out_BRANCH_COMPLETE_PREDICTOR_1_PHT_HISTORY [i]; 105 } 106 if (_param._predictor_2_have_bht) 107 delete out_BRANCH_COMPLETE_PREDICTOR_2_BHT_HISTORY [i]; 108 if (_param._predictor_2_have_pht) 109 delete out_BRANCH_COMPLETE_PREDICTOR_2_PHT_HISTORY [i]; 110 delete in_BRANCH_COMPLETE_HISTORY [i]; 111 if (_param._have_meta_predictor) 112 { 113 delete in_BRANCH_COMPLETE_DIRECTION [i]; 114 delete out_BRANCH_COMPLETE_PREDICTOR_2_DIRECTION [i]; 115 } 116 } 47 delete [] in_PREDICT_PREDICTOR_2_PHT_HISTORY ; 48 delete [] out_PREDICT_HISTORY ; 49 delete [] out_PREDICT_DIRECTION ; 117 50 118 51 if (_param._have_meta_predictor) 119 52 { 120 delete in_BRANCH_COMPLETE_VAL ;121 delete out_BRANCH_COMPLETE_PREDICTOR_2_VAL ;53 delete [] in_BRANCH_COMPLETE_VAL ; 54 delete [] out_BRANCH_COMPLETE_PREDICTOR_2_VAL ; 122 55 123 delete in_BRANCH_COMPLETE_PREDICTOR_0_ACK ;124 delete in_BRANCH_COMPLETE_PREDICTOR_1_ACK ;56 delete [] in_BRANCH_COMPLETE_PREDICTOR_0_ACK ; 57 delete [] in_BRANCH_COMPLETE_PREDICTOR_1_ACK ; 125 58 } 126 delete in_BRANCH_COMPLETE_PREDICTOR_2_ACK ;127 delete out_BRANCH_COMPLETE_ACK ;59 delete [] in_BRANCH_COMPLETE_PREDICTOR_2_ACK ; 60 delete [] out_BRANCH_COMPLETE_ACK ; 128 61 if (_param._have_meta_predictor) 129 62 { 130 63 if (_param._predictor_0_have_bht) 131 delete out_BRANCH_COMPLETE_PREDICTOR_0_BHT_HISTORY ;64 delete [] out_BRANCH_COMPLETE_PREDICTOR_0_BHT_HISTORY ; 132 65 if (_param._predictor_0_have_pht) 133 delete out_BRANCH_COMPLETE_PREDICTOR_0_PHT_HISTORY ;66 delete [] out_BRANCH_COMPLETE_PREDICTOR_0_PHT_HISTORY ; 134 67 if (_param._predictor_1_have_bht) 135 delete out_BRANCH_COMPLETE_PREDICTOR_1_BHT_HISTORY ;68 delete [] out_BRANCH_COMPLETE_PREDICTOR_1_BHT_HISTORY ; 136 69 if (_param._predictor_1_have_pht) 137 delete out_BRANCH_COMPLETE_PREDICTOR_1_PHT_HISTORY ;70 delete [] out_BRANCH_COMPLETE_PREDICTOR_1_PHT_HISTORY ; 138 71 } 139 72 if (_param._predictor_2_have_bht) 140 delete out_BRANCH_COMPLETE_PREDICTOR_2_BHT_HISTORY ;73 delete [] out_BRANCH_COMPLETE_PREDICTOR_2_BHT_HISTORY ; 141 74 if (_param._predictor_2_have_pht) 142 delete out_BRANCH_COMPLETE_PREDICTOR_2_PHT_HISTORY ;143 delete in_BRANCH_COMPLETE_HISTORY ;75 delete [] out_BRANCH_COMPLETE_PREDICTOR_2_PHT_HISTORY ; 76 delete [] in_BRANCH_COMPLETE_HISTORY ; 144 77 if (_param._have_meta_predictor) 145 78 { 146 delete in_BRANCH_COMPLETE_DIRECTION ;147 delete out_BRANCH_COMPLETE_PREDICTOR_2_DIRECTION ;79 delete [] in_BRANCH_COMPLETE_DIRECTION ; 80 delete [] out_BRANCH_COMPLETE_PREDICTOR_2_DIRECTION ; 148 81 } 149 82 // ~~~~~[ Component ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 83 delete _component; 150 84 151 85 log_printf(FUNC,Meta_Predictor_Glue,"deallocation","End"); -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Meta_Predictor_Glue/src/Meta_Predictor_Glue_genMealy_branch_complete_history.cpp
r5 r44 8 8 9 9 #include "Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Meta_Predictor_Glue/include/Meta_Predictor_Glue.h" 10 #include " Include/BitManipulation.h"10 #include "Common/include/BitManipulation.h" 11 11 12 12 namespace morpheo { … … 27 27 if (_param._have_meta_predictor) 28 28 { 29 if (_param._predictor_0_have_bht) 29 if (_param._predictor_0_have_bht) 30 30 PORT_WRITE(out_BRANCH_COMPLETE_PREDICTOR_0_BHT_HISTORY [i], (history >> _param._shift_0) & gen_mask<Tbht_history_t>(_param._predictor_0_bht_size_shifter)); 31 31 if (_param._predictor_0_have_pht) … … 34 34 35 35 if (_param._predictor_1_have_bht) 36 {37 36 PORT_WRITE(out_BRANCH_COMPLETE_PREDICTOR_1_BHT_HISTORY [i], (history >> _param._shift_2) & gen_mask<Tbht_history_t>(_param._predictor_1_bht_size_shifter)); 38 39 37 if (_param._predictor_1_have_pht) 40 38 PORT_WRITE(out_BRANCH_COMPLETE_PREDICTOR_1_PHT_HISTORY [i], (history >> _param._shift_3) & gen_mask<Tpht_history_t>(_param._predictor_1_pht_size_counter)); 41 }42 39 43 40 if (_param._predictor_2_have_bht) -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Meta_Predictor_Glue/src/Meta_Predictor_Glue_vhdl.cpp
r4 r44 21 21 { 22 22 log_printf(FUNC,Meta_Predictor_Glue,"vhdl","Begin"); 23 Vhdl vhdl (_name);24 23 25 vhdl.set_library_work (_name + "_Pack");24 Vhdl * vhdl = new Vhdl (_name); 26 25 27 vhdl_port (vhdl); 26 _interfaces->set_port (vhdl); 27 _component ->vhdl_instance(vhdl); 28 28 29 vhdl_declaration (vhdl); 29 30 vhdl_body (vhdl); 30 31 31 vhdl.generate_file(); 32 vhdl->generate_file(); 33 34 delete vhdl; 35 32 36 log_printf(FUNC,Meta_Predictor_Glue,"vhdl","End"); 33 37 }; -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Meta_Predictor_Glue/src/Meta_Predictor_Glue_vhdl_body.cpp
r5 r44 17 17 18 18 19 void Meta_Predictor_Glue::vhdl_body (Vhdl & vhdl)19 void Meta_Predictor_Glue::vhdl_body (Vhdl * & vhdl) 20 20 { 21 21 log_printf(FUNC,Meta_Predictor_Glue,"vhdl_body","Begin"); 22 vhdl .set_body ("");23 vhdl .set_body (" -- predict");22 vhdl->set_body (""); 23 vhdl->set_body (" -- predict"); 24 24 25 25 for (uint32_t i=0; i<_param._nb_prediction; i++) 26 26 { 27 string meta_predictor_ack = (_param._have_meta_predictor==true)?("in_PREDICT_ PREDICTOR_0_ACK_"+toString(i)+" and in_PREDICT_PREDICTOR_1_ACK_"+toString(i)):"'1'";27 string meta_predictor_ack = (_param._have_meta_predictor==true)?("in_PREDICT_"+toString(i)+"_PREDICTOR_0_ACK and in_PREDICT_"+toString(i)+"_PREDICTOR_1_ACK"):"'1'"; 28 28 29 vhdl .set_body ("out_PREDICT_ACK_"+toString(i)+" <= "+meta_predictor_ack+" and "+"in_PREDICT_PREDICTOR_2_ACK_"+toString(i)+";");29 vhdl->set_body ("out_PREDICT_"+toString(i)+"_ACK <= "+meta_predictor_ack+" and "+"in_PREDICT_"+toString(i)+"_PREDICTOR_2_ACK;"); 30 30 31 31 uint32_t index=_param._size_history; … … 34 34 if (_param._predictor_2_have_pht) 35 35 { 36 vhdl .set_body ("out_PREDICT_HISTORY_"+toString(i)+std_logic_range(index-1,index-_param._predictor_2_pht_size_counter)+" <= in_PREDICT_PREDICTOR_2_PHT_HISTORY_"+toString(i)+";");36 vhdl->set_body ("out_PREDICT_"+toString(i)+"_HISTORY"+std_logic_range(index-1,index-_param._predictor_2_pht_size_counter)+" <= in_PREDICT_"+toString(i)+"_PREDICTOR_2_PHT_HISTORY;"); 37 37 index-= _param._predictor_2_pht_size_counter; 38 38 } 39 39 if (_param._predictor_2_have_bht) 40 40 { 41 vhdl .set_body ("out_PREDICT_HISTORY_"+toString(i)+std_logic_range(index-1,index-_param._predictor_2_bht_size_shifter)+" <= in_PREDICT_PREDICTOR_2_BHT_HISTORY_"+toString(i)+";");41 vhdl->set_body ("out_PREDICT_"+toString(i)+"_HISTORY"+std_logic_range(index-1,index-_param._predictor_2_bht_size_shifter)+" <= in_PREDICT_"+toString(i)+"_PREDICTOR_2_BHT_HISTORY;"); 42 42 index-= _param._predictor_2_bht_size_shifter; 43 43 } … … 47 47 if (_param._predictor_1_have_pht) 48 48 { 49 vhdl .set_body ("out_PREDICT_HISTORY_"+toString(i)+std_logic_range(index-1,index-_param._predictor_1_pht_size_counter)+" <= in_PREDICT_PREDICTOR_1_PHT_HISTORY_"+toString(i)+";");49 vhdl->set_body ("out_PREDICT_"+toString(i)+"_HISTORY"+std_logic_range(index-1,index-_param._predictor_1_pht_size_counter)+" <= in_PREDICT_"+toString(i)+"_PREDICTOR_1_PHT_HISTORY;"); 50 50 index-= _param._predictor_1_pht_size_counter; 51 51 } 52 52 if (_param._predictor_1_have_bht) 53 53 { 54 vhdl .set_body ("out_PREDICT_HISTORY_"+toString(i)+std_logic_range(index-1,index-_param._predictor_1_bht_size_shifter)+" <= in_PREDICT_PREDICTOR_1_BHT_HISTORY_"+toString(i)+";");54 vhdl->set_body ("out_PREDICT_"+toString(i)+"_HISTORY"+std_logic_range(index-1,index-_param._predictor_1_bht_size_shifter)+" <= in_PREDICT_"+toString(i)+"_PREDICTOR_1_BHT_HISTORY;"); 55 55 index-= _param._predictor_1_bht_size_shifter; 56 56 } … … 58 58 if (_param._predictor_0_have_pht) 59 59 { 60 vhdl .set_body ("out_PREDICT_HISTORY_"+toString(i)+std_logic_range(index-1,index-_param._predictor_0_pht_size_counter)+" <= in_PREDICT_PREDICTOR_0_PHT_HISTORY_"+toString(i)+";");60 vhdl->set_body ("out_PREDICT_"+toString(i)+"_HISTORY"+std_logic_range(index-1,index-_param._predictor_0_pht_size_counter)+" <= in_PREDICT_"+toString(i)+"_PREDICTOR_0_PHT_HISTORY;"); 61 61 index-= _param._predictor_0_pht_size_counter; 62 62 } 63 63 if (_param._predictor_0_have_bht) 64 64 { 65 vhdl .set_body ("out_PREDICT_HISTORY_"+toString(i)+std_logic_range(index-1,index-_param._predictor_0_bht_size_shifter)+" <= in_PREDICT_PREDICTOR_0_BHT_HISTORY_"+toString(i)+";");65 vhdl->set_body ("out_PREDICT_"+toString(i)+"_HISTORY"+std_logic_range(index-1,index-_param._predictor_0_bht_size_shifter)+" <= in_PREDICT_"+toString(i)+"_PREDICTOR_0_BHT_HISTORY;"); 66 66 index-= _param._predictor_0_bht_size_shifter; 67 67 } … … 69 69 70 70 // direction of prediction 71 vhdl .set_body ("");71 vhdl->set_body (""); 72 72 if (_param._have_meta_predictor) 73 vhdl .set_body ("out_PREDICT_DIRECTION_"+toString(i)+" <= predict_predictor_0_direction_"+toString(i)+" when predict_predictor_2_direction_"+toString(i)+"='0' else predict_predictor_1_direction_"+toString(i)+";");73 vhdl->set_body ("out_PREDICT_"+toString(i)+"_DIRECTION <= predict_"+toString(i)+"_predictor_0_direction when predict_"+toString(i)+"_predictor_2_direction='0' else predict_"+toString(i)+"_predictor_1_direction;"); 74 74 else 75 vhdl .set_body ("out_PREDICT_DIRECTION_"+toString(i)+" <= predict_predictor_2_direction_"+toString(i)+";");75 vhdl->set_body ("out_PREDICT_"+toString(i)+"_DIRECTION <= predict_"+toString(i)+"_predictor_2_direction;"); 76 76 } 77 77 78 78 // Interface - branch_complete 79 79 80 vhdl .set_body ("");81 vhdl .set_body (" -- branch_complete");80 vhdl->set_body (""); 81 vhdl->set_body (" -- branch_complete"); 82 82 for (uint32_t i=0; i<_param._nb_branch_complete; i++) 83 83 { … … 85 85 if (_param._have_meta_predictor) 86 86 { 87 vhdl .set_body ("out_BRANCH_COMPLETE_PREDICTOR_2_VAL_"+toString(i)+" <= (branch_complete_predictor_0_direction_"+toString(i)+" xor branch_complete_predictor_1_direction_"+toString(i)+") and "+"in_BRANCH_COMPLETE_VAL_"+toString(i)+";");88 vhdl .set_body ("out_BRANCH_COMPLETE_PREDICTOR_2_DIRECTION_"+toString(i)+" <= (branch_complete_predictor_0_direction_"+toString(i)+" and not in_BRANCH_COMPLETE_DIRECTION_"+toString(i)+") or (branch_complete_predictor_1_direction_"+toString(i)+" and in_BRANCH_COMPLETE_DIRECTION_"+toString(i)+");");87 vhdl->set_body ("out_BRANCH_COMPLETE_"+toString(i)+"_PREDICTOR_2_VAL <= (branch_complete_"+toString(i)+"_predictor_0_direction xor branch_complete_"+toString(i)+"_predictor_1_direction) and "+"in_BRANCH_COMPLETE_"+toString(i)+"_VAL;"); 88 vhdl->set_body ("out_BRANCH_COMPLETE_"+toString(i)+"_PREDICTOR_2_DIRECTION <= (branch_complete_"+toString(i)+"_predictor_0_direction and not in_BRANCH_COMPLETE_"+toString(i)+"_DIRECTION) or (branch_complete_"+toString(i)+"_predictor_1_direction and in_BRANCH_COMPLETE_"+toString(i)+"_DIRECTION);"); 89 89 } 90 90 91 string meta_predictor_ack = (_param._have_meta_predictor==true)?("in_BRANCH_COMPLETE_ PREDICTOR_0_ACK_"+toString(i)+" and in_BRANCH_COMPLETE_PREDICTOR_1_ACK_"+toString(i)):"'1'";91 string meta_predictor_ack = (_param._have_meta_predictor==true)?("in_BRANCH_COMPLETE_"+toString(i)+"_PREDICTOR_0_ACK and in_BRANCH_COMPLETE_"+toString(i)+"_PREDICTOR_1_ACK"):"'1'"; 92 92 93 vhdl .set_body ("out_BRANCH_COMPLETE_ACK_"+toString(i)+" <= "+meta_predictor_ack+" and "+"in_BRANCH_COMPLETE_PREDICTOR_2_ACK_"+toString(i)+";");93 vhdl->set_body ("out_BRANCH_COMPLETE_"+toString(i)+"_ACK <= "+meta_predictor_ack+" and "+"in_BRANCH_COMPLETE_"+toString(i)+"_PREDICTOR_2_ACK;"); 94 94 95 95 uint32_t index=_param._size_history; … … 97 97 if (_param._predictor_2_have_pht) 98 98 { 99 vhdl .set_body ("out_BRANCH_COMPLETE_PREDICTOR_2_PHT_HISTORY_"+toString(i)+" <= in_BRANCH_COMPLETE_HISTORY_"+toString(i)+std_logic_range(index-1,index-_param._predictor_2_pht_size_counter)+";");99 vhdl->set_body ("out_BRANCH_COMPLETE_"+toString(i)+"_PREDICTOR_2_PHT_HISTORY <= in_BRANCH_COMPLETE_"+toString(i)+"_HISTORY"+std_logic_range(index-1,index-_param._predictor_2_pht_size_counter)+";"); 100 100 index-= _param._predictor_2_pht_size_counter; 101 101 } 102 102 if (_param._predictor_2_have_bht) 103 103 { 104 vhdl .set_body ("out_BRANCH_COMPLETE_PREDICTOR_2_BHT_HISTORY_"+toString(i)+" <= in_BRANCH_COMPLETE_HISTORY_"+toString(i)+std_logic_range(index-1,index-_param._predictor_2_bht_size_shifter)+";");104 vhdl->set_body ("out_BRANCH_COMPLETE_"+toString(i)+"_PREDICTOR_2_BHT_HISTORY <= in_BRANCH_COMPLETE_"+toString(i)+"_HISTORY"+std_logic_range(index-1,index-_param._predictor_2_bht_size_shifter)+";"); 105 105 index-= _param._predictor_2_bht_size_shifter; 106 106 } … … 110 110 if (_param._predictor_1_have_pht) 111 111 { 112 vhdl .set_body ("out_BRANCH_COMPLETE_PREDICTOR_1_PHT_HISTORY_"+toString(i)+" <= in_BRANCH_COMPLETE_HISTORY_"+toString(i)+std_logic_range(index-1,index-_param._predictor_1_pht_size_counter)+";");112 vhdl->set_body ("out_BRANCH_COMPLETE_"+toString(i)+"_PREDICTOR_1_PHT_HISTORY <= in_BRANCH_COMPLETE_"+toString(i)+"_HISTORY"+std_logic_range(index-1,index-_param._predictor_1_pht_size_counter)+";"); 113 113 index-= _param._predictor_1_pht_size_counter; 114 114 } 115 115 if (_param._predictor_1_have_bht) 116 116 { 117 vhdl .set_body ("out_BRANCH_COMPLETE_PREDICTOR_1_BHT_HISTORY_"+toString(i)+" <= in_BRANCH_COMPLETE_HISTORY_"+toString(i)+std_logic_range(index-1,index-_param._predictor_1_bht_size_shifter)+";");117 vhdl->set_body ("out_BRANCH_COMPLETE_"+toString(i)+"_PREDICTOR_1_BHT_HISTORY <= in_BRANCH_COMPLETE_"+toString(i)+"_HISTORY"+std_logic_range(index-1,index-_param._predictor_1_bht_size_shifter)+";"); 118 118 index-= _param._predictor_1_bht_size_shifter; 119 119 } … … 121 121 if (_param._predictor_0_have_pht) 122 122 { 123 vhdl .set_body ("out_BRANCH_COMPLETE_PREDICTOR_0_PHT_HISTORY_"+toString(i)+" <= in_BRANCH_COMPLETE_HISTORY_"+toString(i)+std_logic_range(index-1,index-_param._predictor_0_pht_size_counter)+";");123 vhdl->set_body ("out_BRANCH_COMPLETE_"+toString(i)+"_PREDICTOR_0_PHT_HISTORY <= in_BRANCH_COMPLETE_"+toString(i)+"_HISTORY"+std_logic_range(index-1,index-_param._predictor_0_pht_size_counter)+";"); 124 124 index-= _param._predictor_0_pht_size_counter; 125 125 } 126 126 if (_param._predictor_0_have_bht) 127 127 { 128 vhdl .set_body ("out_BRANCH_COMPLETE_PREDICTOR_0_BHT_HISTORY_"+toString(i)+" <= in_BRANCH_COMPLETE_HISTORY_"+toString(i)+std_logic_range(index-1,index-_param._predictor_0_bht_size_shifter)+";");128 vhdl->set_body ("out_BRANCH_COMPLETE_"+toString(i)+"_PREDICTOR_0_BHT_HISTORY <= in_BRANCH_COMPLETE_"+toString(i)+"_HISTORY"+std_logic_range(index-1,index-_param._predictor_0_bht_size_shifter)+";"); 129 129 index-= _param._predictor_0_bht_size_shifter; 130 130 } -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Meta_Predictor_Glue/src/Meta_Predictor_Glue_vhdl_declaration.cpp
r5 r44 17 17 18 18 19 void Meta_Predictor_Glue::vhdl_declaration (Vhdl & vhdl)19 void Meta_Predictor_Glue::vhdl_declaration (Vhdl * & vhdl) 20 20 { 21 21 log_printf(FUNC,Meta_Predictor_Glue,"vhdl_declaration","Begin"); … … 26 26 { 27 27 if (_param._predictor_0_have_pht) 28 vhdl .set_alias ("predict_predictor_0_direction_"+toString(i),std_logic(1), "in_PREDICT_PREDICTOR_0_PHT_HISTORY_"+toString(i),std_logic_range(_param._predictor_0_pht_size_counter-1,_param._predictor_0_pht_size_counter-1));28 vhdl->set_alias ("predict_"+toString(i)+"_predictor_0_direction",std_logic(1), "in_PREDICT_"+toString(i)+"_PREDICTOR_0_PHT_HISTORY",std_logic_range(_param._predictor_0_pht_size_counter-1,_param._predictor_0_pht_size_counter-1)); 29 29 else 30 vhdl .set_alias ("predict_predictor_0_direction_"+toString(i),std_logic(1), "in_PREDICT_PREDICTOR_0_BHT_HISTORY_"+toString(i),std_logic_range(_param._predictor_0_bht_size_shifter-1,_param._predictor_0_bht_size_shifter-1));30 vhdl->set_alias ("predict_"+toString(i)+"_predictor_0_direction",std_logic(1), "in_PREDICT_"+toString(i)+"_PREDICTOR_0_BHT_HISTORY",std_logic_range(_param._predictor_0_bht_size_shifter-1,_param._predictor_0_bht_size_shifter-1)); 31 31 if (_param._predictor_1_have_pht) 32 vhdl .set_alias ("predict_predictor_1_direction_"+toString(i),std_logic(1), "in_PREDICT_PREDICTOR_1_PHT_HISTORY_"+toString(i),std_logic_range(_param._predictor_1_pht_size_counter-1,_param._predictor_1_pht_size_counter-1));32 vhdl->set_alias ("predict_"+toString(i)+"_predictor_1_direction",std_logic(1), "in_PREDICT_"+toString(i)+"_PREDICTOR_1_PHT_HISTORY",std_logic_range(_param._predictor_1_pht_size_counter-1,_param._predictor_1_pht_size_counter-1)); 33 33 else 34 vhdl .set_alias ("predict_predictor_1_direction_"+toString(i),std_logic(1), "in_PREDICT_PREDICTOR_1_BHT_HISTORY_"+toString(i),std_logic_range(_param._predictor_1_bht_size_shifter-1,_param._predictor_1_bht_size_shifter-1));34 vhdl->set_alias ("predict_"+toString(i)+"_predictor_1_direction",std_logic(1), "in_PREDICT_"+toString(i)+"_PREDICTOR_1_BHT_HISTORY",std_logic_range(_param._predictor_1_bht_size_shifter-1,_param._predictor_1_bht_size_shifter-1)); 35 35 } 36 36 37 37 if (_param._predictor_2_have_pht) 38 vhdl .set_alias ("predict_predictor_2_direction_"+toString(i),std_logic(1), "in_PREDICT_PREDICTOR_2_PHT_HISTORY_"+toString(i),std_logic_range(_param._predictor_2_pht_size_counter-1,_param._predictor_2_pht_size_counter-1));38 vhdl->set_alias ("predict_"+toString(i)+"_predictor_2_direction",std_logic(1), "in_PREDICT_"+toString(i)+"_PREDICTOR_2_PHT_HISTORY",std_logic_range(_param._predictor_2_pht_size_counter-1,_param._predictor_2_pht_size_counter-1)); 39 39 else 40 vhdl .set_alias ("predict_predictor_2_direction_"+toString(i),std_logic(1), "in_PREDICT_PREDICTOR_2_BHT_HISTORY_"+toString(i),std_logic_range(_param._predictor_2_bht_size_shifter-1,_param._predictor_2_bht_size_shifter-1));40 vhdl->set_alias ("predict_"+toString(i)+"_predictor_2_direction",std_logic(1), "in_PREDICT_"+toString(i)+"_PREDICTOR_2_BHT_HISTORY",std_logic_range(_param._predictor_2_bht_size_shifter-1,_param._predictor_2_bht_size_shifter-1)); 41 41 } 42 42 … … 46 46 { 47 47 // if (_param._predictor_2_have_pht) 48 // vhdl .set_alias ("branch_complete_predictor_2_direction_"+toString(i),std_logic(1)," in_BRANCH_COMPLETE_HISTORY_"+toString(i),std_logic_range(_param._shift_6-1, _param._shift_6-1));48 // vhdl->set_alias ("branch_complete_"+toString(i)+"_predictor_2_direction",std_logic(1)," in_BRANCH_COMPLETE_"+toString(i)+"_HISTORY",std_logic_range(_param._shift_6-1, _param._shift_6-1)); 49 49 // else 50 // vhdl .set_alias ("branch_complete_predictor_2_direction_"+toString(i),std_logic(1)," in_BRANCH_COMPLETE_HISTORY_"+toString(i),std_logic_range(_param._shift_5-1, _param._shift_5-1));50 // vhdl->set_alias ("branch_complete_"+toString(i)+"_predictor_2_direction",std_logic(1)," in_BRANCH_COMPLETE_"+toString(i)+"_HISTORY",std_logic_range(_param._shift_5-1, _param._shift_5-1)); 51 51 52 52 if (_param._predictor_1_have_pht) 53 vhdl .set_alias ("branch_complete_predictor_1_direction_"+toString(i),std_logic(1)," in_BRANCH_COMPLETE_HISTORY_"+toString(i),std_logic_range(_param._shift_4-1, _param._shift_4-1));53 vhdl->set_alias ("branch_complete_"+toString(i)+"_predictor_1_direction",std_logic(1)," in_BRANCH_COMPLETE_"+toString(i)+"_HISTORY",std_logic_range(_param._shift_4-1, _param._shift_4-1)); 54 54 else 55 vhdl .set_alias ("branch_complete_predictor_1_direction_"+toString(i),std_logic(1)," in_BRANCH_COMPLETE_HISTORY_"+toString(i),std_logic_range(_param._shift_3-1, _param._shift_3-1));55 vhdl->set_alias ("branch_complete_"+toString(i)+"_predictor_1_direction",std_logic(1)," in_BRANCH_COMPLETE_"+toString(i)+"_HISTORY",std_logic_range(_param._shift_3-1, _param._shift_3-1)); 56 56 57 57 if (_param._predictor_0_have_pht) 58 vhdl .set_alias ("branch_complete_predictor_0_direction_"+toString(i),std_logic(1)," in_BRANCH_COMPLETE_HISTORY_"+toString(i),std_logic_range(_param._shift_2-1, _param._shift_2-1));58 vhdl->set_alias ("branch_complete_"+toString(i)+"_predictor_0_direction",std_logic(1)," in_BRANCH_COMPLETE_"+toString(i)+"_HISTORY",std_logic_range(_param._shift_2-1, _param._shift_2-1)); 59 59 else 60 vhdl .set_alias ("branch_complete_predictor_0_direction_"+toString(i),std_logic(1)," in_BRANCH_COMPLETE_HISTORY_"+toString(i),std_logic_range(_param._shift_1-1, _param._shift_1-1));60 vhdl->set_alias ("branch_complete_"+toString(i)+"_predictor_0_direction",std_logic(1)," in_BRANCH_COMPLETE_"+toString(i)+"_HISTORY",std_logic_range(_param._shift_1-1, _param._shift_1-1)); 61 61 62 62 } 63 63 } 64 65 66 64 67 65 log_printf(FUNC,Meta_Predictor_Glue,"vhdl_declaration","End"); -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Meta_Predictor_Glue/src/Meta_Predictor_Glue_vhdl_testbench_transition.cpp
r5 r44 21 21 log_printf(FUNC,Meta_Predictor_Glue,"vhdl_testbench_transition","Begin"); 22 22 23 // Evaluation before read the ouput signal 24 sc_start(0); 25 26 // In order with file Meta_Predictor_Glue_vhdl_testbench_port.cpp 27 // Warning : if a output depend of a subcomponent, take directly the port of subcomponent 28 // (because we have no control on the ordonnancer's policy) 29 30 for (uint32_t i=0; i<_param._nb_prediction; i++) 31 { 32 if (_param._have_meta_predictor) 33 { 34 _vhdl_testbench->add_input (PORT_READ( in_PREDICT_PREDICTOR_0_ACK [i])); 35 _vhdl_testbench->add_input (PORT_READ( in_PREDICT_PREDICTOR_1_ACK [i])); 36 } 37 _vhdl_testbench->add_input (PORT_READ( in_PREDICT_PREDICTOR_2_ACK [i])); 38 _vhdl_testbench->add_output(PORT_READ(out_PREDICT_ACK [i])); 39 40 if (_param._have_meta_predictor) 41 { 42 if (_param._predictor_0_have_bht) 43 _vhdl_testbench->add_input (PORT_READ( in_PREDICT_PREDICTOR_0_BHT_HISTORY [i])); 44 if (_param._predictor_0_have_pht) 45 _vhdl_testbench->add_input (PORT_READ( in_PREDICT_PREDICTOR_0_PHT_HISTORY [i])); 46 if (_param._predictor_1_have_bht) 47 _vhdl_testbench->add_input (PORT_READ( in_PREDICT_PREDICTOR_1_BHT_HISTORY [i])); 48 if (_param._predictor_1_have_pht) 49 _vhdl_testbench->add_input (PORT_READ( in_PREDICT_PREDICTOR_1_PHT_HISTORY [i])); 50 } 51 if (_param._predictor_2_have_bht) 52 _vhdl_testbench->add_input (PORT_READ( in_PREDICT_PREDICTOR_2_BHT_HISTORY [i])); 53 if (_param._predictor_2_have_pht) 54 _vhdl_testbench->add_input (PORT_READ( in_PREDICT_PREDICTOR_2_PHT_HISTORY [i])); 55 56 _vhdl_testbench->add_output(PORT_READ(out_PREDICT_HISTORY [i])); 57 _vhdl_testbench->add_output(PORT_READ(out_PREDICT_DIRECTION [i])); 58 } 59 60 for (uint32_t i=0; i<_param._nb_branch_complete; i++) 61 { 62 if (_param._have_meta_predictor) 63 { 64 _vhdl_testbench->add_input (PORT_READ( in_BRANCH_COMPLETE_VAL [i])); 65 _vhdl_testbench->add_output(PORT_READ(out_BRANCH_COMPLETE_PREDICTOR_2_VAL [i])); 66 67 _vhdl_testbench->add_input (PORT_READ( in_BRANCH_COMPLETE_PREDICTOR_0_ACK [i])); 68 _vhdl_testbench->add_input (PORT_READ( in_BRANCH_COMPLETE_PREDICTOR_1_ACK [i])); 69 } 70 _vhdl_testbench->add_input (PORT_READ( in_BRANCH_COMPLETE_PREDICTOR_2_ACK [i])); 71 _vhdl_testbench->add_output(PORT_READ(out_BRANCH_COMPLETE_ACK [i])); 72 73 if (_param._have_meta_predictor) 74 { 75 if (_param._predictor_0_have_bht) 76 _vhdl_testbench->add_output(PORT_READ(out_BRANCH_COMPLETE_PREDICTOR_0_BHT_HISTORY [i])); 77 if (_param._predictor_0_have_pht) 78 _vhdl_testbench->add_output(PORT_READ(out_BRANCH_COMPLETE_PREDICTOR_0_PHT_HISTORY [i])); 79 if (_param._predictor_1_have_bht) 80 _vhdl_testbench->add_output(PORT_READ(out_BRANCH_COMPLETE_PREDICTOR_1_BHT_HISTORY [i])); 81 if (_param._predictor_1_have_pht) 82 _vhdl_testbench->add_output(PORT_READ(out_BRANCH_COMPLETE_PREDICTOR_1_PHT_HISTORY [i])); 83 } 84 if (_param._predictor_2_have_bht) 85 _vhdl_testbench->add_output(PORT_READ(out_BRANCH_COMPLETE_PREDICTOR_2_BHT_HISTORY [i])); 86 if (_param._predictor_2_have_pht) 87 _vhdl_testbench->add_output(PORT_READ(out_BRANCH_COMPLETE_PREDICTOR_2_PHT_HISTORY [i])); 88 89 _vhdl_testbench->add_input (PORT_READ( in_BRANCH_COMPLETE_HISTORY [i])); 90 if (_param._have_meta_predictor) 91 { 92 _vhdl_testbench->add_input (PORT_READ( in_BRANCH_COMPLETE_DIRECTION [i])); 93 _vhdl_testbench->add_output(PORT_READ(out_BRANCH_COMPLETE_PREDICTOR_2_DIRECTION [i])); 94 } 95 } 96 97 // add_test : 98 // - True : the cycle must be compare with the output of systemC 99 // - False : no test 100 _vhdl_testbench->add_test(true); 101 102 _vhdl_testbench->new_cycle (); // always at the end 23 // sc_start(0); 24 _interfaces->testbench(); 103 25 104 26 log_printf(FUNC,Meta_Predictor_Glue,"vhdl_testbench_transition","End");
Note: See TracChangeset
for help on using the changeset viewer.