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

VPR: interchange: add initial support for the interchange netlist frontend #1894

Open
wants to merge 10 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
8 changes: 8 additions & 0 deletions .github/scripts/install_dependencies.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ sudo apt install -y \
binutils \
binutils-gold \
build-essential \
capnproto \
cmake \
ctags \
curl \
Expand All @@ -20,6 +21,7 @@ sudo apt install -y \
git \
gperf \
libcairo2-dev \
libcapnp-dev \
libgtk-3-dev \
libevent-dev \
libfontconfig1-dev \
Expand Down Expand Up @@ -54,3 +56,9 @@ sudo apt install -y \
# libtbb-dev

pip install -r requirements.txt

git clone https://github.com/capnproto/capnproto-java.git $GITHUB_WORKSPACE/env/capnproto-java
pushd $GITHUB_WORKSPACE/env/capnproto-java
make
sudo make install
popd
9 changes: 7 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ option(VTR_ENABLE_CAPNPROTO "Enable capnproto binary serialization support in VP
#Allow the user to enable/disable VPR analytic placement
#VPR option --enable_analytic_placer is also required for Analytic Placement
option(VPR_ANALYTIC_PLACE "Enable analytic placement in VPR." ON)
option(VPR_ENABLE_INTERCHANGE "Enable FPGA interchange." ON)

option(WITH_BLIFEXPLORER "Enable build with blifexplorer" OFF)

Expand Down Expand Up @@ -121,6 +122,11 @@ endif()
# Build type flags
#

set(EXTRA_FLAGS "")
if(VPR_ENABLE_INTERCHANGE)
set(EXTRA_FLAGS "-lz")
endif()

if(NOT MSVC)
# for GCC and Clang
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -O0 -g3")
Expand Down Expand Up @@ -295,7 +301,7 @@ endif()
# Set final flags
#
separate_arguments(
ADDITIONAL_FLAGS UNIX_COMMAND "${SANITIZE_FLAGS} ${PROFILING_FLAGS} ${COVERAGE_FLAGS} ${LOGGING_FLAGS} ${COLORED_COMPILE}"
ADDITIONAL_FLAGS UNIX_COMMAND "${SANITIZE_FLAGS} ${PROFILING_FLAGS} ${COVERAGE_FLAGS} ${LOGGING_FLAGS} ${COLORED_COMPILE} ${EXTRA_FLAGS}"
)
separate_arguments(
WARN_FLAGS UNIX_COMMAND "${WARN_FLAGS}"
Expand Down Expand Up @@ -366,7 +372,6 @@ if (VPR_USE_EZGL STREQUAL "auto")
endif()
endif()


#Add the various sub-projects
if(${WITH_ABC})
add_subdirectory(abc)
Expand Down
59 changes: 32 additions & 27 deletions dev/subtree_config.xml
Original file line number Diff line number Diff line change
@@ -1,42 +1,47 @@
<subtrees>
<subtree
name="abc"
internal_path="abc"
<subtree
name="abc"
internal_path="abc"
external_url="https://github.com/berkeley-abc/abc.git"
default_external_ref="master"/>
<subtree
<subtree
name="libargparse"
internal_path="libs/EXTERNAL/libargparse"
external_url="https://github.com/kmurray/libargparse.git"
default_external_ref="master"/>
<subtree
name="libblifparse"
internal_path="libs/EXTERNAL/libblifparse"
external_url="https://github.com/verilog-to-routing/libblifparse.git"
<subtree
name="libblifparse"
internal_path="libs/EXTERNAL/libblifparse"
external_url="https://github.com/verilog-to-routing/libblifparse.git"
default_external_ref="master"/>
<subtree
name="libsdcparse"
internal_path="libs/EXTERNAL/libsdcparse"
external_url="https://github.com/verilog-to-routing/libsdcparse.git"
<subtree
name="libsdcparse"
internal_path="libs/EXTERNAL/libsdcparse"
external_url="https://github.com/verilog-to-routing/libsdcparse.git"
default_external_ref="master"/>
<subtree
name="libtatum"
internal_path="libs/EXTERNAL/libtatum"
external_url="https://github.com/verilog-to-routing/tatum.git"
<subtree
name="libtatum"
internal_path="libs/EXTERNAL/libtatum"
external_url="https://github.com/verilog-to-routing/tatum.git"
default_external_ref="master"/>
<subtree
name="libezgl"
internal_path="libs/EXTERNAL/libezgl"
external_url="https://github.com/mariobadr/ezgl.git"
<subtree
name="libezgl"
internal_path="libs/EXTERNAL/libezgl"
external_url="https://github.com/mariobadr/ezgl.git"
default_external_ref="master"/>
<subtree
name="capnproto"
internal_path="libs/EXTERNAL/capnproto"
external_url="https://github.com/capnproto/capnproto.git"
<subtree
name="capnproto"
internal_path="libs/EXTERNAL/capnproto"
external_url="https://github.com/capnproto/capnproto.git"
default_external_ref="v0.7.0"/>
<subtree
name="libyosys"
internal_path="libs/EXTERNAL/libyosys"
<subtree
name="libyosys"
internal_path="libs/EXTERNAL/libyosys"
external_url="https://github.com/YosysHQ/yosys.git"
default_external_ref="master"/>
<subtree
name="libinterchange"
internal_path="libs/EXTERNAL/libinterchange"
external_url="https://github.com/chipsalliance/fpga-interchange-schema.git"
default_external_ref="main"/>
</subtrees>
2 changes: 1 addition & 1 deletion libs/EXTERNAL/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ add_subdirectory(libsdcparse)
add_subdirectory(libblifparse)
add_subdirectory(libtatum)

#VPR_USE_EZGL is initialized in the root CMakeLists.
#VPR_USE_EZGL is initialized in the root CMakeLists.
#compile libezgl only if the user asks for or has its dependencies installed.
if(VPR_USE_EZGL STREQUAL "on")
add_subdirectory(libezgl)
Expand Down
42 changes: 42 additions & 0 deletions libs/EXTERNAL/libinterchange/.github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# Copyright (C) 2017-2021 The SymbiFlow Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# SPDX-License-Identifier: Apache-2.0

name: CI tests
on: [push, pull_request]
jobs:
Check-schema:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
with:
submodules: recursive

- uses: SymbiFlow/actions/checks@main

- name: Install
run: |
sudo apt-get install capnproto libcapnp-dev
git clone https://github.com/capnproto/capnproto-java.git $GITHUB_WORKSPACE/env/capnproto-java
cd $GITHUB_WORKSPACE/env/capnproto-java
make
sudo make install
- name: Build schemas
run: |
mkdir build
capnp compile -Iinterchange -oc++:build interchange/References.capnp
capnp compile -Iinterchange -oc++:build interchange/LogicalNetlist.capnp
capnp compile -Iinterchange -oc++:build interchange/PhysicalNetlist.capnp
capnp compile -Iinterchange -oc++:build interchange/DeviceResources.capnp
120 changes: 120 additions & 0 deletions libs/EXTERNAL/libinterchange/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
pip-wheel-metadata/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
.hypothesis/
.pytest_cache/

# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settings.py
db.sqlite3

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
target/

# Jupyter Notebook
.ipynb_checkpoints

# IPython
profile_default/
ipython_config.py

# pyenv
env/
.python-version

# celery beat schedule file
celerybeat-schedule

# SageMath parsed files
*.sage.py

# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/

# Spyder project settings
.spyderproject
.spyproject

# Rope project settings
.ropeproject

# mkdocs documentation
/site

# mypy
.mypy_cache/
.dmypy.json
dmypy.json

# Pyre type checker
.pyre/

# Emacs temporary files
*~
32 changes: 32 additions & 0 deletions libs/EXTERNAL/libinterchange/.readthedocs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Copyright (C) 2017-2021 The SymbiFlow Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# SPDX-License-Identifier: Apache-2.0
#
# .readthedocs.yml
# Read the Docs configuration file
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details

# Required
version: 2

# Build documentation in the docs/ directory with Sphinx
sphinx:
configuration: docs/conf.py

formats:
- htmlzip

conda:
environment: docs/environment.yml
Loading