SystemVerilog probes · 18cVivado: supported

unique0 if: an if/else if chain where no branch may match

Vivado: supported. The open-source chain: all four stages pass.

stagetoday
rtl, simulationpass
synth, synthesispass
netlist, the netlistpass
bit, the bitstreampass

What does Vivado do with it?

Supported. UG901 v2023.2 Ch.10 Table 27 (p.287): 'Unique-if, unique0-if and priority-if: Supported'

What does the open-source chain do with it?

since #28 rtl: PASS: iverilog refuses the design, 'design.sv:4: syntax error', and dewfpga sim goes on with 'design.sv:4: note [sim-from-build]' (the simulation runs on the design as the build reads it, read by yosys' own reader, written back as Verilog and compiled with the testbench and yosys' cell models), then 'PASS'; iverilog 13 alone: syntax error at unique0 if (design.sv:4); yosys builds it; netlist: testbench only, eqv.sh cannot compile the RTL with iverilog

Which error pages explain the messages?

What is the probe's code?

From test/sv/18c_unique0_if.

design.sv

module top(input logic [15:0] sw, output logic [15:0] led);
  always_comb begin
    led = '0;
    unique0 if (sw[1:0] == 2'b01) led[0] = 1'b1;     // unique0: no branch may match, and then nothing is done
    else if (sw[1:0] == 2'b10) led[1] = 1'b1;
  end
endmodule

tb.sv

module tb;
  reg [15:0] sw = 16'h0000;
  wire [15:0] led;
  integer i;
  top dut(.sw(sw), .led(led));
  initial begin
    for (i = 0; i < 4; i = i + 1) begin
      sw = {14'h2A5A, i[1:0]}; #1
      if (!(led === {14'd0, sw[1:0] == 2'b10, sw[1:0] == 2'b01})) begin $display("FAIL: unique0 if (sw=%h led=%h)", sw, led); $finish; end
    end
    $display("PASS"); $finish;
  end
endmodule

previous: unique if / priority if
next: casez with ? wildcards, casex