[83] | 1 | /* |
---|
| 2 | * $Id: Parameters.cpp 106 2009-02-09 22:55:26Z rosiere $ |
---|
| 3 | * |
---|
| 4 | * [ Description ] |
---|
| 5 | * |
---|
| 6 | */ |
---|
| 7 | |
---|
| 8 | #include "Behavioural/Core/Multi_Front_end/Front_end/Context_State/include/Parameters.h" |
---|
| 9 | #include "Common/include/Max.h" |
---|
| 10 | |
---|
| 11 | namespace morpheo { |
---|
| 12 | namespace behavioural { |
---|
| 13 | namespace core { |
---|
| 14 | namespace multi_front_end { |
---|
| 15 | namespace front_end { |
---|
| 16 | namespace context_state { |
---|
| 17 | |
---|
| 18 | |
---|
| 19 | #undef FUNCTION |
---|
| 20 | #define FUNCTION "Context_State::Parameters" |
---|
| 21 | Parameters::Parameters (uint32_t nb_context, |
---|
| 22 | uint32_t nb_decod_unit, |
---|
| 23 | uint32_t nb_inst_branch_complete, |
---|
[106] | 24 | uint32_t * nb_inst_branch_speculated, |
---|
[98] | 25 | uint32_t size_general_data, |
---|
[88] | 26 | uint32_t * size_nb_inst_decod, |
---|
| 27 | uint32_t size_nb_inst_commit, |
---|
[83] | 28 | uint32_t * link_context_to_decod_unit, |
---|
[88] | 29 | bool is_toplevel) |
---|
[83] | 30 | { |
---|
| 31 | log_begin(Context_State,FUNCTION); |
---|
| 32 | |
---|
| 33 | _nb_context = nb_context ; |
---|
| 34 | _nb_decod_unit = nb_decod_unit ; |
---|
| 35 | _nb_inst_branch_complete = nb_inst_branch_complete ; |
---|
[106] | 36 | _nb_inst_branch_speculated = nb_inst_branch_speculated ; |
---|
[98] | 37 | // _size_general_data = size_general_data ; |
---|
[88] | 38 | // _size_nb_inst_decod = size_nb_inst_decod ; |
---|
| 39 | // _size_nb_inst_commit = size_nb_inst_commit ; |
---|
[83] | 40 | _link_context_to_decod_unit = link_context_to_decod_unit ; |
---|
| 41 | |
---|
[88] | 42 | test(); |
---|
| 43 | |
---|
| 44 | if (is_toplevel) |
---|
| 45 | { |
---|
| 46 | _size_context_id = log2(_nb_context); |
---|
[106] | 47 | _size_depth = log2(max<uint32_t>(nb_inst_branch_speculated,_nb_context)); |
---|
[98] | 48 | _size_general_data = size_general_data; |
---|
| 49 | _size_instruction_address = size_general_data-2; |
---|
[88] | 50 | _size_nb_inst_decod = max<uint32_t>(size_nb_inst_decod,_nb_decod_unit); |
---|
| 51 | _size_nb_inst_commit = size_nb_inst_commit; |
---|
| 52 | |
---|
| 53 | _have_port_context_id = (_size_context_id>0); |
---|
| 54 | _have_port_depth = (_size_depth > 0); |
---|
| 55 | |
---|
| 56 | copy (); |
---|
| 57 | } |
---|
[83] | 58 | |
---|
| 59 | log_end(Context_State,FUNCTION); |
---|
| 60 | }; |
---|
| 61 | |
---|
| 62 | // #undef FUNCTION |
---|
| 63 | // #define FUNCTION "Context_State::Parameters (copy)" |
---|
| 64 | // Parameters::Parameters (Parameters & param) |
---|
| 65 | // { |
---|
| 66 | // log_begin(Context_State,FUNCTION); |
---|
| 67 | // test(); |
---|
| 68 | // log_end(Context_State,FUNCTION); |
---|
| 69 | // }; |
---|
| 70 | |
---|
| 71 | #undef FUNCTION |
---|
| 72 | #define FUNCTION "Context_State::~Parameters" |
---|
| 73 | Parameters::~Parameters () |
---|
| 74 | { |
---|
| 75 | log_begin(Context_State,FUNCTION); |
---|
| 76 | log_end(Context_State,FUNCTION); |
---|
| 77 | }; |
---|
| 78 | |
---|
[88] | 79 | #undef FUNCTION |
---|
| 80 | #define FUNCTION "Context_State::copy" |
---|
| 81 | void Parameters::copy (void) |
---|
| 82 | { |
---|
| 83 | log_begin(Context_State,FUNCTION); |
---|
| 84 | log_end(Context_State,FUNCTION); |
---|
| 85 | }; |
---|
| 86 | |
---|
[83] | 87 | }; // end namespace context_state |
---|
| 88 | }; // end namespace front_end |
---|
| 89 | }; // end namespace multi_front_end |
---|
| 90 | }; // end namespace core |
---|
| 91 | |
---|
| 92 | }; // end namespace behavioural |
---|
| 93 | }; // end namespace morpheo |
---|