source: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Rename_unit/Register_translation_unit/Register_Address_Translation_unit/src/Register_Address_Translation_unit_genMealy_retire.cpp @ 128

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

Modif for performance :
1) Load Store Unit : store send request to valid exeception
2) Commit_unit : retire can bypass store
3) Commit_unit : add stat to manage store instruction
4) Load Store Unit and Load Store Pointer Manager : add store_queue_ptr_read
5) Fix lot of bug

  • Property svn:keywords set to Id
File size: 5.8 KB
Line 
1#ifdef SYSTEMC
2/*
3 * $Id: Register_Address_Translation_unit_genMealy_retire.cpp 122 2009-06-03 08:15:51Z rosiere $
4 *
5 * [ Description ]
6 *
7 */
8
9#include "Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Rename_unit/Register_translation_unit/Register_Address_Translation_unit/include/Register_Address_Translation_unit.h"
10
11namespace morpheo                    {
12namespace behavioural {
13namespace core {
14namespace multi_ooo_engine {
15namespace ooo_engine {
16namespace rename_unit {
17namespace register_translation_unit {
18namespace register_address_translation_unit {
19
20
21#undef  FUNCTION
22#define FUNCTION "Register_Address_Translation_unit::genMealy_retire"
23  void Register_Address_Translation_unit::genMealy_retire (void)
24  {
25    log_begin(Register_Address_Translation_unit,FUNCTION);
26    log_function(Register_Address_Translation_unit,FUNCTION,_name.c_str());
27
28    if (PORT_READ(in_NRESET) != 0)
29      {
30    // Init internal update table
31    for (uint32_t i=0; i<_param->_nb_front_end; i++)
32      for (uint32_t j=0; j<_param->_nb_context[i]; j++)
33        {
34          log_printf(TRACE,Register_Address_Translation_unit,FUNCTION,"  * init [%d][%d]",i,j);
35
36          // An event occure
37          // bool event = (PORT_READ(in_RETIRE_EVENT_STATE [i][j]) != EVENT_STATE_NO_EVENT);
38          bool reset_update_table = (PORT_READ(in_RETIRE_EVENT_VAL [i][j]) and // always ack
39                                     (PORT_READ(in_RETIRE_EVENT_STATE [i][j]) == EVENT_STATE_EVENT));
40
41          log_printf(TRACE,Register_Address_Translation_unit,FUNCTION,"    * reset_update_table : %d",reset_update_table);
42
43          // not event -> update_table == 1 -> always update
44          // event     -> update_table and not reset
45          for (uint32_t k=0; k<_param->_nb_general_register_logic; ++k)
46            internal_rat_gpr_update_table [i][j][k] = // not event or
47                                                      (not reset_update_table and rat_gpr_update_table [i][j][k]);
48          for (uint32_t k=0; k<_param->_nb_special_register_logic; ++k)
49            internal_rat_spr_update_table [i][j][k] = // not event or
50                                                      (not reset_update_table and rat_spr_update_table [i][j][k]);
51        }
52
53    // RETIRE is in order -> also don't need test if an instruction is valid
54    for (uint32_t i=0; i<_param->_nb_inst_retire; i++)
55      {
56        log_printf(TRACE,Register_Address_Translation_unit,FUNCTION,"  * inst_retire [%d]",i);
57
58        // init -> need't restore old value
59        Tcontrol_t retire_restore_rd_phy_old = false;
60        Tcontrol_t retire_restore_re_phy_old = false;
61
62        Tcontext_t front_end_id   = (_param->_have_port_front_end_id)?PORT_READ(in_RETIRE_FRONT_END_ID [i]):0;
63        Tcontext_t context_id     = (_param->_have_port_context_id  )?PORT_READ(in_RETIRE_CONTEXT_ID   [i]):0;
64        Tcontrol_t retire_restore = (PORT_READ(in_RETIRE_EVENT_STATE [front_end_id][context_id]) != EVENT_STATE_NO_EVENT);
65
66        log_printf(TRACE,Register_Address_Translation_unit,FUNCTION,"    * front_end_id         : %d",front_end_id);
67        log_printf(TRACE,Register_Address_Translation_unit,FUNCTION,"    * context_id           : %d",context_id  );
68        log_printf(TRACE,Register_Address_Translation_unit,FUNCTION,"    * restore              : %d",retire_restore);
69
70        // Test if event -> need restore ?
71        if (retire_restore)
72          {
73            log_printf(TRACE,Register_Address_Translation_unit,FUNCTION,"      * Have event");
74                       
75            // Test and update update table
76            if (PORT_READ(in_RETIRE_WRITE_RD [i]))
77              {
78                Tgeneral_address_t rd_log = PORT_READ(in_RETIRE_NUM_REG_RD_LOG [i]);
79                retire_restore_rd_phy_old = (internal_rat_gpr_update_table[front_end_id][context_id][rd_log] == 0);
80
81//                 log_printf(TRACE,Register_Address_Translation_unit,FUNCTION,"    * write_rd");
82//                 log_printf(TRACE,Register_Address_Translation_unit,FUNCTION,"      * rd_log             : %d",rd_log);
83//                 log_printf(TRACE,Register_Address_Translation_unit,FUNCTION,"      * rat_gpr_update     : %d",internal_rat_gpr_update_table[front_end_id][context_id][rd_log]);
84
85                internal_rat_gpr_update_table[front_end_id][context_id][rd_log] = 1;
86              }
87            if (PORT_READ(in_RETIRE_WRITE_RE [i]))
88              {
89//                 log_printf(TRACE,Register_Address_Translation_unit,FUNCTION,"    * write_re");
90
91                Tgeneral_address_t re_log = PORT_READ(in_RETIRE_NUM_REG_RE_LOG [i]);
92                retire_restore_re_phy_old = (internal_rat_spr_update_table[front_end_id][context_id][re_log] == 0);
93                internal_rat_spr_update_table[front_end_id][context_id][re_log] = 1;
94              }
95
96            log_printf(TRACE,Register_Address_Translation_unit,FUNCTION,"      * restore_rd_phy_old   : %d",retire_restore_rd_phy_old);
97            log_printf(TRACE,Register_Address_Translation_unit,FUNCTION,"      * restore_re_phy_old   : %d",retire_restore_re_phy_old);
98          }
99
100        internal_RETIRE_RESTORE            [i] = retire_restore;
101        internal_RETIRE_RESTORE_RD_PHY_OLD [i] = retire_restore_rd_phy_old;
102        internal_RETIRE_RESTORE_RE_PHY_OLD [i] = retire_restore_re_phy_old;
103             
104        PORT_WRITE(out_RETIRE_RESTORE           [i], internal_RETIRE_RESTORE            [i]);
105        PORT_WRITE(out_RETIRE_RESTORE_RD_PHY_OLD[i], internal_RETIRE_RESTORE_RD_PHY_OLD [i]);
106        PORT_WRITE(out_RETIRE_RESTORE_RE_PHY_OLD[i], internal_RETIRE_RESTORE_RE_PHY_OLD [i]);
107      }
108      }
109
110    log_end(Register_Address_Translation_unit,FUNCTION);
111  };
112
113}; // end namespace register_address_translation_unit
114}; // end namespace register_translation_unit
115}; // end namespace rename_unit
116}; // end namespace ooo_engine
117}; // end namespace multi_ooo_engine
118}; // end namespace core
119
120}; // end namespace behavioural
121}; // end namespace morpheo             
122#endif
Note: See TracBrowser for help on using the repository browser.