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

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

1) Fix performance
2) add auto generation to SPECINT2000
3) add reset in genMoore and genMealy

  • Property svn:keywords set to Id
File size: 4.3 KB
Line 
1/*
2 * $Id: Stat_List_unit.cpp 123 2009-06-08 20:43:30Z 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_insert; i++)
78          {
79            internal_INSERT_ACK[i] = 1;
80            PORT_WRITE(out_INSERT_ACK[i], internal_INSERT_ACK[i]);
81          }
82        for (uint32_t i=0; i<_param->_nb_inst_retire; i++)
83          {
84            internal_RETIRE_ACK[i] = 1;
85            PORT_WRITE(out_RETIRE_ACK[i], internal_RETIRE_ACK[i]);
86          }
87
88        log_printf(INFO,Stat_List_unit,FUNCTION,"Method - transition");
89
90        SC_METHOD (transition);
91        dont_initialize ();
92        sensitive << (*(in_CLOCK)).pos();
93       
94# ifdef SYSTEMCASS_SPECIFIC
95        // List dependency information
96# endif   
97
98        log_printf(INFO,Stat_List_unit,FUNCTION,"Method - genMoore");
99
100        SC_METHOD (genMoore);
101        dont_initialize ();
102        sensitive << (*(in_CLOCK)).neg(); // need internal register
103       
104# ifdef SYSTEMCASS_SPECIFIC
105        // List dependency information
106# endif   
107
108//      log_printf(INFO,Stat_List_unit,FUNCTION,"Method - genMealy");
109
110//      SC_METHOD (genMealy);
111//      dont_initialize ();
112//      sensitive << (*(in_CLOCK)).neg(); // need internal register
113//      for (uint32_t i=0; i<_param->_nb_inst_insert; i++)
114//        sensitive << (*(in_INSERT_READ_RA        [i]))
115//                  << (*(in_INSERT_NUM_REG_RA_PHY [i]))
116//                  << (*(in_INSERT_READ_RB        [i]))
117//                  << (*(in_INSERT_NUM_REG_RB_PHY [i]))
118//                  << (*(in_INSERT_READ_RC        [i]))
119//                  << (*(in_INSERT_NUM_REG_RC_PHY [i]));
120
121// # ifdef SYSTEMCASS_SPECIFIC
122//      // List dependency information
123
124//      for (uint32_t i=0; i<_param->_nb_inst_insert; i++)
125//        {
126//          (*(out_INSERT_ACK [i])) (*(in_INSERT_READ_RA        [i]));
127//          (*(out_INSERT_ACK [i])) (*(in_INSERT_NUM_REG_RA_PHY [i]));
128//          (*(out_INSERT_ACK [i])) (*(in_INSERT_READ_RB        [i]));
129//          (*(out_INSERT_ACK [i])) (*(in_INSERT_NUM_REG_RB_PHY [i]));
130//          (*(out_INSERT_ACK [i])) (*(in_INSERT_READ_RC        [i]));
131//          (*(out_INSERT_ACK [i])) (*(in_INSERT_NUM_REG_RC_PHY [i]));
132//        }
133// # endif   
134       
135#endif
136      }
137    log_printf(FUNC,Stat_List_unit,FUNCTION,"End");
138  };
139   
140#undef  FUNCTION
141#define FUNCTION "Stat_List_unit::~Stat_List_unit"
142  Stat_List_unit::~Stat_List_unit (void)
143  {
144    log_printf(FUNC,Stat_List_unit,FUNCTION,"Begin");
145
146#ifdef STATISTICS
147    if (usage_is_set(_usage,USE_STATISTICS))
148      {
149        log_printf(INFO,Stat_List_unit,FUNCTION,"Generate Statistics file");
150       
151        delete _stat;
152      }
153#endif
154
155    log_printf(INFO,Stat_List_unit,FUNCTION,"Deallocation");
156    deallocation ();
157
158    log_printf(FUNC,Stat_List_unit,FUNCTION,"End");
159  };
160
161}; // end namespace stat_list_unit
162}; // end namespace register_translation_unit
163}; // end namespace rename_unit
164}; // end namespace ooo_engine
165}; // end namespace multi_ooo_engine
166}; // end namespace core
167
168}; // end namespace behavioural
169}; // end namespace morpheo             
Note: See TracBrowser for help on using the repository browser.