[88] | 1 | /* |
---|
| 2 | * $Id: Parameters.cpp 88 2008-12-10 18:31:39Z rosiere $ |
---|
| 3 | * |
---|
| 4 | * [ Description ] |
---|
| 5 | * |
---|
| 6 | */ |
---|
| 7 | |
---|
| 8 | #include "Behavioural/Core/Multi_Front_end/Front_end/Front_end_Glue/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 front_end_glue { |
---|
| 17 | |
---|
| 18 | |
---|
| 19 | #undef FUNCTION |
---|
| 20 | #define FUNCTION "Front_end_Glue::Parameters" |
---|
| 21 | Parameters::Parameters (uint32_t nb_context , |
---|
| 22 | uint32_t nb_decod_unit , |
---|
| 23 | uint32_t * nb_inst_decod , |
---|
| 24 | uint32_t nb_inst_branch_complete , |
---|
| 25 | uint32_t * link_context_to_decod_unit , |
---|
| 26 | std::vector<uint32_t> * translate_context_id_from_decod_unit , |
---|
| 27 | uint32_t size_address , |
---|
| 28 | uint32_t * size_depth , |
---|
| 29 | uint32_t * nb_branch_speculated , |
---|
| 30 | uint32_t is_toplevel): |
---|
| 31 | morpheo::behavioural::Parameters() |
---|
| 32 | { |
---|
| 33 | log_begin(Front_end_Glue,FUNCTION); |
---|
| 34 | |
---|
| 35 | _nb_context = nb_context ; |
---|
| 36 | _nb_decod_unit = nb_decod_unit ; |
---|
| 37 | _nb_inst_decod = nb_inst_decod ; |
---|
| 38 | _nb_inst_branch_complete = nb_inst_branch_complete ; |
---|
| 39 | _link_context_to_decod_unit = link_context_to_decod_unit ; |
---|
| 40 | _translate_context_id_from_decod_unit = translate_context_id_from_decod_unit; |
---|
| 41 | _nb_branch_speculated = nb_branch_speculated ; |
---|
| 42 | |
---|
| 43 | _decod_unit_nb_context = new uint32_t [_nb_decod_unit]; |
---|
| 44 | |
---|
| 45 | for (uint32_t i=0; i<_nb_decod_unit; i++) |
---|
| 46 | { |
---|
| 47 | _decod_unit_nb_context [i] = translate_context_id_from_decod_unit[i].size(); |
---|
| 48 | } |
---|
| 49 | |
---|
| 50 | test(); |
---|
| 51 | |
---|
| 52 | if (is_toplevel) |
---|
| 53 | { |
---|
| 54 | _size_context_id = log2(_nb_context); |
---|
| 55 | _size_instruction_address = size_address; |
---|
| 56 | _size_depth = max<uint32_t>(size_depth,_nb_context); |
---|
| 57 | |
---|
| 58 | _have_port_context_id = _size_context_id > 0; |
---|
| 59 | _have_port_depth = _size_depth > 0; |
---|
| 60 | |
---|
| 61 | copy (); |
---|
| 62 | } |
---|
| 63 | |
---|
| 64 | log_end(Front_end_Glue,FUNCTION); |
---|
| 65 | }; |
---|
| 66 | |
---|
| 67 | // #undef FUNCTION |
---|
| 68 | // #define FUNCTION "Front_end_Glue::Parameters (copy)" |
---|
| 69 | // Parameters::Parameters (Parameters & param) |
---|
| 70 | // { |
---|
| 71 | // log_begin(Front_end_Glue,FUNCTION); |
---|
| 72 | // test(); |
---|
| 73 | // log_end(Front_end_Glue,FUNCTION); |
---|
| 74 | // }; |
---|
| 75 | |
---|
| 76 | #undef FUNCTION |
---|
| 77 | #define FUNCTION "Front_end_Glue::~Parameters" |
---|
| 78 | Parameters::~Parameters () |
---|
| 79 | { |
---|
| 80 | log_begin(Front_end_Glue,FUNCTION); |
---|
| 81 | |
---|
| 82 | delete [] _decod_unit_nb_context; |
---|
| 83 | |
---|
| 84 | log_end(Front_end_Glue,FUNCTION); |
---|
| 85 | }; |
---|
| 86 | |
---|
| 87 | #undef FUNCTION |
---|
| 88 | #define FUNCTION "Front_end_Glue::copy" |
---|
| 89 | void Parameters::copy (void) |
---|
| 90 | { |
---|
| 91 | log_begin(Front_end_Glue,FUNCTION); |
---|
| 92 | |
---|
| 93 | log_end(Front_end_Glue,FUNCTION); |
---|
| 94 | }; |
---|
| 95 | |
---|
| 96 | }; // end namespace front_end_glue |
---|
| 97 | }; // end namespace front_end |
---|
| 98 | }; // end namespace multi_front_end |
---|
| 99 | }; // end namespace core |
---|
| 100 | |
---|
| 101 | }; // end namespace behavioural |
---|
| 102 | }; // end namespace morpheo |
---|