[82] | 1 | /* |
---|
| 2 | * $Id: Decod_queue.cpp 101 2009-01-15 17:19:08Z rosiere $ |
---|
| 3 | * |
---|
| 4 | * [ Description ] |
---|
| 5 | * |
---|
| 6 | */ |
---|
| 7 | |
---|
| 8 | #include "Behavioural/Core/Multi_Front_end/Front_end/Decod_unit/Decod_queue/include/Decod_queue.h" |
---|
| 9 | |
---|
| 10 | namespace morpheo { |
---|
| 11 | namespace behavioural { |
---|
| 12 | namespace core { |
---|
| 13 | namespace multi_front_end { |
---|
| 14 | namespace front_end { |
---|
| 15 | namespace decod_unit { |
---|
| 16 | namespace decod_queue { |
---|
| 17 | |
---|
| 18 | |
---|
| 19 | #undef FUNCTION |
---|
| 20 | #define FUNCTION "Decod_queue::Decod_queue" |
---|
| 21 | Decod_queue::Decod_queue |
---|
| 22 | ( |
---|
| 23 | #ifdef SYSTEMC |
---|
| 24 | sc_module_name name, |
---|
| 25 | #else |
---|
| 26 | string name, |
---|
| 27 | #endif |
---|
| 28 | #ifdef STATISTICS |
---|
| 29 | morpheo::behavioural::Parameters_Statistics * param_statistics, |
---|
| 30 | #endif |
---|
| 31 | morpheo::behavioural::core::multi_front_end::front_end::decod_unit::decod_queue::Parameters * param, |
---|
| 32 | morpheo::behavioural::Tusage_t usage |
---|
| 33 | ): |
---|
| 34 | _name (name) |
---|
| 35 | ,_param (param) |
---|
| 36 | ,_usage (usage) |
---|
| 37 | { |
---|
| 38 | log_begin(Decod_queue,FUNCTION); |
---|
| 39 | |
---|
| 40 | usage_environment(_usage); |
---|
| 41 | |
---|
[88] | 42 | #if DEBUG_Decod_queue == true |
---|
| 43 | log_printf(INFO,Decod_queue,FUNCTION,_("<%s> Parameters"),_name.c_str()); |
---|
| 44 | |
---|
| 45 | std::cout << *param << std::endl; |
---|
| 46 | #endif |
---|
| 47 | |
---|
[82] | 48 | log_printf(INFO,Decod_queue,FUNCTION,_("Allocation")); |
---|
| 49 | |
---|
| 50 | allocation ( |
---|
| 51 | #ifdef STATISTICS |
---|
| 52 | param_statistics |
---|
| 53 | #endif |
---|
| 54 | ); |
---|
| 55 | |
---|
| 56 | #ifdef STATISTICS |
---|
| 57 | if (usage_is_set(_usage,USE_STATISTICS)) |
---|
| 58 | { |
---|
| 59 | log_printf(INFO,Decod_queue,FUNCTION,_("Allocation of statistics")); |
---|
| 60 | |
---|
| 61 | statistics_allocation(param_statistics); |
---|
| 62 | } |
---|
| 63 | #endif |
---|
| 64 | |
---|
| 65 | #ifdef VHDL |
---|
| 66 | if (usage_is_set(_usage,USE_VHDL)) |
---|
| 67 | { |
---|
| 68 | // generate the vhdl |
---|
| 69 | log_printf(INFO,Decod_queue,FUNCTION,_("Generate the vhdl")); |
---|
| 70 | |
---|
| 71 | vhdl(); |
---|
| 72 | } |
---|
| 73 | #endif |
---|
| 74 | |
---|
| 75 | #ifdef SYSTEMC |
---|
| 76 | if (usage_is_set(_usage,USE_SYSTEMC)) |
---|
| 77 | { |
---|
| 78 | log_printf(INFO,Decod_queue,FUNCTION,_("Method - transition")); |
---|
| 79 | |
---|
| 80 | SC_METHOD (transition); |
---|
| 81 | dont_initialize (); |
---|
| 82 | sensitive << (*(in_CLOCK)).pos(); |
---|
| 83 | |
---|
| 84 | # ifdef SYSTEMCASS_SPECIFIC |
---|
| 85 | // List dependency information |
---|
| 86 | # endif |
---|
| 87 | |
---|
| 88 | log_printf(INFO,Decod_queue,FUNCTION,_("Method - genMoore")); |
---|
| 89 | |
---|
| 90 | SC_METHOD (genMoore); |
---|
| 91 | dont_initialize (); |
---|
| 92 | sensitive << (*(in_CLOCK)).neg(); // use internal register |
---|
| 93 | |
---|
| 94 | # ifdef SYSTEMCASS_SPECIFIC |
---|
| 95 | // List dependency information |
---|
| 96 | # endif |
---|
| 97 | |
---|
| 98 | log_printf(INFO,Decod_queue,FUNCTION,_("Method - genMealy_decod_out")); |
---|
| 99 | |
---|
| 100 | SC_METHOD (genMealy_decod_out); |
---|
| 101 | dont_initialize (); |
---|
| 102 | sensitive << (*(in_CLOCK)).neg(); // use internal register |
---|
| 103 | |
---|
| 104 | for (uint32_t i=0; i<_param->_nb_inst_decod; i++) |
---|
| 105 | sensitive << (*(in_DECOD_OUT_ACK [i])); |
---|
| 106 | for (uint32_t i=0; i<_param->_nb_context; i++) |
---|
[88] | 107 | { |
---|
| 108 | if (_param->_have_port_depth) |
---|
[101] | 109 | { |
---|
[88] | 110 | sensitive << (*(in_DEPTH_MIN [i])); |
---|
| 111 | sensitive << (*(in_DEPTH_MAX [i])); |
---|
[101] | 112 | } |
---|
| 113 | sensitive << (*(in_DEPTH_FULL[i])); |
---|
[88] | 114 | } |
---|
[82] | 115 | |
---|
| 116 | # ifdef SYSTEMCASS_SPECIFIC |
---|
| 117 | // List dependency information |
---|
| 118 | for (uint32_t i=0; i<_param->_nb_inst_decod; i++) |
---|
| 119 | { |
---|
| 120 | (*(out_DECOD_OUT_VAL [i])) (*(in_DECOD_OUT_ACK [i])); |
---|
[88] | 121 | for (uint32_t j=0; j<_param->_nb_context; j++) |
---|
| 122 | { |
---|
| 123 | if (_param->_have_port_depth) |
---|
[101] | 124 | { |
---|
[88] | 125 | (*(out_DECOD_OUT_VAL [i])) (*(in_DEPTH_MIN [j])); |
---|
| 126 | (*(out_DECOD_OUT_VAL [i])) (*(in_DEPTH_MAX [j])); |
---|
[101] | 127 | } |
---|
[88] | 128 | } |
---|
[82] | 129 | } |
---|
| 130 | # endif |
---|
| 131 | |
---|
| 132 | #endif |
---|
| 133 | } |
---|
| 134 | log_end(Decod_queue,FUNCTION); |
---|
| 135 | }; |
---|
| 136 | |
---|
| 137 | #undef FUNCTION |
---|
| 138 | #define FUNCTION "Decod_queue::~Decod_queue" |
---|
| 139 | Decod_queue::~Decod_queue (void) |
---|
| 140 | { |
---|
| 141 | log_begin(Decod_queue,FUNCTION); |
---|
| 142 | |
---|
| 143 | #ifdef STATISTICS |
---|
| 144 | if (usage_is_set(_usage,USE_STATISTICS)) |
---|
| 145 | { |
---|
| 146 | statistics_deallocation(); |
---|
| 147 | } |
---|
| 148 | #endif |
---|
| 149 | |
---|
| 150 | log_printf(INFO,Decod_queue,FUNCTION,_("Deallocation")); |
---|
| 151 | deallocation (); |
---|
| 152 | |
---|
| 153 | log_end(Decod_queue,FUNCTION); |
---|
| 154 | }; |
---|
| 155 | |
---|
| 156 | }; // end namespace decod_queue |
---|
| 157 | }; // end namespace decod_unit |
---|
| 158 | }; // end namespace front_end |
---|
| 159 | }; // end namespace multi_front_end |
---|
| 160 | }; // end namespace core |
---|
| 161 | |
---|
| 162 | }; // end namespace behavioural |
---|
| 163 | }; // end namespace morpheo |
---|