T27.AI

Blog

A real value must not travel in an integer container

2026-08-31 · 7 min read

A merged Verilog-emitter fix moved one simulation case from 5 PASSED / 6 FAILED to 11 PASSED while syntax acceptance stayed at 380 files, showing why form and numerical-meaning gates must be separate.

Three-panel engraved illustration for: A real value must not travel in an integer container
Three panels, left to right
  1. THE CONTAINERInteger storage loses the fraction.
  2. THE CALCULATIONEleven simulation checks now pass.
  3. THE OTHER GATE380 syntax accepts, before and after.
View the complete triptych at full size
#Verilog#Simulation#Compiler#Testing

[measured] A merged t27 change found two places where a real-valued result was forced through an integer container in the Verilog emitter. On specs/trinet/etx.t27 under icarus-simulate, the targeted run moved from 5 PASSED / 6 FAILED with exit code 1 to 11 PASSED with exit code 0.

The file was valid; the calculation was not

One site routed every multiplication through __mul_noop, whose [63:0] inputs rounded a real operand before using it. Thus __mul_noop(0.3, 10.0) produced 0, and ewma_step(5.0, 0.3, 10.0) returned 5.0 instead of 6.5. Another site emitted every given binding as reg [63:0], so ewma_step(0.5, 0.5, 1.0) stored 1 instead of 0.75.

icarus-simulate specs/trinet/etx.t27
before: 5 PASSED / 6 FAILED, exit 1
after:  11 PASSED, exit 0

[measured] The change reached 46 of 581 generated Verilog files. Yet iverilog -g2012 accepted 380 files before and after. The stable syntax count is the point: a simulator can accept a file while the generated program computes a different value.

Two checks, not one

A syntactically valid generated file is not evidence that its numerical result is valid.

The patch also keeps a useful negative result. Five mutations of this defect were killed by tests, but that is evidence about this test set, not a certificate for the whole compiler. The unchanged iverilog acceptance count does not establish computational equivalence either.

What remains open

For an engineering pipeline, keep the gates separate: one asks whether the simulator accepts the generated file, and another compares its numerical result with an independent expected value. The form gate checks shape; the meaning gate checks the calculation.

What this does not settle

Receipts

Work with me

Want this kind of check on your own design?

I audit RTL and build independent, bit-exact models, then take the result through synthesis and, when useful, onto an Artix-7 board. The first conformance module is free.