[88] | 1 | #ifndef morpheo_behavioural_core_multi_front_end_front_end_front_end_glue_Front_end_Glue_h |
---|
| 2 | #define morpheo_behavioural_core_multi_front_end_front_end_front_end_glue_Front_end_Glue_h |
---|
| 3 | |
---|
| 4 | /* |
---|
| 5 | * $Id: Front_end_Glue.h 131 2009-07-08 18:40:08Z rosiere $ |
---|
| 6 | * |
---|
| 7 | * [ Description ] |
---|
| 8 | * |
---|
| 9 | */ |
---|
| 10 | |
---|
| 11 | #ifdef SYSTEMC |
---|
| 12 | #include "systemc.h" |
---|
| 13 | #endif |
---|
| 14 | |
---|
| 15 | |
---|
| 16 | #include "Behavioural/Core/Multi_Front_end/Front_end/Front_end_Glue/include/Parameters.h" |
---|
| 17 | #include "Behavioural/Core/Multi_Front_end/Front_end/Front_end_Glue/include/Types.h" |
---|
| 18 | #ifdef STATISTICS |
---|
| 19 | #include "Behavioural/include/Stat.h" |
---|
| 20 | #endif |
---|
| 21 | #include "Behavioural/include/Component.h" |
---|
| 22 | #ifdef VHDL |
---|
| 23 | #include "Behavioural/include/Vhdl.h" |
---|
| 24 | #endif |
---|
| 25 | #include "Behavioural/include/Usage.h" |
---|
| 26 | |
---|
| 27 | #include "Common/include/ToString.h" |
---|
| 28 | #include "Common/include/Debug.h" |
---|
| 29 | |
---|
| 30 | #include <iostream> |
---|
| 31 | |
---|
| 32 | namespace morpheo { |
---|
| 33 | namespace behavioural { |
---|
| 34 | |
---|
| 35 | namespace core { |
---|
| 36 | namespace multi_front_end { |
---|
| 37 | namespace front_end { |
---|
| 38 | namespace front_end_glue { |
---|
| 39 | |
---|
| 40 | |
---|
| 41 | class Front_end_Glue |
---|
| 42 | #if SYSTEMC |
---|
| 43 | : public sc_module |
---|
| 44 | #endif |
---|
| 45 | { |
---|
| 46 | // -----[ fields ]---------------------------------------------------- |
---|
| 47 | // Parameters |
---|
| 48 | protected : const std::string _name; |
---|
| 49 | protected : const Parameters * _param; |
---|
| 50 | private : const Tusage_t _usage; |
---|
| 51 | |
---|
| 52 | #ifdef STATISTICS |
---|
| 53 | public : Stat * _stat; |
---|
| 54 | #endif |
---|
| 55 | |
---|
| 56 | public : Component * _component; |
---|
| 57 | private : Interfaces * _interfaces; |
---|
| 58 | |
---|
| 59 | #ifdef SYSTEMC |
---|
| 60 | // ~~~~~[ Interface ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
| 61 | // ~~~~~[ Interface : "" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
| 62 | public : SC_CLOCK * in_CLOCK ; |
---|
| 63 | public : SC_IN (Tcontrol_t) * in_NRESET ; |
---|
| 64 | |
---|
| 65 | // ~~~~~[ Interface : "ifetch" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
| 66 | public : SC_OUT(Tcontext_t ) *** out_IFETCH_DECOD_UNIT_CONTEXT_ID ;//[nb_decod_unit][nb_decod_unit_context] |
---|
| 67 | |
---|
| 68 | // ~~~~~[ Interface : "decod" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
| 69 | public : SC_OUT(Tcontext_t ) *** out_DECOD_CONTEXT_ID ;//[nb_decod_unit][nb_inst_decod] |
---|
| 70 | public : SC_IN (Tcontext_t ) *** in_DECOD_DECOD_UNIT_CONTEXT_ID ;//[nb_decod_unit][nb_inst_decod] |
---|
| 71 | |
---|
| 72 | // ~~~~~[ Interface : "branch_complete" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
| 73 | public : SC_IN (Tcontrol_t ) ** in_BRANCH_COMPLETE_VAL ;//[nb_inst_branch_complete] |
---|
| 74 | public : SC_OUT(Tcontrol_t ) ** out_BRANCH_COMPLETE_ACK ;//[nb_inst_branch_complete] |
---|
| 75 | public : SC_OUT(Tcontrol_t ) ** out_BRANCH_COMPLETE_MISS_PREDICTION ;//[nb_inst_branch_complete] |
---|
| 76 | |
---|
| 77 | public : SC_OUT(Tcontrol_t ) ** out_BRANCH_COMPLETE_PREDICTION_UNIT_VAL ;//[nb_inst_branch_complete] |
---|
| 78 | public : SC_IN (Tcontrol_t ) ** in_BRANCH_COMPLETE_PREDICTION_UNIT_ACK ;//[nb_inst_branch_complete] |
---|
| 79 | public : SC_IN (Tcontrol_t ) ** in_BRANCH_COMPLETE_PREDICTION_UNIT_MISS_PREDICTION ;//[nb_inst_branch_complete] |
---|
| 80 | |
---|
| 81 | public : SC_OUT(Tcontrol_t ) ** out_BRANCH_COMPLETE_CONTEXT_STATE_VAL ;//[nb_inst_branch_complete] |
---|
| 82 | public : SC_IN (Tcontrol_t ) ** in_BRANCH_COMPLETE_CONTEXT_STATE_ACK ;//[nb_inst_branch_complete] |
---|
| 83 | public : SC_OUT(Tcontrol_t ) ** out_BRANCH_COMPLETE_CONTEXT_STATE_MISS_PREDICTION ;//[nb_inst_branch_complete] |
---|
| 84 | |
---|
| 85 | // ~~~~~[ Interface "event" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
| 86 | public : SC_OUT(Tcontrol_t ) ** out_EVENT_VAL ;//[nb_context] |
---|
| 87 | public : SC_IN (Tcontrol_t ) ** in_EVENT_ACK ;//[nb_context] |
---|
| 88 | public : SC_OUT(Taddress_t ) ** out_EVENT_ADDRESS ;//[nb_context] |
---|
| 89 | public : SC_OUT(Taddress_t ) ** out_EVENT_ADDRESS_NEXT ;//[nb_context] |
---|
| 90 | public : SC_OUT(Tcontrol_t ) ** out_EVENT_ADDRESS_NEXT_VAL ;//[nb_context] |
---|
| 91 | public : SC_OUT(Tcontrol_t ) ** out_EVENT_IS_DS_TAKE ;//[nb_context] |
---|
| 92 | |
---|
| 93 | public : SC_OUT(Tcontrol_t ) ** out_EVENT_IFETCH_UNIT_VAL ;//[nb_context] |
---|
| 94 | public : SC_IN (Tcontrol_t ) ** in_EVENT_IFETCH_UNIT_ACK ;//[nb_context] |
---|
| 95 | public : SC_OUT(Taddress_t ) ** out_EVENT_IFETCH_UNIT_ADDRESS ;//[nb_context] |
---|
| 96 | public : SC_OUT(Taddress_t ) ** out_EVENT_IFETCH_UNIT_ADDRESS_NEXT ;//[nb_context] |
---|
| 97 | public : SC_OUT(Tcontrol_t ) ** out_EVENT_IFETCH_UNIT_ADDRESS_NEXT_VAL ;//[nb_context] |
---|
| 98 | public : SC_OUT(Tcontrol_t ) ** out_EVENT_IFETCH_UNIT_IS_DS_TAKE ;//[nb_context] |
---|
[97] | 99 | |
---|
| 100 | public : SC_OUT(Tcontrol_t ) ** out_EVENT_PREDICTION_UNIT_VAL ;//[nb_context] |
---|
| 101 | public : SC_IN (Tcontrol_t ) ** in_EVENT_PREDICTION_UNIT_ACK ;//[nb_context] |
---|
| 102 | public : SC_OUT(Tevent_type_t ) ** out_EVENT_PREDICTION_UNIT_TYPE ;//[nb_context] |
---|
| 103 | public : SC_OUT(Tdepth_t ) ** out_EVENT_PREDICTION_UNIT_DEPTH ;//[nb_context] |
---|
[88] | 104 | |
---|
| 105 | public : SC_IN (Tcontrol_t ) ** in_EVENT_CONTEXT_STATE_VAL ;//[nb_context] |
---|
| 106 | public : SC_OUT(Tcontrol_t ) ** out_EVENT_CONTEXT_STATE_ACK ;//[nb_context] |
---|
| 107 | public : SC_IN (Taddress_t ) ** in_EVENT_CONTEXT_STATE_ADDRESS ;//[nb_context] |
---|
| 108 | public : SC_IN (Taddress_t ) ** in_EVENT_CONTEXT_STATE_ADDRESS_NEXT ;//[nb_context] |
---|
| 109 | public : SC_IN (Tcontrol_t ) ** in_EVENT_CONTEXT_STATE_ADDRESS_NEXT_VAL ;//[nb_context] |
---|
| 110 | public : SC_IN (Tcontrol_t ) ** in_EVENT_CONTEXT_STATE_IS_DS_TAKE ;//[nb_context] |
---|
[97] | 111 | public : SC_IN (Tevent_type_t ) ** in_EVENT_CONTEXT_STATE_TYPE ;//[nb_context] |
---|
| 112 | public : SC_IN (Tdepth_t ) ** in_EVENT_CONTEXT_STATE_DEPTH ;//[nb_context] |
---|
[119] | 113 | public : SC_IN (Tcontrol_t ) ** in_EVENT_CONTEXT_STATE_FLUSH_ONLY ;//[nb_context] |
---|
[88] | 114 | |
---|
| 115 | // ~~~~~[ Interface : "depth" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
| 116 | public : SC_OUT(Tdepth_t ) ** out_DEPTH_MIN ;//[nb_context] |
---|
| 117 | public : SC_OUT(Tdepth_t ) ** out_DEPTH_MAX ;//[nb_context] |
---|
[101] | 118 | public : SC_OUT(Tcontrol_t ) ** out_DEPTH_FULL ;//[nb_context] |
---|
[88] | 119 | |
---|
[101] | 120 | public : SC_IN (Tcontrol_t ) ** in_DEPTH_PREDICTION_UNIT_VAL ;//[nb_context] |
---|
[88] | 121 | public : SC_IN (Tdepth_t ) ** in_DEPTH_PREDICTION_UNIT_CURRENT ;//[nb_context] |
---|
| 122 | public : SC_IN (Tdepth_t ) ** in_DEPTH_PREDICTION_UNIT_MIN ;//[nb_context] |
---|
| 123 | public : SC_IN (Tdepth_t ) ** in_DEPTH_PREDICTION_UNIT_MAX ;//[nb_context] |
---|
[101] | 124 | public : SC_IN (Tcontrol_t ) ** in_DEPTH_PREDICTION_UNIT_FULL ;//[nb_context] |
---|
[88] | 125 | |
---|
| 126 | //public : SC_OUT(Tdepth_t ) *** out_DEPTH_DECOD_UNIT_CURRENT ;//[nb_decod_unit][nb_decod_unit_context] |
---|
| 127 | public : SC_OUT(Tdepth_t ) *** out_DEPTH_DECOD_UNIT_MIN ;//[nb_decod_unit][nb_decod_unit_context] |
---|
| 128 | public : SC_OUT(Tdepth_t ) *** out_DEPTH_DECOD_UNIT_MAX ;//[nb_decod_unit][nb_decod_unit_context] |
---|
[101] | 129 | public : SC_OUT(Tcontrol_t ) *** out_DEPTH_DECOD_UNIT_FULL ;//[nb_decod_unit][nb_decod_unit_context] |
---|
[88] | 130 | |
---|
| 131 | public : SC_OUT(Tdepth_t ) ** out_DEPTH_CONTEXT_STATE_MIN ;//[nb_context] |
---|
| 132 | |
---|
| 133 | // ~~~~~[ Interface : "context" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
[101] | 134 | public : SC_OUT(Tcontrol_t ) *** out_CONTEXT_DECOD_UNIT_DEPTH_VAL ;//[nb_decod_unit][nb_decod_unit_context] |
---|
[88] | 135 | public : SC_OUT(Tdepth_t ) *** out_CONTEXT_DECOD_UNIT_DEPTH ;//[nb_decod_unit][nb_decod_unit_context] |
---|
| 136 | |
---|
[108] | 137 | // ~~~~~[ Interface : "nb_inst" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
| 138 | public : SC_OUT(Tcounter_t ) ** out_NB_INST_DECOD_ALL ;//[nb_context] |
---|
| 139 | |
---|
| 140 | public : SC_IN (Tcounter_t ) ** in_NB_INST_DECOD_UNIT_DECOD_ALL ;//[nb_context] |
---|
| 141 | |
---|
| 142 | public : SC_OUT(Tcounter_t ) ** out_NB_INST_CONTEXT_STATE_DECOD_ALL ;//[nb_context] |
---|
| 143 | |
---|
| 144 | |
---|
[88] | 145 | // ~~~~~[ Component ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
| 146 | |
---|
| 147 | // ~~~~~[ Register ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
| 148 | |
---|
| 149 | // ~~~~~[ Internal ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
| 150 | #endif |
---|
| 151 | |
---|
| 152 | // -----[ Methods ]--------------------------------------------------- |
---|
| 153 | |
---|
| 154 | #ifdef SYSTEMC |
---|
| 155 | SC_HAS_PROCESS (Front_end_Glue); |
---|
| 156 | #endif |
---|
| 157 | public : Front_end_Glue |
---|
| 158 | ( |
---|
| 159 | #ifdef SYSTEMC |
---|
| 160 | sc_module_name name, |
---|
| 161 | #else |
---|
| 162 | std::string name, |
---|
| 163 | #endif |
---|
| 164 | #ifdef STATISTICS |
---|
| 165 | morpheo::behavioural::Parameters_Statistics * param_statistics, |
---|
| 166 | #endif |
---|
| 167 | Parameters * param, |
---|
| 168 | morpheo::behavioural::Tusage_t usage |
---|
| 169 | ); |
---|
| 170 | public : ~Front_end_Glue (void); |
---|
| 171 | |
---|
| 172 | private : void allocation ( |
---|
| 173 | #ifdef STATISTICS |
---|
| 174 | morpheo::behavioural::Parameters_Statistics * param_statistics |
---|
| 175 | #else |
---|
| 176 | void |
---|
| 177 | #endif |
---|
| 178 | ); |
---|
| 179 | private : void deallocation (void); |
---|
| 180 | |
---|
| 181 | #ifdef SYSTEMC |
---|
[131] | 182 | public : void constant (void); |
---|
[88] | 183 | public : void transition (void); |
---|
| 184 | //public : void genMoore (void); |
---|
| 185 | public : void genMealy_decod (void); |
---|
| 186 | public : void genMealy_branch_complete (void); |
---|
| 187 | public : void genMealy_event (void); |
---|
| 188 | public : void genMealy_depth (void); |
---|
[108] | 189 | public : void genMealy_nb_inst (void); |
---|
[88] | 190 | #endif |
---|
| 191 | |
---|
| 192 | #if VHDL |
---|
| 193 | public : void vhdl (void); |
---|
| 194 | private : void vhdl_declaration (Vhdl * & vhdl); |
---|
| 195 | private : void vhdl_body (Vhdl * & vhdl); |
---|
| 196 | #endif |
---|
| 197 | |
---|
| 198 | #ifdef STATISTICS |
---|
| 199 | public : void statistics_allocation (morpheo::behavioural::Parameters_Statistics * param_statistics); |
---|
| 200 | public : void statistics_deallocation (void); |
---|
| 201 | #endif |
---|
| 202 | #if defined(STATISTICS) or defined(VHDL_TESTBENCH) |
---|
| 203 | private : void end_cycle (void); |
---|
| 204 | #endif |
---|
| 205 | }; |
---|
| 206 | |
---|
| 207 | }; // end namespace front_end_glue |
---|
| 208 | }; // end namespace front_end |
---|
| 209 | }; // end namespace multi_front_end |
---|
| 210 | }; // end namespace core |
---|
| 211 | |
---|
| 212 | }; // end namespace behavioural |
---|
| 213 | }; // end namespace morpheo |
---|
| 214 | |
---|
| 215 | #endif |
---|