Skip to content

Commit ade138d

Browse files
committed
Merge branch 'master' into yosys_to_submodule
2 parents 2f93d44 + 31cbe66 commit ade138d

File tree

99 files changed

+32931
-573
lines changed

Some content is hidden

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

99 files changed

+32931
-573
lines changed

.github/workflows/nightly_test_manual.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ jobs:
5050
make get_ispd_benchmarks
5151
./dev/upgrade_vtr_archs.sh
5252
make get_symbiflow_benchmarks
53+
make get_zeroasic_rr_graphs
5354
5455
# Build VTR using the default build options.
5556
- name: 'Build VTR'
@@ -133,4 +134,4 @@ jobs:
133134
with:
134135
name: nightly_tests_golden
135136
path: |
136-
vtr_flow/**/vtr_reg_nightly*/**/golden_results.txt
137+
vtr_flow/**/vtr_reg_nightly*/**/golden_results.txt

CMakeLists.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -360,6 +360,14 @@ add_custom_target(get_symbiflow_benchmarks
360360
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
361361
COMMENT "Downloading (~100MB) and extracting SymbiFlow architectures (~2.7GB) into VTR source tree.")
362362

363+
#
364+
# Zero ASIC RR Graph Files
365+
#
366+
add_custom_target(get_zeroasic_rr_graphs
367+
COMMAND ./vtr_flow/scripts/get_zeroasic_rr_graphs.py --vtr_flow_dir ./vtr_flow
368+
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
369+
COMMENT "Downloading (~2MB) and extracting Zero ASIC RR graphs (~0.1GB) into VTR source tree.")
370+
363371
#
364372
# Unit Testing
365373
#

doc/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
#Sphinx
22
_build
3+
.venv

doc/README

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,19 +14,22 @@ Currently VTR's documenation is automatically built by https://readthedocs.org/p
1414
How to build documentation
1515
--------------------------
1616

17-
To build the documentation locally you need sphinx installed:
17+
To build the documentation locally you need to to install Doxygen (Optional) and the python dependencies. You can use your distribution's package manager to install Doxygen. Ubuntu and Debian users can use the following command:
1818

19-
For ubuntu/debian based systems:
19+
$ sudo apt install doxygen
2020

21-
$ apt-get install python-sphinx
21+
While Fedora and RHEL users can use the following command:
2222

23-
To properly build citations and the bibliography, we use the sphinxcontrib-bibtex extension:
23+
$ sudo dnf install doxygen
2424

25-
$ pip install sphinxcontrib-bibtex
25+
You can install python dependencies by fist optionally making a virtual environment:
2626

27-
To install all the python requirements:
27+
$ python -m venv .venv
28+
$ source .venv/bin/activate
2829

29-
$ pip install -r requirements.txt
30+
And then using the requirements file to install the dependencies:
31+
32+
$ pip install -r requirements.txt
3033

3134
To build the documentation just run:
3235

doc/requirements.txt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,12 @@
22
# used by Read The Docs to install python required
33
# modules with pip.
44

5-
sphinx<7
5+
# Pinned sphinx's version to avoid breakage in future
6+
sphinx == 8.2.3
67
sphinx_rtd_theme
78

89
# Support custom domains
9-
sphinxcontrib-domaintools
10+
git+https://github.com/AmirhosseinPoolad/sphinxcontrib-domaintools
1011

1112
# Support Markdown
1213
sphinx-markdown-tables

doc/src/conf.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,13 +67,13 @@
6767
master_doc = "index"
6868

6969
project = "Verilog-to-Routing"
70-
copyright = "2012-2022, VTR Developers"
70+
copyright = "2012-2025, VTR Developers"
7171
author = "VTR Developers"
7272

7373
version = get_vtr_version()
7474
release = get_vtr_release()
7575

76-
language = None
76+
language = "en"
7777

7878
exclude_patterns = ["_build"]
7979

@@ -87,8 +87,6 @@
8787

8888
html_theme = "sphinx_rtd_theme"
8989

