Skip to content

Commit 06fe567

Browse files
Merge branch 'master' into temp_place_est_chan_util
2 parents 7f6c496 + c606a21 commit 06fe567

File tree

329 files changed

+8167
-4813
lines changed

Some content is hidden

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

329 files changed

+8167
-4813
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: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,3 +104,12 @@ jobs:
104104
run: |
105105
source .venv/bin/activate
106106
./run_reg_test.py -j12 vtr_reg_nightly_test7
107+
108+
- name: Upload regression results
109+
if: success() || failure()
110+
uses: actions/upload-artifact@v4
111+
with:
112+
name: nightly_test_results
113+
path: |
114+
vtr_flow/**/*.log
115+
vtr_flow/**/parse_results*.txt

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.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

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
==========
2+
Connection Router
3+
==========
4+
5+
ConnectionRouter
6+
---------
7+
.. doxygenfile:: connection_router.h
8+
:project: vpr
9+
10+
SerialConnectionRouter
11+
----------
12+
.. doxygenclass:: SerialConnectionRouter
13+
:project: vpr
14+
15+
ParallelConnectionRouter
16+
----------
17+
.. doxygenclass:: ParallelConnectionRouter
18+
:project: vpr

doc/src/api/vprinternals/vpr_router.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,4 @@ VPR Router
99

1010
router_heap
1111
router_lookahead
12+
router_connection_router

