[78] | 1 | /* |
---|
| 2 | * $Id: Parameters.cpp 88 2008-12-10 18:31:39Z rosiere $ |
---|
| 3 | * |
---|
| 4 | * [ Description ] |
---|
| 5 | * |
---|
| 6 | */ |
---|
| 7 | |
---|
| 8 | #include "Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Update_Prediction_Table/include/Parameters.h" |
---|
[81] | 9 | #include "Common/include/Max.h" |
---|
[78] | 10 | |
---|
| 11 | namespace morpheo { |
---|
| 12 | namespace behavioural { |
---|
| 13 | namespace core { |
---|
| 14 | namespace multi_front_end { |
---|
| 15 | namespace front_end { |
---|
| 16 | namespace prediction_unit { |
---|
| 17 | namespace update_prediction_table { |
---|
| 18 | |
---|
| 19 | |
---|
| 20 | #undef FUNCTION |
---|
| 21 | #define FUNCTION "Update_Prediction_Table::Parameters" |
---|
[81] | 22 | Parameters::Parameters (uint32_t nb_context , |
---|
[88] | 23 | uint32_t * size_upt_queue , |
---|
| 24 | uint32_t * size_ufpt_queue , |
---|
[81] | 25 | uint32_t size_address , |
---|
| 26 | uint32_t nb_inst_predict , |
---|
| 27 | uint32_t nb_inst_decod , |
---|
| 28 | uint32_t nb_inst_branch_complete, |
---|
| 29 | uint32_t nb_inst_update , |
---|
| 30 | uint32_t size_history , |
---|
[88] | 31 | uint32_t * size_ras_index , |
---|
| 32 | bool is_toplevel): |
---|
| 33 | _not_accurate_block_predict (false) |
---|
[78] | 34 | { |
---|
| 35 | log_printf(FUNC,Update_Prediction_Table,FUNCTION,"Begin"); |
---|
[81] | 36 | |
---|
| 37 | _nb_context = nb_context ; |
---|
[88] | 38 | _size_upt_queue = size_upt_queue ; |
---|
| 39 | _size_ufpt_queue = size_ufpt_queue ; |
---|
| 40 | // _size_address = size_address ; |
---|
[81] | 41 | _nb_inst_predict = nb_inst_predict ; |
---|
| 42 | _nb_inst_decod = nb_inst_decod ; |
---|
| 43 | _nb_inst_branch_complete = nb_inst_branch_complete; |
---|
| 44 | _nb_inst_update = nb_inst_update ; |
---|
| 45 | _size_history = size_history ; |
---|
| 46 | _size_ras_index = size_ras_index ; |
---|
| 47 | |
---|
| 48 | _max_size_ras_index = max<uint32_t>(_size_ras_index,nb_context); |
---|
| 49 | |
---|
| 50 | _have_port_history = _size_history > 0; |
---|
[88] | 51 | |
---|
| 52 | test(); |
---|
| 53 | |
---|
| 54 | if (is_toplevel) |
---|
| 55 | { |
---|
| 56 | _size_instruction_address = size_address; |
---|
| 57 | _size_context_id = log2(nb_context); |
---|
| 58 | _size_depth = log2(max<uint32_t>(_size_upt_queue,_nb_context)); |
---|
| 59 | |
---|
| 60 | _have_port_context_id = _size_context_id> 0; |
---|
| 61 | _have_port_depth = _size_depth > 0; |
---|
| 62 | |
---|
| 63 | copy (); |
---|
| 64 | } |
---|
[81] | 65 | |
---|
[78] | 66 | log_printf(FUNC,Update_Prediction_Table,FUNCTION,"End"); |
---|
| 67 | }; |
---|
| 68 | |
---|
| 69 | // #undef FUNCTION |
---|
| 70 | // #define FUNCTION "Update_Prediction_Table::Parameters (copy)" |
---|
| 71 | // Parameters::Parameters (Parameters & param) |
---|
| 72 | // { |
---|
| 73 | // log_printf(FUNC,Update_Prediction_Table,FUNCTION,"Begin"); |
---|
| 74 | // test(); |
---|
| 75 | // log_printf(FUNC,Update_Prediction_Table,FUNCTION,"End"); |
---|
| 76 | // }; |
---|
| 77 | |
---|
| 78 | #undef FUNCTION |
---|
| 79 | #define FUNCTION "Update_Prediction_Table::~Parameters" |
---|
| 80 | Parameters::~Parameters () |
---|
| 81 | { |
---|
| 82 | log_printf(FUNC,Update_Prediction_Table,FUNCTION,"Begin"); |
---|
[88] | 83 | // delete [] _size_depth ; |
---|
| 84 | // delete [] _have_port_depth; |
---|
[78] | 85 | log_printf(FUNC,Update_Prediction_Table,FUNCTION,"End"); |
---|
| 86 | }; |
---|
| 87 | |
---|
[88] | 88 | #undef FUNCTION |
---|
| 89 | #define FUNCTION "Update_Prediction_Table::copy" |
---|
| 90 | void Parameters::copy (void) |
---|
| 91 | { |
---|
| 92 | log_printf(FUNC,Update_Prediction_Table,FUNCTION,"Begin"); |
---|
| 93 | log_printf(FUNC,Update_Prediction_Table,FUNCTION,"End"); |
---|
| 94 | }; |
---|
| 95 | |
---|
[78] | 96 | }; // end namespace update_prediction_table |
---|
| 97 | }; // end namespace prediction_unit |
---|
| 98 | }; // end namespace front_end |
---|
| 99 | }; // end namespace multi_front_end |
---|
| 100 | }; // end namespace core |
---|
| 101 | |
---|
| 102 | }; // end namespace behavioural |
---|
| 103 | }; // end namespace morpheo |
---|