Tests: Update historical

This commit is contained in:
Wilson Snyder 2023-05-07 22:00:52 -04:00
parent d269fbb446
commit c0490627bf
3 changed files with 30 additions and 11 deletions

View File

@ -7,6 +7,7 @@
module t; module t;
// Test all warnings, including those that are historically removed still parse // Test all warnings, including those that are historically removed still parse
// verilator lint_off ALWCOMBORDER // verilator lint_off ALWCOMBORDER
// verilator lint_off ASCRANGE
// verilator lint_off ASSIGNDLY // verilator lint_off ASSIGNDLY
// verilator lint_off ASSIGNIN // verilator lint_off ASSIGNIN
// verilator lint_off BADSTDPRAGMA // verilator lint_off BADSTDPRAGMA
@ -24,13 +25,14 @@ module t;
// verilator lint_off CMPCONST // verilator lint_off CMPCONST
// verilator lint_off COLONPLUS // verilator lint_off COLONPLUS
// verilator lint_off COMBDLY // verilator lint_off COMBDLY
// verilator lint_off CONSTRAINTIGN
// verilator lint_off CONTASSREG // verilator lint_off CONTASSREG
// verilator lint_off DEFPARAM
// verilator lint_off DECLFILENAME // verilator lint_off DECLFILENAME
// verilator lint_off DEFPARAM
// verilator lint_off DEPRECATED // verilator lint_off DEPRECATED
// verilator lint_off RISEFALLDLY // verilator lint_off ENCAPSULATED
// verilator lint_off MINTYPMAXDLY
// verilator lint_off ENDLABEL // verilator lint_off ENDLABEL
// verilator lint_off ENUMVALUE
// verilator lint_off EOFNEWLINE // verilator lint_off EOFNEWLINE
// verilator lint_off GENCLK // verilator lint_off GENCLK
// verilator lint_off HIERBLOCK // verilator lint_off HIERBLOCK
@ -38,6 +40,7 @@ module t;
// verilator lint_off IGNOREDRETURN // verilator lint_off IGNOREDRETURN
// verilator lint_off IMPERFECTSCH // verilator lint_off IMPERFECTSCH
// verilator lint_off IMPLICIT // verilator lint_off IMPLICIT
// verilator lint_off IMPLICITSTATIC
// verilator lint_off IMPORTSTAR // verilator lint_off IMPORTSTAR
// verilator lint_off IMPURE // verilator lint_off IMPURE
// verilator lint_off INCABSPATH // verilator lint_off INCABSPATH
@ -45,10 +48,12 @@ module t;
// verilator lint_off INITIALDLY // verilator lint_off INITIALDLY
// verilator lint_off INSECURE // verilator lint_off INSECURE
// verilator lint_off LATCH // verilator lint_off LATCH
// verilator lint_off ASCRANGE // verilator lint_off LITENDIAN
// verilator lint_off MINTYPMAXDLY
// verilator lint_off MODDUP // verilator lint_off MODDUP
// verilator lint_off MULTIDRIVEN // verilator lint_off MULTIDRIVEN
// verilator lint_off MULTITOP // verilator lint_off MULTITOP
// verilator lint_off NEWERSTD
// verilator lint_off NOLATCH // verilator lint_off NOLATCH
// verilator lint_off NULLPORT // verilator lint_off NULLPORT
// verilator lint_off PINCONNECTEMPTY // verilator lint_off PINCONNECTEMPTY
@ -62,9 +67,11 @@ module t;
// verilator lint_off RANDC // verilator lint_off RANDC
// verilator lint_off REALCVT // verilator lint_off REALCVT
// verilator lint_off REDEFMACRO // verilator lint_off REDEFMACRO
// verilator lint_off RISEFALLDLY
// verilator lint_off SELRANGE // verilator lint_off SELRANGE
// verilator lint_off SHORTREAL // verilator lint_off SHORTREAL
// verilator lint_off SPLITVAR // verilator lint_off SPLITVAR
// verilator lint_off STATICVAR
// verilator lint_off STMTDLY // verilator lint_off STMTDLY
// verilator lint_off SYMRSVDWORD // verilator lint_off SYMRSVDWORD
// verilator lint_off SYNCASYNCNET // verilator lint_off SYNCASYNCNET
@ -87,6 +94,9 @@ module t;
// verilator lint_off WAITCONST // verilator lint_off WAITCONST
// verilator lint_off WIDTH // verilator lint_off WIDTH
// verilator lint_off WIDTHCONCAT // verilator lint_off WIDTHCONCAT
// verilator lint_off WIDTHEXPAND
// verilator lint_off WIDTHTRUNC
// verilator lint_off WIDTHXZEXPAND
// verilator lint_off ZERODLY // verilator lint_off ZERODLY
endmodule endmodule

View File

