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

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

Modif for performance :
1) Load Store Unit : store send request to valid exeception
2) Commit_unit : retire can bypass store
3) Commit_unit : add stat to manage store instruction
4) Load Store Unit and Load Store Pointer Manager : add store_queue_ptr_read
5) Fix lot of bug

  • Property svn:keywords set to Id
File size: 8.7 KB
Line 
1#ifdef SYSTEMC
2/*
3 * $Id: Issue_queue_function_in_order_genMealy_issue_out.cpp 122 2009-06-03 08:15:51Z 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::function_in_order_genMealy_issue_out"
21  void Issue_queue::function_in_order_genMealy_issue_out (void)
22  {
23    log_begin(Issue_queue,FUNCTION);
24    log_function(Issue_queue,FUNCTION,_name.c_str());
25
26    // ===================================================================
27    // =====[ ISSUE_OUT ]=================================================
28    // ===================================================================
29    {
30      Tcontrol_t val [_param->_nb_inst_issue];
31
32      uint32_t index=0;
33      for (uint32_t i=0; i<_param->_nb_inst_issue; i++)
34        val [i] = 0;
35
36      //--------------------------------------
37      // From Reexecute_queue
38      //--------------------------------------
39
40      // scan all reexecute_queue slot ...
41//       uint32_t num_reexecute_entry = 0;
42      for (std::list<entry_t*>::iterator it=_reexecute_queue.begin();
43           it!=_reexecute_queue.end();
44           ++it)
45        {
46          entry_t* entry = (*it);
47
48          val [index] = 1;
49             
50          if (_param->_have_port_context_id)
51          PORT_WRITE(out_ISSUE_OUT_CONTEXT_ID            [index], entry->_context_id           );
52          if (_param->_have_port_front_end_id)
53          PORT_WRITE(out_ISSUE_OUT_FRONT_END_ID          [index], entry->_front_end_id         );
54          if (_param->_have_port_rob_ptr  )
55          PORT_WRITE(out_ISSUE_OUT_PACKET_ID             [index], entry->_packet_id            );
56          PORT_WRITE(out_ISSUE_OUT_OPERATION             [index], entry->_operation            );
57          PORT_WRITE(out_ISSUE_OUT_TYPE                  [index], entry->_type                 );
58          PORT_WRITE(out_ISSUE_OUT_STORE_QUEUE_PTR_WRITE [index], entry->_store_queue_ptr_write);
59          PORT_WRITE(out_ISSUE_OUT_STORE_QUEUE_PTR_READ  [index], entry->_store_queue_ptr_read );
60          PORT_WRITE(out_ISSUE_OUT_STORE_QUEUE_EMPTY     [index], entry->_store_queue_empty    );
61          if (_param->_have_port_load_queue_ptr)
62          PORT_WRITE(out_ISSUE_OUT_LOAD_QUEUE_PTR_WRITE  [index], entry->_load_queue_ptr_write );
63          PORT_WRITE(out_ISSUE_OUT_HAS_IMMEDIAT          [index], entry->_has_immediat         );
64          PORT_WRITE(out_ISSUE_OUT_IMMEDIAT              [index], entry->_immediat             );
65          PORT_WRITE(out_ISSUE_OUT_READ_RA               [index], entry->_read_ra              );
66          PORT_WRITE(out_ISSUE_OUT_NUM_REG_RA            [index], entry->_num_reg_ra           );
67          PORT_WRITE(out_ISSUE_OUT_READ_RB               [index], entry->_read_rb              );
68          PORT_WRITE(out_ISSUE_OUT_NUM_REG_RB            [index], entry->_num_reg_rb           );
69          PORT_WRITE(out_ISSUE_OUT_READ_RC               [index], entry->_read_rc              );
70          PORT_WRITE(out_ISSUE_OUT_NUM_REG_RC            [index], entry->_num_reg_rc           );
71          PORT_WRITE(out_ISSUE_OUT_WRITE_RD              [index], entry->_write_rd             );
72          PORT_WRITE(out_ISSUE_OUT_NUM_REG_RD            [index], entry->_num_reg_rd           );
73          PORT_WRITE(out_ISSUE_OUT_WRITE_RE              [index], entry->_write_re             );
74          PORT_WRITE(out_ISSUE_OUT_NUM_REG_RE            [index], entry->_num_reg_re           );
75
76          internal_ISSUE_OUT_FROM_REEXECUTE [index] = true;
77//        internal_ISSUE_OUT_NUM_BANK       [index] = num_reexecute_entry;
78          internal_ISSUE_OUT_ENTRY          [index] = entry;
79
80          index ++; // next slot
81        }
82     
83      //--------------------------------------
84      // From Issue_queue
85      //--------------------------------------
86      index = _param->_nb_inst_reexecute;
87
88      log_printf(TRACE,Issue_queue,FUNCTION,"  * From Issue_queue");
89
90      // for all instruction in issue_queue head ...
91      for (uint32_t i=0; i<_param->_nb_bank; ++i)
92        {
93          uint32_t num_bank=(reg_NUM_BANK_HEAD+i)%_param->_nb_bank;
94         
95          log_printf(TRACE,Issue_queue,FUNCTION,"    * Bank [%d]",num_bank);
96         
97//           bool find = false;
98         
99          // ... test if have an instruction
100          if (not _issue_queue [num_bank].empty())
101            {
102              log_printf(TRACE,Issue_queue,FUNCTION,"      * Not Empty !!!");
103
104              // read instruction
105              entry_t* entry = _issue_queue [num_bank].front();
106             
107//               Tcontrol_t issue_ack = PORT_READ(in_ISSUE_OUT_ACK [index]);
108             
109              log_printf(TRACE,Issue_queue,FUNCTION,"      * Issue [%d]",index);
110//               log_printf(TRACE,Issue_queue,FUNCTION,"        * issue_ack            : %d",issue_ack);
111//            log_printf(TRACE,Issue_queue,FUNCTION,"        * previous transaction : %d",val[index]);
112//            log_printf(TRACE,Issue_queue,FUNCTION,"        * can issue type       : %d",_param->_table_issue_type [index][entry->_type]);
113
114              // in_order : test if find a valid read_unit
115//               if (issue_ack)
116//                 {
117//                log_printf(TRACE,Issue_queue,FUNCTION,"        * find !!!");
118                 
119//                   find = true;
120//                 }
121
122              // find a issue port
123              val [index] = true; // instruction is valid
124             
125              if (_param->_have_port_context_id)
126              PORT_WRITE(out_ISSUE_OUT_CONTEXT_ID            [index], entry->_context_id           );
127              if (_param->_have_port_front_end_id)
128              PORT_WRITE(out_ISSUE_OUT_FRONT_END_ID          [index], entry->_front_end_id         );
129              if (_param->_have_port_rob_ptr  )
130              PORT_WRITE(out_ISSUE_OUT_PACKET_ID             [index], entry->_packet_id            );
131              PORT_WRITE(out_ISSUE_OUT_OPERATION             [index], entry->_operation            );
132              PORT_WRITE(out_ISSUE_OUT_TYPE                  [index], entry->_type                 );
133              PORT_WRITE(out_ISSUE_OUT_STORE_QUEUE_PTR_WRITE [index], entry->_store_queue_ptr_write);
134              PORT_WRITE(out_ISSUE_OUT_STORE_QUEUE_PTR_READ  [index], entry->_store_queue_ptr_read );
135              PORT_WRITE(out_ISSUE_OUT_STORE_QUEUE_EMPTY     [index], entry->_store_queue_empty    );
136              if (_param->_have_port_load_queue_ptr)
137              PORT_WRITE(out_ISSUE_OUT_LOAD_QUEUE_PTR_WRITE  [index], entry->_load_queue_ptr_write );
138              PORT_WRITE(out_ISSUE_OUT_HAS_IMMEDIAT          [index], entry->_has_immediat         );
139              PORT_WRITE(out_ISSUE_OUT_IMMEDIAT              [index], entry->_immediat             );
140              PORT_WRITE(out_ISSUE_OUT_READ_RA               [index], entry->_read_ra              );
141              PORT_WRITE(out_ISSUE_OUT_NUM_REG_RA            [index], entry->_num_reg_ra           );
142              PORT_WRITE(out_ISSUE_OUT_READ_RB               [index], entry->_read_rb              );
143              PORT_WRITE(out_ISSUE_OUT_NUM_REG_RB            [index], entry->_num_reg_rb           );
144              PORT_WRITE(out_ISSUE_OUT_READ_RC               [index], entry->_read_rc              );
145              PORT_WRITE(out_ISSUE_OUT_NUM_REG_RC            [index], entry->_num_reg_rc           );
146              PORT_WRITE(out_ISSUE_OUT_WRITE_RD              [index], entry->_write_rd             );
147              PORT_WRITE(out_ISSUE_OUT_NUM_REG_RD            [index], entry->_num_reg_rd           );
148              PORT_WRITE(out_ISSUE_OUT_WRITE_RE              [index], entry->_write_re             );
149              PORT_WRITE(out_ISSUE_OUT_NUM_REG_RE            [index], entry->_num_reg_re           );
150             
151              internal_ISSUE_OUT_FROM_REEXECUTE [index] = false;
152              internal_ISSUE_OUT_NUM_BANK       [index] = num_bank;
153              internal_ISSUE_OUT_ENTRY          [index] = entry;
154
155              index ++; // next slot
156            }
157
158//           if (not find)
159//             {
160//            log_printf(TRACE,Issue_queue,FUNCTION,"      * Not find. Stop Scan (in order)");
161             
162//               break; // stop scan (in order)
163//             }
164        }
165     
166      // Output
167      for (uint32_t i=0; i<_param->_nb_inst_issue; i++)
168        {
169          internal_ISSUE_OUT_VAL [i] = val [i];
170          PORT_WRITE(out_ISSUE_OUT_VAL [i], internal_ISSUE_OUT_VAL [i]);
171
172//           // Type invalid to the Core_Glue network
173//           if (not val [i]) // == empty
174//             PORT_WRITE(out_ISSUE_OUT_TYPE [i], TYPE_INVALID);
175        }
176    }
177
178    log_end(Issue_queue,FUNCTION);
179  };
180
181}; // end namespace issue_queue
182}; // end namespace ooo_engine
183}; // end namespace multi_ooo_engine
184}; // end namespace core
185
186}; // end namespace behavioural
187}; // end namespace morpheo             
188#endif
Note: See TracBrowser for help on using the repository browser.