From d18bcc2a69f672fc5d377159d39315d3cb2d801d Mon Sep 17 00:00:00 2001 From: Wilson Snyder Date: Sun, 23 Aug 2026 15:16:41 -0400 Subject: [PATCH] Commentary: Changes update --- Changes | 6 +- docs/spelling.txt | 1 + test_regress/t/t_constraint_enum_lambda_arg.v | 8 +-- test_regress/t/t_covergroup_args_bad.out | 32 +++++----- test_regress/t/t_covergroup_args_bad.v | 10 ++-- test_regress/t/t_covergroup_args_expr_bad.out | 18 +++--- test_regress/t/t_covergroup_args_expr_bad.v | 12 ++-- test_regress/t/t_covergroup_args_type_bad.out | 58 +++++++++---------- test_regress/t/t_covergroup_args_type_bad.v | 27 +++++---- test_regress/t/t_covergroup_member_event.v | 2 +- 10 files changed, 88 insertions(+), 86 deletions(-) diff --git a/Changes b/Changes index 6abef0bd2..9901cfa19 100644 --- a/Changes +++ b/Changes @@ -39,6 +39,8 @@ Verilator 5.051 devel * Support `weak`/`strong` keywords in property expressions (#8054). [Artur Bieniek, Antmicro Ltd.] * Support class handle covergroup arguments (#8071). [Marco Bartoli] * Support overlong `within` sequences as never-matching (#8177). [Artur Bieniek, Antmicro Ltd.] +* Support covergroup/function/task (ref/virtual/array) interface arguments (#8180). [Marco Bartoli] +* Support covergroup events with reference members or ref arguments (#8201). [Marco Bartoli] * Optimize random initialization. [Geza Lore, Testorrent USA, Inc.] * Optimize more always blocks in DFG (#7775). [Geza Lore, Testorrent USA, Inc.] * Optimize assertion NFAs using bit-vector ring buffers (#7885). [Artur Bieniek, Antmicro Ltd.] @@ -51,6 +53,7 @@ Verilator 5.051 devel * Optimize NFA delay-ring edge traversal, drop complexity to linear (#8145). [Artur Bieniek, Antmicro Ltd.] * Fix $finish continuing event loop (#7267) (#7950). [Artur Bieniek, Antmicro Ltd.] * Fix $display accepting streaming concat arguments (#7663) (#7890). [Jaeuk Lee] +* Fix typedef clocking input sampling (#7688 partial) (#8204). [Marco Bartoli] * Fix DFG misoptimizing bound checks (#7755). [Jakub Michalski] * Fix unique0 case side effects (#7787). [Pawel Klopotek] * Fix mid-window disable iff (#7792) (#7869). [Yilou Wang] @@ -149,7 +152,8 @@ Verilator 5.051 devel * Fix crash on forward-referencing parameters (#8175). [Geza Lore, Testorrent USA, Inc.] * Fix crash on empty `#()` parameter list on class instance (#8182). [Geza Lore, Testorrent USA, Inc.] * Fix crash on multiple missing type parameters (#8184). [Geza Lore, Testorrent USA, Inc.] -* Fix internal on backslash quoted strings (#8198). [Henry Hsieh] +* Fix internal error on an enum literal inside a `with` lambda body (#8190) (#8193). [Aditya Shevade] +* Fix internal error on backslash-quoted strings (#8198). [Henry Hsieh] Verilator 5.050 2026-07-01 diff --git a/docs/spelling.txt b/docs/spelling.txt index 2f3c5c26a..e0f21eb9b 100644 --- a/docs/spelling.txt +++ b/docs/spelling.txt @@ -198,6 +198,7 @@ Holme Homebrew Hornung Hossell +Hsieh Hsu Huggett Hutt diff --git a/test_regress/t/t_constraint_enum_lambda_arg.v b/test_regress/t/t_constraint_enum_lambda_arg.v index c3c3a6ad7..c52c05477 100644 --- a/test_regress/t/t_constraint_enum_lambda_arg.v +++ b/test_regress/t/t_constraint_enum_lambda_arg.v @@ -18,16 +18,12 @@ typedef enum bit [1:0] { class EnumLambdaArg; rand cmd_e items[8]; - constraint c_count { - items.sum() with (item == WRITE ? 1 : 0) == 3; - } + constraint c_count {items.sum() with (item == WRITE ? 1 : 0) == 3;} endclass // Same shape, but the enum lives in a struct field reached via the lambda // argument (item.kind), not the array element itself. -typedef struct { - cmd_e kind; -} entry_t; +typedef struct {cmd_e kind;} entry_t; class StructFieldEnumLambdaArg; rand entry_t items[8]; constraint c_find { diff --git a/test_regress/t/t_covergroup_args_bad.out b/test_regress/t/t_covergroup_args_bad.out index 7c71eed2f..12541a4b6 100644 --- a/test_regress/t/t_covergroup_args_bad.out +++ b/test_regress/t/t_covergroup_args_bad.out @@ -5,22 +5,22 @@ %Error: t/t_covergroup_args_bad.v:14:33: Covergroup formal arguments cannot be output or inout (IEEE 1800-2012 19.3) 14 | covergroup cg_inout(inout bit arg); | ^~~ -%Error: t/t_covergroup_args_bad.v:18:63: Covergroup sample formal argument must have input direction (IEEE 1800-2012 19.8.1). - 18 | covergroup cg_sample_output with function sample(output bit arg); - | ^~~ -%Error: t/t_covergroup_args_bad.v:22:61: Covergroup sample formal argument must have input direction (IEEE 1800-2012 19.8.1). - 22 | covergroup cg_sample_inout with function sample(inout bit arg); - | ^~~ -%Error: t/t_covergroup_args_bad.v:26:57: Covergroup sample formal argument must have input direction (IEEE 1800-2012 19.8.1). - 26 | covergroup cg_sample_ref with function sample(ref bit arg); - | ^~~ -%Error: t/t_covergroup_args_bad.v:30:69: Covergroup sample formal argument must have input direction (IEEE 1800-2012 19.8.1). - 30 | covergroup cg_sample_const_ref with function sample(const ref bit arg); - | ^~~ -%Error: t/t_covergroup_args_bad.v:34:61: Duplicate declaration of signal: 'arg' - 34 | covergroup cg_duplicate(bit arg) with function sample(bit arg); - | ^~~ +%Error: t/t_covergroup_args_bad.v:18:64: Covergroup sample formal argument must have input direction (IEEE 1800-2012 19.8.1). + 18 | covergroup cg_sample_output with function sample (output bit arg); + | ^~~ +%Error: t/t_covergroup_args_bad.v:22:62: Covergroup sample formal argument must have input direction (IEEE 1800-2012 19.8.1). + 22 | covergroup cg_sample_inout with function sample (inout bit arg); + | ^~~ +%Error: t/t_covergroup_args_bad.v:26:58: Covergroup sample formal argument must have input direction (IEEE 1800-2012 19.8.1). + 26 | covergroup cg_sample_ref with function sample (ref bit arg); + | ^~~ +%Error: t/t_covergroup_args_bad.v:30:70: Covergroup sample formal argument must have input direction (IEEE 1800-2012 19.8.1). + 30 | covergroup cg_sample_const_ref with function sample (const ref bit arg); + | ^~~ +%Error: t/t_covergroup_args_bad.v:34:62: Duplicate declaration of signal: 'arg' + 34 | covergroup cg_duplicate(bit arg) with function sample (bit arg); + | ^~~ t/t_covergroup_args_bad.v:34:31: ... Location of original declaration - 34 | covergroup cg_duplicate(bit arg) with function sample(bit arg); + 34 | covergroup cg_duplicate(bit arg) with function sample (bit arg); | ^~~ %Error: Exiting due to diff --git a/test_regress/t/t_covergroup_args_bad.v b/test_regress/t/t_covergroup_args_bad.v index 60ec5ba7b..54c1db27c 100644 --- a/test_regress/t/t_covergroup_args_bad.v +++ b/test_regress/t/t_covergroup_args_bad.v @@ -15,23 +15,23 @@ module t; cp: coverpoint arg; endgroup - covergroup cg_sample_output with function sample(output bit arg); + covergroup cg_sample_output with function sample (output bit arg); cp: coverpoint arg; endgroup - covergroup cg_sample_inout with function sample(inout bit arg); + covergroup cg_sample_inout with function sample (inout bit arg); cp: coverpoint arg; endgroup - covergroup cg_sample_ref with function sample(ref bit arg); + covergroup cg_sample_ref with function sample (ref bit arg); cp: coverpoint arg; endgroup - covergroup cg_sample_const_ref with function sample(const ref bit arg); + covergroup cg_sample_const_ref with function sample (const ref bit arg); cp: coverpoint arg; endgroup - covergroup cg_duplicate(bit arg) with function sample(bit arg); + covergroup cg_duplicate(bit arg) with function sample (bit arg); cp: coverpoint arg; endgroup diff --git a/test_regress/t/t_covergroup_args_expr_bad.out b/test_regress/t/t_covergroup_args_expr_bad.out index 92636d847..8feca1573 100644 --- a/test_regress/t/t_covergroup_args_expr_bad.out +++ b/test_regress/t/t_covergroup_args_expr_bad.out @@ -33,16 +33,16 @@ : ... note: In instance 't' 20 | bins output_bin = {function_output(value)}; | ^~~~~~~~~~~~~~~ -%Error: t/t_covergroup_args_expr_bad.v:27:19: Ref covergroup constructor formal argument 'value' may not be used in a covergroup expression (IEEE 1800-2012 19.5). +%Error: t/t_covergroup_args_expr_bad.v:26:55: Ref covergroup constructor formal argument 'value' may not be used in a covergroup expression (IEEE 1800-2012 19.5). : ... note: In instance 't' - 27 | bins bad = {value}; - | ^~~~~ -%Error: t/t_covergroup_args_expr_bad.v:27:19: Non-constant expression in bin range; values must be constants + 26 | cp_constructor_ref: coverpoint value {bins bad = {value};} + | ^~~~~ +%Error: t/t_covergroup_args_expr_bad.v:26:55: Non-constant expression in bin range; values must be constants : ... note: In instance 't' - 27 | bins bad = {value}; - | ^~~~~ -%Error: t/t_covergroup_args_expr_bad.v:34:19: Non-constant expression in bin range; range bounds must be constants + 26 | cp_constructor_ref: coverpoint value {bins bad = {value};} + | ^~~~~ +%Error: t/t_covergroup_args_expr_bad.v:31:47: Non-constant expression in bin range; range bounds must be constants : ... note: In instance 't' - 34 | bins bad = {[0:nonconstant_bound]}; - | ^ + 31 | cp_bad: coverpoint 0 iff (1) {bins bad = {[0 : nonconstant_bound]};} + | ^ %Error: Exiting due to diff --git a/test_regress/t/t_covergroup_args_expr_bad.v b/test_regress/t/t_covergroup_args_expr_bad.v index cf7cee18a..7e8c169c6 100644 --- a/test_regress/t/t_covergroup_args_expr_bad.v +++ b/test_regress/t/t_covergroup_args_expr_bad.v @@ -14,7 +14,7 @@ module t; return value; endfunction - covergroup cg with function sample(bit value); + covergroup cg with function sample (bit value); cp_option: coverpoint value { bins ref_bin = {0, function_ref(value)}; bins output_bin = {function_output(value)}; @@ -23,17 +23,13 @@ module t; endgroup covergroup cg_constructor_ref(ref bit value); - cp_constructor_ref: coverpoint value { - bins bad = {value}; - } + cp_constructor_ref: coverpoint value {bins bad = {value};} endgroup bit nonconstant_bound; covergroup cg_cross_bad; - cp_bad: coverpoint 0 iff (1) { - bins bad = {[0:nonconstant_bound]}; - } - cp_ok: coverpoint 0 { bins zero = {0}; } + cp_bad: coverpoint 0 iff (1) {bins bad = {[0 : nonconstant_bound]};} + cp_ok: coverpoint 0 {bins zero = {0};} cross_bad: cross cp_bad, cp_ok; endgroup diff --git a/test_regress/t/t_covergroup_args_type_bad.out b/test_regress/t/t_covergroup_args_type_bad.out index ed99263c7..08abbc166 100644 --- a/test_regress/t/t_covergroup_args_type_bad.out +++ b/test_regress/t/t_covergroup_args_type_bad.out @@ -1,54 +1,54 @@ -%Error: t/t_covergroup_args_type_bad.v:30:16: Virtual interface argument 'vif' requires a compatible interface type, parameters, and modport. +%Error: t/t_covergroup_args_type_bad.v:34:16: Virtual interface argument 'vif' requires a compatible interface type, parameters, and modport. : ... note: In instance 't.port_type_mismatch' - 30 | cg cov = new(intf); + 34 | cg cov = new(intf); | ^~~~ ... See the manual at https://verilator.org/verilator_doc.html?v=latest for more assistance. -%Error: t/t_covergroup_args_type_bad.v:62:27: Assigning to const ref variable: 'value' +%Error: t/t_covergroup_args_type_bad.v:68:27: Assigning to const ref variable: 'value' : ... note: In instance 't' - 62 | cp: coverpoint mutate(value); + 68 | cp: coverpoint mutate(value); | ^~~~~ -%Error: t/t_covergroup_args_type_bad.v:77:45: Ref argument requires matching types; port 'state' requires 'class{}BaseState' but connection is 'class{}DerivedState'. +%Error: t/t_covergroup_args_type_bad.v:83:45: Ref argument requires matching types; port 'state' requires 'class{}BaseState' but connection is 'class{}DerivedState'. : ... note: In instance 't' - 77 | cg_const_ref_type const_ref_type_cg = new(derived_state); + 83 | cg_const_ref_type const_ref_type_cg = new(derived_state); | ^~~~~~~~~~~~~ -%Error: t/t_covergroup_args_type_bad.v:78:47: Virtual interface argument 'input_vif' requires a compatible interface type, parameters, and modport. +%Error: t/t_covergroup_args_type_bad.v:84:47: Virtual interface argument 'input_vif' requires a compatible interface type, parameters, and modport. : ... note: In instance 't' - 78 | cg_interface_types interface_types_cg = new(vif6, vif6, vif6); + 84 | cg_interface_types interface_types_cg = new(vif6, vif6, vif6); | ^~~~ -%Error: t/t_covergroup_args_type_bad.v:78:53: Ref virtual interface argument 'ref_vif' requires the same interface type, parameters, and modport. +%Error: t/t_covergroup_args_type_bad.v:84:53: Ref virtual interface argument 'ref_vif' requires the same interface type, parameters, and modport. : ... note: In instance 't' - 78 | cg_interface_types interface_types_cg = new(vif6, vif6, vif6); + 84 | cg_interface_types interface_types_cg = new(vif6, vif6, vif6); | ^~~~ -%Error: t/t_covergroup_args_type_bad.v:78:59: Ref virtual interface argument 'const_ref_vif' requires the same interface type, parameters, and modport. +%Error: t/t_covergroup_args_type_bad.v:84:59: Ref virtual interface argument 'const_ref_vif' requires the same interface type, parameters, and modport. : ... note: In instance 't' - 78 | cg_interface_types interface_types_cg = new(vif6, vif6, vif6); + 84 | cg_interface_types interface_types_cg = new(vif6, vif6, vif6); | ^~~~ -%Error: t/t_covergroup_args_type_bad.v:80:13: Virtual interface argument 'input_vif' requires a compatible interface type, parameters, and modport. +%Error: t/t_covergroup_args_type_bad.v:85:55: Virtual interface argument 'input_vif' requires a compatible interface type, parameters, and modport. : ... note: In instance 't' - 80 | = new(monitor_vif, monitor_vif, monitor_vif); - | ^~~~~~~~~~~ -%Error: t/t_covergroup_args_type_bad.v:80:26: Ref virtual interface argument 'ref_vif' requires the same interface type, parameters, and modport. + 85 | cg_interface_types interface_modport_types_cg = new(monitor_vif, monitor_vif, monitor_vif); + | ^~~~~~~~~~~ +%Error: t/t_covergroup_args_type_bad.v:85:68: Ref virtual interface argument 'ref_vif' requires the same interface type, parameters, and modport. : ... note: In instance 't' - 80 | = new(monitor_vif, monitor_vif, monitor_vif); - | ^~~~~~~~~~~ -%Error: t/t_covergroup_args_type_bad.v:80:39: Ref virtual interface argument 'const_ref_vif' requires the same interface type, parameters, and modport. + 85 | cg_interface_types interface_modport_types_cg = new(monitor_vif, monitor_vif, monitor_vif); + | ^~~~~~~~~~~ +%Error: t/t_covergroup_args_type_bad.v:85:81: Ref virtual interface argument 'const_ref_vif' requires the same interface type, parameters, and modport. : ... note: In instance 't' - 80 | = new(monitor_vif, monitor_vif, monitor_vif); - | ^~~~~~~~~~~ -%Error: t/t_covergroup_args_type_bad.v:82:42: Virtual interface argument 'vifs' requires a compatible interface type, parameters, and modport. + 85 | cg_interface_types interface_modport_types_cg = new(monitor_vif, monitor_vif, monitor_vif); + | ^~~~~~~~~~~ +%Error: t/t_covergroup_args_type_bad.v:87:42: Virtual interface argument 'vifs' requires a compatible interface type, parameters, and modport. : ... note: In instance 't' - 82 | cg_array_input bad_input_modport = new(driver5); + 87 | cg_array_input bad_input_modport = new(driver5); | ^~~~~~~ -%Error: t/t_covergroup_args_type_bad.v:83:44: Virtual interface argument 'vifs' requires a compatible interface type, parameters, and modport. +%Error: t/t_covergroup_args_type_bad.v:88:44: Virtual interface argument 'vifs' requires a compatible interface type, parameters, and modport. : ... note: In instance 't' - 83 | cg_array_input bad_input_parameter = new(monitor6); + 88 | cg_array_input bad_input_parameter = new(monitor6); | ^~~~~~~~ -%Error: t/t_covergroup_args_type_bad.v:84:38: Ref virtual interface argument 'vifs' requires the same interface type, parameters, and modport. +%Error: t/t_covergroup_args_type_bad.v:89:38: Ref virtual interface argument 'vifs' requires the same interface type, parameters, and modport. : ... note: In instance 't' - 84 | cg_array_ref bad_ref_modport = new(driver5); + 89 | cg_array_ref bad_ref_modport = new(driver5); | ^~~~~~~ -%Error: t/t_covergroup_args_type_bad.v:85:52: Ref virtual interface argument 'vifs' requires the same interface type, parameters, and modport. +%Error: t/t_covergroup_args_type_bad.v:90:52: Ref virtual interface argument 'vifs' requires the same interface type, parameters, and modport. : ... note: In instance 't' - 85 | cg_array_const_ref bad_const_ref_parameter = new(monitor6); + 90 | cg_array_const_ref bad_const_ref_parameter = new(monitor6); | ^~~~~~~~ %Error: Exiting due to diff --git a/test_regress/t/t_covergroup_args_type_bad.v b/test_regress/t/t_covergroup_args_type_bad.v index c6f0befbf..799d6c053 100644 --- a/test_regress/t/t_covergroup_args_type_bad.v +++ b/test_regress/t/t_covergroup_args_type_bad.v @@ -10,7 +10,9 @@ endclass class DerivedState extends BaseState; endclass -interface ParameterizedIf #(int WIDTH = 5); +interface ParameterizedIf #( + int WIDTH = 5 +); logic [WIDTH-1:0] value; modport monitor(input value); modport driver(output value); @@ -22,7 +24,9 @@ interface ModportIf; modport driver(output value); endinterface -module CovergroupPortTypeMismatch(ModportIf.monitor intf); +module CovergroupPortTypeMismatch ( + ModportIf.monitor intf +); covergroup cg(input virtual ModportIf.driver vif); cp: coverpoint vif.value; endgroup @@ -31,10 +35,10 @@ module CovergroupPortTypeMismatch(ModportIf.monitor intf); endmodule module t; - ParameterizedIf #(5) if5(); - ParameterizedIf #(6) if6(); - ModportIf modport_if(); - CovergroupPortTypeMismatch port_type_mismatch(modport_if); + ParameterizedIf #(5) if5 (); + ParameterizedIf #(6) if6 (); + ModportIf modport_if (); + CovergroupPortTypeMismatch port_type_mismatch (modport_if); DerivedState derived_state = new; virtual ParameterizedIf #(5).monitor monitor_vif = if5; @@ -52,9 +56,11 @@ module t; cp: coverpoint (state == null); endgroup - covergroup cg_interface_types(input virtual ParameterizedIf #(5) input_vif, - ref virtual ParameterizedIf #(5) ref_vif, - const ref virtual ParameterizedIf #(5) const_ref_vif); + covergroup cg_interface_types( + input virtual ParameterizedIf #(5) input_vif, + ref virtual ParameterizedIf #(5) ref_vif, + const ref virtual ParameterizedIf #(5) const_ref_vif + ); cp: coverpoint input_vif.value; endgroup @@ -76,8 +82,7 @@ module t; cg_const_ref_type const_ref_type_cg = new(derived_state); cg_interface_types interface_types_cg = new(vif6, vif6, vif6); - cg_interface_types interface_modport_types_cg - = new(monitor_vif, monitor_vif, monitor_vif); + cg_interface_types interface_modport_types_cg = new(monitor_vif, monitor_vif, monitor_vif); cg_read_only_ref read_only_ref_cg = new(mutable_value); cg_array_input bad_input_modport = new(driver5); cg_array_input bad_input_parameter = new(monitor6); diff --git a/test_regress/t/t_covergroup_member_event.v b/test_regress/t/t_covergroup_member_event.v index 24644f044..8ed02391d 100644 --- a/test_regress/t/t_covergroup_member_event.v +++ b/test_regress/t/t_covergroup_member_event.v @@ -12,7 +12,7 @@ interface EventIf; endinterface module t; - EventIf event_if(); + EventIf event_if (); logic ref_clock; logic [1:0] ref_clocks;