From 2452061824e40174d9268d1dca31b7d1e836ce89 Mon Sep 17 00:00:00 2001 From: Lofty Date: Mon, 15 Sep 2025 12:08:00 +0100 Subject: [PATCH] another multiplier fix --- himbaechel/uarch/gatemate/route_mult.cc | 34 +++++++++++++++++-------- 1 file changed, 23 insertions(+), 11 deletions(-) diff --git a/himbaechel/uarch/gatemate/route_mult.cc b/himbaechel/uarch/gatemate/route_mult.cc index 12726373..104fc36f 100644 --- a/himbaechel/uarch/gatemate/route_mult.cc +++ b/himbaechel/uarch/gatemate/route_mult.cc @@ -333,7 +333,8 @@ void route_mult_x1y2_upper_in1(Context *ctx, NetInfo *net, CellInfo *upper, Loc auto sb_sml_p01_x23 = ctx->getWireByName(IdStringList::concat(x2y1, ctx->idf("SB_SML.P01.X23"))); auto sb_sml_p01_ydiag = ctx->getWireByName(IdStringList::concat(x2y1, ctx->idf("SB_SML.P01.YDIAG_int"))); - auto sb_sml_p01_y1 = ctx->getWireByName(IdStringList::concat(x2y1, ctx->idf("SB_SML.P01.Y1_int"))); + auto sb_sml_p01_y1_int = ctx->getWireByName(IdStringList::concat(x2y1, ctx->idf("SB_SML.P01.Y1_int"))); + auto sb_sml_p01_y1 = ctx->getWireByName(IdStringList::concat(x2y1, ctx->idf("SB_SML.P01.Y1"))); auto sb_big_d2_1 = ctx->getWireByName(IdStringList::concat(x4y1, ctx->idf("SB_BIG.P01.D2_1"))); auto sb_big_y1 = ctx->getWireByName(IdStringList::concat(x4y1, ctx->idf("SB_BIG.P01.Y1"))); auto sb_big_ydiag = ctx->getWireByName(IdStringList::concat(x4y1, ctx->idf("SB_BIG.P01.YDIAG"))); @@ -345,7 +346,8 @@ void route_mult_x1y2_upper_in1(Context *ctx, NetInfo *net, CellInfo *upper, Loc 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_x23, net); find_and_bind_downhill_pip(ctx, sb_sml_p01_x23, sb_sml_p01_ydiag, net); - find_and_bind_downhill_pip(ctx, sb_sml_p01_ydiag, sb_sml_p01_y1, net); + find_and_bind_downhill_pip(ctx, sb_sml_p01_ydiag, sb_sml_p01_y1_int, net); + find_and_bind_downhill_pip(ctx, sb_sml_p01_y1_int, sb_sml_p01_y1, net); find_and_bind_downhill_pip(ctx, sb_sml_p01_y1, sb_big_d2_1, net); find_and_bind_downhill_pip(ctx, sb_big_d2_1, sb_big_y1, net); find_and_bind_downhill_pip(ctx, sb_big_y1, sb_big_ydiag, net); @@ -410,10 +412,14 @@ void route_mult_x1y2_upper_in8(Context *ctx, NetInfo *net, CellInfo *upper, Loc find_and_bind_downhill_pip(ctx, out_mux_d1, out_mux_y, net); // inverting if (is_fourgroup_a) { - auto sb_sml = ctx->getWireByName(IdStringList::concat(x2y1, ctx->idf("SB_SML.P10.Y2_int"))); + auto sb_sml_d0 = ctx->getWireByName(IdStringList::concat(x2y1, ctx->idf("SB_SML.P10.D0"))); + auto sb_sml_y2_int = ctx->getWireByName(IdStringList::concat(x2y1, ctx->idf("SB_SML.P10.Y2_int"))); + auto sb_sml_y2 = ctx->getWireByName(IdStringList::concat(x2y1, ctx->idf("SB_SML.P10.Y2"))); - find_and_bind_downhill_pip(ctx, out_mux_y, sb_sml, net); - find_and_bind_downhill_pip(ctx, sb_sml, in_mux_p10, net); // inverting + find_and_bind_downhill_pip(ctx, out_mux_y, sb_sml_d0, net); + find_and_bind_downhill_pip(ctx, sb_sml_d0, sb_sml_y2_int, net); + find_and_bind_downhill_pip(ctx, sb_sml_y2_int, sb_sml_y2, net); + find_and_bind_downhill_pip(ctx, sb_sml_y2, in_mux_p10, net); } else { // x2y1/OM.P10.Y is x2y1/SB_BIG.P10.D0 // x2y2/IM.P10.D1 is x2y1/SB_BIG.P10.Y2 @@ -421,13 +427,19 @@ void route_mult_x1y2_upper_in8(Context *ctx, NetInfo *net, CellInfo *upper, Loc find_and_bind_downhill_pip(ctx, out_mux_y, in_mux_p10, net); // inverting } - auto in_mux_p12 = ctx->getWireByName(IdStringList::concat(x2y2, ctx->idf("IM.P12.D6"))); // aka IM.P10.Y - auto in_mux_p04 = ctx->getWireByName(IdStringList::concat(x2y2, ctx->idf("IM.P04.D7"))); // aka IM.P12.Y - auto in_mux_p08 = ctx->getWireByName(IdStringList::concat(x2y2, ctx->idf("IM.P08.D6"))); // aka IM.P04.Y + auto in_mux_p10_y = ctx->getWireByName(IdStringList::concat(x2y2, ctx->idf("IM.P10.Y"))); + auto in_mux_p12 = ctx->getWireByName(IdStringList::concat(x2y2, ctx->idf("IM.P12.D6"))); + auto in_mux_p12_y = ctx->getWireByName(IdStringList::concat(x2y2, ctx->idf("IM.P12.Y"))); + auto in_mux_p04 = ctx->getWireByName(IdStringList::concat(x2y2, ctx->idf("IM.P04.D7"))); + auto in_mux_p04_y = ctx->getWireByName(IdStringList::concat(x2y2, ctx->idf("IM.P04.Y"))); + auto in_mux_p08 = ctx->getWireByName(IdStringList::concat(x2y2, ctx->idf("IM.P08.D6"))); - find_and_bind_downhill_pip(ctx, in_mux_p10, 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_p10, in_mux_p10_y, net); + find_and_bind_downhill_pip(ctx, in_mux_p10_y, in_mux_p12, net); + find_and_bind_downhill_pip(ctx, in_mux_p12, in_mux_p12_y, net); + find_and_bind_downhill_pip(ctx, in_mux_p12_y, in_mux_p04, net); + find_and_bind_downhill_pip(ctx, in_mux_p04, in_mux_p04_y, net); + find_and_bind_downhill_pip(ctx, in_mux_p04_y, in_mux_p08, net); route_mult_diag(ctx, net, Loc{loc.x + 1, loc.y + 1, 0}, in_mux_p08, 8); }