[54] | 1 | #ifdef SYSTEMC |
---|
| 2 | /* |
---|
| 3 | * $Id: Read_queue_genMealy_read_queue_out_spr.cpp 88 2008-12-10 18:31:39Z rosiere $ |
---|
| 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 | { |
---|
[88] | 24 | log_begin(Read_queue,FUNCTION); |
---|
| 25 | log_function(Read_queue,FUNCTION,_name.c_str()); |
---|
[54] | 26 | |
---|
| 27 | internal_READ_QUEUE_OUT_DATA_RC_VAL = (// Previous value |
---|
| 28 | _queue_head->_data_rc_val or |
---|
| 29 | // Test if have already access at the registerfile |
---|
| 30 | (_queue_head->_read_rc_val and |
---|
| 31 | PORT_READ(in_SPR_READ_ACK [0]) and |
---|
| 32 | PORT_READ(in_SPR_READ_DATA_VAL [0])) |
---|
| 33 | ); |
---|
| 34 | |
---|
[88] | 35 | log_printf(TRACE,Read_queue,FUNCTION," * internal_READ_QUEUE_OUT_DATA_RC_VAL : %d",internal_READ_QUEUE_OUT_DATA_RC_VAL); |
---|
| 36 | log_printf(TRACE,Read_queue,FUNCTION," * _queue_head->_data_rc_val : %d",_queue_head->_data_rc_val); |
---|
| 37 | log_printf(TRACE,Read_queue,FUNCTION," * _queue_head->_read_rc_val : %d",_queue_head->_read_rc_val); |
---|
| 38 | log_printf(TRACE,Read_queue,FUNCTION," * in_SPR_READ_ACK [0] : %d",PORT_READ(in_SPR_READ_ACK [0])); |
---|
| 39 | log_printf(TRACE,Read_queue,FUNCTION," * in_SPR_READ_DATA_VAL [0] : %d",PORT_READ(in_SPR_READ_DATA_VAL [0])); |
---|
[54] | 40 | |
---|
| 41 | internal_READ_QUEUE_OUT_DATA_RC = (// Test if have an previous access |
---|
| 42 | (_queue_head->_data_rc_val)? |
---|
| 43 | // if precious access, take previous data |
---|
| 44 | _queue_head->_data_rc: |
---|
| 45 | // else, take the read_data (don't test the validity of data) |
---|
| 46 | PORT_READ(in_SPR_READ_DATA [0])); |
---|
| 47 | |
---|
| 48 | // Test all bypass |
---|
| 49 | for (uint32_t i=0; i<_param->_nb_spr_write ; i++) |
---|
| 50 | { |
---|
[68] | 51 | bool cmp; |
---|
| 52 | |
---|
| 53 | if (_param->_have_port_ooo_engine_id) |
---|
| 54 | cmp = (PORT_READ (in_SPR_WRITE_OOO_ENGINE_ID [i]) == _queue_head->_ooo_engine_id); |
---|
| 55 | else |
---|
| 56 | cmp = true; |
---|
| 57 | |
---|
[54] | 58 | // Test if this bypass is valid |
---|
[68] | 59 | if ( (PORT_READ (in_SPR_WRITE_VAL [i]) == 1) and cmp) |
---|
[54] | 60 | { |
---|
[55] | 61 | if (_queue_head->_num_reg_rc == PORT_READ(in_SPR_WRITE_NUM_REG [i])) |
---|
[54] | 62 | { |
---|
[88] | 63 | log_printf(TRACE,Read_queue,FUNCTION," * internal_READ_QUEUE_OUT_DATA_RC_VAL - bypass hit (%d)",i); |
---|
[54] | 64 | internal_READ_QUEUE_OUT_DATA_RC_VAL = 1; |
---|
[68] | 65 | #ifdef SYSTEMC_VHDL_COMPATIBILITY |
---|
| 66 | if (_queue_head->_read_rc == 1) |
---|
| 67 | #endif |
---|
[55] | 68 | internal_READ_QUEUE_OUT_DATA_RC = PORT_READ(in_SPR_WRITE_DATA [i]); |
---|
[54] | 69 | } |
---|
| 70 | } |
---|
| 71 | } |
---|
| 72 | |
---|
| 73 | // Affectation out port |
---|
| 74 | PORT_WRITE(out_READ_QUEUE_OUT_DATA_RC_VAL,internal_READ_QUEUE_OUT_DATA_RC_VAL); |
---|
| 75 | PORT_WRITE(out_READ_QUEUE_OUT_DATA_RC ,internal_READ_QUEUE_OUT_DATA_RC ); |
---|
| 76 | |
---|
[88] | 77 | log_end(Read_queue,FUNCTION); |
---|
[54] | 78 | }; |
---|
| 79 | |
---|
| 80 | }; // end namespace read_queue |
---|
| 81 | }; // end namespace read_unit |
---|
| 82 | }; // end namespace multi_read_unit |
---|
| 83 | }; // end namespace execute_loop |
---|
| 84 | }; // end namespace multi_execute_loop |
---|
| 85 | }; // end namespace core |
---|
| 86 | |
---|
| 87 | }; // end namespace behavioural |
---|
| 88 | }; // end namespace morpheo |
---|
| 89 | #endif |
---|