Updated version to go along with pull request #385 from Qurrat. Modified the GDS and liberty library builders to accept gzipped files. Made additional corrections to the device generator file to correct NPN and PNP device names.
diff --git a/VERSION b/VERSION index da93f74..4750635 100644 --- a/VERSION +++ b/VERSION
@@ -1 +1 @@ -1.0.424 +1.0.425
diff --git a/common/create_gds_library.py b/common/create_gds_library.py index 9931fd8..6c5235a 100755 --- a/common/create_gds_library.py +++ b/common/create_gds_library.py
@@ -7,11 +7,16 @@ # of cells, create a single GDL library file named <alllibname> and place # it in the same directory. This is done for the option "compile" if specified # for the "-gds" install. +# +# Because GDS files are large, this script supports reading gzipped GDS files. +# The file (de-)compression is handled in Magic; it is only necessary in this +# script to accept ".gds.gz" as a valid filename extension for GDS files. #---------------------------------------------------------------------------- import os import sys import glob +import gzip import fnmatch import subprocess import natural_sort @@ -57,6 +62,8 @@ glist = glob.glob(destlibdir + '/*.gds') glist.extend(glob.glob(destlibdir + '/*.gdsii')) glist.extend(glob.glob(destlibdir + '/*.gds2')) + glist.extend(glob.glob(destlibdir + '/*.gds.gz')) + glist = natural_sort.natural_sort(glist) if alllibname in glist:
diff --git a/common/create_lib_library.py b/common/create_lib_library.py index 46bfc47..beba757 100755 --- a/common/create_lib_library.py +++ b/common/create_lib_library.py
@@ -7,10 +7,14 @@ # of cells, create a single liberty library file named <alllibname> and place # it in the same directory. This is done for the option "compile" if specified # for the "-lib" install. +# +# Because liberty files tend to be both huge and ASCII, this script supports +# handling sets of gzipped .lib files (expecting name ".lib.gz"). #---------------------------------------------------------------------------- import sys import os +import gzip import glob import fnmatch import natural_sort @@ -46,6 +50,7 @@ headerfile=None): headerdone = False + compressed = False # destlib should not have a file extension destlibroot = os.path.splitext(destlib)[0] @@ -80,7 +85,11 @@ for rfile in rlist: llist.append(destlibdir + '/' + rfile) else: - llist = glob.glob(destlibdir + '/*.lib') + llist = glob.glob(destlibdir + '/*.lib.gz') + if len(llist) == 0: + llist = glob.glob(destlibdir + '/*.lib') + else: + compressed = True llist = natural_sort.natural_sort(llist) # Create exclude list with glob-style matching using fnmatch @@ -111,21 +120,26 @@ if not os.path.exists(lfile): print('Error: File ' + lfile + ' not found (skipping).') continue - with open(lfile, 'r') as ifile: - # print('Adding ' + lfile + ' to library.') - ltext = ifile.read() - llines = ltext.splitlines() - headerseen = False - for lline in llines: - if headerdone: - if not headerseen: - ltok = lline.split('(') - if len(ltok) == 0 or not ltok[0].strip() == 'cell': - continue - else: - headerseen = True - print(lline, file=ofile) - headerdone = True + if compressed: + with gzip.open(lfile, 'rb') as ifile: + # print('Adding ' + lfile + ' to library.') + ltext = ifile.read() + else: + with open(lfile, 'r') as ifile: + # print('Adding ' + lfile + ' to library.') + ltext = ifile.read() + llines = ltext.splitlines() + headerseen = False + for lline in llines: + if headerdone: + if not headerseen: + ltok = lline.split('(') + if len(ltok) == 0 or not ltok[0].strip() == 'cell': + continue + else: + headerseen = True + print(lline, file=ofile) + headerdone = True print('/*--------EOF---------*/\n', file=ofile) if headerfile:
diff --git a/gf180mcu/magic/gf180mcu.tcl b/gf180mcu/magic/gf180mcu.tcl index 81de06d..aa68e78 100644 --- a/gf180mcu/magic/gf180mcu.tcl +++ b/gf180mcu/magic/gf180mcu.tcl
@@ -103,14 +103,14 @@ magic::add_toolkit_command $layoutframe "diode_pd2nw_03v3 - p-diode" "magic::gencell gf180mcu::diode_pd2nw_03v3" pdk1 magic::add_toolkit_separator $layoutframe pdk1 - magic::add_toolkit_command $layoutframe "npn_05p00x05p00 (3.3V) - 5.0um^2 " "magic::gencell gf180mcu::vnpn_2x2" pdk1 - magic::add_toolkit_command $layoutframe "vnpn_5x0p42 (3.3V) - 5.0um x 0.42um " "magic::gencell gf180mcu::vnpn_5x0p42" pdk1 - magic::add_toolkit_command $layoutframe "npn_10p00x10p00 (3.3V) - 10.0um^2 " "magic::gencell gf180mcu::npn_05p00x05p00" pdk1 - magic::add_toolkit_command $layoutframe "vnpn_10x0p42 (3.3V) - 10.0um x 0.42um " "magic::gencell gf180mcu::vnpn_10x0p42" pdk1 - magic::add_toolkit_command $layoutframe "pnp_05p00x05p00 (3.3V) - 5.0um^2 " "magic::gencell gf180mcu::pnp_05p00x05p00" pdk1 - magic::add_toolkit_command $layoutframe "vpnp_5x0p42 (3.3V) - 5.0um^2 x 0.42um " "magic::gencell gf180mcu::vpnp_5x0p42" pdk1 - magic::add_toolkit_command $layoutframe "pnp_10p00x10p00 (3.3V) - 10.0um^2 " "magic::gencell gf180mcu::pnp_10p00x10p00" pdk1 - magic::add_toolkit_command $layoutframe "vpnp_10x0p42 (3.3V) - 10.0um^2 x 0.42um " "magic::gencell gf180mcu::vpnp_10x0p42" pdk1 + magic::add_toolkit_command $layoutframe "npn_10p00x10p00 (3.3V) - 10.0um x 10.0um " "magic::gencell gf180mcu::npn_05p00x05p00" pdk1 + magic::add_toolkit_command $layoutframe "npn_05p00x05p00 (3.3V) - 5.0um x 5.0um " "magic::gencell gf180mcu::npn_05p00x05p00" pdk1 + magic::add_toolkit_command $layoutframe "npn_10p00x10p00 (3.3V) - 0.54um x 4.0um " "magic::gencell gf180mcu::npn_00p54x04p00" pdk1 + magic::add_toolkit_command $layoutframe "npn_00p54x02p00 (3.3V) - 0.54um x 2.0um " "magic::gencell gf180mcu::npn_00p54x02p00" pdk1 + magic::add_toolkit_command $layoutframe "pnp_10p00x10p00 (3.3V) - 10.0um x 10.0um " "magic::gencell gf180mcu::pnp_10p00x10p00" pdk1 + magic::add_toolkit_command $layoutframe "pnp_05p00x05p00 (3.3V) - 5.0um x 5.0um " "magic::gencell gf180mcu::pnp_05p00x05p00" pdk1 + magic::add_toolkit_command $layoutframe "pnp_10p00x00p42 (3.3V) - 10.0um x 0.42um " "magic::gencell gf180mcu::pnp_10p00x00p42" pdk1 + magic::add_toolkit_command $layoutframe "pnp_05p00x00p42 (3.3V) - 5.0um x 0.42um " "magic::gencell gf180mcu::pnp_05p00x00p42" pdk1 magic::add_toolkit_separator $layoutframe pdk1 magic::add_toolkit_command $layoutframe "mos capacitor" "magic::gencell gf180mcu::nmoscap_3p3" pdk1 @@ -4272,7 +4272,7 @@ return {nx 1 ny 1 deltax 0 deltay 0 nocell 1 xstep 13.94 ystep 13.94} } -proc gf180mcu::vnpn_5x0p42_defaults {} { +proc gf180mcu::npn_00p54x02p00_defaults {} { return {nx 1 ny 1 deltax 0 deltay 0 nocell 1 xstep 12.36 ystep 16.22} } @@ -4280,7 +4280,7 @@ return {nx 1 ny 1 deltax 0 deltay 0 nocell 1 xstep 16.94 ystep 16.94} } -proc gf180mcu::vnpn_10x0p42_defaults {} { +proc gf180mcu::npn_00p54x04p00_defaults {} { return {nx 1 ny 1 deltax 0 deltay 0 nocell 1 xstep 12.36 ystep 21.22} } @@ -4288,7 +4288,7 @@ return {nx 1 ny 1 deltax 0 deltay 0 nocell 1 xstep 13.94 ystep 13.94} } -proc gf180mcu::vpnp_5x0p42_defaults {} { +proc gf180mcu::pnp_05p00x00p42_defaults {} { return {nx 1 ny 1 deltax 0 deltay 0 nocell 1 xstep 12.36 ystep 16.22} } @@ -4296,7 +4296,7 @@ return {nx 1 ny 1 deltax 0 deltay 0 nocell 1 xstep 16.94 ystep 16.94} } -proc gf180mcu::vpnp_10x0p42_defaults {} { +proc gf180mcu::pnp_10p00x00p42_defaults {} { return {nx 1 ny 1 deltax 0 deltay 0 nocell 1 xstep 12.36 ystep 21.22} } @@ -4322,7 +4322,7 @@ return [gf180mcu::fixed_convert $parameters] } -proc gf180mcu::vnpn_5x0p42_convert {parameters} { +proc gf180mcu::npn_00p54x02p00_convert {parameters} { return [gf180mcu::fixed_convert $parameters] } @@ -4330,7 +4330,7 @@ return [gf180mcu::fixed_convert $parameters] } -proc gf180mcu::vnpn_10x0p42_convert {parameters} { +proc gf180mcu::npn_00p54x04p00_convert {parameters} { return [gf180mcu::fixed_convert $parameters] } @@ -4338,7 +4338,7 @@ return [gf180mcu::fixed_convert $parameters] } -proc gf180mcu::vpnp_5x0p42_convert {parameters} { +proc gf180mcu::pnp_05p00x00p42_convert {parameters} { return [gf180mcu::fixed_convert $parameters] } @@ -4346,7 +4346,7 @@ return [gf180mcu::fixed_convert $parameters] } -proc gf180mcu::vpnp_10x0p42_convert {parameters} { +proc gf180mcu::pnp_10p00x00p42_convert {parameters} { return [gf180mcu::fixed_convert $parameters] } @@ -4399,7 +4399,7 @@ gf180mcu::fixed_dialog $parameters } -proc gf180mcu::vnpn_5x0p42_dialog {parameters} { +proc gf180mcu::npn_00p54x02p00_dialog {parameters} { gf180mcu::fixed_dialog $parameters } @@ -4407,7 +4407,7 @@ gf180mcu::fixed_dialog $parameters } -proc gf180mcu::vnpn_10x0p42_dialog {parameters} { +proc gf180mcu::npn_00p54x04p00_dialog {parameters} { gf180mcu::fixed_dialog $parameters } @@ -4415,7 +4415,7 @@ gf180mcu::fixed_dialog $parameters } -proc gf180mcu::vpnp_5x0p42_dialog {parameters} { +proc gf180mcu::pnp_05p00x00p42_dialog {parameters} { gf180mcu::fixed_dialog $parameters } @@ -4423,7 +4423,7 @@ gf180mcu::fixed_dialog $parameters } -proc gf180mcu::vpnp_10x0p42_dialog {parameters} { +proc gf180mcu::pnp_10p00x00p42_dialog {parameters} { gf180mcu::fixed_dialog $parameters } @@ -4466,35 +4466,35 @@ #---------------------------------------------------------------- proc gf180mcu::npn_05p00x05p00_draw {parameters} { - return [gf180mcu::fixed_draw npn_05p00x05p00 $parameters] + return [gf180mcu::fixed_draw npn_05p00x05p00_0 $parameters] } -proc gf180mcu::vnpn_5x0p42_draw {parameters} { - return [gf180mcu::fixed_draw vnpn_5x0p42 $parameters] +proc gf180mcu::npn_00p54x02p00_draw {parameters} { + return [gf180mcu::fixed_draw npn_00p54x02p00_0 $parameters] } proc gf180mcu::npn_10p00x10p00_draw {parameters} { - return [gf180mcu::fixed_draw npn_10p00x10p00 $parameters] + return [gf180mcu::fixed_draw npn_10p00x10p00_0 $parameters] } -proc gf180mcu::vnpn_10x0p42_draw {parameters} { - return [gf180mcu::fixed_draw vnpn_10X0p42 $parameters] +proc gf180mcu::npn_00p54x04p00_draw {parameters} { + return [gf180mcu::fixed_draw npn_00p54x04p00_0 $parameters] } proc gf180mcu::pnp_05p00x05p00_draw {parameters} { - return [gf180mcu::fixed_draw pnp_05p00x05p00 $parameters] + return [gf180mcu::fixed_draw pnp_05p00x05p00_0 $parameters] } -proc gf180mcu::vpnp_5x0p42_draw {parameters} { - return [gf180mcu::fixed_draw vpnp_5x0p42 $parameters] +proc gf180mcu::pnp_05p00x00p42_draw {parameters} { + return [gf180mcu::fixed_draw pnp_05p00x00p42_0 $parameters] } proc gf180mcu::pnp_10p00x10p00_draw {parameters} { - return [gf180mcu::fixed_draw pnp_10p00x10p00 $parameters] + return [gf180mcu::fixed_draw pnp_10p00x10p00_0 $parameters] } -proc gf180mcu::vpnp_10x0p42_draw {parameters} { - return [gf180mcu::fixed_draw vpnp_10X0p42 $parameters] +proc gf180mcu::pnp_10p00x00p42_draw {parameters} { + return [gf180mcu::fixed_draw pnp_10p00x00p42_0 $parameters] } #---------------------------------------------------------------- @@ -4551,7 +4551,7 @@ return [gf180mcu::fixed_check $parameters] } -proc gf180mcu::vnpn_5x0p42_check {parameters} { +proc gf180mcu::npn_00p54x02p00_check {parameters} { return [gf180mcu::fixed_check $parameters] } @@ -4559,7 +4559,7 @@ return [gf180mcu::fixed_check $parameters] } -proc gf180mcu::vnpn_10x0p42_check {parameters} { +proc gf180mcu::npn_00p54x04p00_check {parameters} { return [gf180mcu::fixed_check $parameters] } @@ -4567,7 +4567,7 @@ return [gf180mcu::fixed_check $parameters] } -proc gf180mcu::vpnp_5x0p42_check {parameters} { +proc gf180mcu::pnp_05p00x00p42_check {parameters} { return [gf180mcu::fixed_check $parameters] } @@ -4575,7 +4575,7 @@ return [gf180mcu::fixed_check $parameters] } -proc gf180mcu::vpnp_10x0p42_check {parameters} { +proc gf180mcu::pnp_10p00x00p42_check {parameters} { return [gf180mcu::fixed_check $parameters] }