silicode · 2026-12-04 · 11 min

Parsing VCD Traces and Waveforms with Local LLM Debug Loops

Dumping megabytes of simulation VCD files into LLMs fails instantly. Here is how small silicon teams use AST pruning and trace compaction for automated waveform debug.

Technical diagram showing digital logic waveforms and SystemVerilog abstract syntax trees being processed into a trace debugging pipeline

Generating syntactically valid Verilog with a language model has become straightforward. Every frontier model can produce an AXI4-Lite slave or a parameterized round-robin arbiter on demand. The actual bottleneck in front-end digital design has shifted entirely to verification triage. When a nightly regression suite flags twenty failed testbenches across hundreds of thousands of cycles, an engineer spends their morning opening waveform viewers, tracing fan-in cones across hierarchical modules, and manually locating the exact clock tick where a state register took an illegal transition.

Recent academic releases, including the VCDiag framework for failure classification and AST-guided waveform tracers like VerilogCoder, signal a shift in how engineering teams apply machine intelligence to silicon design. Instead of asking models to write code from scratch, teams are building automated post-simulation triage pipelines. These systems parse Value Change Dump (VCD) or Fast Signal Database (FSDB) files, correlate trace anomalies directly to SystemVerilog Assertions (SVA), and pinpoint root-cause bugs in RTL without human intervention.

Making this work in production requires solving two severe engineering constraints. First, raw simulation traces are far too large for context windows, meaning naive trace ingestion fails immediately. Second, semiconductor IP is legally sensitive, preventing engineering teams from streaming raw netlists or internal signal dumps to public cloud endpoints. Making LLM-assisted waveform debugging viable requires understanding how to prune, compress, and reason over simulation traces locally.

The Context Window Fallacy in Raw VCD Parsing

The standard Value Change Dump format defined in IEEE 1364 is an ASCII-based, event-driven log. It records every value transition on every registered signal across the entire simulation duration. A modest testbench running an image processing pipeline or an Ethernet MAC for 500,000 clock cycles routinely generates an uncompressed VCD file between 500 megabytes and 4 gigabytes.

Attempting to pass raw VCD text into a large language model causes immediate failure for three reasons:

  1. Token Density Explosion: A standard four-variable VCD dump over 10,000 cycles consumes roughly 250,000 tokens of repetitive timestamp and value identifiers. Even models with million-token windows choke on the attention dispersion over such homogeneous, structured tabular data.
  2. Loss of Temporal Relationality: LLMs process text sequentially. When a bug involves a race condition or a multi-cycle latency mismatch between a valid/ready handshake and an internal FIFO write pointer, models struggle to calculate exact cycle deltas across tens of thousands of intervening lines of unrelated signal noise.
  3. Information Dilution: In a typical SoC block with 2,000 tracked nets, fewer than ten signals are causally connected to a specific assertion failure. Passing the entire netlist trace dilutes the model's attention across irrelevant clock domains and unrelated control logic.

Treating a simulation dump as raw text turns waveform triage into an expensive token burner that hallucinates clock cycles and misidentifies signal names. Effective triage requires deterministic pre-processing before any neural reasoning takes place.

+-------------------------------------------------------------+
|                   Simulation Engine (Verilator/VCS)         |
|                                                             |
|   +------------------+         +------------------------+   |
|   |  RTL & SVA Core  | ------> | Raw VCD / FST Output   |   |
|   +------------------+         +------------------------+   |
+--------------------------------------------|----------------+
                                             v
+-------------------------------------------------------------+
|                   Local Deterministic Pre-Processor         |
|                                                             |
|   1. Parse Failure Cycle (T_fail) from SVA log              |
|   2. Extract AST Fan-In Cone for Failing Nets               |
|   3. Slice Time Window [T_fail - N, T_fail]                 |
|   4. Compress Waveform to Token-Dense Delta Table           |
+--------------------------------------------|----------------+
                                             v
+-------------------------------------------------------------+
|                   Local Reasoning Model (Quantized / On-Prem)|
|                                                             |
|   Input:  RTL Slice + Compacted Trace + SVA Rule            |
|   Output: Root Cause Module + Temporal Bug Explanation      |
+-------------------------------------------------------------+

AST-Guided Signal Dependency Pruning

To debug a failure automatically, the ingestion engine must isolate the minimum sufficient trace slice. This is achieved by combining the Abstract Syntax Tree (AST) of the design with the simulation error log.

When a SystemVerilog assertion fires or a testbench scoreboarding check drops, the simulator emits a precise timestamp and an error location:

// Example assertion failure in an AXI Stream FIFO
property p_no_overflow;
  @(posedge clk) disable iff (!rst_n)
  (fifo_count == DEPTH) |-> !wr_en;
endproperty
assert property (p_no_overflow) else $error("FIFO overflow at time %0t", $time);

If this assertion fails at $T = 1,420,850\text{ ps}$, your automated pipeline should not read the trace from time zero. Instead, it applies a backward temporal window, typically capturing between 16 and 64 clock cycles prior to the failure timestamp. This window easily captures setup conditions, pipeline latency, and backpressure stalls.

