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 @ 88

Last change on this file since 88 was 88, checked in by rosiere, 16 years ago

Almost complete design
with Test and test platform

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