Skip to content

Commit ba39dae

Browse files
authored
Merge branch 'master' into eliminate_free_and_malloc
2 parents 700cc75 + 7933a6c commit ba39dae

File tree

807 files changed

+6146
-9375
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

807 files changed

+6146
-9375
lines changed

.github/scripts/install_dependencies.sh

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,40 +2,32 @@
22

33
sudo apt update
44

5+
# Required packages specifically for the CI and not VTR in general.
56
sudo apt install -y \
67
autoconf \
78
automake \
89
bash \
9-
bison \
1010
binutils \
1111
binutils-gold \
12-
build-essential \
1312
capnproto \
1413
exuberant-ctags \
1514
curl \
1615
doxygen \
17-
flex \
1816
fontconfig \
1917
gdb \
20-
git \
2118
gperf \
2219
libcairo2-dev \
2320
libcapnp-dev \
24-
libgtk-3-dev \
2521
libevent-dev \
2622
libfontconfig1-dev \
2723
liblist-moreutils-perl \
2824
libncurses5-dev \
29-
libx11-dev \
3025
libxft-dev \
3126
libxml2-utils \
3227
libxml++2.6-dev \
33-
libreadline-dev \
3428
tcllib \
3529
tcl8.6-dev \
36-
libffi-dev \
3730
perl \
38-
pkg-config \
3931
texinfo \
4032
time \
4133
valgrind \
@@ -54,9 +46,10 @@ sudo apt install -y \
5446
clang-15 \
5547
clang-16 \
5648
clang-17 \
57-
clang-18 \
58-
clang-format-18 \
59-
libtbb-dev
49+
clang-18
50+
51+
# Standard packages install script.
52+
./install_apt_packages.sh
6053

6154
pip install -r requirements.txt
6255

.github/scripts/install_jammy_dependencies.sh

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,40 +2,32 @@
22

33
sudo apt update
44

5+
# Required packages specifically for the CI and not VTR in general.
56
sudo apt install -y \
67
autoconf \
78
automake \
89
bash \
9-
bison \
1010
binutils \
1111
binutils-gold \
12-
build-essential \
1312
capnproto \
1413
exuberant-ctags \
1514
curl \
1615
doxygen \
17-
flex \
1816
fontconfig \
1917
gdb \
20-
git \
2118
gperf \
2219
libcairo2-dev \
2320
libcapnp-dev \
24-
libgtk-3-dev \
2521
libevent-dev \
2622
libfontconfig1-dev \
2723
liblist-moreutils-perl \
2824
libncurses5-dev \
29-
libx11-dev \
3025
libxft-dev \
3126
libxml2-utils \
3227
libxml++2.6-dev \
33-
libreadline-dev \
3428
tcllib \
3529
tcl8.6-dev \
36-
libffi-dev \
3730
perl \
38-
pkg-config \
3931
texinfo \
4032
time \
4133
valgrind \
@@ -50,9 +42,10 @@ sudo apt install -y \
5042
g++-11 \
5143
gcc-11 \
5244
g++-12 \
53-
gcc-12 \
54-
clang-format-14 \
55-
libtbb-dev
45+
gcc-12
46+
47+
# Standard packages install script.
48+
./install_apt_packages.sh
5649

5750
pip install -r requirements.txt
5851

.github/workflows/nightly_test_manual.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,4 +112,5 @@ jobs:
112112
name: nightly_test_results
113113
path: |
114114
vtr_flow/**/*.log
115+
vtr_flow/**/vpr.out
115116
vtr_flow/**/parse_results*.txt

.github/workflows/test.yml

Lines changed: 67 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ jobs:
9999
run: ./dev/${{ matrix.script }}
100100

101101

102-
UniTests:
102+
UnitTests:
103103
name: 'U: C++ Unit Tests'
104104
runs-on: ubuntu-24.04
105105
steps:
@@ -125,36 +125,90 @@ jobs:
125125
run: ./.github/scripts/unittest.sh
126126

127127

