[78] | 1 | /* |
---|
| 2 | * $Id: Free_List_unit.cpp 123 2009-06-08 20:43:30Z 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 | |
---|
[123] | 41 | // #if DEBUG_Free_List_unit == true |
---|
| 42 | // log_printf(INFO,Free_List_unit,FUNCTION,_("<%s> Parameters"),_name.c_str()); |
---|
[88] | 43 | |
---|
[123] | 44 | // std::cout << *param << std::endl; |
---|
| 45 | // #endif |
---|
[88] | 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 | |
---|
[123] | 87 | #ifdef DEBUG_TEST |
---|
| 88 | log_printf(INFO,Free_List_unit,FUNCTION,"Method - genMoore"); |
---|
| 89 | |
---|
| 90 | SC_METHOD (genMoore); |
---|
| 91 | dont_initialize (); |
---|
| 92 | sensitive << (*(in_CLOCK)).neg(); |
---|
| 93 | |
---|
| 94 | # ifdef SYSTEMCASS_SPECIFIC |
---|
| 95 | // List dependency information |
---|
| 96 | # endif |
---|
| 97 | #endif |
---|
[78] | 98 | log_printf(INFO,Free_List_unit,FUNCTION,"Method - genMealy_pop"); |
---|
| 99 | |
---|
| 100 | SC_METHOD (genMealy_pop); |
---|
| 101 | dont_initialize (); |
---|
[88] | 102 | sensitive << (*(in_CLOCK)).neg(); // need internal register |
---|
[78] | 103 | for (uint32_t i=0; i<_param->_nb_pop; i++) |
---|
| 104 | sensitive << (*(in_POP_GPR_VAL[i])) |
---|
| 105 | << (*(in_POP_SPR_VAL[i])); |
---|
| 106 | |
---|
| 107 | # ifdef SYSTEMCASS_SPECIFIC |
---|
| 108 | // List dependency information |
---|
| 109 | |
---|
| 110 | for (uint32_t i=0; i<_param->_nb_pop; i++) |
---|
| 111 | { |
---|
| 112 | (*(out_POP_GPR_NUM_REG [i])) (*(in_POP_GPR_VAL[i])); |
---|
| 113 | (*(out_POP_SPR_NUM_REG [i])) (*(in_POP_SPR_VAL[i])); |
---|
| 114 | (*(out_POP_ACK [i])) (*(in_POP_GPR_VAL[i])); |
---|
| 115 | (*(out_POP_ACK [i])) (*(in_POP_SPR_VAL[i])); |
---|
| 116 | } |
---|
| 117 | # endif |
---|
| 118 | |
---|
| 119 | log_printf(INFO,Free_List_unit,FUNCTION,"Method - genMealy_push_gpr"); |
---|
| 120 | |
---|
| 121 | SC_METHOD (genMealy_push_gpr); |
---|
| 122 | dont_initialize (); |
---|
[88] | 123 | sensitive << (*(in_CLOCK)).neg(); // need internal register |
---|
[78] | 124 | for (uint32_t i=0; i<_param->_nb_push; i++) |
---|
| 125 | sensitive << (*(in_PUSH_GPR_VAL [i])) |
---|
| 126 | << (*(in_PUSH_GPR_NUM_REG[i])); |
---|
| 127 | |
---|
| 128 | # ifdef SYSTEMCASS_SPECIFIC |
---|
| 129 | // List dependency information |
---|
| 130 | |
---|
| 131 | for (uint32_t i=0; i<_param->_nb_push; i++) |
---|
| 132 | { |
---|
| 133 | (*(out_PUSH_GPR_ACK [i])) (*(in_PUSH_GPR_VAL [i])); |
---|
| 134 | (*(out_PUSH_GPR_ACK [i])) (*(in_PUSH_GPR_NUM_REG[i])); |
---|
| 135 | } |
---|
| 136 | # endif |
---|
| 137 | |
---|
| 138 | log_printf(INFO,Free_List_unit,FUNCTION,"Method - genMealy_push_spr"); |
---|
| 139 | |
---|
| 140 | SC_METHOD (genMealy_push_spr); |
---|
| 141 | dont_initialize (); |
---|
[88] | 142 | sensitive << (*(in_CLOCK)).neg(); // need internal register |
---|
[78] | 143 | for (uint32_t i=0; i<_param->_nb_push; i++) |
---|
| 144 | sensitive << (*(in_PUSH_SPR_VAL [i])) |
---|
| 145 | << (*(in_PUSH_SPR_NUM_REG[i])); |
---|
| 146 | |
---|
| 147 | # ifdef SYSTEMCASS_SPECIFIC |
---|
| 148 | // List dependency information |
---|
| 149 | |
---|
| 150 | for (uint32_t i=0; i<_param->_nb_push; i++) |
---|
| 151 | { |
---|
| 152 | (*(out_PUSH_SPR_ACK [i])) (*(in_PUSH_SPR_VAL [i])); |
---|
| 153 | (*(out_PUSH_SPR_ACK [i])) (*(in_PUSH_SPR_NUM_REG[i])); |
---|
| 154 | } |
---|
| 155 | # endif |
---|
| 156 | |
---|
| 157 | #endif |
---|
| 158 | } |
---|
| 159 | log_printf(FUNC,Free_List_unit,FUNCTION,"End"); |
---|
| 160 | }; |
---|
| 161 | |
---|
| 162 | #undef FUNCTION |
---|
| 163 | #define FUNCTION "Free_List_unit::~Free_List_unit" |
---|
| 164 | Free_List_unit::~Free_List_unit (void) |
---|
| 165 | { |
---|
| 166 | log_printf(FUNC,Free_List_unit,FUNCTION,"Begin"); |
---|
| 167 | |
---|
| 168 | #ifdef STATISTICS |
---|
[88] | 169 | if (usage_is_set(_usage,USE_STATISTICS)) |
---|
[110] | 170 | statistics_deallocation (); |
---|
| 171 | |
---|
[78] | 172 | #endif |
---|
| 173 | |
---|
| 174 | log_printf(INFO,Free_List_unit,FUNCTION,"Deallocation"); |
---|
| 175 | deallocation (); |
---|
| 176 | |
---|
| 177 | log_printf(FUNC,Free_List_unit,FUNCTION,"End"); |
---|
| 178 | }; |
---|
| 179 | |
---|
| 180 | }; // end namespace free_list_unit |
---|
| 181 | }; // end namespace register_translation_unit |
---|
| 182 | }; // end namespace rename_unit |
---|
| 183 | }; // end namespace ooo_engine |
---|
| 184 | }; // end namespace multi_ooo_engine |
---|
| 185 | }; // end namespace core |
---|
| 186 | |
---|
| 187 | }; // end namespace behavioural |
---|
| 188 | }; // end namespace morpheo |
---|