aboutsummaryrefslogtreecommitdiffstats
path: root/tests/simple_abc9
diff options
context:
space:
mode:
Diffstat (limited to 'tests/simple_abc9')
-rw-r--r--tests/simple_abc9/.gitignore1
-rw-r--r--tests/simple_abc9/abc9.box3
-rw-r--r--tests/simple_abc9/abc9.v24
-rwxr-xr-xtests/simple_abc9/run-test.sh30
4 files changed, 46 insertions, 12 deletions
diff --git a/tests/simple_abc9/.gitignore b/tests/simple_abc9/.gitignore
index 2355aea29..fda60e577 100644
--- a/tests/simple_abc9/.gitignore
+++ b/tests/simple_abc9/.gitignore
@@ -2,3 +2,4 @@
*.sv
*.log
*.out
+*.bak
diff --git a/tests/simple_abc9/abc9.box b/tests/simple_abc9/abc9.box
deleted file mode 100644
index b3c88437c..000000000
--- a/tests/simple_abc9/abc9.box
+++ /dev/null
@@ -1,3 +0,0 @@
-MUXF8 1 0 3 1
-#I0 I1 S
-0 0 0 # O
diff --git a/tests/simple_abc9/abc9.v b/tests/simple_abc9/abc9.v
index 5e969c614..fba089b1f 100644
--- a/tests/simple_abc9/abc9.v
+++ b/tests/simple_abc9/abc9.v
@@ -213,7 +213,7 @@ module arbiter (clk, rst, request, acknowledge, grant, grant_valid, grant_encode
input rst;
endmodule
-(* abc9_box_id=1, blackbox *)
+(* abc9_box, blackbox *)
module MUXF8(input I0, I1, S, output O);
specify
(I0 => O) = 0;
@@ -300,15 +300,29 @@ endmodule
module abc9_test036(input A, B, S, output [1:0] O);
(* keep *)
MUXF8 m (
- .I0(I0),
- .I1(I1),
+ .I0(A),
+ .I1(B),
.O(O[0]),
.S(S)
);
MUXF8 m2 (
- .I0(I0),
- .I1(I1),
+ .I0(A),
+ .I1(B),
.O(O[1]),
.S(S)
);
endmodule
+
+(* abc9_box, whitebox *)
+module MUXF7(input I0, I1, S, output O);
+assign O = S ? I1 : I0;
+specify
+ (I0 => O) = 0;
+ (I1 => O) = 0;
+ (S => O) = 0;
+endspecify
+endmodule
+
+module abc9_test037(output o);
+MUXF7 m(.I0(1'b1), .I1(1'b0), .S(o), .O(o));
+endmodule
diff --git a/tests/simple_abc9/run-test.sh b/tests/simple_abc9/run-test.sh
index 650e42fca..4a5bf01a3 100755
--- a/tests/simple_abc9/run-test.sh
+++ b/tests/simple_abc9/run-test.sh
@@ -17,16 +17,38 @@ if ! command -v iverilog > /dev/null ; then
exit 1
fi
+for file in `ls *.v *.sv`; do
+ if [ ! -f "../simple/$file" -a "$file" != "abc9.v" ]; then
+ echo "Warning: $file is in simple_abc9/, but not in simple/"
+ backup="$file.bak"
+ if [ -f "$backup" ]; then
+ if cmp "$file" "$backup" > /dev/null; then
+ echo " => $backup already exists and matches; removing $file"
+ rm "$file"
+ else
+ echo " => $backup already exists but differs; leaving $file in place"
+ fi
+ else
+ echo " => moving $file to $backup"
+ mv -i "$file" "$backup"
+ fi
+ fi
+done
+
cp ../simple/*.v .
cp ../simple/*.sv .
+rm specify.v # bug 2675
DOLLAR='?'
-exec ${MAKE:-make} -f ../tools/autotest.mk $seed *.v *.sv EXTRA_FLAGS="-n 300 -p '\
+exec ${MAKE:-make} -f ../tools/autotest.mk $seed *.v *.sv EXTRA_FLAGS="-f \"verilog -noblackbox -specify\" -n 300 -p '\
+ read_verilog -icells -lib +/abc9_model.v; \
hierarchy; \
synth -run coarse; \
opt -full; \
techmap; \
- abc9 -lut 4 -box ../abc9.box; \
+ abc9 -lut 4; \
clean; \
- check -assert; \
+ check -assert * abc9_test037 %d; \
select -assert-none t:${DOLLAR}_NOT_ t:${DOLLAR}_AND_ %%; \
- setattr -mod -unset blackbox'"
+ setattr -mod -unset blackbox -unset whitebox'"
+
+# NOTE: Skip 'check -assert' on abc9_test037 because it intentionally has a combinatorial loop