-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add scripts to remove output drivers
- Loading branch information
Showing
5 changed files
with
41 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
#!/usr/bin/env python3 | ||
import sys, os | ||
import gdspy | ||
|
||
BOUNDARY_LAYER = 235 # prBndry | ||
BOUNDARY_DATATYPE = 4 # boundary | ||
|
||
if __name__ == '__main__': | ||
|
||
# Check args | ||
if len(sys.argv) < 2: | ||
print(f"{sys.argv[0]} <file.gds>") | ||
print("warning: this script modifies the file in-place") | ||
exit(1) | ||
|
||
# Check filepath | ||
filepath: str = sys.argv.pop() | ||
if not os.path.isfile(filepath): | ||
raise FileNotFoundError("unable to locate GDS file specified") | ||
|
||
target_cellname: str = os.path.basename(filepath.split(".")[0]) | ||
|
||
# Load GDS | ||
gdsii = gdspy.GdsLibrary(infile=filepath) | ||
if not target_cellname in gdsii.cells: | ||
raise RuntimeError("cannot locate a cell in the GDS file matching the filename") | ||
|
||
# Delete output driver cells | ||
target_cell: gdspy.Cell = gdsii.cells[target_cellname] | ||
if "sky130_fd_sc_hd__buf_2" in gdsii.cells: | ||
del gdsii.cells["sky130_fd_sc_hd__buf_2"] | ||
print("removing: sky130_fd_sc_hd__buf_2") | ||
if "sky130_fd_sc_hd__conb_1" in gdsii.cells: | ||
del gdsii.cells["sky130_fd_sc_hd__conb_1"] | ||
print("removing: sky130_fd_sc_hd__conb_1") | ||
|
||
gdsii.write_gds(filepath) | ||
print("Success") | ||
|
File renamed without changes.