Skip to content

Commit

Permalink
changed readlink to python
Browse files Browse the repository at this point in the history
  • Loading branch information
marwaneltoukhy committed Oct 1, 2023
1 parent fa304d0 commit 3ea9727
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ what:
# Install Openlane
.PHONY: openlane
openlane:
@if [ "$$(readlink -f $${OPENLANE_ROOT})" = "$$(readlink -f $$(pwd)/openlane)" ]; then\
@if [ "$(shell python3 -c "import os; print(os.path.abspath(\"$(OPENLANE_RUN_TAG)\"))")" = "$(shell python3 -c "import os; print(os.path.abspath(\"$(PWD)/openlane\"))")" ]; then\
echo "OPENLANE_ROOT is set to '$$(pwd)/openlane' which contains openlane config files"; \
echo "Please set it to a different directory"; \
exit 1; \
Expand All @@ -201,8 +201,8 @@ openlane:
.PHONY: simlink
simlink: check-caravel
### Symbolic links relative path to $CARAVEL_ROOT
$(eval MAKEFILE_PATH := $(shell readlink -f --relative-to=openlane $(CARAVEL_ROOT)/openlane/Makefile))
$(eval PIN_CFG_PATH := $(shell readlink -f --relative-to=openlane/user_project_wrapper $(CARAVEL_ROOT)/openlane/user_project_wrapper_empty/pin_order.cfg))
$(eval MAKEFILE_PATH := $(shell readlink --relative-to=openlane $(CARAVEL_ROOT)/openlane/Makefile))
$(eval PIN_CFG_PATH := $(shell readlink --relative-to=openlane/user_project_wrapper $(CARAVEL_ROOT)/openlane/user_project_wrapper_empty/pin_order.cfg))
mkdir -p openlane
mkdir -p openlane/user_project_wrapper
cd openlane &&\
Expand Down
10 changes: 5 additions & 5 deletions openlane/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -29,16 +29,16 @@ endif

openlane_cmd = \
"flow.tcl \
-design $$(readlink -f ./$*) \
-save_path $$(readlink -f ..) \
-design $(shell python3 -c "import os; print(os.path.abspath(\"$(PWD)/openlane/$*\"))") \
-save_path $(shell python3 -c "import os; print(os.path.dirname(\"$(PWD)\"))") \
-save \
-tag $(OPENLANE_RUN_TAG) \
-overwrite \
-ignore_mismatches"
openlane_cmd_interactive = "flow.tcl -it -file $$(readlink -f ./$*/interactive.tcl)"
openlane_cmd_interactive = "flow.tcl -it -file $(shell python3 -c "import os; print(os.path.abspath(\"$(PWD)/openlane/$*/interactive.tcl\"))")"

docker_mounts = \
-v $$(readlink -f $(PWD)/..):$$(readlink -f $(PWD)/..) \
-v $(shell python3 -c "import os; print(os.path.dirname(\"$(PWD)\"))"):$(shell python3 -c "import os; print(os.path.dirname(\"$(PWD)\"))") \
-v $(PDK_ROOT):$(PDK_ROOT) \
-v $(CARAVEL_ROOT):$(CARAVEL_ROOT) \
-v $(OPENLANE_ROOT):/openlane
Expand Down Expand Up @@ -75,7 +75,7 @@ else
# $(current_design)
mkdir -p ./$*/runs/$(OPENLANE_RUN_TAG)
rm -rf ./$*/runs/$*
ln -s $$(readlink -f ./$*/runs/$(OPENLANE_RUN_TAG)) ./$*/runs/$*
ln -s $(shell python3 -c "import os; print(os.path.dirname(\"$(PWD)/openlane/$*/runs/$(OPENLANE_RUN_TAG)\"))") ./$*/runs/$*
$(docker_run) \
$(OPENLANE_IMAGE_NAME) sh -c $(openlane_cmd)
endif
Expand Down

0 comments on commit 3ea9727

Please sign in to comment.