1 | #ifdef SYSTEMC |
---|
2 | /* |
---|
3 | * $Id: Read_queue_genMealy_read_queue_out_val.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_val" |
---|
22 | void Read_queue::genMealy_read_queue_out_val (void) |
---|
23 | { |
---|
24 | log_begin(Read_queue,FUNCTION); |
---|
25 | log_function(Read_queue,FUNCTION,_name.c_str()); |
---|
26 | |
---|
27 | internal_READ_QUEUE_OUT_READ_RA_VAL = (// Previous value |
---|
28 | _queue_head->_read_ra_val and |
---|
29 | // Test if have already access at the registerfile |
---|
30 | not PORT_READ(in_GPR_READ_ACK [0]) |
---|
31 | ); |
---|
32 | |
---|
33 | internal_READ_QUEUE_OUT_READ_RB_VAL = (_queue_head->_read_rb_val and |
---|
34 | not PORT_READ(in_GPR_READ_ACK [1]) |
---|
35 | ); |
---|
36 | |
---|
37 | internal_READ_QUEUE_OUT_READ_RC_VAL = (_queue_head->_read_rc_val and |
---|
38 | not PORT_READ(in_SPR_READ_ACK [0]) |
---|
39 | ); |
---|
40 | |
---|
41 | // Test all bypass |
---|
42 | for (uint32_t i=0; i<_param->_nb_gpr_write ; i++) |
---|
43 | { |
---|
44 | bool cmp; |
---|
45 | |
---|
46 | if (_param->_have_port_ooo_engine_id) |
---|
47 | cmp = (PORT_READ (in_GPR_WRITE_OOO_ENGINE_ID [i]) == _queue_head->_ooo_engine_id); |
---|
48 | else |
---|
49 | cmp = true; |
---|
50 | |
---|
51 | // Test if this bypass is valid |
---|
52 | if ((PORT_READ (in_GPR_WRITE_VAL [i]) == 1) and cmp) |
---|
53 | { |
---|
54 | Tgeneral_address_t gpr_write_num_reg = PORT_READ(in_GPR_WRITE_NUM_REG [i]); |
---|
55 | |
---|
56 | if (_queue_head->_num_reg_ra == gpr_write_num_reg) |
---|
57 | internal_READ_QUEUE_OUT_READ_RA_VAL = 0; |
---|
58 | |
---|
59 | if (_queue_head->_num_reg_rb == gpr_write_num_reg) |
---|
60 | internal_READ_QUEUE_OUT_READ_RB_VAL = 0; |
---|
61 | } |
---|
62 | } |
---|
63 | |
---|
64 | for (uint32_t i=0; i<_param->_nb_spr_write ; i++) |
---|
65 | { |
---|
66 | bool cmp; |
---|
67 | |
---|
68 | if (_param->_have_port_ooo_engine_id) |
---|
69 | cmp = (PORT_READ (in_SPR_WRITE_OOO_ENGINE_ID [i]) == _queue_head->_ooo_engine_id); |
---|
70 | else |
---|
71 | cmp = true; |
---|
72 | |
---|
73 | // Test if this bypass is valid |
---|
74 | if ((PORT_READ (in_SPR_WRITE_VAL [i]) == 1) and cmp) |
---|
75 | { |
---|
76 | Tspecial_address_t spr_write_num_reg = PORT_READ(in_SPR_WRITE_NUM_REG [i]); |
---|
77 | |
---|
78 | if (_queue_head->_num_reg_rc == spr_write_num_reg) |
---|
79 | internal_READ_QUEUE_OUT_READ_RC_VAL = 0; |
---|
80 | } |
---|
81 | } |
---|
82 | |
---|
83 | // Affectation out port |
---|
84 | |
---|
85 | // READ_QUEUE_OUT_VAL : mealy |
---|
86 | internal_READ_QUEUE_OUT_VAL = (not _queue->empty() and |
---|
87 | not internal_READ_QUEUE_OUT_READ_RA_VAL and |
---|
88 | not internal_READ_QUEUE_OUT_READ_RB_VAL and |
---|
89 | not internal_READ_QUEUE_OUT_READ_RC_VAL |
---|
90 | ); |
---|
91 | |
---|
92 | // READ_QUEUE_OUT_VAL : moore |
---|
93 | // internal_READ_QUEUE_OUT_VAL = (not _queue->empty() and |
---|
94 | // not _queue_head->_read_ra_val and |
---|
95 | // not _queue_head->_read_rb_val and |
---|
96 | // not _queue_head->_read_rc_val |
---|
97 | // ); |
---|
98 | |
---|
99 | |
---|
100 | PORT_WRITE(out_READ_QUEUE_OUT_VAL, internal_READ_QUEUE_OUT_VAL); |
---|
101 | |
---|
102 | log_printf(TRACE,Read_queue,FUNCTION," * internal_READ_QUEUE_OUT_VAL : %d",internal_READ_QUEUE_OUT_VAL); |
---|
103 | log_printf(TRACE,Read_queue,FUNCTION," * _queue->empty() : %d",_queue->empty()); |
---|
104 | log_printf(TRACE,Read_queue,FUNCTION," * internal_READ_QUEUE_OUT_READ_RA_VAL : %d",internal_READ_QUEUE_OUT_READ_RA_VAL); |
---|
105 | log_printf(TRACE,Read_queue,FUNCTION," * _queue_head->_read_ra_val : %d",_queue_head->_read_ra_val); |
---|
106 | log_printf(TRACE,Read_queue,FUNCTION," * in_GPR_READ_ACK [0] : %d",PORT_READ(in_GPR_READ_ACK [0])); |
---|
107 | log_printf(TRACE,Read_queue,FUNCTION," * internal_READ_QUEUE_OUT_READ_RB_VAL : %d",internal_READ_QUEUE_OUT_READ_RB_VAL); |
---|
108 | log_printf(TRACE,Read_queue,FUNCTION," * _queue_head->_read_rb_val : %d",_queue_head->_read_rb_val); |
---|
109 | log_printf(TRACE,Read_queue,FUNCTION," * in_GPR_READ_ACK [1] : %d",PORT_READ(in_GPR_READ_ACK [1])); |
---|
110 | log_printf(TRACE,Read_queue,FUNCTION," * internal_READ_QUEUE_OUT_READ_RC_VAL : %d",internal_READ_QUEUE_OUT_READ_RC_VAL); |
---|
111 | log_printf(TRACE,Read_queue,FUNCTION," * _queue_head->_read_rc_val : %d",_queue_head->_read_rc_val); |
---|
112 | log_printf(TRACE,Read_queue,FUNCTION," * in_SPR_READ_ACK [0] : %d",PORT_READ(in_SPR_READ_ACK [0])); |
---|
113 | |
---|
114 | log_end(Read_queue,FUNCTION); |
---|
115 | }; |
---|
116 | |
---|
117 | }; // end namespace read_queue |
---|
118 | }; // end namespace read_unit |
---|
119 | }; // end namespace multi_read_unit |
---|
120 | }; // end namespace execute_loop |
---|
121 | }; // end namespace multi_execute_loop |
---|
122 | }; // end namespace core |
---|
123 | |
---|
124 | }; // end namespace behavioural |
---|
125 | }; // end namespace morpheo |
---|
126 | #endif |
---|