Skip to content

6D Router Lookahead #2445

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 46 commits into from
Nov 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
f497866
add another dimention, to_layer, to t_wire_cost_map - update test_map…
amin1377 Oct 24, 2023
90bfcd8
update run_dijkstra to not skip nodes on other layers and update t_ro…
amin1377 Oct 24, 2023
84dae95
update get_wire_cost_entry and set_lookahead_map_costs to accept both…
amin1377 Oct 24, 2023
e9e3b30
fix fill_in_missing_lookahead_entries with from_layer_num and to_laye…
amin1377 Oct 24, 2023
eeacb34
remove the special case for channel between different layers
amin1377 Oct 24, 2023
71c2d84
impl get_tile_src_opin_max_ptc_from_rr_graph
amin1377 Oct 24, 2023
6b40d85
remove the extra map to store seg type accessible from OPIN to other …
amin1377 Oct 24, 2023
40dcae0
update router lookahead extended map with the new changes
amin1377 Oct 24, 2023
d39523f
fix the function calling inside router_lookahead_map with the new int…
amin1377 Oct 24, 2023
46e0376
remove src_opin_inter_layer_delays from router_lookahead_map
amin1377 Oct 24, 2023
37de756
pass the true src_opin_delay map to get_cost
amin1377 Oct 24, 2023
e2dcdda
pass to_layer_num to get_cost func of map_extended router lookahead
amin1377 Oct 24, 2023
c70517c
fix the index ordering of src_opin_delays
amin1377 Oct 24, 2023
b94fcc7
alloc swap data structure bb based on cube bb
amin1377 Oct 26, 2023
c69318c
add cube bb to check place
amin1377 Oct 26, 2023
c1d3681
call comp bb based on cube bb in try place
amin1377 Oct 26, 2023
4eb6cb8
remove unused variables
amin1377 Oct 26, 2023
c3a2470
allocate the correct bb based on cube bb
amin1377 Oct 26, 2023
1291e37
update get_bb_from_scratch to accept num_pin_layer_sink
amin1377 Oct 26, 2023
365ca56
add num_sink_layer to update_bb - initialize the placement context of…
amin1377 Oct 26, 2023
2b2cda5
move ts_layer_sink_pin_count initialization out of if block since it …
amin1377 Oct 26, 2023
147e36a
add ts_layer_sink_pin_count to get_non_updateable_bb
amin1377 Oct 26, 2023
c3b5377
update num_sink_layer in update_bb
amin1377 Oct 26, 2023
d7fe06b
add cube_bb under place context
amin1377 Oct 26, 2023
26b38ee
use global cube_bb to check whether a union of bbs needs to be used
amin1377 Oct 26, 2023
ed02d00
use cube bb to select the correct bb
amin1377 Oct 26, 2023
a57215f
remove unused variable
amin1377 Oct 26, 2023
b65a0c0
make format
amin1377 Oct 26, 2023
5ccf453
initialize num_sink_pin_layer for all layer in upbdate_bb
amin1377 Oct 26, 2023
b729a41
Merge branch '3d_link_cost_in_placement' of https://github.com/verilo…
amin1377 Nov 6, 2023
b3b2aa8
get physical_tile first
amin1377 Nov 6, 2023
2c6fab8
comment on why src_opin_... is resized
amin1377 Nov 6, 2023
ba719e1
fix the debugging message for rr_graph node
amin1377 Nov 6, 2023
eb5140e
add layer_num to info of reachable segments
amin1377 Nov 6, 2023
1ea2bf8
set the cost to zero in the empty cost only if layers are equal
amin1377 Nov 6, 2023
12f2ca6
use the reachable segment layer num
amin1377 Nov 6, 2023
bcd1550
remove redundant comments from timing_driven_route_connection_from_heap
amin1377 Nov 6, 2023
2afda40
Merge branch 'master' of https://github.com/verilog-to-routing/vtr-ve…
amin1377 Nov 17, 2023
c036b0b
remove an unused parameter
amin1377 Nov 17, 2023
dc870aa
fix how node layer is shown for rr node
amin1377 Nov 17, 2023
e557f08
comment on router lookahead 6d arrqy
amin1377 Nov 18, 2023
b8b3995
Merge branch 'master' of https://github.com/verilog-to-routing/vtr-ve…
amin1377 Nov 22, 2023
4ef2932
add comment on get_tile_src_opin_max_ptc_from_rr_graph
amin1377 Nov 23, 2023
360f1b0
comment on t_wire_cost_map
amin1377 Nov 23, 2023
afba6ac
fix some comments
amin1377 Nov 23, 2023
bb34dc8
fix a typo
amin1377 Nov 23, 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
19 changes: 12 additions & 7 deletions libs/librrgraph/src/base/rr_graph_view.h
Original file line number Diff line number Diff line change
Expand Up @@ -242,10 +242,13 @@ class RRGraphView {
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 start_layer_str; //layer number
std::string end_layer_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

int node_layer_num = node_layer(node);
if (node_type(node) == OPIN || node_type(node) == IPIN) {
coordinate_string += "side: ("; //add the side of the routing resource node
for (const e_side& node_side : SIDES) {
Expand All @@ -259,12 +262,12 @@ class RRGraphView {
// 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)) + ",";
layer_num_str = std::to_string(node_layer(node)) + ")";
start_layer_str = std::to_string(node_layer_num) + ")";
} 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)) + ",";
layer_num_str = std::to_string(node_layer(node)) + ")";
start_layer_str = std::to_string(node_layer_num) + ")";
} 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 @@ -278,26 +281,28 @@ class RRGraphView {

start_x = " (" + std::to_string(node_xhigh(node)) + ","; //start coordinates have large value
start_y = std::to_string(node_yhigh(node)) + ",";
start_layer_str = std::to_string(node_layer_num);
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)) + ")";
end_layer_str = std::to_string(node_layer_num) + ")";
}

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)) + ",";
start_layer_str = std::to_string(node_layer_num);
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
end_layer_str = std::to_string(node_layer_num) + ")"; //layer number
if (node_direction(node) == Direction::BIDIR) {
arrow = "<->"; //indicate that signal can travel both direction
}
}
}

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

