gem5  v20.1.0.0
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 
28 #include <vector>
29 
44 #include "systemc/utils/vcd.hh"
45 
46 namespace sc_core
47 {
48 
51 
54 {
55  auto tf = new ::sc_gem5::VcdTraceFile(name);
57  return tf;
58 }
59 
60 void
62 {
64  static_cast<::sc_gem5::TraceFile *>(tf));
65  delete tf;
66 }
67 
68 void
69 sc_write_comment(sc_trace_file *tf, const std::string &comment)
70 {
71  static_cast<::sc_gem5::TraceFile *>(tf)->writeComment(comment);
72 }
73 
74 void
75 sc_trace(sc_trace_file *tf, const bool &v, const std::string &name)
76 {
77  static_cast<::sc_gem5::TraceFile *>(tf)->addTraceVal(&v, name);
78 }
79 
80 void
81 sc_trace(sc_trace_file *tf, const bool *v, const std::string &name)
82 {
83  static_cast<::sc_gem5::TraceFile *>(tf)->addTraceVal(v, name);
84 }
85 
86 void
87 sc_trace(sc_trace_file *tf, const float &v, const std::string &name)
88 {
89  static_cast<::sc_gem5::TraceFile *>(tf)->addTraceVal(&v, name);
90 }
91 
92 void
93 sc_trace(sc_trace_file *tf, const float *v, const std::string &name)
94 {
95  static_cast<::sc_gem5::TraceFile *>(tf)->addTraceVal(v, name);
96 }
97 
98 void
99 sc_trace(sc_trace_file *tf, const double &v, const std::string &name)
100 {
101  static_cast<::sc_gem5::TraceFile *>(tf)->addTraceVal(&v, name);
102 }
103 
104 void
105 sc_trace(sc_trace_file *tf, const double *v, const std::string &name)
106 {
107  static_cast<::sc_gem5::TraceFile *>(tf)->addTraceVal(v, name);
108 }
109 
110 void
111 sc_trace(sc_trace_file *tf, const sc_dt::sc_logic &v, const std::string &name)
112 {
113  static_cast<::sc_gem5::TraceFile *>(tf)->addTraceVal(&v, name);
114 }
115 
116 void
117 sc_trace(sc_trace_file *tf, const sc_dt::sc_logic *v, const std::string &name)
118 {
119  static_cast<::sc_gem5::TraceFile *>(tf)->addTraceVal(v, name);
120 }
121 
122 void
124  const std::string &name)
125 {
126  static_cast<::sc_gem5::TraceFile *>(tf)->addTraceVal(&v, name);
127 }
128 
129 void
131  const std::string &name)
132 {
133  static_cast<::sc_gem5::TraceFile *>(tf)->addTraceVal(v, name);
134 }
135 
136 void
138  const std::string &name)
139 {
140  static_cast<::sc_gem5::TraceFile *>(tf)->addTraceVal(&v, name);
141 }
142 
143 void
145  const std::string &name)
146 {
147  static_cast<::sc_gem5::TraceFile *>(tf)->addTraceVal(v, name);
148 }
149 
150 void
152  const std::string &name)
153 {
154  static_cast<::sc_gem5::TraceFile *>(tf)->addTraceVal(&v, name);
155 }
156 
157 void
159  const std::string &name)
160 {
161  static_cast<::sc_gem5::TraceFile *>(tf)->addTraceVal(v, name);
162 }
163 
164 void
166  const std::string &name)
167 {
168  static_cast<::sc_gem5::TraceFile *>(tf)->addTraceVal(&v, name);
169 }
170 
171 void
173  const std::string &name)
174 {
175  static_cast<::sc_gem5::TraceFile *>(tf)->addTraceVal(v, name);
176 }
177 
178 void
180  const std::string &name)
181 {
182  static_cast<::sc_gem5::TraceFile *>(tf)->addTraceVal(&v, name);
183 }
184 
185 void
187  const std::string &name)
188 {
189  static_cast<::sc_gem5::TraceFile *>(tf)->addTraceVal(v, name);
190 }
191 
192 void
194  const std::string &name)
195 {
196  static_cast<::sc_gem5::TraceFile *>(tf)->addTraceVal(&v, name);
197 }
198 
199 void
201  const std::string &name)
202 {
203  static_cast<::sc_gem5::TraceFile *>(tf)->addTraceVal(v, name);
204 }
205 
206 void
207 sc_trace(sc_trace_file *tf, const sc_dt::sc_fxval &v, const std::string &name)
208 {
209  static_cast<::sc_gem5::TraceFile *>(tf)->addTraceVal(&v, name);
210 }
211 
212 void
213 sc_trace(sc_trace_file *tf, const sc_dt::sc_fxval *v, const std::string &name)
214 {
215  static_cast<::sc_gem5::TraceFile *>(tf)->addTraceVal(v, name);
216 }
217 
218 void
220  const std::string &name)
221 {
222  static_cast<::sc_gem5::TraceFile *>(tf)->addTraceVal(&v, name);
223 }
224 
225 void
227  const std::string &name)
228 {
229  static_cast<::sc_gem5::TraceFile *>(tf)->addTraceVal(v, name);
230 }
231 
232 void
233 sc_trace(sc_trace_file *tf, const sc_dt::sc_fxnum &v, const std::string &name)
234 {
235  static_cast<::sc_gem5::TraceFile *>(tf)->addTraceVal(&v, name);
236 }
237 
238 void
239 sc_trace(sc_trace_file *tf, const sc_dt::sc_fxnum *v, const std::string &name)
240 {
241  static_cast<::sc_gem5::TraceFile *>(tf)->addTraceVal(v, name);
242 }
243 
244 void
246  const std::string &name)
247 {
248  static_cast<::sc_gem5::TraceFile *>(tf)->addTraceVal(&v, name);
249 }
250 
251 void
253  const std::string &name)
254 {
255  static_cast<::sc_gem5::TraceFile *>(tf)->addTraceVal(v, name);
256 }
257 
258 void
259 sc_trace(sc_trace_file *tf, const sc_event &v, const std::string &name)
260 {
261  static_cast<::sc_gem5::TraceFile *>(tf)->addTraceVal(&v, name);
262 }
263 
264 void
265 sc_trace(sc_trace_file *tf, const sc_event *v, const std::string &name)
266 {
267  static_cast<::sc_gem5::TraceFile *>(tf)->addTraceVal(v, name);
268 }
269 
270 void
271 sc_trace(sc_trace_file *tf, const sc_time &v, const std::string &name)
272 {
273  static_cast<::sc_gem5::TraceFile *>(tf)->addTraceVal(&v, name);
274 }
275 
276 void
277 sc_trace(sc_trace_file *tf, const sc_time *v, const std::string &name)
278 {
279  static_cast<::sc_gem5::TraceFile *>(tf)->addTraceVal(v, name);
280 }
281 
282 void
283 sc_trace(sc_trace_file *tf, const unsigned char &v,
284  const std::string &name, int width)
285 {
286  static_cast<::sc_gem5::TraceFile *>(tf)->addTraceVal(&v, name, width);
287 }
288 
289 void
290 sc_trace(sc_trace_file *tf, const unsigned char *v,
291  const std::string &name, int width)
292 {
293  static_cast<::sc_gem5::TraceFile *>(tf)->addTraceVal(v, name, width);
294 }
295 
296 void
297 sc_trace(sc_trace_file *tf, const unsigned short &v,
298  const std::string &name, int width)
299 {
300  static_cast<::sc_gem5::TraceFile *>(tf)->addTraceVal(&v, name, width);
301 }
302 
303 void
304 sc_trace(sc_trace_file *tf, const unsigned short *v,
305  const std::string &name, int width)
306 {
307  static_cast<::sc_gem5::TraceFile *>(tf)->addTraceVal(v, name, width);
308 }
309 
310 void
311 sc_trace(sc_trace_file *tf, const unsigned int &v,
312  const std::string &name, int width)
313 {
314  static_cast<::sc_gem5::TraceFile *>(tf)->addTraceVal(&v, name, width);
315 }
316 
317 void
318 sc_trace(sc_trace_file *tf, const unsigned int *v,
319  const std::string &name, int width)
320 {
321  static_cast<::sc_gem5::TraceFile *>(tf)->addTraceVal(v, name, width);
322 }
323 
324 void
325 sc_trace(sc_trace_file *tf, const unsigned long &v,
326  const std::string &name, int width)
327 {
328  static_cast<::sc_gem5::TraceFile *>(tf)->addTraceVal(&v, name, width);
329 }
330 
331 void
332 sc_trace(sc_trace_file *tf, const unsigned long *v,
333  const std::string &name, int width)
334 {
335  static_cast<::sc_gem5::TraceFile *>(tf)->addTraceVal(v, name, width);
336 }
337 
338 void
339 sc_trace(sc_trace_file *tf, const char &v, const std::string &name, int width)
340 {
341  static_cast<::sc_gem5::TraceFile *>(tf)->addTraceVal(&v, name, width);
342 }
343 
344 void
345 sc_trace(sc_trace_file *tf, const char *v, const std::string &name, int width)
346 {
347  static_cast<::sc_gem5::TraceFile *>(tf)->addTraceVal(v, name, width);
348 }
349 
350 void
351 sc_trace(sc_trace_file *tf, const short &v,
352  const std::string &name, int width)
353 {
354  static_cast<::sc_gem5::TraceFile *>(tf)->addTraceVal(&v, name, width);
355 }
356 
357 void
358 sc_trace(sc_trace_file *tf, const short *v,
359  const std::string &name, int width)
360 {
361  static_cast<::sc_gem5::TraceFile *>(tf)->addTraceVal(v, name, width);
362 }
363 
364 void
365 sc_trace(sc_trace_file *tf, const int &v, const std::string &name, int width)
366 {
367  static_cast<::sc_gem5::TraceFile *>(tf)->addTraceVal(&v, name, width);
368 }
369 
370 void
371 sc_trace(sc_trace_file *tf, const int *v, const std::string &name, int width)
372 {
373  static_cast<::sc_gem5::TraceFile *>(tf)->addTraceVal(v, name, width);
374 }
375 
376 void
377 sc_trace(sc_trace_file *tf, const long &v, const std::string &name, int width)
378 {
379  static_cast<::sc_gem5::TraceFile *>(tf)->addTraceVal(&v, name, width);
380 }
381 
382 void
383 sc_trace(sc_trace_file *tf, const long *v, const std::string &name, int width)
384 {
385  static_cast<::sc_gem5::TraceFile *>(tf)->addTraceVal(v, name, width);
386 }
387 
388 void
390  const std::string &name, int width)
391 {
392  static_cast<::sc_gem5::TraceFile *>(tf)->addTraceVal(&v, name, width);
393 }
394 
395 void
397  const std::string &name, int width)
398 {
399  static_cast<::sc_gem5::TraceFile *>(tf)->addTraceVal(v, name, width);
400 }
401 
402 void
404  const std::string &name, int width)
405 {
406  static_cast<::sc_gem5::TraceFile *>(tf)->addTraceVal(&v, name, width);
407 }
408 
409 void
411  const std::string &name, int width)
412 {
413  static_cast<::sc_gem5::TraceFile *>(tf)->addTraceVal(v, name, width);
414 }
415 
416 void
418  const std::string &name, int width)
419 {
420  static_cast<::sc_gem5::TraceFile *>(tf)->
421  addTraceVal(&v.read(), name, width);
422 }
423 
424 void
426  const std::string &name, int width)
427 {
428  static_cast<::sc_gem5::TraceFile *>(tf)->
429  addTraceVal(&v.read(), name, width);
430 }
431 
432 void
434  const std::string &name, int width)
435 {
436  static_cast<::sc_gem5::TraceFile *>(tf)->
437  addTraceVal(&v.read(), name, width);
438 }
439 
440 void
442  const std::string &name, int width)
443 {
444  static_cast<::sc_gem5::TraceFile *>(tf)->
445  addTraceVal(&v.read(), name, width);
446 }
447 
448 void
449 sc_trace(sc_trace_file *tf, const unsigned int &v,
450  const std::string &name, const char **enum_literals)
451 {
452  static_cast<::sc_gem5::TraceFile *>(tf)->
453  addTraceVal(&v, name, enum_literals);
454 }
455 
456 void
458 {
459  static_cast<::sc_gem5::TraceFile *>(tf)->traceDeltas(on);
460 }
461 
462 } // namespace sc_core
sc_fxnum.hh
sc_core
Definition: messages.cc:31
ArmISA::width
Bitfield< 4 > width
Definition: miscregs_types.hh:68
sc_int_base.hh
sc_dt::sc_fxnum_fast
Definition: sc_fxnum.hh:844
sc_dt::sc_fxval
Definition: sc_fxval.hh:86
sc_dt::sc_bv_base
Definition: sc_bv_base.hh:105
sc_dt::sc_int_base
Definition: sc_int_base.hh:494
sc_core::sc_trace_file
Definition: sc_trace_file.hh:61
X86ISA::tf
Bitfield< 8 > tf
Definition: misc.hh:569
sc_bv_base.hh
sc_dt::sc_signed
Definition: sc_signed.hh:984
sc_dt::sc_logic
Definition: sc_logic.hh:130
sc_core::sc_close_vcd_trace_file
void sc_close_vcd_trace_file(sc_trace_file *tf)
Definition: sc_trace_file.cc:61
sc_event.hh
sc_dt::uint64
uint64_t uint64
Definition: sc_nbdefs.hh:206
sc_core::sc_event
Definition: sc_event.hh:169
sc_core::sc_time
Definition: sc_time.hh:49
sc_dt::sc_fxnum
Definition: sc_fxnum.hh:483
sc_signal_in_if.hh
sc_gem5::TraceFile
Definition: tracefile.hh:190
sc_core::sc_signal_in_if
Definition: sc_signal_in_if.hh:53
sc_uint_base.hh
sc_gem5::Scheduler::unregisterTraceFile
void unregisterTraceFile(TraceFile *tf)
Definition: scheduler.hh:375
sc_dt::int64
int64_t int64
Definition: sc_nbdefs.hh:205
sc_core::sc_trace
void sc_trace(sc_trace_file *tf, const sc_in< T > &i, const std::string &name)
Definition: sc_in.hh:156
name
const std::string & name()
Definition: trace.cc:50
sc_dt::sc_uint_base
Definition: sc_uint_base.hh:465
sc_core::sc_trace_file::sc_trace_file
sc_trace_file()
Definition: sc_trace_file.cc:49
sc_signed.hh
sc_dt::sc_lv_base
Definition: sc_lv_base.hh:118
sc_unsigned.hh
sc_core::sc_write_comment
void sc_write_comment(sc_trace_file *tf, const std::string &comment)
Definition: sc_trace_file.cc:69
vcd.hh
sc_dt::sc_fxval_fast
Definition: sc_fxval.hh:376
sc_core::sc_trace_file::~sc_trace_file
virtual ~sc_trace_file()
Definition: sc_trace_file.cc:50
sc_dt::sc_unsigned
Definition: sc_unsigned.hh:890
sc_gem5::Scheduler::registerTraceFile
void registerTraceFile(TraceFile *tf)
Definition: scheduler.hh:374
sc_gem5::scheduler
Scheduler scheduler
Definition: scheduler.cc:489
sc_trace_file.hh
sc_core::sc_trace_delta_cycles
void sc_trace_delta_cycles(sc_trace_file *, bool on=true)
Definition: sc_trace_file.cc:457
sc_lv_base.hh
MipsISA::on
Bitfield< 0 > on
Definition: dt_constants.hh:87
sc_time.hh
sc_logic.hh
sc_fxval.hh
scheduler.hh
ArmISA::v
Bitfield< 28 > v
Definition: miscregs_types.hh:51
sc_core::sc_create_vcd_trace_file
sc_trace_file * sc_create_vcd_trace_file(const char *name)
Definition: sc_trace_file.cc:53

Generated on Wed Sep 30 2020 14:02:18 for gem5 by doxygen 1.8.17