Skip to content

Connection box map WIP branch #546

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
wants to merge 41 commits into from
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
0dfeeef
route: added penalty cost to switches
acomodi Jan 20, 2020
44b8830
Integrate upstream uxsdcxx parser with connection box lookahead.
litghost Jul 8, 2019
ba53446
Complete connection box lookahead to be aware of connection box.
litghost Aug 16, 2019
202b692
Mark file location function as static.
litghost Sep 27, 2019
a29f76c
Add bounds checking when search grid.
litghost Oct 11, 2019
bc730a4
Updates to connection box lookahead map.
litghost Oct 11, 2019
1fd6434
add documentation
HackerFoo Oct 23, 2019
4e908f4
un-shadow a variable
HackerFoo Oct 23, 2019
c722f2a
remove method from set_cost_map
HackerFoo Oct 24, 2019
712eb80
replace std::list with std::vector
HackerFoo Oct 24, 2019
81f9d58
parallelize connection box lookahead
HackerFoo Oct 23, 2019
48fc62c
performance improvements
HackerFoo Oct 25, 2019
768d06a
suggested changes
HackerFoo Oct 30, 2019
620903d
changes suggested in PR
HackerFoo Oct 31, 2019
4015a51
add penalty to Cost_Map::find_cost for points outside of the map
HackerFoo Nov 1, 2019
af96b4c
store penalties
HackerFoo Nov 2, 2019
58f58b2
printf -> VTR_LOG
HackerFoo Nov 4, 2019
f6aa3c4
change sampling method
HackerFoo Nov 6, 2019
988e3e5
remove unnecessary lookups
HackerFoo Nov 6, 2019
1ce2762
remove SimpleCache, use vtr::hash_combine, add timing stats
HackerFoo Nov 7, 2019
c4bb0f6
integrate lighost's patches
HackerFoo Nov 8, 2019
c9cd48a
independently minimize delay and base cost (congestion)
HackerFoo Nov 11, 2019
629ca51
Expand delay and base cost independently
HackerFoo Nov 14, 2019
62f927c
site_pin_delay shouldn't affect congestion
HackerFoo Nov 14, 2019
a71492b
use histogram to choose sample sizes, set minimum penalty
HackerFoo Nov 19, 2019
ba189e5
Use get_rr_cong_cost to compute base_cost's.
litghost Nov 21, 2019
800e81b
run expansions in a region until a number of paths are found
HackerFoo Nov 26, 2019
b0fc84e
use std::make_tuple()
HackerFoo Dec 3, 2019
f4a2d91
suggested changes
HackerFoo Dec 3, 2019
8ccb5fd
Add debugging prints and add fill output to lookahead.
litghost Oct 31, 2019
280cd95
removed criticality from penalty cost math
acomodi Jan 21, 2020
2b6dba1
Fix missing #include <string>
hzeller Jan 29, 2020
295c604
Remove cached segment map from connection map lookahead file.
HackerFoo Feb 19, 2020
2127254
Refactor lookahead computation.
litghost Feb 21, 2020
87b0e93
Skip empty windows.
litghost Feb 8, 2020
e2891cb
Add CONNECTION_BOX_MAP to ShowSetup print.
litghost Jul 1, 2020
9b4ab53
connection box: fixes after rebase
acomodi Sep 14, 2020
2f863db
Move connection_box to end to preserve order w.r.t. upstream.
litghost Jun 18, 2020
a69095c
Adjust connection_box verification logic to handle different definiti…
litghost Jul 1, 2020
cfd25e8
Adjust connection_box verification logic to handle different definiti…
litghost Jul 23, 2020
932fda8
run make format
acomodi Sep 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
2 changes: 2 additions & 0 deletions libs/libarchfpga/src/physical_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -1457,6 +1457,7 @@ struct t_arch_switch_inf {
float Cin = 0.;
float Cout = 0.;
float Cinternal = 0.;
float penalty_cost = 0.;
float mux_trans_size = 1.;
BufferSize buf_size_type = BufferSize::AUTO;
float buf_size = 0.;
Expand Down Expand Up @@ -1521,6 +1522,7 @@ struct t_rr_switch_inf {
float Cout = 0.;
float Cinternal = 0.;
float Tdel = 0.;
float penalty_cost = 0.;
float mux_trans_size = 0.;
float buf_size = 0.;
const char* name = nullptr;
Expand Down
11 changes: 6 additions & 5 deletions libs/libarchfpga/src/read_xml_arch_file.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3987,23 +3987,23 @@ static void ProcessSwitches(pugi::xml_node Parent,
SwitchType type = SwitchType::MUX;
if (0 == strcmp(type_name, "mux")) {
type = SwitchType::MUX;
expect_only_attributes(Node, {"type", "name", "R", "Cin", "Cout", "Cinternal", "Tdel", "buf_size", "power_buf_size", "mux_trans_size"}, " with type '"s + type_name + "'"s, loc_data);
expect_only_attributes(Node, {"type", "name", "R", "Cin", "Cout", "Cinternal", "Tdel", "penalty_cost", "buf_size", "power_buf_size", "mux_trans_size"}, " with type '"s + type_name + "'"s, loc_data);

} else if (0 == strcmp(type_name, "tristate")) {
type = SwitchType::TRISTATE;
expect_only_attributes(Node, {"type", "name", "R", "Cin", "Cout", "Cinternal", "Tdel", "buf_size", "power_buf_size"}, " with type '"s + type_name + "'"s, loc_data);
expect_only_attributes(Node, {"type", "name", "R", "Cin", "Cout", "Cinternal", "Tdel", "penalty_cost", "buf_size", "power_buf_size"}, " with type '"s + type_name + "'"s, loc_data);

} else if (0 == strcmp(type_name, "buffer")) {
type = SwitchType::BUFFER;
expect_only_attributes(Node, {"type", "name", "R", "Cin", "Cout", "Tdel", "buf_size", "power_buf_size"}, " with type '"s + type_name + "'"s, loc_data);
expect_only_attributes(Node, {"type", "name", "R", "Cin", "Cout", "Tdel", "penalty_cost", "buf_size", "power_buf_size"}, " with type '"s + type_name + "'"s, loc_data);

} else if (0 == strcmp(type_name, "pass_gate")) {
type = SwitchType::PASS_GATE;
expect_only_attributes(Node, {"type", "name", "R", "Cin", "Cout", "Tdel"}, " with type '"s + type_name + "'"s, loc_data);
expect_only_attributes(Node, {"type", "name", "R", "Cin", "Cout", "Tdel", "penalty_cost"}, " with type '"s + type_name + "'"s, loc_data);

} else if (0 == strcmp(type_name, "short")) {
type = SwitchType::SHORT;
expect_only_attributes(Node, {"type", "name", "R", "Cin", "Cout", "Tdel"}, " with type "s + type_name + "'"s, loc_data);
expect_only_attributes(Node, {"type", "name", "R", "Cin", "Cout", "Tdel", "penalty_cost"}, " with type "s + type_name + "'"s, loc_data);
} else {
archfpga_throw(loc_data.filename_c_str(), loc_data.line(Node),
"Invalid switch type '%s'.\n", type_name);
Expand All @@ -4026,6 +4026,7 @@ static void ProcessSwitches(pugi::xml_node Parent,
arch_switch.Cin = get_attribute(Node, "Cin", loc_data, CIN_REQD).as_float(0);
arch_switch.Cout = get_attribute(Node, "Cout", loc_data, COUT_REQD).as_float(0);
arch_switch.Cinternal = get_attribute(Node, "Cinternal", loc_data, CINTERNAL_REQD).as_float(0);
arch_switch.penalty_cost = get_attribute(Node, "penalty_cost", loc_data, ReqOpt::OPTIONAL).as_float(0);

if (arch_switch.type() == SwitchType::MUX) {
//Only muxes have mux transistors
Expand Down
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
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);
}
36 changes: 32 additions & 4 deletions libs/libvtrcapnproto/gen/rr_graph_uxsdcxx.capnp
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
# https://github.com/duck2/uxsdcxx
# Modify only if your build process doesn't involve regenerating this file.
#
# Cmdline: uxsdcxx/uxsdcap.py /home/kmurray/trees/vtr/vpr/src/route/rr_graph.xsd
# Input file: /home/kmurray/trees/vtr/vpr/src/route/rr_graph.xsd
# md5sum of input file: 40e83d2ea6556761d4e29f21324b1871
# Cmdline: uxsdcxx/uxsdcap.py rr_graph.xsd
# Input file: rr_graph.xsd
# md5sum of input file: bea3923ac9822e94db96d5d9d15e18c6

@0xb803100e76d3342d;
@0xf281a101eeb2a247;
using Cxx = import "/capnp/c++.capnp";
$Cxx.namespace("ucap");

Expand Down Expand Up @@ -81,6 +81,7 @@ struct Timing {
cout @2 :Float32;
r @3 :Float32;
tdel @4 :Float32;
penaltyCost @5 :Float32;
}

struct Sizing {
Expand Down Expand Up @@ -176,6 +177,18 @@ struct Metadata {
metas @0 :List(Meta);
}

struct CanonicalLoc {
x @0 :UInt32;
y @1 :UInt32;
}

struct ConnectionBoxAnnotation {
id @0 :UInt32;
sitePinDelay @1 :Float32;
x @2 :UInt32;
y @3 :UInt32;
}

struct Node {
capacity @0 :UInt32;
direction @1 :NodeDirection;
Expand All @@ -185,6 +198,8 @@ struct Node {
timing @5 :NodeTiming;
segment @6 :NodeSegment;
metadata @7 :Metadata;
canonicalLoc @8 :CanonicalLoc;
connectionBox @9 :ConnectionBoxAnnotation;
}

struct RrNodes {
Expand All @@ -202,6 +217,18 @@ struct RrEdges {
edges @0 :List(Edge);
}

struct ConnectionBoxDeclaration {
id @0 :UInt32;
name @1 :Text;
}

struct ConnectionBoxes {
numBoxes @0 :UInt32;
xDim @1 :UInt32;
yDim @2 :UInt32;
connectionBoxes @3 :List(ConnectionBoxDeclaration);
}

struct RrGraph {
toolComment @0 :Text;
toolName @1 :Text;
Expand All @@ -213,4 +240,5 @@ struct RrGraph {
grid @7 :GridLocs;
rrNodes @8 :RrNodes;
rrEdges @9 :RrEdges;
connectionBoxes @10 :ConnectionBoxes;
}
1 change: 1 addition & 0 deletions vpr/src/base/SetupVPR.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,7 @@ static void SetupSwitches(const t_arch& Arch,
device_ctx.arch_switch_inf[RoutingArch->delayless_switch].R = 0.;
device_ctx.arch_switch_inf[RoutingArch->delayless_switch].Cin = 0.;
device_ctx.arch_switch_inf[RoutingArch->delayless_switch].Cout = 0.;
device_ctx.arch_switch_inf[RoutingArch->delayless_switch].penalty_cost = 0.;
device_ctx.arch_switch_inf[RoutingArch->delayless_switch].set_Tdel(t_arch_switch_inf::UNDEFINED_FANIN, 0.);
device_ctx.arch_switch_inf[RoutingArch->delayless_switch].power_buffer_type = POWER_BUFFER_TYPE_NONE;
device_ctx.arch_switch_inf[RoutingArch->delayless_switch].mux_trans_size = 0.;
Expand Down
3 changes: 3 additions & 0 deletions vpr/src/base/ShowSetup.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -313,6 +313,9 @@ static void ShowRouterOpts(const t_router_opts& RouterOpts) {
case e_router_lookahead::NO_OP:
VTR_LOG("NO_OP\n");
break;
case e_router_lookahead::CONNECTION_BOX_MAP:
VTR_LOG("CONNECTION_BOX_MAP\n");
break;
default:
VPR_FATAL_ERROR(VPR_ERROR_UNKNOWN, "Unknown lookahead_type\n");
}
Expand Down
10 changes: 7 additions & 3 deletions vpr/src/base/read_options.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -775,6 +775,8 @@ struct ParseRouterLookahead {
conv_value.set_value(e_router_lookahead::MAP);
else if (str == "extended_map")
conv_value.set_value(e_router_lookahead::EXTENDED_MAP);
else if (str == "connection_box_map")
conv_value.set_value(e_router_lookahead::CONNECTION_BOX_MAP);
else {
std::stringstream msg;
msg << "Invalid conversion from '"
Expand All @@ -788,10 +790,12 @@ struct ParseRouterLookahead {

ConvertedValue<std::string> to_str(e_router_lookahead val) {
ConvertedValue<std::string> conv_value;
if (val == e_router_lookahead::CLASSIC)
if (val == e_router_lookahead::CLASSIC) {
conv_value.set_value("classic");
else if (val == e_router_lookahead::MAP) {
} else if (val == e_router_lookahead::MAP) {
conv_value.set_value("map");
} else if (val == e_router_lookahead::CONNECTION_BOX_MAP) {
conv_value.set_value("connection_box_map");
} else {
VTR_ASSERT(val == e_router_lookahead::EXTENDED_MAP);
conv_value.set_value("extended_map");
Expand All @@ -800,7 +804,7 @@ struct ParseRouterLookahead {
}

std::vector<std::string> default_choices() {
return {"classic", "map", "extended_map"};
return {"classic", "map", "extended_map", "connection_box_map"};
}
};

Expand Down
3 changes: 3 additions & 0 deletions vpr/src/base/vpr_context.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
#include "place_macro.h"
#include "compressed_grid.h"
#include "metadata_storage.h"
#include "connection_box.h"

/**
* @brief A Context is collection of state relating to a particular part of VPR
Expand Down Expand Up @@ -231,6 +232,8 @@ struct DeviceContext : public Context {
* Used to determine when reading rrgraph if file is already loaded.
*/
std::string read_rr_graph_filename;

ConnectionBoxes connection_boxes;
};

/**
Expand Down
9 changes: 5 additions & 4 deletions vpr/src/base/vpr_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -110,10 +110,11 @@ constexpr const char* EMPTY_BLOCK_NAME = "EMPTY";
#endif

enum class e_router_lookahead {
CLASSIC, ///<VPR's classic lookahead (assumes uniform wire types)
MAP, ///<Lookahead considering different wire types (see Oleg Petelin's MASc Thesis)
EXTENDED_MAP, ///<Lookahead with a more extensive node sampling method
NO_OP ///<A no-operation lookahead which always returns zero
CLASSIC, ///<VPR's classic lookahead (assumes uniform wire types)
MAP, ///<Lookahead considering different wire types (see Oleg Petelin's MASc Thesis)
EXTENDED_MAP, ///<Lookahead with a more extensive node sampling method
NO_OP, ///<A no-operation lookahead which always returns zero
CONNECTION_BOX_MAP ///<Lookahead considering different wire types and IPIN connection box.
};

enum class e_route_bb_update {
Expand Down
Loading