aboutsummaryrefslogtreecommitdiffstats
path: root/tests/opt/opt_ff.v
diff options
context:
space:
mode:
authorKeith Rothman <537074+litghost@users.noreply.github.com>2019-02-22 10:28:28 -0800
committerKeith Rothman <537074+litghost@users.noreply.github.com>2019-02-22 10:30:42 -0800
commit25680f6a078bb32f157bd580705656496717bafb (patch)
tree5a7166ce7bfd4385cd1fd9bd53b02291a85f8b85 /tests/opt/opt_ff.v
parentd55790909c3b4244889d092c8eae630c7efd1aee (diff)
downloadyosys-25680f6a078bb32f157bd580705656496717bafb.tar.gz
yosys-25680f6a078bb32f157bd580705656496717bafb.tar.bz2
yosys-25680f6a078bb32f157bd580705656496717bafb.zip
Fix WREDUCE on FF not fixing ARST_VALUE parameter.
Adds test case that fails without code change. Signed-off-by: Keith Rothman <537074+litghost@users.noreply.github.com>
Diffstat (limited to 'tests/opt/opt_ff.v')
-rw-r--r--tests/opt/opt_ff.v21
1 files changed, 21 insertions, 0 deletions
diff --git a/tests/opt/opt_ff.v b/tests/opt/opt_ff.v
new file mode 100644
index 000000000..a01b64b61
--- /dev/null
+++ b/tests/opt/opt_ff.v
@@ -0,0 +1,21 @@
+module top(
+ input clk,
+ input rst,
+ input [2:0] a,
+ output [1:0] b
+);
+ reg [2:0] b_reg;
+ initial begin
+ b_reg <= 3'b0;
+ end
+
+ assign b = b_reg[1:0];
+ always @(posedge clk or posedge rst) begin
+ if(rst) begin
+ b_reg <= 3'b0;
+ end else begin
+ b_reg <= a;
+ end
+ end
+endmodule
+