90-
html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]
91-
9290
html_logo = "_static/vtr_logo.svg"
9391

9492
html_favicon = "_static/favicon.ico"

doc/src/vpr/command_line_usage.rst

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1824,6 +1824,20 @@ The following options are only valid when the router is in timing-driven mode (t
18241824

18251825
**Default:** ``map``
18261826

1827+
.. option:: --router_initial_acc_cost_chan_congestion_threshold <float>
1828+
1829+
Utilization threshold above which initial accumulated routing cost (acc_cost) is increased to penalize congested channels.
1830+
Used to bias routing away from highly utilized regions during early routing iterations.
1831+
1832+
**Default:** ``0.5``
1833+
1834+
.. option:: --router_initial_acc_cost_chan_congestion_weight <float>
1835+
Weight applied to the excess channel utilization (above threshold) when computing the initial accumulated cost (acc_cost)of routing resources.
1836+
1837+
Higher values make the router more sensitive to early congestion.
1838+
1839+
**Default:** ``0.5``
1840+
18271841
.. option:: --router_max_convergence_count <float>
18281842

18291843
Controls how many times the router is allowed to converge to a legal routing before halting.

libs/librrgraph/src/base/check_rr_graph.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,9 @@ void check_rr_graph(const RRGraphView& rr_graph,
5353
const t_chan_width& chan_width,
5454
const e_graph_type graph_type,
5555
bool is_flat) {
56-
e_route_type route_type = DETAILED;
56+
e_route_type route_type = e_route_type::DETAILED;
5757
if (graph_type == e_graph_type::GLOBAL) {
58-
route_type = GLOBAL;
58+
route_type = e_route_type::GLOBAL;
5959
}
6060

6161
auto total_edges_to_node = std::vector<int>(rr_graph.num_nodes());
@@ -420,7 +420,7 @@ void check_rr_node(const RRGraphView& rr_graph,
420420
VPR_FATAL_ERROR(VPR_ERROR_ROUTE,
421421
"in check_rr_node: CHANX out of range for endpoints (%d,%d) and (%d,%d)\n", xlow, ylow, xhigh, yhigh);
422422
}
423-
if (route_type == GLOBAL && xlow != xhigh) {
423+
if (route_type == e_route_type::GLOBAL && xlow != xhigh) {
424424
VPR_ERROR(VPR_ERROR_ROUTE,
425425
"in check_rr_node: node %d spans multiple channel segments (not allowed for global routing).\n", inode);
426426
}
@@ -431,7 +431,7 @@ void check_rr_node(const RRGraphView& rr_graph,
431431
VPR_FATAL_ERROR(VPR_ERROR_ROUTE,
432432
"Error in check_rr_node: CHANY out of range for endpoints (%d,%d) and (%d,%d)\n", xlow, ylow, xhigh, yhigh);
433433
}
434-
if (route_type == GLOBAL && ylow != yhigh) {
434+
if (route_type == e_route_type::GLOBAL && ylow != yhigh) {
435435
VPR_ERROR(VPR_ERROR_ROUTE,
436436
"in check_rr_node: node %d spans multiple channel segments (not allowed for global routing).\n", inode);
437437
}
@@ -480,7 +480,7 @@ void check_rr_node(const RRGraphView& rr_graph,
480480

481481
case e_rr_type::CHANX:
482482
case e_rr_type::CHANY:
483-
if (route_type == DETAILED) {
483+
if (route_type == e_route_type::DETAILED) {
484484
nodes_per_chan = chan_width.max;
485485
tracks_per_node = 1;
486486
} else {

libs/librrgraph/src/base/rr_graph_builder.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,9 @@ void RRGraphBuilder::add_node_to_all_locs(RRNodeId node) {
2626
e_rr_type node_type = node_storage_.node_type(node);
2727
short node_ptc_num = node_storage_.node_ptc_num(node);
2828
short node_layer = node_storage_.node_layer(node);
29-
short node_twist = node_storage_.node_ptc_twist(node);
30-
int node_offset = 0;
3129

3230
for (int ix = node_storage_.node_xlow(node); ix <= node_storage_.node_xhigh(node); ix++) {
3331
for (int iy = node_storage_.node_ylow(node); iy <= node_storage_.node_yhigh(node); iy++) {
34-
node_ptc_num += node_twist * node_offset;
35-
node_offset++;
3632

3733
switch (node_type) {
3834
case e_rr_type::SOURCE:

libs/librrgraph/src/base/rr_graph_builder.h

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -205,11 +205,6 @@ class RRGraphBuilder {
205205
node_storage_.set_node_layer(id, layer);
206206
}
207207

208-
/** @brief set the ptc twist increment number for TILEABLE rr graphs (for more information see rr_graph_storage.h twist increment comment) */
209-
inline void set_node_ptc_twist_incr(RRNodeId id, int twist){
210-
node_storage_.set_node_ptc_twist_incr(id, twist);
211-
}
212-
213208

214209
/** @brief set_node_pin_num() is designed for logic blocks, which are IPIN and OPIN nodes */
215210
inline void set_node_pin_num(RRNodeId id, int new_pin_num) {
@@ -325,11 +320,6 @@ class RRGraphBuilder {
325320
node_storage_.resize(size);
326321
}
327322

328-
/** @brief This function resize node ptc twist increment; Since it is only used for tileable rr-graph, we don't put it in general resize function*/
329-
inline void resize_ptc_twist_incr(size_t size){
330-
node_storage_.resize(size);
331-
}
332-
333323
/** @brief This function resize rr_switch to accomidate size RR Switch. */
334324
inline void resize_switches(size_t size) {
335325
rr_switch_inf_.resize(size);

libs/librrgraph/src/base/rr_graph_storage.cpp

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -635,11 +635,6 @@ void t_rr_graph_storage::set_node_layer(RRNodeId id, short layer) {
635635
node_layer_[id] = layer;
636636
}
637637

638-
void t_rr_graph_storage::set_node_ptc_twist_incr(RRNodeId id, short twist_incr){
639-
VTR_ASSERT(!node_ptc_twist_incr_.empty());
640-
node_ptc_twist_incr_[id] = twist_incr;
641-
}
642-
643638
void t_rr_graph_storage::set_node_ptc_num(RRNodeId id, int new_ptc_num) {
644639
node_ptc_[id].ptc_.pin_num = new_ptc_num; //TODO: eventually remove
645640
}
@@ -821,7 +816,6 @@ t_rr_graph_view t_rr_graph_storage::view() const {
821816
vtr::make_const_array_view_id(node_fan_in_),
822817
vtr::make_const_array_view_id(node_layer_),
823818
node_name_,
824-
vtr::make_const_array_view_id(node_ptc_twist_incr_),
825819
vtr::make_const_array_view_id(edge_src_node_),
826820
vtr::make_const_array_view_id(edge_dest_node_),
827821
vtr::make_const_array_view_id(edge_switch_),

libs/librrgraph/src/base/rr_graph_storage.h

Lines changed: 0 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -251,18 +251,6 @@ class t_rr_graph_storage {
251251
return std::nullopt; // Return an empty optional if key is not found
252252
}
253253

254-
/** @brief Find the twist number that RR node uses to change ptc number across the same track.
255-
* By default this number is zero, meaning that ptc number across the same track should be the same.
256-
* This number is only meaningful for CHANX/CHANY nodes, not the other nodes.
257-
*/
258-
short node_ptc_twist(RRNodeId id) const{
259-
//check whether node_ptc_twist_incr has been allocated
260-
if(node_ptc_twist_incr_.empty()){
261-
return 0;
262-
}
263-
return node_ptc_twist_incr_[id];
264-
}
265-
266254
/**
267255
* @brief Returns the node ID of the virtual sink for the specified clock network name.
268256
*
@@ -504,7 +492,6 @@ class t_rr_graph_storage {
504492
node_ptc_.reserve(node_storage_.capacity());
505493
node_ptc_.resize(node_storage_.size());
506494
node_layer_.resize(node_storage_.size());
507-
node_ptc_twist_incr_.resize(node_storage_.size());
508495
}
509496

510497
/** @brief Reserve storage for RR nodes. */
@@ -525,11 +512,6 @@ class t_rr_graph_storage {
525512
node_layer_.resize(size);
526513
}
527514

528-
/** @brief We only allocate the ptc twist increment array while building tileable rr-graphs */
529-
void resize_ptc_twist_incr(size_t size){
530-
node_ptc_twist_incr_.resize(size);
531-
}
532-
533515
/** @brief Number of RR nodes that can be accessed. */
534516
size_t size() const {
535517
return node_storage_.size();
@@ -551,7 +533,6 @@ class t_rr_graph_storage {
551533
node_layer_.clear();
552534
node_name_.clear();
553535
virtual_clock_network_root_idx_.clear();
554-
node_ptc_twist_incr_.clear();
555536
edge_src_node_.clear();
556537
edge_dest_node_.clear();
557538
edge_switch_.clear();
@@ -585,7 +566,6 @@ class t_rr_graph_storage {
585566
node_first_edge_.shrink_to_fit();
586567
node_fan_in_.shrink_to_fit();
587568
node_layer_.shrink_to_fit();
588-
node_ptc_twist_incr_.shrink_to_fit();
589569
edge_src_node_.shrink_to_fit();
590570
edge_dest_node_.shrink_to_fit();
591571
edge_switch_.shrink_to_fit();
@@ -620,7 +600,6 @@ class t_rr_graph_storage {
620600
void set_node_name(RRNodeId id, const std::string& new_name);
621601
void set_node_coordinates(RRNodeId id, short x1, short y1, short x2, short y2);
622602
void set_node_layer(RRNodeId id, short layer);
623-
void set_node_ptc_twist_incr(RRNodeId id, short twist);
624603
void set_node_cost_index(RRNodeId, RRIndexedDataId new_cost_index);
625604
void set_node_rc_index(RRNodeId, NodeRCIndex new_rc_index);
626605
void set_node_capacity(RRNodeId, short new_capacity);
@@ -872,15 +851,6 @@ class t_rr_graph_storage {
872851
*/
873852
std::unordered_map<std::string, RRNodeId> virtual_clock_network_root_idx_;
874853

875-
/** @brief
876-
*Twist Increment number is defined for CHANX/CHANY nodes; it is useful for layout of tileable FPGAs used by openFPGA.
877-
*It gives us a new track index in each tile a longer wire crosses, which enables us to make long wires with a repeated single-tile pattern that "twists" the wires as they cross the tile.
878-
*For example, an L4 wire would change tracks 4 times with metal shorts [e.g. 0, 2, 4, 6] and track 6 would drive a switch -- together this implements an L4 wire with only one layout tile.
879-
* Twist increment number is only meaningful for CHANX and CHANY nodes; it is 0 for other node types.
880-
* We also don't bother allocating this storage if the FPGA is not specified to be tileable; instead in that case the twist for all nodes will always be returned as 0.
881-
*/
882-
vtr::vector<RRNodeId, short> node_ptc_twist_incr_;
883-
884854
/** @brief Edge storage */
885855
vtr::vector<RREdgeId, RRNodeId> edge_src_node_;
886856
vtr::vector<RREdgeId, RRNodeId> edge_dest_node_;
@@ -954,7 +924,6 @@ class t_rr_graph_view {
954924
const vtr::array_view_id<RRNodeId, const t_edge_size> node_fan_in,
955925
const vtr::array_view_id<RRNodeId, const short> node_layer,
956926
const std::unordered_map<RRNodeId, std::string>& node_name,
957-
const vtr::array_view_id<RRNodeId, const short> node_ptc_twist_incr,
958927
const vtr::array_view_id<RREdgeId, const RRNodeId> edge_src_node,
959928
const vtr::array_view_id<RREdgeId, const RRNodeId> edge_dest_node,
960929
const vtr::array_view_id<RREdgeId, const short> edge_switch,
@@ -965,7 +934,6 @@ class t_rr_graph_view {
965934
, node_fan_in_(node_fan_in)
966935
, node_layer_(node_layer)
967936
, node_name_(node_name)
968-
, node_ptc_twist_incr_(node_ptc_twist_incr)
969937
, edge_src_node_(edge_src_node)
970938
, edge_dest_node_(edge_dest_node)
971939
, edge_switch_(edge_switch)
@@ -1055,20 +1023,6 @@ class t_rr_graph_view {
10551023
return std::nullopt; // Return an empty optional if key is not found
10561024
}
10571025

1058-
/**
1059-
* @brief Retrieve the twist number (if available) that the given RRNodeId used for its PTC number.
1060-
*
1061-
* @param id The RRNodeId for which to retrieve the twist number.
1062-
* @return The twist number used for the PTC number, or a default value if not available.
1063-
*/
1064-
short node_ptc_twist_incr(RRNodeId id) const{
1065-
//check if ptc twist increment allocated
1066-
if(node_ptc_twist_incr_.empty()){
1067-
return 0; //if it is not allocated we just assume that is zero
1068-
}
1069-
return node_ptc_twist_incr_[id];
1070-
}
1071-
10721026
/**
10731027
* @brief Prefetches hot RR node data required for optimization.
10741028
*
@@ -1183,7 +1137,6 @@ class t_rr_graph_view {
11831137
vtr::array_view_id<RRNodeId, const t_edge_size> node_fan_in_;
11841138
vtr::array_view_id<RRNodeId, const short> node_layer_;
11851139
const std::unordered_map<RRNodeId, std::string>& node_name_;
1186-
vtr::array_view_id<RRNodeId, const short> node_ptc_twist_incr_;
11871140
vtr::array_view_id<RREdgeId, const RRNodeId> edge_src_node_;
11881141
vtr::array_view_id<RREdgeId, const RRNodeId> edge_dest_node_;
11891142
vtr::array_view_id<RREdgeId, const short> edge_switch_;

libs/librrgraph/src/base/rr_graph_type.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@ struct t_chan_width {
1313
std::vector<int> y_list;
1414
};
1515

16-
enum e_route_type {
16+
/// @brief Specifies whether global routing or combined global and detailed routing is performed.
17+
enum class e_route_type {
1718
GLOBAL,
1819
DETAILED
1920
};

libs/librrgraph/src/base/rr_graph_view.h

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -223,12 +223,6 @@ class RRGraphView {
223223
return node_storage_.node_layer(node);
224224
}
225225

226-
/** @brief Return the ptc number twist of a specified node.
227-
*/
228-
inline short node_ptc_twist(RRNodeId node) const {
229-
return node_storage_.node_ptc_twist(node);
230-
}
231-
232226
/** @brief Return the first outgoing edge of a specified node.
233227
*/
234228
inline RREdgeId node_first_edge(RRNodeId node) const {

libs/librrgraph/src/base/rr_node_types.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -103,8 +103,8 @@ typedef vtr::Range<edge_idx_iterator> edge_idx_range;
103103

104104
typedef std::vector<std::map<int, int>> t_arch_switch_fanin;
105105

106-
/*
107-
* Resistance/Capacitance data for an RR Nodes
106+
/**
107+
* @brief Resistance/Capacitance data for an RR Node.
108108
*
109109
* In practice many RR nodes have the same values, so they are fly-weighted
110110
* to keep t_rr_node small. Each RR node holds an rc_index which allows
@@ -121,8 +121,8 @@ typedef std::vector<std::map<int, int>> t_arch_switch_fanin;
121121
struct t_rr_rc_data {
122122
t_rr_rc_data(float Rval, float Cval) noexcept;
123123

124-
float R;
125-
float C;
124+
float R; ///< Resistance to go through an RR node
125+
float C; ///< Total capacitance of an RR node.
126126
};
127127

128128
// This is the data type of fast lookups of an rr-node given an (rr_type, layer, x, y, and the side)

0 commit comments

Comments
 (0)