128-
Warnings:
129-
name: 'W: Check Compilation Warnings'
128+
# This test builds different variations of VTR (with different CMake Params)
129+
# and ensures that they can run the basic regression tests. This also ensures
130+
# that these build variations are warning clean.
131+
BuildVariations:
130132
runs-on: ubuntu-24.04
133+
name: 'B: Build Variations'
134+
env:
135+
# For the CI, we want all build variations to be warning clean.
136+
# NOTE: Need to turn IPO off due to false warnings being produced.
137+
COMMON_CMAKE_PARAMS: '-DCMAKE_COMPILE_WARNING_AS_ERROR=on -DVTR_IPO_BUILD=off'
131138
steps:
132139

133140
- uses: actions/setup-python@v5
134141
with:
135142
python-version: 3.12.3
143+
136144
- uses: actions/checkout@v4
137145
with:
138146
submodules: 'true'
139147

140-
- name: Get number of CPU cores
148+
- name: 'Get number of CPU cores'
141149
uses: SimenB/github-actions-cpu-cores@v2
142150
id: cpu-cores
143151

144-
- name: Install dependencies
152+
- name: 'Install dependencies'
145153
run: ./.github/scripts/install_dependencies.sh
146154

147-
- uses: hendrikmuhs/[email protected]
155+
- name: 'ccache'
156+
uses: hendrikmuhs/[email protected]
148157

