#54 mag views have conflicting port numbers Issue ...
# open_pdks
g
#54 mag views have conflicting port numbers Issue opened by d-m-bailey After the maglef generation step, the
open_pdks/common/foundry_install.py
file has
Copy code
# Now list all the .mag files generated, and for each, read the
        # corresponding file from the mag/ directory, pull the GDS file
        # properties, and add those properties to the maglef view. Also
        # read the CDL (or SPICE) netlist, read the ports, and rewrite
        # the port order in the mag and maglef file accordingly.
It looks like the port order is being rewritten here. From clkbuf_16 mag file before annotation.
Copy code
flabel pwell 29 -17 63 17 0 FreeSans 200 0 0 0 VNB
port 3 nsew ground input
flabel pwell s 46 0 46 0 0 FreeSans 200 0 0 0 VNB
port 3 nsew default input
flabel nbase 29 527 63 561 0 FreeSans 200 0 0 0 VPB
port 4 nsew power input
flabel nbase s 46 544 46 544 0 FreeSans 200 0 0 0 VPB
port 4 nsew default input
flabel metal1 29 -17 63 17 0 FreeSans 200 0 0 0 VGND
port 2 nsew ground input abutment
flabel metal1 29 527 63 561 0 FreeSans 200 0 0 0 VPWR
port 5 nsew power input abutment
Notice how some
flabel
lines have 13 fields while others (the ones with 's' as the third field) have 14. After annotation:
Copy code
flabel pwell 29 -17 63 17 0 FreeSans 200 0 0 0 VNB
port 3 nsew ground input
flabel pwell s 46 0 46 0 0 FreeSans 200 0 0 0 VNB
port 3 nsew default input
flabel nbase 29 527 63 561 0 FreeSans 200 0 0 0 VPB
port 3 nsew power input
flabel nbase s 46 544 46 544 0 FreeSans 200 0 0 0 VPB
port 4 nsew default input
flabel metal1 29 -17 63 17 0 FreeSans 200 0 0 0 VGND
port 4 nsew ground input abutment
flabel metal1 29 527 63 561 0 FreeSans 200 0 0 0 VPWR
port 4 nsew power input abutment
Looks the port number after the longer lines (the ones with the 's') are propagated to the following shorted lines regardless of the signal name. From
open_pdks/common/foundry_install.py
flabrex = re.compile('flabel[ \t]+[^ \t]+[ \t]+[^ \t]+[ \t]+[^ \t]+[ \t]+[^ \t]+[ \t]+[^ \t]+[ \t]+[^ \t]+[ \t]+[^ \t]+[ \t]+[^ \t]+[ \t]+[^ \t]+[ \t]+[^ \t]+[ \t]+[^ \t]+[ \t]+[^ \t]+[ \t]+([^ \t]+)')
flabrex
only matches the longer lines. So for the unmatched shorter
flabel
lines, the last port number for a long line is used. If there hasn't been a long line encountered, the port number stays the same. The following works for long and short lines.
flabrex = re.compile('flabel[ \t]+.*[ \t]+([^ \t]+)[ \t]*')
RTimothyEdwards/open_pdks