[72] | 1 | /* |
---|
| 2 | * $Id: Parameters.cpp 97 2008-12-19 15:34:00Z rosiere $ |
---|
| 3 | * |
---|
| 4 | * [ Description ] |
---|
| 5 | * |
---|
| 6 | */ |
---|
| 7 | |
---|
| 8 | #include "Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Execute_unit/Execute_unit/Functionnal_unit/include/Parameters.h" |
---|
| 9 | |
---|
| 10 | namespace morpheo { |
---|
| 11 | namespace behavioural { |
---|
| 12 | namespace core { |
---|
| 13 | namespace multi_execute_loop { |
---|
| 14 | namespace execute_loop { |
---|
| 15 | namespace multi_execute_unit { |
---|
| 16 | namespace execute_unit { |
---|
| 17 | namespace functionnal_unit { |
---|
| 18 | |
---|
| 19 | |
---|
| 20 | #undef FUNCTION |
---|
| 21 | #define FUNCTION "Functionnal_unit::Parameters" |
---|
| 22 | Parameters::Parameters (uint32_t nb_context , |
---|
| 23 | uint32_t nb_front_end , |
---|
| 24 | uint32_t nb_ooo_engine , |
---|
| 25 | uint32_t nb_packet , |
---|
| 26 | uint32_t size_general_data , |
---|
| 27 | uint32_t nb_general_register, |
---|
| 28 | uint32_t size_special_data , |
---|
| 29 | uint32_t nb_special_register, |
---|
[78] | 30 | uint32_t size_store_queue , |
---|
| 31 | uint32_t size_load_queue , |
---|
[76] | 32 | execute_timing_t** timing , |
---|
[88] | 33 | morpheo::behavioural::custom::custom_information_t (*get_custom_information) (void), |
---|
| 34 | bool is_toplevel) |
---|
| 35 | { |
---|
| 36 | log_printf(FUNC,Functionnal_unit,FUNCTION,"Begin"); |
---|
[78] | 37 | |
---|
[88] | 38 | _nb_context = nb_context ; |
---|
| 39 | _nb_front_end = nb_front_end ; |
---|
| 40 | _nb_ooo_engine = nb_ooo_engine ; |
---|
| 41 | _nb_packet = nb_packet ; |
---|
| 42 | // _size_general_data = size_general_data ; |
---|
| 43 | // _size_special_data = size_special_data ; |
---|
| 44 | // _nb_general_register = nb_general_register ; |
---|
| 45 | // _nb_special_register = nb_special_register ; |
---|
| 46 | // _size_store_queue = size_store_queue ; |
---|
| 47 | // _size_load_queue = size_load_queue ; |
---|
[72] | 48 | |
---|
[88] | 49 | // _size_context_id = log2(nb_context ); |
---|
| 50 | // _size_front_end_id = log2(nb_front_end ); |
---|
| 51 | // _size_ooo_engine_id = log2(nb_ooo_engine ); |
---|
| 52 | // _size_packet_id = log2(nb_packet ); |
---|
| 53 | // _size_general_register = log2(nb_general_register); |
---|
| 54 | // _size_special_register = log2(nb_special_register); |
---|
[72] | 55 | |
---|
[88] | 56 | // _have_port_context_id = _size_context_id > 0; |
---|
| 57 | // _have_port_front_end_id = _size_front_end_id > 0; |
---|
| 58 | // _have_port_ooo_engine_id = _size_ooo_engine_id > 0; |
---|
| 59 | // _have_port_packet_id = _size_packet_id > 0; |
---|
| 60 | // _have_port_load_queue_ptr= _size_load_queue > 1; |
---|
[72] | 61 | |
---|
[88] | 62 | _have_groupe_MAC = ( (timing[TYPE_SPECIAL][OPERATION_SPECIAL_L_MAC ]._latence > 0) or |
---|
| 63 | (timing[TYPE_SPECIAL][OPERATION_SPECIAL_L_MACRC]._latence > 0) or |
---|
| 64 | (timing[TYPE_SPECIAL][OPERATION_SPECIAL_L_MSB ]._latence > 0)); |
---|
[72] | 65 | |
---|
[88] | 66 | _timing = timing; |
---|
| 67 | |
---|
[78] | 68 | if (get_custom_information == NULL) |
---|
| 69 | _get_custom_information = &(morpheo::behavioural::custom::default_get_custom_information); |
---|
| 70 | else |
---|
| 71 | _get_custom_information = get_custom_information; |
---|
| 72 | |
---|
[72] | 73 | test(); |
---|
[76] | 74 | |
---|
[88] | 75 | if (is_toplevel) |
---|
| 76 | { |
---|
[97] | 77 | _size_instruction_address= size_general_data-2; |
---|
[88] | 78 | _size_context_id = log2(nb_context ); |
---|
| 79 | _size_front_end_id = log2(nb_front_end ); |
---|
| 80 | _size_ooo_engine_id = log2(nb_ooo_engine ); |
---|
| 81 | _size_rob_ptr = log2(nb_packet ); |
---|
| 82 | _size_general_register = log2(nb_general_register); |
---|
| 83 | _size_special_register = log2(nb_special_register); |
---|
| 84 | |
---|
| 85 | _size_general_data = size_general_data ; |
---|
| 86 | _size_special_data = size_special_data ; |
---|
| 87 | _size_general_register = log2(nb_general_register); |
---|
| 88 | _size_special_register = log2(nb_special_register); |
---|
| 89 | |
---|
| 90 | _size_load_queue_ptr = log2(size_load_queue ); |
---|
| 91 | _size_store_queue_ptr = log2(size_store_queue); |
---|
| 92 | |
---|
| 93 | _have_port_context_id = _size_context_id > 0; |
---|
| 94 | _have_port_front_end_id = _size_front_end_id > 0; |
---|
| 95 | _have_port_ooo_engine_id = _size_ooo_engine_id > 0; |
---|
| 96 | _have_port_rob_ptr = _size_rob_ptr > 0; |
---|
| 97 | _have_port_load_queue_ptr= _size_load_queue_ptr> 0; |
---|
| 98 | |
---|
| 99 | copy(); |
---|
| 100 | } |
---|
| 101 | |
---|
[72] | 102 | log_printf(FUNC,Functionnal_unit,FUNCTION,"End"); |
---|
| 103 | }; |
---|
| 104 | |
---|
[88] | 105 | // #undef FUNCTION |
---|
| 106 | // #define FUNCTION "Functionnal_unit::Parameters (copy)" |
---|
| 107 | // Parameters::Parameters (Parameters & param): |
---|
| 108 | // _nb_context (param._nb_context ), |
---|
| 109 | // _nb_front_end (param._nb_front_end ), |
---|
| 110 | // _nb_ooo_engine (param._nb_ooo_engine ), |
---|
| 111 | // _nb_packet (param._nb_packet ), |
---|
| 112 | // _size_general_data (param._size_general_data ), |
---|
| 113 | // _nb_general_register (param._nb_general_register ), |
---|
| 114 | // _size_special_data (param._size_special_data ), |
---|
| 115 | // _nb_special_register (param._nb_special_register ), |
---|
| 116 | // _size_store_queue (param._size_store_queue ), |
---|
| 117 | // _size_load_queue (param._size_load_queue ), |
---|
[72] | 118 | |
---|
[88] | 119 | // _size_context_id (param._size_context_id ), |
---|
| 120 | // _size_front_end_id (param._size_front_end_id ), |
---|
| 121 | // _size_ooo_engine_id (param._size_ooo_engine_id ), |
---|
| 122 | // _size_packet_id (param._size_packet_id ), |
---|
| 123 | // _size_general_register (param._size_general_register ), |
---|
| 124 | // _size_special_register (param._size_special_register ), |
---|
[72] | 125 | |
---|
[88] | 126 | // _have_port_context_id (param._have_port_context_id ), |
---|
| 127 | // _have_port_front_end_id (param._have_port_front_end_id ), |
---|
| 128 | // _have_port_ooo_engine_id (param._have_port_ooo_engine_id), |
---|
| 129 | // _have_port_packet_id (param._have_port_packet_id ), |
---|
| 130 | // _have_port_load_queue_ptr(param._have_port_load_queue_ptr), |
---|
[72] | 131 | |
---|
[88] | 132 | // _have_groupe_MAC (param._have_groupe_MAC ) |
---|
| 133 | // { |
---|
| 134 | // log_printf(FUNC,Functionnal_unit,FUNCTION,"Begin"); |
---|
| 135 | |
---|
| 136 | // _timing = param._timing; |
---|
| 137 | // _get_custom_information = param._get_custom_information; |
---|
| 138 | |
---|
| 139 | // test(); |
---|
| 140 | // log_printf(FUNC,Functionnal_unit,FUNCTION,"End"); |
---|
| 141 | // }; |
---|
| 142 | |
---|
| 143 | #undef FUNCTION |
---|
| 144 | #define FUNCTION "Functionnal_unit::~Parameters" |
---|
| 145 | Parameters::~Parameters (void) |
---|
[72] | 146 | { |
---|
| 147 | log_printf(FUNC,Functionnal_unit,FUNCTION,"Begin"); |
---|
| 148 | log_printf(FUNC,Functionnal_unit,FUNCTION,"End"); |
---|
| 149 | }; |
---|
| 150 | |
---|
| 151 | #undef FUNCTION |
---|
[88] | 152 | #define FUNCTION "Functionnal_unit::copy" |
---|
| 153 | void Parameters::copy (void) |
---|
[72] | 154 | { |
---|
| 155 | log_printf(FUNC,Functionnal_unit,FUNCTION,"Begin"); |
---|
| 156 | log_printf(FUNC,Functionnal_unit,FUNCTION,"End"); |
---|
| 157 | }; |
---|
| 158 | |
---|
| 159 | }; // end namespace functionnal_unit |
---|
| 160 | }; // end namespace execute_unit |
---|
| 161 | }; // end namespace multi_execute_unit |
---|
| 162 | }; // end namespace execute_loop |
---|
| 163 | }; // end namespace multi_execute_loop |
---|
| 164 | }; // end namespace core |
---|
| 165 | |
---|
| 166 | }; // end namespace behavioural |
---|
| 167 | }; // end namespace morpheo |
---|