gem5  v19.0.0.0
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
sc_trace_file.cc
Go to the documentation of this file.
1 /*
2  * Copyright 2018 Google, Inc.
3  *
4  * Redistribution and use in source and binary forms, with or without
5  * modification, are permitted provided that the following conditions are
6  * met: redistributions of source code must retain the above copyright
7  * notice, this list of conditions and the following disclaimer;
8  * redistributions in binary form must reproduce the above copyright
9  * notice, this list of conditions and the following disclaimer in the
10  * documentation and/or other materials provided with the distribution;
11  * neither the name of the copyright holders nor the names of its
12  * contributors may be used to endorse or promote products derived from
13  * this software without specific prior written permission.
14  *
15  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
16  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
17  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
18  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
19  * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
20  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
21  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
22  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
23  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
25  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26  *
27  * Authors: Gabe Black
28  */
29 
30 #include <vector>
31 
46 #include "systemc/utils/vcd.hh"
47 
48 namespace sc_core
49 {
50 
53 
56 {
57  auto tf = new ::sc_gem5::VcdTraceFile(name);
59  return tf;
60 }
61 
62 void
64 {
66  static_cast<::sc_gem5::TraceFile *>(tf));
67  delete tf;
68 }
69 
70 void
71 sc_write_comment(sc_trace_file *tf, const std::string &comment)
72 {
73  static_cast<::sc_gem5::TraceFile *>(tf)->writeComment(comment);
74 }
75 
76 void
77 sc_trace(sc_trace_file *tf, const bool &v, const std::string &name)
78 {
79  static_cast<::sc_gem5::TraceFile *>(tf)->addTraceVal(&v, name);
80 }
81 
82 void
83 sc_trace(sc_trace_file *tf, const bool *v, const std::string &name)
84 {
85  static_cast<::sc_gem5::TraceFile *>(tf)->addTraceVal(v, name);
86 }
87 
88 void
89 sc_trace(sc_trace_file *tf, const float &v, const std::string &name)
90 {
91  static_cast<::sc_gem5::TraceFile *>(tf)->addTraceVal(&v, name);
92 }
93 
94 void
95 sc_trace(sc_trace_file *tf, const float *v, const std::string &name)
96 {
97  static_cast<::sc_gem5::TraceFile *>(tf)->addTraceVal(v, name);
98 }
99 
100 void
101 sc_trace(sc_trace_file *tf, const double &v, const std::string &name)
102 {
103  static_cast<::sc_gem5::TraceFile *>(tf)->addTraceVal(&v, name);
104 }
105 
106 void
107 sc_trace(sc_trace_file *tf, const double *v, const std::string &name)
108 {
109  static_cast<::sc_gem5::TraceFile *>(tf)->addTraceVal(v, name);
110 }
111 
112 void
113 sc_trace(sc_trace_file *tf, const sc_dt::sc_logic &v, const std::string &name)
114 {
115  static_cast<::sc_gem5::TraceFile *>(tf)->addTraceVal(&v, name);
116 }
117 
118 void
119 sc_trace(sc_trace_file *tf, const sc_dt::sc_logic *v, const std::string &name)
120 {
121  static_cast<::sc_gem5::TraceFile *>(tf)->addTraceVal(v, name);
122 }
123 
124 void
126  const std::string &name)
127 {
128  static_cast<::sc_gem5::TraceFile *>(tf)->addTraceVal(&v, name);
129 }
130 
131 void
133  const std::string &name)
134 {
135  static_cast<::sc_gem5::TraceFile *>(tf)->addTraceVal(v, name);
136 }
137 
138 void
140  const std::string &name)
141 {
142  static_cast<::sc_gem5::TraceFile *>(tf)->addTraceVal(&v, name);
143 }
144 
145 void
147  const std::string &name)
148 {
149  static_cast<::sc_gem5::TraceFile *>(tf)->addTraceVal(v, name);
150 }
151 
152 void
154  const std::string &name)
155 {
156  static_cast<::sc_gem5::TraceFile *>(tf)->addTraceVal(&v, name);
157 }
158 
159 void
161  const std::string &name)
162 {
163  static_cast<::sc_gem5::TraceFile *>(tf)->addTraceVal(v, name);
164 }
165 
166 void
168  const std::string &name)
169 {
170  static_cast<::sc_gem5::TraceFile *>(tf)->addTraceVal(&v, name);
171 }
172 
173 void
175  const std::string &name)
176 {
177  static_cast<::sc_gem5::TraceFile *>(tf)->addTraceVal(v, name);
178 }
179 
180 void
182  const std::string &name)
183 {
184  static_cast<::sc_gem5::TraceFile *>(tf)->addTraceVal(&v, name);
185 }
186 
187 void
189  const std::string &name)
190 {
191  static_cast<::sc_gem5::TraceFile *>(tf)->addTraceVal(v, name);
192 }
193 
194 void
196  const std::string &name)
197 {
198  static_cast<::sc_gem5::TraceFile *>(tf)->addTraceVal(&v, name);
199 }
200 
201 void
203  const std::string &name)
204 {
205  static_cast<::sc_gem5::TraceFile *>(tf)->addTraceVal(v, name);
206 }
207 
208 void
209 sc_trace(sc_trace_file *tf, const sc_dt::sc_fxval &v, const std::string &name)
210 {
211  static_cast<::sc_gem5::TraceFile *>(tf)->addTraceVal(&v, name);
212 }
213 
214 void
215 sc_trace(sc_trace_file *tf, const sc_dt::sc_fxval *v, const std::string &name)
216 {
217  static_cast<::sc_gem5::TraceFile *>(tf)->addTraceVal(v, name);
218 }
219 
220 void
222  const std::string &name)
223 {
224  static_cast<::sc_gem5::TraceFile *>(tf)->addTraceVal(&v, name);
225 }
226 
227 void
229  const std::string &name)
230 {
231  static_cast<::sc_gem5::TraceFile *>(tf)->addTraceVal(v, name);
232 }
233 
234 void
235 sc_trace(sc_trace_file *tf, const sc_dt::sc_fxnum &v, const std::string &name)
236 {
237  static_cast<::sc_gem5::TraceFile *>(tf)->addTraceVal(&v, name);
238 }
239 
240 void
241 sc_trace(sc_trace_file *tf, const sc_dt::sc_fxnum *v, const std::string &name)
242 {
243  static_cast<::sc_gem5::TraceFile *>(tf)->addTraceVal(v, name);
244 }
245 
246 void
248  const std::string &name)
249 {
250  static_cast<::sc_gem5::TraceFile *>(tf)->addTraceVal(&v, name);
251 }
252 
253 void
255  const std::string &name)
256 {
257  static_cast<::sc_gem5::TraceFile *>(tf)->addTraceVal(v, name);
258 }
259 
260 void
261 sc_trace(sc_trace_file *tf, const sc_event &v, const std::string &name)
262 {
263  static_cast<::sc_gem5::TraceFile *>(tf)->addTraceVal(&v, name);
264 }
265 
266 void
267 sc_trace(sc_trace_file *tf, const sc_event *v, const std::string &name)
268 {
269  static_cast<::sc_gem5::TraceFile *>(tf)->addTraceVal(v, name);
270 }
271 
272 void
273 sc_trace(sc_trace_file *tf, const sc_time &v, const std::string &name)
274 {
275  static_cast<::sc_gem5::TraceFile *>(tf)->addTraceVal(&v, name);
276 }
277 
278 void
279 sc_trace(sc_trace_file *tf, const sc_time *v, const std::string &name)
280 {
281  static_cast<::sc_gem5::TraceFile *>(tf)->addTraceVal(v, name);
282 }
283 
284 void
285 sc_trace(sc_trace_file *tf, const unsigned char &v,
286  const std::string &name, int width)
287 {
288  static_cast<::sc_gem5::TraceFile *>(tf)->addTraceVal(&v, name, width);
289 }
290 
291 void
292 sc_trace(sc_trace_file *tf, const unsigned char *v,
293  const std::string &name, int width)
294 {
295  static_cast<::sc_gem5::TraceFile *>(tf)->addTraceVal(v, name, width);
296 }
297 
298 void
299 sc_trace(sc_trace_file *tf, const unsigned short &v,
300  const std::string &name, int width)
301 {
302  static_cast<::sc_gem5::TraceFile *>(tf)->addTraceVal(&v, name, width);
303 }
304 
305 void
306 sc_trace(sc_trace_file *tf, const unsigned short *v,
307  const std::string &name, int width)
308 {
309  static_cast<::sc_gem5::TraceFile *>(tf)->addTraceVal(v, name, width);
310 }
311 
312 void
313 sc_trace(sc_trace_file *tf, const unsigned int &v,
314  const std::string &name, int width)
315 {
316  static_cast<::sc_gem5::TraceFile *>(tf)->addTraceVal(&v, name, width);
317 }
318 
319 void
320 sc_trace(sc_trace_file *tf, const unsigned int *v,
321  const std::string &name, int width)
322 {
323  static_cast<::sc_gem5::TraceFile *>(tf)->addTraceVal(v, name, width);
324 }
325 
326 void
327 sc_trace(sc_trace_file *tf, const unsigned long &v,
328  const std::string &name, int width)
329 {
330  static_cast<::sc_gem5::TraceFile *>(tf)->addTraceVal(&v, name, width);
331 }
332 
333 void
334 sc_trace(sc_trace_file *tf, const unsigned long *v,
335  const std::string &name, int width)
336 {
337  static_cast<::sc_gem5::TraceFile *>(tf)->addTraceVal(v, name, width);
338 }
339 
340 void
341 sc_trace(sc_trace_file *tf, const char &v, const std::string &name, int width)
342 {
343  static_cast<::sc_gem5::TraceFile *>(tf)->addTraceVal(&v, name, width);
344 }
345 
346 void
347 sc_trace(sc_trace_file *tf, const char *v, const std::string &name, int width)
348 {
349  static_cast<::sc_gem5::TraceFile *>(tf)->addTraceVal(v, name, width);
350 }
351 
352 void
353 sc_trace(sc_trace_file *tf, const short &v,
354  const std::string &name, int width)
355 {
356  static_cast<::sc_gem5::TraceFile *>(tf)->addTraceVal(&v, name, width);
357 }
358 
359 void
360 sc_trace(sc_trace_file *tf, const short *v,
361  const std::string &name, int width)
362 {
363  static_cast<::sc_gem5::TraceFile *>(tf)->addTraceVal(v, name, width);
364 }
365 
366 void
367 sc_trace(sc_trace_file *tf, const int &v, const std::string &name, int width)
368 {
369  static_cast<::sc_gem5::TraceFile *>(tf)->addTraceVal(&v, name, width);
370 }
371 
372 void
373 sc_trace(sc_trace_file *tf, const int *v, const std::string &name, int width)
374 {
375  static_cast<::sc_gem5::TraceFile *>(tf)->addTraceVal(v, name, width);
376 }
377 
378 void
379 sc_trace(sc_trace_file *tf, const long &v, const std::string &name, int width)
380 {
381  static_cast<::sc_gem5::TraceFile *>(tf)->addTraceVal(&v, name, width);
382 }
383 
384 void
385 sc_trace(sc_trace_file *tf, const long *v, const std::string &name, int width)
386 {
387  static_cast<::sc_gem5::TraceFile *>(tf)->addTraceVal(v, name, width);
388 }
389 
390 void
392  const std::string &name, int width)
393 {
394  static_cast<::sc_gem5::TraceFile *>(tf)->addTraceVal(&v, name, width);
395 }
396 
397 void
399  const std::string &name, int width)
400 {
401  static_cast<::sc_gem5::TraceFile *>(tf)->addTraceVal(v, name, width);
402 }
403 
404 void
406  const std::string &name, int width)
407 {
408  static_cast<::sc_gem5::TraceFile *>(tf)->addTraceVal(&v, name, width);
409 }
410 
411 void
413  const std::string &name, int width)
414 {
415  static_cast<::sc_gem5::TraceFile *>(tf)->addTraceVal(v, name, width);
416 }
417 
418 void
420  const std::string &name, int width)
421 {
422  static_cast<::sc_gem5::TraceFile *>(tf)->
423  addTraceVal(&v.read(), name, width);
424 }
425 
426 void
428  const std::string &name, int width)
429 {
430  static_cast<::sc_gem5::TraceFile *>(tf)->
431  addTraceVal(&v.read(), name, width);
432 }
433 
434 void
436  const std::string &name, int width)
437 {
438  static_cast<::sc_gem5::TraceFile *>(tf)->
439  addTraceVal(&v.read(), name, width);
440 }
441 
442 void
444  const std::string &name, int width)
445 {
446  static_cast<::sc_gem5::TraceFile *>(tf)->
447  addTraceVal(&v.read(), name, width);
448 }
449 
450 void
451 sc_trace(sc_trace_file *tf, const unsigned int &v,
452  const std::string &name, const char **enum_literals)
453 {
454  static_cast<::sc_gem5::TraceFile *>(tf)->
455  addTraceVal(&v, name, enum_literals);
456 }
457 
458 void
460 {
461  static_cast<::sc_gem5::TraceFile *>(tf)->traceDeltas(on);
462 }
463 
464 } // namespace sc_core
Bitfield< 28 > v
const std::string & name()
Definition: trace.cc:54
sc_trace_file * sc_create_vcd_trace_file(const char *name)
void sc_write_comment(sc_trace_file *tf, const std::string &comment)
virtual const T & read() const =0
void registerTraceFile(TraceFile *tf)
Definition: scheduler.hh:376
int64_t int64
Definition: sc_nbdefs.hh:171
void sc_trace(sc_trace_file *tf, const sc_in< T > &i, const std::string &name)
Definition: sc_in.hh:158
Scheduler scheduler
Definition: scheduler.cc:491
void unregisterTraceFile(TraceFile *tf)
Definition: scheduler.hh:377
uint64_t uint64
Definition: sc_nbdefs.hh:172
Bitfield< 4 > width
Bitfield< 8 > tf
Definition: misc.hh:571
void sc_trace_delta_cycles(sc_trace_file *, bool on=true)
void sc_close_vcd_trace_file(sc_trace_file *tf)
Bitfield< 0 > on
Definition: dt_constants.hh:89

Generated on Fri Feb 28 2020 16:27:06 for gem5 by doxygen 1.8.13