Skip to content

Commit f8a002d

Browse files
committed
Merge branch 'master' of https://github.com/verilog-to-routing/vtr-verilog-to-routing into placement_search_range
2 parents 59a08eb + 0391d48 commit f8a002d

File tree

198 files changed

+1503
-4097
lines changed

Some content is hidden

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

198 files changed

+1503
-4097
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

CMakeLists.txt

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,6 @@ option(VTR_ENABLE_CAPNPROTO "Enable capnproto binary serialization support in VP
4242
#Allow the user to decide whether to compile the server module
4343
option(VPR_USE_SERVER "Specify whether vpr enables the server mode" ON)
4444

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)
4845
option(VPR_ENABLE_INTERCHANGE "Enable FPGA interchange." ON)
4946
option(VPR_ENABLE_NOC_SAT_ROUTING "Enable NoC SAT routing." OFF)
5047

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 \

README.developers.md

Lines changed: 23 additions & 0 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).

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ 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-
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. Geoders, and V. Betz "VTR 9: Open-Source CAD for Fabric and Beyond FPGA Architecture Exploration", ACM TRETS, 2025.
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
```

doc/src/vpr/command_line_usage.rst

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,12 @@ General Options
223223

224224
If this option is not specified it may be set from the ``VPR_NUM_WORKERS`` environment variable; otherwise the default is used.
225225

226+
If this option is set to something other than 1, the following algorithms can be run in parallel:
227+
228+
* Timing Analysis
229+
* Routing (If routing algorithm is set to parallel or parallel_decomp; See :option:`--router_algorithm`)
230+
* Portions of analytical placement (If using the analytical placement flow and compiled VPR with Eigen enabled; See :option:`--analytical_place`)
231+
226232
.. note:: To compile VPR to allow the usage of parallel workers, ``libtbb-dev`` must be installed in the system.
227233

228234
**Default:** ``1``
@@ -1517,6 +1523,35 @@ VPR uses a negotiated congestion algorithm (based on Pathfinder) to perform rout
15171523
* `swns` - setup Worst Negative Slack (sWNS) [ns]
15181524
* `stns` - Setup Total Negative Slack (sTNS) [ns]
15191525

1526+
1527+
.. option:: --generate_net_timing_report {on | off}
1528+
1529+
Generates a report that lists the bounding box, slack, and delay of every routed connection in a design in CSV format (``report_net_timing.csv``). Each row in the CSV corresponds to a single net.
1530+
1531+
The report can later be used by other tools to enable further optimizations. For example, the Synopsys synthesis tool (Synplify) can use this information to re-synthesize the design and improve the Quality of Results (QoR).
1532+
1533+
Fields in the report are:
1534+
1535+
.. code-block:: none
1536+
1537+
netname : The name assigned to the net in the atom netlist
1538+
Fanout : Net's fanout (number of sinks)
1539+
bb_xmin : X coordinate of the net's bounding box's bottom-left corner
1540+
bb_ymin : Y coordinate of the net's bounding box's bottom-left corner
1541+
bb_layer_min : Lowest layer number of the net's bounding box
1542+
bb_xmax : X coordinate of the net's bounding box's top-right corner
1543+
bb_ymax : Y coordinate of the net's bounding box's top-right corner
1544+
bb_layer_max : Highest layer number of the net's bounding box
1545+
src_pin_name : Name of the net's source pin
1546+
src_pin_slack : Setup slack of the net's source pin
1547+
sinks : A semicolon-separated list of sink pin entries, each in the format:
1548+
<sink_pin_name>,<sink_pin_slack>,<sink_pin_delay>
1549+
1550+
Example value for the ``sinks`` field:
1551+
``"U2.B,0.12,0.5;U3.C,0.10,0.6;U4.D,0.08,0.7"``
1552+
1553+
**Default:** ``off``
1554+
15201555
.. option:: --route_verbosity <int>
15211556

15221557
Controls the verbosity of routing output.

doc/src/zreferences.rst

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,18 @@
11
Publications & References
22
=========================
33

4+
How to cite
5+
-----------
6+
`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>`__]
7+
8+
Previous Publications
9+
---------------------
10+
* `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.
11+
12+
* `J. LUU`, `J. Goeders`, `M. Wainberg`, `A. Somerville`, `T. Yu`, `K. Nasartschuk`, `M. Nasr`, `S. Wang`, `T. L`, `N. Ahmed`, `K. B. Kent`, `J. Anderson`, `J. Rose`, `V. Betz`, "VTR 7.0: Next Generation Architecture and CAD System for FPGAs", *ACM TRETS*, 2014.
13+
14+
References
15+
----------
16+
417
.. bibliography:: z_references.bib
518
:all:

install_apt_packages.sh

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,11 @@ sudo apt-get install -y \
1010
flex \
1111
python3-dev \
1212
python3-venv
13-
13+
14+
# Packages for more complex features of VTR that most people will use.
15+
sudo apt-get install -y \
16+
libtbb-dev
17+
1418
# Required for graphics
1519
sudo apt-get install -y \
1620
libgtk-3-dev \
@@ -42,6 +46,11 @@ sudo apt-get install -y \
4246
sphinx-common
4347

4448
# Required for code formatting
45-
sudo apt-get install -y \
46-
clang-format-18
47-
49+
# NOTE: clang-format-18 may only be found on specific distributions. Only
50+
# install it if the distribution has this version of clang format.
51+
if apt-cache search '^clang-format-18$' | grep -q 'clang-format-18'; then
52+
sudo apt-get install -y \
53+
clang-format-18
54+
else
55+
echo "clang-format-18 not found in apt-cache. Skipping installation."
56+
fi

libs/libarchfpga/src/arch_types.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
#define TOKENS " \t\n"
1717

1818
/* Value for UNDEFINED data */
19-
constexpr int UNDEFINED = -1;
19+
constexpr int ARCH_FPGA_UNDEFINED_VAL = -1;
2020

2121
/* Maximum value for minimum channel width to avoid overflows of short data type. */
2222
constexpr int MAX_CHANNEL_WIDTH = 8000;

libs/libarchfpga/src/arch_util.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -444,7 +444,7 @@ t_physical_tile_type get_empty_physical_type(const char* name /*= EMPTY_BLOCK_NA
444444
type.capacity = 0;
445445
type.num_drivers = 0;
446446
type.num_receivers = 0;
447-
type.area = UNDEFINED;
447+
type.area = ARCH_FPGA_UNDEFINED_VAL;
448448
type.switchblock_locations = vtr::Matrix<e_sb_type>({{size_t(type.width), size_t(type.height)}}, e_sb_type::FULL);
449449
type.switchblock_switch_overrides = vtr::Matrix<int>({{size_t(type.width), size_t(type.height)}}, DEFAULT_SWITCH);
450450
type.is_input_type = false;

libs/libarchfpga/src/physical_types.cpp

Lines changed: 65 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,71 @@ const t_port* t_logical_block_type::get_port_by_pin(int pin) const {
252252
return nullptr;
253253
}
254254

255-
/**
255+
/*
256+
* t_pb_type
257+
*/
258+
259+
int t_pb_type::get_max_primitives() const {
260+
int max_size;
261+
262+
if (modes == nullptr) {
263+
max_size = 1;
264+
} else {
265+
max_size = 0;
266+
int temp_size = 0;
267+
for (int i = 0; i < num_modes; i++) {
268+
for (int j = 0; j < modes[i].num_pb_type_children; j++) {
269+
temp_size += modes[i].pb_type_children[j].num_pb * modes[i].pb_type_children[j].get_max_primitives();
270+
}
271+
if (temp_size > max_size) {
272+
max_size = temp_size;
273+
}
274+
}
275+
}
276+
277+
return max_size;
278+
}
279+
280+
/* finds maximum number of nets that can be contained in pb_type, this is bounded by the number of driving pins */
281+
int t_pb_type::get_max_nets() const {
282+
int max_nets;
283+
if (modes == nullptr) {
284+
max_nets = num_output_pins;
285+
} else {
286+
max_nets = 0;
287+
288+
for (int i = 0; i < num_modes; i++) {
289+
int temp_nets = 0;
290+
for (int j = 0; j < modes[i].num_pb_type_children; j++) {
291+
temp_nets += modes[i].pb_type_children[j].num_pb * modes[i].pb_type_children[j].get_max_nets();
292+
}
293+
294+
if (temp_nets > max_nets) {
295+
max_nets = temp_nets;
296+
}
297+
}
298+
}
299+
300+
if (is_root()) {
301+
max_nets += num_input_pins + num_output_pins + num_clock_pins;
302+
}
303+
304+
return max_nets;
305+
}
306+
307+
int t_pb_type::get_max_depth() const {
308+
int max_depth = depth;
309+
310+
for (int i = 0; i < num_modes; i++) {
311+
for (int j = 0; j < modes[i].num_pb_type_children; j++) {
312+
int temp_depth = modes[i].pb_type_children[j].get_max_depth();
313+
max_depth = std::max(max_depth, temp_depth);
314+
}
315+
}
316+
return max_depth;
317+
}
318+
319+
/*
256320
* t_pb_graph_node
257321
*/
258322

libs/libarchfpga/src/physical_types.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -725,6 +725,11 @@ struct t_physical_tile_type {
725725
///@brief Is this t_physical_tile_type an empty type?
726726
bool is_empty() const;
727727

728+
///@brief Returns true if the physical tile type can implement either a .input or .output block type
729+
inline bool is_io() const {
730+
return is_input_type || is_output_type;
731+
}
732+
728733
///@brief Returns the relative pin index within a sub tile that corresponds to the pin within the given port and its index in the port
729734
int find_pin(std::string_view port_name, int pin_index_in_port) const;
730735

@@ -1087,6 +1092,10 @@ struct t_pb_type {
10871092
inline bool is_primitive() const {
10881093
return num_modes == 0;
10891094
}
1095+
1096+
int get_max_primitives() const;
1097+
int get_max_depth() const;
1098+
int get_max_nets() const;
10901099
};
10911100

10921101
/** Describes an operational mode of a clustered logic block

0 commit comments

Comments
 (0)