Skip to content

Commit 51bd666

Browse files
authored
Merge branch 'master' into openfpga
2 parents 9eef18c + 36ed2b2 commit 51bd666

File tree

164 files changed

+245081
-7543
lines changed

Some content is hidden

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

164 files changed

+245081
-7543
lines changed

.github/workflows/nightly_test.yml

Lines changed: 110 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
1+
name: NightlyTest
2+
3+
on:
4+
# We want to run the CI when anything is pushed to master.
5+
# Since master is a protected branch this only happens when a PR is merged.
6+
# This is a double check in case the PR was stale and had some issues.
7+
push:
8+
branches:
9+
- master
10+
paths-ignore: # Prevents from running if only docs are updated
11+
- 'doc/**'
12+
- '**/*README*'
13+
- '**.md'
14+
- '**.rst'
15+
pull_request:
16+
paths-ignore: # Prevents from running if only docs are updated
17+
- 'doc/**'
18+
- '**/*README*'
19+
- '**.md'
20+
- '**.rst'
21+
workflow_dispatch:
22+
schedule:
23+
- cron: '0 0 * * *' # daily
24+
25+
# We want to cancel previous runs for a given PR or branch / ref if another CI
26+
# run is requested.
27+
# See: https://docs.github.com/en/actions/using-jobs/using-concurrency
28+
concurrency:
29+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
30+
cancel-in-progress: true
31+
32+
env:
33+
# default compiler for all non-compatibility tests
34+
MATRIX_EVAL: "CC=gcc-11 && CXX=g++-11"
35+
36+
jobs:
37+
Run-tests:
38+
# Prevents from running on forks where no custom runners are available
39+
if: ${{ github.repository_owner == 'verilog-to-routing' }}
40+
41+
timeout-minutes: 420
42+
43+
container: ubuntu:jammy
44+
45+
runs-on: [self-hosted, Linux, X64]
46+
47+
strategy:
48+
fail-fast: false
49+
matrix:
50+
include:
51+
- {test: "vtr_reg_nightly_test1", cores: "16", options: "", cmake: "", extra_pkgs: ""}
52+
- {test: "vtr_reg_nightly_test1_odin", cores: "16", options: "", cmake: "-DWITH_ODIN=ON", extra_pkgs: ""}
53+
- {test: "vtr_reg_nightly_test2", cores: "16", options: "", cmake: "", extra_pkgs: ""}
54+
- {test: "vtr_reg_nightly_test2_odin", cores: "16", options: "", cmake: "-DWITH_ODIN=ON", extra_pkgs: ""}
55+
- {test: "vtr_reg_nightly_test3", cores: "16", options: "", cmake: "", extra_pkgs: ""}
56+
- {test: "vtr_reg_nightly_test3_odin", cores: "16", options: "", cmake: "-DWITH_ODIN=ON", extra_pkgs: ""}
57+
- {test: "vtr_reg_nightly_test4", cores: "16", options: "", cmake: "", extra_pkgs: ""}
58+
- {test: "vtr_reg_nightly_test4_odin", cores: "16", options: "", cmake: "-DWITH_ODIN=ON", extra_pkgs: ""}
59+
- {test: "vtr_reg_nightly_test5", cores: "16", options: "", cmake: "", extra_pkgs: ""}
60+
- {test: "vtr_reg_nightly_test6", cores: "16", options: "", cmake: "", extra_pkgs: ""}
61+
- {test: "vtr_reg_nightly_test7", cores: "16", options: "", cmake: "", extra_pkgs: ""}
62+
- {test: "vtr_reg_strong", cores: "16", options: "", cmake: "-DVTR_ASSERT_LEVEL=3", extra_pkgs: "libeigen3-dev"}
63+
- {test: "vtr_reg_strong_odin", cores: "16", options: "", cmake: "-DVTR_ASSERT_LEVEL=3 -DWITH_ODIN=ON", extra_pkgs: "libeigen3-dev"}
64+
- {test: "vtr_reg_strong_odin", cores: "16", options: "-skip_qor", cmake: "-DVTR_ASSERT_LEVEL=3 -DVTR_ENABLE_SANITIZE=ON -DWITH_ODIN=ON", extra_pkgs: "libeigen3-dev"}
65+
- {test: "vtr_reg_system_verilog", cores: "16", options: "", cmake: "-DYOSYS_F4PGA_PLUGINS=ON", extra_pkgs: ""}
66+
- {test: "odin_reg_strong", cores: "16", options: "", cmake: "-DWITH_ODIN=ON", extra_pkgs: ""}
67+
- {test: "parmys_reg_strong", cores: "16", options: "", cmake: "-DYOSYS_F4PGA_PLUGINS=ON", extra_pkgs: ""}
68+
69+
env:
70+
DEBIAN_FRONTEND: "noninteractive"
71+
72+
steps:
73+
74+
# TODO: This runnner is running on a self-hosted CPU. In order to upgrade
75+
# to v4, need to upgrade the machine to support node20.
76+
- uses: actions/checkout@v3
77+
with:
78+
submodules: 'true'
79+
80+
- name: Setup
81+
run: stdbuf -i0 -i0 -e0 ./.github/scripts/hostsetup.sh
82+
83+
- name: Install external libraries
84+
run: apt install -y ${{ matrix.extra_pkgs }}
85+
if: ${{ matrix.extra_pkgs }}
86+
87+
- name: Execute test script
88+
run: stdbuf -i0 -o0 -e0 ./.github/scripts/run-vtr.sh
89+
env:
90+
VPR_NUM_WORKERS: 4
91+
VTR_TEST: ${{ matrix.test }}
92+
VTR_TEST_OPTIONS: ${{ matrix.options }}
93+
VTR_CMAKE_PARAMS: ${{ matrix.cmake }}
94+
NUM_CORES: ${{ matrix.cores }}
95+
96+
- name: Upload test results
97+
# If the job was not cancelled, we want to save the result (this includes
98+
# when the job fails). See warning here:
99+
# https://docs.github.com/en/actions/learn-github-actions/expressions#always
100+
if: ${{ !cancelled() }}
101+
# TODO: This runnner is running on a self-hosted CPU. In order to upgrade
102+
# to v4, need to upgrade the machine to support node20.
103+
uses: actions/upload-artifact@v3
104+
with:
105+
name: ${{matrix.test}}_test_results
106+
path: |
107+
**/results*.gz
108+
**/plot_*.svg
109+
**/qor_results*.tar.gz
110+

