diff --git a/ivtest/ivltests/br_gh1143a.v b/ivtest/ivltests/br_gh1143a.v new file mode 100644 index 000000000..9553f81a7 --- /dev/null +++ b/ivtest/ivltests/br_gh1143a.v @@ -0,0 +1,29 @@ +module test; + +function integer count(input integer value); + +integer i; + +begin + i = 0; + for ( ; i < value; i = i + 1) begin + end + count = i; +end + +endfunction + +localparam integer c = count(10); + +integer v; + +initial begin + v = count(20); + $display(c,,v); + if (c === 10 && v === 20) + $display("PASSED"); + else + $display("FAILED"); +end + +endmodule diff --git a/ivtest/ivltests/br_gh1143b.v b/ivtest/ivltests/br_gh1143b.v new file mode 100644 index 000000000..9706eedbe --- /dev/null +++ b/ivtest/ivltests/br_gh1143b.v @@ -0,0 +1,29 @@ +module test; + +function integer count(input integer value); + +integer i; + +begin + for (i = 0; ; i = i + 1) begin + if (i == value) break; + end + count = i; +end + +endfunction + +localparam integer c = count(10); + +integer v; + +initial begin + v = count(20); + $display(c,,v); + if (c === 10 && v === 20) + $display("PASSED"); + else + $display("FAILED"); +end + +endmodule diff --git a/ivtest/ivltests/br_gh1143c.v b/ivtest/ivltests/br_gh1143c.v new file mode 100644 index 000000000..950fa4d1a --- /dev/null +++ b/ivtest/ivltests/br_gh1143c.v @@ -0,0 +1,29 @@ +module test; + +function integer count(input integer value); + +integer i; + +begin + for (i = 0 ; i < value; ) begin + i = i + 1; + end + count = i; +end + +endfunction + +localparam integer c = count(10); + +integer v; + +initial begin + v = count(20); + $display(c,,v); + if (c === 10 && v === 20) + $display("PASSED"); + else + $display("FAILED"); +end + +endmodule diff --git a/ivtest/ivltests/br_gh1143d.v b/ivtest/ivltests/br_gh1143d.v new file mode 100644 index 000000000..794d1f700 --- /dev/null +++ b/ivtest/ivltests/br_gh1143d.v @@ -0,0 +1,31 @@ +module test; + +function integer count(input integer value); + +integer i; + +begin + i = 0; + for ( ; ; ) begin + if (i == value) break; + i = i + 1; + end + count = i; +end + +endfunction + +localparam integer c = count(10); + +integer v; + +initial begin + v = count(20); + $display(c,,v); + if (c === 10 && v === 20) + $display("PASSED"); + else + $display("FAILED"); +end + +endmodule diff --git a/ivtest/regress-vvp.list b/ivtest/regress-vvp.list index 36ffd6773..316e8dc93 100644 --- a/ivtest/regress-vvp.list +++ b/ivtest/regress-vvp.list @@ -50,6 +50,10 @@ br_gh1099b vvp_tests/br_gh1099b.json br_gh1099c vvp_tests/br_gh1099c.json br_gh1104 vvp_tests/br_gh1104.json br_gh1122 vvp_tests/br_gh1122.json +br_gh1143a vvp_tests/br_gh1143a.json +br_gh1143b vvp_tests/br_gh1143b.json +br_gh1143c vvp_tests/br_gh1143c.json +br_gh1143d vvp_tests/br_gh1143d.json ca_time_real` vvp_tests/ca_time_real.json case1 vvp_tests/case1.json case2 vvp_tests/case2.json diff --git a/ivtest/vvp_tests/br_gh1143a.json b/ivtest/vvp_tests/br_gh1143a.json new file mode 100644 index 000000000..e76ae6347 --- /dev/null +++ b/ivtest/vvp_tests/br_gh1143a.json @@ -0,0 +1,5 @@ +{ + "type" : "normal", + "source" : "br_gh1143a.v", + "iverilog-args" : [ "-g2012" ] +} diff --git a/ivtest/vvp_tests/br_gh1143b.json b/ivtest/vvp_tests/br_gh1143b.json new file mode 100644 index 000000000..64e8ccf3c --- /dev/null +++ b/ivtest/vvp_tests/br_gh1143b.json @@ -0,0 +1,5 @@ +{ + "type" : "normal", + "source" : "br_gh1143b.v", + "iverilog-args" : [ "-g2012" ] +} diff --git a/ivtest/vvp_tests/br_gh1143c.json b/ivtest/vvp_tests/br_gh1143c.json new file mode 100644 index 000000000..b4d88049b --- /dev/null +++ b/ivtest/vvp_tests/br_gh1143c.json @@ -0,0 +1,5 @@ +{ + "type" : "normal", + "source" : "br_gh1143c.v", + "iverilog-args" : [ "-g2012" ] +} diff --git a/ivtest/vvp_tests/br_gh1143d.json b/ivtest/vvp_tests/br_gh1143d.json new file mode 100644 index 000000000..a397debcd --- /dev/null +++ b/ivtest/vvp_tests/br_gh1143d.json @@ -0,0 +1,5 @@ +{ + "type" : "normal", + "source" : "br_gh1143d.v", + "iverilog-args" : [ "-g2012" ] +}