[82] | 1 | #ifndef morpheo_behavioural_core_multi_front_end_front_end_decod_unit_decod_queue_Decod_queue_h |
---|
| 2 | #define morpheo_behavioural_core_multi_front_end_front_end_decod_unit_decod_queue_Decod_queue_h |
---|
| 3 | |
---|
| 4 | /* |
---|
| 5 | * $Id: Decod_queue.h 110 2009-02-19 16:31:47Z rosiere $ |
---|
| 6 | * |
---|
| 7 | * [ Description ] |
---|
| 8 | * |
---|
| 9 | */ |
---|
| 10 | |
---|
| 11 | #ifdef SYSTEMC |
---|
| 12 | #include "systemc.h" |
---|
| 13 | #endif |
---|
| 14 | |
---|
| 15 | #include "Common/include/ToString.h" |
---|
| 16 | #include "Common/include/Debug.h" |
---|
| 17 | |
---|
| 18 | #include "Behavioural/Core/Multi_Front_end/Front_end/Decod_unit/Decod_queue/include/Parameters.h" |
---|
| 19 | #include "Behavioural/Core/Multi_Front_end/Front_end/Decod_unit/Decod_queue/include/Types.h" |
---|
| 20 | #ifdef STATISTICS |
---|
| 21 | #include "Behavioural/include/Stat.h" |
---|
| 22 | #endif |
---|
| 23 | #include "Behavioural/include/Component.h" |
---|
| 24 | #ifdef VHDL |
---|
| 25 | #include "Behavioural/include/Vhdl.h" |
---|
| 26 | #endif |
---|
| 27 | #include "Behavioural/include/Usage.h" |
---|
| 28 | |
---|
| 29 | #include <iostream> |
---|
| 30 | #include <list> |
---|
| 31 | |
---|
| 32 | namespace morpheo { |
---|
| 33 | namespace behavioural { |
---|
| 34 | |
---|
| 35 | namespace core { |
---|
| 36 | namespace multi_front_end { |
---|
| 37 | namespace front_end { |
---|
| 38 | namespace decod_unit { |
---|
| 39 | namespace decod_queue { |
---|
| 40 | |
---|
| 41 | |
---|
| 42 | class Decod_queue |
---|
| 43 | #if SYSTEMC |
---|
| 44 | : public sc_module |
---|
| 45 | #endif |
---|
| 46 | { |
---|
| 47 | // -----[ fields ]---------------------------------------------------- |
---|
| 48 | // Parameters |
---|
| 49 | protected : const std::string _name; |
---|
| 50 | protected : const Parameters * _param; |
---|
| 51 | private : const Tusage_t _usage; |
---|
| 52 | |
---|
| 53 | #ifdef STATISTICS |
---|
| 54 | public : Stat * _stat; |
---|
| 55 | private : counter_t ** _stat_nb_inst; |
---|
[88] | 56 | private : counter_t * _stat_use_queue; |
---|
[110] | 57 | |
---|
| 58 | private : counter_t * _stat_sum_inst_enable; |
---|
| 59 | private : counter_t * _stat_sum_transaction_decod_in; |
---|
| 60 | private : counter_t * _stat_average_occupation_bundle; |
---|
[82] | 61 | #endif |
---|
| 62 | |
---|
| 63 | public : Component * _component; |
---|
| 64 | private : Interfaces * _interfaces; |
---|
| 65 | |
---|
| 66 | #ifdef SYSTEMC |
---|
| 67 | // ~~~~~[ Interface ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
| 68 | // ~~~~~[ Interface : "" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
| 69 | public : SC_CLOCK * in_CLOCK ; |
---|
| 70 | public : SC_IN (Tcontrol_t) * in_NRESET ; |
---|
| 71 | |
---|
| 72 | // ~~~~~[ Interface : "decod_in" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
| 73 | public : SC_IN (Tcontrol_t ) ** in_DECOD_IN_VAL ;//[nb_inst_decod] |
---|
| 74 | public : SC_OUT(Tcontrol_t ) ** out_DECOD_IN_ACK ;//[nb_inst_decod] |
---|
| 75 | public : SC_IN (Tcontext_t ) ** in_DECOD_IN_CONTEXT_ID ;//[nb_inst_decod] |
---|
| 76 | public : SC_IN (Tdepth_t ) ** in_DECOD_IN_DEPTH ;//[nb_inst_decod] |
---|
| 77 | public : SC_IN (Ttype_t ) ** in_DECOD_IN_TYPE ;//[nb_inst_decod] |
---|
| 78 | public : SC_IN (Toperation_t ) ** in_DECOD_IN_OPERATION ;//[nb_inst_decod] |
---|
[88] | 79 | public : SC_IN (Tcontrol_t ) ** in_DECOD_IN_NO_EXECUTE ;//[nb_inst_decod] |
---|
[82] | 80 | public : SC_IN (Tcontrol_t ) ** in_DECOD_IN_IS_DELAY_SLOT ;//[nb_inst_decod] |
---|
[108] | 81 | #ifdef DEBUG |
---|
| 82 | public : SC_IN (Tgeneral_data_t ) ** in_DECOD_IN_ADDRESS ;//[nb_inst_decod] |
---|
| 83 | #endif |
---|
[105] | 84 | public : SC_IN (Tgeneral_data_t ) ** in_DECOD_IN_ADDRESS_NEXT ;//[nb_inst_decod] |
---|
[82] | 85 | public : SC_IN (Tcontrol_t ) ** in_DECOD_IN_HAS_IMMEDIAT ;//[nb_inst_decod] |
---|
| 86 | public : SC_IN (Tgeneral_data_t ) ** in_DECOD_IN_IMMEDIAT ;//[nb_inst_decod] |
---|
| 87 | public : SC_IN (Tcontrol_t ) ** in_DECOD_IN_READ_RA ;//[nb_inst_decod] |
---|
| 88 | public : SC_IN (Tgeneral_address_t ) ** in_DECOD_IN_NUM_REG_RA ;//[nb_inst_decod] |
---|
| 89 | public : SC_IN (Tcontrol_t ) ** in_DECOD_IN_READ_RB ;//[nb_inst_decod] |
---|
| 90 | public : SC_IN (Tgeneral_address_t ) ** in_DECOD_IN_NUM_REG_RB ;//[nb_inst_decod] |
---|
| 91 | public : SC_IN (Tcontrol_t ) ** in_DECOD_IN_READ_RC ;//[nb_inst_decod] |
---|
| 92 | public : SC_IN (Tspecial_address_t ) ** in_DECOD_IN_NUM_REG_RC ;//[nb_inst_decod] |
---|
| 93 | public : SC_IN (Tcontrol_t ) ** in_DECOD_IN_WRITE_RD ;//[nb_inst_decod] |
---|
| 94 | public : SC_IN (Tgeneral_address_t ) ** in_DECOD_IN_NUM_REG_RD ;//[nb_inst_decod] |
---|
| 95 | public : SC_IN (Tcontrol_t ) ** in_DECOD_IN_WRITE_RE ;//[nb_inst_decod] |
---|
| 96 | public : SC_IN (Tspecial_address_t ) ** in_DECOD_IN_NUM_REG_RE ;//[nb_inst_decod] |
---|
| 97 | public : SC_IN (Texception_t ) ** in_DECOD_IN_EXCEPTION_USE ;//[nb_inst_decod] |
---|
[88] | 98 | public : SC_IN (Texception_t ) ** in_DECOD_IN_EXCEPTION ;//[nb_inst_decod] |
---|
[82] | 99 | |
---|
| 100 | // ~~~~~[ Interface : "decod_out" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
| 101 | public : SC_OUT(Tcontrol_t ) ** out_DECOD_OUT_VAL ;//[nb_inst_decod] |
---|
| 102 | public : SC_IN (Tcontrol_t ) ** in_DECOD_OUT_ACK ;//[nb_inst_decod] |
---|
| 103 | public : SC_OUT(Tcontext_t ) ** out_DECOD_OUT_CONTEXT_ID ;//[nb_inst_decod] |
---|
| 104 | public : SC_OUT(Tdepth_t ) ** out_DECOD_OUT_DEPTH ;//[nb_inst_decod] |
---|
| 105 | public : SC_OUT(Ttype_t ) ** out_DECOD_OUT_TYPE ;//[nb_inst_decod] |
---|
| 106 | public : SC_OUT(Toperation_t ) ** out_DECOD_OUT_OPERATION ;//[nb_inst_decod] |
---|
[88] | 107 | public : SC_OUT(Tcontrol_t ) ** out_DECOD_OUT_NO_EXECUTE ;//[nb_inst_decod] |
---|
[82] | 108 | public : SC_OUT(Tcontrol_t ) ** out_DECOD_OUT_IS_DELAY_SLOT ;//[nb_inst_decod] |
---|
[108] | 109 | #ifdef DEBUG |
---|
| 110 | public : SC_OUT(Tgeneral_data_t ) ** out_DECOD_OUT_ADDRESS ;//[nb_inst_decod] |
---|
| 111 | #endif |
---|
[105] | 112 | public : SC_OUT(Tgeneral_data_t ) ** out_DECOD_OUT_ADDRESS_NEXT ;//[nb_inst_decod] |
---|
[82] | 113 | public : SC_OUT(Tcontrol_t ) ** out_DECOD_OUT_HAS_IMMEDIAT ;//[nb_inst_decod] |
---|
| 114 | public : SC_OUT(Tgeneral_data_t ) ** out_DECOD_OUT_IMMEDIAT ;//[nb_inst_decod] |
---|
| 115 | public : SC_OUT(Tcontrol_t ) ** out_DECOD_OUT_READ_RA ;//[nb_inst_decod] |
---|
| 116 | public : SC_OUT(Tgeneral_address_t ) ** out_DECOD_OUT_NUM_REG_RA ;//[nb_inst_decod] |
---|
| 117 | public : SC_OUT(Tcontrol_t ) ** out_DECOD_OUT_READ_RB ;//[nb_inst_decod] |
---|
| 118 | public : SC_OUT(Tgeneral_address_t ) ** out_DECOD_OUT_NUM_REG_RB ;//[nb_inst_decod] |
---|
| 119 | public : SC_OUT(Tcontrol_t ) ** out_DECOD_OUT_READ_RC ;//[nb_inst_decod] |
---|
| 120 | public : SC_OUT(Tspecial_address_t ) ** out_DECOD_OUT_NUM_REG_RC ;//[nb_inst_decod] |
---|
| 121 | public : SC_OUT(Tcontrol_t ) ** out_DECOD_OUT_WRITE_RD ;//[nb_inst_decod] |
---|
| 122 | public : SC_OUT(Tgeneral_address_t ) ** out_DECOD_OUT_NUM_REG_RD ;//[nb_inst_decod] |
---|
| 123 | public : SC_OUT(Tcontrol_t ) ** out_DECOD_OUT_WRITE_RE ;//[nb_inst_decod] |
---|
| 124 | public : SC_OUT(Tspecial_address_t ) ** out_DECOD_OUT_NUM_REG_RE ;//[nb_inst_decod] |
---|
| 125 | public : SC_OUT(Texception_t ) ** out_DECOD_OUT_EXCEPTION_USE ;//[nb_inst_decod] |
---|
[88] | 126 | public : SC_OUT(Texception_t ) ** out_DECOD_OUT_EXCEPTION ;//[nb_inst_decod] |
---|
[82] | 127 | |
---|
| 128 | // ~~~~~[ Interface : "depth" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
[88] | 129 | public : SC_IN (Tdepth_t ) ** in_DEPTH_MIN ;//[nb_context] |
---|
| 130 | public : SC_IN (Tdepth_t ) ** in_DEPTH_MAX ;//[nb_context] |
---|
[101] | 131 | public : SC_IN (Tcontrol_t ) ** in_DEPTH_FULL ;//[nb_context] |
---|
[82] | 132 | |
---|
| 133 | // ~~~~~[ Interface : "nb_inst" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
| 134 | public : SC_OUT(Tcounter_t ) ** out_NB_INST_ALL ;//[nb_context] |
---|
| 135 | |
---|
| 136 | // ~~~~~[ Component ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
| 137 | |
---|
| 138 | // ~~~~~[ Register ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
| 139 | private : std::list<decod_queue_entry_t*>* reg_QUEUE ; |
---|
| 140 | private : uint32_t * reg_NB_INST ;//[nb_context] |
---|
[108] | 141 | private : uint32_t reg_LAST_SLOT ; |
---|
| 142 | |
---|
[82] | 143 | // ~~~~~[ Internal ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
| 144 | private : Tcontrol_t * internal_DECOD_IN_ACK ;//[nb_inst_decod] |
---|
| 145 | private : Tcontrol_t * internal_DECOD_OUT_VAL ;//[nb_inst_decod] |
---|
| 146 | private : Tcontrol_t * internal_DECOD_OUT_ACK ;//[nb_inst_decod] |
---|
| 147 | #endif |
---|
| 148 | |
---|
| 149 | // -----[ Methods ]--------------------------------------------------- |
---|
| 150 | |
---|
| 151 | #ifdef SYSTEMC |
---|
| 152 | SC_HAS_PROCESS (Decod_queue); |
---|
| 153 | #endif |
---|
| 154 | public : Decod_queue |
---|
| 155 | ( |
---|
| 156 | #ifdef SYSTEMC |
---|
| 157 | sc_module_name name, |
---|
| 158 | #else |
---|
| 159 | std::string name, |
---|
| 160 | #endif |
---|
| 161 | #ifdef STATISTICS |
---|
| 162 | morpheo::behavioural::Parameters_Statistics * param_statistics, |
---|
| 163 | #endif |
---|
| 164 | Parameters * param, |
---|
| 165 | morpheo::behavioural::Tusage_t usage |
---|
| 166 | ); |
---|
| 167 | public : ~Decod_queue (void); |
---|
| 168 | |
---|
| 169 | private : void allocation ( |
---|
| 170 | #ifdef STATISTICS |
---|
| 171 | morpheo::behavioural::Parameters_Statistics * param_statistics |
---|
| 172 | #else |
---|
| 173 | void |
---|
| 174 | #endif |
---|
| 175 | ); |
---|
| 176 | private : void deallocation (void); |
---|
| 177 | |
---|
| 178 | #ifdef SYSTEMC |
---|
| 179 | public : void transition (void); |
---|
| 180 | public : void genMoore (void); |
---|
| 181 | public : void genMealy_decod_out (void); |
---|
| 182 | #endif |
---|
| 183 | |
---|
| 184 | #if VHDL |
---|
| 185 | public : void vhdl (void); |
---|
| 186 | private : void vhdl_declaration (Vhdl * & vhdl); |
---|
| 187 | private : void vhdl_body (Vhdl * & vhdl); |
---|
| 188 | #endif |
---|
| 189 | |
---|
| 190 | #ifdef STATISTICS |
---|
| 191 | public : void statistics_allocation (morpheo::behavioural::Parameters_Statistics * param_statistics); |
---|
| 192 | public : void statistics_deallocation (void); |
---|
| 193 | #endif |
---|
| 194 | #if defined(STATISTICS) or defined(VHDL_TESTBENCH) |
---|
| 195 | private : void end_cycle (void); |
---|
| 196 | #endif |
---|
| 197 | }; |
---|
| 198 | |
---|
| 199 | }; // end namespace decod_queue |
---|
| 200 | }; // end namespace decod_unit |
---|
| 201 | }; // end namespace front_end |
---|
| 202 | }; // end namespace multi_front_end |
---|
| 203 | }; // end namespace core |
---|
| 204 | |
---|
| 205 | }; // end namespace behavioural |
---|
| 206 | }; // end namespace morpheo |
---|
| 207 | |
---|
| 208 | #endif |
---|