source: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Write_unit/Write_unit/Execute_queue/src/Execute_queue_transition.cpp @ 88

Last change on this file since 88 was 88, checked in by rosiere, 15 years ago

Almost complete design
with Test and test platform

  • Property svn:keywords set to Id
File size: 2.4 KB
Line 
1#ifdef SYSTEMC
2/*
3 * $Id: Execute_queue_transition.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_Write_unit/Write_unit/Execute_queue/include/Execute_queue.h"
10
11namespace morpheo                    {
12namespace behavioural {
13namespace core {
14namespace multi_execute_loop {
15namespace execute_loop {
16namespace multi_write_unit {
17namespace write_unit {
18namespace 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_rob_ptr      )?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               PORT_READ(in_EXECUTE_QUEUE_IN_DATA         ));
54           
55            _queue->push(entry);
56          }
57
58        // Test if pop
59        if (internal_EXECUTE_QUEUE_OUT_VAL and PORT_READ(in_EXECUTE_QUEUE_OUT_ACK))
60          {
61            delete _queue->front();
62            _queue->pop();
63          }
64      }
65
66#ifdef STATISTICS
67    if (usage_is_set(_usage,USE_STATISTICS))
68      *(_stat_use_queue) += _queue->size();
69#endif
70   
71
72#if defined(STATISTICS) or defined(VHDL_TESTBENCH)
73    end_cycle ();
74#endif
75
76    log_printf(FUNC,Execute_queue,FUNCTION,"End");
77  };
78
79}; // end namespace execute_queue
80}; // end namespace write_unit
81}; // end namespace multi_write_unit
82}; // end namespace execute_loop
83}; // end namespace multi_execute_loop
84}; // end namespace core
85
86}; // end namespace behavioural
87}; // end namespace morpheo             
88#endif
Note: See TracBrowser for help on using the repository browser.