blob: 8efd70bbaf2d7d4b40cfaded21cb6724a40dbe38 [file] [log] [blame]
Tim Edwards55f4d0e2020-07-05 15:41:02 -04001###
2### Source file sky130.magicrc
3### Process this file with the m4 processor
4###
5puts stdout "Sourcing design .magicrc for technology TECHNAME ..."
6
7# Put grid on 0.005 pitch. This is important, as some commands don't
8# rescale the grid automatically (such as lef read?).
9
10set scalefac [tech lambda]
11if {[lindex $scalefac 1] < 2} {
12 scalegrid 1 2
13}
14
15# drc off
16drc euclidean on
Tim Edwardsec438172021-01-22 11:19:24 -050017# Change this to a fixed number for repeatable behavior with GDS writes
18# e.g., "random seed 12345"
19catch {random seed}
Tim Edwards55f4d0e2020-07-05 15:41:02 -040020
21# Allow override of PDK path from environment variable PDKPATH
Tim Edwards022c39a2020-07-27 17:02:05 -040022if {[catch {set PDKPATH $env(PDKPATH)}]} {
Tim Edwards55f4d0e2020-07-05 15:41:02 -040023 set PDKPATH "STAGING_PATH/TECHNAME"
24}
25
26# loading technology
27#ifdef FULLTECH
28tech load $PDKPATH/MAGIC_CURRENT/TECHNAME-F.tech
29#else
30tech load $PDKPATH/MAGIC_CURRENT/TECHNAME.tech
31#endif
32
33# load device generator
34source $PDKPATH/MAGIC_CURRENT/TECHNAME.tcl
35
36# load bind keys (optional)
37# source $PDKPATH/MAGIC_CURRENT/TECHNAME-BindKeys
38
39# set units to lambda grid
40snap lambda
41
42# set sky130 standard power, ground, and substrate names
43set VDD VPWR
44set GND VGND
45set SUB VSUBS
46
47# Allow override of type of magic library views used, "mag" or "maglef",
48# from environment variable MAGTYPE
49
Tim Edwards022c39a2020-07-27 17:02:05 -040050if {[catch {set MAGTYPE $env(MAGTYPE)}]} {
Tim Edwards94513d42020-11-15 22:07:34 -050051 set MAGTYPE mag
Tim Edwards55f4d0e2020-07-05 15:41:02 -040052}
53
54# add path to reference cells
55if {[file isdir ${PDKPATH}/libs.ref/${MAGTYPE}]} {
Tim Edwardsd7289eb2020-09-10 21:48:31 -040056 addpath ${PDKPATH}/libs.ref/${MAGTYPE}/sky130_fd_pr
Tim Edwards55f4d0e2020-07-05 15:41:02 -040057 addpath ${PDKPATH}/libs.ref/${MAGTYPE}/sky130_fd_io
58 addpath ${PDKPATH}/libs.ref/${MAGTYPE}/sky130_fd_sc_hd
59 addpath ${PDKPATH}/libs.ref/${MAGTYPE}/sky130_fd_sc_hdll
60 addpath ${PDKPATH}/libs.ref/${MAGTYPE}/sky130_fd_sc_hs
61 addpath ${PDKPATH}/libs.ref/${MAGTYPE}/sky130_fd_sc_hvl
62 addpath ${PDKPATH}/libs.ref/${MAGTYPE}/sky130_fd_sc_lp
63 addpath ${PDKPATH}/libs.ref/${MAGTYPE}/sky130_fd_sc_ls
64 addpath ${PDKPATH}/libs.ref/${MAGTYPE}/sky130_fd_sc_ms
Tim Edwardsd7289eb2020-09-10 21:48:31 -040065 addpath ${PDKPATH}/libs.ref/${MAGTYPE}/sky130_osu_sc
Tristan Gingolda5854312020-10-15 18:28:16 +020066 addpath ${PDKPATH}/libs.ref/${MAGTYPE}/sky130_osu_sc_t18
Tim Edwardsbcf59aa2020-12-17 16:55:13 -050067 addpath ${PDKPATH}/libs.ref/${MAGTYPE}/sky130_ml_xx_hd
Tim Edwardscfe970c2021-02-26 14:35:51 -050068 addpath ${PDKPATH}/libs.ref/${MAGTYPE}/sky130_sram_macros
Tim Edwards55f4d0e2020-07-05 15:41:02 -040069} else {
Tim Edwardsd7289eb2020-09-10 21:48:31 -040070 addpath ${PDKPATH}/libs.ref/sky130_fd_pr/${MAGTYPE}
Tim Edwards55f4d0e2020-07-05 15:41:02 -040071 addpath ${PDKPATH}/libs.ref/sky130_fd_io/${MAGTYPE}
72 addpath ${PDKPATH}/libs.ref/sky130_fd_sc_hd/${MAGTYPE}
73 addpath ${PDKPATH}/libs.ref/sky130_fd_sc_hdll/${MAGTYPE}
74 addpath ${PDKPATH}/libs.ref/sky130_fd_sc_hs/${MAGTYPE}
75 addpath ${PDKPATH}/libs.ref/sky130_fd_sc_hvl/${MAGTYPE}
76 addpath ${PDKPATH}/libs.ref/sky130_fd_sc_lp/${MAGTYPE}
77 addpath ${PDKPATH}/libs.ref/sky130_fd_sc_ls/${MAGTYPE}
78 addpath ${PDKPATH}/libs.ref/sky130_fd_sc_ms/${MAGTYPE}
Tim Edwardsd7289eb2020-09-10 21:48:31 -040079 addpath ${PDKPATH}/libs.ref/sky130_osu_sc/${MAGTYPE}
Tristan Gingolda5854312020-10-15 18:28:16 +020080 addpath ${PDKPATH}/libs.ref/sky130_osu_sc_t18/${MAGTYPE}
Tim Edwardsbcf59aa2020-12-17 16:55:13 -050081 addpath ${PDKPATH}/libs.ref/sky130_ml_xx_hd/${MAGTYPE}
Tim Edwardscfe970c2021-02-26 14:35:51 -050082 addpath ${PDKPATH}/libs.ref/sky130_sram_macros/${MAGTYPE}
Tim Edwards55f4d0e2020-07-05 15:41:02 -040083}
84
85# add path to GDS cells
86#ifdef FULLTECH
Ahmed Ghazy32982b72020-07-27 14:46:07 +020087if {[file isdir ${PDKPATH}/libs.ref/gds]} {
Tim Edwardsd7289eb2020-09-10 21:48:31 -040088 path cell ${PDKPATH}/libs.ref/gds/sky130_fd_pr
Tim Edwards55f4d0e2020-07-05 15:41:02 -040089 path cell +${PDKPATH}/libs.ref/gds/sky130_fd_io
90 path cell +${PDKPATH}/libs.ref/gds/sky130_fd_sc_hd
91 path cell +${PDKPATH}/libs.ref/gds/sky130_fd_sc_hdll
92 path cell +${PDKPATH}/libs.ref/gds/sky130_fd_sc_hs
93 path cell +${PDKPATH}/libs.ref/gds/sky130_fd_sc_hvl
94 path cell +${PDKPATH}/libs.ref/gds/sky130_fd_sc_lp
95 path cell +${PDKPATH}/libs.ref/gds/sky130_fd_sc_ls
96 path cell +${PDKPATH}/libs.ref/gds/sky130_fd_sc_ms
97 path cell +${PDKPATH}/libs.ref/gds/sky130_osu130
Tristan Gingolda5854312020-10-15 18:28:16 +020098 path cell +${PDKPATH}/libs.ref/gds/sky130_osu130_t18
Tim Edwardsbcf59aa2020-12-17 16:55:13 -050099 path cell +${PDKPATH}/libs.ref/gds/sky130_ml_xx_hd
Tim Edwardscfe970c2021-02-26 14:35:51 -0500100 path cell +${PDKPATH}/libs.ref/gds/sky130_sram_macros
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400101} else {
Tim Edwardsd7289eb2020-09-10 21:48:31 -0400102 path cell ${PDKPATH}/libs.ref/sky130_fd_pr/gds
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400103 path cell +${PDKPATH}/libs.ref/sky130_fd_io/gds
104 path cell +${PDKPATH}/libs.ref/sky130_fd_sc_hd/gds
105 path cell +${PDKPATH}/libs.ref/sky130_fd_sc_hdll/gds
106 path cell +${PDKPATH}/libs.ref/sky130_fd_sc_hs/gds
107 path cell +${PDKPATH}/libs.ref/sky130_fd_sc_hvl/gds
108 path cell +${PDKPATH}/libs.ref/sky130_fd_sc_lp/gds
109 path cell +${PDKPATH}/libs.ref/sky130_fd_sc_ls/gds
110 path cell +${PDKPATH}/libs.ref/sky130_fd_sc_ms/gds
111 path cell +${PDKPATH}/libs.ref/sky130_osu130/gds
Tristan Gingolda5854312020-10-15 18:28:16 +0200112 path cell +${PDKPATH}/libs.ref/sky130_osu130_t18/gds
Tim Edwardsbcf59aa2020-12-17 16:55:13 -0500113 path cell +${PDKPATH}/libs.ref/sky130_ml_xx_hd/gds
Tim Edwardscfe970c2021-02-26 14:35:51 -0500114 path cell +${PDKPATH}/libs.ref/sky130_sram_macros/gds
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400115}
116#endif (FULLTECH)
117
118# add path to IP from catalog. This procedure defined in the PDK script.
119catch {magic::query_mylib_ip}
120# add path to local IP from user design space. Defined in the PDK script.
121catch {magic::query_my_projects}