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