Skip to content

Commit

Permalink
Merge pull request f4pga#1747 from antmicro/restructure-install-packages
Browse files Browse the repository at this point in the history
Restructure install packages
  • Loading branch information
litghost committed Dec 3, 2020
2 parents 30f32c9 + d7538db commit 5a1ad03
Show file tree
Hide file tree
Showing 12 changed files with 56 additions and 56 deletions.
27 changes: 26 additions & 1 deletion .github/check-status/check-status.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
#!/usr/bin/env python3

from os import environ
import re
from os import environ, path
from github import Github
from stdm import get_latest_artifact_url

gh_ref = environ['GITHUB_REPOSITORY']
gh_sha = environ['INPUT_SHA']
Expand All @@ -17,3 +19,26 @@
if status.state != 'success':
print('Status not successful. Skipping...')
exit(1)

artifacts, _ = get_latest_artifact_url()

PACKAGE_RE = re.compile("symbiflow-arch-defs-([a-zA-Z0-9_-]+)-([a-z0-9])")

for artifact in artifacts:
name = artifact["name"].split(".")[0]
url = artifact["url"]

m = PACKAGE_RE.match(name)
assert m, "Package name not recognized! {}".format(name)

package_name = m.group(1)

if package_name == "install":
file_name = "symbiflow-toolchain-latest"
elif package_name == "benchmarks":
file_name = "symbiflow-benchmarks-latest"
else:
file_name = "symbiflow-{}-latest".format(package_name)

with open(path.join("install", file_name), "w") as f:
f.write(url)
2 changes: 1 addition & 1 deletion .github/check-status/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/usr/bin/env sh

/check-status.py && mkdir install && symbiflow_get_latest_artifact_url > install/latest || echo '::set-output name=skip::true'
mkdir install && /check-status.py || echo '::set-output name=skip::true'
2 changes: 1 addition & 1 deletion .github/kokoro/continuous-install-200t.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ timeout_mins: 4320
action {
define_artifacts {
# File types
regex: "**/symbiflow-arch-defs-*.tar.xz"
regex: "**/symbiflow-*.tar.xz"
strip_prefix: "github/symbiflow-arch-defs-continuous-install-200t/"
}
}
Expand Down
2 changes: 1 addition & 1 deletion .github/kokoro/continuous-install.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ timeout_mins: 4320
action {
define_artifacts {
# File types
regex: "**/symbiflow-arch-defs-*.tar.xz"
regex: "**/symbiflow-*.tar.xz"
strip_prefix: "github/symbiflow-arch-defs-continuous-install/"
}
}
Expand Down
43 changes: 5 additions & 38 deletions .github/kokoro/install-200t.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,45 +11,12 @@ export CMAKE_FLAGS="-GNinja -DCMAKE_INSTALL_PREFIX=${INSTALL_DIR} -DINSTALL_DEVI
export BUILD_TOOL=ninja
source ${SCRIPT_DIR}/common.sh

# This CI was executing the same exact script
# as the XC7 - Install CI, therefore it is now
# set to do nothing.
# TODO: Remove this CI upstream so it does not run at all
echo
echo "========================================"
echo "Running install tests (make install)"
echo "----------------------------------------"
(
source env/conda/bin/activate symbiflow_arch_def_base
pushd build
export VPR_NUM_WORKERS=${CORES}
ninja -j${MAX_CORES} install
popd
cp environment.yml install/
)
echo "----------------------------------------"

echo
echo "Doing nothing!"
echo "========================================"
echo "Running installed toolchain tests"
echo "----------------------------------------"
(
source env/conda/bin/activate symbiflow_arch_def_base
pushd build
export VPR_NUM_WORKERS=${CORES}
export CTEST_OUTPUT_ON_FAILURE=1
ctest -R binary_toolchain_test_50t -j${MAX_CORES}
ctest -R binary_toolchain_test_100t -j${MAX_CORES}
ctest -R binary_toolchain_test_200t -j${MAX_CORES}
popd
)
echo "----------------------------------------"

echo
echo "========================================"
echo "Compressing and uploading install dir"
echo "----------------------------------------"
(
rm -rf build
du -ah install
export GIT_HASH=$(git rev-parse --short HEAD)
tar cfJv symbiflow-arch-defs-install-200t-${GIT_HASH}.tar.xz -C install bin share environment.yml
tar cfJv symbiflow-arch-defs-benchmarks-200t-${GIT_HASH}.tar.xz -C install benchmarks
)
echo "----------------------------------------"
6 changes: 5 additions & 1 deletion .github/kokoro/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,12 @@ echo "----------------------------------------"
rm -rf build
du -ah install
export GIT_HASH=$(git rev-parse --short HEAD)
tar cfJv symbiflow-arch-defs-install-${GIT_HASH}.tar.xz -C install bin share environment.yml
tar cfJv symbiflow-arch-defs-install-${GIT_HASH}.tar.xz -C install bin share/symbiflow/techmaps share/symbiflow/scripts environment.yml
tar cfJv symbiflow-arch-defs-benchmarks-${GIT_HASH}.tar.xz -C install benchmarks
for device in $(ls install/share/symbiflow/arch)
do
tar cfJv symbiflow-arch-defs-$device-${GITH_HASH}.tar.xz -C install share/symbiflow/arch/$device
done
)
echo "----------------------------------------"

