Changeset 42 for trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Two_Level_Branch_Predictor_Glue/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/Two_Level_Branch_Predictor_Glue/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/Two_Level_Branch_Predictor_Glue/src/Two_Level_Branch_Predictor_Glue.cpp
r3 r42 34 34 log_printf(FUNC,Two_Level_Branch_Predictor_Glue,"Two_Level_Branch_Predictor_Glue","Begin"); 35 35 36 #ifdef SYSTEMC 37 allocation (); 38 #endif 39 36 40 #ifdef STATISTICS 37 41 // Allocation of statistics … … 41 45 #endif 42 46 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",false);50 #endif51 52 47 #ifdef VHDL 53 48 // generate the vhdl … … 56 51 57 52 #ifdef SYSTEMC 58 allocation ();59 60 53 #if defined(STATISTICS) or defined(VHDL_TESTBENCH) 61 54 SC_METHOD (transition); … … 192 185 log_printf(FUNC,Two_Level_Branch_Predictor_Glue,"~Two_Level_Branch_Predictor_Glue","Begin"); 193 186 194 #ifdef VHDL_TESTBENCH195 // generate the test bench196 _vhdl_testbench->generate_file();197 delete _vhdl_testbench;198 #endif199 200 187 #ifdef STATISTICS 201 188 _stat->generate_file(statistics(0)); -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Two_Level_Branch_Predictor_Glue/src/Two_Level_Branch_Predictor_Glue_allocation.cpp
r2 r42 24 24 log_printf(FUNC,Two_Level_Branch_Predictor_Glue,"allocation","Begin"); 25 25 26 #if defined(STATISTICS) or defined(VHDL_TESTBENCH) 27 in_CLOCK = new SC_CLOCK ("in_CLOCK"); 26 _component = new Component (); 27 28 Entity * entity = _component->set_entity (_name 29 ,"Two_Level_Branch_Predictor_Glue" 30 #ifdef POSITION 31 ,COMBINATORY 28 32 #endif 33 ); 29 34 35 _interfaces = entity->set_interfaces(); 36 37 // ~~~~~[ Interface : "" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 38 { 39 Interface * interface = _interfaces->set_interface("" 40 #ifdef POSITION 41 , IN 42 , SOUTH 43 , "Generalist interface" 44 #endif 45 ); 46 47 in_CLOCK = interface->set_signal_clk ("clock" ,1,CLOCK_VHDL_NO); 48 in_NRESET = interface->set_signal_in <Tcontrol_t> ("nreset",1,RESET_VHDL_NO); 49 } 50 51 // ~~~~~[ Interface : "Predict" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 30 52 if (_param._have_bht) 31 53 { … … 45 67 for (uint32_t i=0; i<_param._nb_prediction; i++) 46 68 { 69 Interface_fifo * interface = _interfaces->set_interface("predict_"+toString(i) 70 #ifdef POSITION 71 , IN 72 , WEST 73 , "Interface Predict" 74 #endif 75 ); 76 47 77 if (_param._have_bht) 48 78 { 49 rename = " in_PREDICT_BHT_ACK_" +toString(i); 50 in_PREDICT_BHT_ACK [i] = new SC_IN (Tcontrol_t) (rename.c_str()); 51 52 rename = "out_PREDICT_BHT_ADDRESS_"+toString(i); 53 out_PREDICT_BHT_ADDRESS [i] = new SC_OUT(Taddress_t) (rename.c_str()); 79 in_PREDICT_BHT_ACK [i] = interface->set_signal_in <Tcontrol_t> ("bht_ack" ,1); 80 out_PREDICT_BHT_ADDRESS [i] = interface->set_signal_out <Taddress_t> ("bht_address",_param._bht_size_address); 54 81 } 55 82 if (_param._have_pht) 56 83 { 57 rename = " in_PREDICT_PHT_ACK_" +toString(i); 58 in_PREDICT_PHT_ACK [i] = new SC_IN (Tcontrol_t) (rename.c_str()); 59 60 rename = "out_PREDICT_PHT_ADDRESS_"+toString(i); 61 out_PREDICT_PHT_ADDRESS [i] = new SC_OUT(Taddress_t) (rename.c_str()); 84 in_PREDICT_PHT_ACK [i] = interface->set_signal_in <Tcontrol_t> ("pht_ack" ,1); 85 out_PREDICT_PHT_ADDRESS [i] = interface->set_signal_out <Taddress_t> ("pht_address",_param._pht_size_address); 62 86 } 63 87 if (_param._have_bht and _param._have_pht) 64 { 65 rename = " in_PREDICT_BHT_HISTORY_"+toString(i); 66 in_PREDICT_BHT_HISTORY [i] = new SC_IN (Tbht_history_t) (rename.c_str()); 67 } 68 rename = "out_PREDICT_ACK_" +toString(i); 69 out_PREDICT_ACK [i] = new SC_OUT(Tcontrol_t) (rename.c_str()); 70 71 rename = " in_PREDICT_ADDRESS_" +toString(i); 72 in_PREDICT_ADDRESS [i] = new SC_IN (Taddress_t) (rename.c_str()); 88 in_PREDICT_BHT_HISTORY [i] = interface->set_signal_in <Tbht_history_t> ("bht_history",_param._bht_size_history); 89 out_PREDICT_ACK [i] = interface->set_signal_out <Tcontrol_t> ("ack" ,1); 90 in_PREDICT_ADDRESS [i] = interface->set_signal_in <Taddress_t> ("address" ,_param._size_address); 73 91 } 92 93 // ~~~~~[ Interface : "branch_complete" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 74 94 75 95 if (_param._have_bht) … … 91 111 for (uint32_t i=0; i<_param._nb_branch_complete; i++) 92 112 { 113 Interface_fifo * interface = _interfaces->set_interface("branch_complete_"+toString(i) 114 #ifdef POSITION 115 , IN 116 , EAST 117 , "Interface branch complete" 118 #endif 119 ); 93 120 if (_param._have_bht) 94 121 { 95 rename = " in_BRANCH_COMPLETE_BHT_ACK_" +toString(i); 96 in_BRANCH_COMPLETE_BHT_ACK [i] = new SC_IN (Tcontrol_t) (rename.c_str()); 97 98 rename = "out_BRANCH_COMPLETE_BHT_ADDRESS_"+toString(i); 99 out_BRANCH_COMPLETE_BHT_ADDRESS [i] = new SC_OUT(Taddress_t) (rename.c_str()); 122 in_BRANCH_COMPLETE_BHT_ACK [i] = interface->set_signal_in <Tcontrol_t> ("bht_ack" ,1); 123 out_BRANCH_COMPLETE_BHT_ADDRESS [i] = interface->set_signal_out <Taddress_t> ("bht_address",_param._bht_size_address); 100 124 } 101 125 if (_param._have_pht) 102 126 { 103 rename = " in_BRANCH_COMPLETE_PHT_ACK_" +toString(i); 104 in_BRANCH_COMPLETE_PHT_ACK [i] = new SC_IN (Tcontrol_t) (rename.c_str()); 105 106 rename = "out_BRANCH_COMPLETE_PHT_ADDRESS_"+toString(i); 107 out_BRANCH_COMPLETE_PHT_ADDRESS [i] = new SC_OUT(Taddress_t) (rename.c_str()); 127 in_BRANCH_COMPLETE_PHT_ACK [i] = interface->set_signal_in <Tcontrol_t> ("pht_ack" ,1); 128 out_BRANCH_COMPLETE_PHT_ADDRESS [i] = interface->set_signal_out <Taddress_t> ("pht_address",_param._pht_size_address); 108 129 } 109 130 if (_param._have_bht and _param._have_pht) 110 { 111 rename = " in_BRANCH_COMPLETE_BHT_HISTORY_"+toString(i); 112 in_BRANCH_COMPLETE_BHT_HISTORY [i] = new SC_IN (Tbht_history_t) (rename.c_str()); 113 } 114 rename = "out_BRANCH_COMPLETE_ACK_" +toString(i); 115 out_BRANCH_COMPLETE_ACK [i] = new SC_OUT(Tcontrol_t) (rename.c_str()); 116 117 rename = " in_BRANCH_COMPLETE_ADDRESS_" +toString(i); 118 in_BRANCH_COMPLETE_ADDRESS [i] = new SC_IN (Taddress_t) (rename.c_str()); 131 in_BRANCH_COMPLETE_BHT_HISTORY [i] = interface->set_signal_in <Tbht_history_t> ("bht_history",_param._bht_size_history); 132 133 out_BRANCH_COMPLETE_ACK [i] = interface->set_signal_out <Tcontrol_t> ("ack" ,1); 134 in_BRANCH_COMPLETE_ADDRESS [i] = interface->set_signal_in <Taddress_t> ("address" ,_param._size_address); 119 135 } 120 136 121 137 // ~~~~~[ Component ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 138 139 #ifdef POSITION 140 _component->generate_file(); 141 #endif 122 142 123 143 log_printf(FUNC,Two_Level_Branch_Predictor_Glue,"allocation","End"); -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Two_Level_Branch_Predictor_Glue/src/Two_Level_Branch_Predictor_Glue_deallocation.cpp
r2 r42 22 22 log_printf(FUNC,Two_Level_Branch_Predictor_Glue,"deallocation","Begin"); 23 23 24 delete in_CLOCK; 24 delete in_CLOCK; 25 delete in_NRESET; 25 26 26 for (uint32_t i=0; i<_param._nb_prediction; i++)27 {28 if (_param._have_bht)29 {30 delete in_PREDICT_BHT_ACK [i];31 delete out_PREDICT_BHT_ADDRESS [i];32 }33 if (_param._have_pht)34 {35 delete in_PREDICT_PHT_ACK [i];36 delete out_PREDICT_PHT_ADDRESS [i];37 }38 if (_param._have_bht and _param._have_pht)39 delete in_PREDICT_BHT_HISTORY [i];40 delete out_PREDICT_ACK [i];41 delete in_PREDICT_ADDRESS [i];42 }43 27 if (_param._have_bht) 44 28 { 45 delete in_PREDICT_BHT_ACK ;46 delete out_PREDICT_BHT_ADDRESS;29 delete [] in_PREDICT_BHT_ACK ; 30 delete [] out_PREDICT_BHT_ADDRESS; 47 31 } 48 32 if (_param._have_pht) 49 33 { 50 delete in_PREDICT_PHT_ACK ;51 delete out_PREDICT_PHT_ADDRESS;34 delete [] in_PREDICT_PHT_ACK ; 35 delete [] out_PREDICT_PHT_ADDRESS; 52 36 } 53 37 if (_param._have_bht and _param._have_pht) 54 delete in_PREDICT_BHT_HISTORY;38 delete [] in_PREDICT_BHT_HISTORY; 55 39 56 delete out_PREDICT_ACK ;57 delete in_PREDICT_ADDRESS ;40 delete [] out_PREDICT_ACK ; 41 delete [] in_PREDICT_ADDRESS ; 58 42 59 for (uint32_t i=0; i<_param._nb_branch_complete; i++)60 {61 if (_param._have_bht)62 {63 delete in_BRANCH_COMPLETE_BHT_ACK [i];64 delete out_BRANCH_COMPLETE_BHT_ADDRESS [i];65 }66 if (_param._have_pht)67 {68 delete in_BRANCH_COMPLETE_PHT_ACK [i];69 delete out_BRANCH_COMPLETE_PHT_ADDRESS [i];70 }71 if (_param._have_bht and _param._have_pht)72 delete in_BRANCH_COMPLETE_BHT_HISTORY [i];73 delete out_BRANCH_COMPLETE_ACK [i];74 delete in_BRANCH_COMPLETE_ADDRESS [i];75 }76 43 if (_param._have_bht) 77 44 { 78 delete in_BRANCH_COMPLETE_BHT_ACK ;79 delete out_BRANCH_COMPLETE_BHT_ADDRESS;45 delete [] in_BRANCH_COMPLETE_BHT_ACK ; 46 delete [] out_BRANCH_COMPLETE_BHT_ADDRESS; 80 47 } 81 48 if (_param._have_pht) 82 49 { 83 delete in_BRANCH_COMPLETE_PHT_ACK ;84 delete out_BRANCH_COMPLETE_PHT_ADDRESS;50 delete [] in_BRANCH_COMPLETE_PHT_ACK ; 51 delete [] out_BRANCH_COMPLETE_PHT_ADDRESS; 85 52 } 86 53 if (_param._have_bht and _param._have_pht) 87 delete in_BRANCH_COMPLETE_BHT_HISTORY;88 delete out_BRANCH_COMPLETE_ACK ;89 delete in_BRANCH_COMPLETE_ADDRESS ;54 delete [] in_BRANCH_COMPLETE_BHT_HISTORY; 55 delete [] out_BRANCH_COMPLETE_ACK ; 56 delete [] in_BRANCH_COMPLETE_ADDRESS ; 90 57 91 58 // ~~~~~[ Component ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 59 delete _component; 92 60 93 61 log_printf(FUNC,Two_Level_Branch_Predictor_Glue,"deallocation","End"); -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Two_Level_Branch_Predictor_Glue/src/Two_Level_Branch_Predictor_Glue_vhdl.cpp
r2 r42 22 22 { 23 23 log_printf(FUNC,Two_Level_Branch_Predictor_Glue,"vhdl","Begin"); 24 Vhdl vhdl (_name); 24 25 Vhdl * vhdl = new Vhdl (_name); 25 26 26 vhdl .set_library_work (_name + "_Pack");27 vhdl->set_library_work (_name + "_Pack"); 27 28 28 29 vhdl_port (vhdl); … … 30 31 vhdl_body (vhdl); 31 32 32 vhdl.generate_file(); 33 vhdl->generate_file(); 34 35 delete vhdl; 36 33 37 log_printf(FUNC,Two_Level_Branch_Predictor_Glue,"vhdl","End"); 34 38 -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Two_Level_Branch_Predictor_Glue/src/Two_Level_Branch_Predictor_Glue_vhdl_body.cpp
r2 r42 18 18 19 19 20 void Two_Level_Branch_Predictor_Glue::vhdl_body (Vhdl & vhdl)20 void Two_Level_Branch_Predictor_Glue::vhdl_body (Vhdl * & vhdl) 21 21 { 22 22 log_printf(FUNC,Two_Level_Branch_Predictor_Glue,"vhdl_body","Begin"); 23 23 24 vhdl .set_body ("-- ack output");24 vhdl->set_body ("-- ack output"); 25 25 for (uint32_t i=0; i<_param._nb_prediction; i++) 26 26 { … … 28 28 29 29 if (_param._have_bht) 30 bht_ack = "in_PREDICT_ BHT_ACK_"+toString(i);30 bht_ack = "in_PREDICT_"+toString(i)+"_BHT_ACK"; 31 31 else 32 32 bht_ack = "'1'"; 33 33 34 34 if (_param._have_pht) 35 pht_ack = "in_PREDICT_ PHT_ACK_"+toString(i);35 pht_ack = "in_PREDICT_"+toString(i)+"_PHT_ACK"; 36 36 else 37 37 pht_ack = "'1'"; 38 38 39 vhdl .set_body ("out_PREDICT_ACK_"+toString(i)+"<= "+bht_ack+" and "+pht_ack+";");39 vhdl->set_body ("out_PREDICT_"+toString(i)+"_ACK <= "+bht_ack+" and "+pht_ack+";"); 40 40 } 41 41 … … 45 45 46 46 if (_param._have_bht) 47 bht_ack = "in_BRANCH_COMPLETE_ BHT_ACK_"+toString(i);47 bht_ack = "in_BRANCH_COMPLETE_"+toString(i)+"_BHT_ACK"; 48 48 else 49 49 bht_ack = "'1'"; 50 50 51 51 if (_param._have_pht) 52 pht_ack = "in_BRANCH_COMPLETE_ PHT_ACK_"+toString(i);52 pht_ack = "in_BRANCH_COMPLETE_"+toString(i)+"_PHT_ACK"; 53 53 else 54 54 pht_ack = "'1'"; 55 55 56 vhdl .set_body ("out_BRANCH_COMPLETE_ACK_"+toString(i)+"<= "+bht_ack+" and "+pht_ack+";");56 vhdl->set_body ("out_BRANCH_COMPLETE_"+toString(i)+"_ACK <= "+bht_ack+" and "+pht_ack+";"); 57 57 } 58 58 59 vhdl .set_body ("");60 vhdl .set_body ("-- address output");59 vhdl->set_body (""); 60 vhdl->set_body ("-- address output"); 61 61 62 62 for (uint32_t i=0; i<_param._nb_prediction; i++) … … 64 64 // The address is higher than the address size of bht 65 65 if (_param._have_bht) 66 vhdl .set_body ("out_PREDICT_BHT_ADDRESS_"+toString(i)+" <= in_PREDICT_ADDRESS_"+toString(i)+std_logic_range(_param._bht_size_address)+";");66 vhdl->set_body ("out_PREDICT_"+toString(i)+"_BHT_ADDRESS <= in_PREDICT_"+toString(i)+"_ADDRESS"+std_logic_range(_param._bht_size_address)+";"); 67 67 68 68 if (_param._have_pht) … … 93 93 { 94 94 min = _param._pht_size_address_shift; 95 vhdl .set_body ("out_PREDICT_PHT_ADDRESS_"+toString(i)+std_logic_range(min) + " <= in_PREDICT_BHT_HISTORY_"+toString(i)+std_logic_range(min)+";");95 vhdl->set_body ("out_PREDICT_"+toString(i)+"_PHT_ADDRESS"+std_logic_range(min) + " <= in_PREDICT_"+toString(i)+"_BHT_HISTORY"+std_logic_range(min)+";"); 96 96 } 97 97 … … 99 99 { 100 100 max = _param._bht_size_history; 101 vhdl .set_body ("out_PREDICT_PHT_ADDRESS_"+toString(i)+std_logic_range(_param._pht_size_address-1,max) + " <= in_PREDICT_ADDRESS_"+toString(i)+std_logic_range(_param._pht_size_address-1-_param._pht_size_address_shift, _param._pht_size_address_share)+";");101 vhdl->set_body ("out_PREDICT_"+toString(i)+"_PHT_ADDRESS"+std_logic_range(_param._pht_size_address-1,max) + " <= in_PREDICT_"+toString(i)+"_ADDRESS"+std_logic_range(_param._pht_size_address-1-_param._pht_size_address_shift, _param._pht_size_address_share)+";"); 102 102 } 103 103 104 104 // intersection 105 105 if (_param._pht_size_address_share > 0) 106 vhdl .set_body ("out_PREDICT_PHT_ADDRESS_"+toString(i)+std_logic_range(max-1,min) + " <= in_PREDICT_ADDRESS_"+toString(i)+std_logic_range(_param._pht_size_address_share-1,0)+" xor in_PREDICT_BHT_HISTORY_"+toString(i)+std_logic_range(max-1,min)+";");106 vhdl->set_body ("out_PREDICT_"+toString(i)+"_PHT_ADDRESS"+std_logic_range(max-1,min) + " <= in_PREDICT_"+toString(i)+"_ADDRESS"+std_logic_range(_param._pht_size_address_share-1,0)+" xor in_PREDICT_"+toString(i)+"_BHT_HISTORY"+std_logic_range(max-1,min)+";"); 107 107 } 108 108 else 109 vhdl .set_body ("out_PREDICT_PHT_ADDRESS_"+toString(i)+" <= in_PREDICT_ADDRESS_"+toString(i)+std_logic_range(_param._pht_size_address)+";");109 vhdl->set_body ("out_PREDICT_"+toString(i)+"_PHT_ADDRESS <= in_PREDICT_"+toString(i)+"_ADDRESS"+std_logic_range(_param._pht_size_address)+";"); 110 110 } 111 111 } … … 115 115 // The address is higher than the address size of bht 116 116 if (_param._have_bht) 117 vhdl .set_body ("out_BRANCH_COMPLETE_BHT_ADDRESS_"+toString(i)+" <= in_BRANCH_COMPLETE_ADDRESS_"+toString(i)+std_logic_range(_param._bht_size_address)+";");117 vhdl->set_body ("out_BRANCH_COMPLETE_"+toString(i)+"_BHT_ADDRESS <= in_BRANCH_COMPLETE_"+toString(i)+"_ADDRESS"+std_logic_range(_param._bht_size_address)+";"); 118 118 119 119 if (_param._have_pht) … … 129 129 { 130 130 min = _param._pht_size_address_shift; 131 vhdl .set_body ("out_BRANCH_COMPLETE_PHT_ADDRESS_"+toString(i)+std_logic_range(min) + " <= in_BRANCH_COMPLETE_BHT_HISTORY_"+toString(i)+std_logic_range(min)+";");131 vhdl->set_body ("out_BRANCH_COMPLETE_"+toString(i)+"_PHT_ADDRESS"+std_logic_range(min) + " <= in_BRANCH_COMPLETE_"+toString(i)+"_BHT_HISTORY"+std_logic_range(min)+";"); 132 132 } 133 133 … … 135 135 { 136 136 max = _param._bht_size_history; 137 vhdl .set_body ("out_BRANCH_COMPLETE_PHT_ADDRESS_"+toString(i)+std_logic_range(_param._pht_size_address-1,max) + " <= in_BRANCH_COMPLETE_ADDRESS_"+toString(i)+std_logic_range(_param._pht_size_address-1-_param._pht_size_address_shift, _param._pht_size_address_share)+";");137 vhdl->set_body ("out_BRANCH_COMPLETE_"+toString(i)+"_PHT_ADDRESS"+std_logic_range(_param._pht_size_address-1,max) + " <= in_BRANCH_COMPLETE_"+toString(i)+"_ADDRESS"+std_logic_range(_param._pht_size_address-1-_param._pht_size_address_shift, _param._pht_size_address_share)+";"); 138 138 } 139 139 140 140 // intersection 141 141 if (_param._pht_size_address_share > 0) 142 vhdl .set_body ("out_BRANCH_COMPLETE_PHT_ADDRESS_"+toString(i)+std_logic_range(max-1,min) + " <= in_BRANCH_COMPLETE_ADDRESS_"+toString(i)+std_logic_range(_param._pht_size_address_share-1,0)+" xor in_BRANCH_COMPLETE_BHT_HISTORY_"+toString(i)+std_logic_range(max-1,min)+";");142 vhdl->set_body ("out_BRANCH_COMPLETE_"+toString(i)+"_PHT_ADDRESS"+std_logic_range(max-1,min) + " <= in_BRANCH_COMPLETE_"+toString(i)+"_ADDRESS"+std_logic_range(_param._pht_size_address_share-1,0)+" xor in_BRANCH_COMPLETE_"+toString(i)+"_BHT_HISTORY"+std_logic_range(max-1,min)+";"); 143 143 } 144 144 else 145 vhdl .set_body ("out_BRANCH_COMPLETE_PHT_ADDRESS_"+toString(i)+" <= in_BRANCH_COMPLETE_ADDRESS_"+toString(i)+std_logic_range(_param._pht_size_address)+";");145 vhdl->set_body ("out_BRANCH_COMPLETE_"+toString(i)+"_PHT_ADDRESS <= in_BRANCH_COMPLETE_"+toString(i)+"_ADDRESS"+std_logic_range(_param._pht_size_address)+";"); 146 146 } 147 147 } -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Two_Level_Branch_Predictor_Glue/src/Two_Level_Branch_Predictor_Glue_vhdl_declaration.cpp
r2 r42 18 18 19 19 20 void Two_Level_Branch_Predictor_Glue::vhdl_declaration (Vhdl & vhdl)20 void Two_Level_Branch_Predictor_Glue::vhdl_declaration (Vhdl * & vhdl) 21 21 { 22 22 log_printf(FUNC,Two_Level_Branch_Predictor_Glue,"vhdl_declaration","Begin"); -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Two_Level_Branch_Predictor_Glue/src/Two_Level_Branch_Predictor_Glue_vhdl_port.cpp
r3 r42 18 18 19 19 20 void Two_Level_Branch_Predictor_Glue::vhdl_port (Vhdl & vhdl)20 void Two_Level_Branch_Predictor_Glue::vhdl_port (Vhdl * & vhdl) 21 21 { 22 22 log_printf(FUNC,Two_Level_Branch_Predictor_Glue,"vhdl_port","Begin"); 23 23 24 for (uint32_t i=0; i<_param._nb_prediction; i++) 25 { 26 if (_param._have_bht) 27 { 28 vhdl.set_port (" in_PREDICT_BHT_ACK_" +toString(i), IN, 1); 29 vhdl.set_port ("out_PREDICT_BHT_ADDRESS_"+toString(i),OUT,_param._bht_size_address); 30 } 31 if (_param._have_bht and _param._have_pht) 32 vhdl.set_port (" in_PREDICT_BHT_HISTORY_"+toString(i), IN,_param._bht_size_history); 33 if (_param._have_pht) 34 { 35 vhdl.set_port (" in_PREDICT_PHT_ACK_" +toString(i), IN, 1); 36 vhdl.set_port ("out_PREDICT_PHT_ADDRESS_"+toString(i),OUT,_param._pht_size_address); 37 } 38 39 vhdl.set_port ("out_PREDICT_ACK_" +toString(i),OUT, 1); 40 vhdl.set_port (" in_PREDICT_ADDRESS_" +toString(i), IN,_param._size_address); 41 } 42 43 for (uint32_t i=0; i<_param._nb_branch_complete; i++) 44 { 45 if (_param._have_bht) 46 { 47 vhdl.set_port (" in_BRANCH_COMPLETE_BHT_ACK_" +toString(i), IN, 1); 48 vhdl.set_port ("out_BRANCH_COMPLETE_BHT_ADDRESS_"+toString(i),OUT,_param._bht_size_address); 49 } 50 if (_param._have_bht and _param._have_pht) 51 vhdl.set_port (" in_BRANCH_COMPLETE_BHT_HISTORY_"+toString(i), IN,_param._bht_size_history); 52 if (_param._have_pht) 53 { 54 vhdl.set_port (" in_BRANCH_COMPLETE_PHT_ACK_" +toString(i), IN, 1); 55 vhdl.set_port ("out_BRANCH_COMPLETE_PHT_ADDRESS_"+toString(i),OUT,_param._pht_size_address); 56 } 57 vhdl.set_port ("out_BRANCH_COMPLETE_ACK_" +toString(i),OUT, 1); 58 vhdl.set_port (" in_BRANCH_COMPLETE_ADDRESS_" +toString(i), IN,_param._size_address); 59 } 24 _interfaces->set_port(vhdl); 60 25 61 26 log_printf(FUNC,Two_Level_Branch_Predictor_Glue,"vhdl_port","End"); -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Two_Level_Branch_Predictor_Glue/src/Two_Level_Branch_Predictor_Glue_vhdl_testbench_transition.cpp
r2 r42 22 22 log_printf(FUNC,Two_Level_Branch_Predictor_Glue,"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 Two_Level_Branch_Predictor_Glue_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 for (uint32_t i=0; i<_param._nb_prediction; i++) 34 { 35 if (_param._have_bht) 36 { 37 _vhdl_testbench->add_input (PORT_READ( in_PREDICT_BHT_ACK [i])); 38 _vhdl_testbench->add_output (PORT_READ(out_PREDICT_BHT_ADDRESS [i])); 39 } 40 if (_param._have_bht and _param._have_pht) 41 _vhdl_testbench->add_input (PORT_READ( in_PREDICT_BHT_HISTORY [i])); 42 if (_param._have_pht) 43 { 44 _vhdl_testbench->add_input (PORT_READ( in_PREDICT_PHT_ACK [i])); 45 _vhdl_testbench->add_output (PORT_READ(out_PREDICT_PHT_ADDRESS [i])); 46 } 47 _vhdl_testbench->add_output (PORT_READ(out_PREDICT_ACK [i])); 48 _vhdl_testbench->add_input (PORT_READ( in_PREDICT_ADDRESS [i])); 49 } 50 51 for (uint32_t i=0; i<_param._nb_branch_complete; i++) 52 { 53 if (_param._have_bht) 54 { 55 _vhdl_testbench->add_input (PORT_READ( in_BRANCH_COMPLETE_BHT_ACK [i])); 56 _vhdl_testbench->add_output (PORT_READ(out_BRANCH_COMPLETE_BHT_ADDRESS [i])); 57 } 58 if (_param._have_bht and _param._have_pht) 59 _vhdl_testbench->add_input (PORT_READ( in_BRANCH_COMPLETE_BHT_HISTORY [i])); 60 if (_param._have_pht) 61 { 62 _vhdl_testbench->add_input (PORT_READ( in_BRANCH_COMPLETE_PHT_ACK [i])); 63 _vhdl_testbench->add_output (PORT_READ(out_BRANCH_COMPLETE_PHT_ADDRESS [i])); 64 } 65 _vhdl_testbench->add_output (PORT_READ(out_BRANCH_COMPLETE_ACK [i])); 66 _vhdl_testbench->add_input (PORT_READ( in_BRANCH_COMPLETE_ADDRESS [i])); 67 } 68 // add_test : 69 // - True : the cycle must be compare with the output of systemC 70 // - False : no test 71 _vhdl_testbench->add_test(true); 72 73 _vhdl_testbench->new_cycle (); // always at the end 26 _interfaces->testbench(); 74 27 75 28 log_printf(FUNC,Two_Level_Branch_Predictor_Glue,"vhdl_testbench_transition","End");
Note: See TracChangeset
for help on using the changeset viewer.