source: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Ifetch_unit/Ifetch_queue/src/Ifetch_queue.cpp @ 145

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

1) Add new algo in ifetch queue
2) Add Cancel bit
3) new config

  • Property svn:keywords set to Id
File size: 4.2 KB
Line 
1/*
2 * $Id: Ifetch_queue.cpp 136 2009-10-20 18:52:15Z 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        // Function pointer
77        switch (_param->_queue_scheme)
78          {
79          case IFETCH_QUEUE_SCHEME_NO_ASSOC :
80            {
81              function_transition         = &morpheo::behavioural::core::multi_front_end::front_end::ifetch_unit::ifetch_queue::Ifetch_queue::function_no_assoc_transition        ;
82              function_genMoore           = &morpheo::behavioural::core::multi_front_end::front_end::ifetch_unit::ifetch_queue::Ifetch_queue::function_no_assoc_genMoore          ;
83             
84              break;
85            }
86          case IFETCH_QUEUE_SCHEME_FULL_ASSOC :
87            {
88              function_transition         = &morpheo::behavioural::core::multi_front_end::front_end::ifetch_unit::ifetch_queue::Ifetch_queue::function_full_assoc_transition        ;
89              function_genMoore           = &morpheo::behavioural::core::multi_front_end::front_end::ifetch_unit::ifetch_queue::Ifetch_queue::function_full_assoc_genMoore          ;
90             
91              break;
92            }
93          default :
94            {
95              break;
96            }
97          }
98
99        log_printf(INFO,Ifetch_queue,FUNCTION,_("<%s> Method - constant"),_name.c_str());
100
101#ifdef SYSTEMCASS_SPECIFIC
102        constant();
103#else
104        SC_METHOD (constant);
105//      dont_initialize ();
106       
107# ifdef SYSTEMCASS_SPECIFIC
108        // List dependency information
109# endif   
110#endif
111        log_printf(INFO,Ifetch_queue,FUNCTION,_("<%s> Method - transition"),_name.c_str());
112
113        SC_METHOD (transition);
114        dont_initialize ();
115        sensitive << (*(in_CLOCK)).pos();
116       
117# ifdef SYSTEMCASS_SPECIFIC
118        // List dependency information
119# endif   
120
121        log_printf(INFO,Ifetch_queue,FUNCTION,_("<%s> Method - genMoore"),_name.c_str());
122
123        SC_METHOD (genMoore);
124        dont_initialize ();
125        sensitive << (*(in_CLOCK)).neg(); // use internal register
126       
127# ifdef SYSTEMCASS_SPECIFIC
128        // List dependency information
129# endif   
130       
131#endif
132      }
133    log_printf(FUNC,Ifetch_queue,FUNCTION,"End");
134  };
135   
136#undef  FUNCTION
137#define FUNCTION "Ifetch_queue::~Ifetch_queue"
138  Ifetch_queue::~Ifetch_queue (void)
139  {
140    log_printf(FUNC,Ifetch_queue,FUNCTION,"Begin");
141
142#ifdef STATISTICS
143    if (usage_is_set(_usage,USE_STATISTICS))
144      {
145        statistics_deallocation();
146      }
147#endif
148
149    log_printf(INFO,Ifetch_queue,FUNCTION,_("<%s> Deallocation"),_name.c_str());
150    deallocation ();
151
152    log_printf(FUNC,Ifetch_queue,FUNCTION,"End");
153  };
154
155}; // end namespace ifetch_queue
156}; // end namespace ifetch_unit
157}; // end namespace front_end
158}; // end namespace multi_front_end
159}; // end namespace core
160
161}; // end namespace behavioural
162}; // end namespace morpheo             
Note: See TracBrowser for help on using the repository browser.