Expand Down
2 changes: 1 addition & 1 deletion .github/kokoro/kokoro-cfg.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"""

INSTALL = """\
regex: "**/symbiflow-arch-defs-*.tar.xz"\
regex: "**/symbiflow-*.tar.xz"\
"""

DB_FULL = """\
Expand Down
2 changes: 1 addition & 1 deletion .github/kokoro/presubmit-install-200t.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ timeout_mins: 4320
action {
define_artifacts {
# File types
regex: "**/symbiflow-arch-defs-*.tar.xz"
regex: "**/symbiflow-*.tar.xz"
strip_prefix: "github/symbiflow-arch-defs-presubmit-install-200t/"
}
}
Expand Down
2 changes: 1 addition & 1 deletion .github/kokoro/presubmit-install.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ timeout_mins: 4320
action {
define_artifacts {
# File types
regex: "**/symbiflow-arch-defs-*.tar.xz"
regex: "**/symbiflow-*.tar.xz"
strip_prefix: "github/symbiflow-arch-defs-presubmit-install/"
}
}
Expand Down
4 changes: 2 additions & 2 deletions xc/common/cmake/install.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,11 @@ function(DEFINE_XC_TOOLCHAIN_TARGET)
${symbiflow-arch-defs_SOURCE_DIR}/utils/vpr_io_place.py
${symbiflow-arch-defs_SOURCE_DIR}/utils/vpr_place_constraints.py
${symbiflow-arch-defs_SOURCE_DIR}/utils/eblif.py
DESTINATION bin/python
DESTINATION share/symbiflow/scripts
PERMISSIONS WORLD_EXECUTE WORLD_READ OWNER_WRITE OWNER_READ OWNER_EXECUTE GROUP_READ GROUP_EXECUTE)

install(FILES ${symbiflow-arch-defs_SOURCE_DIR}/utils/lib/parse_pcf.py
DESTINATION bin/python/lib)
DESTINATION share/symbiflow/scripts/lib)


# install prjxray techmap
Expand Down
10 changes: 6 additions & 4 deletions xc/xc7/toolchain_wrappers/symbiflow_generate_constraints
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ set -e
MYPATH=`realpath $0`
MYPATH=`dirname ${MYPATH}`

export SHARE_DIR_PATH=`realpath ${MYPATH}/../share/symbiflow`

EBLIF=$1
NET=$2
PART=$3
Expand All @@ -15,10 +17,10 @@ if [ ! -z $PCF ]; then
PCF_OPTS="--pcf $PCF"
fi

VPR_GRID_MAP=`realpath ${MYPATH}/../share/symbiflow/arch/${DEVICE}/vpr_grid_map.csv`
PINMAP=`realpath ${MYPATH}/../share/symbiflow/arch/${DEVICE}/${PART}/pinmap.csv`
IOGEN=`realpath ${MYPATH}/python/prjxray_create_ioplace.py`
CONSTR_GEN=`realpath ${MYPATH}/python/prjxray_create_place_constraints.py`
VPR_GRID_MAP=${SHARE_DIR_PATH}/arch/${DEVICE}/vpr_grid_map.csv
PINMAP=${SHARE_DIR_PATH}/arch/${DEVICE}/${PART}/pinmap.csv
IOGEN=${SHARE_DIR_PATH}/scripts/prjxray_create_ioplace.py
CONSTR_GEN=${SHARE_DIR_PATH}/scripts/prjxray_create_place_constraints.py
PROJECT=$(basename -- "$EBLIF")
IOPLACE_FILE="${PROJECT%.*}.ioplace"

Expand Down
10 changes: 6 additions & 4 deletions xc/xc7/toolchain_wrappers/symbiflow_synth
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,13 @@ set -e
MYPATH=`realpath $0`
MYPATH=`dirname ${MYPATH}`

export TECHMAP_PATH=`realpath ${MYPATH}/../share/symbiflow/techmaps/xc7_vpr/techmap`
export SHARE_DIR_PATH=`realpath ${MYPATH}/../share/symbiflow`
export TECHMAP_PATH=${SHARE_DIR_PATH}/techmaps/xc7_vpr/techmap

SYNTH_TCL_PATH=`realpath ${MYPATH}/../share/symbiflow/scripts/xc7/synth.tcl`
CONV_TCL_PATH=`realpath ${MYPATH}/../share/symbiflow/scripts/xc7/conv.tcl`
export UTILS_PATH=`realpath ${MYPATH}/python`

export UTILS_PATH=${SHARE_DIR_PATH}/scripts
SYNTH_TCL_PATH=${UTILS_PATH}/xc7/synth.tcl
CONV_TCL_PATH=${UTILS_PATH}/xc7/conv.tcl
SPLIT_INOUTS=${UTILS_PATH}/split_inouts.py

VERILOG_FILES=()
Expand Down

0 comments on commit 5a1ad03

Please sign in to comment.