[59] | 1 | #ifndef morpheo_behavioural_core_multi_execute_loop_execute_loop_multi_execute_unit_execute_unit_load_store_unit_Types_h |
---|
| 2 | #define morpheo_behavioural_core_multi_execute_loop_execute_loop_multi_execute_unit_execute_unit_load_store_unit_Types_h |
---|
| 3 | |
---|
| 4 | /* |
---|
| 5 | * $Id$ |
---|
| 6 | * |
---|
| 7 | * [ Description ] |
---|
| 8 | * |
---|
| 9 | */ |
---|
| 10 | |
---|
| 11 | #include "Behavioural/include/Types.h" |
---|
| 12 | #include "Common/include/ToString.h" |
---|
| 13 | #include "Common/include/FromString.h" |
---|
| 14 | #include "Common/include/ErrorMorpheo.h" |
---|
| 15 | |
---|
| 16 | namespace morpheo { |
---|
| 17 | namespace behavioural { |
---|
| 18 | namespace core { |
---|
| 19 | namespace multi_execute_loop { |
---|
| 20 | namespace execute_loop { |
---|
| 21 | namespace multi_execute_unit { |
---|
| 22 | namespace execute_unit { |
---|
| 23 | namespace load_store_unit { |
---|
| 24 | |
---|
| 25 | typedef enum |
---|
| 26 | { |
---|
| 27 | NO_SPECULATIVE_LOAD , //each load wait all previous store before the data cache access |
---|
| 28 | SPECULATIVE_LOAD_ACCESS, //each load wait all previous store before the commiting |
---|
| 29 | SPECULATIVE_LOAD_COMMIT, //each load commit the result before the end of dependence's check |
---|
| 30 | SPECULATIVE_LOAD_BYPASS //each load bypass the result before the end of dependence's check |
---|
| 31 | } Tspeculative_load_t; |
---|
| 32 | |
---|
| 33 | typedef enum |
---|
| 34 | { |
---|
| 35 | SELECT_STORE_QUEUE, |
---|
| 36 | SELECT_LOAD_QUEUE , |
---|
| 37 | SELECT_LOAD_QUEUE_SPECULATIVE |
---|
| 38 | } Tselect_queue_t; |
---|
| 39 | |
---|
| 40 | // ---------------------------------------------------------- |
---|
| 41 | // Store Queue |
---|
| 42 | // ---------------------------------------------------------- |
---|
| 43 | |
---|
| 44 | typedef enum |
---|
| 45 | { |
---|
| 46 | STORE_QUEUE_EMPTY //entry is empty |
---|
| 47 | ,STORE_QUEUE_NO_VALID_NO_SPECULATIVE //entry is the top of rob, and operation isn't arrive |
---|
| 48 | ,STORE_QUEUE_VALID_SPECULATIVE //entry is arrive and wait the top of rob |
---|
| 49 | ,STORE_QUEUE_VALID_NO_SPECULATIVE //entry is ok, can be access at a dcache port. |
---|
| 50 | ,STORE_QUEUE_COMMIT //entry have access at dcache |
---|
| 51 | } Tstore_queue_state_t; |
---|
| 52 | |
---|
| 53 | class Tstore_queue_entry_t |
---|
| 54 | { |
---|
| 55 | public : Tstore_queue_state_t _state ; |
---|
| 56 | public : Tcontext_t _context_id ; |
---|
| 57 | public : Tpacket_t _packet_id ; |
---|
[62] | 58 | public : Tdcache_type_t _dcache_type ; |
---|
[59] | 59 | public : Tcontrol_t _uncached ; |
---|
| 60 | public : Tlsq_ptr_t _load_queue_ptr_write; |
---|
| 61 | public : Tdcache_data_t _address ; |
---|
| 62 | public : Tgeneral_data_t _wdata ; |
---|
| 63 | //public : Tcontrol_t _write_rd ; |
---|
| 64 | //public : Tgeneral_address_t _num_reg_rd ; |
---|
| 65 | public : Texception_t _exception ; |
---|
[62] | 66 | |
---|
| 67 | friend ostream & operator << (ostream& os, const Tstore_queue_entry_t & x) |
---|
| 68 | { |
---|
| 69 | return os << " * state : " << x._state << endl |
---|
| 70 | << " * packet - context_id : " << toString(static_cast<uint32_t>(x._packet_id )) << " - " << toString(static_cast<uint32_t>(x._context_id)) << endl |
---|
| 71 | << " * type - uncached : " << toString(static_cast<uint32_t>(x._dcache_type )) << " - " << toString(static_cast<uint32_t>(x._uncached )) << endl |
---|
| 72 | << " * load_ptr - execption : " << toString(static_cast<uint32_t>(x._load_queue_ptr_write)) << " - " << toString(static_cast<uint32_t>(x._exception )) << endl |
---|
| 73 | << " * address - wdata : " << toString(static_cast<uint32_t>(x._address )) << " - " << toString(static_cast<uint32_t>(x._wdata )) << endl; |
---|
| 74 | } |
---|
[59] | 75 | }; |
---|
[62] | 76 | |
---|
| 77 | |
---|
[59] | 78 | |
---|
| 79 | // ---------------------------------------------------------- |
---|
| 80 | // Speculative_Access Queue |
---|
| 81 | // ---------------------------------------------------------- |
---|
| 82 | |
---|
| 83 | typedef enum |
---|
| 84 | { |
---|
| 85 | SPECULATIVE_ACCESS_QUEUE_EMPTY //entry is empty |
---|
| 86 | ,SPECULATIVE_ACCESS_QUEUE_WAIT_CACHE //entry is valid and can access at the dcache |
---|
| 87 | ,SPECULATIVE_ACCESS_QUEUE_WAIT_LOAD_QUEUE //entry wait an empty slot in load queue |
---|
| 88 | } Tspeculative_access_queue_state_t; |
---|
| 89 | |
---|
| 90 | class Tspeculative_access_queue_entry_t |
---|
| 91 | { |
---|
| 92 | public : Tspeculative_access_queue_state_t _state ; |
---|
| 93 | public : Tcontext_t _context_id ; |
---|
| 94 | public : Tpacket_t _packet_id ; |
---|
| 95 | public : Taccess_t _access ; |
---|
| 96 | public : Tcontrol_t _uncached ; |
---|
| 97 | public : Tcontrol_t _sign_extension ; |
---|
| 98 | public : Tlsq_ptr_t _load_queue_ptr_write ; |
---|
| 99 | public : Tlsq_ptr_t _store_queue_ptr_write; |
---|
| 100 | public : Tdcache_address_t _address ; |
---|
| 101 | public : Tgeneral_data_t _rdata ; |
---|
| 102 | public : Tcontrol_t _write_rd ; |
---|
| 103 | public : Tgeneral_address_t _num_reg_rd ; |
---|
| 104 | public : Texception_t _exception ; |
---|
| 105 | }; |
---|
| 106 | |
---|
| 107 | // ---------------------------------------------------------- |
---|
| 108 | // Load Queue |
---|
| 109 | // ---------------------------------------------------------- |
---|
| 110 | |
---|
| 111 | typedef enum |
---|
| 112 | { |
---|
| 113 | LOAD_QUEUE_EMPTY //entry is empty |
---|
| 114 | ,LOAD_QUEUE_WAIT_CHECK //entry must wait the respons and check dependence with store |
---|
| 115 | ,LOAD_QUEUE_WAIT //entry must wait the respons |
---|
| 116 | ,LOAD_QUEUE_COMMIT_CHECK //entry must check dependence and can commit speculative |
---|
| 117 | ,LOAD_QUEUE_CHECK //entry must check dependence with store |
---|
| 118 | ,LOAD_QUEUE_COMMIT //entry must commit the instruction |
---|
| 119 | } Tload_queue_state_t; |
---|
| 120 | |
---|
| 121 | class Tload_queue_entry_t |
---|
| 122 | { |
---|
| 123 | public : Tload_queue_state_t _state ; |
---|
| 124 | public : Tcontext_t _context_id ; |
---|
| 125 | public : Tpacket_t _packet_id ; |
---|
| 126 | public : Taccess_t _access ; |
---|
| 127 | public : Tcontrol_t _uncached ; |
---|
| 128 | public : Tcontrol_t _sign_extension ; |
---|
| 129 | public : Tlsq_ptr_t _store_queue_ptr_write; |
---|
| 130 | public : Tdcache_address_t _address ; |
---|
| 131 | public : Tgeneral_data_t _rdata ; |
---|
| 132 | public : Tcontrol_t _write_rd ; |
---|
| 133 | public : Tgeneral_address_t _num_reg_rd ; |
---|
| 134 | public : Texception_t _exception ; |
---|
| 135 | }; |
---|
| 136 | |
---|
| 137 | }; // end namespace load_store_unit |
---|
| 138 | }; // end namespace execute_unit |
---|
| 139 | }; // end namespace multi_execute_unit |
---|
| 140 | }; // end namespace execute_loop |
---|
| 141 | }; // end namespace multi_execute_loop |
---|
| 142 | }; // end namespace core |
---|
| 143 | }; // end namespace behavioural |
---|
| 144 | |
---|
| 145 | template<> inline std::string toString<morpheo::behavioural::core::multi_execute_loop::execute_loop::multi_execute_unit::execute_unit::load_store_unit::Tspeculative_load_t>(const morpheo::behavioural::core::multi_execute_loop::execute_loop::multi_execute_unit::execute_unit::load_store_unit::Tspeculative_load_t& x) |
---|
| 146 | { |
---|
| 147 | switch (x) |
---|
| 148 | { |
---|
| 149 | case morpheo::behavioural::core::multi_execute_loop::execute_loop::multi_execute_unit::execute_unit::load_store_unit::NO_SPECULATIVE_LOAD : return "no_speculative_load" ; break; |
---|
| 150 | case morpheo::behavioural::core::multi_execute_loop::execute_loop::multi_execute_unit::execute_unit::load_store_unit::SPECULATIVE_LOAD_ACCESS : return "speculative_load_access"; break; |
---|
| 151 | case morpheo::behavioural::core::multi_execute_loop::execute_loop::multi_execute_unit::execute_unit::load_store_unit::SPECULATIVE_LOAD_COMMIT : return "speculative_load_commit"; break; |
---|
| 152 | case morpheo::behavioural::core::multi_execute_loop::execute_loop::multi_execute_unit::execute_unit::load_store_unit::SPECULATIVE_LOAD_BYPASS : return "speculative_load_bypass"; break; |
---|
| 153 | default : return "" ; break; |
---|
| 154 | } |
---|
| 155 | }; |
---|
| 156 | |
---|
| 157 | template<> inline morpheo::behavioural::core::multi_execute_loop::execute_loop::multi_execute_unit::execute_unit::load_store_unit::Tspeculative_load_t fromString<morpheo::behavioural::core::multi_execute_loop::execute_loop::multi_execute_unit::execute_unit::load_store_unit::Tspeculative_load_t>(const std::string& x) |
---|
| 158 | { |
---|
| 159 | if ( (x.compare("0") == 0) or |
---|
| 160 | (x.compare("no_speculative_load") == 0)) |
---|
| 161 | return morpheo::behavioural::core::multi_execute_loop::execute_loop::multi_execute_unit::execute_unit::load_store_unit::NO_SPECULATIVE_LOAD; |
---|
| 162 | if ( (x.compare("1") == 0) or |
---|
| 163 | (x.compare("speculative_load_access") == 0)) |
---|
| 164 | return morpheo::behavioural::core::multi_execute_loop::execute_loop::multi_execute_unit::execute_unit::load_store_unit::SPECULATIVE_LOAD_ACCESS; |
---|
| 165 | if ( (x.compare("2") == 0) or |
---|
| 166 | (x.compare("speculative_load_commit") == 0)) |
---|
| 167 | return morpheo::behavioural::core::multi_execute_loop::execute_loop::multi_execute_unit::execute_unit::load_store_unit::SPECULATIVE_LOAD_COMMIT; |
---|
| 168 | if ( (x.compare("3") == 0) or |
---|
| 169 | (x.compare("speculative_load_bypass") == 0)) |
---|
| 170 | return morpheo::behavioural::core::multi_execute_loop::execute_loop::multi_execute_unit::execute_unit::load_store_unit::SPECULATIVE_LOAD_BYPASS; |
---|
| 171 | |
---|
| 172 | throw (ErrorMorpheo ("<fromString> : Unknow string : \""+x+"\"")); |
---|
| 173 | }; |
---|
| 174 | |
---|
| 175 | }; // end namespace morpheo |
---|
| 176 | |
---|
| 177 | #endif |
---|