From cfa9563e90584583da342f9f4f5f467ee81300e7 Mon Sep 17 00:00:00 2001 From: Unai Martinez-Corral Date: Wed, 17 Aug 2022 00:13:08 +0200 Subject: [PATCH 1/2] f4pga/setup: same installation regardless of FPGA_FAM Signed-off-by: Unai Martinez-Corral --- f4pga/setup.py | 34 +++++++++++++++------------------- 1 file changed, 15 insertions(+), 19 deletions(-) diff --git a/f4pga/setup.py b/f4pga/setup.py index 82ade20..ba6ff55 100644 --- a/f4pga/setup.py +++ b/f4pga/setup.py @@ -24,9 +24,6 @@ from subprocess import run from setuptools import setup as setuptools_setup -from os import environ -FPGA_FAM = environ.get('FPGA_FAM', 'xc7') - packagePath = Path(__file__).resolve().parent requirementsFile = packagePath / "requirements.txt" @@ -69,6 +66,7 @@ if git is not None: if version is None: version = semver + sf = "symbiflow" shwrappers = "f4pga.wrappers.sh.__init__" @@ -112,21 +110,19 @@ setuptools_setup( f"{sf}_place = {shwrappers}:place", f"{sf}_route = {shwrappers}:route", f"{sf}_synth = {shwrappers}:synth", - f"{sf}_write_fasm = {shwrappers}:write_fasm" - ] + ( - [ - f"{sf}_write_bitstream = {shwrappers}:write_bitstream", - ] if FPGA_FAM == 'xc7' else [ - f"{sf}_analysis = {shwrappers}:analysis", - f"{sf}_fasm2bels = {shwrappers}:fasm2bels", - f"{sf}_generate_bitstream = {shwrappers}:generate_bitstream", - f"{sf}_repack = {shwrappers}:repack", - f"{sf}_write_binary = {shwrappers}:write_binary", - f"{sf}_write_bitheader = {shwrappers}:write_bitheader", - f"{sf}_write_jlink = {shwrappers}:write_jlink", - f"{sf}_write_openocd = {shwrappers}:write_openocd", - f"ql_{sf} = {shwrappers}:ql", - ] - ) + f"{sf}_write_fasm = {shwrappers}:write_fasm", + # Xilinx only + f"{sf}_write_bitstream = {shwrappers}:write_bitstream", + # QuickLogic only + f"{sf}_analysis = {shwrappers}:analysis", + f"{sf}_fasm2bels = {shwrappers}:fasm2bels", + f"{sf}_generate_bitstream = {shwrappers}:generate_bitstream", + f"{sf}_repack = {shwrappers}:repack", + f"{sf}_write_binary = {shwrappers}:write_binary", + f"{sf}_write_bitheader = {shwrappers}:write_bitheader", + f"{sf}_write_jlink = {shwrappers}:write_jlink", + f"{sf}_write_openocd = {shwrappers}:write_openocd", + f"ql_{sf} = {shwrappers}:ql", + ] }, ) From 1bc7804fde803170f0fccac649d229637f64d9e4 Mon Sep 17 00:00:00 2001 From: Unai Martinez-Corral Date: Wed, 17 Aug 2022 00:18:31 +0200 Subject: [PATCH 2/2] f4pga/setup: style Signed-off-by: Unai Martinez-Corral --- f4pga/setup.py | 34 +++++++++++++++++++--------------- 1 file changed, 19 insertions(+), 15 deletions(-) diff --git a/f4pga/setup.py b/f4pga/setup.py index ba6ff55..ebe0993 100644 --- a/f4pga/setup.py +++ b/f4pga/setup.py @@ -106,23 +106,27 @@ setuptools_setup( entry_points={ "console_scripts": [ "f4pga = f4pga.__init__:main", - f"{sf}_pack = {shwrappers}:pack", - f"{sf}_place = {shwrappers}:place", - f"{sf}_route = {shwrappers}:route", - f"{sf}_synth = {shwrappers}:synth", - f"{sf}_write_fasm = {shwrappers}:write_fasm", - # Xilinx only - f"{sf}_write_bitstream = {shwrappers}:write_bitstream", # QuickLogic only - f"{sf}_analysis = {shwrappers}:analysis", - f"{sf}_fasm2bels = {shwrappers}:fasm2bels", - f"{sf}_generate_bitstream = {shwrappers}:generate_bitstream", - f"{sf}_repack = {shwrappers}:repack", - f"{sf}_write_binary = {shwrappers}:write_binary", - f"{sf}_write_bitheader = {shwrappers}:write_bitheader", - f"{sf}_write_jlink = {shwrappers}:write_jlink", - f"{sf}_write_openocd = {shwrappers}:write_openocd", f"ql_{sf} = {shwrappers}:ql", + ] + [ + f"{sf}_{script} = {shwrappers}:{script}" for script in [ + "pack", + "place", + "route", + "synth", + "write_fasm", + # Xilinx only + "write_bitstream", + # QuickLogic only + "analysis", + "fasm2bels", + "generate_bitstream", + "repack", + "write_binary", + "write_bitheader", + "write_jlink", + "write_openocd", + ] ] }, )