[77] | 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/Network/Execution_unit_to_Write_unit/include/Parameters.h" |
---|
[88] | 9 | #include "Common/include/Max.h" |
---|
[77] | 10 | namespace morpheo { |
---|
| 11 | namespace behavioural { |
---|
| 12 | namespace core { |
---|
| 13 | namespace multi_execute_loop { |
---|
| 14 | namespace execute_loop { |
---|
| 15 | namespace network { |
---|
| 16 | namespace execution_unit_to_write_unit { |
---|
| 17 | |
---|
| 18 | |
---|
| 19 | #undef FUNCTION |
---|
| 20 | #define FUNCTION "Execution_unit_to_Write_unit::Parameters" |
---|
| 21 | Parameters::Parameters (uint32_t nb_execute_unit , |
---|
[88] | 22 | uint32_t * nb_execute_unit_port ,//[nb_execute_unit] |
---|
[77] | 23 | uint32_t nb_write_unit , |
---|
| 24 | uint32_t nb_context , |
---|
| 25 | uint32_t nb_front_end , |
---|
| 26 | uint32_t nb_ooo_engine , |
---|
| 27 | uint32_t nb_packet , |
---|
| 28 | uint32_t size_general_data , |
---|
| 29 | uint32_t size_special_data , |
---|
| 30 | uint32_t nb_general_register , |
---|
| 31 | uint32_t nb_special_register , |
---|
| 32 | Tpriority_t priority , |
---|
[88] | 33 | bool *** table_routing ,//[nb_execute_unit][nb_execute_unit_port][nb_write_unit] |
---|
| 34 | bool ** table_thread ,//[nb_write_unit][nb_thread] |
---|
| 35 | bool is_toplevel ) |
---|
[77] | 36 | { |
---|
| 37 | log_printf(FUNC,Execution_unit_to_Write_unit,FUNCTION,"Begin"); |
---|
| 38 | |
---|
[88] | 39 | _nb_execute_unit = nb_execute_unit ; |
---|
| 40 | _nb_execute_unit_port = nb_execute_unit_port; |
---|
| 41 | _nb_write_unit = nb_write_unit ; |
---|
| 42 | _nb_context = nb_context ; |
---|
| 43 | _nb_front_end = nb_front_end ; |
---|
| 44 | _nb_ooo_engine = nb_ooo_engine ; |
---|
| 45 | _nb_packet = nb_packet ; |
---|
| 46 | _nb_general_register = nb_general_register ; |
---|
| 47 | _nb_special_register = nb_special_register ; |
---|
| 48 | _priority = priority ; |
---|
| 49 | _table_routing = table_routing ; |
---|
| 50 | _table_thread = table_thread ; |
---|
[77] | 51 | |
---|
[88] | 52 | _max_nb_execute_unit_port= max<uint32_t>(_nb_execute_unit_port, _nb_execute_unit); |
---|
| 53 | |
---|
| 54 | _nb_thread = get_nb_thread (nb_context, nb_front_end, nb_ooo_engine); |
---|
| 55 | |
---|
[77] | 56 | test(); |
---|
[88] | 57 | |
---|
| 58 | if (is_toplevel) |
---|
| 59 | { |
---|
[97] | 60 | _size_instruction_address= size_general_data-2; |
---|
[88] | 61 | _size_context_id = log2(nb_context ); |
---|
| 62 | _size_front_end_id = log2(nb_front_end ); |
---|
| 63 | _size_ooo_engine_id = log2(nb_ooo_engine ); |
---|
| 64 | _size_rob_ptr = log2(nb_packet ); |
---|
| 65 | _size_general_register = log2(nb_general_register); |
---|
| 66 | _size_special_register = log2(nb_special_register); |
---|
| 67 | _size_general_data = size_general_data ; |
---|
| 68 | _size_special_data = size_special_data ; |
---|
| 69 | |
---|
| 70 | _have_port_context_id = _size_context_id > 0; |
---|
| 71 | _have_port_front_end_id = _size_front_end_id > 0; |
---|
| 72 | _have_port_ooo_engine_id = _size_ooo_engine_id > 0; |
---|
| 73 | _have_port_rob_ptr = _size_rob_ptr > 0; |
---|
| 74 | |
---|
| 75 | copy(); |
---|
| 76 | } |
---|
| 77 | |
---|
[77] | 78 | log_printf(FUNC,Execution_unit_to_Write_unit,FUNCTION,"End"); |
---|
| 79 | }; |
---|
| 80 | |
---|
[88] | 81 | // #undef FUNCTION |
---|
| 82 | // #define FUNCTION "Execution_unit_to_Write_unit::Parameters (copy)" |
---|
| 83 | // Parameters::Parameters (Parameters & param) |
---|
| 84 | // { |
---|
| 85 | // log_printf(FUNC,Execution_unit_to_Write_unit,FUNCTION,"Begin"); |
---|
[77] | 86 | |
---|
[88] | 87 | // test(); |
---|
| 88 | // log_printf(FUNC,Execution_unit_to_Write_unit,FUNCTION,"End"); |
---|
| 89 | // }; |
---|
[77] | 90 | |
---|
[88] | 91 | #undef FUNCTION |
---|
| 92 | #define FUNCTION "Execution_unit_to_Write_unit::~Parameters" |
---|
| 93 | Parameters::~Parameters (void) |
---|
[77] | 94 | { |
---|
| 95 | log_printf(FUNC,Execution_unit_to_Write_unit,FUNCTION,"Begin"); |
---|
| 96 | log_printf(FUNC,Execution_unit_to_Write_unit,FUNCTION,"End"); |
---|
| 97 | }; |
---|
| 98 | |
---|
| 99 | #undef FUNCTION |
---|
[88] | 100 | #define FUNCTION "Execution_unit_to_Write_unit::copy" |
---|
| 101 | void Parameters::copy (void) |
---|
[77] | 102 | { |
---|
| 103 | log_printf(FUNC,Execution_unit_to_Write_unit,FUNCTION,"Begin"); |
---|
| 104 | log_printf(FUNC,Execution_unit_to_Write_unit,FUNCTION,"End"); |
---|
| 105 | }; |
---|
| 106 | |
---|
| 107 | }; // end namespace execution_unit_to_write_unit |
---|
| 108 | }; // end namespace network |
---|
| 109 | }; // end namespace execute_loop |
---|
| 110 | }; // end namespace multi_execute_loop |
---|
| 111 | }; // end namespace core |
---|
| 112 | |
---|
| 113 | }; // end namespace behavioural |
---|
| 114 | }; // end namespace morpheo |
---|