aboutsummaryrefslogtreecommitdiffstats
path: root/tests/memories
diff options
context:
space:
mode:
authorDavid Shah <dave@ds0.me>2019-07-02 13:27:37 +0100
committerDavid Shah <dave@ds0.me>2019-07-02 13:35:50 +0100
commitd45936fe5f2c6fd1e6f371b2fc3d6d820868ef72 (patch)
tree8ff666a0cf8df461c4c228417c908d23ce4ecc91 /tests/memories
parentd206eca03b8aa7bb982fb2486c02c90a61354066 (diff)
downloadyosys-d45936fe5f2c6fd1e6f371b2fc3d6d820868ef72.tar.gz
yosys-d45936fe5f2c6fd1e6f371b2fc3d6d820868ef72.tar.bz2
yosys-d45936fe5f2c6fd1e6f371b2fc3d6d820868ef72.zip
memory_dff: Fix checking of feedback mux input when more than one mux
Signed-off-by: David Shah <dave@ds0.me>
Diffstat (limited to 'tests/memories')
-rw-r--r--tests/memories/read_two_mux.v16
-rwxr-xr-xtests/memories/run-test.sh4
2 files changed, 20 insertions, 0 deletions
diff --git a/tests/memories/read_two_mux.v b/tests/memories/read_two_mux.v
new file mode 100644
index 000000000..4f2e7e1cd
--- /dev/null
+++ b/tests/memories/read_two_mux.v
@@ -0,0 +1,16 @@
+// expect-wr-ports 1
+// expect-rd-ports 1
+// expect-no-rd-clk
+
+module top(input clk, input we, re, reset, input [7:0] addr, wdata, output reg [7:0] rdata);
+
+reg [7:0] bram[0:255];
+(* keep *) reg dummy;
+
+always @(posedge clk) begin
+ rdata <= re ? (reset ? 8'b0 : bram[addr]) : rdata;
+ if (we)
+ bram[addr] <= wdata;
+end
+
+endmodule
diff --git a/tests/memories/run-test.sh b/tests/memories/run-test.sh
index 76acaa9cd..8d1a8b413 100755
--- a/tests/memories/run-test.sh
+++ b/tests/memories/run-test.sh
@@ -31,6 +31,10 @@ for f in `egrep -l 'expect-(wr-ports|rd-ports|rd-clk)' *.v`; do
grep -q "connect \\\\RD_CLK \\$(gawk '/expect-rd-clk/ { print $3; }' $f)\$" ${f%.v}.dmp ||
{ echo " ERROR: Unexpected read clock."; false; }
fi
+ if grep -q expect-no-rd-clk $f; then
+ grep -q "connect \\\\RD_CLK 1'x\$" ${f%.v}.dmp ||
+ { echo " ERROR: Expected no read clock."; false; }
+ fi
echo " ok."
done