149-
- name: Test
158+
- name: 'Test with VTR_ASSERT_LEVEL 4'
159+
if: success() || failure()
150160
env:
151-
#In order to get compilation warnings produced per source file, we must do a non-IPO build
152-
#We also turn warnings into errors for this target by doing a strict compile
153-
CMAKE_PARAMS: "-DVTR_ASSERT_LEVEL=3 -DWITH_BLIFEXPLORER=on -DVTR_ENABLE_STRICT_COMPILE=on -DVTR_IPO_BUILD=off"
161+
CMAKE_PARAMS: "${{ env.COMMON_CMAKE_PARAMS }} -DVTR_ASSERT_LEVEL=4"
154162
NUM_PROC: ${{ steps.cpu-cores.outputs.count }}
155163
run: |
164+
rm -f build/CMakeCache.txt
156165
export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH"
157-
./.github/scripts/build.sh
166+
make -j${{ steps.cpu-cores.outputs.count}}
167+
./run_reg_test.py vtr_reg_basic -show_failures -j${{ steps.cpu-cores.outputs.count}}
168+
169+
- name: 'Test with NO_GRAPHICS'
170+
if: success() || failure()
171+
env:
172+
CMAKE_PARAMS: "${{ env.COMMON_CMAKE_PARAMS }} -DVPR_USE_EZGL=off"
173+
NUM_PROC: ${{ steps.cpu-cores.outputs.count }}
174+
run: |
175+
rm -f build/CMakeCache.txt
176+
export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH"
177+
make -j${{ steps.cpu-cores.outputs.count}}
178+
./run_reg_test.py vtr_reg_basic -show_failures -j${{ steps.cpu-cores.outputs.count}}
179+
180+
- name: 'Test with NO_SERVER'
181+
if: success() || failure()
182+
env:
183+
CMAKE_PARAMS: "${{ env.COMMON_CMAKE_PARAMS }} -DVPR_USE_SERVER=off"
184+
NUM_PROC: ${{ steps.cpu-cores.outputs.count }}
185+
run: |
186+
rm -f build/CMakeCache.txt
187+
export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH"
188+
make -j${{ steps.cpu-cores.outputs.count}}
189+
./run_reg_test.py vtr_reg_basic -show_failures -j${{ steps.cpu-cores.outputs.count}}
190+
191+
- name: 'Test with CAPNPROTO disabled'
192+
if: success() || failure()
193+
env:
194+
CMAKE_PARAMS: "${{ env.COMMON_CMAKE_PARAMS }} -DVTR_ENABLE_CAPNPROTO=off"
195+
NUM_PROC: ${{ steps.cpu-cores.outputs.count }}
196+
run: |
197+
rm -f build/CMakeCache.txt
198+
export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH"
199+
make -j${{ steps.cpu-cores.outputs.count}}
200+
./run_reg_test.py vtr_reg_basic -show_failures -j${{ steps.cpu-cores.outputs.count}}
201+
202+
- name: 'Test with serial VPR_EXECUTION_ENGINE'
203+
if: success() || failure()
204+
env:
205+
CMAKE_PARAMS: "${{ env.COMMON_CMAKE_PARAMS }} -DVPR_EXECUTION_ENGINE=serial -DTATUM_EXECUTION_ENGINE=serial"
206+
NUM_PROC: ${{ steps.cpu-cores.outputs.count }}
207+
run: |
208+
rm -f build/CMakeCache.txt
209+
export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH"
210+
make -j${{ steps.cpu-cores.outputs.count}}
211+
./run_reg_test.py vtr_reg_basic -show_failures -j${{ steps.cpu-cores.outputs.count}}
158212
159213
160214
Regression:
@@ -169,36 +223,12 @@ jobs:
169223
suite: 'vtr_reg_basic',
170224
extra_pkgs: ""
171225
},
172-
{
173-
name: 'Basic with highest assertion level',
174-
params: '-DCMAKE_COMPILE_WARNING_AS_ERROR=on -DVTR_IPO_BUILD=off -DVTR_ASSERT_LEVEL=4 -DWITH_BLIFEXPLORER=on',
175-
suite: 'vtr_reg_basic',
176-
extra_pkgs: ""
177-
},
178226
{
179227
name: 'Basic_odin',
180228
params: '-DCMAKE_COMPILE_WARNING_AS_ERROR=on -DVTR_IPO_BUILD=off -DVTR_ASSERT_LEVEL=3 -DWITH_BLIFEXPLORER=on -DWITH_PARMYS=OFF -DWITH_ODIN=on',
181229
suite: 'vtr_reg_basic_odin',
182230
extra_pkgs: ""
183231
},
184-
{
185-
name: 'Basic with NO_GRAPHICS',
186-
params: '-DCMAKE_COMPILE_WARNING_AS_ERROR=on -DVTR_IPO_BUILD=off -DVTR_ASSERT_LEVEL=3 -DWITH_BLIFEXPLORER=on -DVPR_USE_EZGL=off',
187-
suite: 'vtr_reg_basic',
188-
extra_pkgs: ""
189-
},
190-
{
191-
name: 'Basic with NO_SERVER',
192-
params: '-DVTR_ASSERT_LEVEL=3 -DWITH_BLIFEXPLORER=on -DVPR_USE_EZGL=on -DVPR_USE_SERVER=off',
193-
suite: 'vtr_reg_basic',
194-
extra_pkgs: ""
195-
},
196-
{
197-
name: 'Basic with CAPNPROTO disabled',
198-
params: '-DCMAKE_COMPILE_WARNING_AS_ERROR=on -DVTR_IPO_BUILD=off -DVTR_ASSERT_LEVEL=3 -DWITH_BLIFEXPLORER=on -DVTR_ENABLE_CAPNPROTO=off',
199-
suite: 'vtr_reg_basic',
200-
extra_pkgs: ""
201-
},
202232
{
203233
name: 'Basic with VTR_ENABLE_DEBUG_LOGGING',
204234
params: '-DCMAKE_COMPILE_WARNING_AS_ERROR=on -DVTR_IPO_BUILD=off -DVTR_ASSERT_LEVEL=3 -DWITH_BLIFEXPLORER=on -DVTR_ENABLE_DEBUG_LOGGING=on',
@@ -510,8 +540,8 @@ jobs:
510540
needs:
511541
- Build
512542
- Format
513-
- UniTests
514-
- Warnings
543+
- UnitTests
544+
- BuildVariations
515545
- Regression
516546
- Sanitized
517547
- Parmys

.readthedocs.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,4 @@ build:
2222
python:
2323
install:
2424
- requirements: doc/requirements.txt
25+
- requirements: requirements.txt

CMakeLists.txt

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ set_property(CACHE VTR_IPO_BUILD PROPERTY STRINGS auto on off)
2626
set(VTR_ASSERT_LEVEL "2" CACHE STRING "VTR assertion checking level. 0: no assertions, 1: fast assertions, 2: regular assertions, 3: additional assertions with noticeable run-time overhead, 4: all assertions (including those with significant run-time cost)")
2727
set_property(CACHE VTR_ASSERT_LEVEL PROPERTY STRINGS 0 1 2 3 4)
2828

29-
option(VTR_ENABLE_STRICT_COMPILE "Specifies whether compiler warnings should be treated as errors (e.g. -Werror)" OFF)
3029
option(VTR_ENABLE_SANITIZE "Enable address/leak/undefined-behaviour sanitizers (i.e. run-time error checking)" OFF)
3130
option(VTR_ENABLE_PROFILING "Enable performance profiler (gprof)" OFF)
3231
option(VTR_ENABLE_COVERAGE "Enable code coverage tracking (gcov)" OFF)
@@ -42,9 +41,6 @@ option(VTR_ENABLE_CAPNPROTO "Enable capnproto binary serialization support in VP
4241
#Allow the user to decide whether to compile the server module
4342
option(VPR_USE_SERVER "Specify whether vpr enables the server mode" ON)
4443

45-
#Allow the user to enable/disable VPR analytic placement
46-
#VPR option --enable_analytic_placer is also required for Analytic Placement
47-
option(VPR_ANALYTIC_PLACE "Enable analytic placement in VPR." ON)
4844
option(VPR_ENABLE_INTERCHANGE "Enable FPGA interchange." ON)
4945
option(VPR_ENABLE_NOC_SAT_ROUTING "Enable NoC SAT routing." OFF)
5046

Dockerfile

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,18 +11,15 @@ ENV PIP_BREAK_SYSTEM_PACKAGES=1
1111
# Install and cleanup is done in one command to minimize the build cache size
1212
RUN apt-get update -qq \
1313
# Extract package names from install_apt_packages.sh
14-
&& sed '/sudo/d' install_apt_packages.sh | sed '/#/d' | sed 's/ \\//g' | sed '/^$/d' | sed '/^[[:space:]]*$/d' \
14+
&& sed '/sudo/d' install_apt_packages.sh | sed '/#/d' | sed '/if\s.*then$/d' | sed '/else$/d' | sed '/fi$/d' | sed '/echo\s/d' | sed 's/ \\//g' | sed '/^$/d' | sed '/^[[:space:]]*$/d' | sed 's/\s//g' \
1515
# Install packages
1616
| xargs apt-get -y install --no-install-recommends \
1717
# Additional packages not listed in install_apt_packages.sh
1818
&& apt-get -y install --no-install-recommends \
1919
wget \
2020
ninja-build \
21-
default-jre \
2221
libeigen3-dev \
23-
libtbb-dev \
2422
python3-pip \
25-
git \
2623
time \
2724
# Install python packages
2825
&& pip install -r requirements.txt \

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ override CMAKE_PARAMS := -DCMAKE_BUILD_TYPE=$(CMAKE_BUILD_TYPE) -G 'Unix Makefil
4040
#Are we doing a strict (i.e. warnings as errors) build?
4141
ifneq (,$(findstring strict,$(BUILD_TYPE)))
4242
#Configure for strict build with VPR warning treated as errors
43-
override CMAKE_PARAMS := -DVTR_ENABLE_STRICT_COMPILE=on ${CMAKE_PARAMS}
43+
override CMAKE_PARAMS := -DCMAKE_COMPILE_WARNING_AS_ERROR=on ${CMAKE_PARAMS}
4444
endif #Strict build type
4545

4646
#Enable verbosity

README.developers.md

Lines changed: 31 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,29 @@ For large scale reformatting (should only be performed by VTR maintainers) the s
179179

180180
Python files are automatically checked using `pylint` to ensure they follow established Python conventions. You can run `pylint` on the entire repository by running `./dev/pylint_check.py`. Certain files which were created before we adopted Python lint checking are grandfathered and are not checked. To check *all* files, provide the `--check_grandfathered` argument. You can also manually check individual files using `./dev/pylint_check.py <path_to_file1> <path_to_file2> ...`.
181181

182+
# Sanitizing Includes
183+
184+
You can use include-what-you-use or the clangd language server to make sure includes are correct and you don't have missing or unused includes.
185+
186+
## include-what-you-use
187+
188+
First, install include-what-you-use. Ubuntu/Debian users can run `sudo apt install iwyu` and Fedora/RHEL users can run `sudo dnf install iwyu`. You can then compile VTR with include-what-you-use enabled to get diagnostic messages about includes in all files with the following command:
189+
190+
```
191+
make CMAKE_PARAMS="-DCMAKE_CXX_INCLUDE_WHAT_YOU_USE=include-what-you-use"
192+
```
193+
194+
Note that this method checks all source files and the diagnostic messages can be very long.
195+
196+
## clangd language server
197+
198+
Alternatively, if your editor supports clangd, you can use it to get diagnostic messages for the specific file you are working with. Visual Studio Code users can use the clangd extension to use clangd instead of Microsoft's C/C++ extension. To enable include diagnostics, create a file named `.clangd` in VTR root directory and add the following lines to it:
199+
```
200+
Diagnostics:
201+
UnusedIncludes: Strict
202+
MissingIncludes: Strict
203+
```
204+
182205
# Running Tests
183206

184207
VTR has a variety of tests which are used to check for correctness, performance and Quality of Result (QoR).
@@ -1108,11 +1131,17 @@ All tests passed (1 assertion in 1 test case)
11081131
VTR has support for several additional tools/features to aid debugging.
11091132

11101133
## Basic
1111-
To build vpr with make in debug mode, simply add `BUILD_TYPE=debug` at the end of your make command.
1134+
To build a tool with make in debug mode, simply add `BUILD_TYPE=debug` at the end of your make command. For example, to build all tools in debug mode use:
11121135
```shell
1113-
$ make vpr BUILD_TYPE=debug
1136+
$ make BUILD_TYPE=debug
11141137
```
11151138

1139+
You can also enable additional (verbose) output from some tools. To build vpr with both debug information and additional output, use:
1140+
```shell
1141+
$ make vpr BUILD_TYPE=debug VERBOSE=1
1142+
```
1143+
1144+
11161145
## Sanitizers
11171146
VTR can be compiled using *sanitizers* which will detect invalid memory accesses, memory leaks and undefined behaviour (supported by both GCC and LLVM):
11181147
```shell

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,15 +36,15 @@ See the [full license](LICENSE.md) for details.
3636
## How to Cite
3737
The following paper may be used as a general citation for VTR:
3838

39-
K. E. Murray, O. Petelin, S. Zhong, J. M. Wang, M. ElDafrawy, J.-P. Legault, E. Sha, A. G. Graham, J. Wu, M. J. P. Walker, H. Zeng, P. Patros, J. Luu, K. B. Kent and V. Betz "VTR 8: High Performance CAD and Customizable FPGA Architecture Modelling", ACM TRETS, 2020.
39+
M. A. Elgammal, A. Mohaghegh, S. G. Shahrouz, F. Mahmoudi, F. Kosar, K. Talaei, J. Fife, D. Khadivi, K. Murray, A. Boutros, K. B. Kent, J. Goeders, and V. Betz "VTR 9: Open-Source CAD for Fabric and Beyond FPGA Architecture Exploration", ACM TRETS, 2025. [PDF](https://dl.acm.org/doi/epdf/10.1145/3734798)
4040

4141
Bibtex:
4242
```
43-
@article{vtr8,
44-
title={VTR 8: High Performance CAD and Customizable FPGA Architecture Modelling},
45-
author={Murray, Kevin E. and Petelin, Oleg and Zhong, Sheng and Wang, Jai Min and ElDafrawy, Mohamed and Legault, Jean-Philippe and Sha, Eugene and Graham, Aaron G. and Wu, Jean and Walker, Matthew J. P. and Zeng, Hanqing and Patros, Panagiotis and Luu, Jason and Kent, Kenneth B. and Betz, Vaughn},
43+
@article{vtr9,
44+
title={VTR 9: Open-Source CAD for Fabric and Beyond FPGA Architecture Exploration},
45+
author={Elgammal, Mohamed A. and Mohaghegh, Amin and Shahrouz, Soheil G. and Mahmoudi, Fatemehsadat and Kosar, Fahrican and Talaei, Kimia and Fife, Joshua and Khadivi, Daniel and Murray, Kevin and Boutros, Andrew and Kent, Kenneth B. and Goeders, Jeff and Betz, Vaughn},
4646
journal={ACM Trans. Reconfigurable Technol. Syst.},
47-
year={2020}
47+
year={2025}
4848
}
4949
```
5050

0 commit comments

Comments
 (0)