Skip to content

Commit

Permalink
Add tests for most checkers (#2044)
Browse files Browse the repository at this point in the history
* add unit test for tr checker

* add unit test for xor check

* add unit test for illegal overlaps checker

* add unit test for illegal overlap checker using a def file as input

* add unit tests for unmapped cells

* add unit test to assign statements checker
  • Loading branch information
kareefardi authored Nov 14, 2023
1 parent 000c992 commit 64d4346
Show file tree
Hide file tree
Showing 26 changed files with 6,299 additions and 0 deletions.
1 change: 1 addition & 0 deletions tests/2041-assign-statements-checker/config.tcl
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
set ::env(DESIGN_NAME) inverter
4 changes: 4 additions & 0 deletions tests/2041-assign-statements-checker/interactive.tcl
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
package require openlane;

prep -design $::env(TEST_DIR) {*}$argv
check_assign_statements $::env(TEST_DIR)/inverter.v
14 changes: 14 additions & 0 deletions tests/2041-assign-statements-checker/inverter.v
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
/* Generated by Yosys 0.34 (git sha1 4a1b5599258, gcc 8.3.1 -fPIC -Os) */

module inverter(in, out);
input in;
wire in;
output out;
wire out;
wire tmp;
assign tmp = out;
sky130_fd_sc_hd__inv_2 _0_ (
.A(in),
.Y(out)
);
endmodule
21 changes: 21 additions & 0 deletions tests/2041-assign-statements-checker/issue_regression.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import os
import subprocess
import sys

args = sys.argv[1:]
exit_code = args[1]
run_folder = args[0]

assert exit_code != 0, "OpenLane did not throw non zero exit code"
log_path = os.path.join(run_folder, "openlane.log")
assert (
subprocess.call(
[
"grep",
"-i",
"There are assign statements in the netlist",
log_path,
]
)
== 0
), "OpenLane did not report the existence of assign statments correctly"
4 changes: 4 additions & 0 deletions tests/2041-illegal-overlaps-checker-def/config.tcl
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
set ::env(DESIGN_NAME) inverter
set ::env(MAGIC_EXT_USE_GDS) 0
set ::env(QUIT_ON_ILLEGAL_OVERLAPS) 1

6 changes: 6 additions & 0 deletions tests/2041-illegal-overlaps-checker-def/interactive.tcl
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
package require openlane;

prep -design $::env(TEST_DIR) {*}$argv

set ::env(CURRENT_DEF) $::env(TEST_DIR)/inverter.def
run_magic_spice_export
288 changes: 288 additions & 0 deletions tests/2041-illegal-overlaps-checker-def/inverter.def

Large diffs are not rendered by default.

21 changes: 21 additions & 0 deletions tests/2041-illegal-overlaps-checker-def/issue_regression.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import os
import subprocess
import sys

args = sys.argv[1:]
exit_code = args[1]
run_folder = args[0]

assert exit_code != 0, "OpenLane did not throw non zero exit code"
log_path = os.path.join(run_folder, "openlane.log")
assert (
subprocess.call(
[
"grep",
"-i",
"There are illegal overlaps",
log_path,
]
)
== 0
), "OpenLane did not report the existence of illegal overlaps correctly"
4 changes: 4 additions & 0 deletions tests/2041-illegal-overlaps-checker-gds/config.tcl
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
set ::env(DESIGN_NAME) inverter
set ::env(MAGIC_EXT_USE_GDS) 1
set ::env(QUIT_ON_ILLEGAL_OVERLAPS) 1

6 changes: 6 additions & 0 deletions tests/2041-illegal-overlaps-checker-gds/interactive.tcl
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
package require openlane;

prep -design $::env(TEST_DIR) {*}$argv

set ::env(CURRENT_GDS) $::env(TEST_DIR)/inverter.gds
run_magic_spice_export
Binary file not shown.
21 changes: 21 additions & 0 deletions tests/2041-illegal-overlaps-checker-gds/issue_regression.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import os
import subprocess
import sys

args = sys.argv[1:]
exit_code = args[1]
run_folder = args[0]

assert exit_code != 0, "OpenLane did not throw non zero exit code"
log_path = os.path.join(run_folder, "openlane.log")
assert (
subprocess.call(
[
"grep",
"-i",
"There are illegal overlaps",
log_path,
]
)
== 0
), "OpenLane did not report the existence of illegal overlaps correctly"
2 changes: 2 additions & 0 deletions tests/2041-tr-checker/config.tcl
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
set ::env(DESIGN_NAME) spm
set ::env(DRT_OPT_ITERS) 1
2,032 changes: 2,032 additions & 0 deletions tests/2041-tr-checker/in.def

Large diffs are not rendered by default.

Loading

0 comments on commit 64d4346

Please sign in to comment.