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

Last change on this file since 88 was 88, checked in by rosiere, 16 years ago

Almost complete design
with Test and test platform

  • Property svn:keywords set to Id
File size: 4.4 KB
Line 
1/*
2 * $Id: Ifetch_unit_Glue.cpp 88 2008-12-10 18:31:39Z 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#if DEBUG_Ifetch_unit_Glue == true
41    log_printf(INFO,Ifetch_unit_Glue,FUNCTION,_("<%s> Parameters"),_name.c_str());
42
43    std::cout << *param << std::endl;
44#endif   
45
46    log_printf(INFO,Ifetch_unit_Glue,FUNCTION,"Allocation");
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_unit_Glue,FUNCTION,"Allocation of statistics");
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_unit_Glue,FUNCTION,"Generate the vhdl");
68       
69        vhdl();
70      }
71#endif
72
73#ifdef SYSTEMC
74    if (usage_is_set(_usage,USE_SYSTEMC))
75      {
76        // Write constant
77        PORT_WRITE(out_ICACHE_REQ_TYPE,ICACHE_TYPE_LOAD);
78
79# if defined(STATISTICS) or defined(VHDL_TESTBENCH)
80        log_printf(INFO,Ifetch_unit_Glue,FUNCTION,"Method - transition");
81
82        SC_METHOD (transition);
83        dont_initialize ();
84        sensitive << (*(in_CLOCK)).pos();
85#  ifdef SYSTEMCASS_SPECIFIC
86        // List dependency information
87#  endif   
88# endif
89
90        log_printf(INFO,Ifetch_unit_Glue,FUNCTION,"Method - genMealy_icache_req");
91
92        SC_METHOD (genMealy_icache_req);
93        dont_initialize ();
94//      sensitive << (*(in_CLOCK)).neg(); // don't use internal register
95        sensitive << (*(in_ICACHE_REQ_ADDRESS_VAL))
96                  << (*(in_ICACHE_REQ_ACK        ))
97                  << (*(in_ICACHE_REQ_QUEUE_ACK  ))
98                  << (*(in_ICACHE_REQ_ADDRESS_ADDRESS))
99          ;
100       
101# ifdef SYSTEMCASS_SPECIFIC
102        // List dependency information
103        (*(out_ICACHE_REQ_VAL        )) (*( in_ICACHE_REQ_ADDRESS_VAL));
104        (*(out_ICACHE_REQ_VAL        )) (*( in_ICACHE_REQ_QUEUE_ACK  ));
105       
106        (*(out_ICACHE_REQ_QUEUE_VAL  )) (*( in_ICACHE_REQ_ADDRESS_VAL));
107        (*(out_ICACHE_REQ_QUEUE_VAL  )) (*( in_ICACHE_REQ_ACK        ));
108       
109        (*(out_ICACHE_REQ_ADDRESS_ACK)) (*( in_ICACHE_REQ_QUEUE_ACK  ));
110        (*(out_ICACHE_REQ_ADDRESS_ACK)) (*( in_ICACHE_REQ_ACK        ));
111
112        (*(out_ICACHE_REQ_ADDRESS      )) (*( in_ICACHE_REQ_ADDRESS_ADDRESS));
113        (*(out_ICACHE_REQ_QUEUE_ADDRESS)) (*( in_ICACHE_REQ_ADDRESS_ADDRESS));
114
115# endif   
116
117        log_printf(INFO,Ifetch_unit_Glue,FUNCTION,"Method - genMealy_event");
118
119        SC_METHOD (genMealy_event);
120        dont_initialize ();
121//      sensitive << (*(in_CLOCK)).neg(); // don't use internal register
122        sensitive << (*(in_EVENT_VAL        ))
123                  << (*(in_EVENT_ADDRESS_ACK))
124                  << (*(in_EVENT_QUEUE_ACK  ));
125       
126# ifdef SYSTEMCASS_SPECIFIC
127        // List dependency information
128        (*(out_EVENT_ACK        )) (*( in_EVENT_ADDRESS_ACK));
129        (*(out_EVENT_ACK        )) (*( in_EVENT_QUEUE_ACK  ));
130       
131        (*(out_EVENT_QUEUE_VAL  )) (*( in_EVENT_ADDRESS_ACK));
132        (*(out_EVENT_QUEUE_VAL  )) (*( in_EVENT_VAL        ));
133       
134        (*(out_EVENT_ADDRESS_VAL)) (*( in_EVENT_QUEUE_ACK  ));
135        (*(out_EVENT_ADDRESS_VAL)) (*( in_EVENT_VAL        ));
136# endif
137#endif
138      }
139    log_printf(FUNC,Ifetch_unit_Glue,FUNCTION,"End");
140  };
141   
142#undef  FUNCTION
143#define FUNCTION "Ifetch_unit_Glue::~Ifetch_unit_Glue"
144  Ifetch_unit_Glue::~Ifetch_unit_Glue (void)
145  {
146    log_printf(FUNC,Ifetch_unit_Glue,FUNCTION,"Begin");
147
148#ifdef STATISTICS
149    if (usage_is_set(_usage,USE_STATISTICS)) 
150      {
151        statistics_deallocation();
152      }
153#endif
154
155    log_printf(INFO,Ifetch_unit_Glue,FUNCTION,"Deallocation");
156    deallocation ();
157
158    log_printf(FUNC,Ifetch_unit_Glue,FUNCTION,"End");
159  };
160
161}; // end namespace ifetch_unit_glue
162}; // end namespace ifetch_unit
163}; // end namespace front_end
164}; // end namespace multi_front_end
165}; // end namespace core
166
167}; // end namespace behavioural
168}; // end namespace morpheo             
Note: See TracBrowser for help on using the repository browser.