From c5e160f1ddc2454ceab1a97811647514b0a9bab5 Mon Sep 17 00:00:00 2001 From: Lars-Peter Clausen Date: Sat, 19 Mar 2022 12:28:15 +0100 Subject: [PATCH] Add regression test for `output reg` syntax for UDPs Check that it is possible to declare a registered output of a user defined primitive using the `output reg` syntax. Signed-off-by: Lars-Peter Clausen --- ivtest/ivltests/udp_output_reg.v | 37 ++++++++++++++++++++++++++++++++ ivtest/regress-vlg.list | 1 + 2 files changed, 38 insertions(+) create mode 100644 ivtest/ivltests/udp_output_reg.v diff --git a/ivtest/ivltests/udp_output_reg.v b/ivtest/ivltests/udp_output_reg.v new file mode 100644 index 000000000..584ad9913 --- /dev/null +++ b/ivtest/ivltests/udp_output_reg.v @@ -0,0 +1,37 @@ +// Check that it is possible to have a `output reg` in a UDP defintion + +module test; + + reg clk = 1'b0; + reg d = 1'b0; + wire q; + + dff ff(q, clk, d); + + initial begin + #1 + clk = 1'b1; + #1 + clk = 1'b0; + d = 1'b1; + + if (q === 1'b0) begin + $display("PASSED"); + end else begin + $display("FAILED"); + end + end + +endmodule + +primitive dff(q, c, d); + output reg q; + input c, d; + table + //c d : q : q+ + p 0 : ? : 0 ; + p 1 : ? : 1 ; + n ? : ? : - ; + ? * : ? : - ; + endtable +endprimitive diff --git a/ivtest/regress-vlg.list b/ivtest/regress-vlg.list index 8ca0f666f..bdbcc319f 100644 --- a/ivtest/regress-vlg.list +++ b/ivtest/regress-vlg.list @@ -1667,6 +1667,7 @@ udp_dff normal ivltests udp_dff_std normal ivltests udp_eval_arg normal ivltests udp_jkff normal ivltests +udp_output_reg normal ivltests udp_real_delay normal ivltests udp_sched normal ivltests udp_x normal ivltests