[77] | 1 | /* |
---|
| 2 | * $Id: Parameters.cpp 81 2008-04-15 18:40:01Z rosiere $ |
---|
| 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), |
---|
[78] | 62 | _have_port_load_queue_ptr(_size_load_queue > 1), |
---|
[77] | 63 | |
---|
| 64 | _nb_thread (get_nb_thread (nb_context, nb_front_end, nb_ooo_engine)) |
---|
| 65 | { |
---|
| 66 | log_printf(FUNC,Read_unit_to_Execution_unit,FUNCTION,"Begin"); |
---|
| 67 | |
---|
| 68 | _table_routing = table_routing ; |
---|
| 69 | _table_execute_type = table_execute_type ; |
---|
| 70 | _table_execute_thread = table_execute_thread; |
---|
| 71 | |
---|
[78] | 72 | _nb_load_store_unit = 0; |
---|
| 73 | |
---|
[77] | 74 | for (uint32_t i=0; i<nb_execute_unit; i++) |
---|
[78] | 75 | { |
---|
| 76 | if (table_execute_type[i][TYPE_MEMORY] == true) |
---|
| 77 | _nb_load_store_unit ++; |
---|
| 78 | } |
---|
[77] | 79 | // a execution_unit can't be a load_store unit and a functionnal unit |
---|
| 80 | _nb_functionnal_unit = nb_execute_unit-_nb_load_store_unit; |
---|
| 81 | |
---|
| 82 | test(); |
---|
| 83 | |
---|
| 84 | log_printf(FUNC,Read_unit_to_Execution_unit,FUNCTION,"End"); |
---|
| 85 | }; |
---|
| 86 | |
---|
| 87 | #undef FUNCTION |
---|
| 88 | #define FUNCTION "Read_unit_to_Execution_unit::Parameters (copy)" |
---|
| 89 | Parameters::Parameters (Parameters & param): |
---|
| 90 | _nb_read_unit (param._nb_read_unit ), |
---|
| 91 | _nb_execute_unit (param._nb_execute_unit ), |
---|
| 92 | _nb_context (param._nb_context ), |
---|
| 93 | _nb_front_end (param._nb_front_end ), |
---|
| 94 | _nb_ooo_engine (param._nb_ooo_engine ), |
---|
| 95 | _nb_packet (param._nb_packet ), |
---|
| 96 | _size_general_data (param._size_general_data ), |
---|
| 97 | _size_special_data (param._size_special_data ), |
---|
| 98 | _nb_general_register (param._nb_general_register ), |
---|
| 99 | _nb_special_register (param._nb_special_register ), |
---|
| 100 | _size_store_queue (param._size_store_queue ), |
---|
| 101 | _size_load_queue (param._size_load_queue ), |
---|
| 102 | _priority (param._priority ), |
---|
| 103 | |
---|
| 104 | _size_context_id (param._size_context_id ), |
---|
| 105 | _size_front_end_id (param._size_front_end_id ), |
---|
| 106 | _size_ooo_engine_id (param._size_ooo_engine_id ), |
---|
| 107 | _size_packet_id (param._size_packet_id ), |
---|
| 108 | _size_general_register (param._size_general_register ), |
---|
| 109 | _size_special_register (param._size_special_register ), |
---|
| 110 | |
---|
| 111 | _have_port_context_id (param._have_port_context_id ), |
---|
| 112 | _have_port_front_end_id (param._have_port_front_end_id ), |
---|
| 113 | _have_port_ooo_engine_id (param._have_port_ooo_engine_id), |
---|
| 114 | _have_port_packet_id (param._have_port_packet_id ), |
---|
[78] | 115 | _have_port_load_queue_ptr(param._have_port_load_queue_ptr), |
---|
[77] | 116 | |
---|
| 117 | _nb_thread (param._nb_thread ) |
---|
| 118 | { |
---|
| 119 | log_printf(FUNC,Read_unit_to_Execution_unit,FUNCTION,"Begin"); |
---|
| 120 | |
---|
| 121 | _table_routing = param._table_routing ; |
---|
| 122 | _table_execute_type = param._table_execute_type ; |
---|
| 123 | _table_execute_thread = param._table_execute_thread; |
---|
| 124 | _nb_load_store_unit = param._nb_load_store_unit ; |
---|
| 125 | _nb_functionnal_unit = param._nb_functionnal_unit ; |
---|
| 126 | |
---|
| 127 | test(); |
---|
| 128 | log_printf(FUNC,Read_unit_to_Execution_unit,FUNCTION,"End"); |
---|
| 129 | }; |
---|
| 130 | |
---|
| 131 | #undef FUNCTION |
---|
| 132 | #define FUNCTION "Read_unit_to_Execution_unit::~Parameters" |
---|
| 133 | Parameters::~Parameters () |
---|
| 134 | { |
---|
| 135 | log_printf(FUNC,Read_unit_to_Execution_unit,FUNCTION,"Begin"); |
---|
| 136 | log_printf(FUNC,Read_unit_to_Execution_unit,FUNCTION,"End"); |
---|
| 137 | }; |
---|
| 138 | |
---|
| 139 | }; // end namespace read_unit_to_execution_unit |
---|
| 140 | }; // end namespace network |
---|
| 141 | }; // end namespace execute_loop |
---|
| 142 | }; // end namespace multi_execute_loop |
---|
| 143 | }; // end namespace core |
---|
| 144 | |
---|
| 145 | }; // end namespace behavioural |
---|
| 146 | }; // end namespace morpheo |
---|