agorararmard | 3f79735 | 2020-12-10 18:24:42 +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 | |
agorararmard | 7eebfe4 | 2020-12-07 22:08:29 +0200 | [diff] [blame] | 17 | # cannot commit files larger than 100 MB to GitHub |
Ahmed Ghazy | 31c3465 | 2020-12-01 19:59:44 +0200 | [diff] [blame] | 18 | FILE_SIZE_LIMIT_MB = 100 |
Ahmed Ghazy | b1e5170 | 2020-12-31 22:43:41 +0200 | [diff] [blame] | 19 | |
| 20 | # Commands to be used to compress/uncompress files |
| 21 | # they must operate **in place** (otherwise, modify the target to delete the |
| 22 | # intermediate file/archive) |
| 23 | COMPRESS ?= gzip -n --best |
| 24 | UNCOMPRESS ?= gzip -d |
| 25 | ARCHIVE_EXT ?= gz |
| 26 | |
| 27 | # The following variables are to build static pattern rules |
| 28 | |
| 29 | # Needed to rebuild archives that were previously split |
| 30 | SPLIT_FILES := $(shell find . -type f -name "*.$(ARCHIVE_EXT).00.split") |
| 31 | SPLIT_FILES_SOURCES := $(basename $(basename $(basename $(SPLIT_FILES)))) |
| 32 | |
| 33 | # Needed to uncompress the existing archives |
| 34 | ARCHIVES := $(shell find . -type f -name "*.$(ARCHIVE_EXT)") |
| 35 | ARCHIVE_SOURCES := $(basename $(ARCHIVES)) |
| 36 | |
| 37 | # Needed to compress and split files/archives that are too large |
Ahmed Ghazy | 31c3465 | 2020-12-01 19:59:44 +0200 | [diff] [blame] | 38 | LARGE_FILES := $(shell find ./gds -type f -name "*.gds") |
Ahmed Ghazy | 0011f61 | 2020-12-02 22:53:33 +0200 | [diff] [blame] | 39 | LARGE_FILES += $(shell find . -type f -size +$(FILE_SIZE_LIMIT_MB)M -not -path "./.git/*" -not -path "./gds/*" -not -path "./openlane/*") |
Ahmed Ghazy | b1e5170 | 2020-12-31 22:43:41 +0200 | [diff] [blame] | 40 | LARGE_FILES_GZ := $(addsuffix .$(ARCHIVE_EXT), $(LARGE_FILES)) |
| 41 | LARGE_FILES_GZ_SPLIT := $(addsuffix .$(ARCHIVE_EXT).00.split, $(LARGE_FILES)) |
| 42 | # consider splitting existing archives |
| 43 | LARGE_FILES_GZ_SPLIT += $(addsuffix .00.split, $(ARCHIVES)) |
Ahmed Ghazy | 5898e4a | 2020-11-13 22:28:55 +0200 | [diff] [blame] | 44 | |
agorararmard | 212cd82 | 2020-11-26 22:40:17 +0200 | [diff] [blame] | 45 | # PDK setup configs |
| 46 | THREADS ?= $(shell nproc) |
| 47 | STD_CELL_LIBRARY ?= sky130_fd_sc_hd |
| 48 | SPECIAL_VOLTAGE_LIBRARY ?= sky130_fd_sc_hvl |
| 49 | IO_LIBRARY ?= sky130_fd_io |
agorararmard | fed74ec | 2020-12-01 18:03:46 +0200 | [diff] [blame] | 50 | SKYWATER_COMMIT ?= 3d7617a1acb92ea883539bcf22a632d6361a5de4 |
agorararmard | e1ad4aa | 2021-01-05 20:28:45 +0200 | [diff] [blame] | 51 | OPEN_PDKS_COMMIT ?= 49fc7125db927de199d1f69e002beadc0a29881b |
Ahmed Ghazy | efdc529 | 2020-11-19 16:05:48 +0200 | [diff] [blame] | 52 | |
| 53 | .DEFAULT_GOAL := ship |
Ahmed Ghazy | efdc529 | 2020-11-19 16:05:48 +0200 | [diff] [blame] | 54 | # We need portable GDS_FILE pointers... |
| 55 | .PHONY: ship |
agorararmard | 212cd82 | 2020-11-26 22:40:17 +0200 | [diff] [blame] | 56 | ship: check-env uncompress |
Ahmed Ghazy | efdc529 | 2020-11-19 16:05:48 +0200 | [diff] [blame] | 57 | @echo "###############################################" |
| 58 | @echo "Generating Caravel GDS (sources are in the 'gds' directory)" |
| 59 | @sleep 1 |
agorararmard | f8e91c3 | 2020-11-30 23:59:58 +0200 | [diff] [blame] | 60 | @cp gds/caravel.gds gds/caravel.old.gds && echo "Copying old Caravel to gds/caravel.old.gds" || true |
Ahmed Ghazy | 0252f54 | 2020-11-25 14:45:38 +0200 | [diff] [blame] | 61 | @cd gds && MAGTYPE=mag magic -rcfile ${PDK_ROOT}/sky130A/libs.tech/magic/current/sky130A.magicrc -noc -dnull gen_caravel.tcl < /dev/null |
Ahmed Ghazy | efdc529 | 2020-11-19 16:05:48 +0200 | [diff] [blame] | 62 | |
| 63 | |
Ahmed Ghazy | e4c7ec5 | 2020-11-20 13:10:15 +0200 | [diff] [blame] | 64 | |
Ahmed Ghazy | 5898e4a | 2020-11-13 22:28:55 +0200 | [diff] [blame] | 65 | .PHONY: clean |
| 66 | clean: |
agorararmard | 331d259 | 2020-12-31 17:56:06 +0200 | [diff] [blame] | 67 | cd ./verilog/dv/caravel/mgmt_soc/ && \ |
| 68 | $(MAKE) -j$(THREADS) clean |
| 69 | cd ./verilog/dv/caravel/user_proj_example/ && \ |
| 70 | $(MAKE) -j$(THREADS) clean |
Ahmed Ghazy | 5898e4a | 2020-11-13 22:28:55 +0200 | [diff] [blame] | 71 | |
| 72 | |
| 73 | .PHONY: verify |
| 74 | verify: |
agorararmard | 331d259 | 2020-12-31 17:56:06 +0200 | [diff] [blame] | 75 | cd ./verilog/dv/caravel/mgmt_soc/ && \ |
| 76 | $(MAKE) -j$(THREADS) all |
| 77 | cd ./verilog/dv/caravel/user_proj_example/ && \ |
| 78 | $(MAKE) -j$(THREADS) all |
Ahmed Ghazy | 5898e4a | 2020-11-13 22:28:55 +0200 | [diff] [blame] | 79 | |
| 80 | |
| 81 | |
Ahmed Ghazy | b1e5170 | 2020-12-31 22:43:41 +0200 | [diff] [blame] | 82 | ##### |
| 83 | $(LARGE_FILES_GZ): %.$(ARCHIVE_EXT): % |
| 84 | @if ! [ $(suffix $<) == ".$(ARCHIVE_EXT)" ]; then\ |
| 85 | $(COMPRESS) $< > /dev/null &&\ |
Ahmed Ghazy | 5898e4a | 2020-11-13 22:28:55 +0200 | [diff] [blame] | 86 | echo "$< -> $@";\ |
| 87 | fi |
| 88 | |
Ahmed Ghazy | b1e5170 | 2020-12-31 22:43:41 +0200 | [diff] [blame] | 89 | $(LARGE_FILES_GZ_SPLIT): %.$(ARCHIVE_EXT).00.split: %.$(ARCHIVE_EXT) |
| 90 | @if [ -n "$$(find "$<" -prune -size +$(FILE_SIZE_LIMIT_MB)M)" ]; then\ |
| 91 | split $< -b $(FILE_SIZE_LIMIT_MB)M $<. -d --additional-suffix=.split &&\ |
| 92 | rm $< &&\ |
| 93 | echo -n "$< -> $$(ls $<.*.split)" | tr '\n' ' ' && echo "";\ |
| 94 | fi |
| 95 | |
Ahmed Ghazy | e4c7ec5 | 2020-11-20 13:10:15 +0200 | [diff] [blame] | 96 | # This target compresses all files larger than $(FILE_SIZE_LIMIT_MB) MB |
Ahmed Ghazy | 5898e4a | 2020-11-13 22:28:55 +0200 | [diff] [blame] | 97 | .PHONY: compress |
Ahmed Ghazy | b1e5170 | 2020-12-31 22:43:41 +0200 | [diff] [blame] | 98 | compress: $(LARGE_FILES_GZ) $(LARGE_FILES_GZ_SPLIT) |
Ahmed Ghazy | 5898e4a | 2020-11-13 22:28:55 +0200 | [diff] [blame] | 99 | @echo "Files larger than $(FILE_SIZE_LIMIT_MB) MBytes are compressed!" |
| 100 | |
| 101 | |
| 102 | |
Ahmed Ghazy | b1e5170 | 2020-12-31 22:43:41 +0200 | [diff] [blame] | 103 | ##### |
| 104 | $(ARCHIVE_SOURCES): %: %.$(ARCHIVE_EXT) |
| 105 | @$(UNCOMPRESS) $< |
| 106 | @echo "$< -> $@" |
| 107 | |
| 108 | .SECONDEXPANSION: |
| 109 | $(SPLIT_FILES_SOURCES): %: $$(sort $$(wildcard %.$(ARCHIVE_EXT).*.split)) |
| 110 | @cat $? > $@.$(ARCHIVE_EXT) |
| 111 | @rm $? |
| 112 | @echo "$? -> $@.$(ARCHIVE_EXT)" |
| 113 | @$(UNCOMPRESS) $@.$(ARCHIVE_EXT) |
| 114 | @echo "$@.$(ARCHIVE_EXT) -> $@" |
| 115 | |
Ahmed Ghazy | 5898e4a | 2020-11-13 22:28:55 +0200 | [diff] [blame] | 116 | |
| 117 | .PHONY: uncompress |
Ahmed Ghazy | b1e5170 | 2020-12-31 22:43:41 +0200 | [diff] [blame] | 118 | uncompress: $(SPLIT_FILES_SOURCES) $(ARCHIVE_SOURCES) |
Ahmed Ghazy | 5898e4a | 2020-11-13 22:28:55 +0200 | [diff] [blame] | 119 | @echo "All files are uncompressed!" |
agorararmard | 212cd82 | 2020-11-26 22:40:17 +0200 | [diff] [blame] | 120 | |
Ahmed Ghazy | fdda2cb | 2020-12-04 02:00:38 +0200 | [diff] [blame] | 121 | |
| 122 | # LVS |
Ahmed Ghazy | fdda2cb | 2020-12-04 02:00:38 +0200 | [diff] [blame] | 123 | BLOCKS = $(shell cd openlane && find * -maxdepth 0 -type d) |
| 124 | LVS_BLOCKS = $(foreach block, $(BLOCKS), lvs-$(block)) |
Ahmed Ghazy | 7f70d6f | 2020-12-05 23:05:31 +0200 | [diff] [blame] | 125 | $(LVS_BLOCKS): lvs-% : ./mag/%.mag ./verilog/gl/%.v |
Ahmed Ghazy | fdda2cb | 2020-12-04 02:00:38 +0200 | [diff] [blame] | 126 | echo "Extracting $*" |
| 127 | mkdir -p ./mag/tmp |
| 128 | echo "load $* -dereference;\ |
Ahmed Ghazy | d3ca6fe | 2020-12-16 20:48:17 +0200 | [diff] [blame] | 129 | select top cell;\ |
| 130 | foreach cell [cellname list children] {\ |
| 131 | load \$$cell -dereference;\ |
| 132 | property LEFview TRUE;\ |
| 133 | };\ |
| 134 | load $* -dereference;\ |
| 135 | select top cell;\ |
Ahmed Ghazy | fdda2cb | 2020-12-04 02:00:38 +0200 | [diff] [blame] | 136 | extract no all;\ |
| 137 | extract do local;\ |
Ahmed Ghazy | d3ca6fe | 2020-12-16 20:48:17 +0200 | [diff] [blame] | 138 | extract unique;\ |
Ahmed Ghazy | fdda2cb | 2020-12-04 02:00:38 +0200 | [diff] [blame] | 139 | extract;\ |
| 140 | ext2spice lvs;\ |
Ahmed Ghazy | d3ca6fe | 2020-12-16 20:48:17 +0200 | [diff] [blame] | 141 | ext2spice $*.ext;\ |
Ahmed Ghazy | fdda2cb | 2020-12-04 02:00:38 +0200 | [diff] [blame] | 142 | feedback save extract_$*.log;\ |
| 143 | exit;" > ./mag/extract_$*.tcl |
Ahmed Ghazy | d3ca6fe | 2020-12-16 20:48:17 +0200 | [diff] [blame] | 144 | cd mag && export MAGTYPE=maglef; magic -rcfile ${PDK_ROOT}/sky130A/libs.tech/magic/current/sky130A.magicrc -noc -dnull extract_$*.tcl < /dev/null |
Ahmed Ghazy | fdda2cb | 2020-12-04 02:00:38 +0200 | [diff] [blame] | 145 | mv ./mag/$*.spice ./spi/lvs |
Ahmed Ghazy | d3ca6fe | 2020-12-16 20:48:17 +0200 | [diff] [blame] | 146 | rm ./mag/*.ext |
| 147 | mv -f ./mag/extract_$*.{tcl,log} ./mag/tmp |
Ahmed Ghazy | fdda2cb | 2020-12-04 02:00:38 +0200 | [diff] [blame] | 148 | #### |
| 149 | mkdir -p ./spi/lvs/tmp |
Ahmed Ghazy | d3ca6fe | 2020-12-16 20:48:17 +0200 | [diff] [blame] | 150 | sh ./spi/lvs/run_lvs.sh ./spi/lvs/$*.spice ./verilog/gl/$*.v $* |
| 151 | @echo "" |
agorararmard | 308c7e0 | 2020-12-30 17:12:48 +0200 | [diff] [blame] | 152 | python3 ./scripts/count_lvs.py -f ./verilog/gl/$*.v_comp.json | tee ./spi/lvs/tmp/$*.lvs.summary.log |
Ahmed Ghazy | d3ca6fe | 2020-12-16 20:48:17 +0200 | [diff] [blame] | 153 | mv -f ./verilog/gl/*{.out,.json,.log} ./spi/lvs/tmp 2> /dev/null || true |
Ahmed Ghazy | 66091cc | 2020-12-17 22:13:06 +0200 | [diff] [blame] | 154 | @echo "" |
| 155 | @echo "LVS: ./spi/lvs/$*.spice vs. ./verilog/gl/$*.v" |
Ahmed Ghazy | d3ca6fe | 2020-12-16 20:48:17 +0200 | [diff] [blame] | 156 | @echo "Comparison result: ./spi/lvs/tmp/$*.v_comp.out" |
agorararmard | c520b2d | 2020-12-16 23:49:37 +0200 | [diff] [blame] | 157 | |
Ahmed Ghazy | 96d0fed | 2020-12-24 21:50:21 +0200 | [diff] [blame] | 158 | # connect-by-label is enabled here! |
| 159 | LVS_MAGLEF_BLOCKS = $(foreach block, $(BLOCKS), lvs-maglef-$(block)) |
| 160 | $(LVS_MAGLEF_BLOCKS): lvs-maglef-% : ./mag/%.mag ./verilog/gl/%.v |
| 161 | echo "Extracting $*" |
| 162 | mkdir -p ./maglef/tmp |
| 163 | echo "load $* -dereference;\ |
| 164 | select top cell;\ |
| 165 | foreach cell [cellname list children] {\ |
| 166 | load \$$cell -dereference;\ |
| 167 | property LEFview TRUE;\ |
| 168 | };\ |
| 169 | load $* -dereference;\ |
| 170 | select top cell;\ |
| 171 | extract no all;\ |
| 172 | extract do local;\ |
| 173 | extract;\ |
| 174 | ext2spice lvs;\ |
| 175 | ext2spice $*.ext;\ |
| 176 | feedback save extract_$*.log;\ |
| 177 | exit;" > ./mag/extract_$*.tcl |
| 178 | cd mag && export MAGTYPE=maglef; magic -noc -dnull extract_$*.tcl < /dev/null |
| 179 | mv ./mag/$*.spice ./spi/lvs |
| 180 | rm ./maglef/*.ext |
| 181 | mv -f ./mag/extract_$*.{tcl,log} ./maglef/tmp |
| 182 | #### |
| 183 | mkdir -p ./spi/lvs/tmp |
| 184 | sh ./spi/lvs/run_lvs.sh ./spi/lvs/$*.spice ./verilog/gl/$*.v $* |
| 185 | @echo "" |
agorararmard | 308c7e0 | 2020-12-30 17:12:48 +0200 | [diff] [blame] | 186 | python3 ./scripts/count_lvs.py -f ./verilog/gl/$*.v_comp.json | tee ./spi/lvs/tmp/$*.maglef.lvs.summary.log |
Ahmed Ghazy | 96d0fed | 2020-12-24 21:50:21 +0200 | [diff] [blame] | 187 | mv -f ./verilog/gl/*{.out,.json,.log} ./spi/lvs/tmp 2> /dev/null || true |
| 188 | @echo "" |
| 189 | @echo "LVS: ./spi/lvs/$*.spice vs. ./verilog/gl/$*.v" |
| 190 | @echo "Comparison result: ./spi/lvs/tmp/$*.v_comp.out" |
| 191 | |
agorararmard | c520b2d | 2020-12-16 23:49:37 +0200 | [diff] [blame] | 192 | # DRC |
| 193 | BLOCKS = $(shell cd openlane && find * -maxdepth 0 -type d) |
| 194 | DRC_BLOCKS = $(foreach block, $(BLOCKS), drc-$(block)) |
| 195 | $(DRC_BLOCKS): drc-% : ./gds/%.gds |
| 196 | echo "Running DRC on $*" |
| 197 | mkdir -p ./gds/tmp |
| 198 | cd gds && export DESIGN_IN_DRC=$* && export MAGTYPE=mag; magic -rcfile ${PDK_ROOT}/sky130A/libs.tech/magic/current/sky130A.magicrc -noc -dnull drc_on_gds.tcl < /dev/null |
| 199 | @echo "DRC result: ./gds/tmp/$*.drc" |
| 200 | |
agorararmard | e67e1c8 | 2020-12-28 18:31:48 +0200 | [diff] [blame] | 201 | # Antenna |
| 202 | BLOCKS = $(shell cd openlane && find * -maxdepth 0 -type d) |
| 203 | ANTENNA_BLOCKS = $(foreach block, $(BLOCKS), antenna-$(block)) |
| 204 | $(ANTENNA_BLOCKS): antenna-% : ./gds/%.gds |
| 205 | echo "Running Antenna Checks on $*" |
| 206 | mkdir -p ./gds/tmp |
| 207 | cd gds && export DESIGN_IN_ANTENNA=$* && export MAGTYPE=mag; magic -rcfile ${PDK_ROOT}/sky130A/libs.tech/magic/current/sky130A.magicrc -noc -dnull antenna_on_gds.tcl < /dev/null 2>&1 | tee ./tmp/$*.antenna |
agorararmard | 5deb5ed | 2020-12-29 18:00:17 +0200 | [diff] [blame] | 208 | mv -f ./gds/*.ext ./gds/tmp/ |
agorararmard | e67e1c8 | 2020-12-28 18:31:48 +0200 | [diff] [blame] | 209 | @echo "Antenna result: ./gds/tmp/$*.antenna" |
| 210 | |
Ahmed Ghazy | 876d607 | 2020-12-28 15:55:31 +0200 | [diff] [blame] | 211 | mag2gds: check-env |
| 212 | echo "\ |
| 213 | gds readonly true; \ |
| 214 | gds rescale false; \ |
| 215 | load caravel -dereference;\ |
| 216 | select top cell;\ |
| 217 | gds write caravel.gds; \ |
| 218 | exit;" > ./mag/mag2gds_caravel.tcl |
| 219 | @cd mag && PDKPATH=${PDK_ROOT}/sky130A magic -noc -dnull mag2gds_caravel.tcl < /dev/null |
| 220 | @rm ./mag/mag2gds_caravel.tcl |
| 221 | mv -f ./gds/caravel.gds ./gds/caravel.old.gds |
| 222 | mv ./mag/caravel.gds ./gds |
Ahmed Ghazy | fdda2cb | 2020-12-04 02:00:38 +0200 | [diff] [blame] | 223 | |
| 224 | .PHONY: help |
| 225 | help: |
| 226 | @$(MAKE) -pRrq -f $(lastword $(MAKEFILE_LIST)) : 2>/dev/null | awk -v RS= -F: '/^# File/,/^# Finished Make data base/ {if ($$1 !~ "^[#.]") {print $$1}}' | sort | egrep -v -e '^[^[:alnum:]]' -e '^$@$$' |
| 227 | |
Ahmed Ghazy | b1e5170 | 2020-12-31 22:43:41 +0200 | [diff] [blame] | 228 | |
Ahmed Ghazy | fdda2cb | 2020-12-04 02:00:38 +0200 | [diff] [blame] | 229 | ########################################################################### |
agorararmard | 212cd82 | 2020-11-26 22:40:17 +0200 | [diff] [blame] | 230 | .PHONY: pdk |
agorararmard | a32bd95 | 2020-12-31 21:38:43 +0200 | [diff] [blame] | 231 | pdk: skywater-pdk skywater-library skywater-timing open_pdks build-pdk |
agorararmard | 212cd82 | 2020-11-26 22:40:17 +0200 | [diff] [blame] | 232 | |
| 233 | $(PDK_ROOT)/skywater-pdk: |
| 234 | git clone https://github.com/google/skywater-pdk.git $(PDK_ROOT)/skywater-pdk |
| 235 | |
| 236 | .PHONY: skywater-pdk |
| 237 | skywater-pdk: check-env $(PDK_ROOT)/skywater-pdk |
| 238 | cd $(PDK_ROOT)/skywater-pdk && \ |
agorararmard | 63e5672 | 2020-12-09 19:57:30 +0200 | [diff] [blame] | 239 | git checkout master && git pull && \ |
agorararmard | 212cd82 | 2020-11-26 22:40:17 +0200 | [diff] [blame] | 240 | git checkout -qf $(SKYWATER_COMMIT) |
| 241 | |
| 242 | .PHONY: skywater-library |
| 243 | skywater-library: check-env $(PDK_ROOT)/skywater-pdk |
| 244 | cd $(PDK_ROOT)/skywater-pdk && \ |
| 245 | git submodule update --init libraries/$(STD_CELL_LIBRARY)/latest && \ |
| 246 | git submodule update --init libraries/$(IO_LIBRARY)/latest && \ |
agorararmard | a32bd95 | 2020-12-31 21:38:43 +0200 | [diff] [blame] | 247 | git submodule update --init libraries/$(SPECIAL_VOLTAGE_LIBRARY)/latest |
agorararmard | 212cd82 | 2020-11-26 22:40:17 +0200 | [diff] [blame] | 248 | |
agorararmard | a32bd95 | 2020-12-31 21:38:43 +0200 | [diff] [blame] | 249 | skywater-timing: check-env $(PDK_ROOT)/skywater-pdk |
| 250 | cd $(PDK_ROOT)/skywater-pdk && \ |
| 251 | $(MAKE) -j$(THREADS) timing |
agorararmard | 212cd82 | 2020-11-26 22:40:17 +0200 | [diff] [blame] | 252 | ### OPEN_PDKS |
| 253 | $(PDK_ROOT)/open_pdks: |
agorararmard | e1ad4aa | 2021-01-05 20:28:45 +0200 | [diff] [blame] | 254 | git clone git://opencircuitdesign.com/open_pdks $(PDK_ROOT)/open_pdks |
agorararmard | 212cd82 | 2020-11-26 22:40:17 +0200 | [diff] [blame] | 255 | |
| 256 | .PHONY: open_pdks |
| 257 | open_pdks: check-env $(PDK_ROOT)/open_pdks |
| 258 | cd $(PDK_ROOT)/open_pdks && \ |
agorararmard | 63e5672 | 2020-12-09 19:57:30 +0200 | [diff] [blame] | 259 | git checkout master && git pull && \ |
agorararmard | 212cd82 | 2020-11-26 22:40:17 +0200 | [diff] [blame] | 260 | git checkout -qf $(OPEN_PDKS_COMMIT) |
| 261 | |
| 262 | .PHONY: build-pdk |
| 263 | build-pdk: check-env $(PDK_ROOT)/open_pdks $(PDK_ROOT)/skywater-pdk |
| 264 | [ -d $(PDK_ROOT)/sky130A ] && \ |
| 265 | (echo "Warning: A sky130A build already exists under $(PDK_ROOT). It will be deleted first!" && \ |
| 266 | sleep 5 && \ |
| 267 | rm -rf $(PDK_ROOT)/sky130A) || \ |
| 268 | true |
| 269 | cd $(PDK_ROOT)/open_pdks && \ |
agorararmard | 8ced9ad | 2020-12-30 18:53:21 +0200 | [diff] [blame] | 270 | ./configure --enable-sky130-pdk=$(PDK_ROOT)/skywater-pdk/libraries --with-sky130-local-path=$(PDK_ROOT) && \ |
agorararmard | 212cd82 | 2020-11-26 22:40:17 +0200 | [diff] [blame] | 271 | cd sky130 && \ |
| 272 | $(MAKE) veryclean && \ |
| 273 | $(MAKE) && \ |
| 274 | $(MAKE) install-local |
| 275 | |
agorararmard | 7eebfe4 | 2020-12-07 22:08:29 +0200 | [diff] [blame] | 276 | .RECIPE: manifest |
| 277 | manifest: |
| 278 | cd verilog/rtl/ && \ |
agorararmard | bd78183 | 2020-12-08 21:09:44 +0200 | [diff] [blame] | 279 | find * -type f ! -name "user_*.v" ! -name "manifest" ! -name "README" ! -name "defines.v" -exec shasum {} \; > manifest && \ |
| 280 | cd ../../maglef/ && \ |
| 281 | shasum *.mag > manifest && \ |
| 282 | cd ../mag/ && \ |
| 283 | shasum caravel.mag .magicrc > manifest |
| 284 | |
agorararmard | 7eebfe4 | 2020-12-07 22:08:29 +0200 | [diff] [blame] | 285 | |
agorararmard | 212cd82 | 2020-11-26 22:40:17 +0200 | [diff] [blame] | 286 | check-env: |
| 287 | ifndef PDK_ROOT |
| 288 | $(error PDK_ROOT is undefined, please export it before running make) |
Ahmed Ghazy | 31c3465 | 2020-12-01 19:59:44 +0200 | [diff] [blame] | 289 | endif |
agorararmard | cd6f0af | 2020-12-28 22:32:43 +0200 | [diff] [blame] | 290 | |
| 291 | # Make README.rst |
agorararmard | 97fe84f | 2020-12-28 23:32:41 +0200 | [diff] [blame] | 292 | README.rst: README.src.rst docs/source/getting-started.rst docs/source/tool-versioning.rst openlane/README.src.rst docs/source/caravel-with-openlane.rst Makefile |
agorararmard | cd6f0af | 2020-12-28 22:32:43 +0200 | [diff] [blame] | 293 | pip -q install rst_include && \ |
| 294 | rm -f README.rst && \ |
agorararmard | 2dfdac7 | 2020-12-29 16:19:56 +0200 | [diff] [blame] | 295 | rst_include include README.src.rst - | \ |
| 296 | sed \ |
| 297 | -e's@\.\/\_static@\/docs\/source\/\_static@g' \ |
agorararmard | 6c935cb | 2020-12-30 16:32:04 +0200 | [diff] [blame] | 298 | -e's@:doc:`tool-versioning`@`tool-versioning.rst <./docs/source/tool-versioning.rst>`__@g' \ |
agorararmard | 2dfdac7 | 2020-12-29 16:19:56 +0200 | [diff] [blame] | 299 | -e's@.. note::@**NOTE:**@g' \ |
| 300 | -e's@.. warning::@**WARNING:**@g' \ |
| 301 | > README.rst && \ |
agorararmard | 6f660e0 | 2020-12-28 23:07:36 +0200 | [diff] [blame] | 302 | rst_include include openlane/README.src.rst - | \ |
| 303 | sed \ |
| 304 | -e's@https://github.com/efabless/caravel/blob/master/verilog@../verilog@g' \ |
| 305 | -e's@:ref:`getting-started`@`README.rst <../README.rst>`__@g' \ |
| 306 | -e's@https://github.com/efabless/caravel/blob/master/openlane/@./@g' \ |
agorararmard | 2dfdac7 | 2020-12-29 16:19:56 +0200 | [diff] [blame] | 307 | -e's@.. note::@**NOTE:**@g' \ |
| 308 | -e's@.. warning::@**WARNING:**@g' \ |
agorararmard | 5deb5ed | 2020-12-29 18:00:17 +0200 | [diff] [blame] | 309 | > openlane/README.rst |