.github/workflows/test.yml

Lines changed: 0 additions & 77 deletions
Original file line numberDiff line numberDiff line change
@@ -34,83 +34,6 @@ env:
3434
MATRIX_EVAL: "CC=gcc-11 && CXX=g++-11"
3535

3636
jobs:
37-
38-
39-
Run-tests:
40-
# Prevents from running on forks where no custom runners are available
41-
if: ${{ github.repository_owner == 'verilog-to-routing' }}
42-
43-
timeout-minutes: 420
44-
45-
container: ubuntu:jammy
46-
47-
runs-on: [self-hosted, Linux, X64]
48-
49-
strategy:
50-
fail-fast: false
51-
matrix:
52-
include:
53-
- {test: "vtr_reg_nightly_test1", cores: "16", options: "", cmake: "", extra_pkgs: ""}
54-
- {test: "vtr_reg_nightly_test1_odin", cores: "16", options: "", cmake: "-DWITH_ODIN=ON", extra_pkgs: ""}
55-
- {test: "vtr_reg_nightly_test2", cores: "16", options: "", cmake: "", extra_pkgs: ""}
56-
- {test: "vtr_reg_nightly_test2_odin", cores: "16", options: "", cmake: "-DWITH_ODIN=ON", extra_pkgs: ""}
57-
- {test: "vtr_reg_nightly_test3", cores: "16", options: "", cmake: "", extra_pkgs: ""}
58-
- {test: "vtr_reg_nightly_test3_odin", cores: "16", options: "", cmake: "-DWITH_ODIN=ON", extra_pkgs: ""}
59-
- {test: "vtr_reg_nightly_test4", cores: "16", options: "", cmake: "", extra_pkgs: ""}
60-
- {test: "vtr_reg_nightly_test4_odin", cores: "16", options: "", cmake: "-DWITH_ODIN=ON", extra_pkgs: ""}
61-
- {test: "vtr_reg_nightly_test5", cores: "16", options: "", cmake: "", extra_pkgs: ""}
62-
- {test: "vtr_reg_nightly_test6", cores: "16", options: "", cmake: "", extra_pkgs: ""}
63-
- {test: "vtr_reg_nightly_test7", cores: "16", options: "", cmake: "", extra_pkgs: ""}
64-
- {test: "vtr_reg_strong", cores: "16", options: "", cmake: "-DVTR_ASSERT_LEVEL=3", extra_pkgs: "libeigen3-dev"}
65-
- {test: "vtr_reg_strong_odin", cores: "16", options: "", cmake: "-DVTR_ASSERT_LEVEL=3 -DWITH_ODIN=ON", extra_pkgs: "libeigen3-dev"}
66-
- {test: "vtr_reg_strong_odin", cores: "16", options: "-skip_qor", cmake: "-DVTR_ASSERT_LEVEL=3 -DVTR_ENABLE_SANITIZE=ON -DWITH_ODIN=ON", extra_pkgs: "libeigen3-dev"}
67-
- {test: "vtr_reg_system_verilog", cores: "16", options: "", cmake: "-DYOSYS_F4PGA_PLUGINS=ON", extra_pkgs: ""}
68-
- {test: "odin_reg_strong", cores: "16", options: "", cmake: "-DWITH_ODIN=ON", extra_pkgs: ""}
69-
- {test: "parmys_reg_strong", cores: "16", options: "", cmake: "-DYOSYS_F4PGA_PLUGINS=ON", extra_pkgs: ""}
70-
71-
env:
72-
DEBIAN_FRONTEND: "noninteractive"
73-
74-
steps:
75-
76-
# TODO: This runnner is running on a self-hosted CPU. In order to upgrade
77-
# to v4, need to upgrade the machine to support node20.
78-
- uses: actions/checkout@v3
79-
with:
80-
submodules: 'true'
81-
82-
- name: Setup
83-
run: stdbuf -i0 -i0 -e0 ./.github/scripts/hostsetup.sh
84-
85-
- name: Install external libraries
86-
run: apt install -y ${{ matrix.extra_pkgs }}
87-
if: ${{ matrix.extra_pkgs }}
88-
89-
- name: Execute test script
90-
run: stdbuf -i0 -o0 -e0 ./.github/scripts/run-vtr.sh
91-
env:
92-
VPR_NUM_WORKERS: 4
93-
VTR_TEST: ${{ matrix.test }}
94-
VTR_TEST_OPTIONS: ${{ matrix.options }}
95-
VTR_CMAKE_PARAMS: ${{ matrix.cmake }}
96-
NUM_CORES: ${{ matrix.cores }}
97-
98-
- name: Upload test results
99-
# If the job was not cancelled, we want to save the result (this includes
100-
# when the job fails). See warning here:
101-
# https://docs.github.com/en/actions/learn-github-actions/expressions#always
102-
if: ${{ !cancelled() }}
103-
# TODO: This runnner is running on a self-hosted CPU. In order to upgrade
104-
# to v4, need to upgrade the machine to support node20.
105-
uses: actions/upload-artifact@v3
106-
with:
107-
name: ${{matrix.test}}_test_results
108-
path: |
109-
**/results*.gz
110-
**/plot_*.svg
111-
**/qor_results*.tar.gz
112-
113-
11437
Build:
11538
name: 'B: Building VtR'
11639
runs-on: ubuntu-22.04

