Changeset 42 for trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Pattern_History_Table
- 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/Pattern_History_Table
- Files:
-
- 2 deleted
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Pattern_History_Table/SelfTest/configuration.cfg
r2 r42 1 1 Pattern_History_Table 2 28 *2 # size_counter3 264 *4 # nb_counter4 12 +1 # nb_prediction5 12 +1 # nb_branch_complete2 8 8 *2 # size_counter 3 64 64 *4 # nb_counter 4 2 2 +1 # nb_prediction 5 2 2 +1 # nb_branch_complete -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Pattern_History_Table/SelfTest/mkf.info
r15 r42 1 2 # Pattern_History_Table_0 3 target_dep all Pattern_History_Table_0.ngc 4 target_dep Pattern_History_Table_0.ngc Pattern_History_Table_0.prj 5 target_dep Pattern_History_Table_0.prj Pattern_History_Table_0_Counter_Pack.vhdl Pattern_History_Table_0_Counter.vhdl Pattern_History_Table_0_Pack.vhdl Pattern_History_Table_0_RegisterFile_Pack.vhdl Pattern_History_Table_0_RegisterFile.vhdl Pattern_History_Table_0.vhdl 6 -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Pattern_History_Table/SelfTest/src/test.cpp
r15 r42 7 7 */ 8 8 9 #define NB_ITERATION 10249 #define NB_ITERATION 512 10 10 11 11 #include "Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Pattern_History_Table/SelfTest/include/test.h" … … 93 93 94 94 sc_start(0); 95 _Pattern_History_Table->vhdl_testbench_label("Initialisation");96 95 cout << "{"+toString(static_cast<uint32_t>(sc_simulation_time()))+"} Initialisation" << endl; 97 96 … … 127 126 sc_start(0); 128 127 129 _Pattern_History_Table->vhdl_testbench_label("Loop of Test");130 128 cout << "{"+toString(static_cast<uint32_t>(sc_simulation_time()))+"} Loop of Test" << endl; 131 129 132 130 for (uint32_t iteration=0; iteration<NB_ITERATION; iteration ++) 133 131 { 134 _Pattern_History_Table->vhdl_testbench_label("Iteration "+toString(iteration));135 132 num_port_branch_complete = rand() % param._nb_branch_complete; 136 133 num_port_predict = rand() % param._nb_prediction ; -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Pattern_History_Table/include/Pattern_History_Table.h
r15 r42 29 29 #include "Behavioural/include/Vhdl.h" 30 30 #endif 31 #ifdef VHDL_TESTBENCH 32 #include "Behavioural/include/Vhdl_Testbench.h" 33 #endif 31 #include "Behavioural/include/Component.h" 34 32 35 33 using namespace std; … … 62 60 #endif 63 61 64 #ifdef VHDL_TESTBENCH 65 private : Vhdl_Testbench * _vhdl_testbench; 66 #endif 62 public : Component * _component; 63 private : Interfaces * _interfaces; 67 64 68 65 #ifdef SYSTEMC … … 125 122 public : string statistics (uint32_t depth); 126 123 #endif 127 128 124 #if VHDL 129 125 public : void vhdl (void); 130 private : void vhdl_port (Vhdl & vhdl); 131 private : void vhdl_declaration (Vhdl & vhdl); 132 private : void vhdl_body (Vhdl & vhdl); 126 private : void vhdl_declaration (Vhdl * & vhdl); 127 private : void vhdl_body (Vhdl * & vhdl); 133 128 #endif 134 135 129 #ifdef VHDL_TESTBENCH 136 private : void vhdl_testbench_port (void);137 130 private : void vhdl_testbench_transition (void); 138 131 #endif 139 public : void vhdl_testbench_label (string label);140 132 }; 141 133 -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Pattern_History_Table/src/Pattern_History_Table.cpp
r15 r42 33 33 { 34 34 log_printf(FUNC,Pattern_History_Table,"Pattern_History_Table","Begin"); 35 35 36 #ifdef SYSTEMC 37 allocation (); 38 #endif 39 36 40 #ifdef STATISTICS 37 41 // Allocation of statistics … … 39 43 param_statistics , 40 44 param); 41 #endif42 43 #ifdef VHDL_TESTBENCH44 // Creation of a testbench45 // -> port46 // -> clock's signals47 _vhdl_testbench = new Vhdl_Testbench (_name);48 vhdl_testbench_port ();49 _vhdl_testbench->set_clock ("in_CLOCK",true);50 45 #endif 51 46 … … 56 51 57 52 #ifdef SYSTEMC 58 allocation ();59 60 53 // // Constant 61 54 // for (uint32_t i=0; i<_param._nb_prediction ; i++) … … 82 75 log_printf(FUNC,Pattern_History_Table,"~Pattern_History_Table","Begin"); 83 76 84 #ifdef VHDL_TESTBENCH85 // generate the test bench86 _vhdl_testbench->generate_file();87 delete _vhdl_testbench;88 #endif89 90 77 #ifdef STATISTICS 91 78 _stat->generate_file(statistics(0)); -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Pattern_History_Table/src/Pattern_History_Table_allocation.cpp
r15 r42 20 20 void Pattern_History_Table::allocation (void) 21 21 { 22 string rename;23 24 22 log_printf(FUNC,Pattern_History_Table,"allocation","Begin"); 25 23 26 in_CLOCK = new SC_CLOCK ("in_CLOCK"); 27 in_NRESET = new SC_IN (Tcontrol_t) ("in_NRESET"); 28 24 _component = new Component (); 25 26 Entity * entity = _component->set_entity (_name 27 ,"Pattern_History_Table" 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" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 29 50 in_PREDICT_VAL = new SC_IN (Tcontrol_t) * [_param._nb_prediction]; 30 51 out_PREDICT_ACK = new SC_OUT(Tcontrol_t) * [_param._nb_prediction]; … … 34 55 for (uint32_t i=0; i<_param._nb_prediction; i++) 35 56 { 36 rename = "in_PREDICT_VAL[" +toString(i)+"]"; 37 in_PREDICT_VAL [i] = new SC_IN (Tcontrol_t) (rename.c_str()); 38 39 rename = "out_PREDICT_ACK[" +toString(i)+"]"; 40 out_PREDICT_ACK [i] = new SC_OUT(Tcontrol_t) (rename.c_str()); 41 42 rename = "in_PREDICT_ADDRESS["+toString(i)+"]"; 43 in_PREDICT_ADDRESS [i] = new SC_IN (Taddress_t) (rename.c_str()); 44 45 rename = "out_PREDICT_HISTORY["+toString(i)+"]"; 46 out_PREDICT_HISTORY [i] = new SC_OUT(Thistory_t) (rename.c_str()); 47 } 57 Interface_fifo * interface = _interfaces->set_interface("predict_"+toString(i) 58 #ifdef POSITION 59 , IN 60 , WEST 61 , "Interface Predict" 62 #endif 63 ); 64 65 in_PREDICT_VAL [i] = interface->set_signal_valack_in ("val" , VAL); 66 out_PREDICT_ACK [i] = interface->set_signal_valack_out ("ack" , ACK); 67 in_PREDICT_ADDRESS [i] = interface->set_signal_in <Taddress_t> ("address", static_cast<uint32_t>(ceil(log2(_param._nb_counter)))); 68 out_PREDICT_HISTORY [i] = interface->set_signal_out <Thistory_t> ("history", _param._size_counter); 69 } 70 71 // ~~~~~[ Interface : "branch_complete" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 48 72 49 73 in_BRANCH_COMPLETE_VAL = new SC_IN (Tcontrol_t) * [_param._nb_branch_complete]; … … 52 76 in_BRANCH_COMPLETE_HISTORY = new SC_IN (Thistory_t) * [_param._nb_branch_complete]; 53 77 in_BRANCH_COMPLETE_DIRECTION = new SC_IN (Tcontrol_t) * [_param._nb_branch_complete]; 54 signal_BRANCH_COMPLETE_HISTORY = new SC_SIGNAL (Thistory_t) * [_param._nb_branch_complete];55 78 56 79 for (uint32_t i=0; i<_param._nb_branch_complete; i++) 57 80 { 58 rename = "in_BRANCH_COMPLETE_VAL[" +toString(i)+"]"; 59 in_BRANCH_COMPLETE_VAL [i] = new SC_IN (Tcontrol_t) (rename.c_str()); 60 61 rename = "out_BRANCH_COMPLETE_ACK[" +toString(i)+"]"; 62 out_BRANCH_COMPLETE_ACK [i] = new SC_OUT(Tcontrol_t) (rename.c_str()); 63 64 rename = "in_BRANCH_COMPLETE_ADDRESS["+toString(i)+"]"; 65 in_BRANCH_COMPLETE_ADDRESS [i] = new SC_IN (Taddress_t) (rename.c_str()); 66 67 rename = "in_BRANCH_COMPLETE_HISTORY["+toString(i)+"]"; 68 in_BRANCH_COMPLETE_HISTORY [i] = new SC_IN (Thistory_t) (rename.c_str()); 69 70 rename = "in_BRANCH_COMPLETE_DIRECTION[" +toString(i)+"]"; 71 in_BRANCH_COMPLETE_DIRECTION [i] = new SC_IN (Tcontrol_t) (rename.c_str()); 72 73 rename = "signal_BRANCH_COMPLETE_HISTORY["+toString(i)+"]"; 74 signal_BRANCH_COMPLETE_HISTORY [i] = new SC_SIGNAL (Thistory_t) (rename.c_str()); 75 76 } 77 81 Interface_fifo * interface = _interfaces->set_interface("branch_complete_"+toString(i) 82 #ifdef POSITION 83 , IN 84 , EAST 85 , "Interface branch complete" 86 #endif 87 ); 88 89 in_BRANCH_COMPLETE_VAL [i] = interface->set_signal_valack_in ("val" , VAL); 90 out_BRANCH_COMPLETE_ACK [i] = interface->set_signal_valack_out ("ack" , ACK); 91 in_BRANCH_COMPLETE_ADDRESS [i] = interface->set_signal_in <Taddress_t> ("address" , static_cast<uint32_t>(ceil(log2(_param._nb_counter)))); 92 in_BRANCH_COMPLETE_HISTORY [i] = interface->set_signal_in <Thistory_t> ("history" , _param._size_counter); 93 in_BRANCH_COMPLETE_DIRECTION [i] = interface->set_signal_in <Tcontrol_t> ("direction", 1); 94 } 95 78 96 // ~~~~~[ Component ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 79 97 string name_component; 98 80 99 // =====[ component_Counter ]========================================= 81 100 82 101 name_component = _name+"_Counter"; 83 102 84 component_Counter = new morpheo::behavioural::generic::counter::Counter (name_component.c_str() ,103 component_Counter = new morpheo::behavioural::generic::counter::Counter (name_component.c_str() 85 104 #ifdef STATISTICS 86 _param_statistics , 87 #endif 88 *(_param._param_counter) ); 89 90 91 // Instantiation 105 ,_param_statistics 106 #endif 107 ,*(_param._param_counter)); 108 109 _component->set_component (component_Counter->_component 110 #ifdef POSITION 111 , 25 112 , 25 113 , 10 114 , 10 115 #endif 116 ); 117 118 // =====[ component_RegisterFile ]==================================== 119 120 name_component = _name+"_RegisterFile"; 121 122 component_RegisterFile = new morpheo::behavioural::generic::registerfile::registerfile_monolithic::RegisterFile_Monolithic(name_component.c_str(), 123 #ifdef STATISTICS 124 _param_statistics , 125 #endif 126 *(_param._param_registerfile)); 127 128 _component->set_component (component_RegisterFile->_component 129 #ifdef POSITION 130 , 75 131 , 75 132 , 10 133 , 10 134 #endif 135 ); 136 137 // ~~~~~[ Component - Instanciation ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 138 139 // =====[ component_RegisterFile - Instanciation ]==================== 140 141 #ifdef POSITION 142 _component->interface_map (_name+"_RegisterFile","", 143 _name ,""); 144 #endif 145 146 _component->port_map(_name+"_RegisterFile", "in_CLOCK" , _name,"in_CLOCK" ); 147 _component->port_map(_name+"_RegisterFile", "in_NRESET", _name,"in_NRESET"); 148 149 for (uint32_t i=0; i<_param._nb_prediction; i++) 150 { 151 #ifdef POSITION 152 _component->interface_map (_name+"_RegisterFile","read_" +toString(i), 153 _name ,"predict_"+toString(i)); 154 #endif 155 156 _component->port_map(_name+"_RegisterFile", "in_READ_"+toString(i)+"_VAL" , _name, "in_PREDICT_"+toString(i)+"_VAL" ); 157 _component->port_map(_name+"_RegisterFile","out_READ_"+toString(i)+"_ACK" , _name,"out_PREDICT_"+toString(i)+"_ACK" ); 158 _component->port_map(_name+"_RegisterFile", "in_READ_"+toString(i)+"_ADDRESS", _name, "in_PREDICT_"+toString(i)+"_ADDRESS"); 159 _component->port_map(_name+"_RegisterFile","out_READ_"+toString(i)+"_DATA" , _name,"out_PREDICT_"+toString(i)+"_HISTORY"); 160 } 161 162 for (uint32_t i=0; i<_param._nb_branch_complete; i++) 163 { 164 #ifdef POSITION 165 _component->interface_map (_name+"_RegisterFile","write_" +toString(i), 166 _name+"_Counter" ,"counter_"+toString(i)); 167 #endif 168 169 _component->port_map(_name+"_RegisterFile", "in_WRITE_"+toString(i)+"_VAL" , _name , "in_BRANCH_COMPLETE_"+toString(i)+"_VAL" ); 170 _component->port_map(_name+"_RegisterFile","out_WRITE_"+toString(i)+"_ACK" , _name ,"out_BRANCH_COMPLETE_"+toString(i)+"_ACK" ); 171 _component->port_map(_name+"_RegisterFile", "in_WRITE_"+toString(i)+"_ADDRESS", _name , "in_BRANCH_COMPLETE_"+toString(i)+"_ADDRESS"); 172 _component->port_map(_name+"_RegisterFile", "in_WRITE_"+toString(i)+"_DATA" , _name+"_Counter","out_COUNTER_" +toString(i)+"_DATA"); 173 } 174 175 // =====[ component_Counter - Instanciation ]========================= 176 92 177 #if (defined(STATISTICS) || defined (VHDL_TESTBENCH)) 93 (*(component_Counter->in_CLOCK)) (*(in_CLOCK)); 178 179 #ifdef POSITION 180 _component->interface_map (_name+"_Counter","", 181 _name ,""); 182 #endif 183 184 _component->port_map(_name+"_Counter", "in_CLOCK" , _name,"in_CLOCK" ); 185 _component->port_map(_name+"_Counter", "in_NRESET", _name,"in_NRESET"); 186 94 187 #endif 95 188 96 189 for (uint32_t i=0; i<_param._nb_branch_complete; i++) 97 190 { 98 (*(component_Counter-> in_COUNTER_DATA [i])) (*( in_BRANCH_COMPLETE_HISTORY [i])); 99 (*(component_Counter-> in_COUNTER_ADDSUB [i])) (*( in_BRANCH_COMPLETE_DIRECTION [i])); 100 (*(component_Counter->out_COUNTER_DATA [i])) (*(signal_BRANCH_COMPLETE_HISTORY [i])); 101 } 102 103 // =====[ component_RegisterFile ]==================================== 104 105 name_component = _name+"_RegisterFile"; 106 107 component_RegisterFile = new morpheo::behavioural::generic::registerfile::registerfile_monolithic::RegisterFile_Monolithic (name_component.c_str(), 108 #ifdef STATISTICS 109 _param_statistics , 110 #endif 111 *(_param._param_registerfile)); 112 113 // Instantiation 114 (*(component_RegisterFile->in_CLOCK)) (*(in_CLOCK)); 115 (*(component_RegisterFile->in_NRESET)) (*(in_NRESET)); 116 117 for (uint32_t i=0; i<_param._nb_prediction; i++) 118 { 119 (*(component_RegisterFile-> in_READ_VAL [i])) (*( in_PREDICT_VAL [i])); 120 (*(component_RegisterFile->out_READ_ACK [i])) (*(out_PREDICT_ACK [i])); 121 (*(component_RegisterFile-> in_READ_ADDRESS [i])) (*( in_PREDICT_ADDRESS [i])); 122 (*(component_RegisterFile->out_READ_DATA [i])) (*(out_PREDICT_HISTORY [i])); 123 } 124 125 for (uint32_t i=0; i<_param._nb_branch_complete; i++) 126 { 127 (*(component_RegisterFile-> in_WRITE_VAL [i])) (*( in_BRANCH_COMPLETE_VAL [i])); 128 (*(component_RegisterFile->out_WRITE_ACK [i])) (*( out_BRANCH_COMPLETE_ACK [i])); 129 (*(component_RegisterFile-> in_WRITE_ADDRESS [i])) (*( in_BRANCH_COMPLETE_ADDRESS [i])); 130 (*(component_RegisterFile-> in_WRITE_DATA [i])) (*(signal_BRANCH_COMPLETE_HISTORY [i])); 131 } 191 #ifdef POSITION 192 _component->interface_map (_name+"_Counter","counter_"+toString(i), 193 _name ,"branch_complete_"+toString(i)); 194 195 #endif 196 197 _component->port_map(_name+"_Counter", "in_COUNTER_" +toString(i)+"_DATA" , _name , "in_BRANCH_COMPLETE_"+toString(i)+"_HISTORY"); 198 _component->port_map(_name+"_Counter", "in_COUNTER_" +toString(i)+"_ADDSUB" , _name , "in_BRANCH_COMPLETE_"+toString(i)+"_DIRECTION"); 199 _component->port_map(_name+"_Counter", "out_COUNTER_"+toString(i)+"_DATA" , _name+"_RegisterFile", "in_WRITE_"+toString(i)+"_DATA"); 200 } 201 202 #ifdef POSITION 203 _component->generate_file(); 204 #endif 132 205 133 206 log_printf(FUNC,Pattern_History_Table,"allocation","End"); -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Pattern_History_Table/src/Pattern_History_Table_deallocation.cpp
r15 r42 22 22 log_printf(FUNC,Pattern_History_Table,"deallocation","Begin"); 23 23 24 delete in_CLOCK;25 delete in_NRESET;24 delete in_CLOCK; 25 delete in_NRESET; 26 26 27 for (uint32_t i=0; i<_param._nb_prediction; i++) 28 { 29 delete in_PREDICT_VAL [i]; 30 delete out_PREDICT_ACK [i]; 31 delete in_PREDICT_ADDRESS [i]; 32 delete out_PREDICT_HISTORY [i]; 33 } 27 delete [] in_PREDICT_VAL ; 28 delete [] out_PREDICT_ACK ; 29 delete [] in_PREDICT_ADDRESS; 30 delete [] out_PREDICT_HISTORY; 34 31 35 delete in_PREDICT_VAL ; 36 delete out_PREDICT_ACK ; 37 delete in_PREDICT_ADDRESS; 38 delete out_PREDICT_HISTORY; 39 40 for (uint32_t i=0; i<_param._nb_branch_complete; i++) 41 { 42 delete in_BRANCH_COMPLETE_VAL [i]; 43 delete out_BRANCH_COMPLETE_ACK [i]; 44 delete in_BRANCH_COMPLETE_ADDRESS [i]; 45 delete in_BRANCH_COMPLETE_HISTORY [i]; 46 delete in_BRANCH_COMPLETE_DIRECTION [i]; 47 } 48 delete in_BRANCH_COMPLETE_VAL ; 49 delete out_BRANCH_COMPLETE_ACK ; 50 delete in_BRANCH_COMPLETE_ADDRESS; 51 delete in_BRANCH_COMPLETE_HISTORY; 52 delete in_BRANCH_COMPLETE_DIRECTION; 32 delete [] in_BRANCH_COMPLETE_VAL ; 33 delete [] out_BRANCH_COMPLETE_ACK ; 34 delete [] in_BRANCH_COMPLETE_ADDRESS; 35 delete [] in_BRANCH_COMPLETE_HISTORY; 36 delete [] in_BRANCH_COMPLETE_DIRECTION; 53 37 54 38 // ~~~~~[ Component ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 55 39 delete component_Counter; 56 40 delete component_RegisterFile; 41 42 delete _component; 57 43 58 44 log_printf(FUNC,Pattern_History_Table,"deallocation","End"); -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Pattern_History_Table/src/Pattern_History_Table_vhdl.cpp
r2 r42 22 22 { 23 23 log_printf(FUNC,Pattern_History_Table,"vhdl","Begin"); 24 Vhdl vhdl (_name);24 Vhdl * vhdl = new Vhdl (_name); 25 25 26 vhdl.set_library_work (_name + "_Pack"); 27 vhdl.set_library_work (_name + "_RegisterFile_Pack"); 28 vhdl.set_library_work (_name + "_Counter_Pack"); 26 _interfaces->set_port(vhdl); 27 _component->vhdl_instance(vhdl); 29 28 30 vhdl_port (vhdl);31 29 vhdl_declaration (vhdl); 32 30 vhdl_body (vhdl); 33 31 34 vhdl.generate_file(); 32 vhdl->generate_file(); 33 34 delete vhdl; 35 35 36 log_printf(FUNC,Pattern_History_Table,"vhdl","End"); 36 37 -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Pattern_History_Table/src/Pattern_History_Table_vhdl_body.cpp
r15 r42 18 18 19 19 20 void Pattern_History_Table::vhdl_body (Vhdl & vhdl)20 void Pattern_History_Table::vhdl_body (Vhdl * & vhdl) 21 21 { 22 22 log_printf(FUNC,Pattern_History_Table,"vhdl_body","Begin"); 23 23 24 // vhdl .set_body ("-- Output : always at '1'");24 // vhdl->set_body ("-- Output : always at '1'"); 25 25 // for (uint32_t i=0; i<_param._nb_branch_complete; i++) 26 // vhdl .set_body ("out_BRANCH_COMPLETE_ACK_"+toString(i)+" <= '1';");26 // vhdl->set_body ("out_BRANCH_COMPLETE_ACK_"+toString(i)+" <= '1';"); 27 27 // for (uint32_t i=0; i<_param._nb_prediction ; i++) 28 // vhdl.set_body ("out_PREDICT_ACK_"+toString(i)+" <= '1';"); 29 // vhdl.set_body (""); 30 31 list<string> list_port_map; 32 33 for (uint32_t i=0; i<_param._nb_branch_complete; i++) 34 { 35 vhdl.set_body_component_port_map (list_port_map," in_COUNTER_DATA_"+toString(i)+" "," in_BRANCH_COMPLETE_HISTORY_"+toString(i)); 36 vhdl.set_body_component_port_map (list_port_map," in_COUNTER_ADDSUB_"+toString(i)+" "," in_BRANCH_COMPLETE_DIRECTION_"+toString(i) ); 37 vhdl.set_body_component_port_map (list_port_map,"out_COUNTER_DATA_"+toString(i)+" ","signal_BRANCH_COMPLETE_HISTORY_"+toString(i)); 38 } 39 vhdl.set_body_component ("component_Counter",_name+"_Counter",list_port_map); 40 41 42 list_port_map.clear(); 43 vhdl.set_body_component_port_map (list_port_map,"in_CLOCK ","in_CLOCK "); 44 vhdl.set_body_component_port_map (list_port_map,"in_NRESET","in_NRESET"); 45 46 for (uint32_t i=0; i<_param._nb_prediction; i++) 47 { 48 vhdl.set_body_component_port_map (list_port_map," in_READ_VAL_"+toString(i)+" "," in_PREDICT_VAL_"+toString(i)); 49 vhdl.set_body_component_port_map (list_port_map,"out_READ_ACK_"+toString(i)+" ","out_PREDICT_ACK_"+toString(i)); 50 vhdl.set_body_component_port_map (list_port_map," in_READ_ADDRESS_"+toString(i)+" "," in_PREDICT_ADDRESS_"+toString(i)); 51 vhdl.set_body_component_port_map (list_port_map,"out_READ_DATA_"+toString(i)+" ","out_PREDICT_HISTORY_"+toString(i)); 52 } 53 54 for (uint32_t i=0; i<_param._nb_branch_complete; i++) 55 { 56 vhdl.set_body_component_port_map (list_port_map," in_WRITE_VAL_"+toString(i)+" "," in_BRANCH_COMPLETE_VAL_"+toString(i)+""); 57 vhdl.set_body_component_port_map (list_port_map,"out_WRITE_ACK_"+toString(i)+" "," out_BRANCH_COMPLETE_ACK_"+toString(i)+""); 58 vhdl.set_body_component_port_map (list_port_map," in_WRITE_ADDRESS_"+toString(i)+""," in_BRANCH_COMPLETE_ADDRESS_"+toString(i)); 59 vhdl.set_body_component_port_map (list_port_map," in_WRITE_DATA_"+toString(i)+" ","signal_BRANCH_COMPLETE_HISTORY_"+toString(i)); 60 } 61 vhdl.set_body_component ("component_RegisterFile",_name+"_RegisterFile",list_port_map); 28 // vhdl->set_body ("out_PREDICT_ACK_"+toString(i)+" <= '1';"); 29 // vhdl->set_body (""); 62 30 63 31 log_printf(FUNC,Pattern_History_Table,"vhdl_body","End"); -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Pattern_History_Table/src/Pattern_History_Table_vhdl_port.cpp
r15 r42 18 18 19 19 20 void Pattern_History_Table::vhdl_port (Vhdl& vhdl)21 {22 log_printf(FUNC,Pattern_History_Table,"vhdl_port","Begin");20 // void Pattern_History_Table::vhdl_port (Vhdl * & vhdl) 21 // { 22 // log_printf(FUNC,Pattern_History_Table,"vhdl_port","Begin"); 23 23 24 vhdl.set_port (" in_CLOCK" , IN, 1); 25 vhdl.set_port (" in_NRESET", IN, 1); 24 // _interfaces->set_port(vhdl); 26 25 27 for (uint32_t i=0; i<_param._nb_prediction; i++) 28 { 29 vhdl.set_port(" in_PREDICT_VAL_"+toString(i)+" ", IN, 1); 30 vhdl.set_port("out_PREDICT_ACK_"+toString(i)+" ",OUT, 1); 31 vhdl.set_port(" in_PREDICT_ADDRESS_"+toString(i)+" ", IN, static_cast<uint32_t>(ceil(log2(_param._nb_counter)))); 32 vhdl.set_port("out_PREDICT_HISTORY_"+toString(i)+" ",OUT, _param._size_counter); 33 } 34 for (uint32_t i=0; i<_param._nb_branch_complete; i++) 35 { 36 vhdl.set_port (" in_BRANCH_COMPLETE_VAL_"+toString(i)+" ", IN, 1); 37 vhdl.set_port ("out_BRANCH_COMPLETE_ACK_"+toString(i)+" ",OUT, 1); 38 vhdl.set_port (" in_BRANCH_COMPLETE_ADDRESS_"+toString(i)+" ", IN, static_cast<uint32_t>(ceil(log2(_param._nb_counter)))); 39 vhdl.set_port (" in_BRANCH_COMPLETE_HISTORY_"+toString(i)+" ", IN, _param._size_counter); 40 vhdl.set_port (" in_BRANCH_COMPLETE_DIRECTION_"+toString(i)+"", IN, 1); 41 } 42 43 log_printf(FUNC,Pattern_History_Table,"vhdl_port","End"); 44 }; 26 // log_printf(FUNC,Pattern_History_Table,"vhdl_port","End"); 27 // }; 45 28 46 29 }; // end namespace pattern_history_table -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Pattern_History_Table/src/Pattern_History_Table_vhdl_signal.cpp
r2 r42 18 18 19 19 20 void Pattern_History_Table::vhdl_declaration (Vhdl & vhdl)20 void Pattern_History_Table::vhdl_declaration (Vhdl * & vhdl) 21 21 { 22 22 log_printf(FUNC,Pattern_History_Table,"vhdl_declaration","Begin"); 23 24 for (uint32_t i=0; i<_param._nb_branch_complete; i++)25 vhdl.set_signal ("signal_BRANCH_COMPLETE_HISTORY_"+toString(i), _param._size_counter);26 23 27 24 log_printf(FUNC,Pattern_History_Table,"vhdl_declaration","End"); -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Pattern_History_Table/src/Pattern_History_Table_vhdl_testbench_transition.cpp
r15 r42 22 22 log_printf(FUNC,Pattern_History_Table,"vhdl_testbench_transition","Begin"); 23 23 24 #ifndef SYSTEMCASS_SPECIFIC 25 sc_cycle(0); 26 #endif 24 sc_start(0); 27 25 28 // In order with file Pattern_History_Table_vhdl_testbench_port.cpp 29 // Warning : if a output depend of a subcomponent, take directly the port of subcomponent 30 // (because we have no control on the ordonnancer's policy) 31 32 _vhdl_testbench->add_input (PORT_READ( in_NRESET)); 33 34 for (uint32_t i=0; i<_param._nb_prediction; i++) 35 { 36 _vhdl_testbench->add_input (PORT_READ( in_PREDICT_VAL [i])); 37 _vhdl_testbench->add_output (PORT_READ(component_RegisterFile->out_READ_ACK [i])); 38 _vhdl_testbench->add_input (PORT_READ( in_PREDICT_ADDRESS [i])); 39 _vhdl_testbench->add_output (PORT_READ(component_RegisterFile->out_READ_DATA [i])); 40 //_vhdl_testbench->add_output (PORT_READ(out_PREDICT_HISTORY [i])); 41 } 42 43 for (uint32_t i=0; i<_param._nb_branch_complete; i++) 44 { 45 _vhdl_testbench->add_input (PORT_READ( in_BRANCH_COMPLETE_VAL [i])); 46 _vhdl_testbench->add_output (PORT_READ(component_RegisterFile->out_WRITE_ACK [i])); 47 _vhdl_testbench->add_input (PORT_READ( in_BRANCH_COMPLETE_ADDRESS [i])); 48 _vhdl_testbench->add_input (PORT_READ( in_BRANCH_COMPLETE_HISTORY [i])); 49 _vhdl_testbench->add_input (PORT_READ( in_BRANCH_COMPLETE_DIRECTION[i])); 50 } 51 52 // add_test : 53 // - True : the cycle must be compare with the output of systemC 54 // - False : no test 55 _vhdl_testbench->add_test(true); 56 57 _vhdl_testbench->new_cycle (); // always at the end 26 _interfaces->testbench(); 58 27 59 28 log_printf(FUNC,Pattern_History_Table,"vhdl_testbench_transition","End");
Note: See TracChangeset
for help on using the changeset viewer.