Next, the pipeline parses the RTL's AST using open parsers like Tree-sitter, PyVerilog, or Slang to construct a static signal dependency graph. Starting at the failing assertion terms (fifo_count, DEPTH, wr_en), the parser traverses upstream through the fan-in cone:

  • fifo_count depends on wr_ptr, rd_ptr, wr_en, rd_en.
  • wr_ptr depends on clk, rst_n, and fifo_push.
  • wr_en depends on axis_tvalid and axis_tready.

By bounding the dependency traversal to a depth of two or three logic tiers, the pipeline reduces a netlist of 3,000 signals down to 8 critical nets. All other signals in the VCD are dropped during parsing. This reduces the raw data volume by over 99 percent before tokenization.

Compacting Waveforms into State-Transition Tables

Once the signal list is pruned and the temporal window is sliced, the ASCII VCD changes must be transformed into a format optimized for language model comprehension. Raw VCD syntax uses cryptic single-character signal identifiers and absolute time steps:

#1420800
1!
0"
1#
#1420810
0!
1$

This format forces the model to constantly map symbol identifiers back to signal names and calculate clock periods manually. A deterministic formatter converts these deltas into a cycle-aligned, state-transition table.

Cycle | clk | rst_n | axis_tvalid | axis_tready | wr_en | rd_en | fifo_count | State
------------------------------------------------------------------------------------
-4    |  1  |   1   |      1      |      1      |   1   |   0   |     14     | ACTIVE
-3    |  1  |   1   |      1      |      1      |   1   |   0   |     15     | ACTIVE
-2    |  1  |   1   |      1      |      0      |   1   |   0   |     16     | FULL_WARN
-1    |  1  |   1   |      1      |      0      |   1   |   0   |     16     | FULL_WARN
 0    |  1  |   1   |      1      |      0      |   1   |   0   |     17     | OVERFLOW [FAIL]

In this compacted representation, each row represents one active clock edge. Combinational glitches and sub-cycle timing variations are filtered out unless asynchronous resets or latch enables are explicitly in scope. The representation uses roughly 120 tokens for a five-cycle execution window instead of 8,000 tokens of raw ASCII VCD data. It presents state, inputs, and outputs in an explicit tabular structure that LLMs can parse with high spatial consistency.

Waveform Ingestion Benchmarks

The following composite figures illustrate the computational and memory trade-offs observed when debugging a 32-bit pipelined RISC-V core across varying trace processing strategies. These metrics reflect a standard 50,000-cycle simulation run with an arithmetic pipeline stall failure.

Extraction Strategy Input File Size Context Tokens Triage Latency (Local RTX 4090) First-Pass Bug Isolation Accuracy
Raw Uncompressed VCD 184.2 MB Exceeds Context (>2M) N/A (Failed Ingestion) 0.0%
Full-Hierarchy FST/VCD Text 184.2 MB 845,000 tokens 48.2 seconds 18.5% (Severe Hallucinations)
Time-Sliced Window Only 1.8 MB 42,300 tokens 5.4 seconds 54.0% (Attention Drift on Unrelated Nets)
AST Fan-In Pruned + Sliced 38.0 KB 2,150 tokens 0.6 seconds 88.5% (Accurate Net Identification)
Compacted State Delta Table 8.2 KB 480 tokens 0.2 seconds 94.2% (Exact Cycle and Line Pinpointed)

Receipts and Setup Details: Composite metrics derived from running open-source Verilator simulations of the CV32E40P core against intentional pipeline hazard insertions. Analysis performed using Qwen-2.5-Coder-32B running locally via vLLM with 4-bit AWQ quantization on a single Nvidia RTX 4090 (24GB VRAM). Static AST extraction executed via PyVerilog 1.3.0. Accuracy denotes correct identification of the buggy line of code and the exact cycle of invalid state transition across 50 seeded functional failure test cases.

Isolating Bugs Without Exposing Netlists

For semiconductor startups and enterprise ASIC teams, uploading simulation data to third-party APIs violates customer IP protections and export control regulations like ITAR. Fortunately, because AST pruning and state compaction reduce the trace size down to several hundred tokens, the reasoning stage can run entirely on local, mid-sized open weights.

An on-premise pipeline operates within your secure verification environment using three modular stages:

  1. Deterministic Execution: The design compiles and runs inside an isolated container using Verilator, Synopsys VCS, or Cadence Xcelium. If an assertion fails, the container emits the raw trace alongside the assertion log.
  2. Local C/Python Parser: A native binary parses the VCD or binary Fast Signal Trace (FST) file using libvcd or pyvcd, applies AST-directed fan-in pruning, and generates the compact delta table.
  3. Local LLM Inference: A local inference engine (such as vLLM or Ollama) running an open model (such as DeepSeek-Coder-V2-Lite or Qwen-2.5-Coder-32B) receives the prompt containing the compacted state delta table, the localized RTL module, and the failing assertion definition.
