blob: 535228e0f28253d6e39b994ee04e39085c176ae1 [file] [log] [blame]
dineshannayya14a28a82021-12-22 12:33:40 +05301# 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
17BLOCKS = sar_adc wb_interconnect syntacore qspim uart_i2cm_usb_spi pinmux wb_host
18DEF = $(foreach block,$(BLOCKS), ../def/$(block).def)
19CLEAN = $(foreach block,$(BLOCKS), clean-$(block))
20
21OPENLANE_TAG = mpw3
22OPENLANE_IMAGE_NAME = dineshannayya/openlane:$(OPENLANE_TAG)
23OPENLANE_NETLIST_COMMAND = "cd /project/sta && openroad -exit scripts/or_write_verilog.tcl | tee logs/$@.log"
24OPENLANE_STA_COMMAND = "cd /project/sta && sta scripts/sta.tcl | tee logs/sta.log"
25
26all: $(BLOCKS) run_sta
27
28$(DEF) :
29 @echo "Missing $@. Please create a def for that design"
30 @exit 1
31
32$(BLOCKS) : % : ../def/%.def create
33 docker run -it -v $(PWD)/..:/project -e DESIGN_NAME=$@ -u $(shell id -u $(USER)):$(shell id -g $(USER)) $(OPENLANE_IMAGE_NAME) sh -c $(OPENLANE_NETLIST_COMMAND)
34
35run_sta: $(BLOCKS)
36 #sta inside the docker is crashing with segmentation fault, so are running sta outside the docker
37 #docker run -it -v $(PWD)/..:/project -e DESIGN_NAME=$@ -u $(shell id -u $(USER)):$(shell id -g $(USER)) $(OPENLANE_IMAGE_NAME) sh -c $(OPENLANE_STA_COMMAND)
38 sta scripts/sta.tcl | tee logs/sta.log
39
40create: clean
41 @echo "create temp directory :)"
42 mkdir -p netlist
43 mkdir -p logs
44 mkdir -p reports
45
46clean:
47 @echo "clean everything :)"
48 rm -rf netlist
49 rm -rf logs
50 rm -rf reports
51