source: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Special_Register_unit/src/Special_Register_unit.cpp @ 131

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

1) add constant method
2) test with systemc 2.2.0

  • Property svn:keywords set to Id
File size: 4.0 KB
Line 
1/*
2 * $Id: Special_Register_unit.cpp 131 2009-07-08 18:40:08Z rosiere $
3 *
4 * [ Description ]
5 *
6 */
7
8#include "Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Special_Register_unit/include/Special_Register_unit.h"
9
10namespace morpheo                    {
11namespace behavioural {
12namespace core {
13namespace multi_ooo_engine {
14namespace ooo_engine {
15namespace special_register_unit {
16
17
18#undef  FUNCTION
19#define FUNCTION "Special_Register_unit::Special_Register_unit"
20  Special_Register_unit::Special_Register_unit
21  (
22#ifdef SYSTEMC
23   sc_module_name name,
24#else
25   string name,
26#endif
27#ifdef STATISTICS
28   morpheo::behavioural::Parameters_Statistics * param_statistics,
29#endif
30   morpheo::behavioural::core::multi_ooo_engine::ooo_engine::special_register_unit::Parameters * param,
31   morpheo::behavioural::Tusage_t usage
32   ):
33    _name              (name)
34    ,_param            (param)
35    ,_usage            (usage)
36  {
37    log_begin(Special_Register_unit,FUNCTION);
38
39    usage_environment(_usage);
40
41// #if DEBUG_Core == true
42//     log_printf(INFO,Core,FUNCTION,_("<%s> Parameters"),_name.c_str());
43
44//     std::cout << *param << std::endl;
45// #endif   
46
47    log_printf(INFO,Special_Register_unit,FUNCTION,_("<%s> : Allocation"),_name.c_str());
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,Special_Register_unit,FUNCTION,_("<%s> : Allocation of statistics"),_name.c_str());
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,Special_Register_unit,FUNCTION,_("<%s> : Generate the vhdl"),_name.c_str());
69       
70        vhdl();
71      }
72#endif
73
74#ifdef SYSTEMC
75    if (usage_is_set(_usage,USE_SYSTEMC))
76      {
77#ifdef SYSTEMCASS_SPECIFIC
78        constant();
79#else
80        log_printf(INFO,Special_Register_unit,FUNCTION,_("<%s> : Method - constant"),_name.c_str());
81
82        SC_METHOD (constant);
83//      dont_initialize ();
84       
85# ifdef SYSTEMCASS_SPECIFIC
86        // List dependency information
87# endif   
88#endif
89
90        log_printf(INFO,Special_Register_unit,FUNCTION,_("<%s> : Method - transition"),_name.c_str());
91
92        SC_METHOD (transition);
93        dont_initialize ();
94        sensitive << (*(in_CLOCK)).pos();
95       
96# ifdef SYSTEMCASS_SPECIFIC
97        // List dependency information
98# endif   
99
100        log_printf(INFO,Special_Register_unit,FUNCTION,_("<%s> : Method - genMoore"),_name.c_str());
101
102        SC_METHOD (genMoore);
103        dont_initialize ();
104        sensitive << (*(in_CLOCK)).neg(); // need internal register
105       
106# ifdef SYSTEMCASS_SPECIFIC
107        // List dependency information
108# endif   
109
110        log_printf(INFO,Special_Register_unit,FUNCTION,_("<%s> : Method - genMealy_spr_access"),_name.c_str());
111
112        SC_METHOD (genMealy_spr_access);
113        dont_initialize ();
114        sensitive << (*(in_CLOCK)).neg(); // need internal register
115       
116        for (uint32_t i=0; i<_param->_nb_inst_reexecute; i++)
117          {
118            sensitive << (*(in_SPR_ACCESS_NUM_GROUP    [i]))
119                      << (*(in_SPR_ACCESS_NUM_REG      [i]))
120//                    << (*(in_SPR_ACCESS_VAL          [i]))
121//                    << (*(in_SPR_ACCESS_WEN          [i]))
122              ;
123            if (_param->_have_port_front_end_id)
124            sensitive << (*(in_SPR_ACCESS_FRONT_END_ID [i]));
125            if (_param->_have_port_context_id)
126            sensitive << (*(in_SPR_ACCESS_CONTEXT_ID   [i]));
127          }
128
129
130# ifdef SYSTEMCASS_SPECIFIC
131        // List dependency information
132# endif   
133       
134#endif
135      }
136    log_end(Special_Register_unit,FUNCTION);
137  };
138   
139#undef  FUNCTION
140#define FUNCTION "Special_Register_unit::~Special_Register_unit"
141  Special_Register_unit::~Special_Register_unit (void)
142  {
143    log_begin(Special_Register_unit,FUNCTION);
144
145#ifdef STATISTICS
146    if (usage_is_set(_usage,USE_STATISTICS))
147      {
148        statistics_deallocation();
149      }
150#endif
151
152    log_printf(INFO,Special_Register_unit,FUNCTION,_("<%s> : Deallocation"),_name.c_str());
153    deallocation ();
154
155    log_end(Special_Register_unit,FUNCTION);
156  };
157
158}; // end namespace special_register_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.