BUILDING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ If you download a different version of those tools, then those versions may not
4646

4747
To verfiy that VTR has been installed correctly run::
4848

49-
./vtr_flow/scripts/run_vtr_task.py regression_tests/vtr_reg_basic/basic_timing
49+
./vtr_flow/scripts/run_vtr_task.py ./vtr_flow/tasks/regression_tests/vtr_reg_basic/basic_timing
5050

5151
The expected output is::
5252

README.developers.md

Lines changed: 73 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1272,47 +1272,96 @@ make CMAKE_PARAMS="-DVTR_IPO_BUILD=off" -j8 vpr
12721272

12731273
# Profiling VTR
12741274

1275-
1. Install `gprof`, `gprof2dot`, and `xdot`. Specifically, the previous two packages require python3, and you should install the last one with `sudo apt install` for all the dependencies you will need for visualizing your profile results.
1275+
## Use GNU Profiler gprof
1276+
1277+
1. **Installation**: Install `gprof`, `gprof2dot`, and `xdot` (optional).
1278+
1. `gprof` is part of [GNU Binutils](https://www.gnu.org/software/binutils/), which is a commonly-installed package alongside the standard GCC package on most systems. `gprof` should already exist. If not, use `sudo apt install binutils`.
1279+
2. `gprof2dot` requires python3 or conda. You can install with `pip3 install gprof2dot` or `conda install -c conda-forge gprof2dot`.
1280+
3. `xdot` is optional. To install it, use `sudo apt install`.
12761281
```
1277-
pip3 install gprof
1282+
sudo apt install binutils
12781283
pip3 install gprof2dot
1279-
sudo apt install xdot
1284+
sudo apt install xdot # optional
12801285
```
12811286

12821287
Contact your administrator if you do not have the `sudo` rights.
12831288

1284-
2. Use the CMake option below to enable VPR profiler build.
1289+
2. **VPR build**: Use the CMake option below to enable VPR profiler build.
12851290
```
12861291
make CMAKE_PARAMS="-DVTR_ENABLE_PROFILING=ON" vpr
12871292
```
12881293

1289-
3. With the profiler build, each time you run the VTR flow script, it will produce an extra file `gmon.out` that contains the raw profile information.
1290-
Run `gprof` to parse this file. You will need to specify the path to the VPR executable.
1294+
3. **Profiling**:
1295+
1. With the profiler build, each time you run the VTR flow script, it will produce an extra file `gmon.out` that contains the raw profile information. Run `gprof` to parse this file. You will need to specify the path to the VPR executable.
1296+
```
1297+
gprof $VTR_ROOT/vpr/vpr gmon.out > gprof.txt
1298+
```
1299+
1300+
2. Next, use `gprof2dot` to transform the parsed results to a `.dot` file (Graphviz graph description), which describes the graph of your final profile results. If you encounter long function names, specify the `-s` option for a cleaner graph. For other useful options, please refer to its [online documentation](https://github.com/jrfonseca/gprof2dot?tab=readme-ov-file#documentation).
1301+
```
1302+
gprof2dot -s gprof.txt > vpr.dot
1303+
```
1304+
1305+
- Note: You can chain the above commands to directly produce the `.dot` file:
1306+
```
1307+
gprof $VTR_ROOT/vpr/vpr gmon.out | gprof2dot -s > vpr.dot
1308+
```
1309+
1310+
4. **Visualization**:
1311+
- **Option 1** (Recommended): Use the [Edotor](https://edotor.net/) online Graphviz visualizer.
1312+
1. Open a browser and go to [https://edotor.net/](https://edotor.net/) (on any device, not necessarily the one where VPR is running).
1313+
2. Choose `dot` as the "Engine" at the top navigation bar.
1314+
3. Next, copy and paste `vpr.dot` into the editor space on the left side of the web view.
1315+
4. Then, you can interactively (i.e., pan and zoom) view the results and download an SVG or PNG image.
1316+
- **Option 2**: Use the locally-installed `xdot` visualization tool.
1317+
1. Use `xdot` to view your results:
1318+
```
1319+
xdot vpr.dot
1320+
```
1321+
2. To save your results as a PNG file:
1322+
```
1323+
dot -Tpng -Gdpi=300 vpr.dot > vpr.png
1324+
```
1325+
Note that you can use the `-Gdpi` option to make your picture clearer if you find the default dpi settings not clear enough.
1326+
1327+
## Use Linux Perf Tool
1328+
1329+
1. **Installation**: Install `perf` and `gprof2dot` (optional).
12911330
```
1292-
gprof $VTR_ROOT/vpr/vpr gmon.out > gprof.txt
1331+
sudo apt install linux-tools-common linux-tools-generic
1332+
pip3 install gprof2dot # optional
12931333
```
12941334

1295-
4. Next, use `gprof2dot` to transform the parsed results to a `.dot` file, which describes the graph of your final profile results. If you encounter long function names, specify the `-s` option for a cleaner graph.
1335+
2. **VPR build**: *No need* to enable any CMake options for using `perf`, unless you want to utilize specific features, such as `perf annotate`.
12961336
```
1297-
gprof2dot -s gprof.txt > vpr.dot
1337+
make vpr
12981338
```
12991339

1300-
5. You can chain the above commands to directly produce the `.dot` file:
1301-
```
1302-
gprof $VTR_ROOT/vpr/vpr gmon.out | gprof2dot -s > vpr.dot
1303-
```
1340+
3. **Profiling**: `perf` needs to know the process ID (i.e., pid) of the running VPR you want to monitor and profile, which can be obtained using the Linux command `top -u <username>`.
1341+
- **Option 1**: Real-time analysis
1342+
```
1343+
sudo perf top -p <vpr pid>
1344+
```
1345+
- **Option 2** (Recommended): Record and offline analysis
1346+
1347+
Use `perf record` to record the profile data and the call graph. (Note: The argument `lbr` for `--call-graph` only works on Intel platforms. If you encounter issues with call graph recording, please refer to the [`perf record` manual](https://perf.wiki.kernel.org/index.php/Latest_Manual_Page_of_perf-record.1) for more information.)
1348+
```
1349+
sudo perf record --call-graph lbr -p <vpr pid>
1350+
```
1351+
After VPR completes its run, or if you stop `perf` with CTRL+C (if you are focusing on a specific portion of the VPR execution), the `perf` tool will produce an extra file `perf.data` containing the raw profile results in the directory where you ran `perf`. You can further analyze the results by parsing this file using `perf report`.
1352+
```
1353+
sudo perf report -i perf.data
1354+
```
1355+
- Note 1: The official `perf` [wiki](https://perf.wiki.kernel.org/index.php/Main_Page) and [tutorial](https://perf.wiki.kernel.org/index.php/Tutorial) are highly recommended for those who want to explore more uses of the tool.
1356+
- Note 2: It is highly recommended to run `perf` with `sudo`, but you can find a workaround [here](https://superuser.com/questions/980632/run-perf-without-root-rights) to allow running `perf` without root rights.
1357+
- Note 3: You may also find [Hotspot](https://github.com/KDAB/hotspot) useful if you want to run `perf` with GUI support.
1358+
1359+
4. **Visualization** (optional): If you want a better illustration of the profiling results, first run the following command to transform the `perf` report into a Graphviz dot graph. The remaining steps are exactly the same as those described under [Use GNU Profiler gprof
1360+
](#use-gnu-profiler-gprof).
1361+
```
1362+
perf script -i perf.data | c++filt | gprof2dot.py -f perf -s > vpr.dot
1363+
```
13041364

1305-
6. Use `xdot` to view your results:
1306-
```
1307-
xdot vpr.dot
1308-
```
1309-
1310-
7. To save your results as a `png` file:
1311-
```
1312-
dot -Tpng -Gdpi=300 vpr.dot > vpr.png
1313-
```
1314-
1315-
Note that you can use the `-Gdpi` option to make your picture clearer if you find the default dpi settings not clear enough.
13161365

13171366
# External Subtrees
13181367
VTR includes some code which is developed in external repositories, and is integrated into the VTR source tree using [git subtrees](https://www.atlassian.com/blog/git/alternatives-to-git-submodule-git-subtree).

doc/src/api/vpr/grid.rst

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
========
2+
Grid
3+
========
4+
5+
DeviceGrid
6+
-------
7+
8+
.. doxygenclass:: DeviceGrid
9+
:project: vpr
10+
:members:

doc/src/api/vpr/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ VPR API
77
:maxdepth: 1
88

99
contexts
10+
grid
1011
mapping
1112
netlist
1213
route_tree

doc/src/api/vpr/rr_graph.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,3 +35,9 @@ RRSpatialLookup
3535
:project: librrgraph
3636
:members:
3737

38+
rr_graph_utils
39+
---------------
40+
41+
.. doxygenfile:: rr_graph_utils.h
42+
:project: librrgraph
43+
:sections: briefdescription detaileddescription func prototype user-defined public-func
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
==============
2+
Router Lookahead
3+
==============
4+
5+
e_router_lookahead
6+
----------
7+
.. doxygenenum:: e_router_lookahead
8+
:project: vpr
9+
10+
11+
RouterLookahead
12+
----------
13+
.. doxygenclass:: RouterLookahead
14+
:project: vpr
15+
:members:
16+
17+
MapLookahead
18+
----------
19+
.. doxygenclass:: MapLookahead
20+
:project: vpr
21+
22+
make_router_lookahead
23+
----------
24+
.. doxygenfunction:: make_router_lookahead
25+
:project: vpr
26+
27+
get_cached_router_lookahead
28+
----------
29+
.. doxygenfunction:: get_cached_router_lookahead
30+
:project: vpr
31+
32+
invalidate_router_lookahead_cache
33+
----------
34+
.. doxygenfunction:: invalidate_router_lookahead_cache
35+
:project: vpr

doc/src/api/vprinternals/vpr_router.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,5 @@ VPR Router
77
.. toctree::
88
:maxdepth: 1
99

10-
router_heap
10+
router_heap
11+
router_lookahead

0 commit comments

Comments
 (0)