From d8408b23500d9453b1fe37e0772b3421f1bd32a2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Povi=C5=A1er?= Date: Mon, 6 Nov 2023 14:24:10 +0100 Subject: [PATCH] booth: Move up signed quadrant 1 logic --- passes/techmap/booth.cc | 41 +++++++++++++++++------------------------ 1 file changed, 17 insertions(+), 24 deletions(-) diff --git a/passes/techmap/booth.cc b/passes/techmap/booth.cc index b3c98f086..8be2e6e1d 100644 --- a/passes/techmap/booth.cc +++ b/passes/techmap/booth.cc @@ -1027,6 +1027,22 @@ struct BoothPassWorker { PPij[((encoder_ix - 1) * dec_count) + dec_count - 1], unused_op); } + // + // instantiate the quadrant 1 cell. This is the upper right + // quadrant which can be realized using non-booth encoded logic. + // + SigBit pp0_o_int, pp1_o_int, nxj_o_int, q1_carry_out; + + BuildBoothQ1("icb_booth_q1_", + negi_n_int[0], // negi + cori_n_int[0], // cori + X[0], X[1], Y[0], Y[1], + nxj_o_int, q1_carry_out, pp0_o_int, pp1_o_int); + + module->connect(Z[0], pp0_o_int); + module->connect(Z[1], pp1_o_int); + module->connect(nxj[(0 * dec_count) + 2], nxj_o_int); + // // sum up the partial products // @@ -1052,6 +1068,7 @@ struct BoothPassWorker { /* X */ fa_carry[0].extract(2, x_sz + 2), /* Y */ fa_sum[0].extract(2, x_sz + 2) ); + module->connect(fa_carry[0][1], q1_carry_out); // step case: 2nd and rest of rows. (fa_row_ix == 1...n) // special because these are driven by a decoder and prior fa. @@ -1093,30 +1110,6 @@ struct BoothPassWorker { BuildHa(cpa_name, fa_sum[fa_row_count - 1][cpa_ix - offset + 2], ci, op, cpa_carry[cpa_ix - offset]); module->connect(Z[cpa_ix], op); } - - // - // instantiate the quadrant 1 cell. This is the upper right - // quadrant which can be realized using non-booth encoded logic. - // - std::string q1_name = "icb_booth_q1_"; - - SigBit pp0_o_int; - SigBit pp1_o_int; - SigBit nxj_o_int; - SigBit cor_o_int; - - BuildBoothQ1(q1_name, - negi_n_int[0], // negi - cori_n_int[0], // cori - - X[0], X[1], Y[0], Y[1], - - nxj_o_int, cor_o_int, pp0_o_int, pp1_o_int); - - module->connect(fa_sum[0][0], pp0_o_int); - module->connect(fa_sum[0][1], pp1_o_int); - module->connect(fa_carry[0][1], cor_o_int); - module->connect(nxj[(0 * dec_count) + 2], nxj_o_int); } };