Skip to content

cosim: --xprop unsupported — reactive cosim is two-state-only, silently zero-inits uninitialized DFF/SRAM #95

@robtaylor

Description

@robtaylor

Summary

Selective X-propagation (--xprop, ADR 0016) is wired into the sim
subcommand only. CosimArgs has no xprop field, so jacquard cosim --xprop is rejected, and the reactive cosim run loop never allocates or
carries the X-mask state. As a result, reactive JTAG-replay / peripheral
cosim always runs two-state.

Per ADR 0016, two-state mode "silently resolves uninitialised DFF and SRAM
outputs to zero." So for a post-synthesis netlist that contains unreset
sequential state — e.g. a register file synthesised as unreset flip-flops,
or an SRAM before its first write — cosim cannot model power-up X. Its
output VCD shows a definite 0/1 where a four-state RTL simulator emits
x, which yields false agreement against 4-state RTL and silently masks
initialisation-order bugs. That is the exact failure mode --xprop was
introduced (on sim) to surface.

There is currently no workaround: sim (which has --xprop) consumes a
static input VCD and cannot perform the reactive replay (JTAG, bus
peripherals) that cosim provides — so there is no way to run an X-aware
reactive cosim today.

Repro

jacquard cosim --config sim_config.json design.nl.v \
  --top-module top --jtag-replay bitbang.rec --timing-vcd out.vcd --xprop
# error: unexpected argument '--xprop' found

Where it is / isn't wired (main @ eaebfb6)

  • src/bin/jacquard.rs:153xprop: bool on SimArgs.
  • CosimArgs (src/bin/jacquard.rs:207) — no xprop field.
  • cmd_sim (:371) threads args.xprop into the design build; cmd_cosim
    does not.
  • The X-mask state-buffer handling cmd_sim relies on —
    expand_states_for_xprop, the sram_xmask shadow (init 0xFFFF_FFFF),
    split_xprop_states / write_output_vcd_xprop — has no counterpart in
    the cosim run loop.

So this is more than exposing a flag: the reactive cosim loop needs the
X-mask state carried across the per-cycle peripheral steps to match the
static path.

Request

Extend selective X-propagation to cosim: add xprop to CosimArgs,
thread it into the design build, and carry the X-mask state buffer through
the cosim step loop, so reactive cosim can model uninitialised-state X and
emit x in the timing VCD. Until then, noting on the cosim help / docs
that X-propagation is sim-only would help avoid silently trusting a
two-state reactive run as if it were X-aware.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions