[78] | 1 | #ifdef SYSTEMC |
---|
| 2 | /* |
---|
| 3 | * $Id$ |
---|
| 4 | * |
---|
| 5 | * [ Description ] |
---|
| 6 | * |
---|
| 7 | */ |
---|
| 8 | |
---|
| 9 | #include "Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Rename_unit/Load_Store_pointer_unit/include/Load_Store_pointer_unit.h" |
---|
| 10 | |
---|
| 11 | namespace morpheo { |
---|
| 12 | namespace behavioural { |
---|
| 13 | namespace core { |
---|
| 14 | namespace multi_ooo_engine { |
---|
| 15 | namespace ooo_engine { |
---|
| 16 | namespace rename_unit { |
---|
| 17 | namespace load_store_pointer_unit { |
---|
| 18 | |
---|
| 19 | |
---|
| 20 | #undef FUNCTION |
---|
| 21 | #define FUNCTION "Load_Store_pointer_unit::genMealy_retire" |
---|
| 22 | void Load_Store_pointer_unit::genMealy_retire (void) |
---|
| 23 | { |
---|
| 24 | log_printf(FUNC,Load_Store_pointer_unit,FUNCTION,"Begin"); |
---|
| 25 | |
---|
| 26 | bool use_lsq [_param->_nb_load_store_queue]; |
---|
| 27 | for (uint32_t i=0; i<_param->_nb_load_store_queue; i++) |
---|
| 28 | use_lsq [i] = false; |
---|
| 29 | |
---|
| 30 | for (uint32_t i=0; i<_param->_nb_inst_retire; i++) |
---|
| 31 | { |
---|
| 32 | Tcontrol_t ack = false; |
---|
| 33 | |
---|
| 34 | if ( (PORT_READ(in_RETIRE_VAL [i]) == true ) and |
---|
| 35 | (PORT_READ(in_RETIRE_TYPE [i]) == TYPE_MEMORY)) |
---|
| 36 | { |
---|
| 37 | Tcontext_t front_end_id = (_param->_have_port_front_end_id)?PORT_READ(in_RETIRE_FRONT_END_ID [i]):0; |
---|
| 38 | Tcontext_t context_id = (_param->_have_port_context_id )?PORT_READ(in_RETIRE_CONTEXT_ID [i]):0; |
---|
| 39 | uint32_t lsq = _param->_link_load_store_unit_with_thread[front_end_id][context_id]; |
---|
| 40 | |
---|
| 41 | // Test if a previous instruction use the same lsq |
---|
| 42 | // Authorize once memory access by load store unit |
---|
| 43 | if (use_lsq [lsq] == false) |
---|
| 44 | { |
---|
| 45 | use_lsq [lsq] = true; |
---|
| 46 | ack = true; |
---|
| 47 | |
---|
| 48 | uint32_t ptr; |
---|
| 49 | |
---|
| 50 | // operation became of decod_stage. Also operation is != store_head_ok and store_head_ko |
---|
| 51 | if (is_operation_memory_store(PORT_READ(in_RETIRE_OPERATION [i]))) |
---|
| 52 | { |
---|
| 53 | internal_RETIRE_OPERATION_USE [i] = OPERATION_USE_STORE_QUEUE; |
---|
| 54 | |
---|
| 55 | ptr = PORT_READ(in_RETIRE_STORE_QUEUE_PTR_WRITE [i]); |
---|
| 56 | } |
---|
| 57 | else |
---|
| 58 | { |
---|
| 59 | internal_RETIRE_OPERATION_USE [i] = OPERATION_USE_LOAD_QUEUE; |
---|
| 60 | |
---|
| 61 | ptr = (_param->_have_port_load_queue_ptr)?PORT_READ(in_RETIRE_LOAD_QUEUE_PTR_WRITE [i]):0; |
---|
| 62 | } |
---|
| 63 | |
---|
| 64 | internal_RETIRE_LSQ [i] = lsq; |
---|
| 65 | internal_RETIRE_PTR [i] = ptr; |
---|
| 66 | } |
---|
| 67 | } |
---|
| 68 | else |
---|
| 69 | { |
---|
| 70 | ack = true; |
---|
| 71 | |
---|
| 72 | internal_RETIRE_OPERATION_USE [i] = OPERATION_USE_NONE; |
---|
| 73 | } |
---|
| 74 | |
---|
| 75 | // Write output |
---|
| 76 | internal_RETIRE_ACK [i] = ack; |
---|
| 77 | PORT_WRITE(out_RETIRE_ACK [i], ack); |
---|
| 78 | } |
---|
| 79 | |
---|
| 80 | log_printf(FUNC,Load_Store_pointer_unit,FUNCTION,"End"); |
---|
| 81 | }; |
---|
| 82 | |
---|
| 83 | }; // end namespace load_store_pointer_unit |
---|
| 84 | }; // end namespace rename_unit |
---|
| 85 | }; // end namespace ooo_engine |
---|
| 86 | }; // end namespace multi_ooo_engine |
---|
| 87 | }; // end namespace core |
---|
| 88 | |
---|
| 89 | }; // end namespace behavioural |
---|
| 90 | }; // end namespace morpheo |
---|
| 91 | #endif |
---|