mirror of
https://github.com/YosysHQ/nextpnr.git
synced 2026-01-11 23:53:21 +00:00
current progress
This commit is contained in:
parent
1576703937
commit
78b614ed31
@ -341,6 +341,142 @@ namespace {
|
||||
find_and_bind_downhill_pip(ctx, in_mux_p08, in_mux_p08_y, net); // inverting
|
||||
find_and_bind_downhill_pip(ctx, in_mux_p08_y, cpe_in8_int, net);
|
||||
}
|
||||
|
||||
void route_mult_x2y1_lower(Context *ctx, NetInfo *net, CellInfo* lower, Loc loc, bool is_fourgroup_a) {
|
||||
log_info(" routing net '%s' -> IN5 using x2y1\n", net->name.c_str(ctx));
|
||||
|
||||
auto x0y1 = ctx->idf("X%dY%d", loc.x - 1, loc.y);
|
||||
auto x1y1 = ctx->idf("X%dY%d", loc.x, loc.y);
|
||||
auto x2y1 = ctx->idf("X%dY%d", loc.x + 1, loc.y);
|
||||
|
||||
auto cpe_combout1 = ctx->getBelPinWire(lower->bel, id_OUT);
|
||||
auto cpe_out1_int = ctx->getWireByName(IdStringList::concat(x1y1, ctx->idf("CPE.OUT1_int")));
|
||||
auto in_mux = ctx->getWireByName(IdStringList::concat(x2y1, ctx->idf("IM.P05.D0")));
|
||||
|
||||
ctx->bindWire(cpe_combout1, net, STRENGTH_LOCKED);
|
||||
find_and_bind_downhill_pip(ctx, cpe_combout1, cpe_out1_int, net);
|
||||
|
||||
if (is_fourgroup_a) {
|
||||
NPNR_ASSERT_FALSE("route_mult_x2y1_lower: not yet implemented for four-group A");
|
||||
} else {
|
||||
auto sb_sml_p07_d0 = ctx->getWireByName(IdStringList::concat(x0y1, ctx->idf("SB_SML.P07.D0")));
|
||||
auto sb_sml_p07_y1_int = ctx->getWireByName(IdStringList::concat(x0y1, ctx->idf("SB_SML.P07.Y1_int")));
|
||||
auto sb_sml_p07_ydiag_int = ctx->getWireByName(IdStringList::concat(x0y1, ctx->idf("SB_SML.P07.YDIAG_int")));
|
||||
auto sb_sml_p07_ydiag = ctx->getWireByName(IdStringList::concat(x0y1, ctx->idf("SB_SML.P07.YDIAG"))); // AKA SB_SML.P06.X23
|
||||
auto sb_sml_p06_ydiag_int = ctx->getWireByName(IdStringList::concat(x0y1, ctx->idf("SB_SML.P06.YDIAG_int")));
|
||||
auto sb_sml_p06_ydiag = ctx->getWireByName(IdStringList::concat(x0y1, ctx->idf("SB_SML.P06.YDIAG"))); // AKA SB_SML.P05.X23
|
||||
auto sb_sml_p05_ydiag_int = ctx->getWireByName(IdStringList::concat(x0y1, ctx->idf("SB_SML.P05.YDIAG_int")));
|
||||
auto sb_sml_p05_y1_int = ctx->getWireByName(IdStringList::concat(x0y1, ctx->idf("SB_SML.P05.Y1_int")));
|
||||
|
||||
find_and_bind_downhill_pip(ctx, cpe_out1_int, sb_sml_p07_d0, net);
|
||||
find_and_bind_downhill_pip(ctx, sb_sml_p07_d0, sb_sml_p07_y1_int, net);
|
||||
find_and_bind_downhill_pip(ctx, sb_sml_p07_y1_int, sb_sml_p07_ydiag_int, net);
|
||||
find_and_bind_downhill_pip(ctx, sb_sml_p07_ydiag_int, sb_sml_p07_ydiag, net);
|
||||
find_and_bind_downhill_pip(ctx, sb_sml_p07_ydiag, sb_sml_p06_ydiag_int, net);
|
||||
find_and_bind_downhill_pip(ctx, sb_sml_p06_ydiag_int, sb_sml_p06_ydiag, net);
|
||||
find_and_bind_downhill_pip(ctx, sb_sml_p06_ydiag, sb_sml_p05_ydiag_int, net);
|
||||
find_and_bind_downhill_pip(ctx, sb_sml_p05_ydiag_int, sb_sml_p05_y1_int, net);
|
||||
find_and_bind_downhill_pip(ctx, sb_sml_p05_y1_int, in_mux, net);
|
||||
}
|
||||
|
||||
auto in_mux_y = ctx->getWireByName(IdStringList::concat(x2y1, ctx->idf("IM.P05.Y")));
|
||||
auto cpe_in5_int = ctx->getWireByName(IdStringList::concat(x2y1, ctx->idf("CPE.IN5_int")));
|
||||
|
||||
find_and_bind_downhill_pip(ctx, in_mux, in_mux_y, net);
|
||||
find_and_bind_downhill_pip(ctx, in_mux_y, cpe_in5_int, net);
|
||||
}
|
||||
|
||||
void route_mult_x2y1_upper_in1(Context *ctx, NetInfo *net, CellInfo* upper, Loc loc, bool is_fourgroup_a) {
|
||||
log_info(" routing net '%s' -> IN1 using x2y1\n", net->name.c_str(ctx));
|
||||
|
||||
auto x0y1 = ctx->idf("X%dY%d", loc.x - 1, loc.y);
|
||||
auto x1y1 = ctx->idf("X%dY%d", loc.x, loc.y);
|
||||
auto x2y1 = ctx->idf("X%dY%d", loc.x + 1, loc.y);
|
||||
|
||||
auto cpe_combout2 = ctx->getBelPinWire(upper->bel, id_OUT);
|
||||
auto cpe_out2_int = ctx->getWireByName(IdStringList::concat(x1y1, ctx->idf("CPE.OUT2_int")));
|
||||
auto in_mux = ctx->getWireByName(IdStringList::concat(x2y1, ctx->idf("IM.P01.D0")));
|
||||
|
||||
ctx->bindWire(cpe_combout2, net, STRENGTH_LOCKED);
|
||||
find_and_bind_downhill_pip(ctx, cpe_combout2, cpe_out2_int, net);
|
||||
|
||||
if (is_fourgroup_a) {
|
||||
NPNR_ASSERT_FALSE("route_mult_x2y1_upper_in1: not yet implemented for four-group A");
|
||||
} else {
|
||||
auto sb_sml_p03_d0 = ctx->getWireByName(IdStringList::concat(x0y1, ctx->idf("SB_SML.P03.D0")));
|
||||
auto sb_sml_p03_y1_int = ctx->getWireByName(IdStringList::concat(x0y1, ctx->idf("SB_SML.P03.Y1_int")));
|
||||
auto sb_sml_p03_ydiag_int = ctx->getWireByName(IdStringList::concat(x0y1, ctx->idf("SB_SML.P03.YDIAG_int")));
|
||||
auto sb_sml_p03_ydiag = ctx->getWireByName(IdStringList::concat(x0y1, ctx->idf("SB_SML.P03.YDIAG"))); // AKA SB_SML.P02.X23
|
||||
auto sb_sml_p02_ydiag_int = ctx->getWireByName(IdStringList::concat(x0y1, ctx->idf("SB_SML.P02.YDIAG_int")));
|
||||
auto sb_sml_p02_ydiag = ctx->getWireByName(IdStringList::concat(x0y1, ctx->idf("SB_SML.P02.YDIAG"))); // AKA SB_SML.P01.X23
|
||||
auto sb_sml_p01_ydiag_int = ctx->getWireByName(IdStringList::concat(x0y1, ctx->idf("SB_SML.P01.YDIAG_int")));
|
||||
auto sb_sml_p01_y1_int = ctx->getWireByName(IdStringList::concat(x0y1, ctx->idf("SB_SML.P01.Y1_int")));
|
||||
|
||||
find_and_bind_downhill_pip(ctx, cpe_out2_int, sb_sml_p03_d0, net);
|
||||
find_and_bind_downhill_pip(ctx, sb_sml_p03_d0, sb_sml_p03_y1_int, net);
|
||||
find_and_bind_downhill_pip(ctx, sb_sml_p03_y1_int, sb_sml_p03_ydiag_int, net);
|
||||
find_and_bind_downhill_pip(ctx, sb_sml_p03_ydiag_int, sb_sml_p03_ydiag, net);
|
||||
find_and_bind_downhill_pip(ctx, sb_sml_p03_ydiag, sb_sml_p02_ydiag_int, net);
|
||||
find_and_bind_downhill_pip(ctx, sb_sml_p02_ydiag_int, sb_sml_p02_ydiag, net);
|
||||
find_and_bind_downhill_pip(ctx, sb_sml_p02_ydiag, sb_sml_p01_ydiag_int, net);
|
||||
find_and_bind_downhill_pip(ctx, sb_sml_p01_ydiag_int, sb_sml_p01_y1_int, net);
|
||||
find_and_bind_downhill_pip(ctx, sb_sml_p01_y1_int, in_mux, net);
|
||||
}
|
||||
|
||||
auto in_mux_y = ctx->getWireByName(IdStringList::concat(x2y1, ctx->idf("IM.P01.Y")));
|
||||
auto cpe_in1_int = ctx->getWireByName(IdStringList::concat(x2y1, ctx->idf("CPE.IN1_int")));
|
||||
|
||||
find_and_bind_downhill_pip(ctx, in_mux, in_mux_y, net);
|
||||
find_and_bind_downhill_pip(ctx, in_mux_y, cpe_in1_int, net);
|
||||
}
|
||||
|
||||
void route_mult_x2y1_upper_in8(Context *ctx, NetInfo *net, CellInfo* upper, Loc loc, bool is_fourgroup_a, bool bind_route_start = false) {
|
||||
log_info(" routing net '%s' -> IN8 using x2y1\n", net->name.c_str(ctx));
|
||||
|
||||
auto x1y1 = ctx->idf("X%dY%d", loc.x, loc.y);
|
||||
auto x1y2 = ctx->idf("X%dY%d", loc.x, loc.y + 1);
|
||||
auto x2y1 = ctx->idf("X%dY%d", loc.x + 1, loc.y);
|
||||
auto x2y2 = ctx->idf("X%dY%d", loc.x + 1, loc.y + 1);
|
||||
auto x3y2 = ctx->idf("X%dY%d", loc.x + 2, loc.y + 1);
|
||||
|
||||
auto cpe_combout2 = ctx->getBelPinWire(upper->bel, id_OUT);
|
||||
auto cpe_out2_int = ctx->getWireByName(IdStringList::concat(x1y1, ctx->idf("CPE.OUT2_int")));
|
||||
auto out_mux_d2 = ctx->getWireByName(IdStringList::concat(x1y2, ctx->idf("OM.P09.D2")));
|
||||
auto out_mux_y = ctx->getWireByName(IdStringList::concat(x1y2, ctx->idf("OM.P09.Y")));
|
||||
auto in_mux_p09 = ctx->getWireByName(IdStringList::concat(x2y2, ctx->idf("IM.P09.D0")));
|
||||
|
||||
if (bind_route_start) {
|
||||
ctx->bindWire(cpe_combout2, net, STRENGTH_LOCKED);
|
||||
find_and_bind_downhill_pip(ctx, cpe_combout2, cpe_out2_int, net);
|
||||
find_and_bind_downhill_pip(ctx, cpe_out2_int, out_mux_d2, net);
|
||||
}
|
||||
|
||||
find_and_bind_downhill_pip(ctx, out_mux_d2, out_mux_y, net); // inverting
|
||||
|
||||
if (is_fourgroup_a) {
|
||||
auto sb_sml = ctx->getWireByName(IdStringList::concat(x2y1, ctx->idf("SB_SML.P09.Y1_int")));
|
||||
|
||||
find_and_bind_downhill_pip(ctx, out_mux_y, sb_sml, net);
|
||||
find_and_bind_downhill_pip(ctx, sb_sml, in_mux_p09, net); // inverting
|
||||
} else {
|
||||
// x1y2/OM.P09.Y is x1y2/SB_BIG.P09.D0
|
||||
// x2y2/IM.P09.D0 is x2y1/SB_BIG.P09.Y1
|
||||
|
||||
find_and_bind_downhill_pip(ctx, out_mux_y, in_mux_p09, net); // inverting
|
||||
}
|
||||
|
||||
auto in_mux_p12 = ctx->getWireByName(IdStringList::concat(x3y2, ctx->idf("IM.P12.D7"))); // aka IM.P09.Y
|
||||
auto in_mux_p04 = ctx->getWireByName(IdStringList::concat(x3y2, ctx->idf("IM.P04.D7"))); // aka IM.P12.Y
|
||||
auto in_mux_p08 = ctx->getWireByName(IdStringList::concat(x3y2, ctx->idf("IM.P08.D6"))); // aka IM.P04.Y
|
||||
auto in_mux_p08_y = ctx->getWireByName(IdStringList::concat(x3y2, ctx->idf("IM.P08.Y")));
|
||||
auto cpe_in8_int = ctx->getWireByName(IdStringList::concat(x3y2, ctx->idf("CPE.IN8_int")));
|
||||
|
||||
find_and_bind_downhill_pip(ctx, in_mux_p09, in_mux_p12, net); // inverting
|
||||
find_and_bind_downhill_pip(ctx, in_mux_p12, in_mux_p04, net); // inverting
|
||||
find_and_bind_downhill_pip(ctx, in_mux_p04, in_mux_p08, net); // inverting
|
||||
find_and_bind_downhill_pip(ctx, in_mux_p08, in_mux_p08_y, net); // inverting
|
||||
find_and_bind_downhill_pip(ctx, in_mux_p08_y, cpe_in8_int, net);
|
||||
}
|
||||
}
|
||||
|
||||
NEXTPNR_NAMESPACE_BEGIN
|
||||
@ -391,6 +527,11 @@ void GateMateImpl::route_mult() {
|
||||
route_mult_x1y2_upper_in1(ctx, upper_out, upper, loc, is_fourgroup_a);
|
||||
if (needs_in8_route)
|
||||
route_mult_x1y2_upper_in8(ctx, upper_out, upper, loc, is_fourgroup_a);
|
||||
} else if (x_within_fourgroup == 1 && y_within_fourgroup == 0) {
|
||||
route_mult_x2y1_lower(ctx, lower_out, lower, loc, is_fourgroup_a);
|
||||
route_mult_x2y1_upper_in1(ctx, upper_out, upper, loc, is_fourgroup_a);
|
||||
if (needs_in8_route)
|
||||
route_mult_x2y1_upper_in8(ctx, upper_out, upper, loc, is_fourgroup_a);
|
||||
} else if (is_fourgroup_a) {
|
||||
log_info(" don't know how to route net '%s' (it's four-group A, (%d, %d))\n", lower_out->name.c_str(ctx), x_within_fourgroup, y_within_fourgroup);
|
||||
log_info(" don't know how to route net '%s' (it's four-group A, (%d, %d))\n", upper_out->name.c_str(ctx), x_within_fourgroup, y_within_fourgroup);
|
||||
@ -421,6 +562,8 @@ void GateMateImpl::route_mult() {
|
||||
route_mult_x1y1_upper_in8(ctx, out, zero_driver, loc, is_fourgroup_a, /* bind_route_start=*/true);
|
||||
} else if (x_within_fourgroup == 0 && y_within_fourgroup == 1) {
|
||||
route_mult_x1y2_upper_in8(ctx, out, zero_driver, loc, is_fourgroup_a, /* bind_route_start=*/true);
|
||||
} else if (x_within_fourgroup == 1 && y_within_fourgroup == 0) {
|
||||
route_mult_x2y1_upper_in8(ctx, out, zero_driver, loc, is_fourgroup_a, /*bind_route_start=*/true);
|
||||
} else if (is_fourgroup_a) {
|
||||
log_info(" don't know how to route net '%s' (it's four-group A, (%d, %d))\n", out->name.c_str(ctx), x_within_fourgroup, y_within_fourgroup);
|
||||
} else {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user