SystemVerilog probes · 64Vivado: supported
an unpacked struct: typedef struct { logic [3:0] a; logic [3:0] b; } (no packed)
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): 'Packed/Unpacked structures: Supported'
What does the open-source chain do with it?
since #28 rtl: PASS: iverilog refuses the design, 'design.sv:2: sorry: Unpacked structs not supported.', and dewfpga sim goes on with 'design.sv:2: 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:2: sorry: Unpacked structs not supported.'; bit: 'pnr ok: 0 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/64_unpacked_struct.
design.sv
module top(input logic [15:0] sw, output logic [15:0] led);
typedef struct { logic [3:0] a; logic [3:0] b; } pair_t; // an unpacked struct (no 'packed')
pair_t p;
always_comb begin
p.a = sw[3:0];
p.b = sw[7:4];
led = {8'd0, p.a, p.b};
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 < 256; i = i + 1) begin
sw = {i[3:0], 4'h9, i[7:0]}; #1
if (!(led === {8'd0, sw[3:0], sw[7:4]})) begin $display("FAIL: p.a and p.b (sw=%h led=%h)", sw, led); $finish; end
end
$display("PASS"); $finish;
end
endmodule
previous: a real literal in a localparam used in an expression: localparam MAX = 1e1; ... count == MAX - 1 (a lab writes 50e6)
next: an unpacked union: typedef union { logic [7:0] byte_v; logic [3:0] nib; } (no packed), one member written and read