aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorEddie Hung <eddie@fpgeh.com>2019-07-02 12:35:45 -0700
committerEddie Hung <eddie@fpgeh.com>2019-07-02 12:35:45 -0700
commit35fd9b04731d3bc944e1471b96668ef0cf7b51f1 (patch)
treec92e962f36702b99f1934999d9656bb9a7c1a1b2 /tests
parent69f4c039ce615c6a6c788e7b0da53e37467d32f6 (diff)
parent8455d1f4ffb942c802b65e20748e54a123e08df0 (diff)
downloadyosys-35fd9b04731d3bc944e1471b96668ef0cf7b51f1.tar.gz
yosys-35fd9b04731d3bc944e1471b96668ef0cf7b51f1.tar.bz2
yosys-35fd9b04731d3bc944e1471b96668ef0cf7b51f1.zip
Merge remote-tracking branch 'origin/master' into xaig_dff
Diffstat (limited to 'tests')
-rw-r--r--tests/memories/read_two_mux.v16
-rwxr-xr-xtests/memories/run-test.sh4
-rw-r--r--tests/various/script.ys20
3 files changed, 40 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
diff --git a/tests/various/script.ys b/tests/various/script.ys
new file mode 100644
index 000000000..66b7b5caa
--- /dev/null
+++ b/tests/various/script.ys
@@ -0,0 +1,20 @@
+read_verilog -formal <<EOT
+ module top;
+ foo bar();
+ foo asdf();
+ winnie the_pooh();
+
+ wire [1023:0] _RUNME0 = "select -assert-count 2 t:foo";
+ wire [1023:0] _RUNME1 = "select -assert-count 1 t:winnie";
+ endmodule
+
+ module other;
+ wire [1023:0] _DELETE = "cd; delete c:bar";
+ endmodule
+EOT
+
+script -scriptwire w:_RUNME*
+
+select w:_DELETE
+script -scriptwire
+select -assert-count 1 t:foo