SystemVerilog probes · 67Vivado: supported
equality of two whole unpacked arrays: a == b, a != b
Vivado: supported. The open-source chain: all four stages pass.
| stage | today |
|---|---|
| rtl, simulation | pass |
| synth, synthesis | pass |
| netlist, the netlist | pass |
| bit, the bitstream | pass |
What does Vivado do with it?
Supported. UG901 v2023.2 Ch.10 Table 27 (p.285): 'Operations on arrays: Supported'; (p.286): 'Aggregate expressions: Supported'
What does the open-source chain do with it?
since #28 rtl: PASS: iverilog refuses the design, 'design.sv:5: error: Array a needs an array index here.', and dewfpga sim goes on with 'design.sv:5: note [sim-from-build]' (the simulation runs on the design as the build reads it, 'read by yosys-slang, the second reader', written back as Verilog and compiled with the testbench and yosys' cell models), then 'PASS'; since #4; built by yosys-slang, yosys' own reader refused this code (the note in bit.log); iverilog alone refuses it, 'design.sv:5: error: Array a needs an array index here.'; bit: 'pnr ok: 6 LUT, 0 FF, no clocked paths, timing not applicable (full log: top.log)'; netlist: PASS, 'EQV SKIP: iverilog cannot compile the RTL, so only the testbench checked the netlist'
Which error pages explain the messages?
- sim-from-build: Not an error: iverilog refused a construct in the design, so the testbench ran against the design as the build elaborates it, read by the reader the note names.
What is the probe's code?
From test/sv/67_array_compare.
design.sv
module top(input logic [15:0] sw, output logic [15:0] led);
logic [3:0] a [0:1], b [0:1];
always_comb begin
a[0] = sw[3:0]; a[1] = sw[7:4]; b[0] = sw[11:8]; b[1] = sw[15:12];
led = {14'd0, a != b, a == b}; // equality of two whole unpacked arrays
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 < 65536; i = i + 1) begin
sw = i; #1
if (!(led === {14'd0, sw[7:0] != sw[15:8], sw[7:0] == sw[15:8]})) begin $display("FAIL: a == b and a != b (sw=%h led=%h)", sw, led); $finish; end
end
$display("PASS"); $finish;
end
endmodule
previous: alias a = b; (two nets made one)
next: a slice of an unpacked array: b = a[2:3];