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_genMealy_pop.cpp @ 81

Last change on this file since 81 was 81, checked in by rosiere, 16 years ago
  • Finish Environment (and test)
  • Continue predictor_unit
  • Add external tools
  • svn keyword "Id" set
  • Property svn:keywords set to Id
File size: 2.1 KB
Line 
1#ifdef SYSTEMC
2/*
3 * $Id: Free_List_unit_genMealy_pop.cpp 81 2008-04-15 18:40:01Z 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::genMealy_pop"
23  void Free_List_unit::genMealy_pop (void)
24  {
25    log_printf(FUNC,Free_List_unit,FUNCTION,"Begin");
26
27    for (uint32_t i=0; i<_param->_nb_pop; i++)
28      {
29        uint32_t offset = i*_param->_nb_bank_by_pop;
30
31        // GPR
32        bool gpr_ack = not PORT_READ(in_POP_GPR_VAL[i]);
33
34        if (not gpr_ack)
35          for (uint32_t j=0; j<_param->_nb_bank_by_pop; j++)
36            {
37              uint32_t bank = offset+((j+internal_BANK_PRIORITY)%_param->_nb_bank_by_pop);
38             
39              if (not _gpr_list[bank].empty())
40                {
41                  // find
42                  gpr_ack = true;
43                  internal_POP_GPR_BANK [i] = bank;
44                  PORT_WRITE(out_POP_GPR_NUM_REG [i],
45                             //(bank << _param->_shift) |
46                             _gpr_list[bank].front());
47                 
48                  break;
49                }
50            }
51
52        // SPR
53        bool spr_ack = not PORT_READ(in_POP_SPR_VAL[i]);
54
55        if (not spr_ack)
56          for (uint32_t j=0; j<_param->_nb_bank_by_pop; j++)
57            {
58              uint32_t bank = offset+((j+internal_BANK_PRIORITY)%_param->_nb_bank_by_pop);
59             
60              if (not _spr_list[bank].empty())
61                {
62                  // find
63                  spr_ack = true;
64                  internal_POP_SPR_BANK [i] = bank;
65                  PORT_WRITE(out_POP_SPR_NUM_REG [i],
66                             //(bank << _param->_shift) |
67                             _spr_list[bank].front());
68                 
69                  break;
70                }
71            }
72
73        internal_POP_ACK [i] = gpr_ack and spr_ack;
74       
75        PORT_WRITE(out_POP_ACK [i], internal_POP_ACK [i]);
76      }
77   
78
79    log_printf(FUNC,Free_List_unit,FUNCTION,"End");
80  };
81
82}; // end namespace free_list_unit
83}; // end namespace register_translation_unit
84}; // end namespace rename_unit
85}; // end namespace ooo_engine
86}; // end namespace multi_ooo_engine
87}; // end namespace core
88
89}; // end namespace behavioural
90}; // end namespace morpheo             
91#endif
Note: See TracBrowser for help on using the repository browser.