1 | /* |
---|
2 | * $Id: Ifetch_queue.cpp 123 2009-06-08 20:43:30Z 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 | |
---|
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_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 | // constant output |
---|
77 | internal_ICACHE_RSP_ACK = 1; |
---|
78 | internal_EVENT_RESET_ACK = 1; |
---|
79 | |
---|
80 | PORT_WRITE(out_ICACHE_RSP_ACK , internal_ICACHE_RSP_ACK ); |
---|
81 | PORT_WRITE(out_EVENT_RESET_ACK, internal_EVENT_RESET_ACK); |
---|
82 | |
---|
83 | log_printf(INFO,Ifetch_queue,FUNCTION,_("<%s> Method - transition"),_name.c_str()); |
---|
84 | |
---|
85 | SC_METHOD (transition); |
---|
86 | dont_initialize (); |
---|
87 | sensitive << (*(in_CLOCK)).pos(); |
---|
88 | |
---|
89 | # ifdef SYSTEMCASS_SPECIFIC |
---|
90 | // List dependency information |
---|
91 | # endif |
---|
92 | |
---|
93 | log_printf(INFO,Ifetch_queue,FUNCTION,_("<%s> Method - genMoore"),_name.c_str()); |
---|
94 | |
---|
95 | SC_METHOD (genMoore); |
---|
96 | dont_initialize (); |
---|
97 | sensitive << (*(in_CLOCK)).neg(); // use internal register |
---|
98 | |
---|
99 | # ifdef SYSTEMCASS_SPECIFIC |
---|
100 | // List dependency information |
---|
101 | # endif |
---|
102 | |
---|
103 | #endif |
---|
104 | } |
---|
105 | log_printf(FUNC,Ifetch_queue,FUNCTION,"End"); |
---|
106 | }; |
---|
107 | |
---|
108 | #undef FUNCTION |
---|
109 | #define FUNCTION "Ifetch_queue::~Ifetch_queue" |
---|
110 | Ifetch_queue::~Ifetch_queue (void) |
---|
111 | { |
---|
112 | log_printf(FUNC,Ifetch_queue,FUNCTION,"Begin"); |
---|
113 | |
---|
114 | #ifdef STATISTICS |
---|
115 | if (usage_is_set(_usage,USE_STATISTICS)) |
---|
116 | { |
---|
117 | statistics_deallocation(); |
---|
118 | } |
---|
119 | #endif |
---|
120 | |
---|
121 | log_printf(INFO,Ifetch_queue,FUNCTION,_("<%s> Deallocation"),_name.c_str()); |
---|
122 | deallocation (); |
---|
123 | |
---|
124 | log_printf(FUNC,Ifetch_queue,FUNCTION,"End"); |
---|
125 | }; |
---|
126 | |
---|
127 | }; // end namespace ifetch_queue |
---|
128 | }; // end namespace ifetch_unit |
---|
129 | }; // end namespace front_end |
---|
130 | }; // end namespace multi_front_end |
---|
131 | }; // end namespace core |
---|
132 | |
---|
133 | }; // end namespace behavioural |
---|
134 | }; // end namespace morpheo |
---|