1 | /* |
---|
2 | * $Id: Ifetch_unit_Glue.cpp 132 2009-07-11 16:39:35Z 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 | |
---|
10 | namespace morpheo { |
---|
11 | namespace behavioural { |
---|
12 | namespace core { |
---|
13 | namespace multi_front_end { |
---|
14 | namespace front_end { |
---|
15 | namespace ifetch_unit { |
---|
16 | namespace 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 | #ifdef SYSTEMCASS_SPECIFIC |
---|
77 | constant(); |
---|
78 | #else |
---|
79 | log_printf(INFO,Ifetch_unit_Glue,FUNCTION,"Method - constant"); |
---|
80 | |
---|
81 | SC_METHOD (constant); |
---|
82 | // dont_initialize (); |
---|
83 | |
---|
84 | # ifdef SYSTEMCASS_SPECIFIC |
---|
85 | // List dependency information |
---|
86 | # endif |
---|
87 | #endif |
---|
88 | |
---|
89 | # if defined(STATISTICS) or defined(VHDL_TESTBENCH) |
---|
90 | log_printf(INFO,Ifetch_unit_Glue,FUNCTION,"Method - transition"); |
---|
91 | |
---|
92 | SC_METHOD (transition); |
---|
93 | dont_initialize (); |
---|
94 | sensitive << (*(in_CLOCK)).pos(); |
---|
95 | # ifdef SYSTEMCASS_SPECIFIC |
---|
96 | // List dependency information |
---|
97 | # endif |
---|
98 | # endif |
---|
99 | |
---|
100 | log_printf(INFO,Ifetch_unit_Glue,FUNCTION,"Method - genMealy_icache_req"); |
---|
101 | |
---|
102 | SC_METHOD (genMealy_icache_req); |
---|
103 | dont_initialize (); |
---|
104 | // sensitive << (*(in_CLOCK)).neg(); // don't use internal register |
---|
105 | sensitive << (*(in_NRESET)) |
---|
106 | << (*(in_ICACHE_REQ_ADDRESS_VAL)) |
---|
107 | << (*(in_ICACHE_REQ_ACK )) |
---|
108 | << (*(in_ICACHE_REQ_QUEUE_ACK )) |
---|
109 | << (*(in_ICACHE_REQ_ADDRESS_ADDRESS)) |
---|
110 | ; |
---|
111 | |
---|
112 | # ifdef SYSTEMCASS_SPECIFIC |
---|
113 | // List dependency information |
---|
114 | (*(out_ICACHE_REQ_VAL )) (*( in_ICACHE_REQ_ADDRESS_VAL)); |
---|
115 | (*(out_ICACHE_REQ_VAL )) (*( in_ICACHE_REQ_QUEUE_ACK )); |
---|
116 | |
---|
117 | (*(out_ICACHE_REQ_QUEUE_VAL )) (*( in_ICACHE_REQ_ADDRESS_VAL)); |
---|
118 | (*(out_ICACHE_REQ_QUEUE_VAL )) (*( in_ICACHE_REQ_ACK )); |
---|
119 | |
---|
120 | (*(out_ICACHE_REQ_ADDRESS_ACK)) (*( in_ICACHE_REQ_QUEUE_ACK )); |
---|
121 | (*(out_ICACHE_REQ_ADDRESS_ACK)) (*( in_ICACHE_REQ_ACK )); |
---|
122 | |
---|
123 | (*(out_ICACHE_REQ_ADDRESS )) (*( in_ICACHE_REQ_ADDRESS_ADDRESS)); |
---|
124 | (*(out_ICACHE_REQ_QUEUE_ADDRESS)) (*( in_ICACHE_REQ_ADDRESS_ADDRESS)); |
---|
125 | |
---|
126 | # endif |
---|
127 | |
---|
128 | log_printf(INFO,Ifetch_unit_Glue,FUNCTION,"Method - genMealy_event"); |
---|
129 | |
---|
130 | SC_METHOD (genMealy_event); |
---|
131 | dont_initialize (); |
---|
132 | // sensitive << (*(in_CLOCK)).neg(); // don't use internal register |
---|
133 | sensitive << (*(in_NRESET)) |
---|
134 | << (*(in_EVENT_VAL )) |
---|
135 | << (*(in_EVENT_ADDRESS_ACK)) |
---|
136 | << (*(in_EVENT_QUEUE_ACK )); |
---|
137 | |
---|
138 | # ifdef SYSTEMCASS_SPECIFIC |
---|
139 | // List dependency information |
---|
140 | (*(out_EVENT_ACK )) (*( in_EVENT_ADDRESS_ACK)); |
---|
141 | (*(out_EVENT_ACK )) (*( in_EVENT_QUEUE_ACK )); |
---|
142 | |
---|
143 | (*(out_EVENT_QUEUE_VAL )) (*( in_EVENT_ADDRESS_ACK)); |
---|
144 | (*(out_EVENT_QUEUE_VAL )) (*( in_EVENT_VAL )); |
---|
145 | |
---|
146 | (*(out_EVENT_ADDRESS_VAL)) (*( in_EVENT_QUEUE_ACK )); |
---|
147 | (*(out_EVENT_ADDRESS_VAL)) (*( in_EVENT_VAL )); |
---|
148 | # endif |
---|
149 | #endif |
---|
150 | } |
---|
151 | log_printf(FUNC,Ifetch_unit_Glue,FUNCTION,"End"); |
---|
152 | }; |
---|
153 | |
---|
154 | #undef FUNCTION |
---|
155 | #define FUNCTION "Ifetch_unit_Glue::~Ifetch_unit_Glue" |
---|
156 | Ifetch_unit_Glue::~Ifetch_unit_Glue (void) |
---|
157 | { |
---|
158 | log_printf(FUNC,Ifetch_unit_Glue,FUNCTION,"Begin"); |
---|
159 | |
---|
160 | #ifdef STATISTICS |
---|
161 | if (usage_is_set(_usage,USE_STATISTICS)) |
---|
162 | { |
---|
163 | statistics_deallocation(); |
---|
164 | } |
---|
165 | #endif |
---|
166 | |
---|
167 | log_printf(INFO,Ifetch_unit_Glue,FUNCTION,"Deallocation"); |
---|
168 | deallocation (); |
---|
169 | |
---|
170 | log_printf(FUNC,Ifetch_unit_Glue,FUNCTION,"End"); |
---|
171 | }; |
---|
172 | |
---|
173 | }; // end namespace ifetch_unit_glue |
---|
174 | }; // end namespace ifetch_unit |
---|
175 | }; // end namespace front_end |
---|
176 | }; // end namespace multi_front_end |
---|
177 | }; // end namespace core |
---|
178 | |
---|
179 | }; // end namespace behavioural |
---|
180 | }; // end namespace morpheo |
---|