[73] | 1 | /* |
---|
| 2 | * $Id: Parameters.cpp 113 2009-04-14 18:39:12Z rosiere $ |
---|
| 3 | * |
---|
| 4 | * [ Description ] |
---|
| 5 | * |
---|
| 6 | */ |
---|
| 7 | |
---|
| 8 | #include "Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Write_unit/Write_unit/Execute_queue/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_write_unit { |
---|
| 16 | namespace write_unit { |
---|
| 17 | namespace execute_queue { |
---|
| 18 | |
---|
| 19 | |
---|
| 20 | #undef FUNCTION |
---|
| 21 | #define FUNCTION "Execute_queue::Parameters" |
---|
| 22 | Parameters::Parameters (uint32_t size_queue , |
---|
| 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 , |
---|
[88] | 28 | uint32_t size_special_data , |
---|
[113] | 29 | bool is_toplevel ): |
---|
| 30 | behavioural::Parameters("Execute_queue") |
---|
[88] | 31 | { |
---|
| 32 | log_printf(FUNC,Execute_queue,FUNCTION,"Begin"); |
---|
[73] | 33 | |
---|
[88] | 34 | _size_queue = size_queue ; |
---|
| 35 | _nb_context = nb_context ; |
---|
| 36 | _nb_front_end = nb_front_end ; |
---|
| 37 | _nb_ooo_engine = nb_ooo_engine ; |
---|
| 38 | _nb_packet = nb_packet ; |
---|
[73] | 39 | |
---|
| 40 | test(); |
---|
[88] | 41 | |
---|
| 42 | if (is_toplevel) |
---|
| 43 | { |
---|
[97] | 44 | _size_instruction_address= size_general_data-2; |
---|
[88] | 45 | _size_context_id = log2(_nb_context ); |
---|
| 46 | _size_front_end_id = log2(_nb_front_end ); |
---|
| 47 | _size_ooo_engine_id = log2(_nb_ooo_engine); |
---|
| 48 | _size_rob_ptr = log2(_nb_packet ); |
---|
| 49 | _size_general_data = size_general_data; |
---|
| 50 | _size_special_data = size_special_data; |
---|
[96] | 51 | _size_instruction_address= size_general_data; |
---|
| 52 | |
---|
[88] | 53 | _have_port_context_id = _size_context_id > 0; |
---|
| 54 | _have_port_front_end_id = _size_front_end_id > 0; |
---|
| 55 | _have_port_ooo_engine_id = _size_ooo_engine_id > 0; |
---|
| 56 | _have_port_rob_ptr = _size_rob_ptr > 0; |
---|
| 57 | |
---|
| 58 | copy(); |
---|
| 59 | } |
---|
| 60 | |
---|
[73] | 61 | log_printf(FUNC,Execute_queue,FUNCTION,"End"); |
---|
| 62 | }; |
---|
| 63 | |
---|
[88] | 64 | // #undef FUNCTION |
---|
| 65 | // #define FUNCTION "Execute_queue::Parameters (copy)" |
---|
| 66 | // Parameters::Parameters (Parameters & param): |
---|
| 67 | // _size_queue (param._size_queue ), |
---|
| 68 | // _nb_context (param._nb_context ), |
---|
| 69 | // _nb_front_end (param._nb_front_end ), |
---|
| 70 | // _nb_ooo_engine (param._nb_ooo_engine ), |
---|
| 71 | // _nb_packet (param._nb_packet ), |
---|
| 72 | // _size_general_data (param._size_general_data ), |
---|
| 73 | // _size_special_data (param._size_special_data ), |
---|
[73] | 74 | |
---|
[88] | 75 | // _size_context_id (param._size_context_id ), |
---|
| 76 | // _size_front_end_id (param._size_front_end_id ), |
---|
| 77 | // _size_ooo_engine_id (param._size_ooo_engine_id ), |
---|
| 78 | // _size_packet_id (param._size_packet_id ), |
---|
[73] | 79 | |
---|
[88] | 80 | // _have_port_context_id (param._have_port_context_id ), |
---|
| 81 | // _have_port_front_end_id (param._have_port_front_end_id ), |
---|
| 82 | // _have_port_ooo_engine_id (param._have_port_ooo_engine_id), |
---|
| 83 | // _have_port_packet_id (param._have_port_packet_id ) |
---|
| 84 | // { |
---|
| 85 | // log_printf(FUNC,Execute_queue,FUNCTION,"Begin"); |
---|
| 86 | // test(); |
---|
| 87 | // log_printf(FUNC,Execute_queue,FUNCTION,"End"); |
---|
| 88 | // }; |
---|
| 89 | |
---|
| 90 | #undef FUNCTION |
---|
| 91 | #define FUNCTION "Execute_queue::~Parameters" |
---|
| 92 | Parameters::~Parameters (void) |
---|
[73] | 93 | { |
---|
| 94 | log_printf(FUNC,Execute_queue,FUNCTION,"Begin"); |
---|
| 95 | log_printf(FUNC,Execute_queue,FUNCTION,"End"); |
---|
| 96 | }; |
---|
| 97 | |
---|
| 98 | #undef FUNCTION |
---|
[88] | 99 | #define FUNCTION "Execute_queue::copy" |
---|
| 100 | void Parameters::copy (void) |
---|
[73] | 101 | { |
---|
| 102 | log_printf(FUNC,Execute_queue,FUNCTION,"Begin"); |
---|
[113] | 103 | |
---|
| 104 | _size_internal_queue = |
---|
| 105 | (_size_context_id + |
---|
| 106 | _size_front_end_id + |
---|
| 107 | _size_ooo_engine_id + |
---|
| 108 | _size_rob_ptr + |
---|
| 109 | // _size_operation + |
---|
| 110 | // _size_type + |
---|
| 111 | _size_special_data + |
---|
| 112 | _size_exception + |
---|
| 113 | 1 + |
---|
| 114 | _size_general_data + |
---|
| 115 | _size_general_data |
---|
| 116 | ); |
---|
| 117 | |
---|
[73] | 118 | log_printf(FUNC,Execute_queue,FUNCTION,"End"); |
---|
| 119 | }; |
---|
| 120 | |
---|
| 121 | }; // end namespace execute_queue |
---|
| 122 | }; // end namespace write_unit |
---|
| 123 | }; // end namespace multi_write_unit |
---|
| 124 | }; // end namespace execute_loop |
---|
| 125 | }; // end namespace multi_execute_loop |
---|
| 126 | }; // end namespace core |
---|
| 127 | |
---|
| 128 | }; // end namespace behavioural |
---|
| 129 | }; // end namespace morpheo |
---|