1 | #ifdef SYSTEMC |
---|
2 | /* |
---|
3 | * $Id: Decod_queue_function_one_fifo_genMoore.cpp 137 2010-02-16 12:35:48Z 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 | |
---|
27 | if (PORT_READ(in_NRESET)) |
---|
28 | { |
---|
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]); |
---|
57 | #ifdef STATISTICS |
---|
58 | PORT_WRITE(out_DECOD_OUT_INSTRUCTION [i],reg_QUEUE->front()->_instruction [index]); |
---|
59 | #endif |
---|
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]); |
---|
63 | // PORT_WRITE(out_DECOD_OUT_HAVE_EVENT [i],0); |
---|
64 | PORT_WRITE(out_DECOD_OUT_LAST_EVENT [i],0); |
---|
65 | PORT_WRITE(out_DECOD_OUT_IS_DELAY_SLOT [i],reg_QUEUE->front()->_is_delay_slot [index]); |
---|
66 | #ifdef DEBUG |
---|
67 | PORT_WRITE(out_DECOD_OUT_ADDRESS [i],reg_QUEUE->front()->_address [index]); |
---|
68 | #endif |
---|
69 | PORT_WRITE(out_DECOD_OUT_ADDRESS_NEXT [i],reg_QUEUE->front()->_address_next [index]); |
---|
70 | PORT_WRITE(out_DECOD_OUT_HAS_IMMEDIAT [i],reg_QUEUE->front()->_has_immediat [index]); |
---|
71 | PORT_WRITE(out_DECOD_OUT_IMMEDIAT [i],reg_QUEUE->front()->_immediat [index]); |
---|
72 | PORT_WRITE(out_DECOD_OUT_READ_RA [i],reg_QUEUE->front()->_read_ra [index]); |
---|
73 | PORT_WRITE(out_DECOD_OUT_NUM_REG_RA [i],reg_QUEUE->front()->_num_reg_ra [index]); |
---|
74 | PORT_WRITE(out_DECOD_OUT_READ_RB [i],reg_QUEUE->front()->_read_rb [index]); |
---|
75 | PORT_WRITE(out_DECOD_OUT_NUM_REG_RB [i],reg_QUEUE->front()->_num_reg_rb [index]); |
---|
76 | PORT_WRITE(out_DECOD_OUT_READ_RC [i],reg_QUEUE->front()->_read_rc [index]); |
---|
77 | PORT_WRITE(out_DECOD_OUT_NUM_REG_RC [i],reg_QUEUE->front()->_num_reg_rc [index]); |
---|
78 | PORT_WRITE(out_DECOD_OUT_WRITE_RD [i],reg_QUEUE->front()->_write_rd [index]); |
---|
79 | PORT_WRITE(out_DECOD_OUT_NUM_REG_RD [i],reg_QUEUE->front()->_num_reg_rd [index]); |
---|
80 | PORT_WRITE(out_DECOD_OUT_WRITE_RE [i],reg_QUEUE->front()->_write_re [index]); |
---|
81 | PORT_WRITE(out_DECOD_OUT_NUM_REG_RE [i],reg_QUEUE->front()->_num_reg_re [index]); |
---|
82 | PORT_WRITE(out_DECOD_OUT_EXCEPTION_USE [i],reg_QUEUE->front()->_exception_use [index]); |
---|
83 | PORT_WRITE(out_DECOD_OUT_EXCEPTION [i],reg_QUEUE->front()->_exception [index]); |
---|
84 | } |
---|
85 | |
---|
86 | //-------------------------------------------------------------------- |
---|
87 | //-----[ NB_INST ]---------------------------------------------------- |
---|
88 | //-------------------------------------------------------------------- |
---|
89 | for (uint32_t i=0; i<_param->_nb_context; i++) |
---|
90 | PORT_WRITE(out_NB_INST_ALL [i], reg_NB_INST [i]); |
---|
91 | } |
---|
92 | else |
---|
93 | { |
---|
94 | for (uint32_t i=0; i<_param->_nb_inst_decod; i++) |
---|
95 | { |
---|
96 | internal_DECOD_IN_ACK [i] = 0; |
---|
97 | } |
---|
98 | for (uint32_t i=0; i<_param->_nb_context; i++) |
---|
99 | PORT_WRITE(out_NB_INST_ALL [i], 0); |
---|
100 | } |
---|
101 | |
---|
102 | // Write output |
---|
103 | for (uint32_t i=0; i<_param->_nb_inst_decod; i++) |
---|
104 | { |
---|
105 | PORT_WRITE(out_DECOD_IN_ACK [i],internal_DECOD_IN_ACK [i]); |
---|
106 | } |
---|
107 | |
---|
108 | |
---|
109 | log_end(Decod_queue,FUNCTION); |
---|
110 | }; |
---|
111 | |
---|
112 | }; // end namespace decod_queue |
---|
113 | }; // end namespace decod_unit |
---|
114 | }; // end namespace front_end |
---|
115 | }; // end namespace multi_front_end |
---|
116 | }; // end namespace core |
---|
117 | |
---|
118 | }; // end namespace behavioural |
---|
119 | }; // end namespace morpheo |
---|
120 | #endif |
---|