[115] | 1 | #ifdef SYSTEMC |
---|
| 2 | /* |
---|
| 3 | * $Id: Write_queue_genMealy_write.cpp 136 2009-10-20 18:52:15Z rosiere $ |
---|
| 4 | * |
---|
| 5 | * [ Description ] |
---|
| 6 | * |
---|
| 7 | */ |
---|
| 8 | |
---|
| 9 | #include "Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Write_unit/Write_unit/Write_queue/include/Write_queue.h" |
---|
| 10 | |
---|
| 11 | namespace morpheo { |
---|
| 12 | namespace behavioural { |
---|
| 13 | namespace core { |
---|
| 14 | namespace multi_execute_loop { |
---|
| 15 | namespace execute_loop { |
---|
| 16 | namespace multi_write_unit { |
---|
| 17 | namespace write_unit { |
---|
| 18 | namespace write_queue { |
---|
| 19 | |
---|
| 20 | |
---|
| 21 | #undef FUNCTION |
---|
[118] | 22 | #define FUNCTION "Write_queue::genMealy_write" |
---|
| 23 | void Write_queue::genMealy_write (void) |
---|
[115] | 24 | { |
---|
| 25 | log_begin(Write_queue,FUNCTION); |
---|
| 26 | log_function(Write_queue,FUNCTION,_name.c_str()); |
---|
| 27 | |
---|
[123] | 28 | if (PORT_READ(in_NRESET)) |
---|
| 29 | { |
---|
[115] | 30 | // -----[ Interface "bypass_write" ]---------------------------------- |
---|
| 31 | // in genMoore |
---|
| 32 | // -----[ Interface "Write_queue_in" ]-------------------------------- |
---|
| 33 | // in genMoore |
---|
| 34 | |
---|
| 35 | bool val = not _queue->empty(); |
---|
| 36 | Tcontrol_t write_rd = val and _queue->front()->_write_rd; |
---|
| 37 | Tcontrol_t write_re = val and _queue->front()->_write_re; |
---|
| 38 | |
---|
| 39 | // -----[ Interface "gpr_write" ]------------------------------------- |
---|
| 40 | // -----[ Interface "spr_write" ]------------------------------------- |
---|
| 41 | { |
---|
| 42 | internal_GPR_WRITE_VAL = val and write_rd; |
---|
| 43 | internal_SPR_WRITE_VAL = val and write_re; |
---|
| 44 | |
---|
| 45 | PORT_WRITE(out_GPR_WRITE_VAL [0], internal_GPR_WRITE_VAL); |
---|
| 46 | PORT_WRITE(out_SPR_WRITE_VAL [0], internal_SPR_WRITE_VAL); |
---|
| 47 | |
---|
| 48 | write_rd = (write_rd)?(not PORT_READ(in_GPR_WRITE_ACK [0])):0; |
---|
| 49 | write_re = (write_re)?(not PORT_READ(in_SPR_WRITE_ACK [0])):0; |
---|
| 50 | |
---|
| 51 | if (val) |
---|
| 52 | { |
---|
| 53 | if (_param->_have_port_ooo_engine_id) |
---|
| 54 | { |
---|
| 55 | PORT_WRITE(out_GPR_WRITE_OOO_ENGINE_ID [0], _queue->front()->_ooo_engine_id); |
---|
| 56 | PORT_WRITE(out_SPR_WRITE_OOO_ENGINE_ID [0], _queue->front()->_ooo_engine_id); |
---|
| 57 | } |
---|
| 58 | PORT_WRITE(out_GPR_WRITE_NUM_REG [0], _queue->front()->_num_reg_rd); |
---|
| 59 | PORT_WRITE(out_GPR_WRITE_DATA [0], _queue->front()->_data_rd ); |
---|
| 60 | PORT_WRITE(out_SPR_WRITE_NUM_REG [0], _queue->front()->_num_reg_re); |
---|
| 61 | PORT_WRITE(out_SPR_WRITE_DATA [0], _queue->front()->_data_re ); |
---|
| 62 | } |
---|
| 63 | } |
---|
| 64 | |
---|
| 65 | // -----[ Interface "Write_queue_out" ]-------------------------------- |
---|
| 66 | { |
---|
| 67 | Texception_t load_speculative = (_queue->front()->_exception == EXCEPTION_MEMORY_LOAD_SPECULATIVE); |
---|
| 68 | |
---|
| 69 | internal_WRITE_QUEUE_OUT_VAL = ((val ) and |
---|
| 70 | (not load_speculative) and |
---|
| 71 | (not write_rd ) and |
---|
| 72 | (not write_re )); |
---|
| 73 | |
---|
| 74 | PORT_WRITE(out_WRITE_QUEUE_OUT_VAL, internal_WRITE_QUEUE_OUT_VAL); |
---|
| 75 | |
---|
| 76 | if (internal_WRITE_QUEUE_OUT_VAL) |
---|
| 77 | { |
---|
| 78 | if (_param->_have_port_context_id) |
---|
| 79 | PORT_WRITE(out_WRITE_QUEUE_OUT_CONTEXT_ID , _queue->front()->_context_id ); |
---|
| 80 | if (_param->_have_port_front_end_id) |
---|
| 81 | PORT_WRITE(out_WRITE_QUEUE_OUT_FRONT_END_ID , _queue->front()->_front_end_id ); |
---|
| 82 | if (_param->_have_port_ooo_engine_id) |
---|
| 83 | PORT_WRITE(out_WRITE_QUEUE_OUT_OOO_ENGINE_ID, _queue->front()->_ooo_engine_id); |
---|
| 84 | if (_param->_have_port_rob_ptr ) |
---|
| 85 | PORT_WRITE(out_WRITE_QUEUE_OUT_PACKET_ID , _queue->front()->_packet_id ); |
---|
| 86 | // PORT_WRITE(out_WRITE_QUEUE_OUT_OPERATION , _queue->front()->_operation ); |
---|
| 87 | // PORT_WRITE(out_WRITE_QUEUE_OUT_TYPE , _queue->front()->_type ); |
---|
[136] | 88 | PORT_WRITE(out_WRITE_QUEUE_OUT_CANCEL , _queue->front()->_cancel ); |
---|
[115] | 89 | PORT_WRITE(out_WRITE_QUEUE_OUT_FLAGS , _queue->front()->_data_re ); |
---|
| 90 | PORT_WRITE(out_WRITE_QUEUE_OUT_EXCEPTION , _queue->front()->_exception ); |
---|
| 91 | PORT_WRITE(out_WRITE_QUEUE_OUT_NO_SEQUENCE , _queue->front()->_no_sequence ); |
---|
| 92 | PORT_WRITE(out_WRITE_QUEUE_OUT_ADDRESS , _queue->front()->_address ); |
---|
| 93 | PORT_WRITE(out_WRITE_QUEUE_OUT_DATA , _queue->front()->_data_rd ); |
---|
| 94 | } |
---|
| 95 | } |
---|
[123] | 96 | } |
---|
| 97 | else |
---|
| 98 | { |
---|
| 99 | internal_WRITE_QUEUE_OUT_VAL = 0; |
---|
| 100 | } |
---|
| 101 | |
---|
| 102 | PORT_WRITE(out_WRITE_QUEUE_OUT_VAL, internal_WRITE_QUEUE_OUT_VAL); |
---|
[115] | 103 | |
---|
| 104 | log_end(Write_queue,FUNCTION); |
---|
| 105 | }; |
---|
| 106 | |
---|
| 107 | }; // end namespace write_queue |
---|
| 108 | }; // end namespace write_unit |
---|
| 109 | }; // end namespace multi_write_unit |
---|
| 110 | }; // end namespace execute_loop |
---|
| 111 | }; // end namespace multi_execute_loop |
---|
| 112 | }; // end namespace core |
---|
| 113 | |
---|
| 114 | }; // end namespace behavioural |
---|
| 115 | }; // end namespace morpheo |
---|
| 116 | #endif |
---|