source: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Rename_unit/Register_translation_unit/Stat_List_unit/src/Stat_List_unit.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: 4.1 KB
Line 
1/*
2 * $Id: Stat_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/Stat_List_unit/include/Stat_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 stat_list_unit {
18
19#undef  FUNCTION
20#define FUNCTION "Stat_List_unit::Stat_List_unit"
21  Stat_List_unit::Stat_List_unit
22  (
23#ifdef SYSTEMC
24   sc_module_name name,
25#else
26   string name,
27#endif
28#ifdef STATISTICS
29   morpheo::behavioural::Parameters_Statistics * param_statistics,
30#endif
31   morpheo::behavioural::core::multi_ooo_engine::ooo_engine::rename_unit::register_translation_unit::stat_list_unit::Parameters * param,
32   morpheo::behavioural::Tusage_t usage
33   ):
34    _name              (name)
35    ,_param            (param)
36    ,_usage            (usage)
37  {
38    log_printf(FUNC,Stat_List_unit,FUNCTION,"Begin");
39
40#if DEBUG_Stat_List_unit == true
41    log_printf(INFO,Stat_List_unit,FUNCTION,_("<%s> Parameters"),_name.c_str());
42
43    std::cout << *param << std::endl;
44#endif   
45
46    log_printf(INFO,Stat_List_unit,FUNCTION,"Allocation");
47
48    allocation (
49#ifdef STATISTICS
50                param_statistics
51#endif
52                );
53
54#ifdef STATISTICS
55    if (usage_is_set(_usage,USE_STATISTICS))
56      { 
57        log_printf(INFO,Stat_List_unit,FUNCTION,"Allocation of statistics");
58
59        statistics_declaration(param_statistics);
60      }
61#endif
62
63#ifdef VHDL
64    if (usage_is_set(_usage,USE_VHDL))
65      {
66        // generate the vhdl
67        log_printf(INFO,Stat_List_unit,FUNCTION,"Generate the vhdl");
68       
69        vhdl();
70      }
71#endif
72
73#ifdef SYSTEMC
74    if (usage_is_set(_usage,USE_SYSTEMC))
75      {
76        // Constant
77        for (uint32_t i=0; i<_param->_nb_inst_retire; i++)
78          {
79            internal_RETIRE_ACK[i] = 1;
80            PORT_WRITE(out_RETIRE_ACK[i], internal_RETIRE_ACK[i]);
81          }
82
83        log_printf(INFO,Stat_List_unit,FUNCTION,"Method - transition");
84
85        SC_METHOD (transition);
86        dont_initialize ();
87        sensitive << (*(in_CLOCK)).pos();
88       
89# ifdef SYSTEMCASS_SPECIFIC
90        // List dependency information
91# endif   
92
93        log_printf(INFO,Stat_List_unit,FUNCTION,"Method - genMoore");
94
95        SC_METHOD (genMoore);
96        dont_initialize ();
97        sensitive << (*(in_CLOCK)).neg(); // need internal register
98       
99# ifdef SYSTEMCASS_SPECIFIC
100        // List dependency information
101# endif   
102
103        log_printf(INFO,Stat_List_unit,FUNCTION,"Method - genMealy");
104
105        SC_METHOD (genMealy);
106        dont_initialize ();
107        sensitive << (*(in_CLOCK)).neg(); // need internal register
108        for (uint32_t i=0; i<_param->_nb_inst_insert; i++)
109          sensitive << (*(in_INSERT_READ_RA        [i]))
110                    << (*(in_INSERT_NUM_REG_RA_PHY [i]))
111                    << (*(in_INSERT_READ_RB        [i]))
112                    << (*(in_INSERT_NUM_REG_RB_PHY [i]))
113                    << (*(in_INSERT_READ_RC        [i]))
114                    << (*(in_INSERT_NUM_REG_RC_PHY [i]));
115
116# ifdef SYSTEMCASS_SPECIFIC
117        // List dependency information
118
119        for (uint32_t i=0; i<_param->_nb_inst_insert; i++)
120          {
121            (*(out_INSERT_ACK [i])) (*(in_INSERT_READ_RA        [i]));
122            (*(out_INSERT_ACK [i])) (*(in_INSERT_NUM_REG_RA_PHY [i]));
123            (*(out_INSERT_ACK [i])) (*(in_INSERT_READ_RB        [i]));
124            (*(out_INSERT_ACK [i])) (*(in_INSERT_NUM_REG_RB_PHY [i]));
125            (*(out_INSERT_ACK [i])) (*(in_INSERT_READ_RC        [i]));
126            (*(out_INSERT_ACK [i])) (*(in_INSERT_NUM_REG_RC_PHY [i]));
127          }
128# endif   
129       
130#endif
131      }
132    log_printf(FUNC,Stat_List_unit,FUNCTION,"End");
133  };
134   
135#undef  FUNCTION
136#define FUNCTION "Stat_List_unit::~Stat_List_unit"
137  Stat_List_unit::~Stat_List_unit (void)
138  {
139    log_printf(FUNC,Stat_List_unit,FUNCTION,"Begin");
140
141#ifdef STATISTICS
142    if (usage_is_set(_usage,USE_STATISTICS))
143      {
144        log_printf(INFO,Stat_List_unit,FUNCTION,"Generate Statistics file");
145       
146        delete _stat;
147      }
148#endif
149
150    log_printf(INFO,Stat_List_unit,FUNCTION,"Deallocation");
151    deallocation ();
152
153    log_printf(FUNC,Stat_List_unit,FUNCTION,"End");
154  };
155
156}; // end namespace stat_list_unit
157}; // end namespace register_translation_unit
158}; // end namespace rename_unit
159}; // end namespace ooo_engine
160}; // end namespace multi_ooo_engine
161}; // end namespace core
162
163}; // end namespace behavioural
164}; // end namespace morpheo             
Note: See TracBrowser for help on using the repository browser.