Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
196 commits
Select commit Hold shift + click to select a range
76d8496
[cli] add crr cli parameters
amin1377 Oct 14, 2025
a1b7cc9
[setup_vpr] add structs for crrOpts
amin1377 Oct 14, 2025
8f30644
[utils] pass CRROpts to alloc_routing_structs
amin1377 Oct 14, 2025
f18cc17
[place] padd crropts to relevant funcitons in placement
amin1377 Oct 14, 2025
81b4cc1
[vpr][types] add t_crr_opts
amin1377 Oct 14, 2025
1500928
[vpr][base] pass CRROpts to relevant base functions
amin1377 Oct 14, 2025
4bb1fbd
[vpr][route] pass crr_opts to relevant routing functions
amin1377 Oct 14, 2025
3b8da60
[vpr][route] pass crr_opts to build_tileable_unidir_rr_graph
amin1377 Oct 14, 2025
5bdab0a
[libs][external] add openXLSX
amin1377 Oct 14, 2025
b9f40e6
[cli] fix default values for crr params
amin1377 Oct 14, 2025
664ca84
[vpr][route][tileable] call crr generator if sb_maps is not empty
amin1377 Oct 14, 2025
3f1518b
[libs][external] add OpenXLSX to external libs cmake
amin1377 Oct 14, 2025
c8c964e
[vpr][route][rr_graph] include crr_graph_edge_builder in tileable rr …
amin1377 Oct 14, 2025
b196045
[vpr][route][crr] add df processor
amin1377 Oct 15, 2025
9a57b25
[vpr][route][crr] add init impl for crr_graph_edge_builder
amin1377 Oct 15, 2025
7fa8969
[vpr][cmake] add openXLSX
amin1377 Oct 15, 2025
e7bd77e
[vpr][route][rr_graph] fix warnings
amin1377 Oct 15, 2025
1d16bf3
[libs][external] add yaml-cpp
amin1377 Oct 15, 2025
afe9b9c
[cmake] add yaml-cpp to cmake files
amin1377 Oct 15, 2025
2f361fd
[crr][switch_block_manager] add header file
amin1377 Oct 20, 2025
7ea7740
[vpr][route][crr] add pattern matcher
amin1377 Oct 20, 2025
d2b81e6
[vpr][route][crr][switch_block_manager] add missing libs
amin1377 Oct 20, 2025
6a05626
[vpr][route][crr] rename pattern_match to crr_pattern_matcher
amin1377 Oct 20, 2025
7343fce
[vpr][route][crr] add switch block mng impl
amin1377 Oct 20, 2025
7c03721
[vpr][route][crr] add crr.h/cpp
amin1377 Oct 20, 2025
835f5e2
[vpr][route][crr] add crr_common.h
amin1377 Oct 20, 2025
d2619f8
[vpr][route][crr] add xml_handler.h/cpp
amin1377 Oct 20, 2025
7f32380
[vpr][route][crr] fix compile problems with xml_handler
amin1377 Oct 20, 2025
d38f924
[vpr][route][crr] add node_lookup_mng
amin1377 Oct 20, 2025
9164048
[vpr][route][crr] add crr thread pool
amin1377 Oct 20, 2025
2af1e09
[vpr][route][crr] add crr_generator
amin1377 Oct 20, 2025
01eca68
[vpr][route][crr] add crr_conneciton_builder
amin1377 Oct 20, 2025
d942d0e
[vpr][route][crr] remove switch manager
amin1377 Oct 20, 2025
14aa81b
[vpr][route][crr] remove const vars from df processor
amin1377 Oct 20, 2025
6375030
[vpr][route][crr] fix compile failures
amin1377 Oct 20, 2025
08510ff
[vpr][route][crr] fix vtr_log_error
amin1377 Oct 20, 2025
343a345
[vpr][route][crr] fix log messages
amin1377 Oct 20, 2025
1bdb9b2
[vpr][route][crr] replate throw with vtr_log_error
amin1377 Oct 20, 2025
4986263
[vpr][route][crr] fix file name display
amin1377 Oct 21, 2025
549c5b4
temp: add code to just build crr and step out
amin1377 Oct 21, 2025
1fe6d46
[vpr][route][rr_graph_gen] fix log msg ending
amin1377 Oct 21, 2025
ea02eed
[libs][external] remove openxlsx
amin1377 Oct 23, 2025
8908e31
[Cmake] replace openxlsx with xlnt
amin1377 Oct 23, 2025
341ffed
[vpr][route][crr] remove update vpr xml function
amin1377 Oct 23, 2025
bc4bc0b
[vpr][route][crr] use xlnt instead of openxlsx in data frame processor
amin1377 Oct 23, 2025
bedddcd
[vpr][route][crr] deduct 2 from grid width and height
amin1377 Oct 23, 2025
099b81d
[vpr][route][crr] fix format_float_value in xml_handler
amin1377 Oct 23, 2025
78c2581
[vpr][route][crr] print newly added switches
amin1377 Oct 23, 2025
852890a
[vpr][route][crr] add custom_rr_graph_builder file
amin1377 Oct 23, 2025
d93536c
[CLI][CRR] remove preserve_opin/ipin and replace it with preserve pin…
amin1377 Oct 23, 2025
fc38a9f
[vpr][route][crr] remove custom_rr_graph_builder
amin1377 Oct 23, 2025
84cc0b4
[vpr][route][rr_graph] remove temp code
amin1377 Oct 23, 2025
8215eee
[vpr][route][crr] remove if condition for crr
amin1377 Oct 23, 2025
008a4e2
[vpr][route][crr] pass crr_opts to build_rr_graph_regular_edges
amin1377 Oct 23, 2025
8975125
[vpr][route][crr] add get_connection_builder to crrgenerator
amin1377 Oct 24, 2025
3aaee29
make format
amin1377 Oct 24, 2025
327513e
[vpr][route][crr] fix const function issue in crr_connection_builder
amin1377 Oct 24, 2025
ae4ceef
[vpr][route][crr] fix a typo
amin1377 Oct 24, 2025
76789e7
[vpr][route][crr] use rrnodeid in crr connection builder
amin1377 Oct 24, 2025
91d1fc9
[vpr][route][crr] set NodeId to size_T
amin1377 Oct 25, 2025
c67bae0
[vpr][route][crr] fix node_lookup param to contain RRNoneId instead o…
amin1377 Oct 25, 2025
c895c31
[vpr][route][crr] use RRNodeId for node_lookup_manager
amin1377 Oct 25, 2025
9c9edfb
[vpr][route][crr] change nodeid to rrnodeid for connections class
amin1377 Oct 27, 2025
097ebdc
[vpr][route][crr] use rrnodeid in connection builder
amin1377 Oct 27, 2025
bdba300
[vpr][route][crr] pass RRSwitchId to graph builder
amin1377 Oct 27, 2025
d59ae52
[lib][rr_graph] remove node_tilable_track_nums_ from rr graph view
amin1377 Oct 27, 2025
67783be
[lib][rr_graph][builder] remove direct access to node_tilable_track_n…
amin1377 Oct 27, 2025
7bbec6c
[lib][rr_graph][storage] add node_tilable_track_nums_ API calls to gr…
amin1377 Oct 27, 2025
5c4aeca
[lib][rr_graph][io] remove redundant API call
amin1377 Oct 27, 2025
0803118
[rr_graph][view] update instances with new constructor call
amin1377 Oct 27, 2025
8278af7
[vpr][route][crr] update lookup maanger functions to use rr graph view
amin1377 Oct 27, 2025
60cc0e0
[lib][rr_graph][storage] pass node_offset to add_node_tilable_track_n…
amin1377 Oct 27, 2025
2dc929e
[libs][librrgraph][builder] calculate node offset before calling add_…
amin1377 Oct 27, 2025
6086a64
[vpr][route][crr] change function name to build_crr_gsb_track_to_trac…
amin1377 Oct 28, 2025
88afdce
[vpr][route][crr] change node type to e_rr_type in crr ds and remove …
amin1377 Oct 28, 2025
21998d9
[vpr][route][crr] use rr_graph to access loc in index_node
amin1377 Oct 28, 2025
44990a9
[vpr][route][crr] fix typing issues in crr_common
amin1377 Oct 28, 2025
fc88092
[vpr][route][crr] comment parts releated to switch in connection builder
amin1377 Oct 28, 2025
a393fbe
[vpr][route][crr] comment out parts not used in crr generator
amin1377 Oct 28, 2025
38ee748
[vpr][route][crr] use e_rr_type for node type in custom_rr_graph
amin1377 Oct 28, 2025
dae8bc6
[vpr][route][crr] update xml handler with e_rr_type
amin1377 Oct 28, 2025
3c2350a
[vpr][route][crr] add crr builder to tileable_rr_graph_edge_builder
amin1377 Oct 28, 2025
e3b345f
[vpr][route][crr] use size_t instead of coordinate in node_lookup_man…
amin1377 Oct 28, 2025
9f723a5
[lib][rr_graph][storage] check if node_tilable_track_nums_ is empty b…
amin1377 Oct 28, 2025
d064a15
[vpr][route][crr] add noexcept to some of the class construtors to fi…
amin1377 Oct 28, 2025
f9c1c66
[vpr][route][crr] change coordinate to size_t for for connection builder
amin1377 Oct 28, 2025
6883c93
[vpr][route][crr] cast coordinates returned by rr_graph to size_t
amin1377 Oct 28, 2025
6b4a95b
[lib][rr_graph][base] resize node_tilable_track_nums_ in relevant fun…
amin1377 Oct 28, 2025
10b0888
[lib][rr_graph][io] set tileable to true before loading graph
amin1377 Oct 28, 2025
7139c9e
[vpr][route][crr] init crr data strutures only if crr is created
amin1377 Oct 28, 2025
7ef33f1
make format
amin1377 Oct 28, 2025
fdeb013
Merge branch 'master' of https://github.com/verilog-to-routing/vtr-ve…
amin1377 Oct 28, 2025
6ab4258
[submodule] clone submodules recursively
amin1377 Oct 29, 2025
f14e6e0
[github] add fetch-depth to submodule
amin1377 Oct 29, 2025
2ba93e5
[submodule] remove xlnt
amin1377 Oct 29, 2025
1933857
[subtree] add xlnt to subtree config file
amin1377 Oct 29, 2025
ef41a0b
Squashed 'libs/EXTERNAL/xlnt/' content from commit 297b331435
amin1377 Oct 29, 2025
7e2c039
add xlnt as subtree
amin1377 Oct 29, 2025
d087834
[libs][external] add libstudxml
amin1377 Oct 29, 2025
d5a80f0
[github] don't clone submodules recursively
amin1377 Oct 29, 2025
b62eed4
[libs] remove libstudxml
amin1377 Oct 29, 2025
2d677ca
[lib][external][studxml] add libstudxml
amin1377 Oct 29, 2025
5d5133c
Merge branch 'master' of https://github.com/verilog-to-routing/vtr-ve…
amin1377 Oct 29, 2025
585ecaa
[libs][xlnt] add cstdint
amin1377 Oct 29, 2025
e3f0f28
[libs][xlnt] add cstdint
amin1377 Oct 29, 2025
61c3a21
[libs][xlnt] add cstdint
amin1377 Oct 29, 2025
ca34e03
[libs][xlnt] add cstdint
amin1377 Oct 29, 2025
c408a87
[vpr][route][crr] instantiate CRR vars before if block
amin1377 Oct 30, 2025
86698eb
[vpr][route][crr] fix life time of crr vars
amin1377 Oct 31, 2025
5b17dd1
Merge branch 'master' of https://github.com/verilog-to-routing/vtr-ve…
amin1377 Nov 3, 2025
fe8225c
[vpr][route][rr_graph] make rr_node_driver_switches const in build_rr…
amin1377 Nov 3, 2025
3952894
[vpr][route][crr] change connection's switch_id to delay_ps
amin1377 Nov 3, 2025
16e8ffe
[vpr][route][crr] set connections delay instead of switch id
amin1377 Nov 3, 2025
f85d1c6
[vpr][route][crr] add find_crr_switch_id to get switch id from delay
amin1377 Nov 3, 2025
4b438b9
[vpr][route][crr] move build_edges_for_one_tileable_rr_gsb to outside…
amin1377 Nov 3, 2025
e6fc757
[vpr][route][tileable] check whether track2track_map is empty
amin1377 Nov 3, 2025
e07bbd1
[vpr][route][crr] don't add crr connections for switch blocks on the …
amin1377 Nov 3, 2025
12e17a7
[vpr][route][crr] iterate over ipin/opin ds only if their size is big…
amin1377 Nov 3, 2025
1ce35ad
[vpr][route][crr] remove get_preserved_edge
amin1377 Nov 3, 2025
11d32fa
[vpr][base] adding back preserve ipin/opin
amin1377 Nov 3, 2025
88caeb5
[vpr][route][crr] use default ipin/opin connections based on parameters
amin1377 Nov 3, 2025
949e9a4
[vpr][route][crr] fix condition to build ipin/opin connections
amin1377 Nov 5, 2025
e2d0014
Merge branch 'master' of https://github.com/verilog-to-routing/vtr-ve…
amin1377 Nov 5, 2025
a6934c2
[vpr][route][crr] remove unused functions in crr_gen
amin1377 Nov 5, 2025
ca6fe30
[vpr][route][crr] remove thread pool
amin1377 Nov 6, 2025
219ab6e
Merge branch 'master' of https://github.com/verilog-to-routing/vtr-ve…
amin1377 Nov 6, 2025
3373b7d
Merge branch 'master' of https://github.com/verilog-to-routing/vtr-ve…
amin1377 Nov 12, 2025
dca5881
[vpr][route][crr] remove xml_handler
amin1377 Nov 12, 2025
6324b79
[vpr][route][crr] remove custom_rr_graph file since we no longer buil…
amin1377 Nov 12, 2025
e9d7a10
[vpr][route][crr] remove instances of removed parts
amin1377 Nov 12, 2025
7aff688
[vpr][route][crr] fix compile issues
amin1377 Nov 12, 2025
fca44b1
[vpr][route][crr] remove xlnt usage and replace it with csv
amin1377 Nov 12, 2025
b4d0a59
[subtree] remove xlnt
amin1377 Nov 12, 2025
83a3aef
[cmake] remove xlnt
amin1377 Nov 12, 2025
23f0dc8
[vpr][route][crr] remove double from acceptable values for cell
amin1377 Nov 13, 2025
c72e3c6
[lib][rr_graph] fix formatting
amin1377 Nov 14, 2025
64ac05a
[vpr][route][rr_graph] fix formatting
amin1377 Nov 17, 2025
56796ca
Merge branch 'master' of https://github.com/verilog-to-routing/vtr-ve…
amin1377 Nov 17, 2025
f924fe4
Merge branch 'ipin_base_cost' of https://github.com/verilog-to-routin…
amin1377 Nov 17, 2025
ad08271
[cli] add remove dangling node to crr options
amin1377 Nov 17, 2025
7f0b02e
[lib][rr_graph] remove a redundant function
amin1377 Nov 17, 2025
29bfe3c
Merge branch 'remove_node' of https://github.com/verilog-to-routing/v…
amin1377 Nov 18, 2025
a1859aa
[lib][rr_graph] fix merge conflict
amin1377 Nov 18, 2025
7d1e758
[vpr][route][crr] fix parse_csv_cell
amin1377 Nov 18, 2025
006f22b
Merge branch 'ipin_base_cost' of https://github.com/verilog-to-routin…
amin1377 Nov 19, 2025
848820d
Merge branch 'rr_graph_interposer_cut' of https://github.com/verilog-…
amin1377 Nov 19, 2025
e264986
[vpr][route][rr_graph] remove redundant includes
amin1377 Nov 19, 2025
2aa56e2
[lib][rr_graph] remove data structures related to partioning edges fr…
amin1377 Nov 19, 2025
53490a8
[vpr][route][crr] add remove_dangling_chan_nodes
amin1377 Nov 19, 2025
91c8da5
[lib][rr_graph] remove unlock_storage from rr_graph_builder
amin1377 Nov 20, 2025
e888c7d
[lib][rr_graph][storage] return from remove_edges if parameter is empty
amin1377 Nov 20, 2025
3e839fb
[lib][rr_graph][storage] don't set edges_read_ in init_fan_in
amin1377 Nov 20, 2025
cd4ee33
[lib][rr_graph][storage] fix the bug in remove_nodes
amin1377 Nov 20, 2025
2701610
[vpr][route][crr] rebuild rr graph spatial lookup in remove_dangling_…
amin1377 Nov 20, 2025
56d6981
Merge branch 'remove_node' of https://github.com/verilog-to-routing/v…
amin1377 Nov 24, 2025
19cf552
Merge branch 'master' of https://github.com/verilog-to-routing/vtr-ve…
amin1377 Nov 24, 2025
a135426
Merge branch 'remove_node' of https://github.com/verilog-to-routing/v…
amin1377 Nov 24, 2025
15d69c5
[vpr][route][crr] fix lookup manager bug
amin1377 Nov 24, 2025
df4552d
make format
amin1377 Nov 24, 2025
eb86cfe
[libs][yaml] add -Wno-switch-default for yaml
amin1377 Nov 24, 2025
613989f
[libs][External] set yaml-cpp to system lib
amin1377 Nov 24, 2025
4a4f3c3
[lib][rr_graph] return unlock_storage since it is needed by OpenFPGA
amin1377 Nov 25, 2025
42b9dd4
Merge branch 'master' of https://github.com/verilog-to-routing/vtr-ve…
amin1377 Nov 25, 2025
e933685
[vpr][route][crr] add crr_id to Connection
amin1377 Nov 25, 2025
9135061
[vpr][route][crr] add get_pattern_file_name
amin1377 Nov 25, 2025
7cb89f7
[vpr][route][crr] add get_switch_block_name
amin1377 Nov 25, 2025
0608908
[vpr][route][crr] pass crr id to create_edge_in_cache
amin1377 Nov 25, 2025
0415387
[vpr][route][crr] pass crr id when making crr connections
amin1377 Nov 25, 2025
94b1a3b
[lib][rr_graph] add crr_id to t_rr_edge_info
amin1377 Nov 26, 2025
a5fcbc8
[lib][rr_graph] pass crr_id to create_edge_in_cache
amin1377 Nov 26, 2025
a9f1a43
[lib][rr_graph] add edge_crr_id_ to rr_graph_storage
amin1377 Nov 26, 2025
a758d0b
[lib][rr_graph] fix crr_id
amin1377 Nov 26, 2025
9b8f934
[lib][rr_graph] add crr_id to emplace_back_edge
amin1377 Nov 26, 2025
4aaeb0f
[vpr][route][rr_graph] fix connection issue
amin1377 Nov 26, 2025
f35cde6
[lib][rr_graph] add edge_crr_id methos
amin1377 Nov 26, 2025
b2d8057
[lib][rr_graph][storage] add edge_crr_id
amin1377 Nov 27, 2025
915de4a
[cli] add sb_count_dir cli
amin1377 Nov 27, 2025
6c7365f
[lib][rr_graph] fix the bug with find_edges rr_graph_view
amin1377 Nov 27, 2025
ecec621
[vpr][base] add write_sb_count_stats to vpr analysis
amin1377 Nov 27, 2025
4c0f2dd
[vpr][base] add write_sb_count_stats to stats
amin1377 Nov 27, 2025
6a6eed7
[vpr][stats] add static funcs to read and trim csv files
amin1377 Nov 27, 2025
06a76d9
[vpr][base] write csv files in write_sb_count_stats
amin1377 Nov 27, 2025
702c6c6
[temp][lib] revert capnp support
amin1377 Nov 27, 2025
52e73fa
[temp][lib] revert capnp support
amin1377 Nov 27, 2025
4b90bd0
Merge branch 'master' of https://github.com/verilog-to-routing/vtr-ve…
amin1377 Nov 28, 2025
5eedb46
[vpr][base] add static identifier for write_csv
amin1377 Nov 28, 2025
ac5e489
make format
amin1377 Nov 28, 2025
1fa6dc2
[vpr][base] fix size_t to int cast
amin1377 Nov 28, 2025
5f5a764
[doc] add lan_and_tap figures
amin1377 Nov 29, 2025
0fdc5f0
[doc] add crr doc
amin1377 Nov 29, 2025
6dbd7cf
Merge branch 'master' of https://github.com/verilog-to-routing/vtr-ve…
amin1377 Nov 29, 2025
40f8216
Merge branch 'master' of https://github.com/verilog-to-routing/vtr-ve…
amin1377 Dec 1, 2025
3c8705f
[cli] update reg_strong golden
amin1377 Dec 1, 2025
d7f3183
[cli] update odin golden
amin1377 Dec 1, 2025
ee938f3
[vpr][route][crr] fix format
amin1377 Dec 1, 2025
345668d
[vpr][route][crr] add switches not found in architecutre
amin1377 Dec 1, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@
[submodule "libs/EXTERNAL/yosys-slang"]
path = libs/EXTERNAL/yosys-slang
url = https://github.com/povik/yosys-slang.git
[submodule "libs/EXTERNAL/yaml-cpp"]
path = libs/EXTERNAL/yaml-cpp
url = https://github.com/jbeder/yaml-cpp.git
[submodule "libs/EXTERNAL/libsdcparse"]
path = libs/EXTERNAL/libsdcparse
url = https://github.com/verilog-to-routing/libsdcparse.git
102 changes: 102 additions & 0 deletions doc/src/vpr/custom_rr_graph.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
.. _custom_rr_graph:

Custom RR Graph
===============

For users who want more control over how connections are made in the routing resource graph, VPR provides a way to describe them through a Custom RR Graph (CRR) generator.

Currently, the CRR Generator is only based on the tileable RR Graph. Support for the default VPR RR Graph Generator is in progress. To generate a CRR, the following files are required:

* Switch block map file
* Switch block template files

Switch Block Map File
~~~~~~~~~~~~~~~~~~~~~~

This is a YAML file that specifies which switch block template should be used for each tile. The mapping format supports the following patterns:

* ``SB_1__1_: [sb_template.csv]`` - Tile at location (1, 1) uses switch block template ``sb_template.csv``
* ``SB_1__*_: [sb_template.csv]`` - All tiles with x coordinate 1 use switch block template ``sb_template.csv``
* ``SB_[7,20]__[2:32:3]_: [sb_template.csv]`` - Tiles with x equal to 7 or 20, and y coordinates from 2 to 32 (inclusive) with step 3 use switch block template ``sb_template.csv``

**Important:** The order in which patterns are defined matters, as the first matching pattern is used.

Switch Block Template Files
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Terminology
-----------

Before describing the template files, let's define some key terminology:

**Lane:** A group of wires with the same length. The starting points of consecutive wires in a lane are one switch block apart.

**Tap:** A switch block location where a wire passes through and can have fan-out connections.

