source: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Rename_unit/Rename_select/src/Rename_select_genMealy.cpp @ 110

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

1) OOO_egine : add stat to depiste low perf source
2) Commit : add stat
3) LSU_Pointer : retire - always ack (else combinatory loop). insert - max nb_inst_memory
4) TopLevel? : add debug_idle_time to stop combinatory loop.
5) Issue_queue : add reexecute_queue, new implementation (routage after issue_queue)
6) Decod / Predictor : add "can_continue"

  • Property svn:keywords set to Id
File size: 6.5 KB
Line 
1#ifdef SYSTEMC
2/*
3 * $Id: Rename_select_genMealy.cpp 110 2009-02-19 16:31:47Z rosiere $
4 *
5 * [ Description ]
6 *
7 */
8
9#include "Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Rename_unit/Rename_select/include/Rename_select.h"
10
11namespace morpheo                    {
12namespace behavioural {
13namespace core {
14namespace multi_ooo_engine {
15namespace ooo_engine {
16namespace rename_unit {
17namespace rename_select {
18
19
20#undef  FUNCTION
21#define FUNCTION "Rename_select::genMealy"
22  void Rename_select::genMealy (void)
23  {
24    log_begin(Rename_select,FUNCTION);
25    log_function(Rename_select,FUNCTION,_name.c_str());
26
27    Tcontrol_t val                  [_param->_nb_inst_rename];
28    Tcontrol_t ack                  [_param->_nb_front_end][_param->_max_nb_inst_decod];
29    Tcontrol_t previous_transaction [_param->_nb_front_end];
30
31    for (uint32_t i=0; i<_param->_nb_inst_rename; ++i)
32      val [i] = false;
33    for (uint32_t i=0; i<_param->_nb_front_end; i++)
34      {
35        previous_transaction [i] = true;
36        for (uint32_t j=0; j<_param->_nb_inst_decod[i]; j++)
37          ack [i][j] = false;
38      }
39
40    std::list<generic::priority::select_t> * select = _priority->select();
41    std::list<generic::priority::select_t>::iterator it=select->begin();
42
43    for (uint32_t i=0; i<_param->_nb_inst_rename; i++)
44      {
45        log_printf(TRACE,Rename_select,FUNCTION,"  * RENAME_OUT [%d]",i);
46
47        // Scan all instruction until find
48        while ((it != select->end()) and (val [i] == false))
49          {
50            Tcontext_t x = it->grp;
51            uint32_t   y = it->elt;
52
53            log_printf(TRACE,Rename_select,FUNCTION,"    * front_end[%d].inst_decod[%d]",x,y);
54            log_printf(TRACE,Rename_select,FUNCTION,"      * rename_in_val        : %d",PORT_READ(in_RENAME_IN_VAL[x][y]));
55            log_printf(TRACE,Rename_select,FUNCTION,"      * previous_transaction : %d",previous_transaction[x]);
56
57            // Test if this instruction is valid and if all previous instruction of this front end is an valid transaction
58            if (previous_transaction [x] and
59                PORT_READ(in_RENAME_IN_VAL[x][y]))
60              {
61                // Find !!!
62                val [i]    = true;
63                ack [x][y] = PORT_READ(in_RENAME_OUT_ACK [i]);
64
65                log_printf(TRACE,Rename_select,FUNCTION,"      * rename_out_ack       : %d",PORT_READ(in_RENAME_OUT_ACK[i]));
66
67                Tcontext_t front_end_id = (_param->_have_port_front_end_id)?PORT_READ(in_RENAME_IN_FRONT_END_ID [x][y]):0;
68                Tcontext_t context_id   = (_param->_have_port_context_id  )?PORT_READ(in_RENAME_IN_CONTEXT_ID   [x][y]):0;
69               
70                Tcontrol_t no_execute   = (PORT_READ(in_RENAME_IN_NO_EXECUTE [x][y]));
71                Tcontrol_t read_ra      = (PORT_READ(in_RENAME_IN_READ_RA    [x][y]));
72                Tcontrol_t read_rb      = (PORT_READ(in_RENAME_IN_READ_RB    [x][y]));
73                Tcontrol_t read_rc      = (PORT_READ(in_RENAME_IN_READ_RC    [x][y]));
74                Tcontrol_t write_rd     = (PORT_READ(in_RENAME_IN_WRITE_RD   [x][y]));
75                Tcontrol_t write_re     = (PORT_READ(in_RENAME_IN_WRITE_RE   [x][y]));
76
77                // Attention, j'ai enlevé event_state de la liste de sensibilité
78//                 Tevent_state_t event_state  = PORT_READ(in_RETIRE_EVENT_STATE [front_end_id][context_id]);
79
80//                 Tcontrol_t     no_execute   = (PORT_READ(in_RENAME_IN_NO_EXECUTE [x][y]) or
81//                                                // ROB Flush
82//                                                ((event_state == EVENT_STATE_EVENT  ) or
83//                                                 (event_state == EVENT_STATE_WAITEND)));
84
85//              Tcontrol_t read_ra  = (PORT_READ(in_RENAME_IN_READ_RA  [x][y]) and not no_execute);
86//              Tcontrol_t read_rb  = (PORT_READ(in_RENAME_IN_READ_RB  [x][y]) and not no_execute);
87//              Tcontrol_t read_rc  = (PORT_READ(in_RENAME_IN_READ_RC  [x][y]) and not no_execute);
88//              Tcontrol_t write_rd = (PORT_READ(in_RENAME_IN_WRITE_RD [x][y]) and not no_execute);
89//              Tcontrol_t write_re = (PORT_READ(in_RENAME_IN_WRITE_RE [x][y]) and not no_execute);
90               
91                if (_param->_have_port_front_end_id)
92                PORT_WRITE(out_RENAME_OUT_FRONT_END_ID [i],front_end_id);
93                if (_param->_have_port_context_id)
94                PORT_WRITE(out_RENAME_OUT_CONTEXT_ID   [i],context_id);
95                if (_param->_have_port_depth)
96                PORT_WRITE(out_RENAME_OUT_DEPTH        [i],PORT_READ(in_RENAME_IN_DEPTH         [x][y]));
97                PORT_WRITE(out_RENAME_OUT_TYPE         [i],PORT_READ(in_RENAME_IN_TYPE          [x][y]));
98                PORT_WRITE(out_RENAME_OUT_OPERATION    [i],PORT_READ(in_RENAME_IN_OPERATION     [x][y]));
99                PORT_WRITE(out_RENAME_OUT_NO_EXECUTE   [i],no_execute);
100                PORT_WRITE(out_RENAME_OUT_IS_DELAY_SLOT[i],PORT_READ(in_RENAME_IN_IS_DELAY_SLOT [x][y]));
101#ifdef DEBUG
102                PORT_WRITE(out_RENAME_OUT_ADDRESS      [i],PORT_READ(in_RENAME_IN_ADDRESS       [x][y]));
103#endif
104                PORT_WRITE(out_RENAME_OUT_ADDRESS_NEXT [i],PORT_READ(in_RENAME_IN_ADDRESS_NEXT  [x][y]));
105                PORT_WRITE(out_RENAME_OUT_HAS_IMMEDIAT [i],PORT_READ(in_RENAME_IN_HAS_IMMEDIAT  [x][y]));
106                PORT_WRITE(out_RENAME_OUT_IMMEDIAT     [i],PORT_READ(in_RENAME_IN_IMMEDIAT      [x][y]));
107                PORT_WRITE(out_RENAME_OUT_READ_RA      [i],read_ra);
108                PORT_WRITE(out_RENAME_OUT_NUM_REG_RA   [i],PORT_READ(in_RENAME_IN_NUM_REG_RA    [x][y]));
109                PORT_WRITE(out_RENAME_OUT_READ_RB      [i],read_rb);
110                PORT_WRITE(out_RENAME_OUT_NUM_REG_RB   [i],PORT_READ(in_RENAME_IN_NUM_REG_RB    [x][y]));
111                PORT_WRITE(out_RENAME_OUT_READ_RC      [i],read_rc);
112                PORT_WRITE(out_RENAME_OUT_NUM_REG_RC   [i],PORT_READ(in_RENAME_IN_NUM_REG_RC    [x][y]));
113                PORT_WRITE(out_RENAME_OUT_WRITE_RD     [i],write_rd);
114                PORT_WRITE(out_RENAME_OUT_NUM_REG_RD   [i],PORT_READ(in_RENAME_IN_NUM_REG_RD    [x][y]));
115                PORT_WRITE(out_RENAME_OUT_WRITE_RE     [i],write_re);
116                PORT_WRITE(out_RENAME_OUT_NUM_REG_RE   [i],PORT_READ(in_RENAME_IN_NUM_REG_RE    [x][y]));
117                PORT_WRITE(out_RENAME_OUT_EXCEPTION_USE[i],PORT_READ(in_RENAME_IN_EXCEPTION_USE [x][y]));
118                PORT_WRITE(out_RENAME_OUT_EXCEPTION    [i],PORT_READ(in_RENAME_IN_EXCEPTION     [x][y]));
119              }
120
121            // ack = 1 if previous_transaction == true and rename_in_val == true and rename_out == true
122            previous_transaction [x] = ack [x][y];
123
124            it ++;
125          }
126
127      }
128
129    for (uint32_t i=0; i<_param->_nb_inst_rename; ++i)
130      PORT_WRITE(out_RENAME_OUT_VAL [i], val [i]);
131
132    for (uint32_t i=0; i<_param->_nb_front_end; i++)
133      for (uint32_t j=0; j<_param->_nb_inst_decod[i]; j++)
134        PORT_WRITE(out_RENAME_IN_ACK [i][j], ack [i][j]);
135
136    log_end(Rename_select,FUNCTION);
137  };
138
139}; // end namespace rename_select
140}; // end namespace rename_unit
141}; // end namespace ooo_engine
142}; // end namespace multi_ooo_engine
143}; // end namespace core
144
145}; // end namespace behavioural
146}; // end namespace morpheo             
147#endif
Note: See TracBrowser for help on using the repository browser.