[83] | 1 | /* |
---|
| 2 | * $Id: Parameters.cpp 111 2009-02-27 18:37:40Z rosiere $ |
---|
| 3 | * |
---|
| 4 | * [ Description ] |
---|
| 5 | * |
---|
| 6 | */ |
---|
| 7 | |
---|
| 8 | #include "Behavioural/Core/Multi_Front_end/Front_end/Decod_unit/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 | |
---|
| 18 | |
---|
| 19 | #undef FUNCTION |
---|
| 20 | #define FUNCTION "Decod_unit::Parameters" |
---|
| 21 | Parameters::Parameters (uint32_t nb_context , |
---|
| 22 | uint32_t * nb_inst_fetch , |
---|
| 23 | uint32_t nb_inst_decod , |
---|
| 24 | uint32_t size_queue , |
---|
[111] | 25 | decod_queue::Tdecod_queue_scheme_t |
---|
| 26 | queue_scheme , |
---|
[83] | 27 | uint32_t size_general_data , |
---|
| 28 | uint32_t * nb_branch_speculated , |
---|
[88] | 29 | // uint32_t * size_branch_update_prediction, |
---|
[83] | 30 | uint32_t nb_context_select , |
---|
| 31 | Tpriority_t select_priority , |
---|
| 32 | Tload_balancing_t select_load_balancing , |
---|
| 33 | bool ** instruction_implemeted , |
---|
[88] | 34 | morpheo::behavioural::custom::custom_information_t (*get_custom_information) (void), |
---|
| 35 | bool is_toplevel |
---|
| 36 | ) |
---|
[83] | 37 | { |
---|
| 38 | log_begin(Decod_unit,FUNCTION); |
---|
| 39 | |
---|
| 40 | _nb_context = nb_context ; |
---|
| 41 | _nb_inst_fetch = nb_inst_fetch ; |
---|
| 42 | _nb_inst_decod = nb_inst_decod ; |
---|
| 43 | _size_queue = size_queue ; |
---|
[111] | 44 | _queue_scheme = queue_scheme ; |
---|
[88] | 45 | // _size_general_data = size_general_data ; |
---|
[83] | 46 | _nb_branch_speculated = nb_branch_speculated ; |
---|
[88] | 47 | // _size_branch_update_prediction = size_branch_update_prediction; |
---|
[83] | 48 | _nb_context_select = nb_context_select ; |
---|
| 49 | _select_priority = select_priority ; |
---|
| 50 | _select_load_balancing = select_load_balancing ; |
---|
| 51 | _instruction_implemeted = instruction_implemeted ; |
---|
| 52 | _get_custom_information = get_custom_information ; |
---|
| 53 | |
---|
| 54 | _max_nb_inst_fetch = max<uint32_t>(_nb_inst_fetch,_nb_context); |
---|
[88] | 55 | // _size_address_inst = size_general_data-2; |
---|
[83] | 56 | |
---|
| 57 | test(); |
---|
| 58 | |
---|
| 59 | _param_decod = new morpheo::behavioural::core::multi_front_end::front_end::decod_unit::decod::Parameters |
---|
| 60 | (_nb_context , |
---|
| 61 | _nb_inst_fetch , |
---|
| 62 | _nb_inst_decod , |
---|
[88] | 63 | _nb_branch_speculated, |
---|
| 64 | // _size_branch_update_prediction, |
---|
[83] | 65 | _nb_context_select , |
---|
[88] | 66 | size_general_data , |
---|
[83] | 67 | _select_priority , |
---|
| 68 | _select_load_balancing , |
---|
| 69 | _instruction_implemeted , |
---|
| 70 | _get_custom_information); |
---|
| 71 | |
---|
| 72 | _param_decod_queue = new morpheo::behavioural::core::multi_front_end::front_end::decod_unit::decod_queue::Parameters |
---|
| 73 | (_nb_context , |
---|
| 74 | _nb_inst_decod , |
---|
| 75 | _size_queue , |
---|
[111] | 76 | _queue_scheme , |
---|
[88] | 77 | size_general_data , |
---|
[83] | 78 | _nb_branch_speculated); |
---|
| 79 | |
---|
[88] | 80 | if (is_toplevel) |
---|
| 81 | { |
---|
| 82 | _size_context_id = log2(_nb_context); |
---|
| 83 | _size_depth = max<uint32_t>(_nb_branch_speculated,_nb_context); |
---|
| 84 | // _size_branch_update_prediction_id = max<uint32_t>(_size_branch_update_prediction,_nb_context); |
---|
| 85 | _size_inst_ifetch_ptr = log2(max<uint32_t>(_nb_inst_fetch,_nb_context)); |
---|
| 86 | _size_nb_inst_decod = log2(_size_queue)+1; |
---|
| 87 | |
---|
| 88 | _size_instruction_address = size_general_data-2; |
---|
| 89 | _size_general_data = size_general_data; |
---|
| 90 | |
---|
| 91 | _have_port_context_id = _size_context_id > 0; |
---|
| 92 | _have_port_depth = (_size_depth > 0); |
---|
| 93 | // _have_port_branch_update_prediction_id = (_size_branch_update_prediction_id > 0); |
---|
| 94 | _have_port_inst_ifetch_ptr = (_size_inst_ifetch_ptr > 0); |
---|
| 95 | |
---|
| 96 | copy (); |
---|
| 97 | } |
---|
| 98 | |
---|
[83] | 99 | log_end(Decod_unit,FUNCTION); |
---|
| 100 | }; |
---|
| 101 | |
---|
| 102 | // #undef FUNCTION |
---|
| 103 | // #define FUNCTION "Decod_unit::Parameters (copy)" |
---|
| 104 | // Parameters::Parameters (Parameters & param) |
---|
| 105 | // { |
---|
| 106 | // log_begin(Decod_unit,FUNCTION); |
---|
| 107 | // test(); |
---|
| 108 | // log_end(Decod_unit,FUNCTION); |
---|
| 109 | // }; |
---|
| 110 | |
---|
| 111 | #undef FUNCTION |
---|
| 112 | #define FUNCTION "Decod_unit::~Parameters" |
---|
| 113 | Parameters::~Parameters () |
---|
| 114 | { |
---|
| 115 | log_begin(Decod_unit,FUNCTION); |
---|
| 116 | |
---|
[88] | 117 | delete _param_decod; |
---|
| 118 | delete _param_decod_queue; |
---|
[83] | 119 | |
---|
| 120 | log_end(Decod_unit,FUNCTION); |
---|
| 121 | }; |
---|
| 122 | |
---|
[88] | 123 | |
---|
| 124 | #undef FUNCTION |
---|
| 125 | #define FUNCTION "Decod_unit::copy" |
---|
| 126 | void Parameters::copy (void) |
---|
| 127 | { |
---|
| 128 | log_begin(Decod_unit,FUNCTION); |
---|
| 129 | |
---|
| 130 | COPY(_param_decod ); |
---|
| 131 | COPY(_param_decod_queue); |
---|
| 132 | |
---|
| 133 | log_end(Decod_unit,FUNCTION); |
---|
| 134 | }; |
---|
| 135 | |
---|
[83] | 136 | }; // end namespace decod_unit |
---|
| 137 | }; // end namespace front_end |
---|
| 138 | }; // end namespace multi_front_end |
---|
| 139 | }; // end namespace core |
---|
| 140 | |
---|
| 141 | }; // end namespace behavioural |
---|
| 142 | }; // end namespace morpheo |
---|