Associate trace codes with function indices (#4610)

For each traced variable, also register the trace function index that
will write it.
This commit is contained in:
Geza Lore
2023-10-23 16:01:55 +01:00
committed by GitHub
parent 1bd31742b9
commit d1b6224c2b
9 changed files with 125 additions and 83 deletions
+13 -10
View File
@@ -520,32 +520,35 @@ void VerilatedVcd::declare(uint32_t code, const char* name, const char* wirep, b
m_namemapp->emplace(hiername, decl);
}
void VerilatedVcd::declEvent(uint32_t code, const char* name, bool array, int arraynum) {
void VerilatedVcd::declEvent(uint32_t code, uint32_t fidx, const char* name, bool array,
int arraynum) {
declare(code, name, "event", array, arraynum, false, false, 0, 0);
}
void VerilatedVcd::declBit(uint32_t code, const char* name, bool array, int arraynum) {
void VerilatedVcd::declBit(uint32_t code, uint32_t fidx, const char* name, bool array,
int arraynum) {
declare(code, name, "wire", array, arraynum, false, false, 0, 0);
}
void VerilatedVcd::declBus(uint32_t code, const char* name, bool array, int arraynum, int msb,
int lsb) {
void VerilatedVcd::declBus(uint32_t code, uint32_t fidx, const char* name, bool array,
int arraynum, int msb, int lsb) {
declare(code, name, "wire", array, arraynum, false, true, msb, lsb);
}
void VerilatedVcd::declQuad(uint32_t code, const char* name, bool array, int arraynum, int msb,
int lsb) {
void VerilatedVcd::declQuad(uint32_t code, uint32_t fidx, const char* name, bool array,
int arraynum, int msb, int lsb) {
declare(code, name, "wire", array, arraynum, false, true, msb, lsb);
}
void VerilatedVcd::declArray(uint32_t code, const char* name, bool array, int arraynum, int msb,
int lsb) {
void VerilatedVcd::declArray(uint32_t code, uint32_t fidx, const char* name, bool array,
int arraynum, int msb, int lsb) {
declare(code, name, "wire", array, arraynum, false, true, msb, lsb);
}
void VerilatedVcd::declDouble(uint32_t code, const char* name, bool array, int arraynum) {
void VerilatedVcd::declDouble(uint32_t code, uint32_t fidx, const char* name, bool array,
int arraynum) {
declare(code, name, "real", array, arraynum, false, false, 63, 0);
}
//=============================================================================
// Get/commit trace buffer
VerilatedVcd::Buffer* VerilatedVcd::getTraceBuffer() {
VerilatedVcd::Buffer* VerilatedVcd::getTraceBuffer(uint32_t fidx) {
VerilatedVcd::Buffer* const bufp = new Buffer{*this};
if (parallel()) {
// Note: This is called from VerilatedVcd::dump, which already holds the lock