From 3024afeed3a63ade6df6ead4bfb6df6fb3c69f3e Mon Sep 17 00:00:00 2001 From: umarcor Date: Tue, 6 Jul 2021 20:51:54 +0200 Subject: [PATCH] [setups/osflow] support 'svf' target for ECP5 devices --- setups/examples/Makefile | 8 ++++++-- setups/osflow/PnR_Bit.mk | 5 +++++ setups/osflow/common.mk | 8 ++++++-- 3 files changed, 17 insertions(+), 4 deletions(-) diff --git a/setups/examples/Makefile b/setups/examples/Makefile index a3703f3696..8ed4666391 100644 --- a/setups/examples/Makefile +++ b/setups/examples/Makefile @@ -18,8 +18,12 @@ run: BOARD_SRC=$(EXAMPLES)/neorv32_$(BOARD)_BoardTop_$(DESIGN).vhd \ TOP=neorv32_$(BOARD)_BoardTop_$(DESIGN) \ ID=$(DESIGN) \ - $(TASK) \ - && $(MV) $(OSFLOW)/$(BITSTREAM) ./ + $(TASK) + IMPL="$${BITSTREAM%%.*}"; for item in ".bit" ".svf"; do \ + if [ -f "$(OSFLOW)/$$IMPL$$item" ]; then \ + $(MV) "$(OSFLOW)/$$IMPL$$item" ./; \ + fi \ + done # Boards diff --git a/setups/osflow/PnR_Bit.mk b/setups/osflow/PnR_Bit.mk index 593f0fa1aa..12b9ff1d83 100644 --- a/setups/osflow/PnR_Bit.mk +++ b/setups/osflow/PnR_Bit.mk @@ -7,3 +7,8 @@ ${IMPL}.${PNR2BIT_EXT}: $(IMPL).json $(CONSTRAINTS) ${IMPL}.bit: ${IMPL}.${PNR2BIT_EXT} $(PACKTOOL) $< $@ + +ifeq ($(DEVICE_SERIES),ecp5) +${IMPL}.svf: ${IMPL}.${PNR2BIT_EXT} + $(PACKTOOL) --svf $@ $< +endif diff --git a/setups/osflow/common.mk b/setups/osflow/common.mk index df0d49bbdf..7bf264eb24 100644 --- a/setups/osflow/common.mk +++ b/setups/osflow/common.mk @@ -23,13 +23,17 @@ endif include synthesis.mk include PnR_Bit.mk -.PHONY: syn impl bit clean +.PHONY: syn impl bit svf clean syn: ${IMPL}.json impl: ${IMPL}.${PNR2BIT_EXT} bit: ${IMPL}.bit +ifeq ($(DEVICE_SERIES),ecp5) +svf: ${IMPL}.svf +endif + clean: - rm -rf *.{${PNR2BIT_EXT},bit,cf,dfu,history,json,o} *-report.txt + rm -rf *.{${PNR2BIT_EXT},bit,cf,dfu,history,json,o,svf} *-report.txt include boards/$(BOARD).mk