Commentary: Changes update

This commit is contained in:
Wilson Snyder
2026-04-15 17:46:08 -04:00
parent 1011ea86fa
commit 4fe121e5aa
7 changed files with 183 additions and 179 deletions
+4
View File
@@ -54,6 +54,7 @@ Verilator 5.047 devel
* Support sequence `first_match` operator (#7392). [Yilou Wang]
* Support nonconsecutive repetition [=N] in sequence expressions (#7397). [Yilou Wang]
* Support per-process RNG for process::srandom() and object seeding (#7408) (#7415) (#7408). [Yilou Wang]
* Support 2**n expressions in constraint randomization (#7422). [Yilou Wang]
* Add VPI callback support to --main (#7145).
* Add V3LiftExpr pass to lower impure expressions and calls (#7141) (#7164). [Geza Lore, Testorrent USA, Inc.]
* Add --func-recursion-depth CLI option (#7175) (#7179).
@@ -66,6 +67,7 @@ Verilator 5.047 devel
* Change array tracing to dump left index to right index (#7205). [Geza Lore, Testorrent USA, Inc.]
* Change `--converge-limit` default to 10000 (#7209).
* Remove DFG extract optimization pass (#7394). [Geza Lore, Testorrent USA, Inc.]
* Optimize trace code for faster compiles on repeated types (#6707) (#6832). [Todd Strader]
* Optimize size of trace declaration object code (#7150). [Szymon Gizler, Antmicro Ltd.]
* Optimize function call return value temporaries (#7152). [Geza Lore, Testorrent USA, Inc.]
* Optimize conditional merging across some impure statements (#7159). [Geza Lore, Testorrent USA, Inc.]
@@ -77,6 +79,7 @@ Verilator 5.047 devel
* Optimize more patterns in DfgPeephole (#7332). [Geza Lore, Testorrent USA, Inc.]
* Optimize read references in DFG (#7354). [Geza Lore, Testorrent USA, Inc.]
* Optimize DFG only once, after scoping (#7362). [Geza Lore, Testorrent USA, Inc.]
* Optimize more DFG peephole patterns (#7423). [Geza Lore, Testorrent USA, Inc.]
* Fix recursive default assignment for sub-arrays (#4589) (#7202). [Julian Carrier]
* Fix virtual interface member trigger convergence (#5116) (#7323). [Yilou Wang]
* Fix shift width mismatch in constraint solver SMT emission (#5420) (#7265). [Yilou Wang]
@@ -139,6 +142,7 @@ Verilator 5.047 devel
* Fix virtual interface function calls binding to wrong instance (#7363). [Yilou Wang]
* Fix false ASSIGNIN on interface input port connections (#7365). [Yilou Wang]
* Fix string `inside` queue (#7373).
* Fix subclass with rand_mode(0) getting randomized (#7376) (#7383). [Yilou Wang]
* Fix VPI access to Verilog `force`-ed signals (#7381). [Christian Hecken, Heidelberg University]
* Fix sampling of hierarchical references (#7386). [Ryszard Rozak, Antmicro Ltd.]
* Fix virtual class inheritance false error (#7403) (#7405). [Nikolay Puzanov]
+5 -5
View File
@@ -4,23 +4,23 @@
// SPDX-FileCopyrightText: 2026 Wilson Snyder
// SPDX-License-Identifier: CC0-1.0
module t (/*AUTOARG*/
module t ( /*AUTOARG*/
// Inputs
clk
);
);
input clk;
int cyc = 0;
localparam max = 1000;
logic [31:0] foo [max:0];
logic [max:0] [15:0] [31:0] bar;
logic [31:0] foo[max:0];
logic [max:0][15:0][31:0] bar;
always_ff @(posedge clk) begin
cyc <= cyc + 1;
foo[0] <= cyc;
for (int i = 1; i <= max; i++) foo[i] <= foo[i-1];
bar <= (bar << 32) | type(bar)'(cyc);
bar <= (bar << 32) | type (bar)'(cyc);
if (cyc == 10) begin
$write("*-* All Finished *-*\n");
$finish;
+6 -4
View File
@@ -9,7 +9,10 @@
bit global_bit;
module t (clk, clk2);
module t (
clk,
clk2
);
input clk;
input clk2;
integer cyc = 0;
@@ -24,7 +27,7 @@ module t (clk, clk2);
logic [7:0] unpacked_array[-7:0];
always @ (posedge clk) begin
always @(posedge clk) begin
cyc <= cyc + 1;
foo <= ~foo;
v_strp.b0 <= cyc[0];
@@ -39,7 +42,6 @@ module t (clk, clk2);
always @(posedge clk2) begin
v_strp.b1 <= cyc[1];
v_strp2.b1 <= cyc[3];
for (int i = -1; i > -8; i--)
unpacked_array[i] = cyc[7:0];
for (int i = -1; i > -8; i--) unpacked_array[i] = cyc[7:0];
end
endmodule
+2 -2
View File
@@ -4,10 +4,10 @@
// SPDX-FileCopyrightText: 2026 Wilson Snyder
// SPDX-License-Identifier: CC0-1.0
module t (/*AUTOARG*/
module t ( /*AUTOARG*/
// Inputs
clk
);
);
input clk;
int cyc;
@@ -22,8 +22,14 @@ module t (
end
end
sub sub_a (.clk, .seed(cnt));
sub sub_b (.clk, .seed(cnt + 100));
sub sub_a (
.clk,
.seed(cnt)
);
sub sub_b (
.clk,
.seed(cnt + 100)
);
endmodule
module sub (
@@ -38,19 +44,23 @@ module sub (
typedef struct packed {
inner_t sub;
logic [1:0] [7:0] arr;
logic [1:0][7:0] arr;
logic [7:0] simple;
} outer_t;
// Unpacked array of struct with nested sub-struct and packed array
outer_t uarr [1:0];
outer_t uarr[1:0];
always @(posedge clk) begin
uarr[0] <= '{sub: '{x: seed[7:0], y: seed[15:8]},
arr: '{seed[7:0], seed[7:0]+8'd1},
simple: seed[7:0]};
uarr[1] <= '{sub: '{x: ~seed[7:0], y: ~seed[15:8]},
arr: '{~seed[7:0], ~seed[7:0]+8'd1},
simple: ~seed[7:0]};
uarr[0] <= '{
sub: '{x: seed[7:0], y: seed[15:8]},
arr: '{seed[7:0], seed[7:0] + 8'd1},
simple: seed[7:0]
};
uarr[1] <= '{
sub: '{x: ~seed[7:0], y: ~seed[15:8]},
arr: '{~seed[7:0], ~seed[7:0] + 8'd1},
simple: ~seed[7:0]
};
end
endmodule
+4 -4
View File
@@ -6,7 +6,7 @@
module Sub #(
parameter int data_width
)(
) (
input clk,
output logic [data_width-1:0] read_data
);
@@ -33,10 +33,10 @@ module t ();
logic clk;
Sub #(
.data_width ($bits(struct_t))
) the_sub(
.data_width($bits(struct_t))
) the_sub (
.clk,
.read_data (the_struct)
.read_data(the_struct)
);
initial begin
+31 -43
View File
@@ -13,10 +13,10 @@
`endif
module t (/*AUTOARG*/
module t ( /*AUTOARG*/
// Inputs
clk
);
);
input clk;
int cyc;
@@ -36,22 +36,19 @@ module t (/*AUTOARG*/
int loop_cyc;
always_comb loop_cyc = cyc + i;
sub #(
.data_t (pkg::some_struct_t)
)
the_sub (
.a (loop_cyc[i%32]),
.b (loop_cyc[(i+1)%32]),
.x (x[i]),
.out_2d_unpacked (),
.data (),
.cyc (loop_cyc),
.data_t(pkg::some_struct_t)
) the_sub (
.a(loop_cyc[i%32]),
.b(loop_cyc[(i+1)%32]),
.x(x[i]),
.out_2d_unpacked(),
.data(),
.cyc(loop_cyc),
.clk
);
end
intf
the_intf_a (.*),
the_intf_b (.*);
intf the_intf_a (.*), the_intf_b (.*);
for (genvar m = 0; m < 4; m++) begin : gen_intf_loop
always_comb begin
@@ -71,7 +68,7 @@ package pkg;
typedef struct packed {
logic foo;
logic [3:0] [31:0] bar;
logic [3:0][31:0] bar;
logic [15:0] baz;
logic [127:0] qux;
some_sub_struct_t sub_struct;
@@ -83,17 +80,17 @@ endpackage
module sub #(
parameter type data_t = bit
)(
) (
input a,
input b,
output logic x,
output out_2d_unpacked [3][4],
output out_2d_unpacked[3][4],
output data_t data,
input int cyc,
input clk
);
pkg::some_struct_t the_struct;
pkg::some_struct_t the_structs [3:0];
pkg::some_struct_t the_structs[3:0];
pkg::some_struct_t [2:0] the_packed_structs;
typedef struct packed {
@@ -114,9 +111,7 @@ module sub #(
some_unpacked_struct_t the_local_unpacked_struct;
typedef union packed {
struct packed {
logic [7:0] field_0;
} union_a;
struct packed {logic [7:0] field_0;} union_a;
struct packed {
logic [3:0] field_1;
logic [3:0] field_2;
@@ -128,13 +123,13 @@ module sub #(
} some_union_t;
some_union_t the_local_union;
typedef logic [1:0] [31:0] logic_array_t;
typedef logic [1:0] [31:0] logic_array_2_t;
typedef logic [1:0][31:0] logic_array_t;
typedef logic [1:0][31:0] logic_array_2_t;
logic_array_t the_logic_array;
logic_array_2_t the_other_logic_array;
logic [15:0] the_unpacked_array [5];
logic the_2d_unpacked [3][4];
string the_string_array [3:0];
logic [15:0] the_unpacked_array[5];
logic the_2d_unpacked[3][4];
string the_string_array[3:0];
typedef logic [3:0] four_bit_t;
typedef four_bit_t [1:0] two_fours_t;
@@ -145,23 +140,15 @@ module sub #(
x <= a ^ b;
the_struct <= '{
foo : cyc[0],
bar : '{cyc, cyc+1, cyc+2, cyc+3},
bar : '{cyc, cyc + 1, cyc + 2, cyc + 3},
baz : cyc[15:0],
qux : 128'(cyc),
sub_struct : '{
field_a : cyc[0],
field_b : cyc[5:0],
field_c : cyc[9:0]
}
sub_struct : '{field_a : cyc[0], field_b : cyc[5:0], field_c : cyc[9:0]}
};
for (int i = 0; i < 4; i++) the_structs[i] <= {$bits(pkg::some_struct_t){cyc[i]}};
for (int i = 0; i < 4; i++) the_structs[i] <= {$bits(pkg::some_struct_t) {cyc[i]}};
the_local_struct <= cyc[2:0];
the_typedefed_struct <= cyc[3:1];
the_local_unpacked_struct <= '{
field_a : cyc[0],
field_b : cyc[1],
field_c : cyc[2]
};
the_local_unpacked_struct <= '{field_a : cyc[0], field_b : cyc[1], field_c : cyc[2]};
the_local_union <= cyc[7:0];
for (int i = 0; i < 2; i++) begin
the_logic_array[i] <= cyc + i;
@@ -170,17 +157,18 @@ module sub #(
for (int i = 0; i < 5; i++) the_unpacked_array[i] <= cyc[15:0];
for (int i = 0; i < 3; i++)
for (int j = 0; j < 4; j++) begin
the_2d_unpacked [i][j] <= ~(cyc[i] ^ cyc[j]);
out_2d_unpacked [i][j] <= cyc[i] ^ cyc[j];
the_2d_unpacked[i][j] <= ~(cyc[i] ^ cyc[j]);
out_2d_unpacked[i][j] <= cyc[i] ^ cyc[j];
end
end
always_comb data = the_struct;
endmodule
interface intf
(input wire clk);
logic [3:0] [7:0] data;
interface intf (
input wire clk
);
logic [3:0][7:0] data;
int data_typed;
always_comb data_typed = data;
endinterface