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

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

1) add constant method - compatibility with SystemC
2) add Script to test sensitive list
3) fix bug in sensitive list

  • Property svn:keywords set to Id
File size: 4.7 KB
Line 
1/*
2 * $Id: Free_List_unit.cpp 132 2009-07-11 16:39:35Z 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_allocation(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#ifdef DEBUG_TEST
88        log_printf(INFO,Free_List_unit,FUNCTION,"Method - genMoore");
89
90        SC_METHOD (genMoore);
91        dont_initialize ();
92        sensitive << (*(in_CLOCK)).neg();
93       
94# ifdef SYSTEMCASS_SPECIFIC
95        // List dependency information
96# endif   
97#endif
98        log_printf(INFO,Free_List_unit,FUNCTION,"Method - genMealy_pop");
99
100        SC_METHOD (genMealy_pop);
101        dont_initialize ();
102        sensitive << (*(in_CLOCK)).neg() // need internal register
103                  << (*(in_NRESET));
104
105        for (uint32_t i=0; i<_param->_nb_pop; i++)
106          sensitive << (*(in_POP_GPR_VAL[i]))
107                    << (*(in_POP_SPR_VAL[i]));
108       
109# ifdef SYSTEMCASS_SPECIFIC
110        // List dependency information
111       
112        for (uint32_t i=0; i<_param->_nb_pop; i++)
113          {
114            (*(out_POP_GPR_NUM_REG [i])) (*(in_POP_GPR_VAL[i]));
115            (*(out_POP_SPR_NUM_REG [i])) (*(in_POP_SPR_VAL[i]));
116            (*(out_POP_ACK         [i])) (*(in_POP_GPR_VAL[i]));
117            (*(out_POP_ACK         [i])) (*(in_POP_SPR_VAL[i]));
118          }
119# endif
120
121        log_printf(INFO,Free_List_unit,FUNCTION,"Method - genMealy_push_gpr");
122
123        SC_METHOD (genMealy_push_gpr);
124        dont_initialize ();
125        sensitive << (*(in_CLOCK)).neg() // need internal register
126                  << (*(in_NRESET));
127
128        for (uint32_t i=0; i<_param->_nb_push; i++)
129          sensitive << (*(in_PUSH_GPR_VAL    [i]))
130                    << (*(in_PUSH_GPR_NUM_REG[i]));
131       
132# ifdef SYSTEMCASS_SPECIFIC
133        // List dependency information
134       
135        for (uint32_t i=0; i<_param->_nb_push; i++)
136          {
137            (*(out_PUSH_GPR_ACK         [i])) (*(in_PUSH_GPR_VAL    [i]));
138            (*(out_PUSH_GPR_ACK         [i])) (*(in_PUSH_GPR_NUM_REG[i]));
139          }
140# endif
141
142        log_printf(INFO,Free_List_unit,FUNCTION,"Method - genMealy_push_spr");
143
144        SC_METHOD (genMealy_push_spr);
145        dont_initialize ();
146        sensitive << (*(in_CLOCK)).neg() // need internal register
147                  << (*(in_NRESET));
148
149        for (uint32_t i=0; i<_param->_nb_push; i++)
150          sensitive << (*(in_PUSH_SPR_VAL    [i]))
151                    << (*(in_PUSH_SPR_NUM_REG[i]));
152       
153# ifdef SYSTEMCASS_SPECIFIC
154        // List dependency information
155       
156        for (uint32_t i=0; i<_param->_nb_push; i++)
157          {
158            (*(out_PUSH_SPR_ACK         [i])) (*(in_PUSH_SPR_VAL    [i]));
159            (*(out_PUSH_SPR_ACK         [i])) (*(in_PUSH_SPR_NUM_REG[i]));
160          }
161# endif
162
163#endif
164      }
165    log_printf(FUNC,Free_List_unit,FUNCTION,"End");
166  };
167   
168#undef  FUNCTION
169#define FUNCTION "Free_List_unit::~Free_List_unit"
170  Free_List_unit::~Free_List_unit (void)
171  {
172    log_printf(FUNC,Free_List_unit,FUNCTION,"Begin");
173
174#ifdef STATISTICS
175    if (usage_is_set(_usage,USE_STATISTICS))
176      statistics_deallocation ();
177
178#endif
179
180    log_printf(INFO,Free_List_unit,FUNCTION,"Deallocation");
181    deallocation ();
182
183    log_printf(FUNC,Free_List_unit,FUNCTION,"End");
184  };
185
186}; // end namespace free_list_unit
187}; // end namespace register_translation_unit
188}; // end namespace rename_unit
189}; // end namespace ooo_engine
190}; // end namespace multi_ooo_engine
191}; // end namespace core
192
193}; // end namespace behavioural
194}; // end namespace morpheo             
Note: See TracBrowser for help on using the repository browser.