See the figure below for an illustration:

.. figure:: images/lane_and_tap.png
:alt: Lane and Tap
:width: 50%
:align: center

In the figure above, the taps for the red wire are shown, and the lanes are separated by dotted lines. Note that the figure is simplified for illustration purposes.

In the actual RR Graph, when a wire passes through a switch block, its track number changes. Below is a more realistic example:

.. figure:: images/lane_and_tap_realistic.png
:alt: Lane and Tap Realistic
:width: 50%
:align: center

A more realistic example of a lane and a tap. Each box contains a lane.

Template File Format
--------------------

There should be a directory containing the pattern files specified in the switch block maps file. Each template is a CSV file with the following format:

* **Rows** represent source nodes
* **Columns** represent sink nodes
* An **'x' mark** at an intersection indicates that the source and sink nodes are connected
* A **number** at an intersection indicates that the nodes are connected with the switch delay specified by that number

**Note:** The pattern currently only supports uni-directional segments. Therefore, wires can only be driven from their starting point.

Row Headers (Source Nodes)
^^^^^^^^^^^^^^^^^^^^^^^^^^^

Each row has four header columns describing the source node:

1. **Column 1 - Direction:** The side from which the source node is entering the switch block (e.g., 'left', 'right', 'top', 'bottom')
2. **Column 2 - Segment Type:** The segment length to which the source node belongs
3. **Column 3 - Lane Number:** The lane to which the source node belongs (see terminology above)
4. **Column 4 - Tap Number:** Which tap of the source node is at this switch block

