From 52d049b513dfa520e74f5abbf1acdda76650c499 Mon Sep 17 00:00:00 2001 From: Martin Whitaker Date: Sun, 25 Feb 2024 21:54:20 +0000 Subject: [PATCH] Add additional regression tests for issue #1099. --- ivtest/ivltests/{br_gh1099.v => br_gh1099a.v} | 0 ivtest/ivltests/br_gh1099b.v | 24 +++++++++++++++++++ ivtest/ivltests/br_gh1099c.v | 24 +++++++++++++++++++ ivtest/regress-vvp.list | 4 +++- ivtest/vvp_tests/br_gh1099.json | 4 ---- ivtest/vvp_tests/br_gh1099a.json | 4 ++++ ivtest/vvp_tests/br_gh1099b.json | 4 ++++ ivtest/vvp_tests/br_gh1099c.json | 4 ++++ 8 files changed, 63 insertions(+), 5 deletions(-) rename ivtest/ivltests/{br_gh1099.v => br_gh1099a.v} (100%) create mode 100644 ivtest/ivltests/br_gh1099b.v create mode 100644 ivtest/ivltests/br_gh1099c.v delete mode 100644 ivtest/vvp_tests/br_gh1099.json create mode 100644 ivtest/vvp_tests/br_gh1099a.json create mode 100644 ivtest/vvp_tests/br_gh1099b.json create mode 100644 ivtest/vvp_tests/br_gh1099c.json diff --git a/ivtest/ivltests/br_gh1099.v b/ivtest/ivltests/br_gh1099a.v similarity index 100% rename from ivtest/ivltests/br_gh1099.v rename to ivtest/ivltests/br_gh1099a.v diff --git a/ivtest/ivltests/br_gh1099b.v b/ivtest/ivltests/br_gh1099b.v new file mode 100644 index 000000000..e67d89a68 --- /dev/null +++ b/ivtest/ivltests/br_gh1099b.v @@ -0,0 +1,24 @@ +module top; + reg [3:0] inp1; + reg signed [3:0] inp2; + wire [4:0] out1, out2; + initial begin + $monitor("%b %b %b %b", inp1, inp2, out1, out2); + #1 inp1 = 4'b1111; + #1 inp2 = 4'b1111; + #1; + if ((out1 === 5'b01111) && (out2 === 5'b01111)) + $display("PASSED"); + else + $display("FAILED"); + end + mod m1(inp1[3:0], out1); + mod m2(inp2[3:0], out2); +endmodule + +module mod( + input [4:0] inp, + output [4:0] out +); + assign out = inp; +endmodule diff --git a/ivtest/ivltests/br_gh1099c.v b/ivtest/ivltests/br_gh1099c.v new file mode 100644 index 000000000..12c77bf4f --- /dev/null +++ b/ivtest/ivltests/br_gh1099c.v @@ -0,0 +1,24 @@ +module top; + reg [3:0] inp1; + reg signed [3:0] inp2; + wire [4:0] out1, out2; + initial begin + $monitor("%b %b %b %b", inp1, inp2, out1, out2); + #1 inp1 = 4'b1111; + #1 inp2 = 4'b1111; + #1; + if ((out1 === 5'b01111) && (out2 === 5'b01111)) + $display("PASSED"); + else + $display("FAILED"); + end + mod m1($unsigned(inp1), out1); + mod m2($unsigned(inp2), out2); +endmodule + +module mod( + input [4:0] inp, + output [4:0] out +); + assign out = inp; +endmodule diff --git a/ivtest/regress-vvp.list b/ivtest/regress-vvp.list index 1d8a066cc..79662c919 100644 --- a/ivtest/regress-vvp.list +++ b/ivtest/regress-vvp.list @@ -42,7 +42,9 @@ br_gh1087a2 vvp_tests/br_gh1087a2.json br_gh1087a3 vvp_tests/br_gh1087a3.json br_gh1087b vvp_tests/br_gh1087b.json br_gh1087c vvp_tests/br_gh1087c.json -br_gh1099 vvp_tests/br_gh1099.json +br_gh1099a vvp_tests/br_gh1099a.json +br_gh1099b vvp_tests/br_gh1099b.json +br_gh1099c vvp_tests/br_gh1099c.json br_gh1104 vvp_tests/br_gh1104.json ca_time_real` vvp_tests/ca_time_real.json case1 vvp_tests/case1.json diff --git a/ivtest/vvp_tests/br_gh1099.json b/ivtest/vvp_tests/br_gh1099.json deleted file mode 100644 index 5f4d411e8..000000000 --- a/ivtest/vvp_tests/br_gh1099.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "type" : "normal", - "source" : "br_gh1099.v" -} diff --git a/ivtest/vvp_tests/br_gh1099a.json b/ivtest/vvp_tests/br_gh1099a.json new file mode 100644 index 000000000..7a01ac8ba --- /dev/null +++ b/ivtest/vvp_tests/br_gh1099a.json @@ -0,0 +1,4 @@ +{ + "type" : "normal", + "source" : "br_gh1099a.v" +} diff --git a/ivtest/vvp_tests/br_gh1099b.json b/ivtest/vvp_tests/br_gh1099b.json new file mode 100644 index 000000000..045eda3a7 --- /dev/null +++ b/ivtest/vvp_tests/br_gh1099b.json @@ -0,0 +1,4 @@ +{ + "type" : "normal", + "source" : "br_gh1099b.v" +} diff --git a/ivtest/vvp_tests/br_gh1099c.json b/ivtest/vvp_tests/br_gh1099c.json new file mode 100644 index 000000000..945344a0e --- /dev/null +++ b/ivtest/vvp_tests/br_gh1099c.json @@ -0,0 +1,4 @@ +{ + "type" : "normal", + "source" : "br_gh1099c.v" +}