[59] | 1 | #ifdef SYSTEMC |
---|
| 2 | //#if defined(STATISTICS) or defined(VHDL_TESTBENCH) |
---|
| 3 | /* |
---|
| 4 | * $Id: Load_store_unit_function_speculative_load_commit_genMealy_insert.cpp 88 2008-12-10 18:31:39Z rosiere $ |
---|
| 5 | * |
---|
| 6 | * [ Description ] |
---|
| 7 | * |
---|
| 8 | */ |
---|
| 9 | |
---|
| 10 | #include "Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Execute_unit/Execute_unit/Load_store_unit/include/Load_store_unit.h" |
---|
| 11 | |
---|
| 12 | namespace morpheo { |
---|
| 13 | namespace behavioural { |
---|
| 14 | namespace core { |
---|
| 15 | namespace multi_execute_loop { |
---|
| 16 | namespace execute_loop { |
---|
| 17 | namespace multi_execute_unit { |
---|
| 18 | namespace execute_unit { |
---|
| 19 | namespace load_store_unit { |
---|
| 20 | |
---|
| 21 | |
---|
| 22 | #undef FUNCTION |
---|
| 23 | #define FUNCTION "Load_store_unit::function_speculative_load_commit_genMealy_insert" |
---|
| 24 | void Load_store_unit::function_speculative_load_commit_genMealy_insert (void) |
---|
| 25 | { |
---|
| 26 | log_printf(FUNC,Load_store_unit,FUNCTION,"Begin"); |
---|
| 27 | |
---|
[71] | 28 | // ~~~~~[ Output "memory_in" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
[88] | 29 | |
---|
| 30 | // Initialisation |
---|
| 31 | internal_MEMORY_IN_PORT = 0; |
---|
| 32 | Tcontrol_t ack [_param->_nb_inst_memory]; |
---|
| 33 | for (uint32_t i=0; i<_param->_nb_inst_memory; i++) |
---|
| 34 | ack [i] = 0; |
---|
[59] | 35 | |
---|
[88] | 36 | // find first valid entry |
---|
[71] | 37 | // store queue is never full (pointer is manage by rename stage) |
---|
[88] | 38 | for (uint32_t i=0; i<_param->_nb_inst_memory; i++) |
---|
| 39 | if (PORT_READ(in_MEMORY_IN_VAL [i])) |
---|
| 40 | { |
---|
| 41 | internal_MEMORY_IN_ACK = is_operation_memory_store(PORT_READ(in_MEMORY_IN_OPERATION [i])) or not _speculative_access_queue_control->full(); |
---|
[71] | 42 | |
---|
[88] | 43 | if (internal_MEMORY_IN_ACK) |
---|
| 44 | { |
---|
| 45 | ack [i] = 1; |
---|
| 46 | internal_MEMORY_IN_PORT = i; |
---|
| 47 | break; // end |
---|
| 48 | } |
---|
| 49 | } |
---|
[59] | 50 | |
---|
[88] | 51 | for (uint32_t i=0; i<_param->_nb_inst_memory; i++) |
---|
| 52 | PORT_WRITE(out_MEMORY_IN_ACK [i], ack [i]); |
---|
| 53 | |
---|
[59] | 54 | log_printf(FUNC,Load_store_unit,FUNCTION,"End"); |
---|
| 55 | }; |
---|
| 56 | |
---|
| 57 | }; // end namespace load_store_unit |
---|
| 58 | }; // end namespace execute_unit |
---|
| 59 | }; // end namespace multi_execute_unit |
---|
| 60 | }; // end namespace execute_loop |
---|
| 61 | }; // end namespace multi_execute_loop |
---|
| 62 | }; // end namespace core |
---|
| 63 | |
---|
| 64 | }; // end namespace behavioural |
---|
| 65 | }; // end namespace morpheo |
---|
| 66 | #endif |
---|
| 67 | //#endif |
---|