[88] | 1 | #ifdef SYSTEMC |
---|
| 2 | /* |
---|
| 3 | * $Id: Reexecute_unit_genMealy_reexecute.cpp 123 2009-06-08 20:43:30Z rosiere $ |
---|
| 4 | * |
---|
| 5 | * [ Description ] |
---|
| 6 | * |
---|
| 7 | */ |
---|
| 8 | |
---|
| 9 | #include "Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Reexecute_unit/include/Reexecute_unit.h" |
---|
| 10 | |
---|
| 11 | namespace morpheo { |
---|
| 12 | namespace behavioural { |
---|
| 13 | namespace core { |
---|
| 14 | namespace multi_ooo_engine { |
---|
| 15 | namespace ooo_engine { |
---|
| 16 | namespace reexecute_unit { |
---|
| 17 | |
---|
| 18 | |
---|
| 19 | #undef FUNCTION |
---|
| 20 | #define FUNCTION "Reexecute_unit::genMealy_reexecute" |
---|
| 21 | void Reexecute_unit::genMealy_reexecute (void) |
---|
| 22 | { |
---|
| 23 | log_begin(Reexecute_unit,FUNCTION); |
---|
[98] | 24 | log_function(Reexecute_unit,FUNCTION,_name.c_str()); |
---|
[88] | 25 | |
---|
[123] | 26 | if (PORT_READ(in_NRESET)) |
---|
| 27 | { |
---|
[88] | 28 | // =================================================================== |
---|
| 29 | // =====[ REEXECUTE ]================================================= |
---|
| 30 | // =================================================================== |
---|
| 31 | // Between reexecute_rob and rexecute_queue, reexecute_queue is most priotary |
---|
| 32 | |
---|
| 33 | for (uint32_t i=0; i<_param->_nb_inst_reexecute; i++) |
---|
| 34 | { |
---|
| 35 | Tcontrol_t val; |
---|
| 36 | Tcontrol_t ack; |
---|
| 37 | |
---|
[118] | 38 | log_printf(TRACE,Reexecute_unit,FUNCTION," * REEXECUTE[%d]",i); |
---|
| 39 | |
---|
[88] | 40 | if (not _reexecute_queue [i].empty() and (_reexecute_queue [i].front()->state == STATE_REEXECUTE)) |
---|
| 41 | { |
---|
| 42 | val = true ; |
---|
| 43 | ack = false; |
---|
| 44 | |
---|
| 45 | entry_t * entry = _reexecute_queue [i].front(); |
---|
[118] | 46 | Tpacket_t packet_id = (_param->_have_port_rob_ptr)?entry->packet_id:0; |
---|
[88] | 47 | |
---|
[118] | 48 | log_printf(TRACE,Reexecute_unit,FUNCTION," * From Reexecute_queue"); |
---|
| 49 | log_printf(TRACE,Reexecute_unit,FUNCTION," * packet_id : %d",packet_id); |
---|
| 50 | |
---|
[88] | 51 | if (_param->_have_port_context_id) |
---|
| 52 | PORT_WRITE(out_REEXECUTE_CONTEXT_ID [i],entry->context_id ); |
---|
| 53 | if (_param->_have_port_front_end_id) |
---|
| 54 | PORT_WRITE(out_REEXECUTE_FRONT_END_ID [i],entry->front_end_id ); |
---|
| 55 | if (_param->_have_port_rob_ptr ) |
---|
[118] | 56 | PORT_WRITE(out_REEXECUTE_PACKET_ID [i], packet_id ); |
---|
[88] | 57 | PORT_WRITE(out_REEXECUTE_OPERATION [i],entry->operation ); |
---|
| 58 | PORT_WRITE(out_REEXECUTE_TYPE [i],entry->type ); |
---|
| 59 | PORT_WRITE(out_REEXECUTE_STORE_QUEUE_PTR_WRITE [i],0); |
---|
[122] | 60 | // PORT_WRITE(out_REEXECUTE_STORE_QUEUE_PTR_READ [i], 0); |
---|
| 61 | // PORT_WRITE(out_REEXECUTE_STORE_QUEUE_EMPTY [i], 0); |
---|
[88] | 62 | PORT_WRITE(out_REEXECUTE_HAS_IMMEDIAT [i],1); |
---|
| 63 | PORT_WRITE(out_REEXECUTE_IMMEDIAT [i],entry->data ); |
---|
| 64 | PORT_WRITE(out_REEXECUTE_WRITE_RD [i],entry->write_rd ); |
---|
| 65 | PORT_WRITE(out_REEXECUTE_NUM_REG_RD [i],entry->num_reg_rd ); |
---|
| 66 | } |
---|
| 67 | else |
---|
| 68 | { |
---|
| 69 | val = PORT_READ(in_REEXECUTE_ROB_VAL [i]); |
---|
| 70 | ack = PORT_READ(in_REEXECUTE_ACK [i]); |
---|
| 71 | |
---|
[118] | 72 | Tpacket_t packet_id = (_param->_have_port_rob_ptr)?PORT_READ(in_REEXECUTE_ROB_PACKET_ID [i]):0; |
---|
| 73 | |
---|
| 74 | log_printf(TRACE,Reexecute_unit,FUNCTION," * From ROB"); |
---|
| 75 | log_printf(TRACE,Reexecute_unit,FUNCTION," * val & ack : %d",val and ack); |
---|
| 76 | log_printf(TRACE,Reexecute_unit,FUNCTION," * have ?? : %d",_param->_have_port_rob_ptr); |
---|
| 77 | log_printf(TRACE,Reexecute_unit,FUNCTION," * packet_id : %d",packet_id); |
---|
| 78 | |
---|
[88] | 79 | if (_param->_have_port_context_id) |
---|
| 80 | PORT_WRITE(out_REEXECUTE_CONTEXT_ID [i], PORT_READ(in_REEXECUTE_ROB_CONTEXT_ID [i])); |
---|
| 81 | if (_param->_have_port_front_end_id) |
---|
| 82 | PORT_WRITE(out_REEXECUTE_FRONT_END_ID [i], PORT_READ(in_REEXECUTE_ROB_FRONT_END_ID [i])); |
---|
| 83 | if (_param->_have_port_rob_ptr ) |
---|
[118] | 84 | PORT_WRITE(out_REEXECUTE_PACKET_ID [i], packet_id ); |
---|
[88] | 85 | PORT_WRITE(out_REEXECUTE_OPERATION [i], PORT_READ(in_REEXECUTE_ROB_OPERATION [i])); |
---|
| 86 | PORT_WRITE(out_REEXECUTE_TYPE [i], PORT_READ(in_REEXECUTE_ROB_TYPE [i])); |
---|
| 87 | PORT_WRITE(out_REEXECUTE_STORE_QUEUE_PTR_WRITE [i], PORT_READ(in_REEXECUTE_ROB_STORE_QUEUE_PTR_WRITE [i])); |
---|
[122] | 88 | // PORT_WRITE(out_REEXECUTE_STORE_QUEUE_PTR_READ [i], 0); |
---|
| 89 | // PORT_WRITE(out_REEXECUTE_STORE_QUEUE_EMPTY [i], 0); |
---|
[88] | 90 | PORT_WRITE(out_REEXECUTE_HAS_IMMEDIAT [i], 0); |
---|
| 91 | PORT_WRITE(out_REEXECUTE_IMMEDIAT [i], 0); |
---|
| 92 | PORT_WRITE(out_REEXECUTE_WRITE_RD [i], 0); |
---|
| 93 | PORT_WRITE(out_REEXECUTE_NUM_REG_RD [i], 0); |
---|
| 94 | } |
---|
| 95 | |
---|
| 96 | internal_REEXECUTE_VAL [i] = val; |
---|
| 97 | internal_REEXECUTE_ROB_ACK [i] = ack; |
---|
[123] | 98 | } |
---|
| 99 | } |
---|
| 100 | else |
---|
| 101 | { |
---|
| 102 | for (uint32_t i=0; i<_param->_nb_inst_reexecute; i++) |
---|
| 103 | { |
---|
| 104 | internal_REEXECUTE_VAL [i] = 0; |
---|
| 105 | internal_REEXECUTE_ROB_ACK [i] = 0; |
---|
| 106 | } |
---|
| 107 | } |
---|
[88] | 108 | |
---|
[123] | 109 | for (uint32_t i=0; i<_param->_nb_inst_reexecute; i++) |
---|
| 110 | { |
---|
[88] | 111 | PORT_WRITE(out_REEXECUTE_VAL [i], internal_REEXECUTE_VAL [i]); |
---|
| 112 | PORT_WRITE(out_REEXECUTE_ROB_ACK [i], internal_REEXECUTE_ROB_ACK [i]); |
---|
| 113 | } |
---|
| 114 | log_end(Reexecute_unit,FUNCTION); |
---|
| 115 | }; |
---|
| 116 | |
---|
| 117 | }; // end namespace reexecute_unit |
---|
| 118 | }; // end namespace ooo_engine |
---|
| 119 | }; // end namespace multi_ooo_engine |
---|
| 120 | }; // end namespace core |
---|
| 121 | |
---|
| 122 | }; // end namespace behavioural |
---|
| 123 | }; // end namespace morpheo |
---|
| 124 | #endif |
---|