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

Last change on this file since 81 was 81, checked in by rosiere, 16 years ago
  • Finish Environment (and test)
  • Continue predictor_unit
  • Add external tools
  • svn keyword "Id" set
  • Property svn:keywords set to Id
File size: 3.9 KB
Line 
1/*
2 * $Id: Ifetch_unit_Glue.cpp 81 2008-04-15 18:40:01Z rosiere $
3 *
4 * [ Description ]
5 *
6 */
7
8#include "Behavioural/Core/Multi_Front_end/Front_end/Ifetch_unit/Ifetch_unit_Glue/include/Ifetch_unit_Glue.h"
9
10namespace morpheo                    {
11namespace behavioural {
12namespace core {
13namespace multi_front_end {
14namespace front_end {
15namespace ifetch_unit {
16namespace ifetch_unit_glue {
17
18
19#undef  FUNCTION
20#define FUNCTION "Ifetch_unit_Glue::Ifetch_unit_Glue"
21  Ifetch_unit_Glue::Ifetch_unit_Glue
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_unit_glue::Parameters * param,
32   morpheo::behavioural::Tusage_t usage
33   ):
34    _name              (name)
35    ,_param            (param)
36    ,_usage            (usage)
37  {
38    log_printf(FUNC,Ifetch_unit_Glue,FUNCTION,"Begin");
39
40    log_printf(INFO,Ifetch_unit_Glue,FUNCTION,"Allocation");
41
42    allocation (
43#ifdef STATISTICS
44                param_statistics
45#endif
46                );
47
48#ifdef STATISTICS
49    if (_usage & USE_STATISTICS)
50      { 
51        log_printf(INFO,Ifetch_unit_Glue,FUNCTION,"Allocation of statistics");
52
53        statistics_allocation(param_statistics);
54      }
55#endif
56
57#ifdef VHDL
58    if (_usage & USE_VHDL)
59      {
60        // generate the vhdl
61        log_printf(INFO,Ifetch_unit_Glue,FUNCTION,"Generate the vhdl");
62       
63        vhdl();
64      }
65#endif
66
67#ifdef SYSTEMC
68    PORT_WRITE(out_ICACHE_REQ_TYPE,ICACHE_TYPE_LOAD);
69
70    if (_usage & USE_SYSTEMC)
71      {
72# if defined(STATISTICS) or defined(VHDL_TESTBENCH)
73        log_printf(INFO,Ifetch_unit_Glue,FUNCTION,"Method - transition");
74
75        SC_METHOD (transition);
76        dont_initialize ();
77        sensitive << (*(in_CLOCK)).pos();
78#  ifdef SYSTEMCASS_SPECIFIC
79        // List dependency information
80#  endif   
81# endif
82
83        log_printf(INFO,Ifetch_unit_Glue,FUNCTION,"Method - genMealy_icache_req");
84
85        SC_METHOD (genMealy_icache_req);
86        dont_initialize ();
87//      sensitive << (*(in_CLOCK)).neg(); // don't use internal register
88        sensitive << (*(in_ICACHE_REQ_ADDRESS_VAL))
89                  << (*(in_ICACHE_REQ_ACK        ))
90                  << (*(in_ICACHE_REQ_QUEUE_ACK  ));
91       
92# ifdef SYSTEMCASS_SPECIFIC
93        // List dependency information
94        (*(out_ICACHE_REQ_VAL        )) (*( in_ICACHE_REQ_ADDRESS_VAL));
95        (*(out_ICACHE_REQ_VAL        )) (*( in_ICACHE_REQ_QUEUE_ACK  ));
96       
97        (*(out_ICACHE_REQ_QUEUE_VAL  )) (*( in_ICACHE_REQ_ADDRESS_VAL));
98        (*(out_ICACHE_REQ_QUEUE_VAL  )) (*( in_ICACHE_REQ_ACK        ));
99       
100        (*(out_ICACHE_REQ_ADDRESS_ACK)) (*( in_ICACHE_REQ_QUEUE_ACK  ));
101        (*(out_ICACHE_REQ_ADDRESS_ACK)) (*( in_ICACHE_REQ_ACK        ));
102# endif   
103
104        log_printf(INFO,Ifetch_unit_Glue,FUNCTION,"Method - genMealy_event");
105
106        SC_METHOD (genMealy_event);
107        dont_initialize ();
108//      sensitive << (*(in_CLOCK)).neg(); // don't use internal register
109        sensitive << (*(in_EVENT_VAL        ))
110                  << (*(in_EVENT_ADDRESS_ACK))
111                  << (*(in_EVENT_QUEUE_ACK  ));
112       
113# ifdef SYSTEMCASS_SPECIFIC
114        // List dependency information
115        (*(out_EVENT_ACK        )) (*( in_EVENT_ADDRESS_ACK));
116        (*(out_EVENT_ACK        )) (*( in_EVENT_QUEUE_ACK  ));
117       
118        (*(out_EVENT_QUEUE_VAL  )) (*( in_EVENT_ADDRESS_ACK));
119        (*(out_EVENT_QUEUE_VAL  )) (*( in_EVENT_VAL        ));
120       
121        (*(out_EVENT_ADDRESS_VAL)) (*( in_EVENT_QUEUE_ACK  ));
122        (*(out_EVENT_ADDRESS_VAL)) (*( in_EVENT_VAL        ));
123# endif
124#endif
125      }
126    log_printf(FUNC,Ifetch_unit_Glue,FUNCTION,"End");
127  };
128   
129#undef  FUNCTION
130#define FUNCTION "Ifetch_unit_Glue::~Ifetch_unit_Glue"
131  Ifetch_unit_Glue::~Ifetch_unit_Glue (void)
132  {
133    log_printf(FUNC,Ifetch_unit_Glue,FUNCTION,"Begin");
134
135#ifdef STATISTICS
136    if (_usage & USE_STATISTICS)
137      {
138        statistics_deallocation();
139      }
140#endif
141
142    log_printf(INFO,Ifetch_unit_Glue,FUNCTION,"Deallocation");
143    deallocation ();
144
145    log_printf(FUNC,Ifetch_unit_Glue,FUNCTION,"End");
146  };
147
148}; // end namespace ifetch_unit_glue
149}; // end namespace ifetch_unit
150}; // end namespace front_end
151}; // end namespace multi_front_end
152}; // end namespace core
153
154}; // end namespace behavioural
155}; // end namespace morpheo             
Note: See TracBrowser for help on using the repository browser.