SystemVerilog probes · 18bVivado: supported

unique if / priority if

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:3: syntax error', and dewfpga sim goes on with 'design.sv:3: 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 unique if

Which error pages explain the messages?

What is the probe's code?

From test/sv/18b_unique_priority_if.

design.sv

module top(input logic [15:0] sw, output logic [15:0] led);
  always_comb begin
    unique if (sw[8]) led[0] = 1'b1; else led[0] = 1'b0;
    priority if (sw[9]) led[1] = 1'b1; else if (sw[10]) led[1] = 1'b0; else led[1] = 1'b1;
    led[15:2] = '0;
  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 < 8; i = i + 1) begin
      sw = {5'h15, i[2:0], 8'h5A}; #1
      // unique if: led[0] = sw[8]; priority if: sw[9] first, then sw[10], else 1
      if (!(led === {14'd0, sw[9] | ~sw[10], sw[8]})) begin $display("FAIL: unique if / priority if (sw=%h led=%h)", sw, led); $finish; end
    end
    $display("PASS"); $finish;
  end
endmodule

previous: unique case / priority casez
next: unique0 if: an if/else if chain where no branch may match