Forum Discussion

boondocklabs's avatar
boondocklabs
Icon for New Member rankNew Member
1 hour ago

Quartus 25.1std miscompiles wildcard casez with constant concatenation — RTL/gate mismatch

Quartus Prime Lite 25.1std silently synthesizes the following legal combinational Verilog to a constant-high output, although the RTL requires fire = en. The mismatch exists in the functional post-synthesis netlist, before fitting. The same source passes Vivado 2026.1.

Environment

  • Quartus Prime Lite 25.1std.0 Build 1129, Linux x86_64; Cyclone V 5CGXFC5C6F27C7.
  • Quartus input mode: SYSTEMVERILOG_FILE. A separate VERILOG_FILE test also reproduces the discarded input dependency.
  • Quartus gate simulation: Icarus Verilog 14.0 using unmodified Altera cyclonev_atoms.v and altera_primitives.v.
  • Comparison: Vivado 2026.1 build 6511674, Artix-7 xc7a35tcpg236-1; native XSim 2026.1 and Icarus 14.0, using unmodified AMD cell models.

Minimal reproducer

module trigger(input en, input other, output reg fire);
    always @* begin
        fire = 1'b0;
        casez ({en, 1'b0})
            2'b1?: fire = 1'b1;
        endcase
    end
endmodule

The unused input other keeps the interface identical to the control variant below. No Amaranth, Yosys, IP, clocks, initialization, synthesis attributes, or FPGA hardware are required.

Expected and actual behavior

The pattern masks the low selector bit and requires the high bit, en, to equal 1. Therefore fire must equal en. The output is assigned on every execution of the combinational block.

en other | RTL | Quartus gate | Vivado gate
0  0     | 0   | 1 (wrong)    | 0
0  1     | 0   | 1 (wrong)    | 0
1  0     | 1   | 1            | 1
1  1     | 1   | 1            | 1

All inputs are driven to binary 0/1 values. Quartus connects the fire output buffer to vcc and reports: No output dependent on input pin "en". Vivado preserves en → IBUF → OBUF → fire.

Equivalent controls

  • Replace 2'b1? with 2'b10, keeping {en, 1'b0}: correct in both tools. This is equivalent because the low selector bit is constant zero.
  • Keep 2'b1? but use {en, other}: correct in both tools for all input combinations.

RTL/gate mismatches over four input combinations:
                     wildcard  exact-pattern  variable-selector
Quartus / Icarus        2            0                 0
Vivado / XSim           0            0                 0
Vivado / Icarus         0            0                 0

The RTL references and shared testbench are byte-identical between tools. The Icarus cross-check excludes an Icarus-versus-XSim discrepancy. Generated netlists and vendor cell models were not edited.

Reproduce

Extract the attached ZIP and run from its root, replacing the Quartus installation path as appropriate:

python3 run_gate.py synth --quartus-root /path/to/quartus --output-dir quartus-output
python3 run_gate.py simulate --output-dir quartus-output

The first step runs quartus_map and exports functional netlists using quartus_eda. The second step intentionally exits nonzero when the RTL/gate mismatch is reproduced, with wildcard=2 exact=0 variable=0.

The ZIP contains the full report, source, QSF settings, shared testbench, reproduction scripts, all three unmodified Quartus and Vivado netlists, and the recorded failing/passing logs. Full Vivado/XSim reproduction commands are in REPORT.txt. Vendor simulation library sources are not bundled; the scripts use local installations.

Impact and follow-up

In a larger design this construct removed state-update enables and changed behavior despite passing timing. Fully lowering processes to explicit mux/enable logic before Quartus reads the Verilog avoids the trigger.

Please confirm the miscompilation, provide an existing or new defect tracking number, and advise whether a patch or supported synthesis setting is available for Quartus Lite/Standard 25.1. Other Quartus versions have not been tested.

1 Reply

  • ai_responder's avatar
    ai_responder
    Icon for Community Manager rankCommunity Manager

    Thank you for your inquiry. To ensure an accurate response, your request has been routed to an Altera application engineer for further review and assistance.


    Note: To continue using AI Responder, please start your next inquiry with ai_responder

    Disclaimer: AI-generated responses may contain errors or omissions. Please verify technical guidance with official Altera documentation before implementation.

    Thank you very much.