Expand Down
2 changes: 0 additions & 2 deletions vpr/src/route/connection_router.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -203,8 +203,6 @@ t_heap* ConnectionRouter<Heap>::timing_driven_route_connection_from_heap(RRNodeI
const t_conn_cost_params cost_params,
t_bb bounding_box) {
VTR_ASSERT_SAFE(heap_.is_valid());
//std::cout << "using this: " << (void *)this << "\n";
//std::cout << "using heap: " << heap_.get_ptr() << "\n";

if (heap_.is_empty_heap()) { //No source
VTR_LOGV_DEBUG(router_debug_, " Initial heap empty (no source)\n");
Expand Down
12 changes: 7 additions & 5 deletions vpr/src/route/router_lookahead_extended_map.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ static std::pair<float, int> run_dijkstra(RRNodeId start_node,
std::vector<util::Search_Path>* paths,
util::RoutingCosts* routing_costs);

std::pair<float, float> ExtendedMapLookahead::get_src_opin_cost(RRNodeId from_node, int delta_x, int delta_y, const t_conn_cost_params& params) const {
std::pair<float, float> ExtendedMapLookahead::get_src_opin_cost(RRNodeId from_node, int delta_x, int delta_y, int to_layer_num, const t_conn_cost_params& params) const {
auto& device_ctx = g_vpr_ctx.device();
auto& rr_graph = device_ctx.rr_graph;

Expand Down Expand Up @@ -109,7 +109,7 @@ std::pair<float, float> ExtendedMapLookahead::get_src_opin_cost(RRNodeId from_no
float expected_delay_cost = std::numeric_limits<float>::infinity();
float expected_cong_cost = std::numeric_limits<float>::infinity();

for (const auto& kv : this->src_opin_delays[from_layer_num][tile_index][from_ptc]) {
for (const auto& kv : this->src_opin_delays[from_layer_num][tile_index][from_ptc][to_layer_num]) {
const util::t_reachable_wire_inf& reachable_wire_inf = kv.second;

util::Cost_Entry cost_entry;
Expand Down Expand Up @@ -195,13 +195,15 @@ std::pair<float, float> ExtendedMapLookahead::get_expected_delay_and_cong(RRNode
int to_x = rr_graph.node_xlow(to_node);
int to_y = rr_graph.node_ylow(to_node);

int to_layer_num = rr_graph.node_layer(to_node);

int dx, dy;
dx = to_x - from_x;
dy = to_y - from_y;

e_rr_type from_type = rr_graph.node_type(from_node);
if (from_type == SOURCE || from_type == OPIN) {
return this->get_src_opin_cost(from_node, dx, dy, params);
return this->get_src_opin_cost(from_node, dx, dy, to_layer_num, params);
} else if (from_type == IPIN) {
return std::make_pair(0., 0.);
}
Expand Down Expand Up @@ -420,7 +422,7 @@ std::pair<float, int> ExtendedMapLookahead::run_dijkstra(RRNodeId start_node,

// compute the cost maps for lookahead
void ExtendedMapLookahead::compute(const std::vector<t_segment_inf>& segment_inf) {
std::tie(this->src_opin_delays, this->src_opin_inter_layer_delays) = util::compute_router_src_opin_lookahead(is_flat_);
this->src_opin_delays = util::compute_router_src_opin_lookahead(is_flat_);

this->chan_ipins_delays = util::compute_router_chan_ipin_lookahead();

Expand Down Expand Up @@ -616,7 +618,7 @@ void ExtendedMapLookahead::write(const std::string& file) const {
void ExtendedMapLookahead::read(const std::string& file) {
cost_map_.read(file);

std::tie(this->src_opin_delays, this->src_opin_inter_layer_delays) = util::compute_router_src_opin_lookahead(is_flat_);
this->src_opin_delays = util::compute_router_src_opin_lookahead(is_flat_);

this->chan_ipins_delays = util::compute_router_chan_ipin_lookahead();
}
Expand Down
5 changes: 1 addition & 4 deletions vpr/src/route/router_lookahead_extended_map.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,6 @@ class ExtendedMapLookahead : public RouterLookahead {
///<Look-up table from SOURCE/OPIN to CHANX/CHANY of various types
util::t_src_opin_delays src_opin_delays;

///< Lookup table from SOURCE/OPIN to CHANX/CHANY of the another layer
util::t_src_opin_inter_layer_delays src_opin_inter_layer_delays;

///<Look-up table from CHANX/CHANY to SINK/IPIN of various types
util::t_chan_ipins_delays chan_ipins_delays;

Expand All @@ -33,7 +30,7 @@ class ExtendedMapLookahead : public RouterLookahead {
* @param criticality_fac criticality of the current connection between 0 (all congestion) and 1 (all timing)
* @return expected cost to get to the destination
*/
std::pair<float, float> get_src_opin_cost(RRNodeId from_node, int delta_x, int delta_y, const t_conn_cost_params& params) const;
std::pair<float, float> get_src_opin_cost(RRNodeId from_node, int delta_x, int delta_y, int to_layer_num, const t_conn_cost_params& params) const;

/**
* @brief Returns the CHAN -> IPIN delay that gets added to the final expected delay
Expand Down
Loading