[111] | 1 | #ifdef SYSTEMC |
---|
| 2 | /* |
---|
| 3 | * $Id: Decod_queue_function_one_fifo_genMoore.cpp 139 2010-07-30 14:47:27Z rosiere $ |
---|
| 4 | * |
---|
| 5 | * [ Description ] |
---|
| 6 | * |
---|
| 7 | */ |
---|
| 8 | |
---|
| 9 | #include "Behavioural/Core/Multi_Front_end/Front_end/Decod_unit/Decod_queue/include/Decod_queue.h" |
---|
| 10 | |
---|
| 11 | namespace morpheo { |
---|
| 12 | namespace behavioural { |
---|
| 13 | namespace core { |
---|
| 14 | namespace multi_front_end { |
---|
| 15 | namespace front_end { |
---|
| 16 | namespace decod_unit { |
---|
| 17 | namespace decod_queue { |
---|
| 18 | |
---|
| 19 | |
---|
| 20 | #undef FUNCTION |
---|
| 21 | #define FUNCTION "Decod_queue::function_one_fifo_genMoore" |
---|
| 22 | void Decod_queue::function_one_fifo_genMoore (void) |
---|
| 23 | { |
---|
| 24 | log_begin(Decod_queue,FUNCTION); |
---|
| 25 | log_function(Decod_queue,FUNCTION,_name.c_str()); |
---|
| 26 | |
---|
[123] | 27 | if (PORT_READ(in_NRESET)) |
---|
| 28 | { |
---|
[111] | 29 | //-------------------------------------------------------------------- |
---|
| 30 | //-----[ DECOD_IN ]--------------------------------------------------- |
---|
| 31 | //-------------------------------------------------------------------- |
---|
| 32 | { |
---|
| 33 | Tcontrol_t ack = reg_QUEUE->size() < _param->_size_queue; |
---|
| 34 | |
---|
| 35 | for (uint32_t i=0; i<_param->_nb_inst_decod; i++) |
---|
| 36 | { |
---|
| 37 | internal_DECOD_IN_ACK [i] = ack; |
---|
| 38 | } |
---|
| 39 | } |
---|
| 40 | |
---|
| 41 | //-------------------------------------------------------------------- |
---|
| 42 | //-----[ DECOD_OUT ]-------------------------------------------------- |
---|
| 43 | //-------------------------------------------------------------------- |
---|
| 44 | if (not reg_QUEUE->empty()) |
---|
| 45 | for (uint32_t i=0; i<_param->_nb_inst_decod; i++) |
---|
| 46 | { |
---|
| 47 | uint32_t index = reg_LAST_SLOT + i; |
---|
| 48 | |
---|
| 49 | // Stop |
---|
| 50 | if (index >= _param->_nb_inst_decod) |
---|
| 51 | break; |
---|
| 52 | |
---|
| 53 | if (_param->_have_port_context_id) |
---|
| 54 | PORT_WRITE(out_DECOD_OUT_CONTEXT_ID [i],reg_QUEUE->front()->_context_id [index]); |
---|
| 55 | if (_param->_have_port_depth) |
---|
| 56 | PORT_WRITE(out_DECOD_OUT_DEPTH [i],reg_QUEUE->front()->_depth [index]); |
---|
[137] | 57 | #ifdef STATISTICS |
---|
| 58 | PORT_WRITE(out_DECOD_OUT_INSTRUCTION [i],reg_QUEUE->front()->_instruction [index]); |
---|
| 59 | #endif |
---|
[111] | 60 | PORT_WRITE(out_DECOD_OUT_TYPE [i],reg_QUEUE->front()->_type [index]); |
---|
| 61 | PORT_WRITE(out_DECOD_OUT_OPERATION [i],reg_QUEUE->front()->_operation [index]); |
---|
| 62 | PORT_WRITE(out_DECOD_OUT_NO_EXECUTE [i],reg_QUEUE->front()->_no_execute [index]); |
---|
[123] | 63 | // PORT_WRITE(out_DECOD_OUT_HAVE_EVENT [i],0); |
---|
| 64 | PORT_WRITE(out_DECOD_OUT_LAST_EVENT [i],0); |
---|
[111] | 65 | PORT_WRITE(out_DECOD_OUT_IS_DELAY_SLOT [i],reg_QUEUE->front()->_is_delay_slot [index]); |
---|
[139] | 66 | PORT_WRITE(out_DECOD_OUT_SAVE_RAT [i],reg_QUEUE->front()->_save_rat [index]); |
---|
[111] | 67 | #ifdef DEBUG |
---|
| 68 | PORT_WRITE(out_DECOD_OUT_ADDRESS [i],reg_QUEUE->front()->_address [index]); |
---|
| 69 | #endif |
---|
| 70 | PORT_WRITE(out_DECOD_OUT_ADDRESS_NEXT [i],reg_QUEUE->front()->_address_next [index]); |
---|
| 71 | PORT_WRITE(out_DECOD_OUT_HAS_IMMEDIAT [i],reg_QUEUE->front()->_has_immediat [index]); |
---|
| 72 | PORT_WRITE(out_DECOD_OUT_IMMEDIAT [i],reg_QUEUE->front()->_immediat [index]); |
---|
| 73 | PORT_WRITE(out_DECOD_OUT_READ_RA [i],reg_QUEUE->front()->_read_ra [index]); |
---|
| 74 | PORT_WRITE(out_DECOD_OUT_NUM_REG_RA [i],reg_QUEUE->front()->_num_reg_ra [index]); |
---|
| 75 | PORT_WRITE(out_DECOD_OUT_READ_RB [i],reg_QUEUE->front()->_read_rb [index]); |
---|
| 76 | PORT_WRITE(out_DECOD_OUT_NUM_REG_RB [i],reg_QUEUE->front()->_num_reg_rb [index]); |
---|
| 77 | PORT_WRITE(out_DECOD_OUT_READ_RC [i],reg_QUEUE->front()->_read_rc [index]); |
---|
| 78 | PORT_WRITE(out_DECOD_OUT_NUM_REG_RC [i],reg_QUEUE->front()->_num_reg_rc [index]); |
---|
| 79 | PORT_WRITE(out_DECOD_OUT_WRITE_RD [i],reg_QUEUE->front()->_write_rd [index]); |
---|
| 80 | PORT_WRITE(out_DECOD_OUT_NUM_REG_RD [i],reg_QUEUE->front()->_num_reg_rd [index]); |
---|
| 81 | PORT_WRITE(out_DECOD_OUT_WRITE_RE [i],reg_QUEUE->front()->_write_re [index]); |
---|
| 82 | PORT_WRITE(out_DECOD_OUT_NUM_REG_RE [i],reg_QUEUE->front()->_num_reg_re [index]); |
---|
| 83 | PORT_WRITE(out_DECOD_OUT_EXCEPTION_USE [i],reg_QUEUE->front()->_exception_use [index]); |
---|
| 84 | PORT_WRITE(out_DECOD_OUT_EXCEPTION [i],reg_QUEUE->front()->_exception [index]); |
---|
| 85 | } |
---|
| 86 | |
---|
| 87 | //-------------------------------------------------------------------- |
---|
| 88 | //-----[ NB_INST ]---------------------------------------------------- |
---|
| 89 | //-------------------------------------------------------------------- |
---|
| 90 | for (uint32_t i=0; i<_param->_nb_context; i++) |
---|
| 91 | PORT_WRITE(out_NB_INST_ALL [i], reg_NB_INST [i]); |
---|
[123] | 92 | } |
---|
| 93 | else |
---|
| 94 | { |
---|
| 95 | for (uint32_t i=0; i<_param->_nb_inst_decod; i++) |
---|
| 96 | { |
---|
| 97 | internal_DECOD_IN_ACK [i] = 0; |
---|
| 98 | } |
---|
| 99 | for (uint32_t i=0; i<_param->_nb_context; i++) |
---|
| 100 | PORT_WRITE(out_NB_INST_ALL [i], 0); |
---|
| 101 | } |
---|
| 102 | |
---|
| 103 | // Write output |
---|
| 104 | for (uint32_t i=0; i<_param->_nb_inst_decod; i++) |
---|
| 105 | { |
---|
| 106 | PORT_WRITE(out_DECOD_IN_ACK [i],internal_DECOD_IN_ACK [i]); |
---|
| 107 | } |
---|
[111] | 108 | |
---|
[123] | 109 | |
---|
[111] | 110 | log_end(Decod_queue,FUNCTION); |
---|
| 111 | }; |
---|
| 112 | |
---|
| 113 | }; // end namespace decod_queue |
---|
| 114 | }; // end namespace decod_unit |
---|
| 115 | }; // end namespace front_end |
---|
| 116 | }; // end namespace multi_front_end |
---|
| 117 | }; // end namespace core |
---|
| 118 | |
---|
| 119 | }; // end namespace behavioural |
---|
| 120 | }; // end namespace morpheo |
---|
| 121 | #endif |
---|