1 | #ifdef SYSTEMC |
---|
2 | /* |
---|
3 | * $Id: Reexecute_unit_genMealy_reexecute.cpp 88 2008-12-10 18:31:39Z rosiere $ |
---|
4 | * |
---|
5 | * [ Description ] |
---|
6 | * |
---|
7 | */ |
---|
8 | |
---|
9 | #include "Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Reexecute_unit/include/Reexecute_unit.h" |
---|
10 | |
---|
11 | namespace morpheo { |
---|
12 | namespace behavioural { |
---|
13 | namespace core { |
---|
14 | namespace multi_ooo_engine { |
---|
15 | namespace ooo_engine { |
---|
16 | namespace reexecute_unit { |
---|
17 | |
---|
18 | |
---|
19 | #undef FUNCTION |
---|
20 | #define FUNCTION "Reexecute_unit::genMealy_reexecute" |
---|
21 | void Reexecute_unit::genMealy_reexecute (void) |
---|
22 | { |
---|
23 | log_begin(Reexecute_unit,FUNCTION); |
---|
24 | |
---|
25 | // =================================================================== |
---|
26 | // =====[ REEXECUTE ]================================================= |
---|
27 | // =================================================================== |
---|
28 | // Between reexecute_rob and rexecute_queue, reexecute_queue is most priotary |
---|
29 | |
---|
30 | for (uint32_t i=0; i<_param->_nb_inst_reexecute; i++) |
---|
31 | { |
---|
32 | Tcontrol_t val; |
---|
33 | Tcontrol_t ack; |
---|
34 | |
---|
35 | if (not _reexecute_queue [i].empty() and (_reexecute_queue [i].front()->state == STATE_REEXECUTE)) |
---|
36 | { |
---|
37 | val = true ; |
---|
38 | ack = false; |
---|
39 | |
---|
40 | entry_t * entry = _reexecute_queue [i].front(); |
---|
41 | |
---|
42 | if (_param->_have_port_context_id) |
---|
43 | PORT_WRITE(out_REEXECUTE_CONTEXT_ID [i],entry->context_id ); |
---|
44 | if (_param->_have_port_front_end_id) |
---|
45 | PORT_WRITE(out_REEXECUTE_FRONT_END_ID [i],entry->front_end_id ); |
---|
46 | if (_param->_have_port_rob_ptr ) |
---|
47 | PORT_WRITE(out_REEXECUTE_PACKET_ID [i],entry->packet_id ); |
---|
48 | PORT_WRITE(out_REEXECUTE_OPERATION [i],entry->operation ); |
---|
49 | PORT_WRITE(out_REEXECUTE_TYPE [i],entry->type ); |
---|
50 | PORT_WRITE(out_REEXECUTE_STORE_QUEUE_PTR_WRITE [i],0); |
---|
51 | PORT_WRITE(out_REEXECUTE_HAS_IMMEDIAT [i],1); |
---|
52 | PORT_WRITE(out_REEXECUTE_IMMEDIAT [i],entry->data ); |
---|
53 | PORT_WRITE(out_REEXECUTE_WRITE_RD [i],entry->write_rd ); |
---|
54 | PORT_WRITE(out_REEXECUTE_NUM_REG_RD [i],entry->num_reg_rd ); |
---|
55 | } |
---|
56 | else |
---|
57 | { |
---|
58 | val = PORT_READ(in_REEXECUTE_ROB_VAL [i]); |
---|
59 | ack = PORT_READ(in_REEXECUTE_ACK [i]); |
---|
60 | |
---|
61 | if (_param->_have_port_context_id) |
---|
62 | PORT_WRITE(out_REEXECUTE_CONTEXT_ID [i], PORT_READ(in_REEXECUTE_ROB_CONTEXT_ID [i])); |
---|
63 | if (_param->_have_port_front_end_id) |
---|
64 | PORT_WRITE(out_REEXECUTE_FRONT_END_ID [i], PORT_READ(in_REEXECUTE_ROB_FRONT_END_ID [i])); |
---|
65 | if (_param->_have_port_rob_ptr ) |
---|
66 | PORT_WRITE(out_REEXECUTE_PACKET_ID [i], PORT_READ(in_REEXECUTE_ROB_PACKET_ID [i])); |
---|
67 | PORT_WRITE(out_REEXECUTE_OPERATION [i], PORT_READ(in_REEXECUTE_ROB_OPERATION [i])); |
---|
68 | PORT_WRITE(out_REEXECUTE_TYPE [i], PORT_READ(in_REEXECUTE_ROB_TYPE [i])); |
---|
69 | PORT_WRITE(out_REEXECUTE_STORE_QUEUE_PTR_WRITE [i], PORT_READ(in_REEXECUTE_ROB_STORE_QUEUE_PTR_WRITE [i])); |
---|
70 | PORT_WRITE(out_REEXECUTE_HAS_IMMEDIAT [i], 0); |
---|
71 | PORT_WRITE(out_REEXECUTE_IMMEDIAT [i], 0); |
---|
72 | PORT_WRITE(out_REEXECUTE_WRITE_RD [i], 0); |
---|
73 | PORT_WRITE(out_REEXECUTE_NUM_REG_RD [i], 0); |
---|
74 | } |
---|
75 | |
---|
76 | internal_REEXECUTE_VAL [i] = val; |
---|
77 | internal_REEXECUTE_ROB_ACK [i] = ack; |
---|
78 | |
---|
79 | PORT_WRITE(out_REEXECUTE_VAL [i], internal_REEXECUTE_VAL [i]); |
---|
80 | PORT_WRITE(out_REEXECUTE_ROB_ACK [i], internal_REEXECUTE_ROB_ACK [i]); |
---|
81 | } |
---|
82 | |
---|
83 | log_end(Reexecute_unit,FUNCTION); |
---|
84 | }; |
---|
85 | |
---|
86 | }; // end namespace reexecute_unit |
---|
87 | }; // end namespace ooo_engine |
---|
88 | }; // end namespace multi_ooo_engine |
---|
89 | }; // end namespace core |
---|
90 | |
---|
91 | }; // end namespace behavioural |
---|
92 | }; // end namespace morpheo |
---|
93 | #endif |
---|