Skip to content

WIP: Enhancing VPR lookahead map #1351

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

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
8885050
Add connection box lookahead.
acomodi Jun 15, 2020
4f49a02
Integrate upstream uxsdcxx parser with connection box lookahead
acomodi Jun 15, 2020
b71a487
Complete connection box lookahead to be aware of connection box.
litghost Aug 16, 2019
596c10f
Mark file location function as static.
litghost Sep 27, 2019
15b676b
Add bounds checking when search grid.
litghost Oct 11, 2019
78ef779
Updates to connection box lookahead map.
litghost Oct 11, 2019
b351679
add documentation
HackerFoo Oct 23, 2019
3c1a190
un-shadow a variable
HackerFoo Oct 23, 2019
5d19549
remove method from set_cost_map
HackerFoo Oct 24, 2019
39af170
replace std::list with std::vector
HackerFoo Oct 24, 2019
aec3721
parallelize connection box lookahead
HackerFoo Oct 23, 2019
31b2f47
performance improvements
HackerFoo Oct 25, 2019
9d1aaa9
suggested changes
HackerFoo Oct 30, 2019
9c9437b
changes suggested in PR
HackerFoo Oct 31, 2019
8abd79f
add penalty to Cost_Map::find_cost for points outside of the map
HackerFoo Nov 1, 2019
e5ddec7
store penalties
HackerFoo Nov 2, 2019
f00073f
printf -> VTR_LOG
HackerFoo Nov 4, 2019
56a28ce
change sampling method
HackerFoo Nov 6, 2019
ff57a66
remove unnecessary lookups
HackerFoo Nov 6, 2019
afc36aa
remove SimpleCache, use vtr::hash_combine, add timing stats
HackerFoo Nov 7, 2019
2446c03
integrate lighost's patches
HackerFoo Nov 8, 2019
d654bd4
independently minimize delay and base cost (congestion)
HackerFoo Nov 11, 2019
24eeb80
Expand delay and base cost independently
HackerFoo Nov 14, 2019
578d084
site_pin_delay shouldn't affect congestion
HackerFoo Nov 14, 2019
bb9943e
use histogram to choose sample sizes, set minimum penalty
HackerFoo Nov 19, 2019
0eda42b
Use get_rr_cong_cost to compute base_cost's.
litghost Nov 21, 2019
01a3c41
run expansions in a region until a number of paths are found
HackerFoo Nov 26, 2019
a9f7b12
use std::make_tuple()
HackerFoo Dec 3, 2019
2c1631d
suggested changes
HackerFoo Dec 3, 2019
502acf9
Add debugging prints and add fill output to lookahead.
litghost Oct 31, 2019
8530fef
Fix missing #include <string>
hzeller Jan 29, 2020
669d580
Remove cached segment map from connection map lookahead file.
HackerFoo Feb 19, 2020
e6c691b
Refactor lookahead computation.
litghost Feb 21, 2020
7144db3
Skip empty windows.
litghost Feb 8, 2020
c900a78
vpr: lookahead map enhanced with CHAN -> IPIN delay information
acomodi Jun 8, 2020
feeab99
route: extract lookahead sampling to external file
acomodi Jun 15, 2020
880e40b
route: avoid using connection box information
acomodi Jun 15, 2020
b51ccec
make format
acomodi Jun 15, 2020
52014e7
lookahead: move connection box to router lookahead map
acomodi Jun 15, 2020
309a96d
Revert "Integrate upstream uxsdcxx parser with connection box lookahead"
acomodi Jun 15, 2020
1334f91
WIP: Fixes to have Series7 place-delay and lookahead being computed
acomodi Jun 15, 2020
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
1 change: 1 addition & 0 deletions libs/libvtrcapnproto/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ endif()
# Each schema used should appear here.
set(CAPNP_DEFS
place_delay_model.capnp
connection_map.capnp
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

connection_map.capnp shouldn't be required, because it isn't used?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or if we are going to use this, it should move to map_lookahead.capnp

matrix.capnp
gen/rr_graph_uxsdcxx.capnp
map_lookahead.capnp
Expand Down
25 changes: 25 additions & 0 deletions libs/libvtrcapnproto/connection_map.capnp
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
@0x876ec83c2fea5a18;

using Matrix = import "matrix.capnp";

struct VprCostEntry {
delay @0 :Float32;
congestion @1 :Float32;
fill @2 :Bool;
}

struct VprVector2D {
x @0 :Int64;
y @1 :Int64;
}

struct VprFloatEntry {
value @0 :Float32;
}

struct VprCostMap {
costMap @0 :Matrix.Matrix((Matrix.Matrix(VprCostEntry)));
offset @1 :Matrix.Matrix(VprVector2D);
depField @2 :List(Int64);
penalty @3 :Matrix.Matrix(VprFloatEntry);
}
1 change: 1 addition & 0 deletions vpr/src/base/SetupVPR.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,7 @@ void SetupVPR(const t_options* Options,
}

Segments = Arch->Segments;
device_ctx.segment_inf = Arch->Segments;

SetupSwitches(*Arch, RoutingArch, Arch->Switches, Arch->num_switches);
SetupRoutingArch(*Arch, RoutingArch);
Expand Down
2 changes: 2 additions & 0 deletions vpr/src/base/echo_files.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,8 @@ void alloc_and_load_echo_file_info() {
setEchoFileName(E_ECHO_CHAN_DETAILS, "chan_details.txt");
setEchoFileName(E_ECHO_SBLOCK_PATTERN, "sblock_pattern.txt");
setEchoFileName(E_ECHO_ENDPOINT_TIMING, "endpoint_timing.echo.json");

setEchoFileName(E_ECHO_LOOKAHEAD_MAP, "lookahead_map.echo");
}

void free_echo_file_info() {
Expand Down
1 change: 1 addition & 0 deletions vpr/src/base/echo_files.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ enum e_echo_files {
E_ECHO_CHAN_DETAILS,
E_ECHO_SBLOCK_PATTERN,
E_ECHO_ENDPOINT_TIMING,
E_ECHO_LOOKAHEAD_MAP,

//Timing Graphs
E_ECHO_PRE_PACKING_TIMING_GRAPH,
Expand Down
1 change: 1 addition & 0 deletions vpr/src/base/vpr_context.h
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ struct DeviceContext : public Context {
t_rr_node_indices rr_node_indices; //[0..NUM_RR_TYPES-1][0..grid.width()-1][0..grid.width()-1][0..size-1]

std::vector<t_rr_switch_inf> rr_switch_inf; /* autogenerated in build_rr_graph based on switch fan-in. [0..(num_rr_switches-1)] */
std::vector<t_segment_inf> segment_inf;

//Wire segment types in RR graph
std::vector<t_segment_inf> rr_segments;
Expand Down
5 changes: 3 additions & 2 deletions vpr/src/place/timing_place.h
Original file line number Diff line number Diff line change
Expand Up @@ -190,10 +190,11 @@ class PlacerTimingCosts {
num_levels_ = ilevel + 1;

size_t num_leaves = num_nodes_in_level(ilevel);
size_t num_level_before_leaves = num_nodes_in_level(ilevel - 1);
//size_t num_level_before_leaves = num_nodes_in_level(ilevel - 1);

VTR_ASSERT_MSG(num_leaves >= num_connections, "Need at least as many leaves as connections");
VTR_ASSERT_MSG(num_connections == 0 || num_level_before_leaves < num_connections, "Level before should have fewer nodes than connections (to ensure using the smallest binary tree)");
// XXX: Temporarily disabling this assertion as num_level_befor_leaves
//VTR_ASSERT_MSG(num_connections == 0 || num_level_before_leaves < num_connections, "Level before should have fewer nodes than connections (to ensure using the smallest binary tree)");

//We don't need to store all possible leaves if we have fewer connections
//(i.e. bottom-right of tree is empty)
Expand Down
40 changes: 40 additions & 0 deletions vpr/src/route/route_profiling.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
#include "globals.h"
#include "vpr_types.h"
#include "route_profiling.h"
#include "rr_graph.h"

namespace profiling {

Expand Down Expand Up @@ -29,6 +30,10 @@ void time_on_fanout_analysis() {}

void profiling_initialization(unsigned /*max_net_fanout*/) {}

void conn_start() {}
Copy link
Collaborator

@litghost litghost Jun 15, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The changes to route_profiling.cpp/.h should likely be in another PR.

void conn_finish(int /*src_rr*/, int /*sink_rr*/, float /*criticality*/) {}
void net_finish() {}

#else

constexpr unsigned int fanout_per_bin = 1;
Expand Down Expand Up @@ -181,6 +186,12 @@ void congestion_analysis() {
# endif
}

static clock_t conn_start_time;
static float worst_conn_time = 0.f;
static int worst_src_rr;
static int worst_sink_rr;
static float worst_crit;

void profiling_initialization(unsigned max_fanout) {
// add 1 so that indexing on the max fanout would still be valid
time_on_fanout.resize((max_fanout / fanout_per_bin) + 1, 0);
Expand All @@ -195,8 +206,37 @@ void profiling_initialization(unsigned max_fanout) {
part_tree_preserved = 0;
connections_forced_to_reroute = 0;
connections_rerouted_due_to_forcing = 0;
worst_conn_time = 0.f;
return;
}

void conn_start() {
conn_start_time = clock();
}
void conn_finish(int src_rr, int sink_rr, float criticality) {
float route_time = static_cast<float>(clock() - conn_start_time) / CLOCKS_PER_SEC;
if (route_time > worst_conn_time) {
worst_src_rr = src_rr;
worst_sink_rr = sink_rr;
worst_conn_time = route_time;
worst_crit = criticality;
}

VTR_LOG("%s to %s (crit: %f) took %f\n",
describe_rr_node(src_rr).c_str(),
describe_rr_node(sink_rr).c_str(),
criticality,
route_time);
}
void net_finish() {
if (worst_conn_time > 0.f) {
VTR_LOG("Worst conn was %s to %s (crit: %f) took %f\n",
describe_rr_node(worst_src_rr).c_str(),
describe_rr_node(worst_sink_rr).c_str(),
worst_crit,
worst_conn_time);
}
}
#endif

} // end namespace profiling
4 changes: 4 additions & 0 deletions vpr/src/route/route_profiling.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ void congestion_analysis();
void time_on_criticality_analysis();
void time_on_fanout_analysis();

void conn_start();
void conn_finish(int src_rr, int sink_rr, float criticality);
void net_finish();

void profiling_initialization(unsigned max_net_fanout);

} // end namespace profiling
7 changes: 7 additions & 0 deletions vpr/src/route/route_timing.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1096,6 +1096,8 @@ bool timing_driven_route_net(ConnectionRouter& router,
conn_delay_budget.short_path_criticality = budgeting_inf.get_crit_short_path(net_id, target_pin);
}

profiling::conn_start();
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should move out of this PR with the route_profiling.h/.cpp changes


// build a branch in the route tree to the target
if (!timing_driven_route_sink(router,
net_id,
Expand All @@ -1109,10 +1111,15 @@ bool timing_driven_route_net(ConnectionRouter& router,
router_stats))
return false;

profiling::conn_finish(route_ctx.net_rr_terminals[net_id][0],
sink_rr,
pin_criticality[target_pin]);

++router_stats.connections_routed;
} // finished all sinks

++router_stats.nets_routed;
profiling::net_finish();

/* For later timing analysis. */

Expand Down
2 changes: 2 additions & 0 deletions vpr/src/route/route_timing.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
#include "connection_router_interface.h"
#include "heap_type.h"

extern bool f_router_debug;

int get_max_pins_per_net();

bool try_timing_driven_route(const t_router_opts& router_opts,
Expand Down
Loading