@ -3,10 +3,10 @@
| ^~~~~ | ^~~~~
... For warning description see https://verilator.org/warn/RANDC?v=latest ... For warning description see https://verilator.org/warn/RANDC?v=latest
... Use "/* verilator lint_off RANDC */" and lint_on around source to disable this message. ... Use "/* verilator lint_off RANDC */" and lint_on around source to disable this message.
%Warning-RANDC: t/t_randc.v:45:26: Unsupported: Converting 'randc' to 'rand' %Warning-RANDC: t/t_randc.v:46:26: Unsupported: Converting 'randc' to 'rand'
45 | randc bit [WIDTH-1:0] m_var; 46 | randc bit [WIDTH-1:0] m_var;
| ^~~~~ | ^~~~~
%Warning-RANDC: t/t_randc.v:74:17: Unsupported: Converting 'randc' to 'rand' %Warning-RANDC: t/t_randc.v:76:17: Unsupported: Converting 'randc' to 'rand'
74 | randc enum_t m_var; 76 | randc enum_t m_var;
| ^~~~~ | ^~~~~
%Error: Exiting due to %Error: Exiting due to

View File

@ -13,12 +13,13 @@ class ClsNarrow #(parameter int WIDTH);
automatic int maxcount; automatic int maxcount;
automatic bit bad; automatic bit bad;
automatic int randomize_result; automatic int randomize_result;
$display("Test %m");
for (int trial = 0; trial < 10; ++trial) begin for (int trial = 0; trial < 10; ++trial) begin
for (i = 0; i < (2 ** WIDTH); ++i) begin for (i = 0; i < (2 ** WIDTH); ++i) begin
randomize_result = randomize(); randomize_result = randomize();
if (randomize_result !== 1) $stop; if (randomize_result !== 1) $stop;
`ifdef TEST_VERBOSE `ifdef TEST_VERBOSE
$display("w%0d trial=%0d m_var=%0d", WIDTH, i, m_var); $display("w%0d i=%0d m_var=%x", WIDTH, i, m_var);
`endif `endif
++count[m_var]; ++count[m_var];
end end
@ -47,11 +48,12 @@ class ClsWide #(parameter int WIDTH);
function void test; function void test;
automatic bit [WIDTH-1:0] last; automatic bit [WIDTH-1:0] last;
automatic int randomize_result; automatic int randomize_result;
$display("Test %m");
for (int i = 0; i < 100; ++i) begin for (int i = 0; i < 100; ++i) begin
randomize_result = randomize(); randomize_result = randomize();
if (randomize_result !== 1) $stop; if (randomize_result !== 1) $stop;
`ifdef TEST_VERBOSE `ifdef TEST_VERBOSE
$display("ww%0d m_var=%0d", WIDTH, i, m_var); $display("ww%0d i=%0d m_var=%x", WIDTH, i, m_var);
`endif `endif
if (i != 0) begin if (i != 0) begin
`ifndef TEST_IGNORE_RANDC `ifndef TEST_IGNORE_RANDC
@ -76,12 +78,13 @@ class ClsEnum;
function void test; function void test;
automatic enum_t last; automatic enum_t last;
automatic int randomize_result; automatic int randomize_result;
$display("Test %m");
for (int trial = 0; trial < 10; ++trial) begin for (int trial = 0; trial < 10; ++trial) begin
for (int i = 0; i < 3; ++i) begin for (int i = 0; i < 3; ++i) begin
randomize_result = randomize(); randomize_result = randomize();
if (randomize_result !== 1) $stop; if (randomize_result !== 1) $stop;
`ifdef TEST_VERBOSE `ifdef TEST_VERBOSE
$display("we trial=%0d m_var=%0d", i, m_var); $display("we i=%0d m_var=%x", i, m_var);
`endif `endif
if (m_var != TWO && m_var != FIVE && m_var != SIX) $stop; if (m_var != TWO && m_var != FIVE && m_var != SIX) $stop;
if (i != 0) begin if (i != 0) begin
@ -100,6 +103,8 @@ module t (/*AUTOARG*/);
ClsNarrow #(1) c1; // Degenerate case ClsNarrow #(1) c1; // Degenerate case
ClsNarrow #(2) c2; ClsNarrow #(2) c2;
ClsNarrow #(3) c3;
ClsNarrow #(3) c3b; // Need to have two of same size to cover dtype dedup code
ClsNarrow #(9) c9; ClsNarrow #(9) c9;
ClsWide #(31) c31; ClsWide #(31) c31;
ClsWide #(32) c32; ClsWide #(32) c32;
@ -110,6 +115,10 @@ module t (/*AUTOARG*/);
c1.test(); c1.test();
c2 = new; c2 = new;
c2.test(); c2.test();
c3 = new;
c3.test();
c3b = new;
c3b.test();
c9 = new; c9 = new;
c9.test(); c9.test();
c31 = new; c31 = new;