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 @ 101

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

1) Add soc test
2) fix bug (Pc management, Decod and execute, Update prediction ...)

  • Property svn:keywords set to Id
File size: 3.3 KB
Line 
1#ifdef SYSTEMC
2/*
3 * $Id: Execute_queue_transition.cpp 101 2009-01-15 17:19:08Z 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_begin(Execute_queue,FUNCTION);
26    log_function(Execute_queue,FUNCTION,_name.c_str());
27
28    if (PORT_READ(in_NRESET) == 0)
29      {
30        // Flush queue
31        // FIXME "queue reset"
32        // > 1) flush one slot by cycle
33        // > 2) flush all slot in one cycle
34
35        _queue->clear();
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_back(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_front();
63          }
64      }
65
66#ifdef STATISTICS
67    if (usage_is_set(_usage,USE_STATISTICS))
68      *(_stat_use_queue) += _queue->size();
69#endif
70   
71#if DEBUG_Execute_queue and (DEBUG >= DEBUG_TRACE)
72    log_printf(TRACE,Execute_queue,FUNCTION,"  * Dump Execute_queue");
73    {
74      uint32_t i=0;
75      for (std::list<execute_queue_entry_t *>::iterator it=_queue->begin();
76           it!=_queue->end();
77           ++it)
78        {
79          log_printf(TRACE,Execute_queue,FUNCTION,"  [%d] %.2d %.2d %.2d, %.4d, %.1d, %.2d %.1d, %.8x %.8x",
80                     i,
81                     (*it)->_context_id   ,
82                     (*it)->_front_end_id ,
83                     (*it)->_ooo_engine_id,
84                     (*it)->_packet_id    ,
85                   //(*it)->_operation    ,
86                   //(*it)->_type         ,
87                     (*it)->_flags        ,
88                     (*it)->_exception    ,
89                     (*it)->_no_sequence  ,
90                     (*it)->_address      ,
91                     (*it)->_data
92                     );
93          i++;
94        }
95    }
96#endif
97
98
99#if defined(STATISTICS) or defined(VHDL_TESTBENCH)
100    end_cycle ();
101#endif
102
103    log_end(Execute_queue,FUNCTION);
104  };
105
106}; // end namespace execute_queue
107}; // end namespace write_unit
108}; // end namespace multi_write_unit
109}; // end namespace execute_loop
110}; // end namespace multi_execute_loop
111}; // end namespace core
112
113}; // end namespace behavioural
114}; // end namespace morpheo             
115#endif
Note: See TracBrowser for help on using the repository browser.