agorararmard | 146f013 | 2020-12-10 18:46:20 +0200 | [diff] [blame] | 1 | # 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 | |
mkk | 91ada92 | 2020-12-02 09:08:26 -0800 | [diff] [blame] | 17 | #--------------------------------------------------------------------- |
| 18 | # 1) must set the variable PDK_ROOT |
| 19 | #--------------------------------------------------------------------- |
| 20 | |
| 21 | puts 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 | |
| 28 | set scalefac [tech lambda] |
| 29 | if {[lindex $scalefac 1] < 2} { |
| 30 | scalegrid 1 2 |
| 31 | } |
| 32 | #--------------------------------------------------------------------- |
| 33 | # |
| 34 | # Allow override of DRC on/off from environment variable DRC |
| 35 | # |
| 36 | #--------------------------------------------------------------------- |
| 37 | if {[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 | # |
| 49 | if {[catch {set PDKPATH $env(PDKPATH)}]} { |
| 50 | set PDKPATH "$::env(PDK_ROOT)/sky130A" |
| 51 | } |
| 52 | #--------------------------------------------------------------------- |
| 53 | # loading technology |
| 54 | tech load $PDKPATH/libs.tech/magic/current/sky130A.tech |
| 55 | |
| 56 | #--------------------------------------------------------------------- |
| 57 | # load device generator |
| 58 | source $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 |
| 66 | snap lambda |
| 67 | |
| 68 | #--------------------------------------------------------------------- |
| 69 | |
| 70 | # set sky130 standard power, ground, and substrate names |
| 71 | set VDD VPWR |
| 72 | set GND VGND |
| 73 | set 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 | |
| 80 | if {[catch {set MAGTYPE $env(MAGTYPE)}]} { |
| 81 | set MAGTYPE maglef |
| 82 | } |
| 83 | |
| 84 | path search [concat "../$MAGTYPE" [path search]] |
| 85 | |
| 86 | #--------------------------------------------------------------------- |
| 87 | |
| 88 | # add path to reference cells |
| 89 | if {[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. |
| 118 | catch {magic::query_mylib_ip} |
| 119 | # add path to local IP from user design space. Defined in the PDK script. |
| 120 | catch {magic::query_my_projects} |