Skip to content

KNOWNBUG test for nonblocking followed by blocking assignment - #2139

Merged
kroening merged 2 commits into
diffblue:mainfrom
kroening:kroening/knownbug-nonblocking-then-blocking
Sep 23, 2026
Merged

kroening merged 2 commits into
diffblue:mainfrom
kroening:kroening/knownbug-nonblocking-then-blocking

Conversation

@kroening

Copy link
Copy Markdown
Collaborator

Summary

Adds a KNOWNBUG regression test for a pre-existing soundness bug that is present in both the legacy synthesis flow and the new RTL construction (#2119).

A nonblocking assignment schedules the update in the NBA region, which follows the active region in which the blocking assignments of the same time step execute (1800-2017 4.9.3). A blocking assignment to the same variable later in the same block is therefore overridden by the earlier nonblocking one. Both flows instead let the last assignment in program order win.

always @(posedge clk) begin
  x <= 1;
  x = 2;
end
p0: assert property (@(posedge clk) ##1 x == 1);  // REFUTED: x == 2

Also covers y <= y + 10; y++;. Expected values cross-checked with Icarus Verilog.

Testing

  • regression/verilog/assignments/nonblocking-then-blocking1.desc is reported as SKIPPED by test.pl.
  • Run as CORE, the test fails with both the legacy and the RTL flow at e224197c.

Root cause

record_assignment in src/verilog/verilog_rtl.cpp writes blocking and nonblocking values into the same state.values map, so program order decides. Nonblocking values need to take precedence over blocking ones in the committed next-state value (while blocking values are still what subsequent reads in the block see).

PR diffblue#2119 replaced verilog_synthesis with verilog_transition_relation
(RTL construction) in the EBMC flow. The disable1 and release1 tests
still expected the old synthesis-path diagnostics, so they failed.

Update both .desc files to match the new RTL-construction error
messages:
* disable1: "statement `disable' is not supported by RTL construction"
* release1: "statement `force' is not supported by RTL construction"
A nonblocking assignment schedules the update of the variable in the
NBA region, which follows the active region in which the blocking
assignments of the same time step are executed (1800-2017 4.9.3). A
blocking assignment to the same variable that follows the nonblocking
assignment in the same block is hence overridden by the nonblocking
one. Both the RTL construction and synthesis instead let the last
assignment in program order win.
@kroening
kroening force-pushed the kroening/knownbug-nonblocking-then-blocking branch from 363a1c1 to a9b22f9 Compare September 23, 2026 21:09
@kroening
kroening merged commit 0f0fe09 into diffblue:main Sep 23, 2026
11 checks passed
@kroening
kroening deleted the kroening/knownbug-nonblocking-then-blocking branch September 23, 2026 21:37
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