1 | #ifdef SYSTEMC |
---|
2 | /* |
---|
3 | * $Id$ |
---|
4 | * |
---|
5 | * [ Description ] |
---|
6 | * |
---|
7 | */ |
---|
8 | |
---|
9 | #include "Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Write_unit/Write_unit/Execute_queue/include/Execute_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 execute_queue { |
---|
19 | |
---|
20 | |
---|
21 | #undef FUNCTION |
---|
22 | #define FUNCTION "Execute_queue::transition" |
---|
23 | void Execute_queue::transition (void) |
---|
24 | { |
---|
25 | log_printf(FUNC,Execute_queue,FUNCTION,"Begin"); |
---|
26 | |
---|
27 | if (PORT_READ(in_NRESET) == 0) |
---|
28 | { |
---|
29 | // Flush queue |
---|
30 | // FIXME "queue reset" |
---|
31 | // > 1) flush one slot by cycle |
---|
32 | // > 2) flush all slot in one cycle |
---|
33 | |
---|
34 | while (_queue->empty() == false) |
---|
35 | _queue->pop(); |
---|
36 | } |
---|
37 | else |
---|
38 | { |
---|
39 | // Test if push |
---|
40 | if (PORT_READ(in_EXECUTE_QUEUE_IN_VAL) and internal_EXECUTE_QUEUE_IN_ACK) |
---|
41 | { |
---|
42 | execute_queue_entry_t * entry = new execute_queue_entry_t |
---|
43 | ((_param->_have_port_context_id )?PORT_READ(in_EXECUTE_QUEUE_IN_CONTEXT_ID ):0, |
---|
44 | (_param->_have_port_front_end_id )?PORT_READ(in_EXECUTE_QUEUE_IN_FRONT_END_ID ):0, |
---|
45 | (_param->_have_port_ooo_engine_id)?PORT_READ(in_EXECUTE_QUEUE_IN_OOO_ENGINE_ID):0, |
---|
46 | (_param->_have_port_packet_id )?PORT_READ(in_EXECUTE_QUEUE_IN_PACKET_ID ):0, |
---|
47 | //PORT_READ(in_EXECUTE_QUEUE_IN_OPERATION ), |
---|
48 | //PORT_READ(in_EXECUTE_QUEUE_IN_TYPE ), |
---|
49 | PORT_READ(in_EXECUTE_QUEUE_IN_FLAGS ), |
---|
50 | PORT_READ(in_EXECUTE_QUEUE_IN_EXCEPTION ), |
---|
51 | PORT_READ(in_EXECUTE_QUEUE_IN_NO_SEQUENCE ), |
---|
52 | PORT_READ(in_EXECUTE_QUEUE_IN_ADDRESS )); |
---|
53 | |
---|
54 | _queue->push(entry); |
---|
55 | } |
---|
56 | |
---|
57 | // Test if pop |
---|
58 | if (internal_EXECUTE_QUEUE_OUT_VAL and PORT_READ(in_EXECUTE_QUEUE_OUT_ACK)) |
---|
59 | { |
---|
60 | delete _queue->front(); |
---|
61 | _queue->pop(); |
---|
62 | } |
---|
63 | } |
---|
64 | |
---|
65 | #ifdef STATISTICS |
---|
66 | *(_stat_use_queue) += _queue->size(); |
---|
67 | #endif |
---|
68 | |
---|
69 | |
---|
70 | #if defined(STATISTICS) or defined(VHDL_TESTBENCH) |
---|
71 | end_cycle (); |
---|
72 | #endif |
---|
73 | |
---|
74 | log_printf(FUNC,Execute_queue,FUNCTION,"End"); |
---|
75 | }; |
---|
76 | |
---|
77 | }; // end namespace execute_queue |
---|
78 | }; // end namespace write_unit |
---|
79 | }; // end namespace multi_write_unit |
---|
80 | }; // end namespace execute_loop |
---|
81 | }; // end namespace multi_execute_loop |
---|
82 | }; // end namespace core |
---|
83 | |
---|
84 | }; // end namespace behavioural |
---|
85 | }; // end namespace morpheo |
---|
86 | #endif |
---|