Skip to content

Add warnings and errors to sim -r with VCD code path#5701

Open
gussmith23 wants to merge 4 commits intomainfrom
gus/sim-with-vcd-tuneup
Open

Add warnings and errors to sim -r with VCD code path#5701
gussmith23 wants to merge 4 commits intomainfrom
gus/sim-with-vcd-tuneup

Conversation

@gussmith23
Copy link
Contributor

@gussmith23 gussmith23 commented Feb 20, 2026

We have been inspecting the sharp edges of the sim pass (see #5636). This change makes one of the sharp edges a little more visible: specifically, the behavior around undriven wires.

Currently, undriven wires will not be driven when replaying from a VCD, which is different from the behavior when replaying with a YW file. This sharp edge is often avoided entirely as flows will convert undriven wires to $anyseq, which will be driven during VCD replay. However, if one forgets to do this, they will get unexpected simulation behavior.

This change adds a check + an error (downgradeable to a warning, or entirely skippable) for undriven wires, during VCD simulation.

This check is implemented using DriverMap to check for undriven signals. Given that this may not be performant for large designs, we also add a flag to disable the check entirely.

(1) no check, (2) check with warning, (3) check
with error. Previously the single test was not
testing all cases, as it was exiting after the
first error.
@gussmith23 gussmith23 changed the title Gus/sim with vcd tuneup Add warnings and errors to sim -r with VCD code path Feb 23, 2026
@gussmith23 gussmith23 marked this pull request as ready for review February 23, 2026 19:54
Const value = builder.build();
if (shared->debug)
log("[%s] get %s: %s\n", hiername(), log_signal(sig), log_signal(value));
log("[%s] get %s: %s\n", hiername(), log_signal(sig, true), log_signal(value, true));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is adding true as second parameter for log_signal affecting results log output at all ? since this should affect only constants, if so do you have any example for that ?


issue_count++;
std::string wire_name = scope + "." + RTLIL::unescape_id(wire->name);
log_warning("Input trace contains undriven signal `%s` (%s); values for this signal are not replayed from FST/VCD input.\n",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Too long message and it will repeat if there are multiple signals, maybe add a flag for having undriven signals in file and then just display one more warning at the and with something like Values for mentioned signal(s) are not replayed from FST/VCD input.\n

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants