| 1 | /* |
|---|
| 2 | * $Id: Parameters.cpp 81 2008-04-15 18:40:01Z rosiere $ |
|---|
| 3 | * |
|---|
| 4 | * [ Description ] |
|---|
| 5 | * |
|---|
| 6 | */ |
|---|
| 7 | |
|---|
| 8 | #include "Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Branch_Target_Buffer/Branch_Target_Buffer_Glue/include/Parameters.h" |
|---|
| 9 | #include "Common/include/BitManipulation.h" |
|---|
| 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 branch_target_buffer { |
|---|
| 18 | namespace branch_target_buffer_glue { |
|---|
| 19 | |
|---|
| 20 | |
|---|
| 21 | #undef FUNCTION |
|---|
| 22 | #define FUNCTION "Branch_Target_Buffer_Glue::Parameters" |
|---|
| 23 | Parameters::Parameters (uint32_t max_nb_instruction, |
|---|
| 24 | uint32_t size_buffer , |
|---|
| 25 | uint32_t associativity , |
|---|
| 26 | uint32_t size_address , |
|---|
| 27 | uint32_t nb_inst_predict , |
|---|
| 28 | uint32_t nb_inst_decod , |
|---|
| 29 | uint32_t nb_inst_update ) |
|---|
| 30 | { |
|---|
| 31 | log_printf(FUNC,Branch_Target_Buffer_Glue,FUNCTION,"Begin"); |
|---|
| 32 | |
|---|
| 33 | _max_nb_instruction = max_nb_instruction; |
|---|
| 34 | _size_buffer = size_buffer ; |
|---|
| 35 | _associativity = associativity ; |
|---|
| 36 | _size_address = size_address ; |
|---|
| 37 | _nb_inst_predict = nb_inst_predict ; |
|---|
| 38 | _nb_inst_decod = nb_inst_decod ; |
|---|
| 39 | _nb_inst_update = nb_inst_update ; |
|---|
| 40 | |
|---|
| 41 | _size_bank = size_buffer/associativity; |
|---|
| 42 | _size_victim = log2(associativity); |
|---|
| 43 | _size_victim_address = log2(_size_bank); |
|---|
| 44 | |
|---|
| 45 | _have_port_victim = (_size_victim > 0); |
|---|
| 46 | _is_full_associative = _size_bank == 1; |
|---|
| 47 | |
|---|
| 48 | _mask_bank = gen_mask<Tgeneral_data_t> (_size_victim_address); |
|---|
| 49 | _shift_bank = log2(max_nb_instruction)+2; |
|---|
| 50 | |
|---|
| 51 | test(); |
|---|
| 52 | log_printf(FUNC,Branch_Target_Buffer_Glue,FUNCTION,"End"); |
|---|
| 53 | }; |
|---|
| 54 | |
|---|
| 55 | // #undef FUNCTION |
|---|
| 56 | // #define FUNCTION "Branch_Target_Buffer_Glue::Parameters (copy)" |
|---|
| 57 | // Parameters::Parameters (Parameters & param) |
|---|
| 58 | // { |
|---|
| 59 | // log_printf(FUNC,Branch_Target_Buffer_Glue,FUNCTION,"Begin"); |
|---|
| 60 | // test(); |
|---|
| 61 | // log_printf(FUNC,Branch_Target_Buffer_Glue,FUNCTION,"End"); |
|---|
| 62 | // }; |
|---|
| 63 | |
|---|
| 64 | #undef FUNCTION |
|---|
| 65 | #define FUNCTION "Branch_Target_Buffer_Glue::~Parameters" |
|---|
| 66 | Parameters::~Parameters () |
|---|
| 67 | { |
|---|
| 68 | log_printf(FUNC,Branch_Target_Buffer_Glue,FUNCTION,"Begin"); |
|---|
| 69 | log_printf(FUNC,Branch_Target_Buffer_Glue,FUNCTION,"End"); |
|---|
| 70 | }; |
|---|
| 71 | |
|---|
| 72 | }; // end namespace branch_target_buffer_glue |
|---|
| 73 | }; // end namespace branch_target_buffer |
|---|
| 74 | }; // end namespace prediction_unit |
|---|
| 75 | }; // end namespace front_end |
|---|
| 76 | }; // end namespace multi_front_end |
|---|
| 77 | }; // end namespace core |
|---|
| 78 | |
|---|
| 79 | }; // end namespace behavioural |
|---|
| 80 | }; // end namespace morpheo |
|---|