From 66d69b237a1f340e63e2ae1c583dbdeb0c76cd5d Mon Sep 17 00:00:00 2001 From: Unai Martinez-Corral Date: Wed, 10 Aug 2022 23:04:38 +0200 Subject: [PATCH] f4pga/wrappers/sh/xc7: rm generate_constraints.f4pga.sh Signed-off-by: Unai Martinez-Corral --- f4pga/wrappers/sh/__init__.py | 35 ++++++++++++- .../sh/xc7/generate_constraints.f4pga.sh | 51 ------------------- 2 files changed, 34 insertions(+), 52 deletions(-) delete mode 100755 f4pga/wrappers/sh/xc7/generate_constraints.f4pga.sh diff --git a/f4pga/wrappers/sh/__init__.py b/f4pga/wrappers/sh/__init__.py index 81033fd..9cdb19c 100644 --- a/f4pga/wrappers/sh/__init__.py +++ b/f4pga/wrappers/sh/__init__.py @@ -72,7 +72,40 @@ export OUT_NOISY_WARNINGS=noisy_warnings-${{DEVICE}}_{log_suffix}.log def generate_constraints(): print("[F4PGA] Running (deprecated) generate constraints") - run_sh_script(ROOT / SH_SUBDIR / "generate_constraints.f4pga.sh") + if isQuickLogic: + run_sh_script(ROOT / SH_SUBDIR / "generate_constraints.f4pga.sh") + else: + (eblif, net, part, device, arch_def) = sys_argv[1:6] + pcf_opts = f"PCF_OPTS='--pcf {sys_argv[6]}'" if len(sys_argv) > 6 else '' + run_bash_cmds(f""" +set -e +EBLIF='{eblif}' +NET='{net}' +PART='{part}' +DEVICE='{device}' +ARCH_DEF='{arch_def}' +{pcf_opts} +""" + """ +SHARE_DIR_PATH=${SHARE_DIR_PATH:="$F4PGA_SHARE_DIR"} +PROJECT=$(basename -- "$EBLIF") +IOPLACE_FILE="${PROJECT%.*}.ioplace" + +python3 "${SHARE_DIR_PATH}"/scripts/prjxray_create_ioplace.py \ + --blif "$EBLIF" \ + --map "${SHARE_DIR_PATH}/arch/${DEVICE}/${PART}/pinmap.csv" \ + --net "$NET" $PCF_OPTS \ + > "${IOPLACE_FILE}" + +python3 "${SHARE_DIR_PATH}"/scripts/prjxray_create_place_constraints.py \ + --net "$NET" \ + --arch "${ARCH_DEF}" \ + --blif "$EBLIF" \ + --vpr_grid_map "${SHARE_DIR_PATH}/arch/${DEVICE}/vpr_grid_map.csv" \ + --input "${IOPLACE_FILE}" \ + --db_root "${DATABASE_DIR:=$(prjxray-config)}" \ + --part "$PART" \ + > constraints.place +""") def pack(): diff --git a/f4pga/wrappers/sh/xc7/generate_constraints.f4pga.sh b/f4pga/wrappers/sh/xc7/generate_constraints.f4pga.sh deleted file mode 100755 index 2bbd2f8..0000000 --- a/f4pga/wrappers/sh/xc7/generate_constraints.f4pga.sh +++ /dev/null @@ -1,51 +0,0 @@ -#!/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 - -EBLIF=$1 -NET=$2 -PART=$3 -DEVICE=$4 -ARCH_DEF=$5 -PCF=$6 - -if [ ! -z $PCF ]; then - PCF_OPTS="--pcf $PCF" -fi - -SHARE_DIR_PATH=${SHARE_DIR_PATH:="$F4PGA_SHARE_DIR"} - -PROJECT=$(basename -- "$EBLIF") -IOPLACE_FILE="${PROJECT%.*}.ioplace" - -python3 ${SHARE_DIR_PATH}/scripts/prjxray_create_ioplace.py \ - --blif $EBLIF \ - --map ${SHARE_DIR_PATH}/arch/${DEVICE}/${PART}/pinmap.csv \ - --net $NET $PCF_OPTS \ - > ${IOPLACE_FILE} - -python3 ${SHARE_DIR_PATH}/scripts/prjxray_create_place_constraints.py \ - --net $NET \ - --arch ${ARCH_DEF} \ - --blif $EBLIF \ - --vpr_grid_map ${SHARE_DIR_PATH}/arch/${DEVICE}/vpr_grid_map.csv \ - --input ${IOPLACE_FILE} \ - --db_root ${DATABASE_DIR:=$(prjxray-config)} \ - --part $PART \ - > constraints.place