Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add tests for most checkers #2044

Merged
merged 9 commits into from
Nov 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading