Changeset 111 for trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Direction
- Timestamp:
- Feb 27, 2009, 7:37:40 PM (15 years ago)
- Location:
- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Direction
- Files:
-
- 9 added
- 33 edited
- 4 moved
Legend:
- Unmodified
- Added
- Removed
-
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Direction/Meta_Predictor/Meta_Predictor_Glue/SelfTest/config_meta_predictor.cfg
r110 r111 1 1 Meta_Predictor_Glue 2 4 4 +1 # nb_inst_predict 3 4 4 +1 # nb_inst_update 4 3 3 +1 # nb_predictor 5 8 8 +1 # predictor_size_history [0] [nb_predictor] 6 17 17 +1 # predictor_size_history [1] [nb_predictor] 7 4 4 +1 # predictor_size_history [2] [nb_predictor] 8 1 1 +1 # predictor_update_on_prediction [0] [nb_predictor] 9 1 1 +1 # predictor_update_on_prediction [1] [nb_predictor] 10 0 0 +1 # predictor_update_on_prediction [2] [nb_predictor] -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Direction/Meta_Predictor/Meta_Predictor_Glue/SelfTest/src/main.cpp
r110 r111 7 7 8 8 #include "Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Direction/Meta_Predictor/Meta_Predictor_Glue/SelfTest/include/test.h" 9 #include "Behavioural/include/Selftest.h" 9 10 10 #define NB_PARAMS 011 #define NB_PARAMS 3 11 12 12 13 void usage (int argc, char * argv[]) … … 14 15 err (_("<Usage> %s name_instance list_params.\n"),argv[0]); 15 16 err (_("list_params is :\n")); 16 err (_(" * ()\n")); 17 err (_(" * nb_inst_predict (uint32_t)\n")); 18 err (_(" * nb_inst_update (uint32_t)\n")); 19 err (_(" * nb_predictor (uint32_t)\n")); 20 err (_(" * predictor_size_history [nb_predictor] (uint32_t)\n")); 21 err (_(" * predictor_update_on_prediction [nb_predictor] (bool )\n")); 17 22 18 23 exit (1); … … 25 30 #endif 26 31 { 27 if (argc != static_cast<int>(2+NB_PARAMS))32 if (argc <= static_cast<int>(2+NB_PARAMS)) 28 33 usage (argc, argv); 29 34 … … 32 37 string name = argv[x++]; 33 38 39 uint32_t _nb_inst_predict ; 40 uint32_t _nb_inst_update ; 41 uint32_t _nb_predictor ; 42 uint32_t * _predictor_size_history ;//[nb_predictor] 43 bool * _predictor_update_on_prediction;//[nb_predictor] 44 45 SELFTEST0(_nb_inst_predict ,uint32_t,argv,x); 46 SELFTEST0(_nb_inst_update ,uint32_t,argv,x); 47 SELFTEST0(_nb_predictor ,uint32_t,argv,x); 48 49 if (argc != static_cast<int>(2+NB_PARAMS+2*_nb_predictor)) 50 usage (argc, argv); 51 52 SELFTEST1(_predictor_size_history ,uint32_t,argv,x,_nb_predictor); 53 SELFTEST1(_predictor_update_on_prediction,bool ,argv,x,_nb_predictor); 54 34 55 int _return = EXIT_SUCCESS; 35 56 try … … 37 58 morpheo::behavioural::core::multi_front_end::front_end::prediction_unit::direction::meta_predictor::meta_predictor_glue::Parameters * param = new morpheo::behavioural::core::multi_front_end::front_end::prediction_unit::direction::meta_predictor::meta_predictor_glue::Parameters 38 59 ( 60 _nb_inst_predict , 61 _nb_inst_update , 62 _nb_predictor , 63 _predictor_size_history , 64 _predictor_update_on_prediction, 39 65 true //is_toplevel 40 66 ); … … 63 89 } 64 90 91 DELETE1(_predictor_update_on_prediction,_param->_nb_predictor); 92 DELETE1(_predictor_size_history ,_param->_nb_predictor); 93 65 94 return (_return); 66 95 } -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Direction/Meta_Predictor/Meta_Predictor_Glue/SelfTest/src/test.cpp
r110 r111 51 51 sc_signal<Tcontrol_t> * in_NRESET = new sc_signal<Tcontrol_t> ("NRESET"); 52 52 53 ALLOC1_SC_SIGNAL( in_PREDICT_VAL ," in_PREDICT_VAL ",Tcontrol_t,_param->_nb_inst_predict); 54 ALLOC1_SC_SIGNAL(out_PREDICT_ACK ,"out_PREDICT_ACK ",Tcontrol_t,_param->_nb_inst_predict); 55 ALLOC1_SC_SIGNAL(out_PREDICT_HISTORY ,"out_PREDICT_HISTORY ",Thistory_t,_param->_nb_inst_predict); 56 ALLOC1_SC_SIGNAL(out_PREDICT_DIRECTION ,"out_PREDICT_DIRECTION ",Tcontrol_t,_param->_nb_inst_predict); 57 ALLOC2_SC_SIGNAL(out_PREDICT_PREDICTOR_VAL ,"out_PREDICT_PREDICTOR_VAL ",Tcontrol_t,_param->_nb_predictor,_param->_nb_inst_predict); 58 ALLOC2_SC_SIGNAL( in_PREDICT_PREDICTOR_ACK ," in_PREDICT_PREDICTOR_ACK ",Tcontrol_t,_param->_nb_predictor,_param->_nb_inst_predict); 59 ALLOC2_SC_SIGNAL( in_PREDICT_PREDICTOR_HISTORY ," in_PREDICT_PREDICTOR_HISTORY ",Thistory_t,_param->_nb_predictor,_param->_nb_inst_predict); 60 ALLOC2_SC_SIGNAL( in_PREDICT_PREDICTOR_DIRECTION ," in_PREDICT_PREDICTOR_DIRECTION ",Tcontrol_t,_param->_nb_predictor,_param->_nb_inst_predict); 61 ALLOC2_SC_SIGNAL(out_PREDICT_PREDICTOR_DIRECTION_VAL,"out_PREDICT_PREDICTOR_DIRECTION_VAL",Tcontrol_t,_param->_nb_predictor,_param->_nb_inst_predict); // if update_on_prediction 62 ALLOC2_SC_SIGNAL(out_PREDICT_PREDICTOR_DIRECTION ,"out_PREDICT_PREDICTOR_DIRECTION ",Tcontrol_t,_param->_nb_predictor,_param->_nb_inst_predict); // if update_on_prediction 63 ALLOC1_SC_SIGNAL( in_UPDATE_VAL ," in_UPDATE_VAL ",Tcontrol_t,_param->_nb_inst_update); 64 ALLOC1_SC_SIGNAL(out_UPDATE_ACK ,"out_UPDATE_ACK ",Tcontrol_t,_param->_nb_inst_update); 65 ALLOC1_SC_SIGNAL( in_UPDATE_HISTORY ," in_UPDATE_HISTORY ",Thistory_t,_param->_nb_inst_update); 66 ALLOC1_SC_SIGNAL( in_UPDATE_DIRECTION ," in_UPDATE_DIRECTION ",Tcontrol_t,_param->_nb_inst_update); 67 ALLOC2_SC_SIGNAL(out_UPDATE_PREDICTOR_VAL ,"out_UPDATE_PREDICTOR_VAL ",Tcontrol_t,_param->_nb_predictor,_param->_nb_inst_update); 68 ALLOC2_SC_SIGNAL( in_UPDATE_PREDICTOR_ACK ," in_UPDATE_PREDICTOR_ACK ",Tcontrol_t,_param->_nb_predictor,_param->_nb_inst_update); 69 ALLOC2_SC_SIGNAL(out_UPDATE_PREDICTOR_HISTORY ,"out_UPDATE_PREDICTOR_HISTORY ",Thistory_t,_param->_nb_predictor,_param->_nb_inst_update); 70 ALLOC2_SC_SIGNAL(out_UPDATE_PREDICTOR_DIRECTION ,"out_UPDATE_PREDICTOR_DIRECTION ",Tcontrol_t,_param->_nb_predictor,_param->_nb_inst_update); 71 ALLOC2_SC_SIGNAL(out_UPDATE_PREDICTOR_MISS ,"out_UPDATE_PREDICTOR_MISS ",Tcontrol_t,_param->_nb_predictor,_param->_nb_inst_update); 72 53 73 /******************************************************** 54 74 * Instanciation … … 60 80 (*(_Meta_Predictor_Glue->in_NRESET)) (*(in_NRESET)); 61 81 82 INSTANCE1_SC_SIGNAL(_Meta_Predictor_Glue, in_PREDICT_VAL ,_param->_nb_inst_predict); 83 INSTANCE1_SC_SIGNAL(_Meta_Predictor_Glue,out_PREDICT_ACK ,_param->_nb_inst_predict); 84 INSTANCE1_SC_SIGNAL(_Meta_Predictor_Glue,out_PREDICT_HISTORY ,_param->_nb_inst_predict); 85 INSTANCE1_SC_SIGNAL(_Meta_Predictor_Glue,out_PREDICT_DIRECTION ,_param->_nb_inst_predict); 86 87 INSTANCE2_SC_SIGNAL(_Meta_Predictor_Glue,out_PREDICT_PREDICTOR_VAL ,_param->_nb_predictor,_param->_nb_inst_predict); 88 INSTANCE2_SC_SIGNAL(_Meta_Predictor_Glue, in_PREDICT_PREDICTOR_ACK ,_param->_nb_predictor,_param->_nb_inst_predict); 89 INSTANCE2_SC_SIGNAL(_Meta_Predictor_Glue, in_PREDICT_PREDICTOR_HISTORY ,_param->_nb_predictor,_param->_nb_inst_predict); 90 INSTANCE2_SC_SIGNAL(_Meta_Predictor_Glue, in_PREDICT_PREDICTOR_DIRECTION ,_param->_nb_predictor,_param->_nb_inst_predict); 91 92 for (uint32_t i=0; i<_param->_nb_predictor; ++i) 93 if (_param->_predictor_update_on_prediction [i]) 94 { 95 INSTANCE1_SC_SIGNAL(_Meta_Predictor_Glue,out_PREDICT_PREDICTOR_DIRECTION_VAL[i],_param->_nb_inst_predict); 96 INSTANCE1_SC_SIGNAL(_Meta_Predictor_Glue,out_PREDICT_PREDICTOR_DIRECTION [i],_param->_nb_inst_predict); 97 } 98 99 INSTANCE1_SC_SIGNAL(_Meta_Predictor_Glue, in_UPDATE_VAL ,_param->_nb_inst_update); 100 INSTANCE1_SC_SIGNAL(_Meta_Predictor_Glue,out_UPDATE_ACK ,_param->_nb_inst_update); 101 INSTANCE1_SC_SIGNAL(_Meta_Predictor_Glue, in_UPDATE_HISTORY ,_param->_nb_inst_update); 102 INSTANCE1_SC_SIGNAL(_Meta_Predictor_Glue, in_UPDATE_DIRECTION ,_param->_nb_inst_update); 103 104 INSTANCE2_SC_SIGNAL(_Meta_Predictor_Glue,out_UPDATE_PREDICTOR_VAL ,_param->_nb_predictor,_param->_nb_inst_update); 105 INSTANCE2_SC_SIGNAL(_Meta_Predictor_Glue, in_UPDATE_PREDICTOR_ACK ,_param->_nb_predictor,_param->_nb_inst_update); 106 INSTANCE2_SC_SIGNAL(_Meta_Predictor_Glue,out_UPDATE_PREDICTOR_HISTORY ,_param->_nb_predictor,_param->_nb_inst_update); 107 INSTANCE2_SC_SIGNAL(_Meta_Predictor_Glue,out_UPDATE_PREDICTOR_DIRECTION ,_param->_nb_predictor,_param->_nb_inst_update); 108 for (uint32_t i=0; i<_param->_nb_predictor; ++i) 109 if (_param->_predictor_update_on_prediction [i]) 110 INSTANCE1_SC_SIGNAL(_Meta_Predictor_Glue,out_UPDATE_PREDICTOR_MISS [i] ,_param->_nb_inst_update); 62 111 63 112 msg(_("<%s> : Start Simulation ............\n"),name.c_str()); … … 104 153 delete in_CLOCK; 105 154 delete in_NRESET; 155 156 DELETE1_SC_SIGNAL( in_PREDICT_VAL ,_param->_nb_inst_predict); 157 DELETE1_SC_SIGNAL(out_PREDICT_ACK ,_param->_nb_inst_predict); 158 DELETE1_SC_SIGNAL(out_PREDICT_HISTORY ,_param->_nb_inst_predict); 159 DELETE1_SC_SIGNAL(out_PREDICT_DIRECTION ,_param->_nb_inst_predict); 160 161 DELETE2_SC_SIGNAL(out_PREDICT_PREDICTOR_VAL ,_param->_nb_predictor,_param->_nb_inst_predict); 162 DELETE2_SC_SIGNAL( in_PREDICT_PREDICTOR_ACK ,_param->_nb_predictor,_param->_nb_inst_predict); 163 DELETE2_SC_SIGNAL( in_PREDICT_PREDICTOR_HISTORY ,_param->_nb_predictor,_param->_nb_inst_predict); 164 DELETE2_SC_SIGNAL( in_PREDICT_PREDICTOR_DIRECTION ,_param->_nb_predictor,_param->_nb_inst_predict); 165 DELETE2_SC_SIGNAL(out_PREDICT_PREDICTOR_DIRECTION_VAL,_param->_nb_predictor,_param->_nb_inst_predict); 166 DELETE2_SC_SIGNAL(out_PREDICT_PREDICTOR_DIRECTION ,_param->_nb_predictor,_param->_nb_inst_predict); 167 168 DELETE1_SC_SIGNAL( in_UPDATE_VAL ,_param->_nb_inst_update); 169 DELETE1_SC_SIGNAL(out_UPDATE_ACK ,_param->_nb_inst_update); 170 DELETE1_SC_SIGNAL( in_UPDATE_HISTORY ,_param->_nb_inst_update); 171 DELETE1_SC_SIGNAL( in_UPDATE_DIRECTION ,_param->_nb_inst_update); 172 173 DELETE2_SC_SIGNAL(out_UPDATE_PREDICTOR_VAL ,_param->_nb_predictor,_param->_nb_inst_update); 174 DELETE2_SC_SIGNAL( in_UPDATE_PREDICTOR_ACK ,_param->_nb_predictor,_param->_nb_inst_update); 175 DELETE2_SC_SIGNAL(out_UPDATE_PREDICTOR_HISTORY ,_param->_nb_predictor,_param->_nb_inst_update); 176 DELETE2_SC_SIGNAL(out_UPDATE_PREDICTOR_DIRECTION ,_param->_nb_predictor,_param->_nb_inst_update); 177 DELETE2_SC_SIGNAL(out_UPDATE_PREDICTOR_MISS ,_param->_nb_predictor,_param->_nb_inst_update); 106 178 } 107 179 #endif -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Direction/Meta_Predictor/Meta_Predictor_Glue/include/Meta_Predictor_Glue.h
r110 r111 66 66 public : SC_IN (Tcontrol_t) * in_NRESET ; 67 67 68 // ~~~~~[ Interface : "predict" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 69 public : SC_IN (Tcontrol_t) ** in_PREDICT_VAL ;// [nb_inst_predict] 70 public : SC_OUT(Tcontrol_t) ** out_PREDICT_ACK ;// [nb_inst_predict] 71 public : SC_OUT(Thistory_t) ** out_PREDICT_HISTORY ;// [nb_inst_predict] 72 public : SC_OUT(Tcontrol_t) ** out_PREDICT_DIRECTION ;// [nb_inst_predict] 73 74 public : SC_OUT(Tcontrol_t) *** out_PREDICT_PREDICTOR_VAL ;//[nb_predictor][nb_inst_predict] 75 public : SC_IN (Tcontrol_t) *** in_PREDICT_PREDICTOR_ACK ;//[nb_predictor][nb_inst_predict] 76 public : SC_IN (Thistory_t) *** in_PREDICT_PREDICTOR_HISTORY ;//[nb_predictor][nb_inst_predict] 77 public : SC_IN (Tcontrol_t) *** in_PREDICT_PREDICTOR_DIRECTION ;//[nb_predictor][nb_inst_predict] 78 public : SC_OUT(Tcontrol_t) *** out_PREDICT_PREDICTOR_DIRECTION_VAL;//[nb_predictor][nb_inst_predict] // if update_on_prediction 79 public : SC_OUT(Tcontrol_t) *** out_PREDICT_PREDICTOR_DIRECTION ;//[nb_predictor][nb_inst_predict] // if update_on_prediction 80 81 // ~~~~~[ Interface : "update" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 82 public : SC_IN (Tcontrol_t) ** in_UPDATE_VAL ;// [nb_inst_update] 83 public : SC_OUT(Tcontrol_t) ** out_UPDATE_ACK ;// [nb_inst_update] 84 public : SC_IN (Thistory_t) ** in_UPDATE_HISTORY ;// [nb_inst_update] 85 public : SC_IN (Tcontrol_t) ** in_UPDATE_DIRECTION ;// [nb_inst_update] 86 87 public : SC_OUT(Tcontrol_t) *** out_UPDATE_PREDICTOR_VAL ;//[nb_predictor][nb_inst_update] 88 public : SC_IN (Tcontrol_t) *** in_UPDATE_PREDICTOR_ACK ;//[nb_predictor][nb_inst_update] 89 public : SC_OUT(Thistory_t) *** out_UPDATE_PREDICTOR_HISTORY ;//[nb_predictor][nb_inst_update] 90 public : SC_OUT(Tcontrol_t) *** out_UPDATE_PREDICTOR_DIRECTION ;//[nb_predictor][nb_inst_update] 91 public : SC_OUT(Tcontrol_t) *** out_UPDATE_PREDICTOR_MISS ;//[nb_predictor][nb_inst_update] // if update_on_prediction 92 68 93 // ~~~~~[ Component ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 69 94 … … 105 130 public : void transition (void); 106 131 //public : void genMoore (void); 132 133 public : void genMealy_predict_valack (void); 134 public : void genMealy_predict (void); 135 136 public : void genMealy_update_valack (void); 137 public : void genMealy_update (void); 107 138 #endif 108 139 -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Direction/Meta_Predictor/Meta_Predictor_Glue/include/Parameters.h
r110 r111 11 11 #include "Behavioural/include/Parameters.h" 12 12 #include "Common/include/Debug.h" 13 #include "Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Direction/Meta_Predictor/Meta_Predictor_Glue/include/Types.h" 13 14 14 15 namespace morpheo { … … 26 27 { 27 28 //-----[ fields ]------------------------------------------------------------ 29 public : uint32_t _nb_inst_predict ; 30 public : uint32_t _nb_inst_update ; 31 public : uint32_t _nb_predictor ; 32 public : uint32_t * _predictor_size_history ;//[nb_predictor] 33 public : bool * _predictor_update_on_prediction;//[nb_predictor] 34 35 public : uint32_t _size_history ; 36 public : uint32_t * _predictor_history_shift ;//[nb_predictor] 37 public : uint32_t * _predictor_history_shift_msb ;//[nb_predictor] 38 public : Thistory_t * _predictor_history_mask ;//[nb_predictor] 39 28 40 29 41 //-----[ methods ]----------------------------------------------------------- 30 public : Parameters (bool is_toplevel=false); 42 public : Parameters (uint32_t nb_inst_predict , 43 uint32_t nb_inst_update , 44 uint32_t nb_predictor , 45 uint32_t * predictor_size_history ,//[nb_predictor] 46 bool * predictor_update_on_prediction,//[nb_predictor] 47 bool is_toplevel=false); 31 48 //public : Parameters (Parameters & param) ; 32 49 public : ~Parameters (void); -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Direction/Meta_Predictor/Meta_Predictor_Glue/src/Meta_Predictor_Glue.cpp
r110 r111 82 82 # endif 83 83 84 // log_printf(INFO,Meta_Predictor_Glue,FUNCTION,_("<%s> : Method - genMoore"),_name.c_str());84 log_printf(INFO,Meta_Predictor_Glue,FUNCTION,_("<%s> : Method - genMealy_update_valack"),_name.c_str()); 85 85 86 // SC_METHOD (genMoore); 87 // dont_initialize (); 88 // sensitive << (*(in_CLOCK)).neg(); // need internal register 89 90 // # ifdef SYSTEMCASS_SPECIFIC 91 // // List dependency information 92 // # endif 86 SC_METHOD (genMealy_update_valack); 87 dont_initialize (); 88 // sensitive << (*(in_CLOCK)).neg(); // don't need internal register 89 for (uint32_t i=0; i<_param->_nb_inst_update; ++i) 90 { 91 sensitive << (*(in_UPDATE_VAL [i])); 92 93 for (uint32_t j=0; j<_param->_nb_predictor; ++j) 94 sensitive << (*(in_UPDATE_PREDICTOR_ACK [j][i])); 95 } 96 97 log_printf(INFO,Meta_Predictor_Glue,FUNCTION,_("<%s> : Method - genMealy_update"),_name.c_str()); 98 99 SC_METHOD (genMealy_update); 100 dont_initialize (); 101 // sensitive << (*(in_CLOCK)).neg(); // don't need internal register 102 for (uint32_t i=0; i<_param->_nb_inst_update; ++i) 103 sensitive << (*(in_UPDATE_HISTORY [i])) 104 << (*(in_UPDATE_DIRECTION [i])); 105 106 # ifdef SYSTEMCASS_SPECIFIC 107 // List dependency information 108 # endif 109 110 log_printf(INFO,Meta_Predictor_Glue,FUNCTION,_("<%s> : Method - genMealy_predict_valack"),_name.c_str()); 111 112 SC_METHOD (genMealy_predict_valack); 113 dont_initialize (); 114 // sensitive << (*(in_CLOCK)).neg(); // don't need internal register 115 for (uint32_t i=0; i<_param->_nb_inst_predict; ++i) 116 { 117 sensitive << (*(in_PREDICT_VAL [i])); 118 119 for (uint32_t j=0; j<_param->_nb_predictor; ++j) 120 sensitive << (*(in_PREDICT_PREDICTOR_ACK [j][i])); 121 } 122 123 # ifdef SYSTEMCASS_SPECIFIC 124 // List dependency information 125 # endif 126 127 log_printf(INFO,Meta_Predictor_Glue,FUNCTION,_("<%s> : Method - genMealy_predict"),_name.c_str()); 128 129 SC_METHOD (genMealy_predict); 130 dont_initialize (); 131 // sensitive << (*(in_CLOCK)).neg(); // don't need internal register 132 for (uint32_t i=0; i<_param->_nb_inst_predict; ++i) 133 for (uint32_t j=0; j<_param->_nb_predictor; ++j) 134 sensitive << (*(in_PREDICT_PREDICTOR_HISTORY [j][i])) 135 << (*(in_PREDICT_PREDICTOR_DIRECTION [j][i])); 136 137 # ifdef SYSTEMCASS_SPECIFIC 138 // List dependency information 139 # endif 93 140 94 141 #endif -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Direction/Meta_Predictor/Meta_Predictor_Glue/src/Meta_Predictor_Glue_allocation.cpp
r110 r111 58 58 in_NRESET = interface->set_signal_in <Tcontrol_t> ("nreset",1, RESET_VHDL_YES); 59 59 } 60 61 // ~~~~~[ Interface : "predict" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 62 { 63 ALLOC1_INTERFACE("predict",IN,NORTH,_("Predict next address"),_param->_nb_inst_predict); 64 65 ALLOC1_SIGNAL_IN ( in_PREDICT_VAL ,"VAL" ,Tcontrol_t,1); 66 ALLOC1_SIGNAL_OUT(out_PREDICT_ACK ,"ACK" ,Tcontrol_t,1); 67 ALLOC1_SIGNAL_OUT(out_PREDICT_HISTORY ,"HISTORY" ,Thistory_t,_param->_size_history); 68 ALLOC1_SIGNAL_OUT(out_PREDICT_DIRECTION ,"DIRECTION" ,Tcontrol_t,1); 69 } 70 71 { 72 ALLOC2_INTERFACE("predict_predictor",IN,NORTH,_("Predict next address"),_param->_nb_predictor,_param->_nb_inst_predict); 73 74 ALLOC2_SIGNAL_OUT(out_PREDICT_PREDICTOR_VAL ,"VAL" ,Tcontrol_t,1); 75 ALLOC2_SIGNAL_IN ( in_PREDICT_PREDICTOR_ACK ,"ACK" ,Tcontrol_t,1); 76 ALLOC2_SIGNAL_IN ( in_PREDICT_PREDICTOR_HISTORY ,"HISTORY" ,Thistory_t,_param->_predictor_size_history[it1]); 77 ALLOC2_SIGNAL_IN ( in_PREDICT_PREDICTOR_DIRECTION ,"DIRECTION" ,Tcontrol_t,1); 78 ALLOC2_SIGNAL_OUT(out_PREDICT_PREDICTOR_DIRECTION_VAL,"DIRECTION_VAL",Tcontrol_t,(_param->_predictor_update_on_prediction [it1])?1:0); 79 ALLOC2_SIGNAL_OUT(out_PREDICT_PREDICTOR_DIRECTION ,"DIRECTION" ,Tcontrol_t,(_param->_predictor_update_on_prediction [it1])?1:0); 80 } 81 82 // ~~~~~[ Interface : "update" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 83 { 84 ALLOC1_INTERFACE("update",IN,NORTH,_("Update predictor"),_param->_nb_inst_update); 85 86 ALLOC1_SIGNAL_IN ( in_UPDATE_VAL ,"VAL" ,Tcontrol_t,1); 87 ALLOC1_SIGNAL_OUT(out_UPDATE_ACK ,"ACK" ,Tcontrol_t,1); 88 ALLOC1_SIGNAL_IN ( in_UPDATE_HISTORY ,"HISTORY" ,Thistory_t,_param->_size_history); 89 ALLOC1_SIGNAL_IN ( in_UPDATE_DIRECTION ,"DIRECTION" ,Tcontrol_t,1); 90 } 91 { 92 ALLOC2_INTERFACE("update_predictor",IN,NORTH,_("Update predictor"),_param->_nb_predictor,_param->_nb_inst_update); 93 94 ALLOC2_SIGNAL_OUT(out_UPDATE_PREDICTOR_VAL ,"VAL" ,Tcontrol_t,1); 95 ALLOC2_SIGNAL_IN ( in_UPDATE_PREDICTOR_ACK ,"ACK" ,Tcontrol_t,1); 96 ALLOC2_SIGNAL_OUT(out_UPDATE_PREDICTOR_HISTORY ,"HISTORY" ,Thistory_t,_param->_predictor_size_history[it1]); 97 ALLOC2_SIGNAL_OUT(out_UPDATE_PREDICTOR_DIRECTION ,"DIRECTION" ,Tcontrol_t,1); 98 ALLOC2_SIGNAL_OUT(out_UPDATE_PREDICTOR_MISS ,"MISS" ,Tcontrol_t,(_param->_predictor_update_on_prediction [it1])?1:0); 99 } 100 60 101 // ~~~~~[ Component ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 61 102 -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Direction/Meta_Predictor/Meta_Predictor_Glue/src/Meta_Predictor_Glue_deallocation.cpp
r110 r111 30 30 delete in_CLOCK ; 31 31 delete in_NRESET; 32 33 DELETE1_SIGNAL( in_PREDICT_VAL ,_param->_nb_inst_predict,1); 34 DELETE1_SIGNAL(out_PREDICT_ACK ,_param->_nb_inst_predict,1); 35 DELETE1_SIGNAL(out_PREDICT_HISTORY ,_param->_nb_inst_predict,_param->_size_history); 36 DELETE1_SIGNAL(out_PREDICT_DIRECTION ,_param->_nb_inst_predict,1); 37 38 DELETE2_SIGNAL(out_PREDICT_PREDICTOR_VAL ,_param->_nb_predictor,_param->_nb_inst_predict,1); 39 DELETE2_SIGNAL( in_PREDICT_PREDICTOR_ACK ,_param->_nb_predictor,_param->_nb_inst_predict,1); 40 DELETE2_SIGNAL( in_PREDICT_PREDICTOR_HISTORY ,_param->_nb_predictor,_param->_nb_inst_predict,_param->_predictor_size_history[it1]); 41 DELETE2_SIGNAL( in_PREDICT_PREDICTOR_DIRECTION ,_param->_nb_predictor,_param->_nb_inst_predict,1); 42 DELETE2_SIGNAL(out_PREDICT_PREDICTOR_DIRECTION_VAL,_param->_nb_predictor,_param->_nb_inst_predict,(_param->_predictor_update_on_prediction [it1])?1:0); 43 DELETE2_SIGNAL(out_PREDICT_PREDICTOR_DIRECTION ,_param->_nb_predictor,_param->_nb_inst_predict,(_param->_predictor_update_on_prediction [it1])?1:0); 44 45 DELETE1_SIGNAL( in_UPDATE_VAL ,_param->_nb_inst_update,1); 46 DELETE1_SIGNAL(out_UPDATE_ACK ,_param->_nb_inst_update,1); 47 DELETE1_SIGNAL( in_UPDATE_HISTORY ,_param->_nb_inst_update,_param->_size_history); 48 DELETE1_SIGNAL( in_UPDATE_DIRECTION ,_param->_nb_inst_update,1); 49 50 DELETE2_SIGNAL(out_UPDATE_PREDICTOR_VAL ,_param->_nb_predictor,_param->_nb_inst_update,1); 51 DELETE2_SIGNAL( in_UPDATE_PREDICTOR_ACK ,_param->_nb_predictor,_param->_nb_inst_update,1); 52 DELETE2_SIGNAL(out_UPDATE_PREDICTOR_HISTORY ,_param->_nb_predictor,_param->_nb_inst_update,_param->_predictor_size_history[it1]); 53 DELETE2_SIGNAL(out_UPDATE_PREDICTOR_DIRECTION ,_param->_nb_predictor,_param->_nb_inst_update,1); 54 DELETE2_SIGNAL(out_UPDATE_PREDICTOR_MISS ,_param->_nb_predictor,_param->_nb_inst_update,(_param->_predictor_update_on_prediction [it1])?1:0); 32 55 } 56 33 57 // ~~~~~[ Component ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 34 58 35 59 delete _component; 36 60 -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Direction/Meta_Predictor/Meta_Predictor_Glue/src/Meta_Predictor_Glue_transition.cpp
r110 r111 25 25 { 26 26 log_begin(Meta_Predictor_Glue,FUNCTION); 27 log_function(Meta_Predictor_Glue,FUNCTION,_name.c_str()); 27 28 28 29 #if defined(STATISTICS) or defined(VHDL_TESTBENCH) -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Direction/Meta_Predictor/Meta_Predictor_Glue/src/Parameters.cpp
r110 r111 7 7 8 8 #include "Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Direction/Meta_Predictor/Meta_Predictor_Glue/include/Parameters.h" 9 #include "Behavioural/include/Allocation.h" 10 #include "Common/include/BitManipulation.h" 9 11 10 12 namespace morpheo { … … 21 23 #undef FUNCTION 22 24 #define FUNCTION "Meta_Predictor_Glue::Parameters" 23 Parameters::Parameters (bool is_toplevel) 25 Parameters::Parameters (uint32_t nb_inst_predict , 26 uint32_t nb_inst_update , 27 uint32_t nb_predictor , 28 uint32_t * predictor_size_history ,//[nb_predictor] 29 bool * predictor_update_on_prediction,//[nb_predictor] 30 bool is_toplevel ) 24 31 { 25 32 log_begin(Meta_Predictor_Glue,FUNCTION); 26 33 34 _nb_inst_predict = nb_inst_predict ; 35 _nb_inst_update = nb_inst_update ; 36 _nb_predictor = nb_predictor ; 37 _predictor_size_history = predictor_size_history ; 38 _predictor_update_on_prediction = predictor_update_on_prediction; 39 40 _size_history = 0; 41 for (uint32_t i=0; i<_nb_predictor; ++i) 42 _size_history += _predictor_size_history [i]; 43 27 44 test(); 45 46 ALLOC1(_predictor_history_shift ,uint32_t ,_nb_predictor); 47 ALLOC1(_predictor_history_shift_msb,uint32_t ,_nb_predictor); 48 ALLOC1(_predictor_history_mask ,Thistory_t,_nb_predictor); 49 50 uint32_t shift = 0; 51 for (uint32_t i=0; i<_nb_predictor; ++i) 52 { 53 _predictor_history_shift [i] = shift; 54 _predictor_history_shift_msb [i] = _predictor_size_history [i]-1; 55 _predictor_history_mask [i] = gen_mask<Thistory_t>(_predictor_size_history [i]); 56 57 shift += _predictor_size_history [i]; 58 } 28 59 29 60 if (is_toplevel) … … 57 88 { 58 89 log_begin(Meta_Predictor_Glue,FUNCTION); 90 91 DELETE1(_predictor_history_mask ,_nb_predictor); 92 DELETE1(_predictor_history_shift,_nb_predictor); 93 59 94 log_end(Meta_Predictor_Glue,FUNCTION); 60 95 }; -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Direction/Meta_Predictor/SelfTest/config-alpha_21264.cfg
r110 r111 1 1 Meta_Predictor 2 1 1 +1 # nb_inst_predict 3 1 1 +1 # nb_inst_update 4 30 30 *2 # size_address 5 1 1 +1 # predictor_0_have_bht 6 10 10 +1 # predictor_0_bht_size_shifter 7 1024 1024 *2 # predictor_0_bht_nb_shifter 8 1 1 +1 # predictor_0_have_pht 9 3 3 +1 # predictor_0_pht_size_counter 10 1024 1024 *2 # predictor_0_pht_nb_counter 11 0 0 +1 # predictor_0_pht_size_address_share 12 1 1 +1 # predictor_1_have_bht 13 12 12 +1 # predictor_1_bht_size_shifter 14 2 2 *2 # predictor_1_bht_nb_shifter 15 1 1 +1 # predictor_1_have_pht 16 2 2 +1 # predictor_1_pht_size_counter 17 4096 4096 *2 # predictor_1_pht_nb_counter 18 0 0 +1 # predictor_1_pht_size_address_share 19 0 0 +1 # predictor_2_have_bht 20 4 4 +1 # predictor_2_bht_size_shifter 21 256 256 *2 # predictor_2_bht_nb_shifter 22 1 1 +1 # predictor_2_have_pht 23 2 2 +1 # predictor_2_pht_size_counter 24 4096 4096 *2 # predictor_2_pht_nb_counter 25 0 0 +1 # predictor_2_pht_size_address_share -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Direction/Meta_Predictor/SelfTest/src/main.cpp
r110 r111 7 7 8 8 #include "Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Direction/Meta_Predictor/SelfTest/include/test.h" 9 #include "Behavioural/include/Selftest.h" 9 10 10 #define NB_PARAMS 011 #define NB_PARAMS 3+7*3 11 12 12 13 void usage (int argc, char * argv[]) … … 14 15 err (_("<Usage> %s name_instance list_params.\n"),argv[0]); 15 16 err (_("list_params is :\n")); 16 err (_(" * ()\n")); 17 17 err (_(" * nb_inst_predict (uint32_t)\n")); 18 err (_(" * nb_inst_update (uint32_t)\n")); 19 err (_(" * size_address (uint32_t)\n")); 20 err (_(" * have_bht [3] (bool )\n")); 21 err (_(" * bht_size_shifter [3] (uint32_t)\n")); 22 err (_(" * bht_nb_shifter [3] (uint32_t)\n")); 23 err (_(" * have_pht [3] (bool )\n")); 24 err (_(" * pht_size_counter [3] (uint32_t)\n")); 25 err (_(" * pht_nb_counter [3] (uint32_t)\n")); 26 err (_(" * pht_size_address_share [3] (uint32_t)\n")); 18 27 exit (1); 19 28 } … … 31 40 32 41 string name = argv[x++]; 42 uint32_t _nb_inst_predict ; 43 uint32_t _nb_inst_update ; 44 uint32_t _size_address ; 45 bool _have_bht [3]; 46 uint32_t _bht_size_shifter [3]; 47 uint32_t _bht_nb_shifter [3]; 48 bool _have_pht [3]; 49 uint32_t _pht_size_counter [3]; 50 uint32_t _pht_nb_counter [3]; 51 uint32_t _pht_size_address_share [3]; 52 53 SELFTEST0(_nb_inst_predict ,uint32_t,argv,x); 54 SELFTEST0(_nb_inst_update ,uint32_t,argv,x); 55 SELFTEST0(_size_address ,uint32_t,argv,x); 56 57 for (uint32_t i=0; i<3; ++i) 58 { 59 SELFTEST0(_have_bht [i],bool ,argv,x); 60 SELFTEST0(_bht_size_shifter [i],uint32_t,argv,x); 61 SELFTEST0(_bht_nb_shifter [i],uint32_t,argv,x); 62 SELFTEST0(_have_pht [i],bool ,argv,x); 63 SELFTEST0(_pht_size_counter [i],uint32_t,argv,x); 64 SELFTEST0(_pht_nb_counter [i],uint32_t,argv,x); 65 SELFTEST0(_pht_size_address_share [i],uint32_t,argv,x); 66 } 33 67 34 68 int _return = EXIT_SUCCESS; … … 37 71 morpheo::behavioural::core::multi_front_end::front_end::prediction_unit::direction::meta_predictor::Parameters * param = new morpheo::behavioural::core::multi_front_end::front_end::prediction_unit::direction::meta_predictor::Parameters 38 72 ( 73 _nb_inst_predict , 74 _nb_inst_update , 75 _size_address , 76 _have_bht , 77 _bht_size_shifter , 78 _bht_nb_shifter , 79 _have_pht , 80 _pht_size_counter , 81 _pht_nb_counter , 82 _pht_size_address_share, 39 83 true // is_toplevel 40 84 ); -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Direction/Meta_Predictor/SelfTest/src/test.cpp
r110 r111 50 50 sc_clock * in_CLOCK = new sc_clock ("clock", 1.0, 0.5); 51 51 sc_signal<Tcontrol_t> * in_NRESET = new sc_signal<Tcontrol_t> ("NRESET"); 52 ALLOC1_SC_SIGNAL( in_PREDICT_VAL ," in_PREDICT_VAL ",Tcontrol_t,_param->_nb_inst_predict); 53 ALLOC1_SC_SIGNAL(out_PREDICT_ACK ,"out_PREDICT_ACK ",Tcontrol_t,_param->_nb_inst_predict); 54 ALLOC1_SC_SIGNAL( in_PREDICT_ADDRESS ," in_PREDICT_ADDRESS ",Taddress_t,_param->_nb_inst_predict); 55 ALLOC1_SC_SIGNAL(out_PREDICT_DIRECTION ,"out_PREDICT_DIRECTION ",Tcontrol_t,_param->_nb_inst_predict); 56 ALLOC1_SC_SIGNAL(out_PREDICT_HISTORY ,"out_PREDICT_HISTORY ",Thistory_t,_param->_nb_inst_predict); 57 58 ALLOC1_SC_SIGNAL( in_UPDATE_VAL ," in_UPDATE_VAL ",Tcontrol_t,_param->_nb_inst_update); 59 ALLOC1_SC_SIGNAL(out_UPDATE_ACK ,"out_UPDATE_ACK ",Tcontrol_t,_param->_nb_inst_update); 60 ALLOC1_SC_SIGNAL( in_UPDATE_ADDRESS ," in_UPDATE_ADDRESS ",Taddress_t,_param->_nb_inst_update); 61 ALLOC1_SC_SIGNAL( in_UPDATE_HISTORY ," in_UPDATE_HISTORY ",Thistory_t,_param->_nb_inst_update); 62 ALLOC1_SC_SIGNAL( in_UPDATE_DIRECTION ," in_UPDATE_DIRECTION ",Tcontrol_t,_param->_nb_inst_update); 52 63 53 64 /******************************************************** … … 60 71 (*(_Meta_Predictor->in_NRESET)) (*(in_NRESET)); 61 72 73 INSTANCE1_SC_SIGNAL(_Meta_Predictor, in_PREDICT_VAL ,_param->_nb_inst_predict); 74 INSTANCE1_SC_SIGNAL(_Meta_Predictor,out_PREDICT_ACK ,_param->_nb_inst_predict); 75 INSTANCE1_SC_SIGNAL(_Meta_Predictor, in_PREDICT_ADDRESS ,_param->_nb_inst_predict); 76 INSTANCE1_SC_SIGNAL(_Meta_Predictor,out_PREDICT_DIRECTION ,_param->_nb_inst_predict); 77 INSTANCE1_SC_SIGNAL(_Meta_Predictor,out_PREDICT_HISTORY ,_param->_nb_inst_predict); 78 79 INSTANCE1_SC_SIGNAL(_Meta_Predictor, in_UPDATE_VAL ,_param->_nb_inst_update); 80 INSTANCE1_SC_SIGNAL(_Meta_Predictor,out_UPDATE_ACK ,_param->_nb_inst_update); 81 INSTANCE1_SC_SIGNAL(_Meta_Predictor, in_UPDATE_ADDRESS ,_param->_nb_inst_update); 82 INSTANCE1_SC_SIGNAL(_Meta_Predictor, in_UPDATE_HISTORY ,_param->_nb_inst_update); 83 INSTANCE1_SC_SIGNAL(_Meta_Predictor, in_UPDATE_DIRECTION ,_param->_nb_inst_update); 62 84 63 85 msg(_("<%s> : Start Simulation ............\n"),name.c_str()); … … 104 126 delete in_CLOCK; 105 127 delete in_NRESET; 128 129 DELETE1_SC_SIGNAL( in_PREDICT_VAL ,_param->_nb_inst_predict); 130 DELETE1_SC_SIGNAL(out_PREDICT_ACK ,_param->_nb_inst_predict); 131 DELETE1_SC_SIGNAL( in_PREDICT_ADDRESS ,_param->_nb_inst_predict); 132 DELETE1_SC_SIGNAL(out_PREDICT_DIRECTION ,_param->_nb_inst_predict); 133 DELETE1_SC_SIGNAL(out_PREDICT_HISTORY ,_param->_nb_inst_predict); 134 135 DELETE1_SC_SIGNAL( in_UPDATE_VAL ,_param->_nb_inst_update); 136 DELETE1_SC_SIGNAL(out_UPDATE_ACK ,_param->_nb_inst_update); 137 DELETE1_SC_SIGNAL( in_UPDATE_ADDRESS ,_param->_nb_inst_update); 138 DELETE1_SC_SIGNAL( in_UPDATE_HISTORY ,_param->_nb_inst_update); 139 DELETE1_SC_SIGNAL( in_UPDATE_DIRECTION ,_param->_nb_inst_update); 106 140 } 107 141 #endif -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Direction/Meta_Predictor/Two_Level_Branch_Predictor/SelfTest/config_bht_only.cfg
r110 r111 1 1 Two_Level_Branch_Predictor 2 4 4 *2 # nb_inst_predict 3 4 4 *2 # nb_inst_update 4 30 30 *2 # size_address 5 1 1 +1 # have_bht 6 1 16 *4 # bht_size_shifter 7 1 16 *4 # bht_nb_shifter 8 0 0 +1 # have_pht 9 0 0 +1 # pht_size_counter 10 0 0 *2 # pht_nb_counter 11 0 0 +1 # pht_size_address_share 12 1 1 +1 # update_on_prediction -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Direction/Meta_Predictor/Two_Level_Branch_Predictor/SelfTest/include/test.h
r110 r111 11 11 #endif 12 12 13 #define NB_ITERATION 1 13 #define NB_ITERATION 16 14 14 #define CYCLE_MAX (1024*NB_ITERATION) 15 15 -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Direction/Meta_Predictor/Two_Level_Branch_Predictor/SelfTest/src/main.cpp
r110 r111 7 7 8 8 #include "Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Direction/Meta_Predictor/Two_Level_Branch_Predictor/SelfTest/include/test.h" 9 #include "Behavioural/include/Selftest.h" 9 10 10 #define NB_PARAMS 011 #define NB_PARAMS 11 11 12 12 13 void usage (int argc, char * argv[]) … … 14 15 err (_("<Usage> %s name_instance list_params.\n"),argv[0]); 15 16 err (_("list_params is :\n")); 16 err (_(" * ()\n")); 17 err (_(" * nb_inst_predict (uint32_t)\n")); 18 err (_(" * nb_inst_update (uint32_t)\n")); 19 err (_(" * size_address (uint32_t)\n")); 20 err (_(" * have_bht (bool )\n")); 21 err (_(" * bht_size_shifter (uint32_t)\n")); 22 err (_(" * bht_nb_shifter (uint32_t)\n")); 23 err (_(" * have_pht (bool )\n")); 24 err (_(" * pht_size_counter (uint32_t)\n")); 25 err (_(" * pht_nb_counter (uint32_t)\n")); 26 err (_(" * pht_size_address_share (uint32_t)\n")); 27 err (_(" * update_on_prediction (bool )\n")); 17 28 18 29 exit (1); … … 32 43 string name = argv[x++]; 33 44 45 uint32_t nb_inst_predict ; 46 uint32_t nb_inst_update ; 47 uint32_t size_address ; 48 bool have_bht ; 49 uint32_t bht_size_shifter ; 50 uint32_t bht_nb_shifter ; 51 bool have_pht ; 52 uint32_t pht_size_counter ; 53 uint32_t pht_nb_counter ; 54 uint32_t pht_size_address_share; 55 bool update_on_prediction ; 56 57 SELFTEST0(nb_inst_predict ,uint32_t,argv,x); 58 SELFTEST0(nb_inst_update ,uint32_t,argv,x); 59 SELFTEST0(size_address ,uint32_t,argv,x); 60 SELFTEST0(have_bht ,bool ,argv,x); 61 SELFTEST0(bht_size_shifter ,uint32_t,argv,x); 62 SELFTEST0(bht_nb_shifter ,uint32_t,argv,x); 63 SELFTEST0(have_pht ,bool ,argv,x); 64 SELFTEST0(pht_size_counter ,uint32_t,argv,x); 65 SELFTEST0(pht_nb_counter ,uint32_t,argv,x); 66 SELFTEST0(pht_size_address_share,uint32_t,argv,x); 67 SELFTEST0(update_on_prediction ,bool ,argv,x); 68 34 69 int _return = EXIT_SUCCESS; 35 70 try … … 37 72 morpheo::behavioural::core::multi_front_end::front_end::prediction_unit::direction::meta_predictor::two_level_branch_predictor::Parameters * param = new morpheo::behavioural::core::multi_front_end::front_end::prediction_unit::direction::meta_predictor::two_level_branch_predictor::Parameters 38 73 ( 74 nb_inst_predict , 75 nb_inst_update , 76 size_address , 77 have_bht , 78 bht_size_shifter , 79 bht_nb_shifter , 80 have_pht , 81 pht_size_counter , 82 pht_nb_counter , 83 pht_size_address_share, 84 update_on_prediction , 39 85 true //is_toplevel 40 86 ); -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Direction/Meta_Predictor/Two_Level_Branch_Predictor/SelfTest/src/test.cpp
r110 r111 50 50 sc_clock * in_CLOCK = new sc_clock ("clock", 1.0, 0.5); 51 51 sc_signal<Tcontrol_t> * in_NRESET = new sc_signal<Tcontrol_t> ("NRESET"); 52 53 ALLOC1_SC_SIGNAL( in_PREDICT_VAL ," in_PREDICT_VAL ",Tcontrol_t,_param->_nb_inst_predict); 54 ALLOC1_SC_SIGNAL(out_PREDICT_ACK ,"out_PREDICT_ACK ",Tcontrol_t,_param->_nb_inst_predict); 55 ALLOC1_SC_SIGNAL( in_PREDICT_ADDRESS ," in_PREDICT_ADDRESS ",Taddress_t,_param->_nb_inst_predict); 56 ALLOC1_SC_SIGNAL(out_PREDICT_DIRECTION ,"out_PREDICT_DIRECTION ",Tcontrol_t,_param->_nb_inst_predict); 57 ALLOC1_SC_SIGNAL(out_PREDICT_HISTORY ,"out_PREDICT_HISTORY ",Thistory_t,_param->_nb_inst_predict); 58 ALLOC1_SC_SIGNAL( in_PREDICT_DIRECTION_VAL," in_PREDICT_DIRECTION_VAL",Tcontrol_t,_param->_nb_inst_predict); 59 ALLOC1_SC_SIGNAL( in_PREDICT_DIRECTION ," in_PREDICT_DIRECTION ",Tcontrol_t,_param->_nb_inst_predict); 60 61 ALLOC1_SC_SIGNAL( in_UPDATE_VAL ," in_UPDATE_VAL ",Tcontrol_t,_param->_nb_inst_update); 62 ALLOC1_SC_SIGNAL(out_UPDATE_ACK ,"out_UPDATE_ACK ",Tcontrol_t,_param->_nb_inst_update); 63 ALLOC1_SC_SIGNAL( in_UPDATE_ADDRESS ," in_UPDATE_ADDRESS ",Taddress_t,_param->_nb_inst_update); 64 ALLOC1_SC_SIGNAL( in_UPDATE_HISTORY ," in_UPDATE_HISTORY ",Thistory_t,_param->_nb_inst_update); 65 ALLOC1_SC_SIGNAL( in_UPDATE_DIRECTION ," in_UPDATE_DIRECTION ",Tcontrol_t,_param->_nb_inst_update); 66 ALLOC1_SC_SIGNAL( in_UPDATE_MISS ," in_UPDATE_MISS ",Tcontrol_t,_param->_nb_inst_update); 52 67 53 68 /******************************************************** … … 60 75 (*(_Two_Level_Branch_Predictor->in_NRESET)) (*(in_NRESET)); 61 76 77 INSTANCE1_SC_SIGNAL(_Two_Level_Branch_Predictor, in_PREDICT_VAL ,_param->_nb_inst_predict); 78 INSTANCE1_SC_SIGNAL(_Two_Level_Branch_Predictor,out_PREDICT_ACK ,_param->_nb_inst_predict); 79 INSTANCE1_SC_SIGNAL(_Two_Level_Branch_Predictor, in_PREDICT_ADDRESS ,_param->_nb_inst_predict); 80 INSTANCE1_SC_SIGNAL(_Two_Level_Branch_Predictor,out_PREDICT_DIRECTION ,_param->_nb_inst_predict); 81 INSTANCE1_SC_SIGNAL(_Two_Level_Branch_Predictor,out_PREDICT_HISTORY ,_param->_nb_inst_predict); 82 if (_param->_update_on_prediction) 83 { 84 INSTANCE1_SC_SIGNAL(_Two_Level_Branch_Predictor, in_PREDICT_DIRECTION_VAL,_param->_nb_inst_predict); 85 INSTANCE1_SC_SIGNAL(_Two_Level_Branch_Predictor, in_PREDICT_DIRECTION ,_param->_nb_inst_predict); 86 } 87 88 INSTANCE1_SC_SIGNAL(_Two_Level_Branch_Predictor, in_UPDATE_VAL ,_param->_nb_inst_update); 89 INSTANCE1_SC_SIGNAL(_Two_Level_Branch_Predictor,out_UPDATE_ACK ,_param->_nb_inst_update); 90 INSTANCE1_SC_SIGNAL(_Two_Level_Branch_Predictor, in_UPDATE_ADDRESS ,_param->_nb_inst_update); 91 INSTANCE1_SC_SIGNAL(_Two_Level_Branch_Predictor, in_UPDATE_HISTORY ,_param->_nb_inst_update); 92 INSTANCE1_SC_SIGNAL(_Two_Level_Branch_Predictor, in_UPDATE_DIRECTION ,_param->_nb_inst_update); 93 if (_param->_update_on_prediction) 94 INSTANCE1_SC_SIGNAL(_Two_Level_Branch_Predictor, in_UPDATE_MISS ,_param->_nb_inst_update); 62 95 63 96 msg(_("<%s> : Start Simulation ............\n"),name.c_str()); … … 76 109 srand(seed); 77 110 111 const int32_t percent_transaction_predict = 75; 112 const int32_t percent_transaction_update = 75; 113 78 114 SC_START(0); 79 115 LABEL("Initialisation"); 116 117 for (uint32_t i=0; i<_param->_nb_inst_predict; ++i) 118 in_PREDICT_VAL [i]->write(0); 119 for (uint32_t i=0; i<_param->_nb_inst_update; ++i) 120 in_UPDATE_VAL [i]->write(0); 80 121 81 122 LABEL("Reset"); … … 85 126 86 127 LABEL("Loop of Test"); 87 128 129 Thistory_t bht; 130 Thistory_t pht [_param->_pht_size_bank]; 131 88 132 for (uint32_t iteration=0; iteration<NB_ITERATION; iteration ++) 89 133 { 90 134 LABEL("Iteration %d",iteration); 91 135 136 uint32_t bht_num_reg = (_param->_have_bht)?(rand()%_param->_bht_nb_shifter):0; 137 uint32_t pht_num_bank = (_param->_have_pht)?(rand()%_param->_pht_nb_bank ):0; 138 139 LABEL(" * bht_num_reg : %d",bht_num_reg ); 140 LABEL(" * pht_num_bank : %d",pht_num_bank); 141 142 { 143 LABEL("Init BHT and PHT"); 144 145 bht = 0; 146 for (uint32_t i=0; i<_param->_pht_size_bank; ++i) 147 pht [i] = 0; 148 149 uint32_t port = rand()%_param->_nb_inst_update; 150 151 if (_param->_have_bht) 152 { 153 bool find = false; 154 while (not find) 155 { 156 bool val = ((rand()%2)<percent_transaction_update); 157 in_UPDATE_VAL [port]->write(val); 158 in_UPDATE_DIRECTION [port]->write(0); 159 160 if (_param->_update_on_prediction) 161 in_UPDATE_MISS [port]->write(1); // miss 162 in_UPDATE_HISTORY [port]->write(0); 163 in_UPDATE_ADDRESS [port]->write(bht_num_reg); 164 165 SC_START(0); 166 167 if (val and out_UPDATE_ACK [port]->read()) 168 { 169 LABEL("UPDATE[%d] - Transaction accepted",port); 170 find = true; 171 } 172 173 SC_START(1); 174 } 175 in_UPDATE_VAL [port]->write(0); 176 } 177 178 if (_param->_have_pht) 179 { 180 for (uint32_t i=0; i<_param->_pht_size_bank; ++i) 181 { 182 bool find = false; 183 184 while (not find) 185 { 186 bool val = ((rand()%2)<percent_transaction_update); 187 in_UPDATE_VAL [port]->write(val); 188 in_UPDATE_DIRECTION [port]->write(0); 189 190 if (_param->_update_on_prediction) 191 in_UPDATE_MISS [port]->write(1); // miss 192 in_UPDATE_HISTORY [port]->write(i<<_param->_bht_history_rshift); 193 in_UPDATE_ADDRESS [port]->write(pht_num_bank<<_param->_pht_address_bank_rshift); 194 195 SC_START(0); 196 197 if (val and out_UPDATE_ACK [port]->read()) 198 { 199 LABEL("UPDATE[%d] - Transaction accepted",port); 200 find = true; 201 } 202 203 SC_START(1); 204 } 205 in_UPDATE_VAL [port]->write(0); 206 } 207 } 208 } 209 210 // if (1) 211 // { 212 // LABEL("Saturation all PHT"); 213 214 // } 215 92 216 SC_START(1); 93 217 } … … 104 228 delete in_CLOCK; 105 229 delete in_NRESET; 230 231 DELETE1_SC_SIGNAL( in_PREDICT_VAL ,_param->_nb_inst_predict); 232 DELETE1_SC_SIGNAL(out_PREDICT_ACK ,_param->_nb_inst_predict); 233 DELETE1_SC_SIGNAL( in_PREDICT_ADDRESS ,_param->_nb_inst_predict); 234 DELETE1_SC_SIGNAL(out_PREDICT_DIRECTION ,_param->_nb_inst_predict); 235 DELETE1_SC_SIGNAL(out_PREDICT_HISTORY ,_param->_nb_inst_predict); 236 DELETE1_SC_SIGNAL( in_PREDICT_DIRECTION_VAL,_param->_nb_inst_predict); 237 DELETE1_SC_SIGNAL( in_PREDICT_DIRECTION ,_param->_nb_inst_predict); 238 239 DELETE1_SC_SIGNAL( in_UPDATE_VAL ,_param->_nb_inst_update); 240 DELETE1_SC_SIGNAL(out_UPDATE_ACK ,_param->_nb_inst_update); 241 DELETE1_SC_SIGNAL( in_UPDATE_ADDRESS ,_param->_nb_inst_update); 242 DELETE1_SC_SIGNAL( in_UPDATE_HISTORY ,_param->_nb_inst_update); 243 DELETE1_SC_SIGNAL( in_UPDATE_DIRECTION ,_param->_nb_inst_update); 244 DELETE1_SC_SIGNAL( in_UPDATE_MISS ,_param->_nb_inst_update); 106 245 } 107 246 #endif -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Direction/Meta_Predictor/Two_Level_Branch_Predictor/include/Parameters.h
r110 r111 9 9 */ 10 10 11 #include "Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Direction/Meta_Predictor/Two_Level_Branch_Predictor/include/Types.h" 11 12 #include "Behavioural/include/Parameters.h" 12 13 #include "Common/include/Debug.h" … … 26 27 { 27 28 //-----[ fields ]------------------------------------------------------------ 29 public : uint32_t _nb_inst_predict ; 30 public : uint32_t _nb_inst_update ; 31 public : uint32_t _size_address ; 32 public : bool _have_bht ; 33 public : uint32_t _bht_size_shifter ; 34 public : uint32_t _bht_nb_shifter ; 35 public : bool _have_pht ; 36 public : uint32_t _pht_size_counter ; 37 public : uint32_t _pht_nb_counter ; 38 public : uint32_t _pht_size_address_share ; 39 public : bool _update_on_prediction ; 40 41 public : Thistory_t _pht_counter_max ; 42 43 public : uint32_t _size_history ; 44 45 public : Thistory_t _bht_history_mask ; 46 public : Thistory_t _bht_history_rshift ; 47 public : Thistory_t _pht_history_mask ; 48 public : Thistory_t _pht_history_rshift ; 49 50 public : uint32_t _bht_size_address ; 51 public : uint32_t _pht_size_address ; 52 53 public : Taddress_t _bht_address_mask ; 54 public : uint32_t _pht_nb_bank ; 55 public : uint32_t _pht_size_bank ; 56 public : Taddress_t _pht_address_share_mask ; 57 public : Taddress_t _pht_address_share_lshift; 58 public : Taddress_t _pht_address_bank_mask ; 59 public : Taddress_t _pht_address_bank_rshift ; 28 60 29 61 //-----[ methods ]----------------------------------------------------------- 30 public : Parameters (bool is_toplevel=false); 62 public : Parameters (uint32_t nb_inst_predict , 63 uint32_t nb_inst_update , 64 uint32_t size_address , 65 bool have_bht , 66 uint32_t bht_size_shifter , 67 uint32_t bht_nb_shifter , 68 bool have_pht , 69 uint32_t pht_size_counter , 70 uint32_t pht_nb_counter , 71 uint32_t pht_size_address_share, 72 bool update_on_prediction , 73 bool is_toplevel=false); 31 74 //public : Parameters (Parameters & param) ; 32 75 public : ~Parameters (void); -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Direction/Meta_Predictor/Two_Level_Branch_Predictor/include/Two_Level_Branch_Predictor.h
r110 r111 66 66 public : SC_IN (Tcontrol_t) * in_NRESET ; 67 67 68 // ~~~~~[ Interface : "predict" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 69 public : SC_IN (Tcontrol_t) ** in_PREDICT_VAL ;//[nb_inst_predict] 70 public : SC_OUT(Tcontrol_t) ** out_PREDICT_ACK ;//[nb_inst_predict] 71 public : SC_IN (Taddress_t) ** in_PREDICT_ADDRESS ;//[nb_inst_predict] 72 public : SC_OUT(Tcontrol_t) ** out_PREDICT_DIRECTION ;//[nb_inst_predict] // = MSB[history] 73 public : SC_OUT(Thistory_t) ** out_PREDICT_HISTORY ;//[nb_inst_predict] 74 public : SC_IN (Tcontrol_t) ** in_PREDICT_DIRECTION_VAL;//[nb_inst_predict] // if update_on_prediction 75 public : SC_IN (Tcontrol_t) ** in_PREDICT_DIRECTION ;//[nb_inst_predict] // if update_on_prediction 76 77 // ~~~~~[ Interface : "update" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 78 public : SC_IN (Tcontrol_t) ** in_UPDATE_VAL ;//[nb_inst_update] 79 public : SC_OUT(Tcontrol_t) ** out_UPDATE_ACK ;//[nb_inst_update] 80 public : SC_IN (Taddress_t) ** in_UPDATE_ADDRESS ;//[nb_inst_update] 81 public : SC_IN (Thistory_t) ** in_UPDATE_HISTORY ;//[nb_inst_update] 82 public : SC_IN (Tcontrol_t) ** in_UPDATE_DIRECTION ;//[nb_inst_update] 83 public : SC_IN (Tcontrol_t) ** in_UPDATE_MISS ;//[nb_inst_update] // if update_on_prediction 84 68 85 // ~~~~~[ Component ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 69 86 70 87 // ~~~~~[ Register ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 88 private : Thistory_t * reg_BHT ;//[bht_nb_shifter] 89 private : Thistory_t ** reg_PHT ;//[pht_nb_counter][pht_nb_bank] 71 90 72 91 // ~~~~~[ Internal ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 92 private : Tcontrol_t * internal_PREDICT_ACK ;//[nb_inst_predict] 93 private : Thistory_t * internal_PREDICT_BHT_NUM_REG ;//[nb_inst_predict] // if update_on_prediction 94 private : Thistory_t * internal_PREDICT_PHT_NUM_BANK ;//[nb_inst_predict] // if update_on_prediction 95 private : Thistory_t * internal_PREDICT_PHT_NUM_REG ;//[nb_inst_predict] // if update_on_prediction 96 97 private : Tcontrol_t * internal_UPDATE_ACK ;//[nb_inst_update] 73 98 #endif 74 99 … … 104 129 #ifdef SYSTEMC 105 130 public : void transition (void); 106 //public : void genMoore(void);131 public : void genMealy_predict (void); 107 132 #endif 108 133 -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Direction/Meta_Predictor/Two_Level_Branch_Predictor/src/Parameters.cpp
r110 r111 7 7 8 8 #include "Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Direction/Meta_Predictor/Two_Level_Branch_Predictor/include/Parameters.h" 9 #include "Common/include/BitManipulation.h" 9 10 10 11 namespace morpheo { … … 21 22 #undef FUNCTION 22 23 #define FUNCTION "Two_Level_Branch_Predictor::Parameters" 23 Parameters::Parameters (bool is_toplevel) 24 Parameters::Parameters (uint32_t nb_inst_predict , 25 uint32_t nb_inst_update , 26 uint32_t size_address , 27 bool have_bht , 28 uint32_t bht_size_shifter , 29 uint32_t bht_nb_shifter , 30 bool have_pht , 31 uint32_t pht_size_counter , 32 uint32_t pht_nb_counter , 33 uint32_t pht_size_address_share, 34 bool update_on_prediction , 35 bool is_toplevel) 24 36 { 25 37 log_begin(Two_Level_Branch_Predictor,FUNCTION); 26 38 27 test(); 39 _nb_inst_predict = nb_inst_predict ; 40 _nb_inst_update = nb_inst_update ; 41 _size_address = size_address ; 42 _have_bht = have_bht ; 43 _bht_size_shifter = (have_bht)?(bht_size_shifter):0; 44 _bht_nb_shifter = (have_bht)?(bht_nb_shifter ):0; 45 _have_pht = have_pht ; 46 _pht_size_counter = (have_pht)?(pht_size_counter ):0; 47 _pht_nb_counter = (have_pht)?(pht_nb_counter ):0; 48 _pht_size_address_share = (have_bht and have_pht)?(pht_size_address_share):0; 49 _update_on_prediction = update_on_prediction ; 50 51 _bht_size_address = (_have_bht)?log2(_bht_nb_shifter):0; 52 _pht_size_address = (_have_pht)?log2(_pht_nb_counter):0; 53 54 test(); 55 56 _size_history = _bht_size_shifter + _pht_size_counter; 57 58 _bht_history_mask = gen_mask<Thistory_t>(_bht_size_shifter); 59 _bht_history_rshift = 0; 60 _pht_history_mask = gen_mask<Thistory_t>(_pht_size_counter); 61 _pht_history_rshift = _bht_size_shifter; 62 63 log_printf(TRACE,Two_Level_Branch_Predictor,FUNCTION," * _size_history : %d",_size_history ); 64 log_printf(TRACE,Two_Level_Branch_Predictor,FUNCTION," * _bht_history_mask : 0x%x",_bht_history_mask ); 65 log_printf(TRACE,Two_Level_Branch_Predictor,FUNCTION," * _bht_history_rshift : %d",_bht_history_rshift); 66 log_printf(TRACE,Two_Level_Branch_Predictor,FUNCTION," * _pht_history_mask : 0x%x",_pht_history_mask ); 67 log_printf(TRACE,Two_Level_Branch_Predictor,FUNCTION," * _pht_history_rshift : %d",_pht_history_rshift); 68 69 if (_have_bht) 70 { 71 _bht_address_mask = gen_mask<Taddress_t>(_bht_size_address); 72 73 log_printf(TRACE,Two_Level_Branch_Predictor,FUNCTION," * _bht_address_mask : 0x%x",_bht_address_mask ); 74 } 75 76 if (_have_pht) 77 { 78 _pht_counter_max = (1<<_pht_size_counter)-1; 79 80 _pht_nb_bank = (_pht_nb_counter - (1<<_bht_size_shifter))+1; 81 _pht_size_bank = _pht_nb_counter / _pht_nb_bank; 82 83 _pht_address_share_mask = gen_mask<Taddress_t>(_pht_size_address_share); 84 _pht_address_share_lshift= _bht_size_shifter-_pht_size_address_share; 85 _pht_address_bank_mask = gen_mask<Taddress_t>(log2(_pht_nb_bank)); 86 _pht_address_bank_rshift = _pht_size_address_share; 87 88 log_printf(TRACE,Two_Level_Branch_Predictor,FUNCTION," * _pht_nb_bank : %d" ,_pht_nb_bank ); 89 log_printf(TRACE,Two_Level_Branch_Predictor,FUNCTION," * _pht_size_bank : %d" ,_pht_size_bank ); 90 log_printf(TRACE,Two_Level_Branch_Predictor,FUNCTION," * _pht_address_share_mask : 0x%x",_pht_address_share_mask ); 91 log_printf(TRACE,Two_Level_Branch_Predictor,FUNCTION," * _pht_address_share_lshift : %d" ,_pht_address_share_lshift); 92 log_printf(TRACE,Two_Level_Branch_Predictor,FUNCTION," * _pht_address_bank_mask : 0x%x",_pht_address_bank_mask ); 93 log_printf(TRACE,Two_Level_Branch_Predictor,FUNCTION," * _pht_address_bank_rshift : %d" ,_pht_address_bank_rshift ); 94 } 28 95 29 96 if (is_toplevel) 30 { 31 copy(); 32 } 97 copy(); 33 98 34 99 log_end(Two_Level_Branch_Predictor,FUNCTION); -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Direction/Meta_Predictor/Two_Level_Branch_Predictor/src/Parameters_msg_error.cpp
r110 r111 29 29 Parameters_test test ("Two_Level_Branch_Predictor"); 30 30 31 if ((_have_bht or _have_pht) == false) 32 test.error(_("They have no Branch History Table and no Pattern History Table. You need a less of a BHT or a PHT\n")); 33 34 if ( _have_bht and (_size_address < _bht_size_address)) 35 test.error(_("The address's size must to large to the number of shifter in the Branch History Table.\n")); 36 37 if (_have_pht and (_size_address < _pht_size_address)) 38 test.error(_("The address's size must to large to the number of counter in the Pattern History Table.\n")); 39 40 if (_have_pht and _have_bht and (_bht_size_address > _pht_nb_counter)) 41 test.error (_("The size of shifter don't must too large that the number of counter in the Pattern History Table.\n")); 42 43 if (_have_pht and _have_bht and (_pht_size_address_share > _bht_size_shifter)) 44 test.error (_("The size of address share don't must too large that the size of shifter in the Branch History Table.\n")); 45 31 46 log_end(Two_Level_Branch_Predictor,FUNCTION); 32 47 -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Direction/Meta_Predictor/Two_Level_Branch_Predictor/src/Two_Level_Branch_Predictor.cpp
r110 r111 72 72 if (usage_is_set(_usage,USE_SYSTEMC)) 73 73 { 74 // Constants : 75 for (uint32_t i=0; i<_param->_nb_inst_predict; ++i) 76 { 77 internal_PREDICT_ACK [i] = 1; 78 PORT_WRITE(out_PREDICT_ACK [i], internal_PREDICT_ACK [i]); 79 } 80 for (uint32_t i=0; i<_param->_nb_inst_update; ++i) 81 { 82 internal_UPDATE_ACK [i] = 1; 83 PORT_WRITE(out_UPDATE_ACK [i], internal_UPDATE_ACK [i]); 84 } 85 86 74 87 log_printf(INFO,Two_Level_Branch_Predictor,FUNCTION,_("<%s> : Method - transition"),_name.c_str()); 75 88 … … 82 95 # endif 83 96 84 // log_printf(INFO,Two_Level_Branch_Predictor,FUNCTION,_("<%s> : Method - genMoore"),_name.c_str());97 log_printf(INFO,Two_Level_Branch_Predictor,FUNCTION,_("<%s> : Method - genMealy_predict"),_name.c_str()); 85 98 86 // SC_METHOD (genMoore); 87 // dont_initialize (); 88 // sensitive << (*(in_CLOCK)).neg(); // need internal register 89 90 // # ifdef SYSTEMCASS_SPECIFIC 91 // // List dependency information 92 // # endif 99 SC_METHOD (genMealy_predict); 100 dont_initialize (); 101 sensitive << (*(in_CLOCK)).neg(); // need internal register 102 103 for (uint32_t i=0; i<_param->_nb_inst_predict; ++i) 104 sensitive 105 // << (*(in_PREDICT_VAL [i])) 106 << (*(in_PREDICT_ADDRESS [i])); 107 108 # ifdef SYSTEMCASS_SPECIFIC 109 // List dependency information 110 # endif 93 111 94 112 #endif -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Direction/Meta_Predictor/Two_Level_Branch_Predictor/src/Two_Level_Branch_Predictor_allocation.cpp
r110 r111 19 19 namespace meta_predictor { 20 20 namespace two_level_branch_predictor { 21 22 23 21 24 22 #undef FUNCTION … … 58 56 in_NRESET = interface->set_signal_in <Tcontrol_t> ("nreset",1, RESET_VHDL_YES); 59 57 } 58 59 // ~~~~~[ Interface : "predict" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 60 { 61 ALLOC1_INTERFACE("predict",IN,WEST,_("Predict direction interface"),_param->_nb_inst_predict); 62 63 ALLOC1_VALACK_IN ( in_PREDICT_VAL ,VAL); 64 ALLOC1_VALACK_OUT(out_PREDICT_ACK ,ACK); 65 ALLOC1_SIGNAL_IN ( in_PREDICT_ADDRESS ,"ADDRESS" ,Taddress_t,_param->_size_address); 66 ALLOC1_SIGNAL_OUT(out_PREDICT_DIRECTION ,"DIRECTION" ,Tcontrol_t,1 ); 67 ALLOC1_SIGNAL_OUT(out_PREDICT_HISTORY ,"HISTORY" ,Thistory_t,_param->_size_history); 68 if (_param->_update_on_prediction) 69 { 70 ALLOC1_SIGNAL_IN ( in_PREDICT_DIRECTION_VAL,"DIRECTION_VAL",Tcontrol_t,1 ); 71 ALLOC1_SIGNAL_IN ( in_PREDICT_DIRECTION ,"DIRECTION" ,Tcontrol_t,1 ); 72 } 73 } 74 75 // ~~~~~[ Interface : "update" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 76 { 77 ALLOC1_INTERFACE("update",IN,WEST,_("Update direction interface"),_param->_nb_inst_update); 78 79 ALLOC1_VALACK_IN ( in_UPDATE_VAL ,VAL); 80 ALLOC1_VALACK_OUT(out_UPDATE_ACK ,ACK); 81 ALLOC1_SIGNAL_IN ( in_UPDATE_ADDRESS ,"ADDRESS" ,Taddress_t,_param->_size_address); 82 ALLOC1_SIGNAL_IN ( in_UPDATE_HISTORY ,"HISTORY" ,Thistory_t,_param->_size_history); 83 ALLOC1_SIGNAL_IN ( in_UPDATE_DIRECTION ,"DIRECTION" ,Tcontrol_t,1 ); 84 if (_param->_update_on_prediction) 85 ALLOC1_SIGNAL_IN ( in_UPDATE_MISS ,"MISS" ,Tcontrol_t,1 ); 86 } 87 88 if (usage_is_set(_usage,USE_SYSTEMC)) 89 { 90 if (_param->_have_bht) 91 { 92 ALLOC1(reg_BHT ,Thistory_t,_param->_bht_nb_shifter); 93 94 for (uint32_t i=0; i<_param->_bht_nb_shifter; ++i) 95 reg_BHT [i] = 0; 96 } 97 98 if (_param->_have_pht) 99 { 100 ALLOC2(reg_PHT ,Thistory_t,_param->_pht_nb_bank,_param->_pht_size_bank); 101 102 for (uint32_t i=0; i<_param->_pht_nb_bank; ++i) 103 for (uint32_t j=0; j<_param->_pht_size_bank; ++j) 104 reg_PHT [i][j] = 0; 105 } 106 107 108 ALLOC1(internal_PREDICT_ACK ,Tcontrol_t,_param->_nb_inst_predict); 109 if (_param->_update_on_prediction) 110 { 111 if (_param->_have_bht) 112 ALLOC1(internal_PREDICT_BHT_NUM_REG ,Thistory_t,_param->_nb_inst_predict); 113 if (_param->_have_pht) 114 { 115 ALLOC1(internal_PREDICT_PHT_NUM_BANK ,Thistory_t,_param->_nb_inst_predict); 116 ALLOC1(internal_PREDICT_PHT_NUM_REG ,Thistory_t,_param->_nb_inst_predict); 117 } 118 } 119 ALLOC1(internal_UPDATE_ACK ,Tcontrol_t,_param->_nb_inst_update ); 120 } 121 60 122 // ~~~~~[ Component ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 61 62 123 #ifdef POSITION 63 124 if (usage_is_set(_usage,USE_POSITION)) -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Direction/Meta_Predictor/Two_Level_Branch_Predictor/src/Two_Level_Branch_Predictor_deallocation.cpp
r110 r111 30 30 delete in_CLOCK ; 31 31 delete in_NRESET; 32 33 DELETE1_SIGNAL( in_PREDICT_VAL ,_param->_nb_inst_predict,1 ); 34 DELETE1_SIGNAL(out_PREDICT_ACK ,_param->_nb_inst_predict,1 ); 35 DELETE1_SIGNAL( in_PREDICT_ADDRESS ,_param->_nb_inst_predict,_param->_size_address); 36 DELETE1_SIGNAL(out_PREDICT_DIRECTION ,_param->_nb_inst_predict,1 ); 37 DELETE1_SIGNAL(out_PREDICT_HISTORY ,_param->_nb_inst_predict,_param->_size_history); 38 if (_param->_update_on_prediction) 39 { 40 DELETE1_SIGNAL( in_PREDICT_DIRECTION_VAL,_param->_nb_inst_predict,1 ); 41 DELETE1_SIGNAL( in_PREDICT_DIRECTION ,_param->_nb_inst_predict,1 ); 42 } 43 44 DELETE1_SIGNAL( in_UPDATE_VAL ,_param->_nb_inst_update,1 ); 45 DELETE1_SIGNAL(out_UPDATE_ACK ,_param->_nb_inst_update,1 ); 46 DELETE1_SIGNAL( in_UPDATE_ADDRESS ,_param->_nb_inst_update,_param->_size_address); 47 DELETE1_SIGNAL( in_UPDATE_HISTORY ,_param->_nb_inst_update,_param->_size_history); 48 DELETE1_SIGNAL( in_UPDATE_DIRECTION ,_param->_nb_inst_update,1 ); 49 if (_param->_update_on_prediction) 50 DELETE1_SIGNAL( in_UPDATE_MISS ,_param->_nb_inst_update,1 ); 51 52 if (_param->_have_bht) 53 DELETE1(reg_BHT ,_param->_bht_nb_shifter); 54 if (_param->_have_pht) 55 DELETE2(reg_PHT ,_param->_pht_nb_bank,_param->_pht_size_bank); 56 57 DELETE1(internal_PREDICT_ACK ,_param->_nb_inst_predict); 58 if (_param->_update_on_prediction) 59 { 60 if (_param->_have_bht) 61 DELETE1(internal_PREDICT_BHT_NUM_REG ,_param->_nb_inst_predict); 62 if (_param->_have_pht) 63 { 64 DELETE1(internal_PREDICT_PHT_NUM_BANK ,_param->_nb_inst_predict); 65 DELETE1(internal_PREDICT_PHT_NUM_REG ,_param->_nb_inst_predict); 66 } 67 } 68 DELETE1(internal_UPDATE_ACK ,_param->_nb_inst_update ); 32 69 } 33 70 // ~~~~~[ Component ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Direction/Meta_Predictor/Two_Level_Branch_Predictor/src/Two_Level_Branch_Predictor_transition.cpp
r110 r111 25 25 { 26 26 log_begin(Two_Level_Branch_Predictor,FUNCTION); 27 log_function(Two_Level_Branch_Predictor,FUNCTION,_name.c_str()); 28 29 if (PORT_READ(in_NRESET) == 0) 30 { 31 } 32 else 33 { 34 // =================================================================== 35 // =====[ PREDICT ]=================================================== 36 // =================================================================== 37 38 for (uint32_t i=0; i<_param->_nb_inst_predict; ++i) 39 if (PORT_READ(in_PREDICT_VAL[i]) and internal_PREDICT_ACK[i]) 40 { 41 log_printf(TRACE,Two_Level_Branch_Predictor,FUNCTION," * PREDICT [%d]",i); 42 43 // Predict if 44 // * update_on_prediction and direction is valid 45 if (_param->_update_on_prediction) 46 if (PORT_READ(in_PREDICT_DIRECTION_VAL [i])) 47 { 48 Tcontrol_t direction = PORT_READ(in_PREDICT_DIRECTION [i]); 49 50 if (_param->_have_bht) 51 { 52 Thistory_t bht_num_reg = internal_PREDICT_BHT_NUM_REG [i]; 53 log_printf(TRACE,Two_Level_Branch_Predictor,FUNCTION," * bht_num_reg : %d",bht_num_reg); 54 55 Thistory_t bht_history = reg_BHT[bht_num_reg]; 56 log_printf(TRACE,Two_Level_Branch_Predictor,FUNCTION," * bht_history (old): %x",bht_history); 57 58 59 bht_history = ((bht_history<<1) | direction)&_param->_bht_history_mask ; 60 log_printf(TRACE,Two_Level_Branch_Predictor,FUNCTION," * bht_history (new): %x",bht_history); 61 reg_BHT [bht_num_reg] = bht_history; 62 } 63 64 if (_param->_have_pht) 65 { 66 Thistory_t pht_num_reg = internal_PREDICT_PHT_NUM_REG [i]; 67 Thistory_t pht_num_bank= internal_PREDICT_PHT_NUM_BANK [i]; 68 log_printf(TRACE,Two_Level_Branch_Predictor,FUNCTION," * pht_num_reg : %d",pht_num_reg); 69 log_printf(TRACE,Two_Level_Branch_Predictor,FUNCTION," * pht_num_bank : %d",pht_num_bank); 70 71 Thistory_t pht_history = reg_PHT [pht_num_bank][pht_num_reg]; 72 log_printf(TRACE,Two_Level_Branch_Predictor,FUNCTION," * pht_history (old): %x",pht_history); 73 74 // PHT : saturation counter 75 pht_history = (direction==1)?((pht_history<_param->_pht_counter_max)?(pht_history+1):(pht_history)):((pht_history>0)?(pht_history-1):(pht_history)); 76 77 log_printf(TRACE,Two_Level_Branch_Predictor,FUNCTION," * pht_history (new): %x",pht_history); 78 79 reg_PHT [pht_num_bank][pht_num_reg] = pht_history; 80 } 81 } 82 } 83 84 // =================================================================== 85 // =====[ UPDATE ]==================================================== 86 // =================================================================== 87 88 for (uint32_t i=0; i<_param->_nb_inst_update; ++i) 89 if (PORT_READ(in_UPDATE_VAL[i]) and internal_UPDATE_ACK[i]) 90 { 91 log_printf(TRACE,Two_Level_Branch_Predictor,FUNCTION," * UPDATE [%d]",i); 92 93 // Update if 94 // * update_on_prediction and miss 95 // * not update_on_prediction 96 if (not _param->_update_on_prediction or (_param->_update_on_prediction and PORT_READ(in_UPDATE_MISS [i]))) 97 { 98 Taddress_t address = PORT_READ(in_UPDATE_ADDRESS [i]); 99 Thistory_t history = PORT_READ(in_UPDATE_HISTORY [i]); 100 Tcontrol_t direction = PORT_READ(in_UPDATE_DIRECTION [i])&1; 101 102 log_printf(TRACE,Two_Level_Branch_Predictor,FUNCTION," * address : %.8x",address); 103 log_printf(TRACE,Two_Level_Branch_Predictor,FUNCTION," * direction : %d",direction); 104 105 Thistory_t pht_bht_history = 0; 106 107 if (_param->_have_bht) 108 { 109 Thistory_t bht_history = (history>>_param->_bht_history_rshift)&_param->_bht_history_mask; 110 Thistory_t bht_num_reg = address & _param->_bht_address_mask; 111 112 pht_bht_history = bht_history; 113 114 log_printf(TRACE,Two_Level_Branch_Predictor,FUNCTION," * bht_history (old): %x",bht_history); 115 log_printf(TRACE,Two_Level_Branch_Predictor,FUNCTION," * bht_num_reg : %x",bht_num_reg); 116 117 // BHT : shift register 118 119 bht_history = ((bht_history<<1) | direction)&_param->_bht_history_mask ; 120 log_printf(TRACE,Two_Level_Branch_Predictor,FUNCTION," * bht_history (new): %x",bht_history); 121 reg_BHT [bht_num_reg] = bht_history; 122 } 123 124 if (_param->_have_pht) 125 { 126 Thistory_t pht_history = (history>>_param->_pht_history_rshift)&_param->_pht_history_mask; 127 Thistory_t pht_num_reg = pht_bht_history xor ((address&_param->_pht_address_share_mask)<<_param->_pht_address_share_lshift); 128 Thistory_t pht_num_bank= (address>>_param->_pht_address_bank_rshift)&_param->_pht_address_bank_mask; 129 130 log_printf(TRACE,Two_Level_Branch_Predictor,FUNCTION," * bht_history (old): %x",pht_bht_history); 131 log_printf(TRACE,Two_Level_Branch_Predictor,FUNCTION," * pht_history (old): %x",pht_history); 132 log_printf(TRACE,Two_Level_Branch_Predictor,FUNCTION," * pht_num_reg : %x",pht_num_reg); 133 log_printf(TRACE,Two_Level_Branch_Predictor,FUNCTION," * pht_num_bank : %x",pht_num_bank); 134 135 // PHT : saturation counter 136 pht_history = (direction==1)?((pht_history<_param->_pht_counter_max)?(pht_history+1):(pht_history)):((pht_history>0)?(pht_history-1):(pht_history)); 137 138 log_printf(TRACE,Two_Level_Branch_Predictor,FUNCTION," * pht_history (new): %x",pht_history); 139 140 reg_PHT [pht_num_bank][pht_num_reg] = pht_history; 141 } 142 } 143 } 144 } 145 146 #if defined(DEBUG) and DEBUG_Two_Level_Branch_Predictor and (DEBUG >= DEBUG_TRACE) 147 if (0) 148 { 149 log_printf(TRACE,Two_Level_Branch_Predictor,FUNCTION," * Dump Two_Level_Branch_Predictor"); 150 151 if (_param->_have_bht) 152 { 153 log_printf(TRACE,Two_Level_Branch_Predictor,FUNCTION," * Dump BHT"); 154 155 uint32_t limit = 4; 156 157 for (uint32_t i=0; i<_param->_bht_nb_shifter; i+=limit) 158 { 159 std::string str = ""; 160 161 for (uint32_t j=0; j<limit; j++) 162 { 163 uint32_t index = i+j; 164 if (index >= _param->_bht_nb_shifter) 165 break; 166 else 167 str+=toString("[%.4d] %.4x ",index,reg_BHT[index]); 168 } 169 170 log_printf(TRACE,Two_Level_Branch_Predictor,FUNCTION," %s",str.c_str()); 171 } 172 } 173 174 if (_param->_have_pht) 175 { 176 log_printf(TRACE,Two_Level_Branch_Predictor,FUNCTION," * Dump PHT"); 177 178 uint32_t limit = 4; 179 180 for (uint32_t num_bank=0; num_bank <_param->_pht_nb_bank; ++num_bank) 181 { 182 log_printf(TRACE,Two_Level_Branch_Predictor,FUNCTION," [%.4d]",num_bank); 183 184 for (uint32_t i=0; i<_param->_pht_size_bank; i+=limit) 185 { 186 std::string str = ""; 187 188 for (uint32_t j=0; j<limit; j++) 189 { 190 uint32_t index = i+j; 191 if (index >= _param->_pht_nb_counter) 192 break; 193 else 194 str+=toString("[%.4d] %.4x ",index,reg_PHT[num_bank][index]); 195 } 196 197 log_printf(TRACE,Two_Level_Branch_Predictor,FUNCTION," %s",str.c_str()); 198 } 199 } 200 } 201 } 202 #endif 27 203 28 204 #if defined(STATISTICS) or defined(VHDL_TESTBENCH) -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Direction/Meta_Predictor/include/Meta_Predictor.h
r110 r111 12 12 #include "systemc.h" 13 13 #endif 14 15 #include "Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Direction/Meta_Predictor/Two_Level_Branch_Predictor/include/Two_Level_Branch_Predictor.h" 16 #include "Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Direction/Meta_Predictor/Meta_Predictor_Glue/include/Meta_Predictor_Glue.h" 14 17 15 18 #include "Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Direction/Meta_Predictor/include/Parameters.h" … … 65 68 public : SC_IN (Tcontrol_t) * in_NRESET ; 66 69 70 // ~~~~~[ Interface : "predict" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 71 public : SC_IN (Tcontrol_t) ** in_PREDICT_VAL ;//[nb_inst_predict] 72 public : SC_OUT(Tcontrol_t) ** out_PREDICT_ACK ;//[nb_inst_predict] 73 public : SC_IN (Taddress_t) ** in_PREDICT_ADDRESS ;//[nb_inst_predict] 74 public : SC_OUT(Tcontrol_t) ** out_PREDICT_DIRECTION ;//[nb_inst_predict] // = MSB[history] 75 public : SC_OUT(Thistory_t) ** out_PREDICT_HISTORY ;//[nb_inst_predict] 76 77 // ~~~~~[ Interface : "update" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 78 public : SC_IN (Tcontrol_t) ** in_UPDATE_VAL ;//[nb_inst_update] 79 public : SC_OUT(Tcontrol_t) ** out_UPDATE_ACK ;//[nb_inst_update] 80 public : SC_IN (Taddress_t) ** in_UPDATE_ADDRESS ;//[nb_inst_update] 81 public : SC_IN (Thistory_t) ** in_UPDATE_HISTORY ;//[nb_inst_update] 82 public : SC_IN (Tcontrol_t) ** in_UPDATE_DIRECTION ;//[nb_inst_update] 83 67 84 // ~~~~~[ Component ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 85 private : morpheo::behavioural::core::multi_front_end::front_end::prediction_unit::direction::meta_predictor::two_level_branch_predictor::Two_Level_Branch_Predictor ** _component_two_level_branch_predictor;//[nb_predictor] 86 private : morpheo::behavioural::core::multi_front_end::front_end::prediction_unit::direction::meta_predictor::meta_predictor_glue ::Meta_Predictor_Glue * _component_glue; 68 87 69 88 // ~~~~~[ Register ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Direction/Meta_Predictor/include/Parameters.h
r110 r111 9 9 */ 10 10 11 #include "Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Direction/Meta_Predictor/Two_Level_Branch_Predictor/include/Parameters.h" 12 #include "Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Direction/Meta_Predictor/Meta_Predictor_Glue/include/Parameters.h" 13 11 14 #include "Behavioural/include/Parameters.h" 12 15 #include "Common/include/Debug.h" 16 13 17 14 18 namespace morpheo { … … 25 29 { 26 30 //-----[ fields ]------------------------------------------------------------ 31 public : uint32_t _nb_inst_predict ; 32 public : uint32_t _nb_inst_update ; 33 public : uint32_t _size_address ; 34 public : bool _have_bht [3]; 35 public : uint32_t _bht_size_shifter [3]; 36 public : uint32_t _bht_nb_shifter [3]; 37 public : bool _have_pht [3]; 38 public : uint32_t _pht_size_counter [3]; 39 public : uint32_t _pht_nb_counter [3]; 40 public : uint32_t _pht_size_address_share [3]; 41 42 public : bool _have_meta_predictor ; 43 public : uint32_t _nb_predictor ; 44 45 public : bool * _predictor_update_on_prediction;//[nb_predictor] 46 public : uint32_t * _predictor_size_history ;//[nb_predictor] 47 public : uint32_t _size_history ; 48 49 public : morpheo::behavioural::core::multi_front_end::front_end::prediction_unit::direction::meta_predictor::two_level_branch_predictor::Parameters ** _param_two_level_branch_predictor;//[nb_predictor] 50 public : morpheo::behavioural::core::multi_front_end::front_end::prediction_unit::direction::meta_predictor::meta_predictor_glue ::Parameters * _param_glue; 27 51 28 52 //-----[ methods ]----------------------------------------------------------- 29 public : Parameters (bool is_toplevel=false); 53 public : Parameters (uint32_t nb_inst_predict , 54 uint32_t nb_inst_update , 55 uint32_t size_address , 56 bool have_bht [3], 57 uint32_t bht_size_shifter [3], 58 uint32_t bht_nb_shifter [3], 59 bool have_pht [3], 60 uint32_t pht_size_counter [3], 61 uint32_t pht_nb_counter [3], 62 uint32_t pht_size_address_share [3], 63 bool is_toplevel=false); 30 64 //public : Parameters (Parameters & param) ; 31 65 public : ~Parameters (void); -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Direction/Meta_Predictor/src/Meta_Predictor_allocation.cpp
r110 r111 18 18 namespace meta_predictor { 19 19 20 21 22 20 #undef FUNCTION 23 21 #define FUNCTION "Meta_Predictor::allocation" … … 57 55 in_NRESET = interface->set_signal_in <Tcontrol_t> ("nreset",1, RESET_VHDL_YES); 58 56 } 57 58 // ~~~~~[ Interface : "predict" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 59 { 60 ALLOC1_INTERFACE("predict",IN,WEST,_("Predict direction interface"),_param->_nb_inst_predict); 61 62 ALLOC1_VALACK_IN ( in_PREDICT_VAL ,VAL); 63 ALLOC1_VALACK_OUT(out_PREDICT_ACK ,ACK); 64 ALLOC1_SIGNAL_IN ( in_PREDICT_ADDRESS ,"ADDRESS" ,Taddress_t,_param->_size_address); 65 ALLOC1_SIGNAL_OUT(out_PREDICT_DIRECTION ,"DIRECTION" ,Tcontrol_t,1 ); 66 ALLOC1_SIGNAL_OUT(out_PREDICT_HISTORY ,"HISTORY" ,Thistory_t,_param->_size_history); 67 } 68 69 // ~~~~~[ Interface : "update" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 70 { 71 ALLOC1_INTERFACE("update",IN,WEST,_("Update direction interface"),_param->_nb_inst_update); 72 73 ALLOC1_VALACK_IN ( in_UPDATE_VAL ,VAL); 74 ALLOC1_VALACK_OUT(out_UPDATE_ACK ,ACK); 75 ALLOC1_SIGNAL_IN ( in_UPDATE_ADDRESS ,"ADDRESS" ,Taddress_t,_param->_size_address); 76 ALLOC1_SIGNAL_IN ( in_UPDATE_HISTORY ,"HISTORY" ,Thistory_t,_param->_size_history); 77 ALLOC1_SIGNAL_IN ( in_UPDATE_DIRECTION ,"DIRECTION" ,Tcontrol_t,1 ); 78 } 59 79 60 80 // ~~~~~[ Component ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 81 82 std::string name; 83 84 85 { 86 _component_two_level_branch_predictor = new morpheo::behavioural::core::multi_front_end::front_end::prediction_unit::direction::meta_predictor::two_level_branch_predictor::Two_Level_Branch_Predictor * [_param->_nb_predictor]; 87 88 for (uint32_t i=0; i<_param->_nb_predictor; ++i) 89 { 90 name = _name+"_two_level_branch_predictor_"+toString(i); 91 log_printf(INFO,Meta_Predictor,FUNCTION,_("Create : %s"),name.c_str()); 92 93 _component_two_level_branch_predictor [i] = new morpheo::behavioural::core::multi_front_end::front_end::prediction_unit::direction::meta_predictor::two_level_branch_predictor::Two_Level_Branch_Predictor 94 (name.c_str() 95 #ifdef STATISTICS 96 ,param_statistics 97 #endif 98 ,_param->_param_two_level_branch_predictor[i] 99 ,_usage); 100 101 _component->set_component (_component_two_level_branch_predictor[i]->_component 102 #ifdef POSITION 103 , 50, 50, 10, 10 104 #endif 105 ); 106 } 107 } 108 109 { 110 name = _name+"_glue"; 111 log_printf(INFO,Meta_Predictor,FUNCTION,_("Create : %s"),name.c_str()); 112 113 _component_glue = new morpheo::behavioural::core::multi_front_end::front_end::prediction_unit::direction::meta_predictor::meta_predictor_glue::Meta_Predictor_Glue 114 (name.c_str() 115 #ifdef STATISTICS 116 ,param_statistics 117 #endif 118 ,_param->_param_glue 119 ,_usage); 120 121 _component->set_component (_component_glue->_component 122 #ifdef POSITION 123 , 50, 50, 10, 10 124 #endif 125 ); 126 } 61 127 62 128 // ~~~~~[ Instanciation ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 63 129 std::string src,dest; 130 131 // =================================================================== 132 // =====[ Two_Level_Branch_Predictor ]================================ 133 // =================================================================== 134 135 for (uint32_t i=0; i<_param->_nb_predictor; ++i) 136 { 137 src = _name+"_two_level_branch_predictor_"+toString(i); 138 log_printf(INFO,Prediction_unit,FUNCTION,_("Instance : %s"),src.c_str()); 139 140 { 141 dest = _name; 142 #ifdef POSITION 143 _component->interface_map (src ,"", 144 dest,""); 145 #endif 146 147 PORT_MAP(_component,src , "in_CLOCK" ,dest, "in_CLOCK"); 148 PORT_MAP(_component,src , "in_NRESET",dest, "in_NRESET"); 149 } 150 151 // ~~~~~[ Interface : "predict" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 152 for (uint32_t j=0; j<_param->_nb_inst_predict; ++j) 153 { 154 dest = _name; 155 156 #ifdef POSITION 157 _component->interface_map (src ,"predict_"+toString(j), 158 dest,"predict_"+toString(j)); 159 #endif 160 161 PORT_MAP(_component,src , "in_PREDICT_"+toString(j)+"_ADDRESS" , 162 dest, "in_PREDICT_"+toString(j)+"_ADDRESS" ); 163 164 dest = _name+"_glue"; 165 166 #ifdef POSITION 167 _component->interface_map (src ,"predict_"+toString(j), 168 dest,"predict_predictor_"+toString(i)+"_"+toString(j)); 169 #endif 170 171 COMPONENT_MAP(_component,src , "in_PREDICT_" +toString(j)+"_VAL" , 172 dest,"out_PREDICT_PREDICTOR_"+toString(i)+"_"+toString(j)+"_VAL" ); 173 COMPONENT_MAP(_component,src ,"out_PREDICT_" +toString(j)+"_ACK" , 174 dest, "in_PREDICT_PREDICTOR_"+toString(i)+"_"+toString(j)+"_ACK" ); 175 // COMPONENT_MAP(_component,src , "in_PREDICT_" +toString(j)+"_ADDRESS" , 176 // dest,"out_PREDICT_PREDICTOR_"+toString(i)+"_"+toString(j)+"_ADDRESS" ); 177 COMPONENT_MAP(_component,src ,"out_PREDICT_" +toString(j)+"_DIRECTION" , 178 dest, "in_PREDICT_PREDICTOR_"+toString(i)+"_"+toString(j)+"_DIRECTION" ); 179 COMPONENT_MAP(_component,src ,"out_PREDICT_" +toString(j)+"_HISTORY" , 180 dest, "in_PREDICT_PREDICTOR_"+toString(i)+"_"+toString(j)+"_HISTORY" ); 181 if (_param->_predictor_update_on_prediction [i]) 182 { 183 COMPONENT_MAP(_component,src , "in_PREDICT_" +toString(j)+"_DIRECTION_VAL", 184 dest,"out_PREDICT_PREDICTOR_"+toString(i)+"_"+toString(j)+"_DIRECTION_VAL"); 185 COMPONENT_MAP(_component,src , "in_PREDICT_" +toString(j)+"_DIRECTION" , 186 dest,"out_PREDICT_PREDICTOR_"+toString(i)+"_"+toString(j)+"_DIRECTION" ); 187 } 188 } 189 190 // ~~~~~[ Interface : "update" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 191 for (uint32_t j=0; j<_param->_nb_inst_update; ++j) 192 { 193 dest = _name; 194 195 #ifdef POSITION 196 _component->interface_map (src ,"update_"+toString(j), 197 dest,"update_"+toString(j)); 198 #endif 199 200 PORT_MAP(_component,src , "in_UPDATE_"+toString(j)+"_ADDRESS" , 201 dest, "in_UPDATE_"+toString(j)+"_ADDRESS" ); 202 203 dest = _name+"_glue"; 204 205 #ifdef POSITION 206 _component->interface_map (src ,"update_"+toString(j), 207 dest,"update_predictor_"+toString(i)+"_"+toString(j)); 208 #endif 209 210 COMPONENT_MAP(_component,src , "in_UPDATE_" +toString(j)+"_VAL" , 211 dest,"out_UPDATE_PREDICTOR_"+toString(i)+"_"+toString(j)+"_VAL" ); 212 COMPONENT_MAP(_component,src ,"out_UPDATE_" +toString(j)+"_ACK" , 213 dest, "in_UPDATE_PREDICTOR_"+toString(i)+"_"+toString(j)+"_ACK" ); 214 // COMPONENT_MAP(_component,src , "in_UPDATE_" +toString(j)+"_ADDRESS" , 215 // dest,"out_UPDATE_PREDICTOR_"+toString(i)+"_"+toString(j)+"_ADDRESS" ); 216 COMPONENT_MAP(_component,src , "in_UPDATE_" +toString(j)+"_DIRECTION" , 217 dest,"out_UPDATE_PREDICTOR_"+toString(i)+"_"+toString(j)+"_DIRECTION" ); 218 COMPONENT_MAP(_component,src , "in_UPDATE_" +toString(j)+"_HISTORY" , 219 dest,"out_UPDATE_PREDICTOR_"+toString(i)+"_"+toString(j)+"_HISTORY" ); 220 if (_param->_predictor_update_on_prediction [i]) 221 COMPONENT_MAP(_component,src , "in_UPDATE_" +toString(j)+"_MISS" , 222 dest,"out_UPDATE_PREDICTOR_"+toString(i)+"_"+toString(j)+"_MISS" ); 223 } 224 // // ~~~~~[ Interface : "update" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 225 // public : SC_IN (Tcontrol_t) ** in_UPDATE_VAL ;//[nb_inst_update] 226 // public : SC_OUT(Tcontrol_t) ** out_UPDATE_ACK ;//[nb_inst_update] 227 // public : SC_IN (Taddress_t) ** in_UPDATE_ADDRESS ;//[nb_inst_update] 228 // public : SC_IN (Thistory_t) ** in_UPDATE_HISTORY ;//[nb_inst_update] 229 // public : SC_IN (Tcontrol_t) ** in_UPDATE_DIRECTION ;//[nb_inst_update] 230 // public : SC_IN (Tcontrol_t) ** in_UPDATE_MISS ;//[nb_inst_update] // if update_on_prediction 231 232 } 233 234 // =================================================================== 235 // =====[ Glue ]====================================================== 236 // =================================================================== 237 238 { 239 src = _name+"_glue"; 240 log_printf(INFO,Prediction_unit,FUNCTION,_("Instance : %s"),src.c_str()); 241 242 { 243 dest = _name; 244 #ifdef POSITION 245 _component->interface_map (src ,"", 246 dest,""); 247 #endif 248 249 PORT_MAP(_component,src , "in_CLOCK" ,dest, "in_CLOCK"); 250 PORT_MAP(_component,src , "in_NRESET",dest, "in_NRESET"); 251 } 252 253 // ~~~~~[ Interface : "predict" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 254 for (uint32_t i=0; i<_param->_nb_inst_predict; ++i) 255 { 256 dest = _name; 257 #ifdef POSITION 258 _component->interface_map (src ,"predict_"+toString(i), 259 dest,"predict_"+toString(i)); 260 #endif 261 262 PORT_MAP(_component,src , "in_PREDICT_"+toString(i)+"_VAL" , 263 dest, "in_PREDICT_"+toString(i)+"_VAL" ); 264 PORT_MAP(_component,src ,"out_PREDICT_"+toString(i)+"_ACK" , 265 dest,"out_PREDICT_"+toString(i)+"_ACK" ); 266 PORT_MAP(_component,src ,"out_PREDICT_"+toString(i)+"_HISTORY" , 267 dest,"out_PREDICT_"+toString(i)+"_HISTORY" ); 268 PORT_MAP(_component,src ,"out_PREDICT_"+toString(i)+"_DIRECTION", 269 dest,"out_PREDICT_"+toString(i)+"_DIRECTION"); 270 } 271 272 // out_PREDICT_PREDICTOR_VAL -> two_level_branch_predictor. in_PREDICT_PREDICTOR_VAL 273 // in_PREDICT_PREDICTOR_ACK -> two_level_branch_predictor.out_PREDICT_PREDICTOR_ACK 274 // in_PREDICT_PREDICTOR_HISTORY -> two_level_branch_predictor.out_PREDICT_PREDICTOR_HISTORY 275 // in_PREDICT_PREDICTOR_DIRECTION -> two_level_branch_predictor.out_PREDICT_PREDICTOR_DIRECTION 276 // out_PREDICT_PREDICTOR_DIRECTION_VAL -> two_level_branch_predictor. in_PREDICT_PREDICTOR_DIRECTION_VAL 277 // out_PREDICT_PREDICTOR_DIRECTION -> two_level_branch_predictor. in_PREDICT_PREDICTOR_DIRECTION 278 279 // ~~~~~[ Interface : "update" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 280 for (uint32_t i=0; i<_param->_nb_inst_update; ++i) 281 { 282 dest = _name; 283 #ifdef POSITION 284 _component->interface_map (src ,"update_"+toString(i), 285 dest,"update_"+toString(i)); 286 #endif 287 288 PORT_MAP(_component,src , "in_UPDATE_"+toString(i)+"_VAL" , 289 dest, "in_UPDATE_"+toString(i)+"_VAL" ); 290 PORT_MAP(_component,src ,"out_UPDATE_"+toString(i)+"_ACK" , 291 dest,"out_UPDATE_"+toString(i)+"_ACK" ); 292 PORT_MAP(_component,src , "in_UPDATE_"+toString(i)+"_HISTORY" , 293 dest, "in_UPDATE_"+toString(i)+"_HISTORY" ); 294 PORT_MAP(_component,src , "in_UPDATE_"+toString(i)+"_DIRECTION", 295 dest, "in_UPDATE_"+toString(i)+"_DIRECTION"); 296 } 297 298 // out_UPDATE_PREDICTOR_VAL -> two_level_branch_predictor. in_UPDATE_PREDICTOR_VAL 299 // in_UPDATE_PREDICTOR_ACK -> two_level_branch_predictor.out_UPDATE_PREDICTOR_ACK 300 // out_UPDATE_PREDICTOR_HISTORY -> two_level_branch_predictor. in_UPDATE_PREDICTOR_HISTORY 301 // out_UPDATE_PREDICTOR_DIRECTION -> two_level_branch_predictor. in_UPDATE_PREDICTOR_DIRECTION 302 // out_UPDATE_PREDICTOR_MISS -> two_level_branch_predictor. in_UPDATE_PREDICTOR_MISS 303 304 } 64 305 65 306 // ~~~~~[ Others ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Direction/Meta_Predictor/src/Meta_Predictor_deallocation.cpp
r110 r111 29 29 delete in_CLOCK ; 30 30 delete in_NRESET; 31 32 DELETE1_SIGNAL( in_PREDICT_VAL ,_param->_nb_inst_predict,1 ); 33 DELETE1_SIGNAL(out_PREDICT_ACK ,_param->_nb_inst_predict,1 ); 34 DELETE1_SIGNAL( in_PREDICT_ADDRESS ,_param->_nb_inst_predict,_param->_size_address); 35 DELETE1_SIGNAL(out_PREDICT_DIRECTION ,_param->_nb_inst_predict,1 ); 36 DELETE1_SIGNAL(out_PREDICT_HISTORY ,_param->_nb_inst_predict,_param->_size_history); 37 38 DELETE1_SIGNAL( in_UPDATE_VAL ,_param->_nb_inst_update,1 ); 39 DELETE1_SIGNAL(out_UPDATE_ACK ,_param->_nb_inst_update,1 ); 40 DELETE1_SIGNAL( in_UPDATE_ADDRESS ,_param->_nb_inst_update,_param->_size_address); 41 DELETE1_SIGNAL( in_UPDATE_HISTORY ,_param->_nb_inst_update,_param->_size_history); 42 DELETE1_SIGNAL( in_UPDATE_DIRECTION ,_param->_nb_inst_update,1 ); 31 43 } 32 44 // ~~~~~[ Component ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 33 45 46 DELETE0(_component_glue); 47 DELETE1(_component_two_level_branch_predictor,_param->_nb_predictor); 48 34 49 delete _component; 50 35 51 36 52 log_end(Meta_Predictor,FUNCTION); -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Direction/Meta_Predictor/src/Parameters.cpp
r110 r111 7 7 8 8 #include "Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Direction/Meta_Predictor/include/Parameters.h" 9 #include "Behavioural/include/Allocation.h" 9 10 10 11 namespace morpheo { … … 20 21 #undef FUNCTION 21 22 #define FUNCTION "Meta_Predictor::Parameters" 22 Parameters::Parameters (bool is_toplevel) 23 Parameters::Parameters (uint32_t nb_inst_predict , 24 uint32_t nb_inst_update , 25 uint32_t size_address , 26 bool have_bht [3], 27 uint32_t bht_size_shifter [3], 28 uint32_t bht_nb_shifter [3], 29 bool have_pht [3], 30 uint32_t pht_size_counter [3], 31 uint32_t pht_nb_counter [3], 32 uint32_t pht_size_address_share [3], 33 bool is_toplevel) 23 34 { 24 35 log_begin(Meta_Predictor,FUNCTION); 25 36 37 _nb_inst_predict = nb_inst_predict ; 38 _nb_inst_update = nb_inst_update ; 39 _size_address = size_address ; 40 for (uint32_t i=0; i<3; ++i) 41 { 42 _have_bht [i] = have_bht [i]; 43 _bht_size_shifter [i] = (_have_bht [i])?bht_size_shifter [i]:0; 44 _bht_nb_shifter [i] = (_have_bht [i])?bht_nb_shifter [i]:0; 45 _have_pht [i] = have_pht [i]; 46 _pht_size_counter [i] = (_have_pht [i])?pht_size_counter [i]:0; 47 _pht_nb_counter [i] = (_have_pht [i])?pht_nb_counter [i]:0; 48 _pht_size_address_share [i] = (_have_bht[i] and _have_pht [i])?pht_size_address_share [i]:0; 49 } 50 26 51 test(); 27 52 53 _have_meta_predictor = (_have_bht [2] or _have_pht [2]); 54 _nb_predictor = (_have_meta_predictor)?3:1; 55 56 ALLOC1(_predictor_update_on_prediction,bool , _nb_predictor); 57 ALLOC1(_predictor_size_history ,uint32_t, _nb_predictor); 58 59 // All predictor can update on prediction .... 60 for (uint32_t i=0; i<_nb_predictor; ++i) 61 _predictor_update_on_prediction [i] = true; 62 63 // ... But the selector prediction can't 64 if (_have_meta_predictor) 65 _predictor_update_on_prediction [_nb_predictor-1] = false; 66 67 _param_two_level_branch_predictor = new morpheo::behavioural::core::multi_front_end::front_end::prediction_unit::direction::meta_predictor::two_level_branch_predictor::Parameters * [_nb_predictor]; 68 for (uint32_t i=0; i<_nb_predictor; ++i) 69 { 70 _param_two_level_branch_predictor [i] = new morpheo::behavioural::core::multi_front_end::front_end::prediction_unit::direction::meta_predictor::two_level_branch_predictor::Parameters 71 (_nb_inst_predict , 72 _nb_inst_update , 73 _size_address , 74 _have_bht [i], 75 _bht_size_shifter [i], 76 _bht_nb_shifter [i], 77 _have_pht [i], 78 _pht_size_counter [i], 79 _pht_nb_counter [i], 80 _pht_size_address_share [i], 81 _predictor_update_on_prediction [i] 82 ); 83 84 _predictor_size_history [i] = _param_two_level_branch_predictor [i]->_size_history; 85 } 86 87 _param_glue = new morpheo::behavioural::core::multi_front_end::front_end::prediction_unit::direction::meta_predictor::meta_predictor_glue::Parameters 88 ( 89 _nb_inst_predict , 90 _nb_inst_update , 91 _nb_predictor , 92 _predictor_size_history , 93 _predictor_update_on_prediction 94 ); 95 _size_history = _param_glue->_size_history; 96 28 97 if (is_toplevel) 29 98 { … … 48 117 { 49 118 log_begin(Meta_Predictor,FUNCTION); 119 120 DELETE1(_param_two_level_branch_predictor, _nb_predictor); 121 122 DELETE1(_predictor_size_history , _nb_predictor); 123 DELETE1(_predictor_update_on_prediction , _nb_predictor); 124 50 125 log_end(Meta_Predictor,FUNCTION); 51 126 }; … … 56 131 { 57 132 log_begin(Meta_Predictor,FUNCTION); 133 134 COPY(_param_glue); 135 for (uint32_t i=0; i<_nb_predictor; ++i) 136 COPY(_param_two_level_branch_predictor [i]); 137 58 138 log_end(Meta_Predictor,FUNCTION); 59 139 }; -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Direction/include/Direction.h
r82 r111 13 13 #endif 14 14 15 #include "Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Direction/Direction_Glue/include/Direction_Glue.h" 16 #include "Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Direction/Meta_Predictor/include/Meta_Predictor.h" 15 17 #include <iostream> 16 18 #include "Common/include/ToString.h" … … 27 29 #endif 28 30 #include "Behavioural/include/Usage.h" 29 30 #include "Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Direction/Direction_Glue/include/Direction_Glue.h"31 31 32 32 namespace morpheo { … … 79 79 80 80 // ~~~~~[ Component ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 81 public : morpheo::behavioural::core::multi_front_end::front_end::prediction_unit::direction::meta_predictor::Meta_Predictor * _component_meta_predictor; 81 82 public : morpheo::behavioural::core::multi_front_end::front_end::prediction_unit::direction::direction_glue::Direction_Glue * _component_glue; 82 83 -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Direction/include/Parameters.h
r88 r111 14 14 15 15 #include "Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Direction/Direction_Glue/include/Parameters.h" 16 #include "Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Direction/Meta_Predictor/include/Parameters.h" 16 17 17 18 namespace morpheo { … … 45 46 46 47 public : morpheo::behavioural::core::multi_front_end::front_end::prediction_unit::direction::direction_glue::Parameters * _param_glue; 48 public : morpheo::behavioural::core::multi_front_end::front_end::prediction_unit::direction::meta_predictor::Parameters * _param_meta_predictor; 47 49 48 50 //-----[ methods ]----------------------------------------------------------- -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Direction/src/Direction_allocation.cpp
r88 r111 84 84 std::string name; 85 85 86 if (_param->_have_component_meta_predictor) 87 { 88 name = _name+"_meta_predictor"; 89 log_printf(INFO,Prediction_unit,FUNCTION,_("Create : %s"),name.c_str()); 90 91 _component_meta_predictor = new morpheo::behavioural::core::multi_front_end::front_end::prediction_unit::direction::meta_predictor::Meta_Predictor 92 (name.c_str() 93 #ifdef STATISTICS 94 ,param_statistics 95 #endif 96 ,_param->_param_meta_predictor 97 ,_usage); 98 99 _component->set_component (_component_meta_predictor->_component 100 #ifdef POSITION 101 , 50, 50, 10, 10 102 #endif 103 ); 104 } 105 86 106 { 87 107 name = _name+"_glue"; … … 105 125 // ~~~~~[ Instanciation ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 106 126 std::string src,dest; 127 128 // =================================================================== 129 // =====[ Meta_Predictor ]============================================ 130 // =================================================================== 131 if (_param->_have_component_meta_predictor) 132 { 133 src = _name+"_meta_predictor"; 134 log_printf(INFO,Prediction_unit,FUNCTION,_("Instance : %s"),src.c_str()); 135 136 { 137 dest = _name; 138 #ifdef POSITION 139 _component->interface_map (src ,"", 140 dest,""); 141 #endif 142 143 PORT_MAP(_component,src , "in_CLOCK" ,dest, "in_CLOCK"); 144 PORT_MAP(_component,src , "in_NRESET",dest, "in_NRESET"); 145 } 146 147 for (uint32_t i=0; i<_param->_nb_inst_predict; i++) 148 { 149 dest = _name+"_glue"; 150 #ifdef POSITION 151 _component->interface_map (src ,"predict_" +toString(i), 152 dest,"predict_predictor_"+toString(i)); 153 #endif 154 155 COMPONENT_MAP(_component,src , "in_PREDICT_"+toString(i)+ "_VAL" , 156 dest,"out_PREDICT_"+toString(i)+"_PREDICTOR_VAL" ); 157 COMPONENT_MAP(_component,src ,"out_PREDICT_"+toString(i)+ "_ACK" , 158 dest, "in_PREDICT_"+toString(i)+"_PREDICTOR_ACK" ); 159 COMPONENT_MAP(_component,src , "in_PREDICT_"+toString(i)+ "_ADDRESS" , 160 dest,"out_PREDICT_"+toString(i)+"_PREDICTOR_ADDRESS_SRC"); 161 COMPONENT_MAP(_component,src ,"out_PREDICT_"+toString(i)+ "_DIRECTION" , 162 dest, "in_PREDICT_"+toString(i)+"_PREDICTOR_DIRECTION" ); 163 COMPONENT_MAP(_component,src ,"out_PREDICT_"+toString(i)+ "_HISTORY" , 164 dest, "in_PREDICT_"+toString(i)+"_PREDICTOR_HISTORY" ); 165 } 166 167 for (uint32_t i=0; i<_param->_nb_inst_update; i++) 168 { 169 dest = _name+"_glue"; 170 #ifdef POSITION 171 _component->interface_map (src ,"update_" +toString(i), 172 dest,"update_predictor_"+toString(i)); 173 #endif 174 175 COMPONENT_MAP(_component,src , "in_UPDATE_"+toString(i)+ "_VAL" , 176 dest,"out_UPDATE_"+toString(i)+"_PREDICTOR_VAL" ); 177 COMPONENT_MAP(_component,src ,"out_UPDATE_"+toString(i)+ "_ACK" , 178 dest, "in_UPDATE_"+toString(i)+"_PREDICTOR_ACK" ); 179 COMPONENT_MAP(_component,src , "in_UPDATE_"+toString(i)+ "_ADDRESS" , 180 dest,"out_UPDATE_"+toString(i)+"_PREDICTOR_ADDRESS" ); 181 COMPONENT_MAP(_component,src , "in_UPDATE_"+toString(i)+ "_DIRECTION" , 182 dest,"out_UPDATE_"+toString(i)+"_PREDICTOR_DIRECTION" ); 183 COMPONENT_MAP(_component,src , "in_UPDATE_"+toString(i)+ "_HISTORY" , 184 dest,"out_UPDATE_"+toString(i)+"_PREDICTOR_HISTORY" ); 185 } 186 } 107 187 188 // =================================================================== 189 // =====[ Glue ]====================================================== 190 // =================================================================== 108 191 { 109 192 src = _name+"_glue"; … … 179 262 } 180 263 // ~~~~~[ Others ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 181 // _component->test_map(); 264 if (DEBUG_Direction == true) 265 _component->test_map(); 182 266 183 267 #ifdef POSITION -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Direction/src/Direction_deallocation.cpp
r88 r111 45 45 // ~~~~~[ Component ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 46 46 delete _component_glue; 47 if (_param->_have_component_meta_predictor) 48 delete _component_meta_predictor; 47 49 delete _component; 48 50 -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Direction/src/Parameters.cpp
r88 r111 134 134 } 135 135 136 _size_history = 0; 136 test(); 137 138 if (_have_component_meta_predictor) 139 _param_meta_predictor = new morpheo::behavioural::core::multi_front_end::front_end::prediction_unit::direction::meta_predictor::Parameters 140 ( 141 _nb_inst_predict , 142 _nb_inst_update , 143 size_address , 144 _have_bht , 145 _bht_size_shifter , 146 _bht_nb_shifter , 147 _have_pht , 148 _pht_size_counter , 149 _pht_nb_counter , 150 _pht_size_address_share 151 ); 137 152 138 for (uint32_t i=0; i<3; i++) 139 _size_history += (((_have_bht [i])?_bht_size_shifter [i]:0) + 140 ((_have_pht [i])?_pht_size_counter [i]:0)); 141 142 _have_port_history = (_size_history > 0); 143 144 test(); 153 _size_history = (_have_component_meta_predictor)?_param_meta_predictor->_size_history:0; 154 155 log_printf(TRACE,Direction,FUNCTION," * size_history : %d",_size_history); 156 157 // _size_history = 0; 158 // for (uint32_t i=0; i<3; i++) 159 // _size_history += (((_have_bht [i])?_bht_size_shifter [i]:0) + 160 // ((_have_pht [i])?_pht_size_counter [i]:0)); 161 162 _have_port_history = (_size_history > 0); 145 163 146 164 _param_glue = new morpheo::behavioural::core::multi_front_end::front_end::prediction_unit::direction::direction_glue::Parameters … … 177 195 178 196 delete _param_glue; 197 if (_have_component_meta_predictor) 198 delete _param_meta_predictor; 199 179 200 log_printf(FUNC,Direction,FUNCTION,"End"); 180 201 }; -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Direction/src/Parameters_msg_error.cpp
r81 r111 39 39 case PREDICTOR_STATIC : 40 40 case PREDICTOR_LAST_TAKE : 41 {42 break;43 }44 41 case PREDICTOR_COUNTER : 45 42 case PREDICTOR_LOCAL : … … 47 44 case PREDICTOR_META : 48 45 case PREDICTOR_CUSTOM : 46 { 47 break; 48 } 49 default : 49 50 { 50 51 test.error("Unimplemented predictor_scheme : \""+toString(_predictor_scheme)+"\". (Coming Soon)");
Note: See TracChangeset
for help on using the changeset viewer.