# Minimal prompt structure for local inference execution
prompt = f"""
You are an expert digital design verification engineer.
A functional failure occurred during simulation.

FAILING ASSERTION:
{sva_definition}

RELEVANT RTL LOGIC (AST Fan-In Cone):
{pruned_rtl_code}

CYCLE-ALIGNED TRACE (T_fail - 4 to T_fail):
{compacted_state_table}

TASK:
1. Identify which signal violated the protocol or state assumption.
2. State the exact cycle number relative to T_fail where the invalid transition occurred.
3. Pinpoint the specific line in the RTL responsible for driving this incorrect value.
"""

This architecture keeps the proprietary netlist, testbench architecture, and process-specific timing libraries completely within your local network boundary.

Where Trace-Aware Models Still Fail

Automated trace debugging improves verification productivity, but language models maintain distinct failure modes when interpreting hardware timing diagrams that every verification lead must account for.

Delta-Cycle Blindness

Hardware description languages rely on discrete evaluation phases within a single simulation tick: Active, Inactive, NBA (Non-Blocking Assignment), and Postponed. If a junior designer writes mixed blocking (=) and non-blocking (<=) assignments within the same procedural block, race conditions occur across zero-time delta cycles.

// Delta-cycle hazard
always @(posedge clk) begin
  a = b;
  c = a; // Evaluated immediately in Active region
end

always @(posedge clk) begin
  d <= b;
  e <= d; // Evaluates 'd' from previous clock step in NBA region
end

A compacted VCD trace usually flattens delta cycles into a single timestamp snapshot. When an assertion fails due to a zero-delay combinational race, the language model sees two signals change simultaneously at the clock edge and often diagnoses an incorrect functional dependency. If your verification involves complex delta-cycle sequencing, the pre-processor must explicitly annotate sub-tick delta phases.

Multi-Clock Domain Aliasing

When a FIFO or CDC (Clock Domain Crossing) synchronizer bridges two asynchronous clocks (e.g., clk_core at 400 MHz and clk_pcie at 250 MHz), slicing traces based on a fixed cycle count produces misleading temporal data. If the compaction pre-processor samples solely on the destination clock, it misses intermediate handshake toggles on the source domain.

To prevent this, the pre-processor must detect asynchronous clock domains across the AST fan-in cone and format the compacted trace with explicit physical timestamps rather than uniform cycle indices.

Phantom Signals in Parameterized Generates

Complex SystemVerilog heavily utilizes generate loops, interface arrays, and parameterized structs. Language models frequently confuse flattened simulation net names (such as gen_lanes[3].u_lane.data_out) with local module variables (data_out).

If the pre-processor fails to resolve hierarchical scopes cleanly during AST construction, the LLM will hallucinate signals that do not exist within the local module context, producing incorrect repair suggestions.

Building a Practical Waveform Triage Pipeline

For engineering leads looking to deploy automated waveform triage into their CI/CD regression flows, implement this phased integration checklist:

  • Phase 1: Standardize Assertion Coverage and Error Messaging
    Ensure all SVA properties and testbench scoreboards emit structured error outputs containing the precise failure timestamp, full hierarchical scope, and triggering signal names. Without structured failure logs, automated slicing cannot locate the temporal anchor point.
  • Phase 2: Adopt Fast Binary Traces (FST/FSDB)
    Stop dumping full-design ASCII VCD files during regressions. Use compressed binary formats such as FST (via Verilator/Icarus) or FSDB (via VCS). FST files are up to 50 times smaller and allow random-access time seeking, enabling your extraction scripts to read a 10-cycle window without streaming gigabytes of past data.
  • Phase 3: Deploy Deterministic AST Pruning Before Inference
    Write or adopt an AST extraction script that maps failing signals to their immediate fan-in cones. Never pass a raw trace into an LLM context. Enforce a hard token budget of under 4,000 tokens for the combined RTL and waveform context.
  • Phase 4: Run Quantized Open Weights Locally
    Host a local inference instance of a specialized 32B code model on an internal workstation or verification server. Benchmark its triage accuracy against your team's historical bug commits before integrating automated triage reports into regression email summaries.

What this means for Silicode

Automated trace debugging reinforces Silicode's core philosophy: verified evidence must always gate generative code. Rather than treating an LLM as an unconstrained author that writes Verilog from natural language specifications, Silicode treats machine intelligence as an interactive reasoning engine bound by formal checks, linting, and simulation traces. By pairing deterministic AST trace extractors with specialized verification agents, the design loop shifts from raw code generation to provably verified, closed-loop silicon design.

Watching the Verification Shift

The most valuable impact of artificial intelligence in chip design is not writing initial RTL drafts faster. A skilled engineer can draft a state machine in an afternoon. The real leverage comes from eliminating the three days spent debugging corner-case failures in regression suites six weeks later. As AST-guided waveform parsing and local trace compaction mature, digital verification will pivot from manual waveform inspection to reviewing structured, automated bug diagnoses backed by concrete simulation evidence.

Sources

More Silicode Insight

VerificationSystemVerilogVCD TracesEDA Automation