[77] | 1 | /* |
---|
| 2 | * $Id$ |
---|
| 3 | * |
---|
| 4 | * [ Description ] |
---|
| 5 | * |
---|
| 6 | */ |
---|
| 7 | |
---|
| 8 | #include "Behavioural/Core/Multi_Execute_loop/Execute_loop/Network/Read_unit_to_Execution_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 network { |
---|
| 16 | namespace read_unit_to_execution_unit { |
---|
| 17 | |
---|
| 18 | |
---|
| 19 | #undef FUNCTION |
---|
| 20 | #define FUNCTION "Read_unit_to_Execution_unit::Parameters" |
---|
| 21 | Parameters::Parameters (uint32_t nb_read_unit , |
---|
| 22 | uint32_t nb_execute_unit , |
---|
| 23 | uint32_t nb_context , |
---|
| 24 | uint32_t nb_front_end , |
---|
| 25 | uint32_t nb_ooo_engine , |
---|
| 26 | uint32_t nb_packet , |
---|
| 27 | uint32_t size_general_data , |
---|
| 28 | uint32_t size_special_data , |
---|
| 29 | uint32_t nb_general_register , |
---|
| 30 | uint32_t nb_special_register , |
---|
| 31 | uint32_t size_store_queue , |
---|
| 32 | uint32_t size_load_queue , |
---|
| 33 | Tpriority_t priority , |
---|
| 34 | bool ** table_routing , |
---|
| 35 | bool ** table_execute_type , |
---|
| 36 | bool ** table_execute_thread ): |
---|
| 37 | _nb_read_unit (nb_read_unit ), |
---|
| 38 | _nb_execute_unit (nb_execute_unit ), |
---|
| 39 | _nb_context (nb_context ), |
---|
| 40 | _nb_front_end (nb_front_end ), |
---|
| 41 | _nb_ooo_engine (nb_ooo_engine ), |
---|
| 42 | _nb_packet (nb_packet ), |
---|
| 43 | _size_general_data (size_general_data ), |
---|
| 44 | _size_special_data (size_special_data ), |
---|
| 45 | _nb_general_register (nb_general_register), |
---|
| 46 | _nb_special_register (nb_special_register), |
---|
| 47 | _size_store_queue (size_store_queue ), |
---|
| 48 | _size_load_queue (size_load_queue ), |
---|
| 49 | _priority (priority ), |
---|
| 50 | |
---|
| 51 | _size_context_id (log2(nb_context )), |
---|
| 52 | _size_front_end_id (log2(nb_front_end )), |
---|
| 53 | _size_ooo_engine_id (log2(nb_ooo_engine )), |
---|
| 54 | _size_packet_id (log2(nb_packet )), |
---|
| 55 | _size_general_register (log2(nb_general_register)), |
---|
| 56 | _size_special_register (log2(nb_special_register)), |
---|
| 57 | |
---|
| 58 | _have_port_context_id (_size_context_id > 0), |
---|
| 59 | _have_port_front_end_id (_size_front_end_id > 0), |
---|
| 60 | _have_port_ooo_engine_id (_size_ooo_engine_id > 0), |
---|
| 61 | _have_port_packet_id (_size_packet_id > 0), |
---|
| 62 | |
---|
| 63 | _nb_thread (get_nb_thread (nb_context, nb_front_end, nb_ooo_engine)) |
---|
| 64 | { |
---|
| 65 | log_printf(FUNC,Read_unit_to_Execution_unit,FUNCTION,"Begin"); |
---|
| 66 | |
---|
| 67 | _table_routing = table_routing ; |
---|
| 68 | _table_execute_type = table_execute_type ; |
---|
| 69 | _table_execute_thread = table_execute_thread; |
---|
| 70 | |
---|
| 71 | _nb_load_store_unit = 0; |
---|
| 72 | |
---|
| 73 | for (uint32_t i=0; i<nb_execute_unit; i++) |
---|
| 74 | if (table_execute_type[i][TYPE_MEMORY] == true) |
---|
| 75 | _nb_load_store_unit ++; |
---|
| 76 | |
---|
| 77 | // a execution_unit can't be a load_store unit and a functionnal unit |
---|
| 78 | _nb_functionnal_unit = nb_execute_unit-_nb_load_store_unit; |
---|
| 79 | |
---|
| 80 | test(); |
---|
| 81 | |
---|
| 82 | log_printf(FUNC,Read_unit_to_Execution_unit,FUNCTION,"End"); |
---|
| 83 | }; |
---|
| 84 | |
---|
| 85 | #undef FUNCTION |
---|
| 86 | #define FUNCTION "Read_unit_to_Execution_unit::Parameters (copy)" |
---|
| 87 | Parameters::Parameters (Parameters & param): |
---|
| 88 | _nb_read_unit (param._nb_read_unit ), |
---|
| 89 | _nb_execute_unit (param._nb_execute_unit ), |
---|
| 90 | _nb_context (param._nb_context ), |
---|
| 91 | _nb_front_end (param._nb_front_end ), |
---|
| 92 | _nb_ooo_engine (param._nb_ooo_engine ), |
---|
| 93 | _nb_packet (param._nb_packet ), |
---|
| 94 | _size_general_data (param._size_general_data ), |
---|
| 95 | _size_special_data (param._size_special_data ), |
---|
| 96 | _nb_general_register (param._nb_general_register ), |
---|
| 97 | _nb_special_register (param._nb_special_register ), |
---|
| 98 | _size_store_queue (param._size_store_queue ), |
---|
| 99 | _size_load_queue (param._size_load_queue ), |
---|
| 100 | _priority (param._priority ), |
---|
| 101 | |
---|
| 102 | _size_context_id (param._size_context_id ), |
---|
| 103 | _size_front_end_id (param._size_front_end_id ), |
---|
| 104 | _size_ooo_engine_id (param._size_ooo_engine_id ), |
---|
| 105 | _size_packet_id (param._size_packet_id ), |
---|
| 106 | _size_general_register (param._size_general_register ), |
---|
| 107 | _size_special_register (param._size_special_register ), |
---|
| 108 | |
---|
| 109 | _have_port_context_id (param._have_port_context_id ), |
---|
| 110 | _have_port_front_end_id (param._have_port_front_end_id ), |
---|
| 111 | _have_port_ooo_engine_id (param._have_port_ooo_engine_id), |
---|
| 112 | _have_port_packet_id (param._have_port_packet_id ), |
---|
| 113 | |
---|
| 114 | _nb_thread (param._nb_thread ) |
---|
| 115 | { |
---|
| 116 | log_printf(FUNC,Read_unit_to_Execution_unit,FUNCTION,"Begin"); |
---|
| 117 | |
---|
| 118 | _table_routing = param._table_routing ; |
---|
| 119 | _table_execute_type = param._table_execute_type ; |
---|
| 120 | _table_execute_thread = param._table_execute_thread; |
---|
| 121 | _nb_load_store_unit = param._nb_load_store_unit ; |
---|
| 122 | _nb_functionnal_unit = param._nb_functionnal_unit ; |
---|
| 123 | |
---|
| 124 | test(); |
---|
| 125 | log_printf(FUNC,Read_unit_to_Execution_unit,FUNCTION,"End"); |
---|
| 126 | }; |
---|
| 127 | |
---|
| 128 | #undef FUNCTION |
---|
| 129 | #define FUNCTION "Read_unit_to_Execution_unit::~Parameters" |
---|
| 130 | Parameters::~Parameters () |
---|
| 131 | { |
---|
| 132 | log_printf(FUNC,Read_unit_to_Execution_unit,FUNCTION,"Begin"); |
---|
| 133 | log_printf(FUNC,Read_unit_to_Execution_unit,FUNCTION,"End"); |
---|
| 134 | }; |
---|
| 135 | |
---|
| 136 | }; // end namespace read_unit_to_execution_unit |
---|
| 137 | }; // end namespace network |
---|
| 138 | }; // end namespace execute_loop |
---|
| 139 | }; // end namespace multi_execute_loop |
---|
| 140 | }; // end namespace core |
---|
| 141 | |
---|
| 142 | }; // end namespace behavioural |
---|
| 143 | }; // end namespace morpheo |
---|