Skip to content

Enhanced 3D Placement Cost and Router Lookahead with Cross-Die Delay #2348

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 274 commits into from
Nov 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
274 commits
Select commit Hold shift + click to select a range
974eeb5
decrease NUM_PL_NONTIMING_MOVE_TYPES NUM_PL_1ST_STATE_MOVE_TYPES by o…
amin1377 Jul 6, 2023
a13e38d
related to makeing unifrom inter die move being performed in state 2
amin1377 Jul 6, 2023
a55af92
pass a vild to_layer to find_loc_uniform
amin1377 Jul 6, 2023
c0e553f
remove redundant parts from inter layer uniform
amin1377 Jul 6, 2023
74fec5f
check whether rt node has a connection to other layer
amin1377 Jul 6, 2023
8ad1c01
comment unused parameter - debug get_min_cross_layer_delay
amin1377 Jul 6, 2023
847aed9
for the non-timing-driven moves, find a free layer at the given x-y l…
amin1377 Jul 6, 2023
4eec20d
add inter layer uniform only if several layers are on FPGA
amin1377 Jul 6, 2023
53193f3
if multiple layers are not available set num_2nd_state_avail_moves to…
amin1377 Jul 7, 2023
f313ded
add layer_num to t_pl_offset
amin1377 Jul 7, 2023
6b83d54
delete the assertion in has_path_to_sink that check sink type
amin1377 Jul 7, 2023
7f25d98
if node is of type sink, add it to heap even if it is not on the same…
amin1377 Jul 7, 2023
0a7d67a
set layer num when high fanout bb is set
Jul 9, 2023
b270a01
fix move idx to move name index for uniform inter layer move
Jul 9, 2023
8e0e147
if there is no switch assigned for inter-lie connection for connectio…
amin1377 Jul 10, 2023
cacd06c
debug: node type was used instead of node layer
amin1377 Jul 10, 2023
690c41e
multiply the area of fpga die by the number of layers to get the corr…
amin1377 Jul 10, 2023
74c61d1
add swap op numbers to parsed file
amin1377 Jul 10, 2023
ad11a17
put assertion to assert if uniform_inter_layer is called when there i…
amin1377 Jul 10, 2023
915be19
fix the white space for place stats
amin1377 Jul 10, 2023
3e6a734
add layer check to is_legal_swap_to_location
amin1377 Jul 10, 2023
e8b593b
get ref const
amin1377 Jul 10, 2023
335d3bd
incorporate layer num in hashing t_pl_loc
amin1377 Jul 10, 2023
476b879
fix the bug in UniformInterLayerMoveGenerator
amin1377 Jul 11, 2023
667169c
add gaurd to make sure that if capnproto is not supported, it doesn't…
amin1377 Jul 12, 2023
52ed8ba
fix the layer num in add_high_fanout_route_tree_to_heap
amin1377 Jul 12, 2023
451f11a
fix the router lookahead functions when capnp is not enabled
amin1377 Jul 12, 2023
d58c553
fix bounding box layer num in test_connection_router
amin1377 Jul 13, 2023
abae71b
change a field name in noc_storage
amin1377 Jul 13, 2023
fffb10d
sometimes the sink_node passed to connection router is equal to -1 - …
amin1377 Jul 13, 2023
1a30f13
fix calculate_all_path_delays_from_rr_node bounding box layer num - m…
amin1377 Jul 13, 2023
013f6b6
merge with inter_die_communication
amin1377 Jul 13, 2023
25278dd
instead of choosing only among layers other that the current layer, c…
amin1377 Jul 18, 2023
baefdf4
Merge branch 'master' into 3d_link_cost_in_placement
amin1377 Jul 19, 2023
e340ead
prevent loading RR graph again if it is already loaded
amin1377 Jul 24, 2023
f3df583
add assertion to find_free_layer
amin1377 Aug 7, 2023
de10ebb
add a new data structure (t_2D_bb) that only shows a bb on one layer
amin1377 Aug 8, 2023
603a816
change fields under PlacerMoveContext to take t_2D_tbb instead of t_b…
amin1377 Aug 8, 2023
d26138a
break the bb between layers - compute the cost for each layer
amin1377 Aug 8, 2023
ba05fce
make format
amin1377 Aug 8, 2023
cde9f28
add modified aman's arch for 3d experiments
amin1377 Aug 9, 2023
7532f9a
add a helper function to move utils to get the union of a vector of bbs
amin1377 Aug 9, 2023
6411e31
fix the issue with 3d bb in median move
amin1377 Aug 9, 2023
853c755
remove unused vars
amin1377 Aug 9, 2023
21c586c
allocate enough space for num_sink_pin_layer
amin1377 Aug 9, 2023
4757577
allocate enough space for xmin_edge
amin1377 Aug 9, 2023
3082c22
if layer doesn't have a valid bb, pass
amin1377 Aug 9, 2023
a20b1ca
fix a bug in median_move
amin1377 Aug 9, 2023
7be4426
direct conversion from distance
amin1377 Aug 10, 2023
ca6dc60
fix the bugs of 3d bb for placement
amin1377 Aug 10, 2023
143188f
make format
amin1377 Aug 10, 2023
e96e830
comment unused var - remove redundant assertions
amin1377 Aug 10, 2023
79af555
remove choosing free layer from centroid move
amin1377 Aug 10, 2023
2b37a24
remove choosing free layer fro median move
amin1377 Aug 10, 2023
3d465c5
remove choosing free layer from uniform move
amin1377 Aug 10, 2023
f77d024
add get_random_layer function to move utils + find_to_loc_uniform als…
amin1377 Aug 10, 2023
26f595a
make format
amin1377 Aug 10, 2023
3582150
remove unused vars
amin1377 Aug 10, 2023
3c1098a
fix the bug with layer_num
amin1377 Aug 11, 2023
eec5e62
assign pin_sink_count of all layer to new array to avoid getting non-…
amin1377 Aug 11, 2023
145ce31
initialize bb for all layers
amin1377 Aug 11, 2023
fcec332
initialze the bb for each layer around the source block
amin1377 Aug 12, 2023
4174061
update ts_layer_sink_pin_count only if the moving pin is of type rece…
amin1377 Aug 12, 2023
4faf7d8
solve merge conflicts with master - minor debugging
amin1377 Sep 12, 2023
8626f3f
fix a few formatting issues
amin1377 Sep 12, 2023
8f370cb
add to vpr command line argument: write_initial_place_file
amin1377 Sep 12, 2023
75dbaa6
merge with placement_debug_tool
amin1377 Sep 12, 2023
e8ed849
fix a bug with uniform inter layer
amin1377 Sep 12, 2023
d631206
increament the number passed to wirelength crossing by 1 since it sho…
amin1377 Sep 13, 2023
cca5134
Merge branch 'master' of https://github.com/verilog-to-routing/vtr-ve…
amin1377 Sep 13, 2023
3c3842d
consider source pin in the number passed to wirelength_crossing_count
amin1377 Sep 13, 2023
39d16d8
Merge branch 'placement_debug_tool' of https://github.com/verilog-to-…
amin1377 Sep 13, 2023
1d26ac0
print search range in debug info
amin1377 Sep 13, 2023
a8ed7e1
choose a random layer if number of layers is more than one
amin1377 Sep 13, 2023
900109e
assign layer num to search range
amin1377 Sep 13, 2023
d619202
solve the bug in union 2d tbb
amin1377 Sep 13, 2023
b661f37
fix node string layer num
amin1377 Sep 20, 2023
48380fd
comment on tbb data structures
amin1377 Sep 20, 2023
bcdae22
modify layer in t_pl_offset
amin1377 Sep 20, 2023
e4081dc
remove uniform_inter_layer from available moves
amin1377 Sep 20, 2023
9522517
set the max layer bounding box to num_layer - 1
amin1377 Sep 21, 2023
05b2ac5
comment the unused parameter
amin1377 Sep 21, 2023
66f7cd3
fix the max layer num
amin1377 Sep 21, 2023
9baa738
remove an unnecessary assertion
amin1377 Sep 21, 2023
1b74dad
solve the conflicts with master
amin1377 Sep 22, 2023
14ff50c
Merge branch 'add_place_debug_info' of https://github.com/verilog-to-…
amin1377 Sep 22, 2023
894cd88
Merge branch 'add_place_debug_info' of https://github.com/verilog-to-…
amin1377 Sep 22, 2023
75f2932
remove redundant header
amin1377 Sep 22, 2023
5602155
debug the layer number when pl_loc is subtracted
amin1377 Sep 22, 2023
2f9405e
Merge branch 'add_place_debug_info' of https://github.com/verilog-to-…
amin1377 Sep 22, 2023
c2336b1
simplify updating bb
amin1377 Sep 25, 2023
426f09d
update bb if xnew is not equal to xold
amin1377 Sep 25, 2023
b0d58d5
update bb coord if layer is changed
amin1377 Sep 25, 2023
32845de
rewrite how to calculate bb
amin1377 Sep 25, 2023
98d5b61
fix the inline static name
amin1377 Sep 25, 2023
e860289
remove a redunant check in place.cpp
amin1377 Sep 25, 2023
94d2562
make format
amin1377 Sep 25, 2023
328e222
remove a redundant if statemetn since there should be a bounding box …
amin1377 Sep 26, 2023
954a7b4
remove a redundant assignment
amin1377 Sep 26, 2023
091f8d6
make union_2d_tbb faster
amin1377 Sep 26, 2023
a93551a
don't need to create an object, just pass the constructor args
amin1377 Sep 26, 2023
10b3900
remove an unused var
amin1377 Sep 26, 2023
e11ff58
remove unused var
amin1377 Sep 26, 2023
7e96dd0
instead of assigning vectors, set a value whenever it is needes
amin1377 Sep 26, 2023
05800d9
write update_bb_same_layer to update bb when block is moved on the sa…
amin1377 Sep 28, 2023
897ac38
write update_bb_layer_changed to update bb when block is moved to a d…
amin1377 Sep 28, 2023
3b9ce85
remove unused var
amin1377 Sep 28, 2023
9cf4d7f
remove having separate bbs for median move generator
amin1377 Sep 28, 2023
0e637ca
minor debugging - change order of parameters
amin1377 Sep 28, 2023
e1ba007
remove an unused variable
amin1377 Sep 28, 2023
b50ba98
add two new vars to placer context to store layer bb
amin1377 Sep 29, 2023
e4e7e7b
use a 3d bb for median_move_generator
amin1377 Sep 30, 2023
2d3f9e3
add ts_bb* vars for a time when a 2D FPGA is used
amin1377 Oct 2, 2023
0f97816
impl get_bb_from_scratch and the separate layer version of it
amin1377 Oct 2, 2023
006c2d3
impl get_net_cost and get_net_layer_cost
amin1377 Oct 2, 2023
e2ccdba
impl update_layer_bb update_bb
amin1377 Oct 2, 2023
344ecee
impl get_non_updateable_bb get_non_updateable_layer_bb
amin1377 Oct 2, 2023
95f367a
impl get_net_wirelength_estimate and get_net_layer_wirelength_estimate
amin1377 Oct 2, 2023
8ea2da1
impl comp_bb_cost comp_layer_bb_cost
amin1377 Oct 2, 2023
91fa447
impl update_net_layer_bb update_net_bb
amin1377 Oct 2, 2023
a9e67c3
fix a problem with update_move_nets (use correct data structure when …
amin1377 Oct 2, 2023
514c68c
solve the bug in the order of parameters passed to update_bb
amin1377 Oct 2, 2023
b8a2043
minor formatting
amin1377 Oct 2, 2023
1227a41
use a signle layer num to print a node's coordinate
amin1377 Oct 2, 2023
d9fa137
add write_initial_placement option to place opt
amin1377 Oct 2, 2023
ec3a8ac
add is_init_place to print_place method
amin1377 Oct 2, 2023
a90955f
print initial placement if the parameter is passed
amin1377 Oct 2, 2023
98cfa49
add an assertion to t_2D_tbb to check that layer_num is bigger than o…
amin1377 Oct 2, 2023
f2eb879
rename t_2D_tbb to *_bb
amin1377 Oct 2, 2023
90f7589
comment on t_2D_bb
amin1377 Oct 2, 2023
bc67c4a
comment on print_place
amin1377 Oct 3, 2023
0b358d8
comment on layer_num_blocks in noc_storage
amin1377 Oct 3, 2023
30320ba
remove the remaining parts of inter layer move
amin1377 Oct 3, 2023
dd9014a
comment on is_multi_layer parameter passed to simple rl move generator
amin1377 Oct 3, 2023
a52f48e
comment on register_block_inter_layer_connection
amin1377 Oct 3, 2023
bc5d59e
comment on src_opin_inter_layer_delays - remove checking for IPIN int…
amin1377 Oct 3, 2023
0ebe3ed
if a from node is of type CHAN, it should be on the same layer as sink
amin1377 Oct 3, 2023
f52c3b4
remove unused vars
amin1377 Oct 3, 2023
7d2c952
remove layer assignment in the uniform move
amin1377 Oct 3, 2023
c845ccf
remove t_sink_inter_layer_connection
amin1377 Oct 3, 2023
d0da837
remove an unused variable
amin1377 Oct 3, 2023
9ae8a10
remove inter_layer_sw_id field from map lookahead
amin1377 Oct 3, 2023
d191ec2
fix a type in an assertion
amin1377 Oct 3, 2023
cb9a270
assign curr_bb data structures to the new one first, then update it
amin1377 Oct 4, 2023
ba2dd63
use the union of bbs across layers when median calculate bb from scratch
amin1377 Oct 4, 2023
fe8ffc3
impl union_2d_bb_incr
amin1377 Oct 4, 2023
aea8437
use union_2d_bb_incr in median move incr bb update
amin1377 Oct 4, 2023
e90d4f8
fix a typo
amin1377 Oct 4, 2023
97b8e0a
first num_edge should be updated, then, coords
amin1377 Oct 4, 2023
f6e948a
fix the order of parameter of union_2d_bb_incr
amin1377 Oct 4, 2023
b02d7d4
use the layer num of the current bb
amin1377 Oct 4, 2023
a9185ef
debug: pass the comparison results not the value of the var
amin1377 Oct 4, 2023
c8a41db
fix a bug with router lookahead: return inifinite cost instead of ass…
amin1377 Oct 4, 2023
ca72c45
Merge branch 'master' into 3d_link_cost_in_placement
vaughnbetz Oct 5, 2023
0e26a21
experiment: last 4 moves choose the free layer
amin1377 Oct 5, 2023
cf819c0
Merge branch '3d_link_cost_in_placement' of https://github.com/verilo…
amin1377 Oct 5, 2023
23e9045
fix the order of moves in move to string
amin1377 Oct 5, 2023
0a9c907
experiment: new move to change layer in addition to the random move
amin1377 Oct 5, 2023
33fc559
find_to_loc_median use to layer num instead of from layer num
amin1377 Oct 5, 2023
f461cfd
assign layer num to to_loc in feasible move
amin1377 Oct 5, 2023
5ee8d71
remove redundant assignment
amin1377 Oct 5, 2023
250a19f
last four move change layer in addition to new move and uniform move
amin1377 Oct 5, 2023
64f8c44
remove new move
amin1377 Oct 5, 2023
687d3c9
make the to layer num const
amin1377 Oct 5, 2023
e604e30
return to original: only uniform move change the layer
amin1377 Oct 5, 2023
ec971e6
Merge branch 'master' of https://github.com/verilog-to-routing/vtr-ve…
amin1377 Oct 6, 2023
2a31327
make format
amin1377 Oct 6, 2023
c97de47
new experiment: choose layer for last 4 layers
amin1377 Oct 10, 2023
9167e2f
reverse the prev expr.
amin1377 Oct 10, 2023
06498cf
assign loc layer right after declaration
amin1377 Oct 11, 2023
bcd511b
experiment: don't change layer after initial placement
amin1377 Oct 11, 2023
12925b4
Revert "experiment: don't change layer after initial placement"
amin1377 Oct 11, 2023
f86a7a7
for median move, choose a layer that has the highest number of blocks
amin1377 Oct 11, 2023
c7afe7a
for weighted median move, choose a layer that has the highest number …
amin1377 Oct 11, 2023
974ea6b
update calculate_centroid_loc to get the centroid of layers
amin1377 Oct 11, 2023
bd58a10
assign centroid layer to centroid and weighted centroid moves
amin1377 Oct 11, 2023
0200061
fix initialization of layer_blk_cnt
amin1377 Oct 11, 2023
a56ac72
Revert "assign centroid layer to centroid and weighted centroid moves"
amin1377 Oct 11, 2023
9aadfcf
decreament num block on layer if pin is not of driver type
amin1377 Oct 11, 2023
5d89b5f
assign centroid layer
amin1377 Oct 11, 2023
b5839fc
choose from.layer if centroid layer is not valid
amin1377 Oct 11, 2023
982726d
experiment: centroid moves change layer + random move
amin1377 Oct 11, 2023
6d25fa1
weighted median + median choose the layer with maximum number of sinks
amin1377 Oct 12, 2023
c140f9d
add a type to store BB type
amin1377 Oct 12, 2023
755125c
add ParsePlaceBoundingBox
amin1377 Oct 12, 2023
360870b
add a parameter to vpr to select bounding box mode
amin1377 Oct 12, 2023
04c3c75
add an addition parameter to hierarchy of functions that try to updat…
amin1377 Oct 12, 2023
68ac9b6
fix a typo
amin1377 Oct 12, 2023
cb7d470
remove some unused library
amin1377 Oct 12, 2023
90ae26d
impl inter_layer_connections_limited_to_opin
amin1377 Oct 12, 2023
ff118ed
determine the type of bb in try_place and pass it to related functions
amin1377 Oct 12, 2023
56703eb
if the architecture has only one layer, use cube bb
amin1377 Oct 13, 2023
4b5f829
Print bounding box mode when it is selected
amin1377 Oct 24, 2023
ddfab6f
remove initial placement id
amin1377 Oct 27, 2023
9fd835e
rename to layer_num_grid_locs
amin1377 Oct 27, 2023
55befbb
pass cube_bb to the global state
amin1377 Oct 27, 2023
d52b8b8
remove initial placement id
amin1377 Oct 27, 2023
4246443
rename to layer_num_grid_locs
amin1377 Oct 27, 2023
e3faf05
pass cube_bb to the global state
amin1377 Oct 27, 2023
59b3583
alloc swap data structure bb based on cube bb
amin1377 Oct 26, 2023
58034d8
add cube bb to check place
amin1377 Oct 26, 2023
b11c27d
call comp bb based on cube bb in try place
amin1377 Oct 26, 2023
3c0161f
allocate the correct bb based on cube bb
amin1377 Oct 26, 2023
8860c99
update get_bb_from_scratch to accept num_pin_layer_sink
amin1377 Oct 26, 2023
7f5bb17
add num_sink_layer to update_bb - initialize the placement context of…
amin1377 Oct 26, 2023
f1f70bf
move ts_layer_sink_pin_count initialization out of if block since it …
amin1377 Oct 26, 2023
ebcf3b7
add ts_layer_sink_pin_count to get_non_updateable_bb
amin1377 Oct 26, 2023
199dfe7
update num_sink_layer in update_bb
amin1377 Oct 26, 2023
8405bfa
add cube_bb under place context
amin1377 Oct 26, 2023
fb019b3
change some unnecessary assertion to assert_safe
amin1377 Oct 27, 2023
d916420
use global cube_bb to check whether a union of bbs needs to be used
amin1377 Oct 26, 2023
5d9a116
use cube bb to select the correct bb
amin1377 Oct 26, 2023
3d536c9
initialize num_sink_pin_layer for all layer in upbdate_bb
amin1377 Oct 26, 2023
4e63b69
add online doc for added parameters
amin1377 Oct 27, 2023
be6acd2
assert if centriod layer is not valid
amin1377 Oct 27, 2023
36a7b04
remove the extra line to initialize layer in rl moves
amin1377 Oct 27, 2023
f5f0abe
comment on cube bb and per-layer bb
amin1377 Oct 27, 2023
cea3c3e
remove redundant resizings
amin1377 Oct 28, 2023
84d512d
comment on cross-layer link delay field
Oct 31, 2023
2d4ab8f
remove an unused variable
amin1377 Nov 3, 2023
d495962
remove layer parameter from get_bb_incrementally
amin1377 Nov 3, 2023
1eda7f3
comment on union_2d_bb functions
amin1377 Nov 3, 2023
1256995
set bb_coord_new to zero if there isn't any sink on that layer
amin1377 Nov 3, 2023
b08492a
initialize xmin,etc with src locs
amin1377 Nov 3, 2023
10990d1
remove the multi_layer parameter from SimpleRLMoveGenerator constructor
amin1377 Nov 3, 2023
b109b9f
remove uniform_inter_layer_move_generator
amin1377 Nov 3, 2023
93fb9d7
fix a bug - comment on weighted_move layer
amin1377 Nov 3, 2023
977d98e
comment on why we need to decreament number of sinks
amin1377 Nov 3, 2023
015de7b
update has_path_to_sink to accomodate for sw block inter-layer connec…
amin1377 Nov 3, 2023
dca4108
forward declaration of static functions
amin1377 Nov 3, 2023
0a1c499
comment on has_path_to_sink
amin1377 Nov 4, 2023
b8617f4
comment on the case that BB should cover all layers
amin1377 Nov 4, 2023
78be619
comment on router delay profiler calculate_delay
amin1377 Nov 4, 2023
8135d80
comment on get_cost_from_src_opin
amin1377 Nov 4, 2023
1879400
comment on compute_router_src_opin_lookahead
amin1377 Nov 4, 2023
122ab4d
remove redundant min func
amin1377 Nov 4, 2023
17074d3
comment on get_min_cross_layer_delay
amin1377 Nov 4, 2023
f45c4d2
centroid loc is not always valid
amin1377 Nov 4, 2023
b2c9e71
make format
amin1377 Nov 6, 2023
9b1c60d
experiment: change std vec to array for num sink on each layer per net
amin1377 Nov 7, 2023
65fb007
initialize the num_sink ds to number of nets
amin1377 Nov 7, 2023
aa0b5e9
initialize num_sink per layer to OPEN instead of zero
amin1377 Nov 9, 2023
d18fc4f
define max_num_layers and change place.cpp to use that
amin1377 Nov 9, 2023
c5178e4
change placer context to use max_num_layer const
amin1377 Nov 9, 2023
114012a
add an assertion to check the maximum number of layers
amin1377 Nov 9, 2023
eb71943
fix a typo in number of layers
amin1377 Nov 9, 2023
cce3bc6
change vector of arrays to 2D matrix
amin1377 Nov 9, 2023
afbadb3
don't assign open to coords if there is no sink on that layer
amin1377 Nov 10, 2023
48a1b42
make format
amin1377 Nov 10, 2023
8d8c335
Merge branch 'master' into 3d_link_cost_in_placement
amin1377 Nov 10, 2023
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
16 changes: 16 additions & 0 deletions doc/src/vpr/command_line_usage.rst
Original file line number Diff line number Diff line change
Expand Up @@ -381,6 +381,9 @@ Use the options below to override this default naming behaviour.
.. option:: --write_placement_delay_lookup <file>

Writes the placement delay lookup to the specified file.
.. option:: --write_initial_place_file <file>

Writes out the the placement chosen by the initial placement algorithm to the specified file

.. option:: --outfile_prefix <string>

Expand Down Expand Up @@ -769,6 +772,19 @@ If any of init_t, exit_t or alpha_t is specified, the user schedule, with a fixe

**Default:** ``criticality_timing``

.. option:: --place_bounding_box_mode {auto_bb | cube_bb | per_layer_bb}

Specifies the type of the wirelength estimator used during placement. For single layer architectures, cube_bb (a 3D bounding box) is always used (and is the same as per_layer_bb).
For 3D architectures, cube_bb is appropriate if you can cross between layers at switch blocks, while if you can only cross between layers at output pins per_layer_bb (one bouding box per layer) is more accurate and appropriate.

``auto_bb``: The bounding box type is determined automatically based on the cross-layer connections.

``cube_bb``: ``cube_bb`` bounding box is used to estimate the wirelength.

``per_layer_bb``: ``per_layer_bb`` bounding box is used to estimate the wirelength

**Default:** ``auto_bb``

.. option:: --place_chan_width <int>

Tells VPR how many tracks a channel of relative width 1 is expected to need to complete routing of this circuit.
Expand Down
27 changes: 23 additions & 4 deletions libs/librrgraph/src/base/rr_graph_utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,9 @@
***************************************************************************/
#include <queue>
#include <random>
#include <algorithm>

#include "rr_graph_utils.h"

#include "vtr_memory.h"
#include "vtr_time.h"

#include "vpr_error.h"

#include "rr_graph_obj.h"
Expand Down Expand Up @@ -119,4 +115,27 @@ vtr::vector<RRNodeId, std::vector<RREdgeId>> get_fan_in_list(const RRGraphView&
});

