1 | /* |
---|
2 | * $Id: Issue_queue.cpp 132 2009-07-11 16:39:35Z rosiere $ |
---|
3 | * |
---|
4 | * [ Description ] |
---|
5 | * |
---|
6 | */ |
---|
7 | |
---|
8 | #include "Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Issue_queue/include/Issue_queue.h" |
---|
9 | |
---|
10 | namespace morpheo { |
---|
11 | namespace behavioural { |
---|
12 | namespace core { |
---|
13 | namespace multi_ooo_engine { |
---|
14 | namespace ooo_engine { |
---|
15 | namespace issue_queue { |
---|
16 | |
---|
17 | |
---|
18 | #undef FUNCTION |
---|
19 | #define FUNCTION "Issue_queue::Issue_queue" |
---|
20 | Issue_queue::Issue_queue |
---|
21 | ( |
---|
22 | #ifdef SYSTEMC |
---|
23 | sc_module_name name, |
---|
24 | #else |
---|
25 | string name, |
---|
26 | #endif |
---|
27 | #ifdef STATISTICS |
---|
28 | morpheo::behavioural::Parameters_Statistics * param_statistics, |
---|
29 | #endif |
---|
30 | morpheo::behavioural::core::multi_ooo_engine::ooo_engine::issue_queue::Parameters * param, |
---|
31 | morpheo::behavioural::Tusage_t usage |
---|
32 | ): |
---|
33 | _name (name) |
---|
34 | ,_param (param) |
---|
35 | ,_usage (usage) |
---|
36 | { |
---|
37 | log_begin(Issue_queue,FUNCTION); |
---|
38 | |
---|
39 | usage_environment(_usage); |
---|
40 | |
---|
41 | // #if DEBUG_Issue_queue == true |
---|
42 | // log_printf(INFO,Issue_queue,FUNCTION,_("<%s> Parameters"),_name.c_str()); |
---|
43 | |
---|
44 | // std::cout << *param << std::endl; |
---|
45 | // #endif |
---|
46 | |
---|
47 | log_printf(INFO,Issue_queue,FUNCTION,_("<%s> : Allocation"),_name.c_str()); |
---|
48 | |
---|
49 | allocation ( |
---|
50 | #ifdef STATISTICS |
---|
51 | param_statistics |
---|
52 | #endif |
---|
53 | ); |
---|
54 | |
---|
55 | #ifdef STATISTICS |
---|
56 | if (usage_is_set(_usage,USE_STATISTICS)) |
---|
57 | { |
---|
58 | log_printf(INFO,Issue_queue,FUNCTION,_("<%s> : Allocation of statistics"),_name.c_str()); |
---|
59 | |
---|
60 | statistics_allocation(param_statistics); |
---|
61 | } |
---|
62 | #endif |
---|
63 | |
---|
64 | #ifdef VHDL |
---|
65 | if (usage_is_set(_usage,USE_VHDL)) |
---|
66 | { |
---|
67 | // generate the vhdl |
---|
68 | log_printf(INFO,Issue_queue,FUNCTION,_("<%s> : Generate the vhdl"),_name.c_str()); |
---|
69 | |
---|
70 | vhdl(); |
---|
71 | } |
---|
72 | #endif |
---|
73 | |
---|
74 | #ifdef SYSTEMC |
---|
75 | if (usage_is_set(_usage,USE_SYSTEMC)) |
---|
76 | { |
---|
77 | // Function pointer |
---|
78 | switch (_param->_queue_scheme) |
---|
79 | { |
---|
80 | case ISSUE_QUEUE_SCHEME_IN_ORDER : |
---|
81 | { |
---|
82 | function_transition = &morpheo::behavioural::core::multi_ooo_engine::ooo_engine::issue_queue::Issue_queue::function_in_order_transition ; |
---|
83 | function_genMoore = &morpheo::behavioural::core::multi_ooo_engine::ooo_engine::issue_queue::Issue_queue::function_in_order_genMoore ; |
---|
84 | function_genMealy_issue_in = NULL; |
---|
85 | function_genMealy_issue_out = &morpheo::behavioural::core::multi_ooo_engine::ooo_engine::issue_queue::Issue_queue::function_in_order_genMealy_issue_out; |
---|
86 | |
---|
87 | break; |
---|
88 | } |
---|
89 | case ISSUE_QUEUE_SCHEME_OUT_OF_ORDER : |
---|
90 | { |
---|
91 | function_transition = &morpheo::behavioural::core::multi_ooo_engine::ooo_engine::issue_queue::Issue_queue::function_out_of_order_transition ; |
---|
92 | function_genMoore = &morpheo::behavioural::core::multi_ooo_engine::ooo_engine::issue_queue::Issue_queue::function_out_of_order_genMoore ; |
---|
93 | function_genMealy_issue_in = NULL; |
---|
94 | function_genMealy_issue_out = NULL; |
---|
95 | |
---|
96 | break; |
---|
97 | } |
---|
98 | default : |
---|
99 | { |
---|
100 | break; |
---|
101 | } |
---|
102 | } |
---|
103 | |
---|
104 | if (function_transition != NULL) |
---|
105 | { |
---|
106 | log_printf(INFO,Issue_queue,FUNCTION,_("<%s> : Method - transition"),_name.c_str()); |
---|
107 | |
---|
108 | SC_METHOD (transition); |
---|
109 | dont_initialize (); |
---|
110 | sensitive << (*(in_CLOCK)).pos(); |
---|
111 | |
---|
112 | # ifdef SYSTEMCASS_SPECIFIC |
---|
113 | // List dependency information |
---|
114 | # endif |
---|
115 | } |
---|
116 | |
---|
117 | if (function_genMoore != NULL) |
---|
118 | { |
---|
119 | log_printf(INFO,Issue_queue,FUNCTION,_("<%s> : Method - genMoore"),_name.c_str()); |
---|
120 | |
---|
121 | SC_METHOD (genMoore); |
---|
122 | dont_initialize (); |
---|
123 | sensitive << (*(in_CLOCK)).neg(); // need internal register |
---|
124 | |
---|
125 | # ifdef SYSTEMCASS_SPECIFIC |
---|
126 | // List dependency information |
---|
127 | # endif |
---|
128 | } |
---|
129 | |
---|
130 | if (function_genMealy_issue_in != NULL) |
---|
131 | { |
---|
132 | log_printf(INFO,Issue_queue,FUNCTION,_("<%s> : Method - genMealy_issue_in"),_name.c_str()); |
---|
133 | |
---|
134 | SC_METHOD (genMealy_issue_in); |
---|
135 | dont_initialize (); |
---|
136 | sensitive << (*(in_CLOCK)).neg() // need internal register |
---|
137 | << (*(in_NRESET)); |
---|
138 | # ifdef SYSTEMCASS_SPECIFIC |
---|
139 | // List dependency information |
---|
140 | # endif |
---|
141 | } |
---|
142 | |
---|
143 | if (function_genMealy_issue_out != NULL) |
---|
144 | { |
---|
145 | log_printf(INFO,Issue_queue,FUNCTION,_("<%s> : Method - genMealy_issue_out"),_name.c_str()); |
---|
146 | |
---|
147 | SC_METHOD (genMealy_issue_out); |
---|
148 | dont_initialize (); |
---|
149 | sensitive << (*(in_CLOCK)).neg() // need internal register |
---|
150 | << (*(in_NRESET)); |
---|
151 | if (_param->_queue_scheme == ISSUE_QUEUE_SCHEME_IN_ORDER) |
---|
152 | { |
---|
153 | for (uint32_t i=0; i<_param->_nb_inst_issue; ++i) |
---|
154 | sensitive << (*(in_ISSUE_OUT_ACK [i])); |
---|
155 | } |
---|
156 | |
---|
157 | # ifdef SYSTEMCASS_SPECIFIC |
---|
158 | // List dependency information |
---|
159 | # endif |
---|
160 | } |
---|
161 | |
---|
162 | #endif |
---|
163 | } |
---|
164 | log_end(Issue_queue,FUNCTION); |
---|
165 | }; |
---|
166 | |
---|
167 | #undef FUNCTION |
---|
168 | #define FUNCTION "Issue_queue::~Issue_queue" |
---|
169 | Issue_queue::~Issue_queue (void) |
---|
170 | { |
---|
171 | log_begin(Issue_queue,FUNCTION); |
---|
172 | |
---|
173 | #ifdef STATISTICS |
---|
174 | if (usage_is_set(_usage,USE_STATISTICS)) |
---|
175 | { |
---|
176 | statistics_deallocation(); |
---|
177 | } |
---|
178 | #endif |
---|
179 | |
---|
180 | log_printf(INFO,Issue_queue,FUNCTION,_("<%s> : Deallocation"),_name.c_str()); |
---|
181 | |
---|
182 | deallocation (); |
---|
183 | |
---|
184 | log_end(Issue_queue,FUNCTION); |
---|
185 | }; |
---|
186 | |
---|
187 | }; // end namespace issue_queue |
---|
188 | }; // end namespace ooo_engine |
---|
189 | }; // end namespace multi_ooo_engine |
---|
190 | }; // end namespace core |
---|
191 | |
---|
192 | }; // end namespace behavioural |
---|
193 | }; // end namespace morpheo |
---|