Add testcase from #1459
authorEddie Hung <eddie@fpgeh.com>
Tue, 7 Jan 2020 00:22:22 +0000 (16:22 -0800)
committerEddie Hung <eddie@fpgeh.com>
Tue, 7 Jan 2020 00:22:22 +0000 (16:22 -0800)
tests/arch/ecp5/bug1459.ys [new file with mode: 0644]

diff --git a/tests/arch/ecp5/bug1459.ys b/tests/arch/ecp5/bug1459.ys
new file mode 100644 (file)
index 0000000..1142ae0
--- /dev/null
@@ -0,0 +1,25 @@
+read_verilog <<EOT
+module register_file(
+    input wire clk,
+    input wire write_enable,
+    input wire [63:0] write_data,
+    input wire [4:0] write_reg,
+    input wire [4:0] read1_reg,
+    output reg [63:0] read1_data,
+    );
+
+    reg [63:0] registers[0:31];
+
+    always @(posedge clk) begin
+      if (write_enable == 1'b1) begin
+        registers[write_reg] <= write_data;
+      end
+    end
+
+    always @(all) begin
+      read1_data <= registers[read1_reg];
+    end
+endmodule
+EOT
+
+synth_ecp5 -abc9