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

Last change on this file since 81 was 81, checked in by rosiere, 16 years ago
  • Finish Environment (and test)
  • Continue predictor_unit
  • Add external tools
  • svn keyword "Id" set
  • Property svn:keywords set to Id
File size: 3.9 KB
Line 
1/*
2 * $Id: Stat_List_unit.cpp 81 2008-04-15 18:40:01Z 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
20#undef  FUNCTION
21#define FUNCTION "Stat_List_unit::Stat_List_unit"
22  Stat_List_unit::Stat_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::stat_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,Stat_List_unit,FUNCTION,"Begin");
40
41    log_printf(INFO,Stat_List_unit,FUNCTION,"Allocation");
42
43    allocation (
44#ifdef STATISTICS
45                param_statistics
46#endif
47                );
48
49#ifdef STATISTICS
50    if (_usage & USE_STATISTICS)
51      { 
52        log_printf(INFO,Stat_List_unit,FUNCTION,"Allocation of statistics");
53
54        statistics_declaration(param_statistics);
55      }
56#endif
57
58#ifdef VHDL
59    if (_usage & USE_VHDL)
60      {
61        // generate the vhdl
62        log_printf(INFO,Stat_List_unit,FUNCTION,"Generate the vhdl");
63       
64        vhdl();
65      }
66#endif
67
68#ifdef SYSTEMC
69    if (_usage & USE_SYSTEMC)
70      {
71        // Constant
72        for (uint32_t i=0; i<_param->_nb_inst_retire; i++)
73          {
74            internal_RETIRE_ACK[i] = 1;
75            PORT_WRITE(out_RETIRE_ACK[i], internal_RETIRE_ACK[i]);
76          }
77
78        log_printf(INFO,Stat_List_unit,FUNCTION,"Method - transition");
79
80        SC_METHOD (transition);
81        dont_initialize ();
82        sensitive << (*(in_CLOCK)).pos();
83       
84# ifdef SYSTEMCASS_SPECIFIC
85        // List dependency information
86# endif   
87
88        log_printf(INFO,Stat_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
98        log_printf(INFO,Stat_List_unit,FUNCTION,"Method - genMealy");
99
100        SC_METHOD (genMealy);
101        dont_initialize ();
102        sensitive << (*(in_CLOCK)).neg();
103        for (uint32_t i=0; i<_param->_nb_inst_insert; i++)
104          sensitive << (*(in_INSERT_READ_RA        [i]))
105                    << (*(in_INSERT_NUM_REG_RA_PHY [i]))
106                    << (*(in_INSERT_READ_RB        [i]))
107                    << (*(in_INSERT_NUM_REG_RB_PHY [i]))
108                    << (*(in_INSERT_READ_RC        [i]))
109                    << (*(in_INSERT_NUM_REG_RC_PHY [i]));
110
111# ifdef SYSTEMCASS_SPECIFIC
112        // List dependency information
113
114        for (uint32_t i=0; i<_param->_nb_inst_insert; i++)
115          {
116            (*(out_INSERT_ACK [i])) (*(in_INSERT_READ_RA        [i]));
117            (*(out_INSERT_ACK [i])) (*(in_INSERT_NUM_REG_RA_PHY [i]));
118            (*(out_INSERT_ACK [i])) (*(in_INSERT_READ_RB        [i]));
119            (*(out_INSERT_ACK [i])) (*(in_INSERT_NUM_REG_RB_PHY [i]));
120            (*(out_INSERT_ACK [i])) (*(in_INSERT_READ_RC        [i]));
121            (*(out_INSERT_ACK [i])) (*(in_INSERT_NUM_REG_RC_PHY [i]));
122          }
123# endif   
124       
125#endif
126      }
127    log_printf(FUNC,Stat_List_unit,FUNCTION,"End");
128  };
129   
130#undef  FUNCTION
131#define FUNCTION "Stat_List_unit::~Stat_List_unit"
132  Stat_List_unit::~Stat_List_unit (void)
133  {
134    log_printf(FUNC,Stat_List_unit,FUNCTION,"Begin");
135
136#ifdef STATISTICS
137    if (_usage & USE_STATISTICS)
138      {
139        log_printf(INFO,Stat_List_unit,FUNCTION,"Generate Statistics file");
140       
141        delete _stat;
142      }
143#endif
144
145    log_printf(INFO,Stat_List_unit,FUNCTION,"Deallocation");
146    deallocation ();
147
148    log_printf(FUNC,Stat_List_unit,FUNCTION,"End");
149  };
150
151}; // end namespace stat_list_unit
152}; // end namespace register_translation_unit
153}; // end namespace rename_unit
154}; // end namespace ooo_engine
155}; // end namespace multi_ooo_engine
156}; // end namespace core
157
158}; // end namespace behavioural
159}; // end namespace morpheo             
Note: See TracBrowser for help on using the repository browser.