From 84fef6357bf245d2429ff28a198ceb92407c36f9 Mon Sep 17 00:00:00 2001 From: Unai Martinez-Corral Date: Sun, 27 Feb 2022 15:27:49 +0100 Subject: [PATCH] ci: use f4pga entrypoints to sh wrappers Signed-off-by: Unai Martinez-Corral --- .github/scripts/prepare_environment.sh | 29 +++++++++++++++++++++- f4pga/setup.py | 33 ++++++++++++++++++++++++++ 2 files changed, 61 insertions(+), 1 deletion(-) diff --git a/.github/scripts/prepare_environment.sh b/.github/scripts/prepare_environment.sh index 48da177..c79b301 100755 --- a/.github/scripts/prepare_environment.sh +++ b/.github/scripts/prepare_environment.sh @@ -47,7 +47,7 @@ echo '::endgroup::' cd .. -echo '::group::Add f4pga-env' +echo '::group::🗑️ Remove the wrappers (pre-packaged from arch-defs) and add f4pga-env' case "$F4PGA_FAM" in xc7) F4PGA_DIR_ROOT='install';; @@ -58,6 +58,33 @@ F4PGA_DIR_BIN="$F4PGA_INSTALL_DIR_FAM/$F4PGA_DIR_ROOT"/bin/ cp $(dirname "$0")/../../f4pga-env "$F4PGA_DIR_BIN" cd "$F4PGA_DIR_BIN" +case "$F4PGA_FAM" in + xc7) + rm -vrf \ + env \ + symbiflow_generate_constraints \ + symbiflow_pack \ + symbiflow_place \ + symbiflow_route \ + symbiflow_synth \ + symbiflow_write_bitstream \ + symbiflow_write_fasm \ + vpr_common + ;; + eos-s3) + sed -i 's#${MYPATH}/../share#'"$(./f4pga-env share)"'#' vpr_common + rm -vrf \ + symbiflow_pack \ + symbiflow_place \ + symbiflow_route \ + symbiflow_write_fasm \ + symbiflow_analysis \ + symbiflow_repack \ + symbiflow_generate_bitstream \ + symbiflow_generate_libfile + ;; +esac + ls -lah echo '::endgroup::' diff --git a/f4pga/setup.py b/f4pga/setup.py index d1d83f1..0b968c6 100644 --- a/f4pga/setup.py +++ b/f4pga/setup.py @@ -4,9 +4,39 @@ from pathlib import Path from setuptools import setup as setuptools_setup +from os import environ +F4PGA_FAM = environ.get('F4PGA_FAM', 'xc7') + packagePath = Path(__file__).resolve().parent +sf = "symbiflow" +shwrappers = "f4pga.wrappers.sh.__init__" + +wrapper_entrypoints = [ + f"{sf}_generate_constraints = {shwrappers}:generate_constraints", + f"{sf}_pack = {shwrappers}:pack", + f"{sf}_place = {shwrappers}:place", + f"{sf}_route = {shwrappers}:route", + f"{sf}_synth = {shwrappers}:synth", + f"{sf}_write_bitstream = {shwrappers}:write_bitstream", + f"{sf}_write_fasm = {shwrappers}:write_fasm", +] if F4PGA_FAM == 'xc7' else [ +# f"{sf}_generate_constraints = {shwrappers}:generate_constraints", + 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", +# f"{sf}_write_xml_rr_graph = {shwrappers}:write_xml_rr_graph", # Is this unused ??? +# f"vpr_common = {shwrappers}:vpr_common", +# f"{sf}_analysis = {shwrappers}:analysis", # Is this unused ??? +# f"{sf}_repack = {shwrappers}:repack", # Is this unused ??? +# f"{sf}_generate_bitstream = {shwrappers}:generate_bitstream", # Is this unused ??? +# f"{sf}_generate_libfile = {shwrappers}:generate_libfile", # Is this unused ??? +# f"ql_{sf} = {shwrappers}:ql", +] + setuptools_setup( name=packagePath.name, version="0.0.0", @@ -23,4 +53,7 @@ setuptools_setup( }, classifiers=[], python_requires='>=3.6', + entry_points={ + "console_scripts": wrapper_entrypoints + }, )