From 20b64d95069e0fbe1f5faae3d0deabef32ecfeec Mon Sep 17 00:00:00 2001 From: Unai Martinez-Corral Date: Wed, 10 Aug 2022 16:05:55 +0200 Subject: [PATCH] f4pga/wrappers/sh: add genfasm.f4pga.sh Signed-off-by: Unai Martinez-Corral --- f4pga/setup.py | 1 + f4pga/wrappers/sh/genfasm.f4pga.sh | 23 +++++++++++++++++++ .../sh/quicklogic/vpr_common.f4pga.sh | 13 ----------- .../sh/quicklogic/write_fasm.f4pga.sh | 7 +++++- f4pga/wrappers/sh/xc7/vpr_common.f4pga.sh | 13 ----------- f4pga/wrappers/sh/xc7/write_fasm.f4pga.sh | 7 +++++- 6 files changed, 36 insertions(+), 28 deletions(-) create mode 100755 f4pga/wrappers/sh/genfasm.f4pga.sh diff --git a/f4pga/setup.py b/f4pga/setup.py index 50a65cf..286c0cf 100644 --- a/f4pga/setup.py +++ b/f4pga/setup.py @@ -92,6 +92,7 @@ setuptools_setup( 'platforms/*.json' ], 'f4pga.wrappers.sh': [ + '*.f4pga.sh', 'xc7/*.f4pga.sh', 'quicklogic/*.f4pga.sh' ] diff --git a/f4pga/wrappers/sh/genfasm.f4pga.sh b/f4pga/wrappers/sh/genfasm.f4pga.sh new file mode 100755 index 0000000..9767c89 --- /dev/null +++ b/f4pga/wrappers/sh/genfasm.f4pga.sh @@ -0,0 +1,23 @@ +#!/usr/bin/env bash +# +# Copyright (C) 2020-2022 F4PGA Authors. +# +# 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 +# +# https://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 + +set -e + +"`which genfasm`" ${ARCH_DEF} \ + ${EBLIF} --device ${DEVICE_NAME} ${VPR_OPTIONS} --read_rr_graph ${RR_GRAPH} \ + $@ diff --git a/f4pga/wrappers/sh/quicklogic/vpr_common.f4pga.sh b/f4pga/wrappers/sh/quicklogic/vpr_common.f4pga.sh index f9b87c0..f4b26fa 100755 --- a/f4pga/wrappers/sh/quicklogic/vpr_common.f4pga.sh +++ b/f4pga/wrappers/sh/quicklogic/vpr_common.f4pga.sh @@ -163,16 +163,3 @@ function run_vpr { return $? } - -function run_genfasm { - set -e - - "`which genfasm`" ${ARCH_DEF} \ - ${EBLIF} \ - --device ${DEVICE_NAME} \ - ${VPR_OPTIONS} \ - --read_rr_graph ${RR_GRAPH} \ - $@ - - return $? -} diff --git a/f4pga/wrappers/sh/quicklogic/write_fasm.f4pga.sh b/f4pga/wrappers/sh/quicklogic/write_fasm.f4pga.sh index b7a503f..95e1d19 100755 --- a/f4pga/wrappers/sh/quicklogic/write_fasm.f4pga.sh +++ b/f4pga/wrappers/sh/quicklogic/write_fasm.f4pga.sh @@ -26,7 +26,12 @@ FASM_EXTRA="${TOP}_fasm_extra.fasm" export OUT_NOISY_WARNINGS=noisy_warnings-${DEVICE}_fasm.log -run_genfasm +ARCH_DEF="$ARCH_DEF" \ +EBLIF="$EBLIF" \ +DEVICE_NAME="$DEVICE_NAME" \ +VPR_OPTIONS="$VPR_OPTIONS" \ +RR_GRAPH="$RR_GRAPH" \ + $(dirname "$0")/../genfasm.f4pga.sh echo "FASM extra: $FASM_EXTRA" if [ -f $FASM_EXTRA ]; then diff --git a/f4pga/wrappers/sh/xc7/vpr_common.f4pga.sh b/f4pga/wrappers/sh/xc7/vpr_common.f4pga.sh index 7f12307..c751219 100755 --- a/f4pga/wrappers/sh/xc7/vpr_common.f4pga.sh +++ b/f4pga/wrappers/sh/xc7/vpr_common.f4pga.sh @@ -132,16 +132,3 @@ function run_vpr { return $? } - -function run_genfasm { - set -e - - genfasm ${ARCH_DEF} \ - ${EBLIF} \ - --device ${DEVICE_NAME} \ - ${VPR_OPTIONS} \ - --read_rr_graph ${RR_GRAPH} \ - $@ - - return $? -} diff --git a/f4pga/wrappers/sh/xc7/write_fasm.f4pga.sh b/f4pga/wrappers/sh/xc7/write_fasm.f4pga.sh index 5a89790..868e5f8 100755 --- a/f4pga/wrappers/sh/xc7/write_fasm.f4pga.sh +++ b/f4pga/wrappers/sh/xc7/write_fasm.f4pga.sh @@ -26,7 +26,12 @@ FASM_EXTRA=${TOP}_fasm_extra.fasm export OUT_NOISY_WARNINGS=noisy_warnings-${DEVICE}_fasm.log -run_genfasm +ARCH_DEF="$ARCH_DEF" \ +EBLIF="$EBLIF" \ +DEVICE_NAME="$DEVICE_NAME" \ +VPR_OPTIONS="$VPR_OPTIONS" \ +RR_GRAPH="$RR_GRAPH" \ + $(dirname "$0")/../genfasm.f4pga.sh echo "FASM extra: $FASM_EXTRA" if [ -f $FASM_EXTRA ]; then