source: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Decod_unit/Decod_queue/src/Decod_queue.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: 3.6 KB
Line 
1/*
2 * $Id: Decod_queue.cpp 88 2008-12-10 18:31:39Z rosiere $
3 *
4 * [ Description ]
5 *
6 */
7
8#include "Behavioural/Core/Multi_Front_end/Front_end/Decod_unit/Decod_queue/include/Decod_queue.h"
9
10namespace morpheo                    {
11namespace behavioural {
12namespace core {
13namespace multi_front_end {
14namespace front_end {
15namespace decod_unit {
16namespace decod_queue {
17
18
19#undef  FUNCTION
20#define FUNCTION "Decod_queue::Decod_queue"
21  Decod_queue::Decod_queue
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_front_end::front_end::decod_unit::decod_queue::Parameters * param,
32   morpheo::behavioural::Tusage_t usage
33   ):
34    _name              (name)
35    ,_param            (param)
36    ,_usage            (usage)
37  {
38    log_begin(Decod_queue,FUNCTION);
39
40    usage_environment(_usage);
41
42#if DEBUG_Decod_queue == true
43    log_printf(INFO,Decod_queue,FUNCTION,_("<%s> Parameters"),_name.c_str());
44
45    std::cout << *param << std::endl;
46#endif   
47
48    log_printf(INFO,Decod_queue,FUNCTION,_("Allocation"));
49
50    allocation (
51#ifdef STATISTICS
52                param_statistics
53#endif
54                );
55
56#ifdef STATISTICS
57    if (usage_is_set(_usage,USE_STATISTICS))
58      { 
59        log_printf(INFO,Decod_queue,FUNCTION,_("Allocation of statistics"));
60
61        statistics_allocation(param_statistics);
62      }
63#endif
64
65#ifdef VHDL
66    if (usage_is_set(_usage,USE_VHDL))
67      {
68        // generate the vhdl
69        log_printf(INFO,Decod_queue,FUNCTION,_("Generate the vhdl"));
70       
71        vhdl();
72      }
73#endif
74
75#ifdef SYSTEMC
76    if (usage_is_set(_usage,USE_SYSTEMC))
77      {
78        log_printf(INFO,Decod_queue,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,Decod_queue,FUNCTION,_("Method - genMoore"));
89
90        SC_METHOD (genMoore);
91        dont_initialize ();
92        sensitive << (*(in_CLOCK)).neg(); // use internal register
93       
94# ifdef SYSTEMCASS_SPECIFIC
95        // List dependency information
96# endif   
97
98        log_printf(INFO,Decod_queue,FUNCTION,_("Method - genMealy_decod_out"));
99
100        SC_METHOD (genMealy_decod_out);
101        dont_initialize ();
102        sensitive << (*(in_CLOCK)).neg(); // use internal register
103
104        for (uint32_t i=0; i<_param->_nb_inst_decod; i++)
105          sensitive << (*(in_DECOD_OUT_ACK [i]));
106          for (uint32_t i=0; i<_param->_nb_context; i++)
107            {
108              if (_param->_have_port_depth)
109              sensitive << (*(in_DEPTH_MIN [i]));
110              sensitive << (*(in_DEPTH_MAX [i]));
111            }
112
113# ifdef SYSTEMCASS_SPECIFIC
114        // List dependency information
115        for (uint32_t i=0; i<_param->_nb_inst_decod; i++)
116          {
117            (*(out_DECOD_OUT_VAL [i])) (*(in_DECOD_OUT_ACK [i]));
118            for (uint32_t j=0; j<_param->_nb_context; j++)
119              {
120                if (_param->_have_port_depth)
121                (*(out_DECOD_OUT_VAL [i])) (*(in_DEPTH_MIN [j]));
122                (*(out_DECOD_OUT_VAL [i])) (*(in_DEPTH_MAX [j]));
123              }
124          }
125# endif   
126       
127#endif
128      }
129    log_end(Decod_queue,FUNCTION);
130  };
131   
132#undef  FUNCTION
133#define FUNCTION "Decod_queue::~Decod_queue"
134  Decod_queue::~Decod_queue (void)
135  {
136    log_begin(Decod_queue,FUNCTION);
137
138#ifdef STATISTICS
139    if (usage_is_set(_usage,USE_STATISTICS))
140      {
141        statistics_deallocation();
142      }
143#endif
144
145    log_printf(INFO,Decod_queue,FUNCTION,_("Deallocation"));
146    deallocation ();
147
148    log_end(Decod_queue,FUNCTION);
149  };
150
151}; // end namespace decod_queue
152}; // end namespace decod_unit
153}; // end namespace front_end
154}; // end namespace multi_front_end
155}; // end namespace core
156
157}; // end namespace behavioural
158}; // end namespace morpheo             
Note: See TracBrowser for help on using the repository browser.