[59] | 1 | /* |
---|
| 2 | * $Id$ |
---|
| 3 | * |
---|
| 4 | * [ Description ] |
---|
| 5 | * |
---|
| 6 | */ |
---|
| 7 | |
---|
| 8 | #include "Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Execute_unit/Execute_unit/Load_store_unit/include/Load_store_unit.h" |
---|
| 9 | |
---|
| 10 | namespace morpheo { |
---|
| 11 | namespace behavioural { |
---|
| 12 | namespace core { |
---|
| 13 | namespace multi_execute_loop { |
---|
| 14 | namespace execute_loop { |
---|
| 15 | namespace multi_execute_unit { |
---|
| 16 | namespace execute_unit { |
---|
| 17 | namespace load_store_unit { |
---|
| 18 | |
---|
| 19 | |
---|
| 20 | #undef FUNCTION |
---|
| 21 | #define FUNCTION "Load_store_unit::Load_store_unit" |
---|
| 22 | #ifdef SYSTEMC |
---|
| 23 | Load_store_unit::Load_store_unit (sc_module_name name, |
---|
| 24 | #else |
---|
| 25 | Load_store_unit::Load_store_unit (string name, |
---|
| 26 | #endif |
---|
| 27 | #ifdef STATISTICS |
---|
| 28 | morpheo::behavioural::Parameters_Statistics * param_statistics, |
---|
| 29 | #endif |
---|
| 30 | morpheo::behavioural::core::multi_execute_loop::execute_loop::multi_execute_unit::execute_unit::load_store_unit::Parameters * param ): |
---|
| 31 | _name (name) |
---|
| 32 | ,_param (param) |
---|
| 33 | { |
---|
| 34 | log_printf(FUNC,Load_store_unit,FUNCTION,"Begin"); |
---|
| 35 | |
---|
| 36 | #ifdef SYSTEMC |
---|
| 37 | log_printf(INFO,Load_store_unit,FUNCTION,"Allocation"); |
---|
| 38 | |
---|
| 39 | allocation (); |
---|
| 40 | #endif |
---|
| 41 | |
---|
| 42 | #ifdef STATISTICS |
---|
| 43 | log_printf(INFO,Load_store_unit,FUNCTION,"Allocation of statistics"); |
---|
| 44 | |
---|
[71] | 45 | statistics_declaration(param_statistics); |
---|
[59] | 46 | #endif |
---|
| 47 | |
---|
| 48 | #ifdef VHDL |
---|
| 49 | // generate the vhdl |
---|
| 50 | log_printf(INFO,Load_store_unit,FUNCTION,"Generate the vhdl"); |
---|
| 51 | |
---|
| 52 | vhdl(); |
---|
| 53 | #endif |
---|
| 54 | |
---|
| 55 | #ifdef SYSTEMC |
---|
| 56 | // Function pointer |
---|
| 57 | |
---|
| 58 | switch (_param->_speculative_load) |
---|
| 59 | { |
---|
| 60 | case SPECULATIVE_LOAD_COMMIT : |
---|
| 61 | { |
---|
| 62 | function_transition = &morpheo::behavioural::core::multi_execute_loop::execute_loop::multi_execute_unit::execute_unit::load_store_unit::Load_store_unit::function_speculative_load_commit_transition ; |
---|
| 63 | function_genMoore = &morpheo::behavioural::core::multi_execute_loop::execute_loop::multi_execute_unit::execute_unit::load_store_unit::Load_store_unit::function_speculative_load_commit_genMoore ; |
---|
| 64 | function_genMealy_dcache = &morpheo::behavioural::core::multi_execute_loop::execute_loop::multi_execute_unit::execute_unit::load_store_unit::Load_store_unit::function_speculative_load_commit_genMealy_dcache; |
---|
| 65 | function_genMealy_insert = &morpheo::behavioural::core::multi_execute_loop::execute_loop::multi_execute_unit::execute_unit::load_store_unit::Load_store_unit::function_speculative_load_commit_genMealy_insert; |
---|
| 66 | function_genMealy_retire = &morpheo::behavioural::core::multi_execute_loop::execute_loop::multi_execute_unit::execute_unit::load_store_unit::Load_store_unit::function_speculative_load_commit_genMealy_retire; |
---|
| 67 | break; |
---|
| 68 | } |
---|
| 69 | case NO_SPECULATIVE_LOAD : |
---|
| 70 | case SPECULATIVE_LOAD_ACCESS : |
---|
| 71 | case SPECULATIVE_LOAD_BYPASS : |
---|
| 72 | default : |
---|
| 73 | { |
---|
| 74 | break; |
---|
| 75 | } |
---|
| 76 | } |
---|
| 77 | |
---|
[71] | 78 | log_printf(INFO,Load_store_unit,FUNCTION,"Constant affectation"); |
---|
| 79 | |
---|
| 80 | internal_DCACHE_RSP_ACK = 1; |
---|
| 81 | PORT_WRITE(out_DCACHE_RSP_ACK, 1); |
---|
| 82 | |
---|
[59] | 83 | log_printf(INFO,Load_store_unit,FUNCTION,"Method - transition"); |
---|
| 84 | |
---|
| 85 | SC_METHOD (transition); |
---|
| 86 | dont_initialize (); |
---|
| 87 | sensitive_pos << *(in_CLOCK); |
---|
| 88 | |
---|
| 89 | #ifdef SYSTEMCASS_SPECIFIC |
---|
| 90 | // List dependency information |
---|
| 91 | #endif |
---|
| 92 | |
---|
| 93 | log_printf(INFO,Load_store_unit,FUNCTION,"Method - genMoore"); |
---|
| 94 | |
---|
| 95 | SC_METHOD (genMoore); |
---|
| 96 | dont_initialize (); |
---|
| 97 | sensitive_neg << *(in_CLOCK); |
---|
| 98 | |
---|
| 99 | #ifdef SYSTEMCASS_SPECIFIC |
---|
| 100 | // List dependency information |
---|
| 101 | #endif |
---|
| 102 | |
---|
| 103 | log_printf(INFO,Load_store_unit,FUNCTION,"Method - genMealy_insert"); |
---|
| 104 | |
---|
| 105 | SC_METHOD (genMealy_insert); |
---|
| 106 | dont_initialize (); |
---|
| 107 | sensitive_neg << *(in_CLOCK); |
---|
| 108 | sensitive << *(in_MEMORY_IN_OPERATION); |
---|
| 109 | |
---|
| 110 | #ifdef SYSTEMCASS_SPECIFIC |
---|
| 111 | // List dependency information |
---|
| 112 | (*(out_MEMORY_IN_ACK)) (*(in_MEMORY_IN_OPERATION)); |
---|
| 113 | #endif |
---|
| 114 | |
---|
| 115 | log_printf(INFO,Load_store_unit,FUNCTION,"Method - genMealy_retire"); |
---|
| 116 | |
---|
| 117 | SC_METHOD (genMealy_retire); |
---|
| 118 | dont_initialize (); |
---|
| 119 | sensitive_neg << *(in_CLOCK); |
---|
| 120 | |
---|
| 121 | #ifdef SYSTEMCASS_SPECIFIC |
---|
| 122 | // List dependency information |
---|
| 123 | #endif |
---|
| 124 | |
---|
| 125 | log_printf(INFO,Load_store_unit,FUNCTION,"Method - genMealy_dcache"); |
---|
| 126 | |
---|
| 127 | SC_METHOD (genMealy_dcache); |
---|
| 128 | dont_initialize (); |
---|
| 129 | sensitive_neg << *(in_CLOCK); |
---|
| 130 | |
---|
| 131 | #ifdef SYSTEMCASS_SPECIFIC |
---|
| 132 | // List dependency information |
---|
| 133 | #endif |
---|
| 134 | |
---|
| 135 | #endif |
---|
| 136 | log_printf(FUNC,Load_store_unit,FUNCTION,"End"); |
---|
| 137 | }; |
---|
| 138 | |
---|
| 139 | #undef FUNCTION |
---|
| 140 | #define FUNCTION "Load_store_unit::~Load_store_unit" |
---|
| 141 | Load_store_unit::~Load_store_unit (void) |
---|
| 142 | { |
---|
| 143 | log_printf(FUNC,Load_store_unit,FUNCTION,"Begin"); |
---|
| 144 | |
---|
| 145 | #ifdef STATISTICS |
---|
| 146 | log_printf(INFO,Load_store_unit,FUNCTION,"Generate Statistics file"); |
---|
| 147 | |
---|
| 148 | delete _stat; |
---|
| 149 | #endif |
---|
| 150 | |
---|
| 151 | #ifdef SYSTEMC |
---|
| 152 | log_printf(INFO,Load_store_unit,FUNCTION,"Deallocation"); |
---|
| 153 | |
---|
| 154 | deallocation (); |
---|
| 155 | #endif |
---|
| 156 | |
---|
| 157 | log_printf(FUNC,Load_store_unit,FUNCTION,"End"); |
---|
| 158 | }; |
---|
| 159 | |
---|
| 160 | }; // end namespace load_store_unit |
---|
| 161 | }; // end namespace execute_unit |
---|
| 162 | }; // end namespace multi_execute_unit |
---|
| 163 | }; // end namespace execute_loop |
---|
| 164 | }; // end namespace multi_execute_loop |
---|
| 165 | }; // end namespace core |
---|
| 166 | |
---|
| 167 | }; // end namespace behavioural |
---|
| 168 | }; // end namespace morpheo |
---|