[54] | 1 | #ifdef SYSTEMC |
---|
| 2 | /* |
---|
| 3 | * $Id$ |
---|
| 4 | * |
---|
| 5 | * [ Description ] |
---|
| 6 | * |
---|
| 7 | */ |
---|
| 8 | |
---|
| 9 | #include "Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Read_unit/Read_unit/Read_queue/include/Read_queue.h" |
---|
| 10 | |
---|
| 11 | namespace morpheo { |
---|
| 12 | namespace behavioural { |
---|
| 13 | namespace core { |
---|
| 14 | namespace multi_execute_loop { |
---|
| 15 | namespace execute_loop { |
---|
| 16 | namespace multi_read_unit { |
---|
| 17 | namespace read_unit { |
---|
| 18 | namespace read_queue { |
---|
| 19 | |
---|
| 20 | #undef FUNCTION |
---|
| 21 | #define FUNCTION "Read_queue::genMealy_read_queue_out_spr" |
---|
| 22 | void Read_queue::genMealy_read_queue_out_spr (void) |
---|
| 23 | { |
---|
| 24 | log_printf(FUNC,Read_queue,FUNCTION,"Begin"); |
---|
| 25 | |
---|
| 26 | internal_READ_QUEUE_OUT_DATA_RC_VAL = (// Previous value |
---|
| 27 | _queue_head->_data_rc_val or |
---|
| 28 | // Test if have already access at the registerfile |
---|
| 29 | (_queue_head->_read_rc_val and |
---|
| 30 | PORT_READ(in_SPR_READ_ACK [0]) and |
---|
| 31 | PORT_READ(in_SPR_READ_DATA_VAL [0])) |
---|
| 32 | ); |
---|
| 33 | |
---|
| 34 | log_printf(TRACE,Read_queue,FUNCTION," * internal_READ_QUEUE_OUT_DATA_RC_VAL : %d",internal_READ_QUEUE_OUT_DATA_RC_VAL); |
---|
| 35 | log_printf(TRACE,Read_queue,FUNCTION," * _queue_head->_data_rc_val : %d",_queue_head->_data_rc_val); |
---|
| 36 | log_printf(TRACE,Read_queue,FUNCTION," * _queue_head->_read_rc_val : %d",_queue_head->_read_rc_val); |
---|
| 37 | log_printf(TRACE,Read_queue,FUNCTION," * in_SPR_READ_ACK [0] : %d",PORT_READ(in_SPR_READ_ACK [0])); |
---|
| 38 | log_printf(TRACE,Read_queue,FUNCTION," * in_SPR_READ_DATA_VAL [0] : %d",PORT_READ(in_SPR_READ_DATA_VAL [0])); |
---|
| 39 | |
---|
| 40 | internal_READ_QUEUE_OUT_DATA_RC = (// Test if have an previous access |
---|
| 41 | (_queue_head->_data_rc_val)? |
---|
| 42 | // if precious access, take previous data |
---|
| 43 | _queue_head->_data_rc: |
---|
| 44 | // else, take the read_data (don't test the validity of data) |
---|
| 45 | PORT_READ(in_SPR_READ_DATA [0])); |
---|
| 46 | |
---|
| 47 | // Test all bypass |
---|
| 48 | for (uint32_t i=0; i<_param->_nb_spr_write ; i++) |
---|
| 49 | { |
---|
[68] | 50 | bool cmp; |
---|
| 51 | |
---|
| 52 | if (_param->_have_port_ooo_engine_id) |
---|
| 53 | cmp = (PORT_READ (in_SPR_WRITE_OOO_ENGINE_ID [i]) == _queue_head->_ooo_engine_id); |
---|
| 54 | else |
---|
| 55 | cmp = true; |
---|
| 56 | |
---|
[54] | 57 | // Test if this bypass is valid |
---|
[68] | 58 | if ( (PORT_READ (in_SPR_WRITE_VAL [i]) == 1) and cmp) |
---|
[54] | 59 | { |
---|
[55] | 60 | if (_queue_head->_num_reg_rc == PORT_READ(in_SPR_WRITE_NUM_REG [i])) |
---|
[54] | 61 | { |
---|
| 62 | log_printf(TRACE,Read_queue,FUNCTION," * internal_READ_QUEUE_OUT_DATA_RC_VAL - bypass hit (%d)",i); |
---|
| 63 | internal_READ_QUEUE_OUT_DATA_RC_VAL = 1; |
---|
[68] | 64 | #ifdef SYSTEMC_VHDL_COMPATIBILITY |
---|
| 65 | if (_queue_head->_read_rc == 1) |
---|
| 66 | #endif |
---|
[55] | 67 | internal_READ_QUEUE_OUT_DATA_RC = PORT_READ(in_SPR_WRITE_DATA [i]); |
---|
[54] | 68 | } |
---|
| 69 | } |
---|
| 70 | } |
---|
| 71 | |
---|
| 72 | // Affectation out port |
---|
| 73 | PORT_WRITE(out_READ_QUEUE_OUT_DATA_RC_VAL,internal_READ_QUEUE_OUT_DATA_RC_VAL); |
---|
| 74 | PORT_WRITE(out_READ_QUEUE_OUT_DATA_RC ,internal_READ_QUEUE_OUT_DATA_RC ); |
---|
| 75 | |
---|
| 76 | log_printf(FUNC,Read_queue,FUNCTION,"End"); |
---|
| 77 | }; |
---|
| 78 | |
---|
| 79 | }; // end namespace read_queue |
---|
| 80 | }; // end namespace read_unit |
---|
| 81 | }; // end namespace multi_read_unit |
---|
| 82 | }; // end namespace execute_loop |
---|
| 83 | }; // end namespace multi_execute_loop |
---|
| 84 | }; // end namespace core |
---|
| 85 | |
---|
| 86 | }; // end namespace behavioural |
---|
| 87 | }; // end namespace morpheo |
---|
| 88 | #endif |
---|