blob: 94668c37763ddbdd76b8a5f40c4420bc9545a3b9 [file] [log] [blame]
agorararmard146f0132020-12-10 18:46:20 +02001# SPDX-FileCopyrightText: 2020 Efabless Corporation
2#
3# Licensed under the Apache License, Version 2.0 (the "License");
4# you may not use this file except in compliance with the License.
5# You may obtain a copy of the License at
6#
7# http://www.apache.org/licenses/LICENSE-2.0
8#
9# Unless required by applicable law or agreed to in writing, software
10# distributed under the License is distributed on an "AS IS" BASIS,
11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12# See the License for the specific language governing permissions and
13# limitations under the License.
14#
15# SPDX-License-Identifier: Apache-2.0
16
mkk91ada922020-12-02 09:08:26 -080017#---------------------------------------------------------------------
18# 1) must set the variable PDK_ROOT
19#---------------------------------------------------------------------
20
21puts stdout "Sourcing design .magicrc for technology sky130A ..."
22
23#---------------------------------------------------------------------
24
25# Put grid on 0.005 pitch. This is important, as some commands don't
26# rescale the grid automatically (such as lef read?).
27
28set scalefac [tech lambda]
29if {[lindex $scalefac 1] < 2} {
30 scalegrid 1 2
31}
32#---------------------------------------------------------------------
33#
34# Allow override of DRC on/off from environment variable DRC
35#
36#---------------------------------------------------------------------
37if {[catch {set DRC $env(DRC)}]} {
38 # default value
39 drc off
40} else {
41 drc style drc(full)
42 drc euclidean on
43 sdrc $DRC
44}
45#
46#---------------------------------------------------------------------
47# Allow override of PDK path from environment variable PDKPATH
48#
49if {[catch {set PDKPATH $env(PDKPATH)}]} {
50 set PDKPATH "$::env(PDK_ROOT)/sky130A"
51}
52#---------------------------------------------------------------------
53# loading technology
54tech load $PDKPATH/libs.tech/magic/current/sky130A.tech
55
56#---------------------------------------------------------------------
57# load device generator
58source $PDKPATH/libs.tech/magic/current/sky130A.tcl
59
60#---------------------------------------------------------------------
61# load bind keys (optional)
62# source $PDKPATH/libs.tech/magic/current/sky130A-BindKeys
63
64#---------------------------------------------------------------------
65# set units to lambda grid
66snap lambda
67
68#---------------------------------------------------------------------
69
70# set sky130 standard power, ground, and substrate names
71set VDD VPWR
72set GND VGND
73set SUB VSUBS
74
75#---------------------------------------------------------------------
76
77# Allow override of type of magic library views used, "mag" or "maglef",
78# from environment variable MAGTYPE. Deafault value is MAGTYPE=maglef
79
80if {[catch {set MAGTYPE $env(MAGTYPE)}]} {
81 set MAGTYPE maglef
82}
83
84path search [concat "../$MAGTYPE" [path search]]
85
86#---------------------------------------------------------------------
87
88# add path to reference cells
89if {[file isdir ${PDKPATH}/libs.ref/${MAGTYPE}]} {
90 addpath ${PDKPATH}/libs.ref/${MAGTYPE}/sky130_fd_pr
91 addpath ${PDKPATH}/libs.ref/${MAGTYPE}/sky130_fd_io
92 addpath ${PDKPATH}/libs.ref/${MAGTYPE}/sky130_fd_sc_hd
93 addpath ${PDKPATH}/libs.ref/${MAGTYPE}/sky130_fd_sc_hdll
94 addpath ${PDKPATH}/libs.ref/${MAGTYPE}/sky130_fd_sc_hs
95 addpath ${PDKPATH}/libs.ref/${MAGTYPE}/sky130_fd_sc_hvl
96 addpath ${PDKPATH}/libs.ref/${MAGTYPE}/sky130_fd_sc_lp
97 addpath ${PDKPATH}/libs.ref/${MAGTYPE}/sky130_fd_sc_ls
98 addpath ${PDKPATH}/libs.ref/${MAGTYPE}/sky130_fd_sc_ms
99 addpath ${PDKPATH}/libs.ref/${MAGTYPE}/sky130_osu_sc
100} else {
101 addpath ${PDKPATH}/libs.ref/sky130_fd_pr/${MAGTYPE}
102 addpath ${PDKPATH}/libs.ref/sky130_fd_io/${MAGTYPE}
103 addpath ${PDKPATH}/libs.ref/sky130_fd_sc_hd/${MAGTYPE}
104 addpath ${PDKPATH}/libs.ref/sky130_fd_sc_hdll/${MAGTYPE}
105 addpath ${PDKPATH}/libs.ref/sky130_fd_sc_hs/${MAGTYPE}
106 addpath ${PDKPATH}/libs.ref/sky130_fd_sc_hvl/${MAGTYPE}
107 addpath ${PDKPATH}/libs.ref/sky130_fd_sc_lp/${MAGTYPE}
108 addpath ${PDKPATH}/libs.ref/sky130_fd_sc_ls/${MAGTYPE}
109 addpath ${PDKPATH}/libs.ref/sky130_fd_sc_ms/${MAGTYPE}
110 addpath ${PDKPATH}/libs.ref/sky130_osu_sc/${MAGTYPE}
111}
112
113# add path to GDS cells
114
115 addpath ../gds
116
117# add path to IP from catalog. This procedure defined in the PDK script.
118catch {magic::query_mylib_ip}
119# add path to local IP from user design space. Defined in the PDK script.
120catch {magic::query_my_projects}