blob: 5ca71cc702435bd574bd1d08b8c4062bb00e4045 [file] [log] [blame]
# SPDX-FileCopyrightText: 2020 Efabless Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# SPDX-License-Identifier: Apache-2.0
BLOCKS = glbl_cfg wb_interconnect mbist1 mbist2 wb_host
DEF = $(foreach block,$(BLOCKS), ../def/$(block).def)
CLEAN = $(foreach block,$(BLOCKS), clean-$(block))
OPENLANE_TAG = mpw3
OPENLANE_IMAGE_NAME = dineshannayya/openlane:$(OPENLANE_TAG)
OPENLANE_NETLIST_COMMAND = "cd /project/sta && openroad -exit scripts/or_write_verilog.tcl | tee logs/$@.log"
OPENLANE_STA_COMMAND = "cd /project/sta && sta scripts/sta.tcl | tee logs/sta.log"
all: $(BLOCKS) sta
$(DEF) :
@echo "Missing $@. Please create a def for that design"
@exit 1
$(BLOCKS) : % : ../def/%.def create
mkdir -p reports/$@/func
mkdir -p reports/$@/scan
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)
sta:
#sta inside the docker is crashing with segmentation fault, so are running sta outside the docker
#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)
mkdir -p reports/user_project_wrapper/func
mkdir -p reports/user_project_wrapper/scan
export STA_MODE="func"
sta scripts/sta.tcl | tee logs/sta_func.log
export STA_MODE="scan"
sta scripts/sta.tcl | tee logs/sta_scan.log
create: clean
@echo "create temp directory :)"
mkdir -p netlist
mkdir -p logs
mkdir -p reports
clean:
@echo "clean everything :)"
rm -rf netlist
rm -rf logs
rm -rf reports