source: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Issue_queue/src/Issue_queue_transition.cpp @ 111

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

1) Decod_queue : multi implementation (one_fifo, multi_fifo)
2) Issue_queue : multi implementation (in_order, out_of_order)
3) Direction : Add Meta predictor
4) Context_State : re add Branch_complete, More priority to Load miss (is not speculative)
5) Return_Address_Stack : update reg_PREDICT pointer on decod miss prediction
6) UPT : Fix bug in multi event
7) Prediction_glue : in read_stack case, insert in UPT pc_next
8) Rename select : when rob have an event (need flush), read_r{a,b,c} and write_r{d,e} is set at 0

  • Property svn:keywords set to Id
File size: 8.2 KB
Line 
1#ifdef SYSTEMC
2/*
3 * $Id: Issue_queue_transition.cpp 111 2009-02-27 18:37:40Z rosiere $
4 *
5 * [ Description ]
6 *
7 */
8
9#include "Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Issue_queue/include/Issue_queue.h"
10
11namespace morpheo                    {
12namespace behavioural {
13namespace core {
14namespace multi_ooo_engine {
15namespace ooo_engine {
16namespace issue_queue {
17
18
19#undef  FUNCTION
20#define FUNCTION "Issue_queue::transition"
21  void Issue_queue::transition (void)
22  {
23    log_begin(Issue_queue,FUNCTION);
24    log_function(Issue_queue,FUNCTION,_name.c_str());
25
26    if (PORT_READ(in_NRESET) == 0)
27      {
28        _priority_in ->reset();
29        _reexecute_queue.clear();
30      }
31    else
32      {
33        _priority_in ->transition();
34
35        // ===================================================================
36        // =====[ REEXECUTE_UNIT ]============================================
37        // ===================================================================
38
39        for (uint32_t i=0; i<_param->_nb_inst_reexecute; ++i)
40          if (PORT_READ(in_REEXECUTE_VAL [i]) and internal_REEXECUTE_ACK [i])
41            {
42              log_printf(TRACE,Issue_queue,FUNCTION,"  * REEXECUTE [%d]",i);
43#ifdef STATISTICS
44              if (usage_is_set(_usage,USE_STATISTICS))
45                (*_stat_nb_inst_reexecute) ++;
46#endif
47              entry_t * entry = new entry_t
48                (
49                 (_param->_have_port_context_id    )?PORT_READ(in_REEXECUTE_CONTEXT_ID            [i]):0,
50                 (_param->_have_port_front_end_id  )?PORT_READ(in_REEXECUTE_FRONT_END_ID          [i]):0,
51                 (_param->_have_port_rob_ptr       )?PORT_READ(in_REEXECUTE_PACKET_ID             [i]):0,
52                                                     PORT_READ(in_REEXECUTE_OPERATION             [i]),
53                                                     PORT_READ(in_REEXECUTE_TYPE                  [i]),
54                                                     PORT_READ(in_REEXECUTE_STORE_QUEUE_PTR_WRITE [i]),
55                 (_param->_have_port_load_queue_ptr)?PORT_READ(in_REEXECUTE_LOAD_QUEUE_PTR_WRITE  [i]):0,
56                                                     PORT_READ(in_REEXECUTE_HAS_IMMEDIAT          [i]),
57                                                     PORT_READ(in_REEXECUTE_IMMEDIAT              [i]),
58                                                     PORT_READ(in_REEXECUTE_READ_RA               [i]),
59                                                     PORT_READ(in_REEXECUTE_NUM_REG_RA            [i]),
60                                                     PORT_READ(in_REEXECUTE_READ_RB               [i]),
61                                                     PORT_READ(in_REEXECUTE_NUM_REG_RB            [i]),
62                                                     PORT_READ(in_REEXECUTE_READ_RC               [i]),
63                                                     PORT_READ(in_REEXECUTE_NUM_REG_RC            [i]),
64                                                     PORT_READ(in_REEXECUTE_WRITE_RD              [i]),
65                                                     PORT_READ(in_REEXECUTE_NUM_REG_RD            [i]),
66                                                     PORT_READ(in_REEXECUTE_WRITE_RE              [i]),
67                                                     PORT_READ(in_REEXECUTE_NUM_REG_RE            [i])
68                 );
69
70              _reexecute_queue.push_back(entry);
71            }
72
73        // ===================================================================
74        // =====[ ISSUE_OUT ]=================================================
75        // ===================================================================
76
77        for (uint32_t i=0; i<_param->_nb_inst_issue; ++i)
78          if (internal_ISSUE_OUT_VAL [i] and PORT_READ(in_ISSUE_OUT_ACK [i]))
79            {
80#ifdef STATISTICS
81              if (usage_is_set(_usage,USE_STATISTICS))
82                (*_stat_nb_inst_issue_out ) ++;
83#endif
84              if (internal_ISSUE_OUT_FROM_REEXECUTE [i])
85                {
86                  entry_t * entry = internal_ISSUE_OUT_ENTRY    [i];
87                 
88                  log_printf(TRACE,Issue_queue,FUNCTION,"  * ISSUE_OUT [%d] - From Reexecute_queue",i);
89                 
90                  _reexecute_queue.remove(entry);
91                 
92                  delete entry;
93                }
94                // else ... in function specific
95            }
96      }
97
98    // specific implementation
99    (this->*function_transition) ();
100
101    // ===================================================================
102    // =====[ PRINT ]====================================================
103    // ===================================================================
104
105#if defined(DEBUG) and DEBUG_Issue_queue and (DEBUG >= DEBUG_TRACE)
106    log_printf(TRACE,Issue_queue,FUNCTION,"  * Dump Issue_queue");
107
108    for (uint32_t i=0; i<_param->_nb_bank; i++)
109      {
110        log_printf(TRACE,Issue_queue,FUNCTION,"    * Bank [%d] size : %d",i,(int)_issue_queue[i].size());
111
112        uint32_t j = 0;
113        for (std::list<entry_t*>::iterator it=_issue_queue[i].begin();it!=_issue_queue[i].end(); ++it)
114          {
115            log_printf(TRACE,Issue_queue,FUNCTION,"      [%.4d] %.2d %.2d %.4d, %.2d %.3d, %.2d %.2d, %.1d %.8x, %.1d %.4d, %.1d %.4d, %.1d %.4d, %.1d %.4d, %.1d %.4d",
116                       j,
117                       
118                       (*it)->_context_id           ,
119                       (*it)->_front_end_id         ,
120                       (*it)->_packet_id            ,
121                       
122                       (*it)->_type                 ,
123                       (*it)->_operation            ,
124                       
125                       (*it)->_store_queue_ptr_write,
126                       (*it)->_load_queue_ptr_write ,
127                       
128                       (*it)->_has_immediat         ,
129                       (*it)->_immediat             ,
130                       
131                       (*it)->_read_ra              ,
132                       (*it)->_num_reg_ra           ,
133                       
134                       (*it)->_read_rb              ,
135                       (*it)->_num_reg_rb           ,
136                       
137                       (*it)->_read_rc              ,
138                       (*it)->_num_reg_rc           ,
139                       
140                       (*it)->_write_rd             ,
141                       (*it)->_num_reg_rd           ,
142                       
143                       (*it)->_write_re             ,
144                       (*it)->_num_reg_re           );
145           
146                ++j;
147              }
148      }
149
150    {
151      log_printf(TRACE,Issue_queue,FUNCTION,"    * Reexecute_queue - size : %d",(int)_reexecute_queue.size());
152     
153      uint32_t i = 0;
154
155      for (std::list<entry_t*>::iterator it=_reexecute_queue.begin();it!=_reexecute_queue.end(); ++it)
156        {
157          log_printf(TRACE,Issue_queue,FUNCTION,"      [%.4d] %.2d %.2d %.4d, %.2d %.3d, %.2d %.2d, %.1d %.8x, %.1d %.4d, %.1d %.4d, %.1d %.4d, %.1d %.4d, %.1d %.4d",
158                     i,
159                     
160                     (*it)->_context_id           ,
161                     (*it)->_front_end_id         ,
162                     (*it)->_packet_id            ,
163                     
164                     (*it)->_type                 ,
165                     (*it)->_operation            ,
166                     
167                     (*it)->_store_queue_ptr_write,
168                     (*it)->_load_queue_ptr_write ,
169                     
170                     (*it)->_has_immediat         ,
171                     (*it)->_immediat             ,
172                     
173                     (*it)->_read_ra              ,
174                     (*it)->_num_reg_ra           ,
175                     
176                     (*it)->_read_rb              ,
177                     (*it)->_num_reg_rb           ,
178                     
179                     (*it)->_read_rc              ,
180                     (*it)->_num_reg_rc           ,
181                     
182                     (*it)->_write_rd             ,
183                     (*it)->_num_reg_rd           ,
184                     
185                     (*it)->_write_re             ,
186                     (*it)->_num_reg_re           );
187          ++i;
188        }
189    }
190#endif
191
192#ifdef STATISTICS
193    if (usage_is_set(_usage,USE_STATISTICS))
194      for (uint32_t i=0; i<_param->_nb_bank; i++)
195        *(_stat_bank_nb_inst [i]) += _issue_queue[i].size();
196#endif
197
198
199
200#if defined(STATISTICS) or defined(VHDL_TESTBENCH)
201    end_cycle ();
202#endif
203
204    log_end(Issue_queue,FUNCTION);
205  };
206
207}; // end namespace issue_queue
208}; // end namespace ooo_engine
209}; // end namespace multi_ooo_engine
210}; // end namespace core
211
212}; // end namespace behavioural
213}; // end namespace morpheo             
214#endif
Note: See TracBrowser for help on using the repository browser.