Column Headers (Sink Nodes)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Each column has header rows describing the sink node:

1. **Row 1 - Direction:** The side from which the sink node is exiting the switch block
2. **Row 2 - Segment Type:** The segment length to which the sink node belongs
3. **Row 3 - Fan-in:** The fan-in of the sink node (optional)
4. **Row 4 - Lane Number:** The lane to which the sink node belongs

Example
^^^^^^^

Let’s consider an architecture with a channel width of 16 that contains only wire segments of length 4.

The number of rows should be calculated as:

- ``4`` (number of sides) × ``160/2`` (number of tracks in one direction) = ``320`` rows.

On each side, there should be:

- ``20`` lanes (``80 / 4``), and
- each lane requires ``4`` rows (because length-4 wires require 4 tap positions).

For the columns, the count should be:

- ``4`` (number of sides) × ``160/2`` (number of tracks in one direction) ÷ ``4`` (number of starting tracks per lane) = ``80`` columns.
Binary file added doc/src/vpr/lane_and_tap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added doc/src/vpr/lane_and_tap_realistic.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 10 additions & 0 deletions libs/EXTERNAL/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,16 @@ add_subdirectory(libsdcparse)
add_subdirectory(libblifparse)
add_subdirectory(libtatum)
add_subdirectory(libcatch2)

