-
Notifications
You must be signed in to change notification settings - Fork 85
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Modified sky130.tech magic techfile to add nwell and pwell as
masterslice layers to the LEF input setup; this should resolve issues with the VNB and VPB pins in standard cells. Along with that, committed a script to correct the layers assigned to VNB and VPB in the original sources.
- Loading branch information
1 parent
d9fe000
commit 282d954
Showing
3 changed files
with
67 additions
and
4 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
1.0.8 | ||
1.0.9 |
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,64 @@ | ||
#!/usr/bin/env python3 | ||
# | ||
# Convert VNB and VPB layers in a LEF file from "li1" or "met1" to | ||
# "pwell" and "nwell" masterslice layers, as they should be. | ||
# | ||
|
||
import os | ||
import sys | ||
import re | ||
|
||
if len(sys.argv) < 3: | ||
print("Usage: vpb_vnb_convert.py <lef_file_in> <lef_file_out>") | ||
sys.exit(1) | ||
|
||
lef_file_in = sys.argv[1] | ||
lef_file_out = sys.argv[2] | ||
|
||
print("Input: " + lef_file_in) | ||
print("Output: " + lef_file_out) | ||
|
||
with open(lef_file_in, 'r') as ifile: | ||
leflines = ifile.read().splitlines() | ||
|
||
layrex = re.compile('[ \t]*LAYER[ \t]+([^ \t]+)[ \t]+;') | ||
pinrex = re.compile('[ \t]*PIN[ \t]+([^ \t\n]+)') | ||
endrex = re.compile('[ \t]*END[ \t]+([^ \t\n]+)') | ||
subrex = re.compile('([ \t]*LAYER[ \t]+)([^ \t]+)([ \t]+;)') | ||
|
||
vpbpin = False | ||
vnbpin = False | ||
|
||
linesout = [] | ||
|
||
for line in leflines: | ||
lineout = line | ||
|
||
lmatch = layrex.match(line) | ||
pmatch = pinrex.match(line) | ||
ematch = endrex.match(line) | ||
|
||
if pmatch: | ||
pinname = pmatch.group(1) | ||
|
||
if pinname == 'VNB': | ||
vnbpin = True | ||
elif pinname == 'VPB': | ||
vpbpin = True | ||
|
||
elif ematch: | ||
pinname = '' | ||
vnbpin = False | ||
vpbpin = False | ||
|
||
elif lmatch: | ||
if vpbpin: | ||
lineout = subrex.sub(r'\1nwell\3', line) | ||
elif vnbpin: | ||
lineout = subrex.sub(r'\1pwell\3', line) | ||
|
||
linesout.append(lineout) | ||
|
||
with open(lef_file_out, 'w') as ofile: | ||
for line in linesout: | ||
print(line, file=ofile) |
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