Files
verilator/test_regress/t/t_constraint_implication_else_bad.v
T
Yilou Wangandgithub action cfebe805c9 Support implication operator with constraint_set (#7300) (#7448)
* Support implication operator with constraint_set

* improve coverage, achieve 100 line cov

* Address review: simplify addNext; tighten disable soft grammar to constraint_primary

* Apply 'make format'

* re-run

---------

Co-authored-by: github action <[email protected]>
2026-04-23 10:50:23 +02:00

24 lines
581 B
Systemverilog

// DESCRIPTION: Verilator: Verilog Test module
//
// This file ONLY is placed under the Creative Commons Public Domain.
// SPDX-FileCopyrightText: 2026 PlanV GmbH
// SPDX-License-Identifier: CC0-1.0
class C;
rand bit [3:0] a;
rand bit [3:0] b;
// IEEE 1800-2023 18.7.2: implication operator -> takes one constraint_set
// on the RHS; it is single-armed (no else clause). Only the if (...) form
// accepts an optional else branch.
constraint c_bad {
(a == 0) -> { b == 4'h1; } else { b == 4'h2; }
}
endclass
module t;
initial begin
$stop;
end
endmodule