[78] | 1 | /* |
---|
| 2 | * $Id: Free_List_unit.cpp 110 2009-02-19 16:31:47Z rosiere $ |
---|
| 3 | * |
---|
| 4 | * [ Description ] |
---|
| 5 | * |
---|
| 6 | */ |
---|
| 7 | |
---|
| 8 | #include "Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Rename_unit/Register_translation_unit/Free_List_unit/include/Free_List_unit.h" |
---|
| 9 | |
---|
| 10 | namespace morpheo { |
---|
| 11 | namespace behavioural { |
---|
| 12 | namespace core { |
---|
| 13 | namespace multi_ooo_engine { |
---|
| 14 | namespace ooo_engine { |
---|
| 15 | namespace rename_unit { |
---|
| 16 | namespace register_translation_unit { |
---|
| 17 | namespace free_list_unit { |
---|
| 18 | |
---|
| 19 | |
---|
| 20 | #undef FUNCTION |
---|
| 21 | #define FUNCTION "Free_List_unit::Free_List_unit" |
---|
| 22 | Free_List_unit::Free_List_unit |
---|
| 23 | ( |
---|
| 24 | #ifdef SYSTEMC |
---|
| 25 | sc_module_name name, |
---|
| 26 | #else |
---|
| 27 | string name, |
---|
| 28 | #endif |
---|
| 29 | #ifdef STATISTICS |
---|
| 30 | morpheo::behavioural::Parameters_Statistics * param_statistics, |
---|
| 31 | #endif |
---|
| 32 | morpheo::behavioural::core::multi_ooo_engine::ooo_engine::rename_unit::register_translation_unit::free_list_unit::Parameters * param, |
---|
| 33 | morpheo::behavioural::Tusage_t usage |
---|
| 34 | ): |
---|
| 35 | _name (name) |
---|
| 36 | ,_param (param) |
---|
| 37 | ,_usage (usage) |
---|
| 38 | { |
---|
| 39 | log_printf(FUNC,Free_List_unit,FUNCTION,"Begin"); |
---|
| 40 | |
---|
[88] | 41 | #if DEBUG_Free_List_unit == true |
---|
| 42 | log_printf(INFO,Free_List_unit,FUNCTION,_("<%s> Parameters"),_name.c_str()); |
---|
| 43 | |
---|
| 44 | std::cout << *param << std::endl; |
---|
| 45 | #endif |
---|
| 46 | |
---|
[78] | 47 | log_printf(INFO,Free_List_unit,FUNCTION,"Allocation"); |
---|
| 48 | |
---|
| 49 | allocation ( |
---|
| 50 | #ifdef STATISTICS |
---|
| 51 | param_statistics |
---|
| 52 | #endif |
---|
| 53 | ); |
---|
| 54 | |
---|
| 55 | #ifdef STATISTICS |
---|
[88] | 56 | if (usage_is_set(_usage,USE_STATISTICS)) |
---|
[78] | 57 | { |
---|
| 58 | log_printf(INFO,Free_List_unit,FUNCTION,"Allocation of statistics"); |
---|
| 59 | |
---|
[110] | 60 | statistics_allocation(param_statistics); |
---|
[78] | 61 | } |
---|
| 62 | #endif |
---|
| 63 | |
---|
| 64 | #ifdef VHDL |
---|
[88] | 65 | if (usage_is_set(_usage,USE_VHDL)) |
---|
[78] | 66 | { |
---|
| 67 | // generate the vhdl |
---|
| 68 | log_printf(INFO,Free_List_unit,FUNCTION,"Generate the vhdl"); |
---|
| 69 | |
---|
| 70 | vhdl(); |
---|
| 71 | } |
---|
| 72 | #endif |
---|
| 73 | |
---|
| 74 | #ifdef SYSTEMC |
---|
[88] | 75 | if (usage_is_set(_usage,USE_SYSTEMC)) |
---|
[78] | 76 | { |
---|
| 77 | log_printf(INFO,Free_List_unit,FUNCTION,"Method - transition"); |
---|
| 78 | |
---|
| 79 | SC_METHOD (transition); |
---|
| 80 | dont_initialize (); |
---|
| 81 | sensitive << (*(in_CLOCK)).pos(); |
---|
| 82 | |
---|
| 83 | # ifdef SYSTEMCASS_SPECIFIC |
---|
| 84 | // List dependency information |
---|
| 85 | # endif |
---|
| 86 | |
---|
| 87 | log_printf(INFO,Free_List_unit,FUNCTION,"Method - genMealy_pop"); |
---|
| 88 | |
---|
| 89 | SC_METHOD (genMealy_pop); |
---|
| 90 | dont_initialize (); |
---|
[88] | 91 | sensitive << (*(in_CLOCK)).neg(); // need internal register |
---|
[78] | 92 | for (uint32_t i=0; i<_param->_nb_pop; i++) |
---|
| 93 | sensitive << (*(in_POP_GPR_VAL[i])) |
---|
| 94 | << (*(in_POP_SPR_VAL[i])); |
---|
| 95 | |
---|
| 96 | # ifdef SYSTEMCASS_SPECIFIC |
---|
| 97 | // List dependency information |
---|
| 98 | |
---|
| 99 | for (uint32_t i=0; i<_param->_nb_pop; i++) |
---|
| 100 | { |
---|
| 101 | (*(out_POP_GPR_NUM_REG [i])) (*(in_POP_GPR_VAL[i])); |
---|
| 102 | (*(out_POP_SPR_NUM_REG [i])) (*(in_POP_SPR_VAL[i])); |
---|
| 103 | (*(out_POP_ACK [i])) (*(in_POP_GPR_VAL[i])); |
---|
| 104 | (*(out_POP_ACK [i])) (*(in_POP_SPR_VAL[i])); |
---|
| 105 | } |
---|
| 106 | # endif |
---|
| 107 | |
---|
| 108 | log_printf(INFO,Free_List_unit,FUNCTION,"Method - genMealy_push_gpr"); |
---|
| 109 | |
---|
| 110 | SC_METHOD (genMealy_push_gpr); |
---|
| 111 | dont_initialize (); |
---|
[88] | 112 | sensitive << (*(in_CLOCK)).neg(); // need internal register |
---|
[78] | 113 | for (uint32_t i=0; i<_param->_nb_push; i++) |
---|
| 114 | sensitive << (*(in_PUSH_GPR_VAL [i])) |
---|
| 115 | << (*(in_PUSH_GPR_NUM_REG[i])); |
---|
| 116 | |
---|
| 117 | # ifdef SYSTEMCASS_SPECIFIC |
---|
| 118 | // List dependency information |
---|
| 119 | |
---|
| 120 | for (uint32_t i=0; i<_param->_nb_push; i++) |
---|
| 121 | { |
---|
| 122 | (*(out_PUSH_GPR_ACK [i])) (*(in_PUSH_GPR_VAL [i])); |
---|
| 123 | (*(out_PUSH_GPR_ACK [i])) (*(in_PUSH_GPR_NUM_REG[i])); |
---|
| 124 | } |
---|
| 125 | # endif |
---|
| 126 | |
---|
| 127 | log_printf(INFO,Free_List_unit,FUNCTION,"Method - genMealy_push_spr"); |
---|
| 128 | |
---|
| 129 | SC_METHOD (genMealy_push_spr); |
---|
| 130 | dont_initialize (); |
---|
[88] | 131 | sensitive << (*(in_CLOCK)).neg(); // need internal register |
---|
[78] | 132 | for (uint32_t i=0; i<_param->_nb_push; i++) |
---|
| 133 | sensitive << (*(in_PUSH_SPR_VAL [i])) |
---|
| 134 | << (*(in_PUSH_SPR_NUM_REG[i])); |
---|
| 135 | |
---|
| 136 | # ifdef SYSTEMCASS_SPECIFIC |
---|
| 137 | // List dependency information |
---|
| 138 | |
---|
| 139 | for (uint32_t i=0; i<_param->_nb_push; i++) |
---|
| 140 | { |
---|
| 141 | (*(out_PUSH_SPR_ACK [i])) (*(in_PUSH_SPR_VAL [i])); |
---|
| 142 | (*(out_PUSH_SPR_ACK [i])) (*(in_PUSH_SPR_NUM_REG[i])); |
---|
| 143 | } |
---|
| 144 | # endif |
---|
| 145 | |
---|
| 146 | #endif |
---|
| 147 | } |
---|
| 148 | log_printf(FUNC,Free_List_unit,FUNCTION,"End"); |
---|
| 149 | }; |
---|
| 150 | |
---|
| 151 | #undef FUNCTION |
---|
| 152 | #define FUNCTION "Free_List_unit::~Free_List_unit" |
---|
| 153 | Free_List_unit::~Free_List_unit (void) |
---|
| 154 | { |
---|
| 155 | log_printf(FUNC,Free_List_unit,FUNCTION,"Begin"); |
---|
| 156 | |
---|
| 157 | #ifdef STATISTICS |
---|
[88] | 158 | if (usage_is_set(_usage,USE_STATISTICS)) |
---|
[110] | 159 | statistics_deallocation (); |
---|
| 160 | |
---|
[78] | 161 | #endif |
---|
| 162 | |
---|
| 163 | log_printf(INFO,Free_List_unit,FUNCTION,"Deallocation"); |
---|
| 164 | deallocation (); |
---|
| 165 | |
---|
| 166 | log_printf(FUNC,Free_List_unit,FUNCTION,"End"); |
---|
| 167 | }; |
---|
| 168 | |
---|
| 169 | }; // end namespace free_list_unit |
---|
| 170 | }; // end namespace register_translation_unit |
---|
| 171 | }; // end namespace rename_unit |
---|
| 172 | }; // end namespace ooo_engine |
---|
| 173 | }; // end namespace multi_ooo_engine |
---|
| 174 | }; // end namespace core |
---|
| 175 | |
---|
| 176 | }; // end namespace behavioural |
---|
| 177 | }; // end namespace morpheo |
---|