Skip to content

Commit

Permalink
bump openlane2 version
Browse files Browse the repository at this point in the history
copy results from run
make openlane targets relative to PROJECT_ROOT
  • Loading branch information
kareefardi committed Aug 18, 2023
1 parent a13d612 commit 8cc3629
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 28 deletions.
20 changes: 10 additions & 10 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ endif
# Include Caravel Makefile Targets
.PHONY: % : check-caravel
%:
export CARAVEL_ROOT=$(CARAVEL_ROOT) && $(MAKE) -f $(CARAVEL_ROOT)/Makefile $@
export CARAVEL_ROOT=$(CARAVEL_ROOT) && export PROJECT_ROOT=$(PROJECT_ROOT) && $(MAKE) -f $(CARAVEL_ROOT)/Makefile $@

.PHONY: install
install:
Expand All @@ -109,7 +109,7 @@ simenv:
setup: check_dependencies install check-env install_mcw openlane pdk-with-volare setup-timing-scripts setup-cocotb

# Openlane
blocks=$(shell cd openlane && find * -maxdepth 0 -type d)
blocks=$(shell cd $(PROJECT_ROOT)/openlane && find * -maxdepth 0 -type d)
.PHONY: $(blocks)
$(blocks): % :
$(MAKE) -C openlane $*
Expand Down Expand Up @@ -186,20 +186,20 @@ what:

# Install Openlane
.PHONY: openlane
openlane: openlane-venv openlane-docker-container
openlane: openlane-venv
# openlane installed

OPENLANE_TAG_DOCKER=$(subst -,,$(OPENLANE_TAG))
.PHONY: openlane-docker-container
openlane-docker-container:
docker pull ghcr.io/efabless/openlane2:$(OPENLANE_TAG_DOCKER)

openlane-venv: openlane-venv/manifest.txt
openlane-venv/manifest.txt:
openlane-venv: $(PROJECT_ROOT)/openlane-venv/manifest.txt
$(PROJECT_ROOT)/openlane-venv/manifest.txt:
rm -rf openlane-venv
python3 -m venv ./openlane-venv
PYTHONPATH= ./openlane-venv/bin/python3 -m pip install openlane==$(OPENLANE_TAG)
PYTHONPATH= ./openlane-venv/bin/python3 -m pip freeze > $@
python3 -m venv $(PROJECT_ROOT)/openlane-venv
PYTHONPATH= $(PROJECT_ROOT)/openlane-venv/bin/python3 -m pip install openlane==$(OPENLANE_TAG)
PYTHONPATH= $(PROJECT_ROOT)/openlane-venv/bin/python3 -m pip freeze > $(PROJECT_ROOT)/openlane-venv/manifest.txt

#### Not sure if the targets following are of any use

Expand Down Expand Up @@ -309,9 +309,9 @@ check_dependencies:
fi


export CUP_ROOT=$(shell pwd)
export CUP_ROOT?=$(shell pwd)
export TIMING_ROOT?=$(shell pwd)/dependencies/timing-scripts
export PROJECT_ROOT=$(CUP_ROOT)
export PROJECT_ROOT?=$(CUP_ROOT)
timing-scripts-repo=https://github.com/efabless/timing-scripts.git

$(TIMING_ROOT):
Expand Down
29 changes: 13 additions & 16 deletions openlane/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export PDK:=$(PDK)
export PDK_ROOT:=$(PDK_ROOT)
OPENLANE_TAG ?= 2023.07.19
OPENLANE_IMAGE_NAME ?= efabless/openlane:$(OPENLANE_TAG)
designs = $(shell find * -maxdepth 0 -type d)
designs = $(shell cd $(PROJECT_ROOT)/openlane && find * -maxdepth 0 -type d)
current_design = null
OPENLANE_USE_NIX ?= 0
ROOTLESS ?= 0
Expand All @@ -34,10 +34,10 @@ openlane_args = \
--run-tag $(OPENLANE_RUN_TAG) \
--manual-pdk \
--pdk-root $(PDK_ROOT) \
$$(realpath ./$*)/config.json
$(PROJECT_ROOT)/openlane/$*/config.json

