source: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Ifetch_unit/Ifetch_queue/src/Ifetch_queue.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: 3.1 KB
Line 
1/*
2 * $Id: Ifetch_queue.cpp 131 2009-07-08 18:40:08Z rosiere $
3 *
4 * [ Description ]
5 *
6 */
7
8#include "Behavioural/Core/Multi_Front_end/Front_end/Ifetch_unit/Ifetch_queue/include/Ifetch_queue.h"
9
10namespace morpheo                    {
11namespace behavioural {
12namespace core {
13namespace multi_front_end {
14namespace front_end {
15namespace ifetch_unit {
16namespace ifetch_queue {
17
18
19#undef  FUNCTION
20#define FUNCTION "Ifetch_queue::Ifetch_queue"
21  Ifetch_queue::Ifetch_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::ifetch_unit::ifetch_queue::Parameters * param,
32   morpheo::behavioural::Tusage_t usage
33   ):
34    _name              (name)
35    ,_param            (param)
36    ,_usage            (usage)
37  {
38    log_printf(FUNC,Ifetch_queue,FUNCTION,"Begin");
39
40// #if DEBUG_Ifetch_queue == true
41//     log_printf(INFO,Ifetch_queue,FUNCTION,_("<%s> Parameters"),_name.c_str());
42
43//     std::cout << *param << std::endl;
44// #endif   
45
46    log_printf(INFO,Ifetch_queue,FUNCTION,_("<%s> Allocation"),_name.c_str());
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,Ifetch_queue,FUNCTION,_("<%s> Allocation of statistics"),_name.c_str());
58
59        statistics_allocation(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,Ifetch_queue,FUNCTION,_("<%s> Generate the vhdl"),_name.c_str());
68       
69        vhdl();
70      }
71#endif
72
73#ifdef SYSTEMC
74    if (usage_is_set(_usage,USE_SYSTEMC))
75      {
76        log_printf(INFO,Ifetch_queue,FUNCTION,_("<%s> Method - constant"),_name.c_str());
77
78        SC_METHOD (constant);
79//      dont_initialize ();
80       
81# ifdef SYSTEMCASS_SPECIFIC
82        // List dependency information
83# endif   
84
85        log_printf(INFO,Ifetch_queue,FUNCTION,_("<%s> Method - transition"),_name.c_str());
86
87        SC_METHOD (transition);
88        dont_initialize ();
89        sensitive << (*(in_CLOCK)).pos();
90       
91# ifdef SYSTEMCASS_SPECIFIC
92        // List dependency information
93# endif   
94
95        log_printf(INFO,Ifetch_queue,FUNCTION,_("<%s> Method - genMoore"),_name.c_str());
96
97        SC_METHOD (genMoore);
98        dont_initialize ();
99        sensitive << (*(in_CLOCK)).neg(); // use internal register
100       
101# ifdef SYSTEMCASS_SPECIFIC
102        // List dependency information
103# endif   
104       
105#endif
106      }
107    log_printf(FUNC,Ifetch_queue,FUNCTION,"End");
108  };
109   
110#undef  FUNCTION
111#define FUNCTION "Ifetch_queue::~Ifetch_queue"
112  Ifetch_queue::~Ifetch_queue (void)
113  {
114    log_printf(FUNC,Ifetch_queue,FUNCTION,"Begin");
115
116#ifdef STATISTICS
117    if (usage_is_set(_usage,USE_STATISTICS))
118      {
119        statistics_deallocation();
120      }
121#endif
122
123    log_printf(INFO,Ifetch_queue,FUNCTION,_("<%s> Deallocation"),_name.c_str());
124    deallocation ();
125
126    log_printf(FUNC,Ifetch_queue,FUNCTION,"End");
127  };
128
129}; // end namespace ifetch_queue
130}; // end namespace ifetch_unit
131}; // end namespace front_end
132}; // end namespace multi_front_end
133}; // end namespace core
134
135}; // end namespace behavioural
136}; // end namespace morpheo             
Note: See TracBrowser for help on using the repository browser.