source: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Rename_unit/Register_translation_unit/Free_List_unit/src/Free_List_unit_transition.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: 7.0 KB
RevLine 
[78]1#ifdef SYSTEMC
2/*
3 * $Id: Free_List_unit_transition.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/Register_translation_unit/Free_List_unit/include/Free_List_unit.h"
10
11namespace morpheo                    {
12namespace behavioural {
13namespace core {
14namespace multi_ooo_engine {
15namespace ooo_engine {
16namespace rename_unit {
17namespace register_translation_unit {
18namespace free_list_unit {
19
20
21#undef  FUNCTION
22#define FUNCTION "Free_List_unit::transition"
23  void Free_List_unit::transition (void)
24  {
[88]25    log_begin(Free_List_unit,FUNCTION);
26    log_function(Free_List_unit,FUNCTION,_name.c_str());
[78]27
28    if (PORT_READ(in_NRESET) == 0)
29      {
[109]30        _priority_gpr->reset();
31        _priority_spr->reset();
32
[78]33        for (uint32_t i=0; i<_param->_nb_bank; i++)
34          {
35            _gpr_list[i].clear();
36            _spr_list[i].clear();
37          }
38      }
39    else
40      {
[109]41        _priority_gpr->transition();
42        _priority_spr->transition();
43
[78]44        // ==================================================
45        // =====[ POP ]======================================
46        // ==================================================
47        for (uint32_t i=0; i<_param->_nb_pop; i++)
48          if (PORT_READ(in_POP_VAL[i]) and internal_POP_ACK [i])
49            {
[88]50              log_printf(TRACE,Free_List_unit,FUNCTION,"  * POP [%d]",i);
51
[110]52#ifdef STATISTICS
53              (*_stat_nb_inst_pop) ++;
54#endif
55
[78]56              if (PORT_READ(in_POP_GPR_VAL [i]))
[110]57                {
58#ifdef STATISTICS
59                  (*_stat_nb_inst_pop_gpr) ++;
60#endif
61                  _gpr_list [internal_POP_GPR_BANK[i]].pop_front();
62                }
[78]63         
64              if (PORT_READ(in_POP_SPR_VAL [i]))
[110]65                {
66#ifdef STATISTICS
67                  (*_stat_nb_inst_pop_spr) ++;
68#endif
69                  _spr_list [internal_POP_SPR_BANK[i]].pop_front();
70                }
[78]71            }
72
73        // ==================================================
74        // =====[ PUSH_GPR ]=================================
75        // ==================================================
76        for (uint32_t i=0; i<_param->_nb_push; i++)
77          if (PORT_READ(in_PUSH_GPR_VAL[i]) and internal_PUSH_GPR_ACK [i])
[88]78            {
79              log_printf(TRACE,Free_List_unit,FUNCTION,"  * PUSH_GPR[%d]",i);
[108]80              log_printf(TRACE,Free_List_unit,FUNCTION,"    * bank    : %d",internal_PUSH_GPR_BANK[i]);
81              log_printf(TRACE,Free_List_unit,FUNCTION,"    * num_reg : %d",PORT_READ(in_PUSH_GPR_NUM_REG [i]));
[78]82
[110]83#ifdef STATISTICS
84              (*_stat_nb_inst_push_gpr) ++;
85#endif
86
[108]87              _gpr_list [internal_PUSH_GPR_BANK[i]].push_back(PORT_READ(in_PUSH_GPR_NUM_REG [i]));
[88]88            }
[78]89        // ==================================================
90        // =====[ PUSH_SPR ]=================================
91        // ==================================================
92        for (uint32_t i=0; i<_param->_nb_push; i++)
93          if (PORT_READ(in_PUSH_SPR_VAL[i]) and internal_PUSH_SPR_ACK [i])
[88]94            {
95              log_printf(TRACE,Free_List_unit,FUNCTION,"  * PUSH_SPR[%d]",i);
[108]96              log_printf(TRACE,Free_List_unit,FUNCTION,"    * bank    : %d",internal_PUSH_SPR_BANK[i]);
97              log_printf(TRACE,Free_List_unit,FUNCTION,"    * num_reg : %d",PORT_READ(in_PUSH_SPR_NUM_REG [i]));
[78]98
[110]99#ifdef STATISTICS
100              (*_stat_nb_inst_push_spr) ++;
101#endif
102
[108]103              _spr_list [internal_PUSH_SPR_BANK[i]].push_back(PORT_READ(in_PUSH_SPR_NUM_REG [i]));
[88]104            }
105
[110]106#ifdef STATISTICS
107          for (uint32_t i=0; i<_param->_nb_bank; ++i)
108            {
109              (*(_stat_bank_gpr_nb_elt [i])) += _gpr_list[i].size();
110              (*(_stat_bank_spr_nb_elt [i])) += _spr_list[i].size();
111            }
112#endif
113
[88]114#if (DEBUG >= DEBUG_TRACE) and (DEBUG_Free_List_unit == true)
[106]115        {
116          uint32_t limit = 4;
117     
118          log_printf(TRACE,Free_List_unit,FUNCTION,"  * Dump Free List");
119          for (uint32_t i=0; i<_param->_nb_bank; ++i)
120            {
[108]121              log_printf(TRACE,Free_List_unit,FUNCTION,"    * GPR [%d] - NB_ELT : %d",i,_gpr_list[i].size());
122
[106]123              uint32_t j=0;
[108]124              for (std::list<Tgeneral_address_t>::iterator it=_gpr_list[i].begin();
125                   it!=_gpr_list[i].end();
[106]126                   )
127                {
128                  std::string str = "";
129             
130                  for (uint32_t x=0; x<limit; x++)
131                    {
[108]132                      if (it==_gpr_list[i].end())
[106]133                        break;
134                      else
135                        str+=toString("GPR[%.4d][%.4d] : %.5d | ",i,j,*it);
136                      ++it;
137                      ++j;
138                    }
139                  log_printf(TRACE,Register_Address_Translation_unit,FUNCTION,"      * %s",str.c_str());
140                }
141            }
[88]142
[106]143          for (uint32_t i=0; i<_param->_nb_bank; ++i)
144            {
[108]145              log_printf(TRACE,Free_List_unit,FUNCTION,"    * SPR [%d] - NB_ELT : %d",i,_spr_list[i].size());
146
[106]147              uint32_t j=0;
[108]148              for (std::list<Tspecial_address_t>::iterator it=_spr_list[i].begin();
149                   it!=_spr_list[i].end();
[106]150                   )
151                {
152                  std::string str = "";
153
154                  for (uint32_t x=0; x<limit; x++)
155                    {
[108]156                      if (it==_spr_list[i].end())
[106]157                        break;
158                      else
159                        str+=toString("SPR[%.4d][%.4d] : %.5d | ",i,j,*it);
160                      ++it;
161                      ++j;
162                    }
163                  log_printf(TRACE,Register_Address_Translation_unit,FUNCTION,"      * %s",str.c_str());
164                }
165            }
166        }
167#endif
168
169#ifdef DEBUG_TEST
170        if (1)
[108]171          for (uint32_t i=0; i<_param->_nb_bank; ++i)
[110]172            {
[108]173            for (std::list<Tgeneral_address_t>::iterator it1=_gpr_list[i].begin();
174                 it1!=_gpr_list[i].end();
[106]175                 ++it1
176                 )
[88]177              {
[106]178                std::list<Tgeneral_address_t>::iterator it2 = it1;
179
180                it2 ++;
[108]181                while (it2 != _gpr_list[i].end())
[106]182                  {
183                    if (*it1 == *it2)
184                      throw ERRORMORPHEO (FUNCTION,toString(_("In free list, Same GPR (%d)"),*it1));
185                    it2 ++;
186                  }
[88]187              }
[106]188
[108]189            for (std::list<Tspecial_address_t>::iterator it1=_spr_list[i].begin();
190                 it1!=_spr_list[i].end();
[106]191                 ++it1
192                 )
[88]193              {
[106]194                std::list<Tspecial_address_t>::iterator it2 = it1;
195
196                it2 ++;
[108]197                while (it2 != _spr_list[i].end())
[106]198                  {
199                    if (*it1 == *it2)
200                      throw ERRORMORPHEO (FUNCTION,toString(_("In free list, Same SPR (%d)"),*it1));
201                    it2 ++;
202                  }
[88]203              }
204          }
[106]205#endif
[88]206
[78]207      }
208
209#if defined(STATISTICS) or defined(VHDL_TESTBENCH)
210    end_cycle ();
211#endif
212
[88]213    log_end(Free_List_unit,FUNCTION);
[78]214  };
215
216}; // end namespace free_list_unit
217}; // end namespace register_translation_unit
218}; // end namespace rename_unit
219}; // end namespace ooo_engine
220}; // end namespace multi_ooo_engine
221}; // end namespace core
222
223}; // end namespace behavioural
224}; // end namespace morpheo             
225#endif
Note: See TracBrowser for help on using the repository browser.