Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

vtr-libs #275

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions .github/workflows/Build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
29 changes: 29 additions & 0 deletions misc/vtr-libs/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#!/bin/bash
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this looks very similar to https://github.com/hdl/conda-eda/blob/master/pnr/vtr-gui/build.sh, I noticed https://github.com/hdl/conda-eda/tree/master/pnr/vtr does a symlink to the vtr-gui package, maybe something similar could be done here?


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/
rm ${PREFIX}/bin/*

CAPNP_SCHEMAS=${PREFIX}/bin/capnp-schemas-dir

echo -e "#!/bin/bash\n\necho ${PREFIX}/capnp" > ${CAPNP_SCHEMAS}
chmod +x ${CAPNP_SCHEMAS}
49 changes: 49 additions & 0 deletions misc/vtr-libs/meta.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# Use `conda-build-prepare` before building for a better version string.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shouldn't this go alongside the other vtr packages in https://github.com/hdl/conda-eda/tree/master/pnr?

{% 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:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if we could leverage conda outputs, to have a single build for vtr that ends up in multiple conda packages.

Maybe @ajelinski could advise on the best way to consolidate this?

# 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:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

curious why we disable the tests?

# 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.'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe we should expand in https://docs.conda.io/projects/conda-build/en/latest/resources/define-metadata.html#about-section about the differences with the other vtr packages?

22 changes: 22 additions & 0 deletions misc/vtr-libs/osx.patch
Original file line number Diff line number Diff line change
@@ -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;
}
}