return node_fan_in_list;
}

bool inter_layer_connections_limited_to_opin(const RRGraphView& rr_graph) {
bool limited_to_opin = true;
for (const auto& from_node : rr_graph.nodes()) {
for (t_edge_size edge : rr_graph.edges(from_node)) {
RRNodeId to_node = rr_graph.edge_sink_node(from_node, edge);
int from_layer = rr_graph.node_layer(from_node);
int to_layer = rr_graph.node_layer(to_node);

if (from_layer != to_layer) {
if (rr_graph.node_type(from_node) != e_rr_type::OPIN) {
limited_to_opin = false;
break;
}
}
}
if (!limited_to_opin) {
break;
}
}

return limited_to_opin;
}
8 changes: 8 additions & 0 deletions libs/librrgraph/src/base/rr_graph_utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,12 @@ vtr::vector<RRNodeId, std::vector<RREdgeId>> get_fan_in_list(const RRGraphView&
int seg_index_of_cblock(const RRGraphView& rr_graph, t_rr_type from_rr_type, int to_node);
int seg_index_of_sblock(const RRGraphView& rr_graph, int from_node, int to_node);

/**
* @brief This function checks whether all inter-die connections are form OPINs. Return "true"
* if that is the case. Can be used for multiple purposes. For example, to determine which type of bounding
* box to be used to estimate the wire-length of a net.
* @param rr_graph
* @return
*/
bool inter_layer_connections_limited_to_opin(const RRGraphView& rr_graph);
#endif
32 changes: 19 additions & 13 deletions libs/librrgraph/src/base/rr_graph_view.h
Original file line number Diff line number Diff line change
Expand Up @@ -234,14 +234,15 @@ class RRGraphView {
}

/** @brief Get string of information about routing resource node. The string will contain the following information.
* type, side, x_low, x_high, y_low, y_high, length, direction, segment_name
* type, side, x_low, x_high, y_low, y_high, length, direction, segment_name, layer num
* This function is inlined for runtime optimization.
*/
inline const std::string node_coordinate_to_string(RRNodeId node) const {
std::string start_x; //start x-coordinate
std::string start_y; //start y-coordinate
std::string end_x; //end x-coordinate
std::string end_y; //end y-coordinate
std::string layer_num_str; //layer number
std::string arrow; //direction arrow
std::string coordinate_string = node_type_string(node); //write the component's type as a routing resource node
coordinate_string += ":" + std::to_string(size_t(node)) + " "; //add the index of the routing resource node
Expand All @@ -256,12 +257,14 @@ class RRGraphView {
coordinate_string += ")"; //add the side of the routing resource node
// For OPINs and IPINs the starting and ending coordinate are identical, so we can just arbitrarily assign the start to larger values
// and the end to the lower coordinate
start_x = " (" + std::to_string(node_xhigh(node)) + ","; //start and end coordinates are the same for OPINs and IPINs
start_y = std::to_string(node_yhigh(node)) + ")";
start_x = " (" + std::to_string(node_xhigh(node)) + ","; //start and end coordinates are the same for OPINs and IPINs
start_y = std::to_string(node_yhigh(node)) + ",";
layer_num_str = std::to_string(node_layer(node)) + ")";
} else if (node_type(node) == SOURCE || node_type(node) == SINK) {
// For SOURCE and SINK the starting and ending coordinate are identical, so just use start
start_x = "(" + std::to_string(node_xhigh(node)) + ",";
start_y = std::to_string(node_yhigh(node)) + ")";
start_x = " (" + std::to_string(node_xhigh(node)) + ",";
start_y = std::to_string(node_yhigh(node)) + ",";
layer_num_str = std::to_string(node_layer(node)) + ")";
} else if (node_type(node) == CHANX || node_type(node) == CHANY) { //for channels, we would like to describe the component with segment specific information
RRIndexedDataId cost_index = node_cost_index(node);
int seg_index = rr_indexed_data_[cost_index].seg_index;
Expand All @@ -272,26 +275,29 @@ class RRGraphView {
arrow = "->"; //we will point the coordinates from start to finish, left to right

if (node_direction(node) == Direction::DEC) { //signal travels along decreasing direction

start_x = " (" + std::to_string(node_xhigh(node)) + ","; //start coordinates have large value
start_y = std::to_string(node_yhigh(node)) + ")";
end_x = "(" + std::to_string(node_xlow(node)) + ","; //end coordinates have smaller value
end_y = std::to_string(node_ylow(node)) + ")";
start_y = std::to_string(node_yhigh(node)) + ",";
end_x = " (" + std::to_string(node_xlow(node)) + ","; //end coordinates have smaller value
end_y = std::to_string(node_ylow(node)) + ",";
layer_num_str = std::to_string(node_layer(node)) + ")";
}

else { // signal travels in increasing direction, stays at same point, or can travel both directions
start_x = " (" + std::to_string(node_xlow(node)) + ","; //start coordinates have smaller value
start_y = std::to_string(node_ylow(node)) + ")";
end_x = "(" + std::to_string(node_xhigh(node)) + ","; //end coordinates have larger value
end_y = std::to_string(node_yhigh(node)) + ")";
start_y = std::to_string(node_ylow(node)) + ",";
end_x = " (" + std::to_string(node_xhigh(node)) + ","; //end coordinates have larger value
end_y = std::to_string(node_yhigh(node)) + ",";
layer_num_str = std::to_string(node_layer(node)) + ")"; //layer number
if (node_direction(node) == Direction::BIDIR) {
arrow = "<->"; //indicate that signal can travel both direction
}
}
}

coordinate_string += start_x + start_y; //Write the starting coordinates
coordinate_string += start_x + start_y + layer_num_str; //Write the starting coordinates
coordinate_string += arrow; //Indicate the direction
coordinate_string += end_x + end_y; //Write the end coordinates
coordinate_string += end_x + end_y + layer_num_str; //Write the end coordinates
return coordinate_string;
}

Expand Down
11 changes: 8 additions & 3 deletions utils/route_diag/src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,8 @@ static void do_one_route(const Netlist<>& net_list,
bounding_box.xmax = device_ctx.grid.width() + 1;
bounding_box.ymin = 0;
bounding_box.ymax = device_ctx.grid.height() + 1;
bounding_box.layer_min = 0;
bounding_box.layer_max = device_ctx.grid.get_num_layers() - 1;

t_conn_cost_params cost_params;
cost_params.criticality = router_opts.max_criticality;
Expand Down Expand Up @@ -203,9 +205,12 @@ static void profile_source(const Netlist<>& net_list,
vtr::ScopedStartFinishTimer delay_timer(vtr::string_fmt(
"Routing Src: %d Sink: %d", source_rr_node,
sink_rr_node));
successfully_routed = profiler.calculate_delay(RRNodeId(source_rr_node), RRNodeId(sink_rr_node),
router_opts,
&delays[sink_x][sink_y]);

successfully_routed = profiler.calculate_delay(RRNodeId(source_rr_node),
RRNodeId(sink_rr_node),
router_opts,
&delays[sink_x][sink_y],
layer_num);
}

if (successfully_routed) {
Expand Down
3 changes: 3 additions & 0 deletions vpr/src/base/SetupVPR.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -622,6 +622,8 @@ static void SetupPlacerOpts(const t_options& Options, t_placer_opts* PlacerOpts)

PlacerOpts->constraints_file = Options.constraints_file;

PlacerOpts->write_initial_place_file = Options.write_initial_place_file;

PlacerOpts->pad_loc_type = Options.pad_loc_type;

PlacerOpts->place_chan_width = Options.PlaceChanWidth;
Expand Down Expand Up @@ -661,6 +663,7 @@ static void SetupPlacerOpts(const t_options& Options, t_placer_opts* PlacerOpts)
PlacerOpts->place_static_move_prob = Options.place_static_move_prob;
PlacerOpts->place_static_notiming_move_prob = Options.place_static_notiming_move_prob;
PlacerOpts->place_high_fanout_net = Options.place_high_fanout_net;
PlacerOpts->place_bounding_box_mode = Options.place_bounding_box_mode;
PlacerOpts->RL_agent_placement = Options.RL_agent_placement;
PlacerOpts->place_agent_multistate = Options.place_agent_multistate;
PlacerOpts->place_checkpointing = Options.place_checkpointing;
Expand Down
54 changes: 54 additions & 0 deletions vpr/src/base/read_options.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -430,6 +430,41 @@ struct ParsePlaceAlgorithm {
}
};

struct ParsePlaceBoundingBox {
ConvertedValue<e_place_bounding_box_mode> from_str(std::string str) {
ConvertedValue<e_place_bounding_box_mode> conv_value;
if (str == "auto_bb") {
conv_value.set_value(AUTO_BB);
} else if (str == "cube_bb") {
conv_value.set_value(CUBE_BB);
} else if (str == "per_layer_bb") {
conv_value.set_value(PER_LAYER_BB);
} else {
std::stringstream msg;
msg << "Invalid conversion from '" << str << "' to e_place_algorithm (expected one of: " << argparse::join(default_choices(), ", ") << ")";
conv_value.set_error(msg.str());
}
return conv_value;
}

ConvertedValue<std::string> to_str(e_place_bounding_box_mode val) {
ConvertedValue<std::string> conv_value;
if (val == AUTO_BB) {
conv_value.set_value("auto_bb");
} else if (val == CUBE_BB) {
conv_value.set_value("cube_bb");
} else {
VTR_ASSERT(val == PER_LAYER_BB);
conv_value.set_value("per_layer_bb");
}
return conv_value;
}

std::vector<std::string> default_choices() {
return {"auto_bb", "cube_bb", "per_layer_bb"};
}
};

struct ParsePlaceAgentAlgorithm {
ConvertedValue<e_agent_algorithm> from_str(std::string str) {
ConvertedValue<e_agent_algorithm> conv_value;
Expand Down Expand Up @@ -1569,6 +1604,11 @@ argparse::ArgumentParser create_arg_parser(std::string prog_name, t_options& arg
.metavar("RR_GRAPH_FILE")
.show_in(argparse::ShowIn::HELP_ONLY);

file_grp.add_argument(args.write_initial_place_file, "--write_initial_place_file")
.help("Writes out the the placement chosen by the initial placement algorithm to the specified file")
.metavar("INITIAL_PLACE_FILE")
.show_in(argparse::ShowIn::HELP_ONLY);

file_grp.add_argument(args.read_vpr_constraints_file, "--read_vpr_constraints")
.help("Reads the floorplanning constraints that packing and placement must respect from the specified XML file.")
.show_in(argparse::ShowIn::HELP_ONLY);
Expand Down Expand Up @@ -2007,6 +2047,20 @@ argparse::ArgumentParser create_arg_parser(std::string prog_name, t_options& arg
.default_value("10")
.show_in(argparse::ShowIn::HELP_ONLY);

place_grp.add_argument<e_place_bounding_box_mode, ParsePlaceBoundingBox>(args.place_bounding_box_mode, "--place_bounding_box_mode")
.help(
"Specifies the type of bounding box to be used in 3D architectures.\n"
"\n"
"MODE options:\n"
" auto_bb : Automatically determine the appropriate bounding box based on the connections between layers.\n"
" cube_bb : Use 3D bounding boxes.\n"
" per_layer_bb : Use per-layer bounding boxes.\n"
"\n"
"Choose one of the available modes to define the behavior of bounding boxes in your 3D architecture. The default mode is 'automatic'.")
.default_value("auto_bb")
.choices({"auto_bb", "cube_bb", "per_layer_bb"})
.show_in(argparse::ShowIn::HELP_ONLY);

place_grp.add_argument<bool, ParseOnOff>(args.RL_agent_placement, "--RL_agent_placement")
.help(
"Uses a Reinforcement Learning (RL) agent in choosing the appropiate move type in placement."
Expand Down
2 changes: 2 additions & 0 deletions vpr/src/base/read_options.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ struct t_options {
argparse::ArgValue<std::string> constraints_file;
argparse::ArgValue<std::string> write_rr_graph_file;
argparse::ArgValue<std::string> read_rr_graph_file;
argparse::ArgValue<std::string> write_initial_place_file;
argparse::ArgValue<std::string> read_vpr_constraints_file;
argparse::ArgValue<std::string> write_vpr_constraints_file;

Expand Down Expand Up @@ -127,6 +128,7 @@ struct t_options {
argparse::ArgValue<std::vector<float>> place_static_move_prob;
argparse::ArgValue<std::vector<float>> place_static_notiming_move_prob;
argparse::ArgValue<int> place_high_fanout_net;
argparse::ArgValue<e_place_bounding_box_mode> place_bounding_box_mode;

argparse::ArgValue<bool> RL_agent_placement;
argparse::ArgValue<bool> place_agent_multistate;
Expand Down
2 changes: 2 additions & 0 deletions vpr/src/base/vpr_api.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -452,6 +452,8 @@ void vpr_create_device_grid(const t_vpr_setup& vpr_setup, const t_arch& Arch) {
float target_device_utilization = vpr_setup.PackerOpts.target_device_utilization;
device_ctx.grid = create_device_grid(vpr_setup.device_layout, Arch.grid_layouts, num_type_instances, target_device_utilization);

VTR_ASSERT_MSG(device_ctx.grid.get_num_layers() <= MAX_NUM_LAYERS, "Number of layers should be less than MAX_NUM_LAYERS. If you need more layers, please increase the value of MAX_NUM_LAYERS in vpr_types.h");

/*
*Report on the device
*/
Expand Down
6 changes: 6 additions & 0 deletions vpr/src/base/vpr_context.h
Original file line number Diff line number Diff line change
Expand Up @@ -402,6 +402,12 @@ struct PlacementContext : public Context {
* placer_debug_net or placer_debug_block parameters in the command line.
*/
bool f_placer_debug = false;

/**
* Set this variable to ture if the type of the bounding box used in placement is of the type cube. If it is false,
* it would mean that per-layer bounding box is used. For the 2D architecture, the cube bounding box would be used.
*/
bool cube_bb = false;
};

/**
Expand Down
Loading