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

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

Almost complete design
with Test and test platform

  • Property svn:keywords set to Id
File size: 3.9 KB
Line 
1#ifdef SYSTEMC
2/*
3 * $Id: Free_List_unit_transition.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::transition"
23  void Free_List_unit::transition (void)
24  {
25    log_begin(Free_List_unit,FUNCTION);
26    log_function(Free_List_unit,FUNCTION,_name.c_str());
27
28    if (PORT_READ(in_NRESET) == 0)
29      {
30        internal_BANK_PRIORITY = 0;
31        for (uint32_t i=0; i<_param->_nb_bank; i++)
32          {
33            _gpr_list[i].clear();
34            _spr_list[i].clear();
35          }
36      }
37    else
38      {
39        // ==================================================
40        // =====[ POP ]======================================
41        // ==================================================
42        for (uint32_t i=0; i<_param->_nb_pop; i++)
43          if (PORT_READ(in_POP_VAL[i]) and internal_POP_ACK [i])
44            {
45              log_printf(TRACE,Free_List_unit,FUNCTION,"  * POP [%d]",i);
46
47              if (PORT_READ(in_POP_GPR_VAL [i]))
48                _gpr_list [internal_POP_GPR_BANK[i]].pop_front();
49         
50              if (PORT_READ(in_POP_SPR_VAL [i]))
51                _spr_list [internal_POP_SPR_BANK[i]].pop_front();
52            }
53
54        // ==================================================
55        // =====[ PUSH_GPR ]=================================
56        // ==================================================
57        for (uint32_t i=0; i<_param->_nb_push; i++)
58          if (PORT_READ(in_PUSH_GPR_VAL[i]) and internal_PUSH_GPR_ACK [i])
59            {
60              log_printf(TRACE,Free_List_unit,FUNCTION,"  * PUSH_GPR[%d]",i);
61
62              _gpr_list [internal_PUSH_GPR_BANK[i]].push_back(//_param->_mask_gpr &
63                                                              PORT_READ(in_PUSH_GPR_NUM_REG [i]));
64            }
65        // ==================================================
66        // =====[ PUSH_SPR ]=================================
67        // ==================================================
68        for (uint32_t i=0; i<_param->_nb_push; i++)
69          if (PORT_READ(in_PUSH_SPR_VAL[i]) and internal_PUSH_SPR_ACK [i])
70            {
71              log_printf(TRACE,Free_List_unit,FUNCTION,"  * PUSH_SPR[%d]",i);
72
73              _spr_list [internal_PUSH_SPR_BANK[i]].push_back(//_param->_mask_spr &
74                                                              PORT_READ(in_PUSH_SPR_NUM_REG [i]));
75            }
76
77        if (_param->_priority == PRIORITY_ROUND_ROBIN)
78          internal_BANK_PRIORITY = (internal_BANK_PRIORITY+1)%_param->_nb_bank_by_pop;
79
80#if (DEBUG >= DEBUG_TRACE) and (DEBUG_Free_List_unit == true)
81        log_printf(TRACE,Free_List_unit,FUNCTION,"  * Dump Free List");
82
83        for (uint32_t i=0; i<_param->_nb_bank; ++i)
84          {
85            uint32_t j=0;
86            for (std::list<Tgeneral_address_t>::iterator it=_gpr_list->begin();
87                 it!=_gpr_list->end();
88                 ++it)
89              {
90                log_printf(TRACE,Free_List_unit,FUNCTION,"    * GPR_LIST[%.5d][%.5d] : %.5d",i,j,*it);
91                ++j;
92              }
93          }
94        for (uint32_t i=0; i<_param->_nb_bank; ++i)
95          {
96            uint32_t j=0;
97            for (std::list<Tspecial_address_t>::iterator it=_spr_list->begin();
98                 it!=_spr_list->end();
99                 ++it)
100              {
101                log_printf(TRACE,Free_List_unit,FUNCTION,"    * SPR_LIST[%.5d][%.5d] : %.5d",i,j,*it);
102                ++j;
103              }
104          }
105
106#endif
107      }
108
109#if defined(STATISTICS) or defined(VHDL_TESTBENCH)
110    end_cycle ();
111#endif
112
113    log_end(Free_List_unit,FUNCTION);
114  };
115
116}; // end namespace free_list_unit
117}; // end namespace register_translation_unit
118}; // end namespace rename_unit
119}; // end namespace ooo_engine
120}; // end namespace multi_ooo_engine
121}; // end namespace core
122
123}; // end namespace behavioural
124}; // end namespace morpheo             
125#endif
Note: See TracBrowser for help on using the repository browser.