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.cpp @ 100

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

1) Bug fix (Operation, Instruction)
2) Modif Return Address Stack
3) Add Soft Test
4) Add Soc Test

  • Property svn:keywords set to Id
File size: 5.4 KB
Line 
1/*
2 * $Id: Register_Address_Translation_unit.cpp 100 2009-01-08 13:06:27Z rosiere $
3 *
4 * [ Description ]
5 *
6 */
7
8#include "Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Rename_unit/Register_translation_unit/Register_Address_Translation_unit/include/Register_Address_Translation_unit.h"
9
10namespace morpheo                    {
11namespace behavioural {
12namespace core {
13namespace multi_ooo_engine {
14namespace ooo_engine {
15namespace rename_unit {
16namespace register_translation_unit {
17namespace register_address_translation_unit {
18
19
20#undef  FUNCTION
21#define FUNCTION "Register_Address_Translation_unit::Register_Address_Translation_unit"
22  Register_Address_Translation_unit::Register_Address_Translation_unit
23  (
24#ifdef SYSTEMC
25   sc_module_name name,
26#else
27   string name,
28#endif
29#ifdef STATISTICS
30   morpheo::behavioural::Parameters_Statistics * param_statistics,
31#endif
32   morpheo::behavioural::core::multi_ooo_engine::ooo_engine::rename_unit::register_translation_unit::register_address_translation_unit::Parameters * param,
33   morpheo::behavioural::Tusage_t usage
34   ):
35    _name              (name)
36    ,_param            (param)
37    ,_usage            (usage)
38  {
39    log_printf(FUNC,Register_Address_Translation_unit,FUNCTION,"Begin");
40
41#if DEBUG_Register_Address_Translation_unit == true
42    log_printf(INFO,Register_Address_Translation_unit,FUNCTION,_("<%s> Parameters"),_name.c_str());
43
44    std::cout << *param << std::endl;
45#endif   
46
47    log_printf(INFO,Register_Address_Translation_unit,FUNCTION,"Allocation");
48
49    allocation (
50#ifdef STATISTICS
51                param_statistics
52#endif
53                );
54
55#ifdef STATISTICS
56    if (usage_is_set(_usage,USE_STATISTICS))
57      { 
58        log_printf(INFO,Register_Address_Translation_unit,FUNCTION,"Allocation of statistics");
59
60        statistics_declaration(param_statistics);
61      }
62#endif
63
64#ifdef VHDL
65    if (usage_is_set(_usage,USE_VHDL))
66      {
67        // generate the vhdl
68        log_printf(INFO,Register_Address_Translation_unit,FUNCTION,"Generate the vhdl");
69       
70        vhdl();
71      }
72#endif
73
74#ifdef SYSTEMC
75    if (usage_is_set(_usage,USE_SYSTEMC))
76      {
77        // Constant : accepted already transaction
78        for (uint32_t i=0; i<_param->_nb_inst_insert; i++)
79          {
80            internal_RENAME_ACK [i] = 1;
81            internal_INSERT_ACK [i] = 1;
82
83            PORT_WRITE(out_RENAME_ACK[i],internal_RENAME_ACK [i]);
84            PORT_WRITE(out_INSERT_ACK[i],internal_INSERT_ACK [i]);
85          }
86        for (uint32_t i=0; i<_param->_nb_inst_retire; i++)
87          {
88            internal_RETIRE_ACK [i] = 1;
89
90            PORT_WRITE(out_RETIRE_ACK[i],internal_RETIRE_ACK [i]);
91          }
92
93        log_printf(INFO,Register_Address_Translation_unit,FUNCTION,"Method - transition");
94
95        SC_METHOD (transition);
96        dont_initialize ();
97        sensitive << (*(in_CLOCK)).pos();
98       
99# ifdef SYSTEMCASS_SPECIFIC
100        // List dependency information
101# endif   
102
103        log_printf(INFO,Register_Address_Translation_unit,FUNCTION,"Method - genMealy_rename");
104
105        SC_METHOD (genMealy_rename);
106        dont_initialize ();
107        sensitive << (*(in_CLOCK)).neg(); // need internal register
108        for (uint32_t i=0; i<_param->_nb_inst_insert; i++)
109          {
110            if (_param->_have_port_front_end_id) 
111            sensitive << (*(in_RENAME_FRONT_END_ID   [i]));
112            if (_param->_have_port_context_id  )
113            sensitive << (*(in_RENAME_CONTEXT_ID     [i]));
114           
115            sensitive << (*(in_RENAME_VAL            [i])) // Not necessary
116                      << (*(in_RENAME_NUM_REG_RA_LOG [i]))
117                      << (*(in_RENAME_NUM_REG_RB_LOG [i]))
118                      << (*(in_RENAME_NUM_REG_RC_LOG [i]))
119                      << (*(in_RENAME_NUM_REG_RD_LOG [i]))
120                      << (*(in_RENAME_NUM_REG_RE_LOG [i]));
121      }
122
123
124# ifdef SYSTEMCASS_SPECIFIC
125        // List dependency information
126# endif   
127
128        log_printf(INFO,Register_Address_Translation_unit,FUNCTION,"Method - genMealy_retire");
129
130        SC_METHOD (genMealy_retire);
131        dont_initialize ();
132        sensitive << (*(in_CLOCK)).neg(); // need internal register
133        for (uint32_t i=0; i<_param->_nb_inst_retire; ++i)
134          {
135            if (param->_have_port_front_end_id)
136            sensitive << (*(in_RETIRE_FRONT_END_ID   [i]));
137            if (param->_have_port_context_id)
138            sensitive << (*(in_RETIRE_CONTEXT_ID     [i]));
139           
140            sensitive << (*(in_RETIRE_EVENT_STATE    [i]))
141                      << (*(in_RETIRE_WRITE_RD       [i]))
142                      << (*(in_RETIRE_WRITE_RE       [i]))
143                      << (*(in_RETIRE_NUM_REG_RD_LOG [i]))
144                      << (*(in_RETIRE_NUM_REG_RE_LOG [i]));
145          }
146       
147# ifdef SYSTEMCASS_SPECIFIC
148        // List dependency information
149# endif   
150       
151#endif
152      }
153    log_printf(FUNC,Register_Address_Translation_unit,FUNCTION,"End");
154  };
155   
156#undef  FUNCTION
157#define FUNCTION "Register_Address_Translation_unit::~Register_Address_Translation_unit"
158  Register_Address_Translation_unit::~Register_Address_Translation_unit (void)
159  {
160    log_printf(FUNC,Register_Address_Translation_unit,FUNCTION,"Begin");
161
162#ifdef STATISTICS
163    if (usage_is_set(_usage,USE_STATISTICS))
164      {
165        log_printf(INFO,Register_Address_Translation_unit,FUNCTION,"Generate Statistics file");
166       
167        delete _stat;
168      }
169#endif
170
171    log_printf(INFO,Register_Address_Translation_unit,FUNCTION,"Deallocation");
172    deallocation ();
173
174    log_printf(FUNC,Register_Address_Translation_unit,FUNCTION,"End");
175  };
176
177}; // end namespace register_address_translation_unit
178}; // end namespace register_translation_unit
179}; // end namespace rename_unit
180}; // end namespace ooo_engine
181}; // end namespace multi_ooo_engine
182}; // end namespace core
183
184}; // end namespace behavioural
185}; // end namespace morpheo             
Note: See TracBrowser for help on using the repository browser.