add_subdirectory(yaml-cpp)
# Treat yaml-cpp headers as system headers to suppress warnings
if(TARGET yaml-cpp)
get_target_property(YAML_INCLUDE_DIRS yaml-cpp INTERFACE_INCLUDE_DIRECTORIES)
set_target_properties(yaml-cpp PROPERTIES
INTERFACE_SYSTEM_INCLUDE_DIRECTORIES "${YAML_INCLUDE_DIRS}"
)
endif()

#add_subdirectory(parmys)

#Proc numbers
Expand Down
1 change: 1 addition & 0 deletions libs/EXTERNAL/yaml-cpp
Submodule yaml-cpp added at a83cd3
8 changes: 6 additions & 2 deletions libs/librrgraph/src/base/rr_edge.h
Original file line number Diff line number Diff line change
@@ -1,20 +1,24 @@
#pragma once

#include <string>

#include "physical_types.h"
#include "librrgraph_types.h"
#include "rr_graph_fwd.h"

struct t_rr_edge_info {
t_rr_edge_info(RRNodeId from, RRNodeId to, short type, bool is_remapped) noexcept
t_rr_edge_info(RRNodeId from, RRNodeId to, short type, bool is_remapped, std::string crr_id_="") noexcept
: from_node(from)
, to_node(to)
, switch_type(type)
, remapped(is_remapped) {}
, remapped(is_remapped)
, crr_id(std::move(crr_id_)) {}

RRNodeId from_node = RRNodeId::INVALID();
RRNodeId to_node = RRNodeId::INVALID();
short switch_type = LIBRRGRAPH_UNDEFINED_VAL;
bool remapped = false;
std::string crr_id = "";

friend bool operator<(const t_rr_edge_info& lhs, const t_rr_edge_info& rhs) {
VTR_ASSERT(lhs.remapped == rhs.remapped);
Expand Down
4 changes: 2 additions & 2 deletions libs/librrgraph/src/base/rr_graph_builder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -176,8 +176,8 @@ void RRGraphBuilder::reorder_nodes(e_rr_node_reorder_algorithm reorder_rr_graph_
});
}

