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.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: 4.5 KB
Line 
1/*
2 * $Id: Free_List_unit.cpp 88 2008-12-10 18:31:39Z rosiere $
3 *
4 * [ Description ]
5 *
6 */
7
8#include "Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Rename_unit/Register_translation_unit/Free_List_unit/include/Free_List_unit.h"
9
10namespace morpheo                    {
11namespace behavioural {
12namespace core {
13namespace multi_ooo_engine {
14namespace ooo_engine {
15namespace rename_unit {
16namespace register_translation_unit {
17namespace free_list_unit {
18
19
20#undef  FUNCTION
21#define FUNCTION "Free_List_unit::Free_List_unit"
22  Free_List_unit::Free_List_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::free_list_unit::Parameters * param,
33   morpheo::behavioural::Tusage_t usage
34   ):
35    _name              (name)
36    ,_param            (param)
37    ,_usage            (usage)
38  {
39    log_printf(FUNC,Free_List_unit,FUNCTION,"Begin");
40
41#if DEBUG_Free_List_unit == true
42    log_printf(INFO,Free_List_unit,FUNCTION,_("<%s> Parameters"),_name.c_str());
43
44    std::cout << *param << std::endl;
45#endif   
46
47    log_printf(INFO,Free_List_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,Free_List_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,Free_List_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        log_printf(INFO,Free_List_unit,FUNCTION,"Method - transition");
78
79        SC_METHOD (transition);
80        dont_initialize ();
81        sensitive << (*(in_CLOCK)).pos();
82       
83# ifdef SYSTEMCASS_SPECIFIC
84        // List dependency information
85# endif   
86
87        log_printf(INFO,Free_List_unit,FUNCTION,"Method - genMealy_pop");
88
89        SC_METHOD (genMealy_pop);
90        dont_initialize ();
91        sensitive << (*(in_CLOCK)).neg(); // need internal register
92        for (uint32_t i=0; i<_param->_nb_pop; i++)
93          sensitive << (*(in_POP_GPR_VAL[i]))
94                    << (*(in_POP_SPR_VAL[i]));
95       
96# ifdef SYSTEMCASS_SPECIFIC
97        // List dependency information
98       
99        for (uint32_t i=0; i<_param->_nb_pop; i++)
100          {
101            (*(out_POP_GPR_NUM_REG [i])) (*(in_POP_GPR_VAL[i]));
102            (*(out_POP_SPR_NUM_REG [i])) (*(in_POP_SPR_VAL[i]));
103            (*(out_POP_ACK         [i])) (*(in_POP_GPR_VAL[i]));
104            (*(out_POP_ACK         [i])) (*(in_POP_SPR_VAL[i]));
105          }
106# endif
107
108        log_printf(INFO,Free_List_unit,FUNCTION,"Method - genMealy_push_gpr");
109
110        SC_METHOD (genMealy_push_gpr);
111        dont_initialize ();
112        sensitive << (*(in_CLOCK)).neg(); // need internal register
113        for (uint32_t i=0; i<_param->_nb_push; i++)
114          sensitive << (*(in_PUSH_GPR_VAL    [i]))
115                    << (*(in_PUSH_GPR_NUM_REG[i]));
116       
117# ifdef SYSTEMCASS_SPECIFIC
118        // List dependency information
119       
120        for (uint32_t i=0; i<_param->_nb_push; i++)
121          {
122            (*(out_PUSH_GPR_ACK         [i])) (*(in_PUSH_GPR_VAL    [i]));
123            (*(out_PUSH_GPR_ACK         [i])) (*(in_PUSH_GPR_NUM_REG[i]));
124          }
125# endif
126
127        log_printf(INFO,Free_List_unit,FUNCTION,"Method - genMealy_push_spr");
128
129        SC_METHOD (genMealy_push_spr);
130        dont_initialize ();
131        sensitive << (*(in_CLOCK)).neg(); // need internal register
132        for (uint32_t i=0; i<_param->_nb_push; i++)
133          sensitive << (*(in_PUSH_SPR_VAL    [i]))
134                    << (*(in_PUSH_SPR_NUM_REG[i]));
135       
136# ifdef SYSTEMCASS_SPECIFIC
137        // List dependency information
138       
139        for (uint32_t i=0; i<_param->_nb_push; i++)
140          {
141            (*(out_PUSH_SPR_ACK         [i])) (*(in_PUSH_SPR_VAL    [i]));
142            (*(out_PUSH_SPR_ACK         [i])) (*(in_PUSH_SPR_NUM_REG[i]));
143          }
144# endif
145
146#endif
147      }
148    log_printf(FUNC,Free_List_unit,FUNCTION,"End");
149  };
150   
151#undef  FUNCTION
152#define FUNCTION "Free_List_unit::~Free_List_unit"
153  Free_List_unit::~Free_List_unit (void)
154  {
155    log_printf(FUNC,Free_List_unit,FUNCTION,"Begin");
156
157#ifdef STATISTICS
158    if (usage_is_set(_usage,USE_STATISTICS))
159      {
160        log_printf(INFO,Free_List_unit,FUNCTION,"Generate Statistics file");
161       
162        delete _stat;
163      }
164#endif
165
166    log_printf(INFO,Free_List_unit,FUNCTION,"Deallocation");
167    deallocation ();
168
169    log_printf(FUNC,Free_List_unit,FUNCTION,"End");
170  };
171
172}; // end namespace free_list_unit
173}; // end namespace register_translation_unit
174}; // end namespace rename_unit
175}; // end namespace ooo_engine
176}; // end namespace multi_ooo_engine
177}; // end namespace core
178
179}; // end namespace behavioural
180}; // end namespace morpheo             
Note: See TracBrowser for help on using the repository browser.