docker_mounts = \
-m $$(realpath $(PWD)/..) \
-m $(PROJECT_ROOT)\
-m $(PDK_ROOT) \
-m $(CARAVEL_ROOT)

Expand All @@ -53,9 +53,6 @@ export MCW_ROOT:=$(MCW_ROOT)
docker_mounts += -m $(MCW_ROOT)
endif

ifeq ($(OPENLANE_USE_NIX),0)
endif

docker_startup_mode = $(shell test -t 0 && echo "-it" || echo "--rm" )
openlane_extra_args = $(shell test -t 0 || echo "--log-level WARN")
docker_run = \
Expand All @@ -69,21 +66,21 @@ list:

.PHONY: $(designs)
$(designs) : export current_design=$@
$(designs) : % : ./%/config.json
$(designs) : % : $(PROJECT_ROOT)/openlane/%/config.json
# $(current_design)
rm -rf ./$*/runs/$(OPENLANE_RUN_TAG)
@rm -rf $(PROJECT_ROOT)/openlane/$*/runs/$(OPENLANE_RUN_TAG)
ifeq ($(OPENLANE_USE_NIX),1)
nix-shell --pure --command "openlane $(openlane_args) $(openlane_extra_args)"
else
../openlane-venv/bin/python3 -m openlane $(docker_mounts) --dockerized $(openlane_args) $(openlane_extra_args)
$(PROJECT_ROOT)/openlane-venv/bin/python3 -m openlane $(docker_mounts) --dockerized $(openlane_args) $(openlane_extra_args)
endif
mkdir -p ./$*/runs/$(OPENLANE_RUN_TAG)
rm -rf ./$*/runs/$*
ln -s $$(realpath ./$*/runs/$(OPENLANE_RUN_TAG)) ./$*/runs/$*
@mkdir -p ../signoff/$*/
@echo $(OPENLANE_TAG) > ../signoff/$*/OPENLANE_VERSION
@cp $(PDK_ROOT)/$(PDK)/SOURCES ../signoff/$*/PDK_SOURCES
@cp ./$*/runs/$*/final/*.csv ../signoff/$*/
@rm -rf $(PROJECT_ROOT)/openlane/$*/runs/$*
@ln -s $$(realpath $(PROJECT_ROOT)/openlane/$*/runs/$(OPENLANE_RUN_TAG)) $(PROJECT_ROOT)/openlane/$*/runs/$*
@mkdir -p $(PROJECT_ROOT)/signoff/$*/
@echo $(OPENLANE_TAG) > $(PROJECT_ROOT)/signoff/$*/OPENLANE_VERSION
@cp $(PDK_ROOT)/$(PDK)/SOURCES $(PROJECT_ROOT)/signoff/$*/PDK_SOURCES
@cp $(PROJECT_ROOT)/openlane/$*/runs/$*/final/*.csv $(PROJECT_ROOT)/signoff/$*/
@rsync -a $(PROJECT_ROOT)/openlane/$*/runs/$*/final/ $(PROJECT_ROOT)/ --exclude "metrics.csv" --exclude "metrics.json"

.PHONY: openlane
openlane: check-openlane-env
Expand Down
4 changes: 2 additions & 2 deletions openlane/shell.nix
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
# limitations under the License.
{
pkgs ? import (fetchTarball "https://github.com/NixOS/nixpkgs/archive/0218941ea68b4c625533bead7bbb94ccce52dceb.tar.gz") {},
openlane-version ? "8b47c810ae47835079e09bbec8ff945c4b90b14a",
openlane-sha256 ? "sha256-I6vZhkqH+7InaQrmxWYJSuK0PKrMEA/UFAzfqFseR3A="
openlane-version ? "2.0.0b7",
openlane-sha256 ? "sha256-LGO/dpSdAD2zYj+8X9MnsaRVIrX7P9AYHIa2ozJdB8M="
}:

let openlane-src = pkgs.fetchFromGitHub {
Expand Down

0 comments on commit 8cc3629

Please sign in to comment.