doc/src/tutorials/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,4 @@ Tutorials
1010
arch/index
1111
titan_benchmarks/index
1212
timing_simulation/index
13+
timing_analysis/index
Lines changed: 170 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,170 @@
1+
.. _timing_analysis_tutorial:
2+
3+
Post-Implementation Timing Analysis
4+
-----------------------------------
5+
6+
This tutorial describes how to perform static timing analysis (STA) on a circuit which has
7+
been implemented by :ref:`VPR` using OpenSTA, an external timing analysis tool.
8+
9+
External timing analysis can be useful since VPR's timing analyzer (Tatum) does
10+
not support all timing constraints and does not provide a TCL interface to allow
11+
you to directly interrogate the timing graph. VPR also has limited support for
12+
timing exceptions such as multi-cycles and false paths, which tools like OpenSTA
13+
have better support for.
14+
15+
Some external tools can also ingest more complex timing models (e.g. four
16+
transition rr, rf, fr, ff delays vs. VTR's modeling of all transitions having
17+
the same min,max range).
18+
19+
.. _fig_timing_analysis_design_cycle:
20+
21+
.. figure:: timing_analysis_design_cycle.png
22+
23+
Post-implementation timing analysis design cycle.
24+
25+
A user design cycle which would use post-implementation timing analysis could perform the following:
26+
1. Run VPR with the timing commands it can support (simplified constraints).
27+
2. Perform timing analysis on the resulting netlist using OpenSTA with
28+
more complex timing commands.
29+
3. The user can then modify the design to meet the complex timing constraints based on the timing report produced by OpenSTA.
30+
4. The design can then be fed back into VPR and the process can repeat until all constraints are met.
31+
32+
Generating the Post-Implementation Netlist for STA
33+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
34+
35+
For this tutorial, we will be using the ``clma`` :ref:`benchmark <benchmarks>`
36+
targetting the ``k6_frac_N10_frac_chain_mem32K_40nm.xml`` architecture.
37+
38+
We will first create a working directory to hold all the timing analysis files:
39+
40+
.. code-block:: console
41+
42+
$ mkdir timing_analysis_tut
43+
$ cd timing_analysis_tut
44+
45+
Next we will copy over the benchmark and FPGA architecture into the working
46+
directory for convenience:
47+
48+
.. code-block:: console
49+
50+
$ cp $VTR_ROOT/vtr_flow/benchmarks/blif/clma.blif .
51+
$ cp $VTR_ROOT/vtr_flow/arch/timing/k6_frac_N10_frac_chain_mem32K_40nm.xml .
52+
53+
.. note:: Replace :term:`$VTR_ROOT` with the root directory of the VTR source tree
54+
55+
To perform timing analysis externally to VTR, we need to provide an SDC file
56+
which will contain the timing constraints on the clocks and I/Os in the circuit.
57+
For this tutorial, we will use the following ``clma.sdc`` file:
58+
59+
.. code-block:: tcl
60+
:linenos:
61+
:caption: SDC file ``clma.sdc`` used for timing analysis.
62+
63+
# Set pclk to be a clock with a 16ns period.
64+
create_clock -period 16 pclk
65+
66+
# Set the input delays of all input ports in the clma design to be 0 relative to pclk.
67+
set_input_delay -clock pclk -max 0 [get_ports {pi*}]
68+
69+
# Set the output delays of all output ports in the clma design to be 0 relative to pclk.
70+
set_output_delay -clock pclk -max 0 [get_ports {p__*}]
71+
72+
Next, we can generate the post-implementation netlist and other necessary files
73+
for timing analysis using VPR.
74+
75+
.. code-block:: console
76+
77+
$ vpr \
78+
$ k6_frac_N10_frac_chain_mem32K_40nm.xml \
79+
$ clma.blif \
80+
$ --route_chan_width 100 \
81+
$ --sdc_file clma.sdc \
82+
$ --gen_post_synthesis_netlist on \
83+
$ --gen_post_implementation_sdc on \
84+
$ --post_synth_netlist_unconn_inputs gnd \
85+
$ --post_synth_netlist_module_parameters off
86+
87+
In this command, we provide the architecture, circuit, the channel width, and
88+
the SDC file. The other four commands are what generate the necessary netlist
89+
files for timing analysis:
90+
* ``--gen_post_synthesis_netlist on``: This will generate the post-implementation netlist as a Verilog file.
91+
* ``--gen_post_implementation_sdc on``: This will have VPR generate a new SDC file which contains extra timing information (e.g. clock delays) based on how VPR implemented the design.
92+
* ``--post_synth_netlist_unconn_inputs gnd``: For timing analysis with OpenSTA, we should be explicit about how we handle unconnected signal ports. Here we just ground them for simplicity.
93+
* ``--post_synth_netlist_module_parameters off``: OpenSTA does not allow parameters to be used in the netlist. This command tells VPR to generate a netlist without using parameters.
94+
95+
Once VPR has completed, we should see the generated Verilog netlist, SDF file, and SDC file:
96+
97+
.. code-block:: console
98+
99+
$ ls *.v *.sdf *.sdc
100+
top_post_synthesis.sdc top_post_synthesis.sdf top_post_synthesis.v
101+
102+
103+
Performing Timing Analysis using OpenSTA
104+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
105+
106+
To perform static timing analysis for this tutorial, we will be using OpenSTA (https://github.com/parallaxsw/OpenSTA ).
107+
Other STA tools can be used, however they may use slightly different commands.
108+
109+
First, install OpenSTA onto your system. Building from source is a good option,
110+
which can be done using the following instructions:
111+
https://github.com/parallaxsw/OpenSTA?tab=readme-ov-file#build-from-source
112+
113+
After OpenSTA is installed, we can perfrom static timing analysis on the post-implementation
114+
netlist generated by VPR.
115+
116+
It is easiest to write a ``sdf_delays.tcl`` file to setup and configure the timing analysis:
117+
118+
.. code-block:: tcl
119+
:linenos:
120+
:caption: OpenSTA TCL file ``sdf_delays.tcl``. Note that :term:`$VTR_ROOT` should be replaced with the relevant path.
121+
122+
# Read a skeleton of a liberty file which contains just enough information to
123+
# allow OpenSTA to perform timing analysis on the post-synthesized netlist using
124+
# an SDF file. This contains descriptions of the timing arcs of the primitives
125+
# in the circuit.
126+
read_liberty $VTR_ROOT/vtr_flow/primitives.lib
127+
128+
# Read the post-implementation netlist generated by VPR.
129+
read_verilog top_post_synthesis.v
130+
131+
# Link the top-level design.
132+
link_design top
133+
134+
# Read the post-synthesis SDF file.
135+
read_sdf top_post_synthesis.sdf
136+
137+
# Read the SDC commands generated by VPR.
138+
read_sdc top_post_synthesis.sdc
139+
140+
# Report the setup and hold timing checks using OpenSTA and write them to files.
141+
report_checks -group_path_count 100 -digits 3 -path_delay max > open_sta_report_timing.setup.rpt
142+
report_checks -group_path_count 100 -digits 3 -path_delay min > open_sta_report_timing.hold.rpt
143+
144+
# Report the minimum period of the clocks and their fmax.
145+
report_clock_min_period
146+
147+
# Exit OpenSTA's TCL terminal.
148+
# This can be removed if you want terminal access to write TCL commands after
149+
# executing the prior commands.
150+
exit
151+
152+
Now that we have a ``.tcl`` file, we can launch OpenSTA from the terminal and run it:
153+
154+
.. code-block:: console
155+
156+
$ sta sdf_delays.tcl
157+
158+
Running this command will open a TCL terminal which will execute all of the commands
159+
in ``sdf_delays.tcl``. The TCL file above will write setup and hold timing reports (similar to
160+
the reports written by VPR), report the minimum period of all clocks, and then exit the OpenSTA TCL terminal.
161+
162+
You can compare the timing reports generated by OpenSTA (``open_sta_report_timing.{setup/hold}.rpt``)
163+
to the timing reports generated by VPR (``report_timing.{setup/hold}.rpt``).
164+
You can also compare the minimum period reported by OpenSTA with the final
165+
period reported by VTR at the bottom of ``vpr_stdout.log``.
166+
167+
The TCL file above is just an example of what OpenSTA can do. For full documentation
168+
of the different commands available in OpenSTA, see:
169+
https://github.com/parallaxsw/OpenSTA/blob/master/doc/OpenSTA.pdf
170+
Loading

0 commit comments

Comments
 (0)