f4pga/wrappers/sh: merge 'genfasm' into 'write_fasm'

Signed-off-by: Unai Martinez-Corral <umartinezcorral@antmicro.com>
This commit is contained in:
Unai Martinez-Corral 2022-08-10 21:00:50 +02:00
parent a74239fb35
commit 315ffd2df2
2 changed files with 5 additions and 42 deletions

View File

@ -101,26 +101,16 @@ def write_bitstream():
run_sh_script(ROOT / SH_SUBDIR / "write_bitstream.f4pga.sh")
def genfasm(extra_args):
run_bash_cmds(f"""
'{which('genfasm')}' ${{ARCH_DEF}} \
${{EBLIF}} --device ${{DEVICE_NAME}} ${{VPR_OPTIONS}} --read_rr_graph ${{RR_GRAPH}} \
{' '.join(extra_args)}
""")
def write_fasm():
def write_fasm(genfasm_extra_args = None):
print("[F4PGA] Running (deprecated) write fasm")
run_bash_cmds(vpr_common_cmds('fasm')+f"""
TOP="${{EBLIF%.*}}"
FASM_EXTRA="${{TOP}}_fasm_extra.fasm"
ARCH_DEF="$ARCH_DEF" \
EBLIF="$EBLIF" \
DEVICE_NAME="$DEVICE_NAME" \
VPR_OPTIONS="$VPR_OPTIONS" \
RR_GRAPH="$RR_GRAPH" \
python3 -m f4pga.wrappers.sh.genfasm
'{which('genfasm')}' \
${{ARCH_DEF}} ${{EBLIF}} --device ${{DEVICE_NAME}} \
${{VPR_OPTIONS}} \
--read_rr_graph ${{RR_GRAPH}} {' '.join(genfasm_extra_args) if genfasm_extra_args is not None else ''}
echo "FASM extra: $FASM_EXTRA"
if [ -f $FASM_EXTRA ]; then

View File

@ -1,27 +0,0 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# 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
#
# Python entrypoints to the shell wrappers moved from arch-defs
from sys import argv as sys_argv
from f4pga.wrappers.sh import genfasm
if __name__ == '__main__':
genfasm(sys_argv[1:])