[78] | 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/Decod_unit/Decod/include/Parameters.h" |
---|
| 9 | #include "Common/include/Max.h" |
---|
| 10 | |
---|
| 11 | namespace morpheo { |
---|
| 12 | namespace behavioural { |
---|
| 13 | namespace core { |
---|
| 14 | namespace multi_front_end { |
---|
| 15 | namespace front_end { |
---|
| 16 | namespace decod_unit { |
---|
| 17 | namespace decod { |
---|
| 18 | |
---|
| 19 | |
---|
| 20 | #undef FUNCTION |
---|
| 21 | #define FUNCTION "Decod::Parameters" |
---|
| 22 | Parameters::Parameters (uint32_t nb_context , |
---|
| 23 | uint32_t * nb_inst_fetch , |
---|
| 24 | uint32_t nb_inst_decod , |
---|
| 25 | uint32_t nb_branch_speculated , |
---|
| 26 | uint32_t size_branch_update_prediction, |
---|
| 27 | uint32_t nb_context_select , |
---|
| 28 | uint32_t size_general_data , |
---|
| 29 | Tpriority_t priority , |
---|
| 30 | Tload_balancing_t load_balancing , |
---|
| 31 | bool ** instruction_implemeted , |
---|
| 32 | morpheo::behavioural::custom::custom_information_t (*get_custom_information) (uint32_t)) |
---|
| 33 | { |
---|
| 34 | log_printf(FUNC,Decod,FUNCTION,"Begin"); |
---|
| 35 | |
---|
| 36 | _nb_context = nb_context ; |
---|
| 37 | _nb_inst_fetch = nb_inst_fetch ; |
---|
| 38 | _nb_inst_decod = nb_inst_decod ; |
---|
| 39 | _nb_branch_speculated = nb_branch_speculated ; |
---|
| 40 | _nb_context_select = nb_context_select ; |
---|
| 41 | _size_branch_update_prediction = size_branch_update_prediction; |
---|
| 42 | _size_general_data = size_general_data ; |
---|
| 43 | _priority = priority ; |
---|
| 44 | _load_balancing = load_balancing ; |
---|
| 45 | _instruction_implemeted = instruction_implemeted ; |
---|
| 46 | |
---|
| 47 | if (get_custom_information == NULL) |
---|
| 48 | _get_custom_information = &(morpheo::behavioural::custom::default_get_custom_information); |
---|
| 49 | else |
---|
| 50 | _get_custom_information = get_custom_information; |
---|
| 51 | |
---|
| 52 | |
---|
| 53 | _max_nb_inst_fetch = max<uint32_t>(nb_inst_fetch,nb_context); |
---|
| 54 | |
---|
| 55 | _size_context_id = log2(nb_context ); |
---|
| 56 | _size_depth = log2(nb_branch_speculated); |
---|
| 57 | _size_inst_ifetch_ptr = log2(_max_nb_inst_fetch ); |
---|
| 58 | |
---|
| 59 | _have_port_context_id = _size_context_id > 0; |
---|
| 60 | _have_port_depth = _size_depth > 0; |
---|
| 61 | _have_port_branch_update_prediction_id = _size_branch_update_prediction > 0; |
---|
| 62 | _have_port_inst_ifetch_ptr = _size_inst_ifetch_ptr > 0; |
---|
| 63 | |
---|
| 64 | test(); |
---|
| 65 | log_printf(FUNC,Decod,FUNCTION,"End"); |
---|
| 66 | }; |
---|
| 67 | |
---|
| 68 | // #undef FUNCTION |
---|
| 69 | // #define FUNCTION "Decod::Parameters (copy)" |
---|
| 70 | // Parameters::Parameters (Parameters & param) |
---|
| 71 | // { |
---|
| 72 | // log_printf(FUNC,Decod,FUNCTION,"Begin"); |
---|
| 73 | // test(); |
---|
| 74 | // log_printf(FUNC,Decod,FUNCTION,"End"); |
---|
| 75 | // }; |
---|
| 76 | |
---|
| 77 | #undef FUNCTION |
---|
| 78 | #define FUNCTION "Decod::~Parameters" |
---|
| 79 | Parameters::~Parameters () |
---|
| 80 | { |
---|
| 81 | log_printf(FUNC,Decod,FUNCTION,"Begin"); |
---|
| 82 | log_printf(FUNC,Decod,FUNCTION,"End"); |
---|
| 83 | }; |
---|
| 84 | |
---|
| 85 | }; // end namespace decod |
---|
| 86 | }; // end namespace decod_unit |
---|
| 87 | }; // end namespace front_end |
---|
| 88 | }; // end namespace multi_front_end |
---|
| 89 | }; // end namespace core |
---|
| 90 | |
---|
| 91 | }; // end namespace behavioural |
---|
| 92 | }; // end namespace morpheo |
---|