[88] | 1 | #ifndef morpheo_behavioural_core_multi_ooo_engine_ooo_engine_rename_unit_register_translation_unit_stat_list_unit_Stat_List_unit_h |
---|
[78] | 2 | #define morpheo_behavioural_core_multi_ooo_engine_ooo_engine_rename_unit_register_translation_unit_stat_list_unit_Stat_List_unit_h |
---|
| 3 | |
---|
| 4 | /* |
---|
| 5 | * $Id: Stat_List_unit.h 135 2009-07-17 08:59:05Z rosiere $ |
---|
| 6 | * |
---|
| 7 | * [ Description ] |
---|
| 8 | * |
---|
| 9 | */ |
---|
| 10 | |
---|
| 11 | #ifdef SYSTEMC |
---|
| 12 | #include "systemc.h" |
---|
| 13 | #endif |
---|
| 14 | |
---|
| 15 | #include <iostream> |
---|
| 16 | #include "Common/include/ToString.h" |
---|
| 17 | #include "Common/include/Debug.h" |
---|
| 18 | #include "Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Rename_unit/Register_translation_unit/Stat_List_unit/include/Types.h" |
---|
| 19 | #include "Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Rename_unit/Register_translation_unit/Stat_List_unit/include/Parameters.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 | namespace morpheo { |
---|
| 30 | namespace behavioural { |
---|
| 31 | |
---|
| 32 | namespace core { |
---|
| 33 | namespace multi_ooo_engine { |
---|
| 34 | namespace ooo_engine { |
---|
| 35 | namespace rename_unit { |
---|
| 36 | namespace register_translation_unit { |
---|
| 37 | namespace stat_list_unit { |
---|
| 38 | |
---|
| 39 | class Stat_List_unit |
---|
| 40 | #if SYSTEMC |
---|
| 41 | : public sc_module |
---|
| 42 | #endif |
---|
| 43 | { |
---|
| 44 | // -----[ fields ]---------------------------------------------------- |
---|
| 45 | // Parameters |
---|
| 46 | protected : const std::string _name; |
---|
| 47 | protected : const Parameters * _param; |
---|
| 48 | private : const Tusage_t _usage; |
---|
| 49 | |
---|
| 50 | #ifdef STATISTICS |
---|
| 51 | public : Stat * _stat; |
---|
| 52 | #endif |
---|
| 53 | |
---|
| 54 | public : Component * _component; |
---|
| 55 | private : Interfaces * _interfaces; |
---|
| 56 | |
---|
| 57 | #ifdef SYSTEMC |
---|
| 58 | // ~~~~~[ Interface ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
| 59 | // Interface |
---|
| 60 | public : SC_CLOCK * in_CLOCK ; |
---|
| 61 | public : SC_IN (Tcontrol_t) * in_NRESET; |
---|
| 62 | |
---|
| 63 | // ~~~~~[ Interface "insert" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
| 64 | public : SC_IN (Tcontrol_t ) ** in_INSERT_VAL ;//[nb_inst_insert] |
---|
| 65 | public : SC_OUT(Tcontrol_t ) ** out_INSERT_ACK ;//[nb_inst_insert] |
---|
| 66 | public : SC_IN (Tcontrol_t ) ** in_INSERT_READ_RA ;//[nb_inst_insert] |
---|
| 67 | public : SC_IN (Tgeneral_address_t) ** in_INSERT_NUM_REG_RA_PHY ;//[nb_inst_insert] |
---|
| 68 | public : SC_IN (Tcontrol_t ) ** in_INSERT_READ_RB ;//[nb_inst_insert] |
---|
| 69 | public : SC_IN (Tgeneral_address_t) ** in_INSERT_NUM_REG_RB_PHY ;//[nb_inst_insert] |
---|
| 70 | public : SC_IN (Tcontrol_t ) ** in_INSERT_READ_RC ;//[nb_inst_insert] |
---|
| 71 | public : SC_IN (Tspecial_address_t) ** in_INSERT_NUM_REG_RC_PHY ;//[nb_inst_insert] |
---|
| 72 | public : SC_IN (Tcontrol_t ) ** in_INSERT_WRITE_RD ;//[nb_inst_insert] |
---|
[117] | 73 | public : SC_IN (Tgeneral_address_t) ** in_INSERT_NUM_REG_RD_PHY_OLD;//[nb_inst_insert] |
---|
[78] | 74 | public : SC_IN (Tgeneral_address_t) ** in_INSERT_NUM_REG_RD_PHY_NEW;//[nb_inst_insert] |
---|
| 75 | public : SC_IN (Tcontrol_t ) ** in_INSERT_WRITE_RE ;//[nb_inst_insert] |
---|
[117] | 76 | public : SC_IN (Tspecial_address_t) ** in_INSERT_NUM_REG_RE_PHY_OLD;//[nb_inst_insert] |
---|
[78] | 77 | public : SC_IN (Tspecial_address_t) ** in_INSERT_NUM_REG_RE_PHY_NEW;//[nb_inst_insert] |
---|
[117] | 78 | |
---|
[78] | 79 | // ~~~~~[ Interface "retire" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
| 80 | public : SC_IN (Tcontrol_t ) ** in_RETIRE_VAL ;//[nb_inst_retire] |
---|
| 81 | public : SC_OUT(Tcontrol_t ) ** out_RETIRE_ACK ;//[nb_inst_retire] |
---|
[112] | 82 | public : SC_IN (Tcontrol_t ) ** in_RETIRE_RESTORE ;//[nb_inst_retire] |
---|
[123] | 83 | //public : SC_IN (Tcontrol_t ) ** in_RETIRE_READ_RA ;//[nb_inst_retire] |
---|
| 84 | //public : SC_IN (Tgeneral_address_t) ** in_RETIRE_NUM_REG_RA_PHY ;//[nb_inst_retire] |
---|
| 85 | //public : SC_IN (Tcontrol_t ) ** in_RETIRE_READ_RB ;//[nb_inst_retire] |
---|
| 86 | //public : SC_IN (Tgeneral_address_t) ** in_RETIRE_NUM_REG_RB_PHY ;//[nb_inst_retire] |
---|
| 87 | //public : SC_IN (Tcontrol_t ) ** in_RETIRE_READ_RC ;//[nb_inst_retire] |
---|
| 88 | //public : SC_IN (Tspecial_address_t) ** in_RETIRE_NUM_REG_RC_PHY ;//[nb_inst_retire] |
---|
[78] | 89 | public : SC_IN (Tcontrol_t ) ** in_RETIRE_WRITE_RD ;//[nb_inst_retire] |
---|
[88] | 90 | public : SC_IN (Tcontrol_t ) ** in_RETIRE_RESTORE_RD_PHY_OLD;//[nb_inst_retire] |
---|
[78] | 91 | public : SC_IN (Tgeneral_address_t) ** in_RETIRE_NUM_REG_RD_PHY_OLD;//[nb_inst_retire] |
---|
| 92 | public : SC_IN (Tgeneral_address_t) ** in_RETIRE_NUM_REG_RD_PHY_NEW;//[nb_inst_retire] |
---|
| 93 | public : SC_IN (Tcontrol_t ) ** in_RETIRE_WRITE_RE ;//[nb_inst_retire] |
---|
[88] | 94 | public : SC_IN (Tcontrol_t ) ** in_RETIRE_RESTORE_RE_PHY_OLD;//[nb_inst_retire] |
---|
[78] | 95 | public : SC_IN (Tspecial_address_t) ** in_RETIRE_NUM_REG_RE_PHY_OLD;//[nb_inst_retire] |
---|
| 96 | public : SC_IN (Tspecial_address_t) ** in_RETIRE_NUM_REG_RE_PHY_NEW;//[nb_inst_retire] |
---|
| 97 | |
---|
| 98 | // ~~~~~[ interface : "push_gpr" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
| 99 | public : SC_OUT(Tcontrol_t) ** out_PUSH_GPR_VAL ;//[nb_reg_free] |
---|
| 100 | public : SC_IN (Tcontrol_t) ** in_PUSH_GPR_ACK ;//[nb_reg_free] |
---|
| 101 | public : SC_OUT(Tgeneral_address_t) ** out_PUSH_GPR_NUM_REG ;//[nb_reg_free] |
---|
| 102 | |
---|
| 103 | // ~~~~~[ interface : "push_spr" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
| 104 | public : SC_OUT(Tcontrol_t) ** out_PUSH_SPR_VAL ;//[nb_reg_free] |
---|
| 105 | public : SC_IN (Tcontrol_t) ** in_PUSH_SPR_ACK ;//[nb_reg_free] |
---|
| 106 | public : SC_OUT(Tspecial_address_t) ** out_PUSH_SPR_NUM_REG ;//[nb_reg_free] |
---|
| 107 | |
---|
[123] | 108 | // ~~~~~[ interface : "info" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
| 109 | #ifdef DEBUG_TEST |
---|
| 110 | public : SC_IN (bool ) * in_INFO_ROB_EMPTY ; |
---|
| 111 | public : SC_IN (uint32_t ) * in_INFO_NB_GPR_FREE; |
---|
| 112 | public : SC_IN (uint32_t ) * in_INFO_NB_SPR_FREE; |
---|
| 113 | #endif |
---|
| 114 | |
---|
[78] | 115 | // ~~~~~[ Component ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
| 116 | |
---|
| 117 | // ~~~~~[ Register ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
| 118 | private : stat_list_entry_t ** gpr_stat_list; //[nb_bank][nb_general_register_by_bank] |
---|
| 119 | private : stat_list_entry_t ** spr_stat_list; //[nb_bank][nb_general_register_by_bank] |
---|
| 120 | |
---|
[112] | 121 | private : uint32_t reg_GPR_PTR_FREE; |
---|
| 122 | private : uint32_t reg_SPR_PTR_FREE; |
---|
| 123 | |
---|
[78] | 124 | // ~~~~~[ Internal ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
| 125 | private : Tcontrol_t * internal_INSERT_ACK ;//[nb_inst_insert] |
---|
| 126 | private : Tcontrol_t * internal_RETIRE_ACK ;//[nb_inst_retire] |
---|
| 127 | private : Tcontrol_t * internal_PUSH_GPR_VAL ;//[nb_reg_free] |
---|
| 128 | private : uint32_t * internal_PUSH_GPR_NUM_BANK;//[nb_reg_free] |
---|
[118] | 129 | private : uint32_t * internal_PUSH_GPR_NUM_REG ;//[nb_reg_free] |
---|
[78] | 130 | private : Tcontrol_t * internal_PUSH_SPR_VAL ;//[nb_reg_free] |
---|
| 131 | private : uint32_t * internal_PUSH_SPR_NUM_BANK;//[nb_reg_free] |
---|
[118] | 132 | private : uint32_t * internal_PUSH_SPR_NUM_REG ;//[nb_reg_free] |
---|
[78] | 133 | #endif |
---|
| 134 | |
---|
| 135 | // -----[ Methods ]--------------------------------------------------- |
---|
| 136 | |
---|
| 137 | #ifdef SYSTEMC |
---|
| 138 | SC_HAS_PROCESS (Stat_List_unit); |
---|
| 139 | #endif |
---|
| 140 | public : Stat_List_unit |
---|
| 141 | ( |
---|
| 142 | #ifdef SYSTEMC |
---|
| 143 | sc_module_name name, |
---|
| 144 | #else |
---|
| 145 | std::string name, |
---|
| 146 | #endif |
---|
| 147 | #ifdef STATISTICS |
---|
| 148 | morpheo::behavioural::Parameters_Statistics * param_statistics, |
---|
| 149 | #endif |
---|
| 150 | Parameters * param, |
---|
[82] | 151 | morpheo::behavioural::Tusage_t usage |
---|
[78] | 152 | ); |
---|
| 153 | public : ~Stat_List_unit (void); |
---|
| 154 | |
---|
| 155 | private : void allocation ( |
---|
| 156 | #ifdef STATISTICS |
---|
| 157 | morpheo::behavioural::Parameters_Statistics * param_statistics |
---|
| 158 | #else |
---|
| 159 | void |
---|
| 160 | #endif |
---|
| 161 | ); |
---|
| 162 | private : void deallocation (void); |
---|
| 163 | |
---|
| 164 | #ifdef SYSTEMC |
---|
[131] | 165 | public : void constant (void); |
---|
[78] | 166 | public : void transition (void); |
---|
| 167 | public : void genMoore (void); |
---|
[112] | 168 | //public : void genMealy (void); |
---|
[78] | 169 | #endif |
---|
| 170 | |
---|
| 171 | #if VHDL |
---|
| 172 | public : void vhdl (void); |
---|
| 173 | private : void vhdl_declaration (Vhdl * & vhdl); |
---|
| 174 | private : void vhdl_body (Vhdl * & vhdl); |
---|
| 175 | #endif |
---|
| 176 | |
---|
| 177 | #ifdef STATISTICS |
---|
| 178 | public : void statistics_declaration (morpheo::behavioural::Parameters_Statistics * param_statistics); |
---|
| 179 | #endif |
---|
| 180 | #if defined(STATISTICS) or defined(VHDL_TESTBENCH) |
---|
| 181 | private : void end_cycle (void); |
---|
| 182 | #endif |
---|
| 183 | }; |
---|
| 184 | |
---|
| 185 | }; // end namespace stat_list_unit |
---|
| 186 | }; // end namespace register_translation_unit |
---|
| 187 | }; // end namespace rename_unit |
---|
| 188 | }; // end namespace ooo_engine |
---|
| 189 | }; // end namespace multi_ooo_engine |
---|
| 190 | }; // end namespace core |
---|
| 191 | |
---|
| 192 | }; // end namespace behavioural |
---|
| 193 | }; // end namespace morpheo |
---|
| 194 | |
---|
| 195 | #endif |
---|