aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorEddie Hung <eddie@fpgeh.com>2020-05-02 09:56:10 -0700
committerEddie Hung <eddie@fpgeh.com>2020-05-02 10:00:32 -0700
commit2e78daf1ca68068ca9fa02eca1cc10e64d92cb11 (patch)
tree84c33858ecc9793b55fe8a88947e077edbd23695 /tests
parenta0afa1787e71fca1fb143a96580136f4bf355251 (diff)
downloadyosys-2e78daf1ca68068ca9fa02eca1cc10e64d92cb11.tar.gz
yosys-2e78daf1ca68068ca9fa02eca1cc10e64d92cb11.tar.bz2
yosys-2e78daf1ca68068ca9fa02eca1cc10e64d92cb11.zip
tests: aiger test for wire->start_offset != 0
Diffstat (limited to 'tests')
-rw-r--r--tests/aiger/neg.ys36
-rwxr-xr-xtests/aiger/run-test.sh5
2 files changed, 41 insertions, 0 deletions
diff --git a/tests/aiger/neg.ys b/tests/aiger/neg.ys
new file mode 100644
index 000000000..4c1edd8a4
--- /dev/null
+++ b/tests/aiger/neg.ys
@@ -0,0 +1,36 @@
+read_verilog <<EOT
+module top(input [31:-32] a, input [-65:-128] b, output [128:65] c);
+assign c = a & b;
+endmodule
+EOT
+select -assert-count 1 i:a
+select -assert-count 1 i:b
+select -assert-count 1 o:c
+select -assert-count 3 x:* s:64 %i
+design -save read
+
+!rm -rf neg.out
+!mkdir neg.out
+simplemap
+write_aiger -map neg.out/neg.map neg.out/neg.aig
+
+design -reset
+read_aiger -wideports -map neg.out/neg.map neg.out/neg.aig
+select -assert-count 1 i:a
+select -assert-count 1 i:b
+select -assert-count 1 o:c
+select -assert-count 3 x:* s:64 %i
+
+
+design -load read
+!rm -rf neg.out
+!mkdir neg.out
+simplemap
+write_xaiger -map neg.out/neg.map neg.out/neg.aig
+
+design -reset
+read_aiger -wideports -map neg.out/neg.map neg.out/neg.aig
+select -assert-count 1 i:a
+select -assert-count 1 i:b
+select -assert-count 1 o:c
+select -assert-count 3 x:* s:64 %i
diff --git a/tests/aiger/run-test.sh b/tests/aiger/run-test.sh
index 8e932b091..de7bc68cf 100755
--- a/tests/aiger/run-test.sh
+++ b/tests/aiger/run-test.sh
@@ -52,3 +52,8 @@ miter -equiv -flatten -make_assert -make_outputs gold gate miter
sat -verify -prove-asserts -show-ports -seq 16 miter
" -l ${aig}.log
done
+
+for y in *.ys; do
+ echo "Running $y."
+ ../../yosys $y -ql ${y%.*}.log
+done