[78] | 1 | /* |
---|
| 2 | * $Id: Register_translation_unit_Glue.cpp 81 2008-04-15 18:40:01Z rosiere $ |
---|
| 3 | * |
---|
| 4 | * [ Description ] |
---|
| 5 | * |
---|
| 6 | */ |
---|
| 7 | |
---|
| 8 | #include "Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Rename_unit/Register_translation_unit/Register_translation_unit_Glue/include/Register_translation_unit_Glue.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 register_translation_unit_glue { |
---|
| 18 | |
---|
| 19 | |
---|
| 20 | #undef FUNCTION |
---|
| 21 | #define FUNCTION "Register_translation_unit_Glue::Register_translation_unit_Glue" |
---|
| 22 | Register_translation_unit_Glue::Register_translation_unit_Glue |
---|
| 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::register_translation_unit_glue::Parameters * param, |
---|
| 33 | morpheo::behavioural::Tusage_t usage |
---|
| 34 | ): |
---|
| 35 | _name (name) |
---|
| 36 | ,_param (param) |
---|
| 37 | ,_usage (usage) |
---|
| 38 | { |
---|
| 39 | log_printf(FUNC,Register_translation_unit_Glue,FUNCTION,"Begin"); |
---|
| 40 | |
---|
| 41 | log_printf(INFO,Register_translation_unit_Glue,FUNCTION,"Allocation"); |
---|
| 42 | |
---|
| 43 | allocation ( |
---|
| 44 | #ifdef STATISTICS |
---|
| 45 | param_statistics |
---|
| 46 | #endif |
---|
| 47 | ); |
---|
| 48 | |
---|
| 49 | #ifdef STATISTICS |
---|
| 50 | if (_usage & USE_STATISTICS) |
---|
| 51 | { |
---|
| 52 | log_printf(INFO,Register_translation_unit_Glue,FUNCTION,"Allocation of statistics"); |
---|
| 53 | |
---|
| 54 | statistics_declaration(param_statistics); |
---|
| 55 | } |
---|
| 56 | #endif |
---|
| 57 | |
---|
| 58 | #ifdef VHDL |
---|
| 59 | if (_usage & USE_VHDL) |
---|
| 60 | { |
---|
| 61 | // generate the vhdl |
---|
| 62 | log_printf(INFO,Register_translation_unit_Glue,FUNCTION,"Generate the vhdl"); |
---|
| 63 | |
---|
| 64 | vhdl(); |
---|
| 65 | } |
---|
| 66 | #endif |
---|
| 67 | |
---|
| 68 | #ifdef SYSTEMC |
---|
| 69 | if (_usage & USE_SYSTEMC) |
---|
| 70 | { |
---|
| 71 | log_printf(INFO,Register_translation_unit_Glue,FUNCTION,"Method - transition"); |
---|
| 72 | |
---|
| 73 | SC_METHOD (transition); |
---|
| 74 | dont_initialize (); |
---|
| 75 | sensitive << (*(in_CLOCK)).pos(); |
---|
| 76 | |
---|
| 77 | # ifdef SYSTEMCASS_SPECIFIC |
---|
| 78 | // List dependency information |
---|
| 79 | # endif |
---|
| 80 | |
---|
| 81 | log_printf(INFO,Register_translation_unit_Glue,FUNCTION,"Method - genMealy_retire"); |
---|
| 82 | |
---|
| 83 | SC_METHOD (genMealy_retire); |
---|
| 84 | dont_initialize (); |
---|
| 85 | // sensitive << (*(in_CLOCK)).neg(); |
---|
| 86 | for (uint32_t i=0; i<_param->_nb_inst_retire; i++) |
---|
| 87 | sensitive << (*(in_RETIRE_VAL [i])) |
---|
| 88 | << (*(in_RETIRE_RAT_ACK [i])) |
---|
| 89 | << (*(in_RETIRE_STAT_LIST_ACK [i])); |
---|
| 90 | |
---|
| 91 | # ifdef SYSTEMCASS_SPECIFIC |
---|
| 92 | // List dependency information |
---|
| 93 | for (uint32_t i=0; i<_param->_nb_inst_retire; i++) |
---|
| 94 | { |
---|
| 95 | (*(out_RETIRE_ACK [i])) (*(in_RETIRE_RAT_ACK [i])); |
---|
| 96 | (*(out_RETIRE_ACK [i])) (*(in_RETIRE_STAT_LIST_ACK [i])); |
---|
| 97 | |
---|
| 98 | (*(out_RETIRE_RAT_VAL [i])) (*(in_RETIRE_VAL [i])); |
---|
| 99 | (*(out_RETIRE_RAT_VAL [i])) (*(in_RETIRE_STAT_LIST_ACK [i])); |
---|
| 100 | |
---|
| 101 | (*(out_RETIRE_STAT_LIST_VAL [i])) (*(in_RETIRE_VAL [i])); |
---|
| 102 | (*(out_RETIRE_STAT_LIST_VAL [i])) (*(in_RETIRE_RAT_ACK [i])); |
---|
| 103 | } |
---|
| 104 | # endif |
---|
| 105 | |
---|
| 106 | log_printf(INFO,Register_translation_unit_Glue,FUNCTION,"Method - genMealy_insert"); |
---|
| 107 | |
---|
| 108 | SC_METHOD (genMealy_insert); |
---|
| 109 | dont_initialize (); |
---|
| 110 | // sensitive << (*(in_CLOCK)).neg(); |
---|
| 111 | for (uint32_t i=0; i<_param->_nb_inst_insert; i++) |
---|
| 112 | sensitive << (*(in_INSERT_RENAME_VAL [i])) |
---|
| 113 | << (*(in_INSERT_INSERT_ACK [i])) |
---|
| 114 | << (*(in_INSERT_RAT_RENAME_ACK [i])) |
---|
| 115 | << (*(in_INSERT_RAT_INSERT_ACK [i])) |
---|
| 116 | << (*(in_INSERT_FREE_LIST_ACK [i])) |
---|
| 117 | << (*(in_INSERT_STAT_LIST_ACK [i])); |
---|
| 118 | |
---|
| 119 | # ifdef SYSTEMCASS_SPECIFIC |
---|
| 120 | // List dependency information |
---|
| 121 | for (uint32_t i=0; i<_param->_nb_inst_insert; i++) |
---|
| 122 | { |
---|
| 123 | (*(out_INSERT_RENAME_ACK [i])) (*(in_INSERT_INSERT_ACK [i])); |
---|
| 124 | (*(out_INSERT_RENAME_ACK [i])) (*(in_INSERT_RAT_RENAME_ACK [i])); |
---|
| 125 | (*(out_INSERT_RENAME_ACK [i])) (*(in_INSERT_RAT_INSERT_ACK [i])); |
---|
| 126 | (*(out_INSERT_RENAME_ACK [i])) (*(in_INSERT_FREE_LIST_ACK [i])); |
---|
| 127 | (*(out_INSERT_RENAME_ACK [i])) (*(in_INSERT_STAT_LIST_ACK [i])); |
---|
| 128 | |
---|
| 129 | (*(out_INSERT_INSERT_VAL [i])) (*(in_INSERT_RENAME_VAL [i])); |
---|
| 130 | (*(out_INSERT_INSERT_VAL [i])) (*(in_INSERT_RAT_RENAME_ACK [i])); |
---|
| 131 | (*(out_INSERT_INSERT_VAL [i])) (*(in_INSERT_RAT_INSERT_ACK [i])); |
---|
| 132 | (*(out_INSERT_INSERT_VAL [i])) (*(in_INSERT_FREE_LIST_ACK [i])); |
---|
| 133 | (*(out_INSERT_INSERT_VAL [i])) (*(in_INSERT_STAT_LIST_ACK [i])); |
---|
| 134 | |
---|
| 135 | (*(out_INSERT_RAT_INSERT_VAL [i])) (*(in_INSERT_RENAME_VAL [i])); |
---|
| 136 | (*(out_INSERT_RAT_INSERT_VAL [i])) (*(in_INSERT_INSERT_ACK [i])); |
---|
| 137 | (*(out_INSERT_RAT_INSERT_VAL [i])) (*(in_INSERT_RAT_RENAME_ACK [i])); |
---|
| 138 | (*(out_INSERT_RAT_INSERT_VAL [i])) (*(in_INSERT_FREE_LIST_ACK [i])); |
---|
| 139 | (*(out_INSERT_RAT_INSERT_VAL [i])) (*(in_INSERT_STAT_LIST_ACK [i])); |
---|
| 140 | |
---|
| 141 | (*(out_INSERT_FREE_LIST_VAL [i])) (*(in_INSERT_RENAME_VAL [i])); |
---|
| 142 | (*(out_INSERT_FREE_LIST_VAL [i])) (*(in_INSERT_INSERT_ACK [i])); |
---|
| 143 | (*(out_INSERT_FREE_LIST_VAL [i])) (*(in_INSERT_RAT_RENAME_ACK [i])); |
---|
| 144 | (*(out_INSERT_FREE_LIST_VAL [i])) (*(in_INSERT_RAT_INSERT_ACK [i])); |
---|
| 145 | (*(out_INSERT_FREE_LIST_VAL [i])) (*(in_INSERT_STAT_LIST_ACK [i])); |
---|
| 146 | |
---|
| 147 | (*(out_INSERT_STAT_LIST_VAL [i])) (*(in_INSERT_RENAME_VAL [i])); |
---|
| 148 | (*(out_INSERT_STAT_LIST_VAL [i])) (*(in_INSERT_INSERT_ACK [i])); |
---|
| 149 | (*(out_INSERT_STAT_LIST_VAL [i])) (*(in_INSERT_RAT_RENAME_ACK [i])); |
---|
| 150 | (*(out_INSERT_STAT_LIST_VAL [i])) (*(in_INSERT_RAT_INSERT_ACK [i])); |
---|
| 151 | (*(out_INSERT_STAT_LIST_VAL [i])) (*(in_INSERT_FREE_LIST_ACK [i])); |
---|
| 152 | } |
---|
| 153 | # endif |
---|
| 154 | |
---|
| 155 | #endif |
---|
| 156 | } |
---|
| 157 | log_printf(FUNC,Register_translation_unit_Glue,FUNCTION,"End"); |
---|
| 158 | }; |
---|
| 159 | |
---|
| 160 | #undef FUNCTION |
---|
| 161 | #define FUNCTION "Register_translation_unit_Glue::~Register_translation_unit_Glue" |
---|
| 162 | Register_translation_unit_Glue::~Register_translation_unit_Glue (void) |
---|
| 163 | { |
---|
| 164 | log_printf(FUNC,Register_translation_unit_Glue,FUNCTION,"Begin"); |
---|
| 165 | |
---|
| 166 | #ifdef STATISTICS |
---|
| 167 | if (_usage & USE_STATISTICS) |
---|
| 168 | { |
---|
| 169 | log_printf(INFO,Register_translation_unit_Glue,FUNCTION,"Generate Statistics file"); |
---|
| 170 | |
---|
| 171 | delete _stat; |
---|
| 172 | } |
---|
| 173 | #endif |
---|
| 174 | |
---|
| 175 | log_printf(INFO,Register_translation_unit_Glue,FUNCTION,"Deallocation"); |
---|
| 176 | deallocation (); |
---|
| 177 | |
---|
| 178 | log_printf(FUNC,Register_translation_unit_Glue,FUNCTION,"End"); |
---|
| 179 | }; |
---|
| 180 | |
---|
| 181 | }; // end namespace register_translation_unit_glue |
---|
| 182 | }; // end namespace register_translation_unit |
---|
| 183 | }; // end namespace rename_unit |
---|
| 184 | }; // end namespace ooo_engine |
---|
| 185 | }; // end namespace multi_ooo_engine |
---|
| 186 | }; // end namespace core |
---|
| 187 | |
---|
| 188 | }; // end namespace behavioural |
---|
| 189 | }; // end namespace morpheo |
---|