[78] | 1 | #ifndef morpheo_behavioural_core_multi_ooo_engine_ooo_engine_rename_unit_register_translation_unit_free_list_unit_Free_List_unit_h |
---|
| 2 | #define morpheo_behavioural_core_multi_ooo_engine_ooo_engine_rename_unit_register_translation_unit_free_list_unit_Free_List_unit_h |
---|
| 3 | |
---|
| 4 | /* |
---|
| 5 | * $Id: Free_List_unit.h 108 2009-02-12 11:55:06Z rosiere $ |
---|
| 6 | * |
---|
| 7 | * [ Description ] |
---|
| 8 | * |
---|
| 9 | */ |
---|
| 10 | |
---|
| 11 | #ifdef SYSTEMC |
---|
| 12 | #include "systemc.h" |
---|
| 13 | #endif |
---|
| 14 | |
---|
| 15 | #include <iostream> |
---|
| 16 | #include <list> |
---|
| 17 | #include "Common/include/ToString.h" |
---|
| 18 | #include "Common/include/Debug.h" |
---|
| 19 | #include "Behavioural/include/Types.h" |
---|
| 20 | |
---|
| 21 | #include "Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Rename_unit/Register_translation_unit/Free_List_unit/include/Parameters.h" |
---|
| 22 | #ifdef STATISTICS |
---|
| 23 | #include "Behavioural/include/Stat.h" |
---|
| 24 | #endif |
---|
| 25 | #include "Behavioural/include/Component.h" |
---|
| 26 | #ifdef VHDL |
---|
| 27 | #include "Behavioural/include/Vhdl.h" |
---|
| 28 | #endif |
---|
| 29 | #include "Behavioural/include/Usage.h" |
---|
| 30 | |
---|
| 31 | namespace morpheo { |
---|
| 32 | namespace behavioural { |
---|
| 33 | |
---|
| 34 | namespace core { |
---|
| 35 | namespace multi_ooo_engine { |
---|
| 36 | namespace ooo_engine { |
---|
| 37 | namespace rename_unit { |
---|
| 38 | namespace register_translation_unit { |
---|
| 39 | namespace free_list_unit { |
---|
| 40 | |
---|
| 41 | |
---|
| 42 | class Free_List_unit |
---|
| 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 | #endif |
---|
| 56 | |
---|
| 57 | public : Component * _component; |
---|
| 58 | private : Interfaces * _interfaces; |
---|
| 59 | |
---|
| 60 | #ifdef SYSTEMC |
---|
| 61 | // ~~~~~[ Interface ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
| 62 | // Interface |
---|
| 63 | public : SC_CLOCK * in_CLOCK ; |
---|
| 64 | public : SC_IN (Tcontrol_t) * in_NRESET ; |
---|
| 65 | |
---|
| 66 | // ~~~~~[ interface : "pop" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
| 67 | public : SC_IN (Tcontrol_t) ** in_POP_VAL ; |
---|
| 68 | public : SC_OUT(Tcontrol_t) ** out_POP_ACK ; |
---|
| 69 | public : SC_IN (Tcontrol_t ) ** in_POP_GPR_VAL ; // write_rd |
---|
| 70 | public : SC_OUT(Tgeneral_address_t) ** out_POP_GPR_NUM_REG; // num_reg_rd |
---|
| 71 | public : SC_IN (Tcontrol_t ) ** in_POP_SPR_VAL ; // write_re |
---|
| 72 | public : SC_OUT(Tspecial_address_t) ** out_POP_SPR_NUM_REG; // num_reg_re |
---|
| 73 | |
---|
| 74 | // ~~~~~[ interface : "push_gpr" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
| 75 | public : SC_IN (Tcontrol_t) ** in_PUSH_GPR_VAL ; // gpr_free (cf stat_list) |
---|
| 76 | public : SC_OUT(Tcontrol_t) ** out_PUSH_GPR_ACK ; |
---|
| 77 | public : SC_IN (Tgeneral_address_t) ** in_PUSH_GPR_NUM_REG; |
---|
| 78 | |
---|
| 79 | // ~~~~~[ interface : "push_spr" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
| 80 | public : SC_IN (Tcontrol_t) ** in_PUSH_SPR_VAL ; // spr_free (cf stat_list) |
---|
| 81 | public : SC_OUT(Tcontrol_t) ** out_PUSH_SPR_ACK ; |
---|
| 82 | public : SC_IN (Tspecial_address_t) ** in_PUSH_SPR_NUM_REG; |
---|
| 83 | |
---|
| 84 | // ~~~~~[ Component ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
| 85 | |
---|
| 86 | // ~~~~~[ Register ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
| 87 | private : std::list<Tgeneral_address_t> * _gpr_list; //[nb_bank] |
---|
| 88 | private : std::list<Tspecial_address_t> * _spr_list; //[nb_bank] |
---|
| 89 | |
---|
| 90 | // ~~~~~[ Internal ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
[108] | 91 | private : uint32_t reg_BANK_PRIORITY; |
---|
[78] | 92 | |
---|
| 93 | private : Tcontrol_t * internal_POP_ACK ; //[nb_pop] |
---|
| 94 | private : uint32_t * internal_POP_GPR_BANK ; //[nb_pop] |
---|
| 95 | private : uint32_t * internal_POP_SPR_BANK ; //[nb_pop] |
---|
| 96 | |
---|
| 97 | private : Tcontrol_t * internal_PUSH_GPR_ACK ; //[nb_push] |
---|
| 98 | private : Tcontrol_t * internal_PUSH_SPR_ACK ; //[nb_push] |
---|
| 99 | private : uint32_t * internal_PUSH_GPR_BANK; //[nb_push] |
---|
| 100 | private : uint32_t * internal_PUSH_SPR_BANK; //[nb_push] |
---|
| 101 | #endif |
---|
| 102 | |
---|
| 103 | // -----[ Methods ]--------------------------------------------------- |
---|
| 104 | |
---|
| 105 | #ifdef SYSTEMC |
---|
| 106 | SC_HAS_PROCESS (Free_List_unit); |
---|
| 107 | #endif |
---|
| 108 | public : Free_List_unit |
---|
| 109 | ( |
---|
| 110 | #ifdef SYSTEMC |
---|
| 111 | sc_module_name name, |
---|
| 112 | #else |
---|
| 113 | std::string name, |
---|
| 114 | #endif |
---|
| 115 | #ifdef STATISTICS |
---|
| 116 | morpheo::behavioural::Parameters_Statistics * param_statistics, |
---|
| 117 | #endif |
---|
| 118 | Parameters * param, |
---|
[82] | 119 | morpheo::behavioural::Tusage_t usage |
---|
[78] | 120 | ); |
---|
| 121 | public : ~Free_List_unit (void); |
---|
| 122 | |
---|
| 123 | private : void allocation ( |
---|
| 124 | #ifdef STATISTICS |
---|
| 125 | morpheo::behavioural::Parameters_Statistics * param_statistics |
---|
| 126 | #else |
---|
| 127 | void |
---|
| 128 | #endif |
---|
| 129 | ); |
---|
| 130 | private : void deallocation (void); |
---|
| 131 | |
---|
| 132 | #ifdef SYSTEMC |
---|
| 133 | public : void transition (void); |
---|
| 134 | public : void genMealy_pop (void); |
---|
| 135 | public : void genMealy_push_gpr (void); |
---|
| 136 | public : void genMealy_push_spr (void); |
---|
| 137 | #endif |
---|
| 138 | |
---|
| 139 | #if VHDL |
---|
| 140 | public : void vhdl (void); |
---|
| 141 | private : void vhdl_declaration (Vhdl * & vhdl); |
---|
| 142 | private : void vhdl_body (Vhdl * & vhdl); |
---|
| 143 | #endif |
---|
| 144 | |
---|
| 145 | #ifdef STATISTICS |
---|
| 146 | public : void statistics_declaration (morpheo::behavioural::Parameters_Statistics * param_statistics); |
---|
| 147 | #endif |
---|
| 148 | #if defined(STATISTICS) or defined(VHDL_TESTBENCH) |
---|
| 149 | private : void end_cycle (void); |
---|
| 150 | #endif |
---|
| 151 | }; |
---|
| 152 | |
---|
| 153 | }; // end namespace free_list_unit |
---|
| 154 | }; // end namespace register_translation_unit |
---|
| 155 | }; // end namespace rename_unit |
---|
| 156 | }; // end namespace ooo_engine |
---|
| 157 | }; // end namespace multi_ooo_engine |
---|
| 158 | }; // end namespace core |
---|
| 159 | |
---|
| 160 | }; // end namespace behavioural |
---|
| 161 | }; // end namespace morpheo |
---|
| 162 | |
---|
| 163 | #endif |
---|