From 50d4ad4691b2f196517f695eac2844afd0a011d3 Mon Sep 17 00:00:00 2001 From: dani <17553473+poname@users.noreply.github.com> Date: Wed, 4 Jan 2023 11:32:51 -0400 Subject: [PATCH 1/2] vtr libs package --- .github/workflows/Build.yml | 21 ++++++++++++++++ misc/vtr-libs/build.sh | 31 +++++++++++++++++++++++ misc/vtr-libs/meta.yaml | 49 +++++++++++++++++++++++++++++++++++++ misc/vtr-libs/osx.patch | 22 +++++++++++++++++ 4 files changed, 123 insertions(+) create mode 100644 misc/vtr-libs/build.sh create mode 100644 misc/vtr-libs/meta.yaml create mode 100644 misc/vtr-libs/osx.patch diff --git a/.github/workflows/Build.yml b/.github/workflows/Build.yml index a8d6c190..97f73df4 100644 --- a/.github/workflows/Build.yml +++ b/.github/workflows/Build.yml @@ -751,3 +751,24 @@ jobs: steps: - uses: actions/checkout@v3 - uses: ./ci + + #67 + vtr-libs-linux: + runs-on: "ubuntu-20.04" + env: + PACKAGE: "misc/vtr-libs" + OS_NAME: "linux" + steps: + - uses: actions/checkout@v3 + - uses: ./ci + + #68 + vtr-libs-osx: + runs-on: "macos-latest" + env: + PACKAGE: "misc/vtr-libs" + OS_NAME: "osx" + SKIP: "true" + steps: + - uses: actions/checkout@v3 + - uses: ./ci diff --git a/misc/vtr-libs/build.sh b/misc/vtr-libs/build.sh new file mode 100644 index 00000000..6f4bd028 --- /dev/null +++ b/misc/vtr-libs/build.sh @@ -0,0 +1,31 @@ +#!/bin/bash + +set -e +set -x + +# Identify OS +UNAME_OUT="$(uname -s)" +case "${UNAME_OUT}" in + Linux*) OS=Linux;; + Darwin*) OS=Mac;; + *) OS="${UNAME_OUT}" + echo "Unknown OS: ${OS}" + exit;; +esac + +make V=1 CMAKE_PARAMS="-DCMAKE_INSTALL_PREFIX=${PREFIX} -DVTR_IPO_BUILD=off" -j$CPU_COUNT +if [[ $OS != "Mac" ]]; then + make test +fi +make install + +mkdir -p ${PREFIX}/lib +mv ${PREFIX}/bin/*.a ${PREFIX}/lib/ +mv ${PREFIX}/bin/capnp-schemas-dir ${PREFIX}/lib/ +rm ${PREFIX}/bin/* +mv ${PREFIX}/lib/capnp-schemas-dir ${PREFIX}/bin/ + +CAPNP_SCHEMAS=${PREFIX}/bin/capnp-schemas-dir + +echo -e "#!/bin/bash\n\necho ${PREFIX}/capnp" > ${CAPNP_SCHEMAS} +chmod +x ${CAPNP_SCHEMAS} diff --git a/misc/vtr-libs/meta.yaml b/misc/vtr-libs/meta.yaml new file mode 100644 index 00000000..8eaaa9fb --- /dev/null +++ b/misc/vtr-libs/meta.yaml @@ -0,0 +1,49 @@ +# Use `conda-build-prepare` before building for a better version string. +{% set version = '%s_%04i_%s'|format(GIT_DESCRIBE_TAG|replace('vpr-', '')|replace('-', '') or '0.X', GIT_DESCRIBE_NUMBER|int, GIT_DESCRIBE_HASH or 'gUNKNOWN') %} + +package: + name: vtr-libs + version: {{ version }} + +source: + git_url: https://github.com/verilog-to-routing/vtr-verilog-to-routing.git + git_rev: master + patches: + - osx.patch [osx] + +build: + # number: 201803050325 + number: {{ environ.get('DATE_NUM') }} + # string: 20180305_0325 + string: {{ environ.get('DATE_STR') }} + script_env: + - CI + +requirements: + build: + - {{ compiler('c') }} [linux] + - {{ compiler('cxx') }} [linux] + - clang 8.0 [osx] + - clangxx 8.0 [osx] + - python {{ python }} + - make + host: + - bison 3.4 + - cmake + - flex + - pkg-config + - tbb <2021.0.0a0 + - tbb-devel <2021.0.0a0 + run: + - tbb <2021.0.0a0 + +#test: +# commands: +# - ./run_reg_test.pl vtr_reg_basic +# - ./run_reg_test.pl vtr_reg_strong -j2 + +about: + home: http://verilogtorouting.org/ + license: MIT + license_file: LICENSE.md + summary: 'The Verilog-to-Routing (VTR) project is a world-wide collaborative effort to provide a open-source framework for conducting FPGA architecture and CAD research and development. The VTR design flow takes as input a Verilog description of a digital circuit, and a description of the target FPGA architecture.' diff --git a/misc/vtr-libs/osx.patch b/misc/vtr-libs/osx.patch new file mode 100644 index 00000000..c44a9984 --- /dev/null +++ b/misc/vtr-libs/osx.patch @@ -0,0 +1,22 @@ +diff --git a/vpr/src/timing/timing_util.cpp b/vpr/src/timing/timing_util.cpp +index 522946304..b200964ae 100644 +--- a/vpr/src/timing/timing_util.cpp ++++ b/vpr/src/timing/timing_util.cpp +@@ -29,7 +29,7 @@ tatum::TimingPathInfo find_longest_critical_path_delay(const tatum::TimingConstr + + //Record the maximum critical path accross all domain pairs + for (const auto& path_info : cpds) { +- if (crit_path_info.delay() < path_info.delay() || std::isnan(crit_path_info.delay())) { ++ if (crit_path_info.delay() < path_info.delay() || std::isnan(float(crit_path_info.delay()))) { + crit_path_info = path_info; + } + } +@@ -46,7 +46,7 @@ tatum::TimingPathInfo find_least_slack_critical_path_delay(const tatum::TimingCo + + //Record the maximum critical path accross all domain pairs + for (const auto& path_info : cpds) { +- if (path_info.slack() < crit_path_info.slack() || std::isnan(crit_path_info.slack())) { ++ if (path_info.slack() < crit_path_info.slack() || std::isnan(float(crit_path_info.slack()))) { + crit_path_info = path_info; + } + } From 8630d0141c522f1c1d75c8f6ffff4ebc3cf80c55 Mon Sep 17 00:00:00 2001 From: dani <17553473+poname@users.noreply.github.com> Date: Wed, 4 Jan 2023 14:08:22 -0400 Subject: [PATCH 2/2] issue fixed --- misc/vtr-libs/build.sh | 2 -- 1 file changed, 2 deletions(-) diff --git a/misc/vtr-libs/build.sh b/misc/vtr-libs/build.sh index 6f4bd028..f2a2d9e2 100644 --- a/misc/vtr-libs/build.sh +++ b/misc/vtr-libs/build.sh @@ -21,9 +21,7 @@ make install mkdir -p ${PREFIX}/lib mv ${PREFIX}/bin/*.a ${PREFIX}/lib/ -mv ${PREFIX}/bin/capnp-schemas-dir ${PREFIX}/lib/ rm ${PREFIX}/bin/* -mv ${PREFIX}/lib/capnp-schemas-dir ${PREFIX}/bin/ CAPNP_SCHEMAS=${PREFIX}/bin/capnp-schemas-dir