[83] | 1 | /* |
---|
| 2 | * $Id: Context_State.cpp 83 2008-05-09 18:00:21Z rosiere $ |
---|
| 3 | * |
---|
| 4 | * [ Description ] |
---|
| 5 | * |
---|
| 6 | */ |
---|
| 7 | |
---|
| 8 | #include "Behavioural/Core/Multi_Front_end/Front_end/Context_State/include/Context_State.h" |
---|
| 9 | |
---|
| 10 | namespace morpheo { |
---|
| 11 | namespace behavioural { |
---|
| 12 | namespace core { |
---|
| 13 | namespace multi_front_end { |
---|
| 14 | namespace front_end { |
---|
| 15 | namespace context_state { |
---|
| 16 | |
---|
| 17 | |
---|
| 18 | #undef FUNCTION |
---|
| 19 | #define FUNCTION "Context_State::Context_State" |
---|
| 20 | Context_State::Context_State |
---|
| 21 | ( |
---|
| 22 | #ifdef SYSTEMC |
---|
| 23 | sc_module_name name, |
---|
| 24 | #else |
---|
| 25 | string name, |
---|
| 26 | #endif |
---|
| 27 | #ifdef STATISTICS |
---|
| 28 | morpheo::behavioural::Parameters_Statistics * param_statistics, |
---|
| 29 | #endif |
---|
| 30 | morpheo::behavioural::core::multi_front_end::front_end::context_state::Parameters * param, |
---|
| 31 | morpheo::behavioural::Tusage_t usage |
---|
| 32 | ): |
---|
| 33 | _name (name) |
---|
| 34 | ,_param (param) |
---|
| 35 | ,_usage (usage) |
---|
| 36 | { |
---|
| 37 | log_begin(Context_State,FUNCTION); |
---|
| 38 | |
---|
| 39 | usage_environment(_usage); |
---|
| 40 | |
---|
| 41 | log_printf(INFO,Context_State,FUNCTION,_("Allocation")); |
---|
| 42 | |
---|
| 43 | allocation ( |
---|
| 44 | #ifdef STATISTICS |
---|
| 45 | param_statistics |
---|
| 46 | #endif |
---|
| 47 | ); |
---|
| 48 | |
---|
| 49 | #ifdef STATISTICS |
---|
| 50 | if (usage_is_set(_usage,USE_STATISTICS)) |
---|
| 51 | { |
---|
| 52 | log_printf(INFO,Context_State,FUNCTION,_("Allocation of statistics")); |
---|
| 53 | |
---|
| 54 | statistics_allocation(param_statistics); |
---|
| 55 | } |
---|
| 56 | #endif |
---|
| 57 | |
---|
| 58 | #ifdef VHDL |
---|
| 59 | if (usage_is_set(_usage,USE_VHDL)) |
---|
| 60 | { |
---|
| 61 | // generate the vhdl |
---|
| 62 | log_printf(INFO,Context_State,FUNCTION,_("Generate the vhdl")); |
---|
| 63 | |
---|
| 64 | vhdl(); |
---|
| 65 | } |
---|
| 66 | #endif |
---|
| 67 | |
---|
| 68 | #ifdef SYSTEMC |
---|
| 69 | if (usage_is_set(_usage,USE_SYSTEMC)) |
---|
| 70 | { |
---|
| 71 | // Constant |
---|
| 72 | for (uint32_t i=0; i<_param->_nb_decod_unit; i++) |
---|
| 73 | { |
---|
| 74 | internal_DECOD_EVENT_ACK [i] = 1; |
---|
| 75 | PORT_WRITE(out_DECOD_EVENT_ACK [i], internal_DECOD_EVENT_ACK [i]); |
---|
| 76 | } |
---|
| 77 | |
---|
| 78 | for (uint32_t i=0; i<_param->_nb_ooo_engine; i++) |
---|
| 79 | { |
---|
| 80 | internal_COMMIT_EVENT_ACK [i] = 1; |
---|
| 81 | PORT_WRITE(out_COMMIT_EVENT_ACK [i], internal_COMMIT_EVENT_ACK [i]); |
---|
| 82 | } |
---|
| 83 | |
---|
| 84 | for (uint32_t i=0; i<_param->_nb_inst_branch_complete; i++) |
---|
| 85 | { |
---|
| 86 | internal_BRANCH_COMPLETE_ACK [i] = 1; |
---|
| 87 | PORT_WRITE(out_BRANCH_COMPLETE_ACK [i], internal_BRANCH_COMPLETE_ACK [i]); |
---|
| 88 | } |
---|
| 89 | |
---|
| 90 | log_printf(INFO,Context_State,FUNCTION,_("Method - transition")); |
---|
| 91 | |
---|
| 92 | SC_METHOD (transition); |
---|
| 93 | dont_initialize (); |
---|
| 94 | sensitive << (*(in_CLOCK)).pos(); |
---|
| 95 | |
---|
| 96 | # ifdef SYSTEMCASS_SPECIFIC |
---|
| 97 | // List dependency information |
---|
| 98 | # endif |
---|
| 99 | |
---|
| 100 | log_printf(INFO,Context_State,FUNCTION,_("Method - genMoore")); |
---|
| 101 | |
---|
| 102 | SC_METHOD (genMoore); |
---|
| 103 | dont_initialize (); |
---|
| 104 | sensitive << (*(in_CLOCK)).neg(); // use internal register |
---|
| 105 | |
---|
| 106 | # ifdef SYSTEMCASS_SPECIFIC |
---|
| 107 | // List dependency information |
---|
| 108 | # endif |
---|
| 109 | |
---|
| 110 | #endif |
---|
| 111 | } |
---|
| 112 | log_end(Context_State,FUNCTION); |
---|
| 113 | }; |
---|
| 114 | |
---|
| 115 | #undef FUNCTION |
---|
| 116 | #define FUNCTION "Context_State::~Context_State" |
---|
| 117 | Context_State::~Context_State (void) |
---|
| 118 | { |
---|
| 119 | log_begin(Context_State,FUNCTION); |
---|
| 120 | |
---|
| 121 | #ifdef STATISTICS |
---|
| 122 | if (usage_is_set(_usage,USE_STATISTICS)) |
---|
| 123 | { |
---|
| 124 | statistics_deallocation(); |
---|
| 125 | } |
---|
| 126 | #endif |
---|
| 127 | |
---|
| 128 | log_printf(INFO,Context_State,FUNCTION,_("Deallocation")); |
---|
| 129 | deallocation (); |
---|
| 130 | |
---|
| 131 | log_end(Context_State,FUNCTION); |
---|
| 132 | }; |
---|
| 133 | |
---|
| 134 | }; // end namespace context_state |
---|
| 135 | }; // end namespace front_end |
---|
| 136 | }; // end namespace multi_front_end |
---|
| 137 | }; // end namespace core |
---|
| 138 | |
---|
| 139 | }; // end namespace behavioural |
---|
| 140 | }; // end namespace morpheo |
---|