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