Skip to content

Commit a48ed5f

Browse files
Merge branch 'master' into diff_switches_for_inc_dec_wires
2 parents ba408fd + 843df0a commit a48ed5f

File tree

36 files changed

+1098
-648
lines changed

36 files changed

+1098
-648
lines changed

.github/workflows/nightly_test.yml

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

.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

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

libs/libarchfpga/src/device_grid.h

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
#include <cmath>
77
#include "vtr_ndmatrix.h"
88
#include "physical_types.h"
9+
#include "vtr_geometry.h"
910

1011
/**
1112
* @brief s_grid_tile is the minimum tile of the fpga
@@ -73,6 +74,18 @@ class DeviceGrid {
7374
return grid_[tile_loc.layer_num][tile_loc.x][tile_loc.y].height_offset;
7475
}
7576

77+
///@brief Returns a rectangle which represents the bounding box of the tile at the given location.
78+
inline vtr::Rect<int> get_tile_bb(const t_physical_tile_loc& tile_loc) const {
79+
t_physical_tile_type_ptr tile_type = get_physical_type(tile_loc);
80+
81+
int tile_xlow = tile_loc.x - get_width_offset(tile_loc);
82+
int tile_ylow = tile_loc.y - get_height_offset(tile_loc);
83+
int tile_xhigh = tile_xlow + tile_type->width - 1;
84+
int tile_yhigh = tile_ylow + tile_type->height - 1;
85+
86+
return {{tile_xlow, tile_ylow}, {tile_xhigh, tile_yhigh}};
87+
}
88+
7689
///@brief Return the metadata of the tile at the specified location
7790
inline const t_metadata_dict* get_metadata(const t_physical_tile_loc& tile_loc) const {
7891
return grid_[tile_loc.layer_num][tile_loc.x][tile_loc.y].meta;

libs/librrgraph/src/base/check_rr_graph.cpp

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
#include "physical_types_util.h"
1010

1111
#include "describe_rr_node.h"
12+
#include "rr_graph_utils.h"
1213

1314
/*********************** Subroutines local to this module *******************/
1415

@@ -389,16 +390,29 @@ void check_rr_node(const RRGraphView& rr_graph,
389390

390391
switch (rr_type) {
391392
case SOURCE:
392-
case SINK:
393393
if (type == nullptr) {
394394
VPR_FATAL_ERROR(VPR_ERROR_ROUTE,
395395
"in check_rr_node: node %d (type %d) is at an illegal clb location (%d, %d).\n", inode, rr_type, xlow, ylow);
396396
}
397+
397398
if (xlow != (xhigh - type->width + 1) || ylow != (yhigh - type->height + 1)) {
398399
VPR_FATAL_ERROR(VPR_ERROR_ROUTE,
399400
"in check_rr_node: node %d (type %d) has endpoints (%d,%d) and (%d,%d)\n", inode, rr_type, xlow, ylow, xhigh, yhigh);
400401
}
401402
break;
403+
case SINK: {
404+
if (type == nullptr) {
405+
VPR_FATAL_ERROR(VPR_ERROR_ROUTE,
406+
"in check_rr_node: node %d (type %d) is at an illegal clb location (%d, %d).\n", inode, rr_type, xlow, ylow);
407+
}
408+
409+
vtr::Rect<int> tile_bb = grid.get_tile_bb({xlow, ylow, layer_num});
410+
if (xlow < tile_bb.xmin() || ylow < tile_bb.ymin() || xhigh > tile_bb.xmax() || yhigh > tile_bb.ymax()) {
411+
VPR_FATAL_ERROR(VPR_ERROR_ROUTE,
412+
"in check_rr_node: node %d (type %d) has endpoints (%d,%d) and (%d,%d), which is outside the bounds of the grid tile containing it.\n", inode, rr_type, xlow, ylow, xhigh, yhigh);
413+
}
414+
break;
415+
}
402416
case IPIN:
403417
case OPIN:
404418
if (type == nullptr) {

0 commit comments

Comments
 (0)