void RRGraphBuilder::create_edge_in_cache(RRNodeId src, RRNodeId dest, RRSwitchId edge_switch, bool remapped) {
edges_to_build_.emplace_back(src, dest, size_t(edge_switch), remapped);
void RRGraphBuilder::create_edge_in_cache(RRNodeId src, RRNodeId dest, RRSwitchId edge_switch, bool remapped, std::string crr_id_) {
edges_to_build_.emplace_back(src, dest, size_t(edge_switch), remapped, std::move(crr_id_));
is_edge_dirty_ = true; // Adding a new edge revokes the flag
is_incoming_edge_dirty_ = true;
}
Expand Down
18 changes: 14 additions & 4 deletions libs/librrgraph/src/base/rr_graph_builder.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
*
*/

#include <string>
#include "rr_graph_storage.h"
#include "rr_spatial_lookup.h"
#include "metadata_storage.h"
Expand Down Expand Up @@ -289,7 +290,7 @@ class RRGraphBuilder {

/** @brief Add a new edge to the cache of edges to be built
* @note This will not add an edge to storage. You need to call build_edges() after all the edges are cached. */
void create_edge_in_cache(RRNodeId src, RRNodeId dest, RRSwitchId edge_switch, bool remapped);
void create_edge_in_cache(RRNodeId src, RRNodeId dest, RRSwitchId edge_switch, bool remapped, std::string crr_id_="");

/** @brief Add a new edge to the cache of edges to be built
* @note This will not add an edge to storage! You need to call build_edges() after all the edges are cached! */
Expand Down Expand Up @@ -332,8 +333,8 @@ class RRGraphBuilder {
* remap the arch switch id to rr switch id, the edge switch id of this edge shouldn't be changed. For example, when the intra-cluster graph
* is built and the rr-graph related to global resources are read from a file, this parameter is true since the intra-cluster switches are
* also listed in rr-graph file. So, we use that list to use the rr switch id instead of passing arch switch id for intra-cluster edges.*/
inline void emplace_back_edge(RRNodeId src, RRNodeId dest, short edge_switch, bool remapped) {
node_storage_.emplace_back_edge(src, dest, edge_switch, remapped);
inline void emplace_back_edge(RRNodeId src, RRNodeId dest, short edge_switch, bool remapped, std::string crr_id="") {
node_storage_.emplace_back_edge(src, dest, edge_switch, remapped, std::move(crr_id));
}
/** @brief Append 1 more RR node to the RR graph. */
inline void emplace_back() {
Expand Down Expand Up @@ -401,6 +402,16 @@ class RRGraphBuilder {
return node_storage_.count_rr_switches(arch_switch_inf, arch_switch_fanins);
}

/**
* @brief Unlock storage; required to modify an routing resource graph after edge is read
* @note This function is used by OpenFPGA and currently doesn't have any use in VPR code.
*/
inline void unlock_storage() {
node_storage_.edges_read_ = false;
node_storage_.partitioned_ = false;
node_storage_.clear_node_first_edge();
}

/** @brief Reserve the lists of nodes, edges, switches etc. to be memory efficient.
* This function is mainly used to reserve memory space inside RRGraph,
* when adding a large number of nodes/edge/switches/segments,
Expand All @@ -420,7 +431,6 @@ class RRGraphBuilder {
node_storage_.resize(size);
}


/** @brief This function resize rr_switch to accommodate size RR Switch. */
inline void resize_switches(size_t size) {
rr_switch_inf_.resize(size);
Expand Down
14 changes: 12 additions & 2 deletions libs/librrgraph/src/base/rr_graph_storage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,17 @@ void t_rr_graph_storage::reserve_edges(size_t num_edges) {
edge_dest_node_.reserve(num_edges);
edge_switch_.reserve(num_edges);
edge_remapped_.reserve(num_edges);
edge_crr_id_.reserve(num_edges);
}

void t_rr_graph_storage::emplace_back_edge(RRNodeId src, RRNodeId dest, short edge_switch, bool remapped) {
void t_rr_graph_storage::emplace_back_edge(RRNodeId src, RRNodeId dest, short edge_switch, bool remapped, std::string crr_id) {
// Cannot mutate edges once edges have been read!
VTR_ASSERT(!edges_read_);
edge_src_node_.emplace_back(src);
edge_dest_node_.emplace_back(dest);
edge_switch_.emplace_back(edge_switch);
edge_remapped_.emplace_back(remapped);
edge_crr_id_.emplace_back(crr_id);
}

// Typical node to edge ratio. This allows a preallocation guess for the edges
Expand All @@ -49,14 +51,16 @@ void t_rr_graph_storage::alloc_and_load_edges(const t_rr_edge_info_set* rr_edges
edge_dest_node_.reserve(new_capacity);
edge_switch_.reserve(new_capacity);
edge_remapped_.reserve(new_capacity);
edge_crr_id_.reserve(new_capacity);
}

for (const t_rr_edge_info& new_edge : *rr_edges_to_create) {
emplace_back_edge(
new_edge.from_node,
new_edge.to_node,
new_edge.switch_type,
new_edge.remapped);
new_edge.remapped,
new_edge.crr_id);
}
}

Expand Down Expand Up @@ -87,6 +91,7 @@ void t_rr_graph_storage::remove_edges(std::vector<RREdgeId>& rr_edges_to_remove)
edge_src_node_[erase_idx] = edge_src_node_[RREdgeId(edge_list_end)];
edge_switch_[erase_idx] = edge_switch_[RREdgeId(edge_list_end)];
edge_remapped_[erase_idx] = edge_remapped_[RREdgeId(edge_list_end)];
edge_crr_id_[erase_idx] = edge_crr_id_[RREdgeId(edge_list_end)];

// At this point we have no copies of what was at erase_idx and two copies of
// what was at the end of the list. If we make the list one element shorter,
Expand All @@ -101,6 +106,7 @@ void t_rr_graph_storage::remove_edges(std::vector<RREdgeId>& rr_edges_to_remove)
edge_src_node_.erase(edge_src_node_.begin() + edge_list_end + 1, edge_src_node_.end());
edge_switch_.erase(edge_switch_.begin() + edge_list_end + 1, edge_switch_.end());
edge_remapped_.erase(edge_remapped_.begin() + edge_list_end + 1, edge_remapped_.end());
edge_crr_id_.erase(edge_crr_id_.begin() + edge_list_end + 1, edge_crr_id_.end());

VTR_ASSERT(edge_dest_node_.size() == (starting_edge_count - rr_edges_to_remove.size()));

Expand All @@ -126,6 +132,7 @@ void t_rr_graph_storage::assign_first_edges() {
VTR_ASSERT(edge_dest_node_.size() == num_edges);
VTR_ASSERT(edge_switch_.size() == num_edges);
VTR_ASSERT(edge_remapped_.size() == num_edges);
VTR_ASSERT(edge_crr_id_.size() == num_edges);

while (true) {
VTR_ASSERT(first_edge_id < num_edges);
Expand Down Expand Up @@ -808,6 +815,7 @@ t_rr_graph_view t_rr_graph_storage::view() const {
vtr::make_const_array_view_id(edge_src_node_),
vtr::make_const_array_view_id(edge_dest_node_),
vtr::make_const_array_view_id(edge_switch_),
vtr::make_const_array_view_id(edge_crr_id_),
virtual_clock_network_root_idx_,
vtr::make_const_array_view_id(node_bend_start_),
vtr::make_const_array_view_id(node_bend_end_));
Expand Down Expand Up @@ -846,6 +854,7 @@ void t_rr_graph_storage::reorder(const vtr::vector<RRNodeId, RRNodeId>& order,
auto old_edge_dest_node = edge_dest_node_;
auto old_edge_switch = edge_switch_;
auto old_edge_remapped = edge_remapped_;
auto old_edge_crr_id = edge_crr_id_;
RREdgeId cur_edge(0);

// Reorder edges by source node
Expand All @@ -859,6 +868,7 @@ void t_rr_graph_storage::reorder(const vtr::vector<RRNodeId, RRNodeId>& order,
edge_dest_node_[cur_edge] = order[old_edge_dest_node[e]];
edge_switch_[cur_edge] = old_edge_switch[e];
edge_remapped_[cur_edge] = old_edge_remapped[e];
edge_crr_id_[cur_edge] = old_edge_crr_id[e];
cur_edge = RREdgeId(size_t(cur_edge) + 1);
}
}
Expand Down
Loading