| puts stdout "Sourcing design .magicrc for technology sky130 ..." |
| |
| # Put grid on 0.005 pitch. This is important, as some commands don't |
| # rescale the grid automatically (such as lef read?). |
| |
| set scalefac [tech lambda] |
| if {[lindex $scalefac 1] < 2} { |
| scalegrid 1 2 |
| } |
| |
| # drc off |
| drc euclidean on |
| |
| # PDK |
| if { [info exists env(PDK_ROOT)] && $env(PDK_ROOT) ne {} } { |
| ## found variable, set tcl PDK_ROOT var |
| if {![file isdir $env(PDK_ROOT)]} { |
| puts stderr "Warning: PDK_ROOT environment variable is set but path not found on the system." |
| } |
| set PDK_ROOT $env(PDK_ROOT) |
| } else { |
| ## not existing or empty. |
| puts stderr "Warning: PDK_ROOT env. var. not found or empty, trying to find an open_pdks install" |
| } |
| |
| ## get process variant |
| if {[info exists env(PDK)]} { |
| set PDK $env(PDK) |
| } else { |
| set PDK sky130B |
| } |
| set PDKPATH ${PDK_ROOT}/${PDK} |
| |
| # loading technology |
| tech load $PDKPATH/libs.tech/magic/sky130B.tech |
| |
| # load device generator |
| source $PDKPATH/libs.tech/magic/sky130B.tcl |
| |
| # load bind keys (optional) |
| # source $PDKPATH/libs.tech/magic/current/sky130B-BindKeys |
| |
| # set units to lambda grid |
| snap lambda |
| |
| # set sky130 standard power, ground, and substrate names |
| set VDD VPWR |
| set GND VGND |
| set SUB VSUBS |
| |
| # Allow override of type of magic library views used, "mag" or "maglef", |
| # from environment variable MAGTYPE |
| |
| if {[catch {set MAGTYPE $env(MAGTYPE)}]} { |
| set MAGTYPE maglef |
| } |
| |
| # add path to reference cells |
| if {[file isdir ${PDKPATH}/libs.ref/${MAGTYPE}]} { |
| addpath ${PDKPATH}/libs.ref/${MAGTYPE}/sky130_fd_pr |
| addpath ${PDKPATH}/libs.ref/${MAGTYPE}/sky130_fd_io |
| addpath ${PDKPATH}/libs.ref/${MAGTYPE}/sky130_fd_sc_hd |
| addpath ${PDKPATH}/libs.ref/${MAGTYPE}/sky130_fd_sc_hdll |
| addpath ${PDKPATH}/libs.ref/${MAGTYPE}/sky130_fd_sc_hs |
| addpath ${PDKPATH}/libs.ref/${MAGTYPE}/sky130_fd_sc_hvl |
| addpath ${PDKPATH}/libs.ref/${MAGTYPE}/sky130_fd_sc_lp |
| addpath ${PDKPATH}/libs.ref/${MAGTYPE}/sky130_fd_sc_ls |
| addpath ${PDKPATH}/libs.ref/${MAGTYPE}/sky130_fd_sc_ms |
| addpath ${PDKPATH}/libs.ref/${MAGTYPE}/sky130_osu_sc |
| } else { |
| addpath ${PDKPATH}/libs.ref/sky130_fd_pr/${MAGTYPE} |
| addpath ${PDKPATH}/libs.ref/sky130_fd_io/${MAGTYPE} |
| addpath ${PDKPATH}/libs.ref/sky130_fd_sc_hd/${MAGTYPE} |
| addpath ${PDKPATH}/libs.ref/sky130_fd_sc_hdll/${MAGTYPE} |
| addpath ${PDKPATH}/libs.ref/sky130_fd_sc_hs/${MAGTYPE} |
| addpath ${PDKPATH}/libs.ref/sky130_fd_sc_hvl/${MAGTYPE} |
| addpath ${PDKPATH}/libs.ref/sky130_fd_sc_lp/${MAGTYPE} |
| addpath ${PDKPATH}/libs.ref/sky130_fd_sc_ls/${MAGTYPE} |
| addpath ${PDKPATH}/libs.ref/sky130_fd_sc_ms/${MAGTYPE} |
| addpath ${PDKPATH}/libs.ref/sky130_osu_sc/${MAGTYPE} |
| } |
| |
| # add path to GDS cells |
| |
| # add path to IP from catalog. This procedure defined in the PDK script. |
| catch {magic::query_mylib_ip} |
| # add path to local IP from user design space. Defined in the PDK script. |
| catch {magic::query_my_projects} |
| |
| snap user |
| ext2spice scale off |
| ext2spice hierarchy on |
| ext2spice short resistor |
| |
| add fulgor/fulgor_opamp |