2012-04-13 01:08:20 +00:00
|
|
|
// -*- mode: C++; c-file-style: "cc-mode" -*-
|
2010-01-24 23:37:01 +00:00
|
|
|
//=============================================================================
|
|
|
|
//
|
2021-03-20 21:46:00 +00:00
|
|
|
// Code available from: https://verilator.org
|
2010-01-24 23:37:01 +00:00
|
|
|
//
|
2024-01-01 08:19:59 +00:00
|
|
|
// Copyright 2001-2024 by Wilson Snyder. This program is free software; you
|
2020-03-21 15:24:24 +00:00
|
|
|
// can redistribute it and/or modify it under the terms of either the GNU
|
|
|
|
// Lesser General Public License Version 3 or the Perl Artistic License
|
|
|
|
// Version 2.0.
|
|
|
|
// SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
|
2010-01-24 23:37:01 +00:00
|
|
|
//
|
|
|
|
//=============================================================================
|
|
|
|
///
|
|
|
|
/// \file
|
2021-03-20 21:46:00 +00:00
|
|
|
/// \brief Verilated tracing in VCD format header
|
|
|
|
///
|
|
|
|
/// User wrapper code should use this header when creating VCD traces.
|
2010-01-24 23:37:01 +00:00
|
|
|
///
|
|
|
|
//=============================================================================
|
|
|
|
|
2021-03-04 02:57:07 +00:00
|
|
|
#ifndef VERILATOR_VERILATED_VCD_C_H_
|
|
|
|
#define VERILATOR_VERILATED_VCD_C_H_
|
2010-01-24 23:37:01 +00:00
|
|
|
|
2017-10-21 21:53:23 +00:00
|
|
|
#include "verilated.h"
|
2020-04-19 22:57:36 +00:00
|
|
|
#include "verilated_trace.h"
|
2010-01-24 23:37:01 +00:00
|
|
|
|
|
|
|
#include <string>
|
|
|
|
#include <vector>
|
|
|
|
|
2022-05-29 18:08:39 +00:00
|
|
|
class VerilatedVcdBuffer;
|
|
|
|
class VerilatedVcdFile;
|
2015-03-05 13:54:57 +00:00
|
|
|
|
2010-01-24 23:37:01 +00:00
|
|
|
//=============================================================================
|
|
|
|
// VerilatedVcd
|
2021-03-07 13:28:13 +00:00
|
|
|
// Base class to create a Verilator VCD dump
|
|
|
|
// This is an internally used class - see VerilatedVcdC for what to call from applications
|
2010-01-24 23:37:01 +00:00
|
|
|
|
2022-05-29 18:08:39 +00:00
|
|
|
class VerilatedVcd VL_NOT_FINAL : public VerilatedTrace<VerilatedVcd, VerilatedVcdBuffer> {
|
|
|
|
public:
|
|
|
|
using Super = VerilatedTrace<VerilatedVcd, VerilatedVcdBuffer>;
|
|
|
|
|
2010-01-24 23:37:01 +00:00
|
|
|
private:
|
2022-07-18 14:32:14 +00:00
|
|
|
friend VerilatedVcdBuffer; // Give the buffer access to the private bits
|
2020-04-19 22:57:36 +00:00
|
|
|
|
|
|
|
//=========================================================================
|
2024-09-10 23:04:55 +00:00
|
|
|
// VCD-specific internals
|
2020-04-19 22:57:36 +00:00
|
|
|
|
2021-03-21 01:11:53 +00:00
|
|
|
VerilatedVcdFile* m_filep; // File we're writing to
|
|
|
|
bool m_fileNewed; // m_filep needs destruction
|
|
|
|
bool m_isOpen = false; // True indicates open file
|
|
|
|
std::string m_filename; // Filename we're writing to (if open)
|
2022-08-28 12:25:02 +00:00
|
|
|
uint64_t m_rolloverSize = 0; // File size to rollover at
|
2024-02-13 23:37:41 +00:00
|
|
|
int m_indent = 0; // Indentation depth
|
2020-04-04 17:45:24 +00:00
|
|
|
|
2021-03-21 01:11:53 +00:00
|
|
|
char* m_wrBufp; // Output buffer
|
2022-05-29 18:08:39 +00:00
|
|
|
char* m_wrFlushp; // Output buffer flush trigger location
|
2021-03-21 01:11:53 +00:00
|
|
|
char* m_writep; // Write pointer into output buffer
|
2022-05-29 18:08:39 +00:00
|
|
|
size_t m_wrChunkSize; // Output buffer size
|
|
|
|
size_t m_maxSignalBytes = 0; // Upper bound on number of bytes a single signal can generate
|
2022-03-27 19:27:40 +00:00
|
|
|
uint64_t m_wroteBytes = 0; // Number of bytes written to this file
|
2020-04-04 17:45:24 +00:00
|
|
|
|
2021-03-21 01:11:53 +00:00
|
|
|
std::vector<char> m_suffixes; // VCD line end string codes + metadata
|
2020-04-13 23:13:10 +00:00
|
|
|
|
2023-10-24 15:33:29 +00:00
|
|
|
// Prefixes to add to signal names/scope types
|
|
|
|
std::vector<std::pair<std::string, VerilatedTracePrefixType>> m_prefixStack{
|
|
|
|
{"", VerilatedTracePrefixType::SCOPE_MODULE}};
|
2017-09-23 11:44:52 +00:00
|
|
|
|
2022-05-29 18:08:39 +00:00
|
|
|
// Vector of free trace buffers as (pointer, size) pairs.
|
|
|
|
std::vector<std::pair<char*, size_t>> m_freeBuffers;
|
|
|
|
size_t m_numBuffers = 0; // Number of trace buffers allocated
|
|
|
|
|
|
|
|
void bufferResize(size_t minsize);
|
2017-10-27 01:51:51 +00:00
|
|
|
void bufferFlush() VL_MT_UNSAFE_ONE;
|
2022-09-16 12:17:38 +00:00
|
|
|
void bufferCheck() {
|
2018-08-22 23:14:06 +00:00
|
|
|
// Flush the write buffer if there's not enough space left for new information
|
|
|
|
// We only call this once per vector, so we need enough slop for a very wide "b###" line
|
2021-02-22 02:25:21 +00:00
|
|
|
if (VL_UNLIKELY(m_writep > m_wrFlushp)) bufferFlush();
|
2010-01-24 23:37:01 +00:00
|
|
|
}
|
2021-03-07 16:01:54 +00:00
|
|
|
void openNextImp(bool incFilename);
|
2010-01-24 23:37:01 +00:00
|
|
|
void closePrev();
|
|
|
|
void closeErr();
|
2018-10-14 22:39:33 +00:00
|
|
|
void printIndent(int level_change);
|
2018-08-22 23:14:06 +00:00
|
|
|
void printStr(const char* str);
|
2022-03-27 19:27:40 +00:00
|
|
|
void declare(uint32_t code, const char* name, const char* wirep, bool array, int arraynum,
|
2023-10-24 15:33:29 +00:00
|
|
|
bool bussed, int msb, int lsb);
|
2020-04-13 23:13:10 +00:00
|
|
|
|
2017-11-01 22:51:41 +00:00
|
|
|
// CONSTRUCTORS
|
|
|
|
VL_UNCOPYABLE(VerilatedVcd);
|
2020-04-04 17:45:24 +00:00
|
|
|
|
2020-04-19 22:57:36 +00:00
|
|
|
protected:
|
|
|
|
//=========================================================================
|
|
|
|
// Implementation of VerilatedTrace interface
|
|
|
|
|
2022-05-29 18:08:39 +00:00
|
|
|
// Called when the trace moves forward to a new time point
|
2022-07-30 14:01:25 +00:00
|
|
|
void emitTimeChange(uint64_t timeui) override;
|
2020-04-19 22:57:36 +00:00
|
|
|
|
|
|
|
// Hooks called from VerilatedTrace
|
2022-07-30 14:01:25 +00:00
|
|
|
bool preFullDump() override { return isOpen(); }
|
|
|
|
bool preChangeDump() override;
|
2020-04-19 22:57:36 +00:00
|
|
|
|
2022-05-29 18:08:39 +00:00
|
|
|
// Trace buffer management
|
2023-10-23 15:01:55 +00:00
|
|
|
Buffer* getTraceBuffer(uint32_t fidx) override;
|
2022-07-30 14:01:25 +00:00
|
|
|
void commitTraceBuffer(Buffer*) override;
|
2020-04-19 22:57:36 +00:00
|
|
|
|
2022-07-20 10:27:10 +00:00
|
|
|
// Configure sub-class
|
2022-07-30 15:52:35 +00:00
|
|
|
void configure(const VerilatedTraceConfig&) override{};
|
2022-07-20 10:27:10 +00:00
|
|
|
|
2010-01-24 23:37:01 +00:00
|
|
|
public:
|
2020-04-19 22:57:36 +00:00
|
|
|
//=========================================================================
|
|
|
|
// External interface to client code
|
|
|
|
|
2022-05-29 18:08:39 +00:00
|
|
|
// CONSTRUCTOR
|
2020-08-15 14:12:55 +00:00
|
|
|
explicit VerilatedVcd(VerilatedVcdFile* filep = nullptr);
|
2010-01-24 23:37:01 +00:00
|
|
|
~VerilatedVcd();
|
|
|
|
|
|
|
|
// ACCESSORS
|
2022-08-28 12:25:02 +00:00
|
|
|
// Set size in bytes after which new file should be created.
|
2022-12-02 00:32:09 +00:00
|
|
|
void rolloverSize(uint64_t size) VL_MT_SAFE { m_rolloverSize = size; }
|
2010-01-24 23:37:01 +00:00
|
|
|
|
2022-05-29 18:08:39 +00:00
|
|
|
// METHODS - All must be thread safe
|
2021-03-07 13:28:13 +00:00
|
|
|
// Open the file; call isOpen() to see if errors
|
2021-03-07 16:01:54 +00:00
|
|
|
void open(const char* filename) VL_MT_SAFE_EXCLUDES(m_mutex);
|
2021-03-07 13:28:13 +00:00
|
|
|
// Open next data-only file
|
2021-03-07 16:01:54 +00:00
|
|
|
void openNext(bool incFilename) VL_MT_SAFE_EXCLUDES(m_mutex);
|
2021-03-07 13:28:13 +00:00
|
|
|
// Close the file
|
2021-03-07 16:01:54 +00:00
|
|
|
void close() VL_MT_SAFE_EXCLUDES(m_mutex);
|
2021-03-07 13:28:13 +00:00
|
|
|
// Flush any remaining data to this file
|
2021-03-07 16:01:54 +00:00
|
|
|
void flush() VL_MT_SAFE_EXCLUDES(m_mutex);
|
2021-03-07 13:28:13 +00:00
|
|
|
// Return if file is open
|
2021-03-07 16:01:54 +00:00
|
|
|
bool isOpen() const VL_MT_SAFE { return m_isOpen; }
|
2010-01-24 23:37:01 +00:00
|
|
|
|
2020-04-19 22:57:36 +00:00
|
|
|
//=========================================================================
|
|
|
|
// Internal interface to Verilator generated code
|
2010-01-24 23:37:01 +00:00
|
|
|
|
2023-10-24 15:33:29 +00:00
|
|
|
void pushPrefix(const std::string&, VerilatedTracePrefixType);
|
|
|
|
void popPrefix();
|
|
|
|
|
|
|
|
void declEvent(uint32_t code, uint32_t fidx, const char* name, int dtypenum,
|
|
|
|
VerilatedTraceSigDirection, VerilatedTraceSigKind, VerilatedTraceSigType,
|
|
|
|
bool array, int arraynum);
|
|
|
|
void declBit(uint32_t code, uint32_t fidx, const char* name, int dtypenum,
|
|
|
|
VerilatedTraceSigDirection, VerilatedTraceSigKind, VerilatedTraceSigType,
|
|
|
|
bool array, int arraynum);
|
|
|
|
void declBus(uint32_t code, uint32_t fidx, const char* name, int dtypenum,
|
|
|
|
VerilatedTraceSigDirection, VerilatedTraceSigKind, VerilatedTraceSigType,
|
|
|
|
bool array, int arraynum, int msb, int lsb);
|
|
|
|
void declQuad(uint32_t code, uint32_t fidx, const char* name, int dtypenum,
|
|
|
|
VerilatedTraceSigDirection, VerilatedTraceSigKind, VerilatedTraceSigType,
|
|
|
|
bool array, int arraynum, int msb, int lsb);
|
|
|
|
void declArray(uint32_t code, uint32_t fidx, const char* name, int dtypenum,
|
|
|
|
VerilatedTraceSigDirection, VerilatedTraceSigKind, VerilatedTraceSigType,
|
|
|
|
bool array, int arraynum, int msb, int lsb);
|
|
|
|
void declDouble(uint32_t code, uint32_t fidx, const char* name, int dtypenum,
|
|
|
|
VerilatedTraceSigDirection, VerilatedTraceSigKind, VerilatedTraceSigType,
|
|
|
|
bool array, int arraynum);
|
2010-01-24 23:37:01 +00:00
|
|
|
};
|
|
|
|
|
2021-03-28 15:50:05 +00:00
|
|
|
#ifndef DOXYGEN
|
2022-05-29 18:08:39 +00:00
|
|
|
// Declare specialization here as it's used in VerilatedFstC just below
|
2022-08-05 09:56:57 +00:00
|
|
|
template <>
|
|
|
|
void VerilatedVcd::Super::dump(uint64_t time);
|
|
|
|
template <>
|
|
|
|
void VerilatedVcd::Super::set_time_unit(const char* unitp);
|
|
|
|
template <>
|
|
|
|
void VerilatedVcd::Super::set_time_unit(const std::string& unit);
|
|
|
|
template <>
|
|
|
|
void VerilatedVcd::Super::set_time_resolution(const char* unitp);
|
|
|
|
template <>
|
|
|
|
void VerilatedVcd::Super::set_time_resolution(const std::string& unit);
|
|
|
|
template <>
|
|
|
|
void VerilatedVcd::Super::dumpvars(int level, const std::string& hier);
|
2021-03-28 15:50:05 +00:00
|
|
|
#endif // DOXYGEN
|
2020-04-19 22:57:36 +00:00
|
|
|
|
2022-05-29 18:08:39 +00:00
|
|
|
//=============================================================================
|
|
|
|
// VerilatedVcdBuffer
|
|
|
|
|
2022-07-18 14:32:14 +00:00
|
|
|
class VerilatedVcdBuffer VL_NOT_FINAL {
|
2022-12-02 23:46:38 +00:00
|
|
|
// Give the trace file and sub-classes access to the private bits
|
2022-05-29 18:08:39 +00:00
|
|
|
friend VerilatedVcd;
|
|
|
|
friend VerilatedVcd::Super;
|
2022-07-18 14:32:14 +00:00
|
|
|
friend VerilatedVcd::Buffer;
|
|
|
|
friend VerilatedVcd::OffloadBuffer;
|
|
|
|
|
|
|
|
VerilatedVcd& m_owner; // Trace file owning this buffer. Required by subclasses.
|
2022-05-29 18:08:39 +00:00
|
|
|
|
2022-07-19 16:06:26 +00:00
|
|
|
// Write pointer into output buffer (in parallel mode, this is set up in 'getTraceBuffer')
|
|
|
|
char* m_writep = m_owner.parallel() ? nullptr : m_owner.m_writep;
|
|
|
|
// Output buffer flush trigger location (only used when not parallel)
|
|
|
|
char* const m_wrFlushp = m_owner.parallel() ? nullptr : m_owner.m_wrFlushp;
|
2022-05-29 18:08:39 +00:00
|
|
|
|
|
|
|
// VCD line end string codes + metadata
|
|
|
|
const char* const m_suffixes = m_owner.m_suffixes.data();
|
|
|
|
// The maximum number of bytes a single signal can emit
|
|
|
|
const size_t m_maxSignalBytes = m_owner.m_maxSignalBytes;
|
|
|
|
|
2022-07-19 16:06:26 +00:00
|
|
|
// Additional data for parallel tracing only
|
|
|
|
char* m_bufp = nullptr; // The beginning of the trace buffer
|
|
|
|
size_t m_size = 0; // The size of the buffer at m_bufp
|
|
|
|
char* m_growp = nullptr; // Resize limit pointer
|
2022-05-29 18:08:39 +00:00
|
|
|
|
|
|
|
void adjustGrowp() {
|
|
|
|
m_growp = (m_bufp + m_size) - (2 * m_maxSignalBytes);
|
|
|
|
assert(m_growp >= m_bufp + m_maxSignalBytes);
|
|
|
|
}
|
|
|
|
|
2022-07-19 16:06:26 +00:00
|
|
|
void finishLine(uint32_t code, char* writep);
|
|
|
|
|
2022-05-29 18:08:39 +00:00
|
|
|
// CONSTRUCTOR
|
2022-07-18 14:32:14 +00:00
|
|
|
explicit VerilatedVcdBuffer(VerilatedVcd& owner)
|
|
|
|
: m_owner{owner} {}
|
|
|
|
virtual ~VerilatedVcdBuffer() = default;
|
2022-05-29 18:08:39 +00:00
|
|
|
|
|
|
|
//=========================================================================
|
|
|
|
// Implementation of VerilatedTraceBuffer interface
|
|
|
|
// Implementations of duck-typed methods for VerilatedTraceBuffer. These are
|
|
|
|
// called from only one place (the full* methods), so always inline them.
|
2024-09-10 23:14:52 +00:00
|
|
|
VL_ATTR_ALWINLINE void emitEvent(uint32_t code);
|
2022-09-16 12:17:38 +00:00
|
|
|
VL_ATTR_ALWINLINE void emitBit(uint32_t code, CData newval);
|
|
|
|
VL_ATTR_ALWINLINE void emitCData(uint32_t code, CData newval, int bits);
|
|
|
|
VL_ATTR_ALWINLINE void emitSData(uint32_t code, SData newval, int bits);
|
|
|
|
VL_ATTR_ALWINLINE void emitIData(uint32_t code, IData newval, int bits);
|
|
|
|
VL_ATTR_ALWINLINE void emitQData(uint32_t code, QData newval, int bits);
|
|
|
|
VL_ATTR_ALWINLINE void emitWData(uint32_t code, const WData* newvalp, int bits);
|
|
|
|
VL_ATTR_ALWINLINE void emitDouble(uint32_t code, double newval);
|
2022-05-29 18:08:39 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
//=============================================================================
|
|
|
|
// VerilatedFile
|
|
|
|
/// Class representing a file to write to. These virtual methods can be
|
|
|
|
/// overrode for e.g. socket I/O.
|
|
|
|
|
|
|
|
class VerilatedVcdFile VL_NOT_FINAL {
|
|
|
|
private:
|
|
|
|
int m_fd = 0; // File descriptor we're writing to
|
|
|
|
public:
|
|
|
|
// METHODS
|
|
|
|
/// Construct a (as yet) closed file
|
|
|
|
VerilatedVcdFile() = default;
|
|
|
|
/// Close and destruct
|
|
|
|
virtual ~VerilatedVcdFile() = default;
|
|
|
|
/// Open a file with given filename
|
|
|
|
virtual bool open(const std::string& name) VL_MT_UNSAFE;
|
|
|
|
/// Close object's file
|
|
|
|
virtual void close() VL_MT_UNSAFE;
|
|
|
|
/// Write data to file (if it is open)
|
|
|
|
virtual ssize_t write(const char* bufp, ssize_t len) VL_MT_UNSAFE;
|
|
|
|
};
|
|
|
|
|
2010-01-24 23:37:01 +00:00
|
|
|
//=============================================================================
|
|
|
|
// VerilatedVcdC
|
2021-03-28 15:50:05 +00:00
|
|
|
/// Class representing a VCD dump file in C standalone (no SystemC)
|
|
|
|
/// simulations. Also derived for use in SystemC simulations.
|
2010-01-24 23:37:01 +00:00
|
|
|
|
2024-03-30 20:00:52 +00:00
|
|
|
class VerilatedVcdC VL_NOT_FINAL : public VerilatedTraceBaseC {
|
2021-03-21 01:11:53 +00:00
|
|
|
VerilatedVcd m_sptrace; // Trace file being created
|
2017-11-01 22:51:41 +00:00
|
|
|
|
2010-01-24 23:37:01 +00:00
|
|
|
// CONSTRUCTORS
|
2017-11-01 22:51:41 +00:00
|
|
|
VL_UNCOPYABLE(VerilatedVcdC);
|
2020-04-04 17:45:24 +00:00
|
|
|
|
2017-11-01 22:51:41 +00:00
|
|
|
public:
|
2021-03-07 13:28:13 +00:00
|
|
|
/// Construct the dump. Optional argument is a preconstructed file.
|
2020-08-15 14:12:55 +00:00
|
|
|
explicit VerilatedVcdC(VerilatedVcdFile* filep = nullptr)
|
2020-08-16 13:55:36 +00:00
|
|
|
: m_sptrace{filep} {}
|
2021-03-07 13:28:13 +00:00
|
|
|
/// Destruct, flush, and close the dump
|
2021-12-22 23:41:11 +00:00
|
|
|
virtual ~VerilatedVcdC() { close(); }
|
2020-04-04 17:45:24 +00:00
|
|
|
|
2021-03-07 13:28:13 +00:00
|
|
|
// METHODS - User called
|
|
|
|
|
|
|
|
/// Return if file is open
|
2024-03-30 20:00:52 +00:00
|
|
|
bool isOpen() const override VL_MT_SAFE { return m_sptrace.isOpen(); }
|
2010-01-24 23:37:01 +00:00
|
|
|
/// Open a new VCD file
|
2013-02-24 02:10:25 +00:00
|
|
|
/// This includes a complete header dump each time it is called,
|
|
|
|
/// just as if this object was deleted and reconstructed.
|
2021-12-22 23:41:11 +00:00
|
|
|
virtual void open(const char* filename) VL_MT_SAFE { m_sptrace.open(filename); }
|
2010-01-24 23:37:01 +00:00
|
|
|
/// Continue a VCD dump by rotating to a new file name
|
2013-02-24 02:10:25 +00:00
|
|
|
/// The header is only in the first file created, this allows
|
|
|
|
/// "cat" to be used to combine the header plus any number of data files.
|
2021-03-07 16:01:54 +00:00
|
|
|
void openNext(bool incFilename = true) VL_MT_SAFE { m_sptrace.openNext(incFilename); }
|
2022-08-28 12:25:02 +00:00
|
|
|
/// Set size in bytes after which new file should be created
|
|
|
|
/// This will create a header file, followed by each separate file
|
|
|
|
/// which might be larger than the given size (due to chunking and
|
|
|
|
/// alignment to a start of a given time's dump). Any file but the
|
|
|
|
/// first may be removed. Cat files together to create viewable vcd.
|
|
|
|
void rolloverSize(size_t size) VL_MT_SAFE { m_sptrace.rolloverSize(size); }
|
2010-01-24 23:37:01 +00:00
|
|
|
/// Close dump
|
2024-03-30 20:00:52 +00:00
|
|
|
void close() VL_MT_SAFE {
|
|
|
|
m_sptrace.close();
|
|
|
|
modelConnected(false);
|
|
|
|
}
|
2010-01-24 23:37:01 +00:00
|
|
|
/// Flush dump
|
2021-03-07 16:01:54 +00:00
|
|
|
void flush() VL_MT_SAFE { m_sptrace.flush(); }
|
2010-01-24 23:37:01 +00:00
|
|
|
/// Write one cycle of dump data
|
2021-05-13 22:56:07 +00:00
|
|
|
/// Call with the current context's time just after eval'ed,
|
|
|
|
/// e.g. ->dump(contextp->time())
|
2022-03-27 19:27:40 +00:00
|
|
|
void dump(uint64_t timeui) VL_MT_SAFE { m_sptrace.dump(timeui); }
|
2010-01-24 23:37:01 +00:00
|
|
|
/// Write one cycle of dump data - backward compatible and to reduce
|
2022-03-27 19:27:40 +00:00
|
|
|
/// conversion warnings. It's better to use a uint64_t time instead.
|
|
|
|
void dump(double timestamp) { dump(static_cast<uint64_t>(timestamp)); }
|
|
|
|
void dump(uint32_t timestamp) { dump(static_cast<uint64_t>(timestamp)); }
|
|
|
|
void dump(int timestamp) { dump(static_cast<uint64_t>(timestamp)); }
|
2021-03-07 13:28:13 +00:00
|
|
|
|
|
|
|
// METHODS - Internal/backward compatible
|
|
|
|
// \protectedsection
|
|
|
|
|
|
|
|
// Set time units (s/ms, defaults to ns)
|
|
|
|
// Users should not need to call this, as for Verilated models, these
|
2023-11-11 04:25:53 +00:00
|
|
|
// propagate from the Verilated default timeunit
|
2021-03-07 16:01:54 +00:00
|
|
|
void set_time_unit(const char* unit) VL_MT_SAFE { m_sptrace.set_time_unit(unit); }
|
|
|
|
void set_time_unit(const std::string& unit) VL_MT_SAFE { m_sptrace.set_time_unit(unit); }
|
2021-03-07 13:28:13 +00:00
|
|
|
// Set time resolution (s/ms, defaults to ns)
|
|
|
|
// Users should not need to call this, as for Verilated models, these
|
2023-11-11 04:25:53 +00:00
|
|
|
// propagate from the Verilated default timeprecision
|
2021-03-07 16:01:54 +00:00
|
|
|
void set_time_resolution(const char* unit) VL_MT_SAFE { m_sptrace.set_time_resolution(unit); }
|
|
|
|
void set_time_resolution(const std::string& unit) VL_MT_SAFE {
|
|
|
|
m_sptrace.set_time_resolution(unit);
|
|
|
|
}
|
2022-03-05 20:44:32 +00:00
|
|
|
// Set variables to dump, using $dumpvars format
|
|
|
|
// If level = 0, dump everything and hier is then ignored
|
|
|
|
void dumpvars(int level, const std::string& hier) VL_MT_SAFE {
|
|
|
|
m_sptrace.dumpvars(level, hier);
|
|
|
|
}
|
2017-06-20 23:33:58 +00:00
|
|
|
|
2021-03-07 13:28:13 +00:00
|
|
|
// Internal class access
|
2022-09-16 12:17:38 +00:00
|
|
|
VerilatedVcd* spTrace() { return &m_sptrace; }
|
2010-01-24 23:37:01 +00:00
|
|
|
};
|
|
|
|
|
2018-08-22 23:14:06 +00:00
|
|
|
#endif // guard
|