| 1 |
/* |
| 2 |
* nextpnr -- Next Generation Place and Route |
| 3 |
* |
| 4 |
* Copyright (C) 2024 The Project Peppercorn Authors. |
| 5 |
* |
| 6 |
* Permission to use, copy, modify, and/or distribute this software for any |
| 7 |
* purpose with or without fee is hereby granted, provided that the above |
| 8 |
* copyright notice and this permission notice appear in all copies. |
| 9 |
* |
| 10 |
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES |
| 11 |
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF |
| 12 |
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR |
| 13 |
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES |
| 14 |
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN |
| 15 |
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF |
| 16 |
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. |
| 17 |
* |
| 18 |
*/ |
| 19 |
|
| 20 |
#include "idstring.h" |
| 21 |
#include "log.h" |
| 22 |
#include "nextpnr_assertions.h" |
| 23 |
#include "nextpnr_namespaces.h" |
| 24 |
#include "nextpnr_types.h" |
| 25 |
#include "pack.h" |
| 26 |
#include "property.h" |
| 27 |
#include "uarch/gatemate/extra_data.h" |
| 28 |
#include "uarch/gatemate/gatemate.h" |
| 29 |
#include "util.h" |
| 30 |
|
| 31 |
#define HIMBAECHEL_CONSTIDS "uarch/gatemate/constids.inc" |
| 32 |
#include "himbaechel_constids.h" |
| 33 |
|
| 34 |
NEXTPNR_NAMESPACE_BEGIN |
| 35 |
|
| 36 |
// Constant zero. |
| 37 |
struct ZeroDriver |
| 38 |
{ |
| 39 |
ZeroDriver() : lower{nullptr}, upper{nullptr} {} |
| 40 |
ZeroDriver(CellInfo *lower, CellInfo *upper, IdString name); |
| 41 |
|
| 42 |
CellInfo *lower; |
| 43 |
CellInfo *upper; |
| 44 |
}; |
| 45 |
|
| 46 |
// Propagate A0 through OUT1 and A1 through OUT2; zero COUTX and POUTX. |
| 47 |
struct APassThroughCell |
| 48 |
{ |
| 49 |
APassThroughCell(CellInfo *lower, CellInfo *upper, CellInfo *comp, CellInfo *cplines, IdString name); |
| 50 |
|
| 51 |
void clean_up_cell(Context *ctx, CellInfo *cell); |
| 52 |
|
| 53 |
CellInfo *lower; |
| 54 |
CellInfo *upper; |
| 55 |
CellInfo *comp; |
| 56 |
CellInfo *cplines; |
| 57 |
}; |
| 58 |
|
| 59 |
// Propagate B0 through POUTY1 and B1 through COUTY1 |
| 60 |
struct BPassThroughCell |
| 61 |
{ |
| 62 |
BPassThroughCell() : lower{nullptr}, upper{nullptr}, cplines{nullptr} {} |
| 63 |
BPassThroughCell(CellInfo *lower, CellInfo *upper, CellInfo *cplines, IdString name); |
| 64 |
|
| 65 |
void clean_up_cell(Context *ctx, CellInfo *cell); |
| 66 |
|
| 67 |
CellInfo *lower; |
| 68 |
CellInfo *upper; |
| 69 |
CellInfo *cplines; |
| 70 |
}; |
| 71 |
|
| 72 |
// TODO: Micko points out this is an L2T4 CPE_HALF |
| 73 |
struct CarryGenCell |
| 74 |
{ |
| 75 |
CarryGenCell() : lower{nullptr}, upper{nullptr}, comp{nullptr}, cplines{nullptr} {} |
| 76 |
CarryGenCell(CellInfo *lower, CellInfo *upper, CellInfo *comp, CellInfo *cplines, IdString name, bool is_odd_x, |
| 77 |
bool enable_cinx); |
| 78 |
|
| 79 |
CellInfo *lower; |
| 80 |
CellInfo *upper; |
| 81 |
CellInfo *comp; |
| 82 |
CellInfo *cplines; |
| 83 |
}; |
| 84 |
|
| 85 |
// This prepares B bits for multiplication. |
| 86 |
// CITE: CPE_MULTFab.pdf |
| 87 |
struct MultfabCell |
| 88 |
{ |
| 89 |
MultfabCell() : lower{nullptr}, upper{nullptr}, comp{nullptr}, cplines{nullptr} {} |
| 90 |
MultfabCell(CellInfo *lower, CellInfo *upper, CellInfo *comp, CellInfo *cplines, IdString name, bool is_even_x, |
| 91 |
bool enable_cinx); |
| 92 |
|
| 93 |
CellInfo *lower; |
| 94 |
CellInfo *upper; |
| 95 |
CellInfo *comp; |
| 96 |
CellInfo *cplines; |
| 97 |
}; |
| 98 |
|
| 99 |
// CITE: CPE_ges_f-routing1.pdf for !is_even_x; CPE_ges_f-routing2 for is_even_x |
| 100 |
struct FRoutingCell |
| 101 |
{ |
| 102 |
FRoutingCell() : lower{nullptr}, upper{nullptr}, comp{nullptr}, cplines{nullptr} {} |
| 103 |
FRoutingCell(CellInfo *lower, CellInfo *upper, CellInfo *comp, CellInfo *cplines, IdString name, bool is_even_x); |
| 104 |
|
| 105 |
CellInfo *lower; |
| 106 |
CellInfo *upper; |
| 107 |
CellInfo *comp; |
| 108 |
CellInfo *cplines; |
| 109 |
}; |
| 110 |
|
| 111 |
// Multiply two bits of A with two bits of B. |
| 112 |
// |
| 113 |
// CITE: CPE_MULT.pdf |
| 114 |
struct MultCell |
| 115 |
{ |
| 116 |
MultCell() : lower{nullptr}, upper{nullptr} {} |
| 117 |
MultCell(CellInfo *lower, CellInfo *upper, IdString name, bool is_msb); |
| 118 |
|
| 119 |
CellInfo *lower; |
| 120 |
CellInfo *upper; |
| 121 |
}; |
| 122 |
|
| 123 |
// CITE: CPE_ges_MSB-routing.pdf |
| 124 |
struct MsbRoutingCell |
| 125 |
{ |
| 126 |
MsbRoutingCell() : lower{nullptr}, upper{nullptr}, comp{nullptr}, cplines{nullptr} {} |
| 127 |
MsbRoutingCell(CellInfo *lower, CellInfo *upper, CellInfo *comp, CellInfo *cplines, IdString name); |
| 128 |
|
| 129 |
CellInfo *lower; |
| 130 |
CellInfo *upper; |
| 131 |
CellInfo *comp; |
| 132 |
CellInfo *cplines; |
| 133 |
}; |
| 134 |
|
| 135 |
struct MultiplierColumn |
| 136 |
{ |
| 137 |
BPassThroughCell b_passthru; |
| 138 |
CarryGenCell carry; |
| 139 |
MultfabCell multfab; |
| 140 |
FRoutingCell f_route; |
| 141 |
std::vector<MultCell> mults; |
| 142 |
MsbRoutingCell msb_route; |
| 143 |
}; |
| 144 |
|
| 145 |
// A GateMate multiplier is made up of columns of 2x2 multipliers. |
| 146 |
struct Multiplier |
| 147 |
{ |
| 148 |
ZeroDriver zero; |
| 149 |
std::vector<APassThroughCell> a_passthrus; |
| 150 |
std::vector<MultiplierColumn> cols; |
| 151 |
|
| 152 |
size_t cpe_count() const |
| 153 |
{ |
| 154 |
auto count = 1 /* (zero driver) */ + a_passthrus.size(); |
| 155 |
for (const auto &col : cols) { |
| 156 |
count += 4 /* (b_passthru, carry, multfab, f_route) */ + col.mults.size() + 1 /* (msb_route) */; |
| 157 |
} |
| 158 |
return count; |
| 159 |
} |
| 160 |
}; |
| 161 |
|
| 162 |
ZeroDriver::ZeroDriver(CellInfo *lower, CellInfo *upper, IdString name) : lower{lower}, upper{upper} |
| 163 |
{ |
| 164 |
upper->params[id_INIT_L00] = Property(LUT_ZERO, 4); // (unused) |
| 165 |
upper->params[id_INIT_L01] = Property(LUT_ZERO, 4); // (unused) |
| 166 |
upper->params[id_INIT_L10] = Property(LUT_ZERO, 4); // (unused) |
| 167 |
} |
| 168 |
|
| 169 |
APassThroughCell::APassThroughCell(CellInfo *lower, CellInfo *upper, CellInfo *comp, CellInfo *cplines, IdString name) |
| 170 |
: lower{lower}, upper{upper}, comp{comp}, cplines{cplines} |
| 171 |
{ |
| 172 |
lower->params[id_INIT_L00] = Property(LUT_D0, 4); // IN5 |
| 173 |
lower->params[id_INIT_L01] = Property(LUT_ZERO, 4); // (unused) |
| 174 |
lower->params[id_INIT_L10] = Property(LUT_D0, 4); // L02 |
| 175 |
|
| 176 |
comp->params[id_INIT_L30] = Property(LUT_ONE, 4); // zero -> COMP_OUT (L30 is inverted) |
| 177 |
|
| 178 |
upper->params[id_INIT_L00] = Property(LUT_D0, 4); // IN1 |
| 179 |
upper->params[id_INIT_L01] = Property(LUT_ZERO, 4); // (unused) |
| 180 |
upper->params[id_INIT_L10] = Property(LUT_D0, 4); // L00 -> COMB2OUT |
| 181 |
|
| 182 |
cplines->params[id_C_SEL_C] = Property(1, 1); // COMP_OUT -> CX_VAL |
| 183 |
cplines->params[id_C_SEL_P] = Property(1, 1); // COMP_OUT -> PX_VAL |
| 184 |
cplines->params[id_C_CX_I] = Property(1, 1); // CX_VAL -> COUTX |
| 185 |
cplines->params[id_C_PX_I] = Property(1, 1); // PX_VAL -> POUTX |
| 186 |
} |
| 187 |
|
| 188 |
void APassThroughCell::clean_up_cell(Context *ctx, CellInfo *cell) |
| 189 |
{ |
| 190 |
auto *net = cell->ports.at(id_IN1).net; |
| 191 |
|
| 192 |
NPNR_ASSERT(net != nullptr); |
| 193 |
|
| 194 |
bool net_is_gnd = net->name == ctx->idf("$PACKER_GND"); |
| 195 |
bool net_is_vcc = net->name == ctx->idf("$PACKER_VCC"); |
| 196 |
if (net_is_gnd || net_is_vcc) { |
| 197 |
cell->params[id_INIT_L00] = Property(LUT_ZERO, 4); |
| 198 |
cell->params[id_INIT_L10] = Property(net_is_vcc ? LUT_ONE : LUT_ZERO, 4); |
| 199 |
cell->disconnectPort(id_IN1); |
| 200 |
} |
| 201 |
} |
| 202 |
|
| 203 |
// B0 -> POUTY1; B1 -> COUTY1 |
| 204 |
BPassThroughCell::BPassThroughCell(CellInfo *lower, CellInfo *upper, CellInfo *cplines, IdString name) |
| 205 |
: lower{lower}, upper{upper}, cplines{cplines} |
| 206 |
{ |
| 207 |
lower->params[id_INIT_L00] = Property(LUT_D0, 4); // IN5 |
| 208 |
lower->params[id_INIT_L01] = Property(LUT_ZERO, 4); // (unused) |
| 209 |
lower->params[id_INIT_L10] = Property(LUT_D0, 4); // L02 |
| 210 |
|
| 211 |
upper->params[id_INIT_L00] = Property(LUT_D0, 4); // IN1 |
| 212 |
upper->params[id_INIT_L01] = Property(LUT_ZERO, 4); // (unused) |
| 213 |
upper->params[id_INIT_L10] = Property(LUT_D0, 4); // L00 -> COMB2OUT |
| 214 |
|
| 215 |
cplines->params[id_C_SEL_C] = Property(0, 1); // COMB2OUT -> CY1_VAL |
| 216 |
cplines->params[id_C_SEL_P] = Property(0, 1); // COMB1OUT -> PY1_VAL |
| 217 |
cplines->params[id_C_SELY1] = Property(0, 1); // COMB1OUT -> PY1_VAL; COMB2OUT -> CY1_VAL |
| 218 |
cplines->params[id_C_CY1_I] = Property(1, 1); // CY1_VAL -> COUTY1 |
| 219 |
cplines->params[id_C_PY1_I] = Property(1, 1); // PY1_VAL -> POUTY1 |
| 220 |
} |
| 221 |
|
| 222 |
void BPassThroughCell::clean_up_cell(Context *ctx, CellInfo *cell) |
| 223 |
{ |
| 224 |
auto *net = cell->ports.at(id_IN1).net; |
| 225 |
|
| 226 |
NPNR_ASSERT(net != nullptr); |
| 227 |
|
| 228 |
bool net_is_gnd = net->name == ctx->idf("$PACKER_GND"); |
| 229 |
bool net_is_vcc = net->name == ctx->idf("$PACKER_VCC"); |
| 230 |
if (net_is_gnd || net_is_vcc) { |
| 231 |
cell->params[id_INIT_L00] = Property(LUT_ZERO, 4); |
| 232 |
cell->params[id_INIT_L10] = Property(net_is_vcc ? LUT_ONE : LUT_ZERO, 4); |
| 233 |
cell->disconnectPort(id_IN1); |
| 234 |
} |
| 235 |
} |
| 236 |
|
| 237 |
CarryGenCell::CarryGenCell(CellInfo *lower, CellInfo *upper, CellInfo *comp, CellInfo *cplines, IdString name, |
| 238 |
bool is_odd_x, bool enable_cinx) |
| 239 |
: lower{lower}, upper{upper}, comp{comp}, cplines{cplines} |
| 240 |
{ |
| 241 |
lower->params[id_INIT_L00] = Property(LUT_D1, 4); // PINY1 |
| 242 |
lower->params[id_INIT_L01] = Property(LUT_ZERO, 4); // (overriden by CIN) |
| 243 |
lower->params[id_INIT_L10] = Property(is_odd_x ? LUT_OR : enable_cinx ? LUT_AND : LUT_ZERO, 4); |
| 244 |
lower->params[id_INIT_L20] = Property(is_odd_x ? LUT_OR : enable_cinx ? LUT_AND : LUT_ZERO, 4); |
| 245 |
lower->params[id_C_FUNCTION] = Property(C_EN_CIN, 3); |
| 246 |
lower->params[id_C_I3] = Property(1, 1); // PINY1 for L02 |
| 247 |
lower->params[id_C_HORIZ] = Property(0, 1); // CINY1 for CIN_ for L03 |
| 248 |
|
| 249 |
upper->params[id_INIT_L00] = Property(LUT_ZERO, 4); // (unused) |
| 250 |
upper->params[id_INIT_L01] = Property(enable_cinx ? LUT_D1 : LUT_ZERO, 4); // CINX |
| 251 |
upper->params[id_INIT_L10] = Property(LUT_D1, 4); |
| 252 |
if (enable_cinx) |
| 253 |
upper->params[id_C_I2] = Property(1, 1); // CINX for L01 |
| 254 |
|
| 255 |
comp->params[id_INIT_L30] = Property(LUT_INV_D0, 4); // OUT1 -> COMP_OUT |
| 256 |
|
| 257 |
cplines->params[id_C_PY1_I] = Property(0, 1); // PINY1 -> POUTY1 |
| 258 |
cplines->params[id_C_CY1_I] = Property(0, 1); // CINY1 -> COUTY1 |
| 259 |
cplines->params[id_C_CY2_I] = Property(1, 1); // CY2_VAL -> COUTY2 |
| 260 |
cplines->params[id_C_SEL_C] = Property(1, 1); // COMP_OUT -> CY2_VAL |
| 261 |
cplines->params[id_C_SELY2] = Property(0, 1); // COMP_OUT -> CY2_VAL |
| 262 |
} |
| 263 |
|
| 264 |
MultfabCell::MultfabCell(CellInfo *lower, CellInfo *upper, CellInfo *comp, CellInfo *cplines, IdString name, |
| 265 |
bool is_even_x, bool enable_cinx) |
| 266 |
: lower{lower}, upper{upper}, comp{comp}, cplines{cplines} |
| 267 |
{ |
| 268 |
lower->params[id_INIT_L00] = Property(LUT_D1, 4); // PINY1 |
| 269 |
// lower->params[id_INIT_L01] = Property(LUT_ZERO, 4); // (unused) |
| 270 |
lower->params[id_INIT_L10] = Property(LUT_D0, 4); // L02 |
| 271 |
lower->params[id_INIT_L20] = Property(is_even_x ? LUT_AND_INV_D0 : LUT_OR, 4); // L10 AND L11 -> OUT1 |
| 272 |
lower->params[id_C_FUNCTION] = Property(C_ADDCIN, 3); |
| 273 |
lower->params[id_C_HORIZ] = Property(0, 1); // CINY1 for CIN_ for L20 |
| 274 |
|
| 275 |
comp->params[id_INIT_L30] = Property(LUT_INV_D1, 4); // L10 -> COMP_OUT |
| 276 |
|
| 277 |
upper->params[id_INIT_L00] = Property(LUT_D1, 4); // PINY1 |
| 278 |
upper->params[id_INIT_L01] = Property(enable_cinx ? LUT_D1 : LUT_ZERO, 4); // CINX |
| 279 |
upper->params[id_INIT_L10] = Property(LUT_XOR, 4); // XOR |
| 280 |
|
| 281 |
upper->params[id_C_I1] = Property(1, 1); // PINY1 for L00 |
| 282 |
if (enable_cinx) |
| 283 |
upper->params[id_C_I2] = Property(1, 1); // CINX for L01 |
| 284 |
lower->params[id_C_I3] = Property(1, 1); // PINY1 for L02 |
| 285 |
|
| 286 |
cplines->params[id_C_SELX] = Property(1, 1); // inverted CINY2 -> CX_VAL |
| 287 |
cplines->params[id_C_SEL_C] = Property(1, 1); // inverted CINY2 -> CX_VAL; COMP_OUT -> CY1_VAL |
| 288 |
cplines->params[id_C_Y12] = Property(1, 1); // inverted CINY2 -> CX_VAL |
| 289 |
cplines->params[id_C_CX_I] = Property(1, 1); // CX_VAL -> COUTX |
| 290 |
cplines->params[id_C_CY1_I] = Property(1, 1); // CY1_VAL -> COUTY1 |
| 291 |
cplines->params[id_C_PY1_I] = Property(1, 1); // PY1_VAL -> POUTY1 |
| 292 |
cplines->params[id_C_SEL_P] = Property(0, 1); // OUT1 -> PY1_VAL |
| 293 |
cplines->params[id_C_SELY1] = Property(0, 1); // COMP_OUT -> CY1_VAL; OUT1 -> PY1_VAL |
| 294 |
} |
| 295 |
|
| 296 |
FRoutingCell::FRoutingCell(CellInfo *lower, CellInfo *upper, CellInfo *comp, CellInfo *cplines, IdString name, |
| 297 |
bool is_even_x) |
| 298 |
: lower{lower}, upper{upper}, comp{comp}, cplines{cplines} |
| 299 |
{ |
| 300 |
lower->params[id_INIT_L00] = Property(LUT_ZERO, 4); // (unused) |
| 301 |
lower->params[id_INIT_L01] = Property(LUT_ZERO, 4); // (unused) |
| 302 |
lower->params[id_INIT_L10] = Property(LUT_ZERO, 4); |
| 303 |
lower->params[id_INIT_L20] = Property(LUT_D1, 4); |
| 304 |
lower->params[id_C_FUNCTION] = Property(C_ADDCIN, 3); |
| 305 |
lower->params[id_C_HORIZ] = Property(0, 1); // CINY1 for CIN_ for L20 |
| 306 |
|
| 307 |
comp->params[id_INIT_L30] = Property(is_even_x ? LUT_ONE : LUT_INV_D1, 4); // L10 -> COMP_OUT |
| 308 |
|
| 309 |
upper->params[id_INIT_L00] = Property(LUT_D1, 4); // PINY1 |
| 310 |
// upper->params[id_INIT_L01] = Property(LUT_ONE, 4); // (unused) |
| 311 |
upper->params[id_INIT_L10] = Property(LUT_D0, 4); |
| 312 |
upper->params[id_C_I1] = Property(1, 1); // PINY1 for L00 |
| 313 |
|
| 314 |
cplines->params[id_C_SELX] = Property(1, 1); |
| 315 |
cplines->params[id_C_SEL_C] = Property(1, 1); |
| 316 |
cplines->params[id_C_Y12] = Property(1, 1); |
| 317 |
cplines->params[id_C_CX_I] = Property(1, 1); |
| 318 |
cplines->params[id_C_CY1_I] = Property(is_even_x, 1); |
| 319 |
cplines->params[id_C_CY2_I] = Property(1, 1); |
| 320 |
cplines->params[id_C_PY1_I] = Property(1, 1); |
| 321 |
cplines->params[id_C_PY2_I] = Property(1, 1); |
| 322 |
} |
| 323 |
|
| 324 |
MultCell::MultCell(CellInfo *lower, CellInfo *upper, IdString name, bool is_msb) : lower{lower}, upper{upper} |
| 325 |
{ |
| 326 |
lower->params[id_INIT_L02] = Property(LUT_AND, 4); |
| 327 |
lower->params[id_INIT_L03] = Property(LUT_D1, 4); // PINX |
| 328 |
lower->params[id_INIT_L11] = Property(LUT_XOR, 4); |
| 329 |
lower->params[id_C_FUNCTION] = Property(C_MULT, 3); |
| 330 |
|
| 331 |
upper->params[id_INIT_L00] = Property(LUT_AND, 4); |
| 332 |
upper->params[id_INIT_L01] = Property(LUT_D1, 4); // CINX |
| 333 |
upper->params[id_INIT_L10] = Property(LUT_XOR, 4); |
| 334 |
|
| 335 |
upper->params[id_C_I1] = Property(1, 1); // PINY1 for L00 |
| 336 |
upper->params[id_C_I2] = Property(1, 1); // CINX for L01 |
| 337 |
lower->params[id_C_I3] = Property(1, 1); // PINY1 for L02 |
| 338 |
lower->params[id_C_I4] = Property(1, 1); // PINX for L03 |
| 339 |
upper->params[id_C_FUNCTION] = Property(C_MULT, 3); |
| 340 |
|
| 341 |
if (is_msb) { |
| 342 |
lower->params[id_C_PY1_I] = Property(1, 1); |
| 343 |
lower->params[id_C_C_P] = Property(1, 1); |
| 344 |
} else { |
| 345 |
lower->params[id_C_PY1_I] = Property(0, 1); |
| 346 |
lower->params[id_C_C_P] = Property(0, 1); |
| 347 |
} |
| 348 |
|
| 349 |
// Must force these, even if outputs are not used, to preserve logic |
| 350 |
lower->params[id_C_O1] = Property(0b10, 2); // CP_OUT1 -> OUT1 |
| 351 |
lower->params[id_C_O2] = Property(0b10, 2); // CP_OUT2 -> OUT2 |
| 352 |
} |
| 353 |
|
| 354 |
MsbRoutingCell::MsbRoutingCell(CellInfo *lower, CellInfo *upper, CellInfo *comp, CellInfo *cplines, IdString name) |
| 355 |
: lower{lower}, upper{upper}, comp{comp}, cplines{cplines} |
| 356 |
{ |
| 357 |
comp->params[id_INIT_L30] = Property(LUT_ONE, 4); // zero -> COMP_OUT (L30 is inverted) |
| 358 |
|
| 359 |
upper->params[id_INIT_L00] = Property(LUT_D1, 4); // PINY1 |
| 360 |
upper->params[id_INIT_L01] = Property(LUT_ZERO, 4); // (unused) |
| 361 |
upper->params[id_INIT_L10] = Property(LUT_D0, 4); // L00 -> COMB2OUT |
| 362 |
upper->params[id_C_I1] = Property(1, 1); // PINY1 for L00 |
| 363 |
|
| 364 |
cplines->params[id_C_SELX] = Property(1, 1); // COMB2OUT -> CX_VAL; PINY1 -> PX_VAL |
| 365 |
cplines->params[id_C_SELY1] = Property(0, 1); // COMP_OUT -> PY1_VAL |
| 366 |
cplines->params[id_C_SELY2] = Property(0, 1); // COMP_OUT -> PY2_VAL |
| 367 |
cplines->params[id_C_SEL_P] = Property(1, 1); // PINY1 -> PX_VAL; COMP_OUT -> PY1_VAL; COMP_OUT -> PY2_VAL |
| 368 |
cplines->params[id_C_CX_I] = Property(1, 1); // CX_VAL -> COUTX |
| 369 |
cplines->params[id_C_PX_I] = Property(1, 1); // PX_VAL -> POUTX |
| 370 |
cplines->params[id_C_PY1_I] = Property(1, 1); // PY1_VAL -> POUTY1 |
| 371 |
cplines->params[id_C_PY2_I] = Property(1, 1); // PY2_VAL -> POUTY2 |
| 372 |
} |
| 373 |
|
| 374 |
void GateMatePacker::pack_mult() |
| 375 |
{ |
| 376 |
// note to self: use constr_children for recursive constraints |
| 377 |
// fpga_generic.pas in p_r might have useful info |
| 378 |
|
| 379 |
auto create_zero_driver = [&](IdString name) { |
| 380 |
auto *zero_lower = create_cell_ptr(id_CPE_DUMMY, ctx->idf("%s$zero_lower", name.c_str(ctx))); |
| 381 |
auto *zero_upper = create_cell_ptr(id_CPE_L2T4, ctx->idf("%s$zero", name.c_str(ctx))); |
| 382 |
|
| 383 |
uarch->multiplier_zero_drivers.insert(zero_upper->name); |
| 384 |
|
| 385 |
return ZeroDriver{zero_lower, zero_upper, name}; |
| 386 |
}; |
| 387 |
|
| 388 |
auto create_a_passthru = [&](IdString name) { |
| 389 |
auto *a_passthru_lower = create_cell_ptr(id_CPE_L2T4, ctx->idf("%s$a_passthru_lower", name.c_str(ctx))); |
| 390 |
auto *a_passthru_upper = create_cell_ptr(id_CPE_L2T4, ctx->idf("%s$a_passthru_upper", name.c_str(ctx))); |
| 391 |
auto *a_passthru_comp = create_cell_ptr(id_CPE_COMP, ctx->idf("%s$a_passthru_comp", name.c_str(ctx))); |
| 392 |
auto *a_passthru_lines = create_cell_ptr(id_CPE_CPLINES, ctx->idf("%s$a_passthru_cplines", name.c_str(ctx))); |
| 393 |
|
| 394 |
NetInfo *comp_conn = ctx->createNet(ctx->idf("%s$a_passthru_comp$compout", name.c_str(ctx))); |
| 395 |
a_passthru_comp->connectPort(id_COMPOUT, comp_conn); |
| 396 |
a_passthru_lines->connectPort(id_COMPOUT, comp_conn); |
| 397 |
|
| 398 |
uarch->multiplier_a_passthru_lowers.insert(a_passthru_lower->name); |
| 399 |
uarch->multiplier_a_passthru_uppers.insert(a_passthru_upper->name); |
| 400 |
|
| 401 |
return APassThroughCell{a_passthru_lower, a_passthru_upper, a_passthru_comp, a_passthru_lines, name}; |
| 402 |
}; |
| 403 |
|
| 404 |
auto create_mult_col = [&](IdString name, int a_width, bool is_even_x, bool enable_cinx) { |
| 405 |
// Ideally this would be the MultiplierColumn constructor, but we need create_cell_ptr here. |
| 406 |
auto col = MultiplierColumn{}; |
| 407 |
|
| 408 |
{ |
| 409 |
auto *b_passthru_lower = create_cell_ptr(id_CPE_L2T4, ctx->idf("%s$b_passthru_lower", name.c_str(ctx))); |
| 410 |
auto *b_passthru_upper = create_cell_ptr(id_CPE_L2T4, ctx->idf("%s$b_passthru_upper", name.c_str(ctx))); |
| 411 |
auto *b_passthru_lines = |
| 412 |
create_cell_ptr(id_CPE_CPLINES, ctx->idf("%s$b_passthru_cplines", name.c_str(ctx))); |
| 413 |
|
| 414 |
NetInfo *comb1_conn = ctx->createNet(ctx->idf("%s$b_passthru$comb1", name.c_str(ctx))); |
| 415 |
b_passthru_lower->connectPort(id_OUT, comb1_conn); |
| 416 |
b_passthru_lines->connectPort(id_OUT1, comb1_conn); |
| 417 |
|
| 418 |
NetInfo *comb2_conn = ctx->createNet(ctx->idf("%s$b_passthru$comb2", name.c_str(ctx))); |
| 419 |
b_passthru_upper->connectPort(id_OUT, comb2_conn); |
| 420 |
b_passthru_lines->connectPort(id_OUT2, comb2_conn); |
| 421 |
|
| 422 |
col.b_passthru = BPassThroughCell{b_passthru_lower, b_passthru_upper, b_passthru_lines, name}; |
| 423 |
} |
| 424 |
|
| 425 |
{ |
| 426 |
auto *carry_lower = create_cell_ptr(id_CPE_L2T4, ctx->idf("%s$carry_lower", name.c_str(ctx))); |
| 427 |
auto *carry_upper = create_cell_ptr(id_CPE_L2T4, ctx->idf("%s$carry_upper", name.c_str(ctx))); |
| 428 |
auto *carry_comp = create_cell_ptr(id_CPE_COMP, ctx->idf("%s$carry_comp", name.c_str(ctx))); |
| 429 |
auto *carry_lines = create_cell_ptr(id_CPE_CPLINES, ctx->idf("%s$carry_lines", name.c_str(ctx))); |
| 430 |
|
| 431 |
NetInfo *comb2_conn = ctx->createNet(ctx->idf("%s$carrycomb2", name.c_str(ctx))); |
| 432 |
carry_upper->connectPort(id_OUT, comb2_conn); |
| 433 |
carry_lower->addInput(id_COMBIN); |
| 434 |
carry_lower->connectPort(id_COMBIN, comb2_conn); |
| 435 |
|
| 436 |
NetInfo *comp_in = ctx->createNet(ctx->idf("%s$carry$comp_in", name.c_str(ctx))); |
| 437 |
carry_lower->connectPort(id_OUT, comp_in); |
| 438 |
carry_comp->connectPort(id_COMB1, comp_in); |
| 439 |
|
| 440 |
NetInfo *comp_out = ctx->createNet(ctx->idf("%s$carry$comp_out", name.c_str(ctx))); |
| 441 |
carry_comp->connectPort(id_COMPOUT, comp_out); |
| 442 |
carry_lines->connectPort(id_COMPOUT, comp_out); |
| 443 |
|
| 444 |
col.carry = CarryGenCell{carry_lower, carry_upper, carry_comp, carry_lines, name, !is_even_x, enable_cinx}; |
| 445 |
} |
| 446 |
|
| 447 |
{ |
| 448 |
auto *multfab_lower = |
| 449 |
create_cell_ptr(id_CPE_L2T4, ctx->idf("%s$multf%c_lower", name.c_str(ctx), is_even_x ? 'a' : 'b')); |
| 450 |
auto *multfab_upper = |
| 451 |
create_cell_ptr(id_CPE_L2T4, ctx->idf("%s$multf%c_upper", name.c_str(ctx), is_even_x ? 'a' : 'b')); |
| 452 |
auto *multfab_comp = |
| 453 |
create_cell_ptr(id_CPE_COMP, ctx->idf("%s$multf%c_comp", name.c_str(ctx), is_even_x ? 'a' : 'b')); |
| 454 |
auto *multfab_lines = create_cell_ptr( |
| 455 |
id_CPE_CPLINES, ctx->idf("%s$multf%c_cplines", name.c_str(ctx), is_even_x ? 'a' : 'b')); |
| 456 |
|
| 457 |
NetInfo *comb1_conn = ctx->createNet(ctx->idf("%s$multf%c$comb1", name.c_str(ctx), is_even_x ? 'a' : 'b')); |
| 458 |
multfab_lower->connectPort(id_OUT, comb1_conn); |
| 459 |
multfab_lines->connectPort(id_OUT1, comb1_conn); |
| 460 |
|
| 461 |
NetInfo *comb2_conn = ctx->createNet(ctx->idf("%s$multf%c$comb2", name.c_str(ctx), is_even_x ? 'a' : 'b')); |
| 462 |
multfab_upper->connectPort(id_OUT, comb2_conn); |
| 463 |
multfab_lower->addInput(id_COMBIN); |
| 464 |
multfab_lower->connectPort(id_COMBIN, comb2_conn); |
| 465 |
multfab_comp->connectPort(id_COMB2, comb2_conn); |
| 466 |
|
| 467 |
NetInfo *comp_out = ctx->createNet(ctx->idf("%s$multf%c$comp_out", name.c_str(ctx), is_even_x ? 'a' : 'b')); |
| 468 |
multfab_comp->connectPort(id_COMPOUT, comp_out); |
| 469 |
multfab_lines->connectPort(id_COMPOUT, comp_out); |
| 470 |
|
| 471 |
col.multfab = MultfabCell{multfab_lower, multfab_upper, multfab_comp, multfab_lines, |
| 472 |
name, is_even_x, enable_cinx}; |
| 473 |
} |
| 474 |
|
| 475 |
{ |
| 476 |
auto *f_route_lower = create_cell_ptr(id_CPE_L2T4, ctx->idf("%s$f_route_lower", name.c_str(ctx))); |
| 477 |
auto *f_route_upper = create_cell_ptr(id_CPE_L2T4, ctx->idf("%s$f_route_upper", name.c_str(ctx))); |
| 478 |
auto *f_route_comp = create_cell_ptr(id_CPE_COMP, ctx->idf("%s$f_route_comp", name.c_str(ctx))); |
| 479 |
auto *f_route_lines = create_cell_ptr(id_CPE_CPLINES, ctx->idf("%s$f_route_lines", name.c_str(ctx))); |
| 480 |
|
| 481 |
NetInfo *comb1_conn = ctx->createNet(ctx->idf("%s$f_route$comb1", name.c_str(ctx))); |
| 482 |
f_route_lower->connectPort(id_OUT, comb1_conn); |
| 483 |
f_route_lines->connectPort(id_OUT1, comb1_conn); |
| 484 |
|
| 485 |
NetInfo *comb2_conn = ctx->createNet(ctx->idf("%s$f_route$comb2", name.c_str(ctx))); |
| 486 |
f_route_upper->connectPort(id_OUT, comb2_conn); |
| 487 |
f_route_lines->connectPort(id_OUT2, comb2_conn); |
| 488 |
if (!is_even_x) |
| 489 |
f_route_comp->connectPort(id_COMB2, comb2_conn); |
| 490 |
|
| 491 |
NetInfo *comp_out = ctx->createNet(ctx->idf("%s$f_route$comp_out", name.c_str(ctx))); |
| 492 |
f_route_comp->connectPort(id_COMPOUT, comp_out); |
| 493 |
f_route_lines->connectPort(id_COMPOUT, comp_out); |
| 494 |
|
| 495 |
col.f_route = FRoutingCell{f_route_lower, f_route_upper, f_route_comp, f_route_lines, name, is_even_x}; |
| 496 |
} |
| 497 |
|
| 498 |
for (int i = 0; i < (a_width / 2); i++) { |
| 499 |
auto *mult_lower = create_cell_ptr(id_CPE_LT_L, ctx->idf("%s$row%d$mult_lower", name.c_str(ctx), i)); |
| 500 |
auto *mult_upper = create_cell_ptr(id_CPE_LT_U, ctx->idf("%s$row%d$mult_upper", name.c_str(ctx), i)); |
| 501 |
mult_lower->params[id_MULT_INVERT] = Property(is_even_x ? Property::State::S0 : Property::State::S1); |
| 502 |
|
| 503 |
col.mults.push_back(MultCell{mult_lower, mult_upper, name, i == ((a_width / 2) - 1)}); |
| 504 |
} |
| 505 |
|
| 506 |
{ |
| 507 |
auto *msb_route_lower = create_cell_ptr(id_CPE_DUMMY, ctx->idf("%s$msb_route_lower", name.c_str(ctx))); |
| 508 |
auto *msb_route_upper = create_cell_ptr(id_CPE_L2T4, ctx->idf("%s$msb_route", name.c_str(ctx))); |
| 509 |
auto *msb_route_comp = create_cell_ptr(id_CPE_COMP, ctx->idf("%s$msb_route_comp", name.c_str(ctx))); |
| 510 |
auto *msb_route_lines = create_cell_ptr(id_CPE_CPLINES, ctx->idf("%s$msb_route_lines", name.c_str(ctx))); |
| 511 |
|
| 512 |
NetInfo *comp_conn = ctx->createNet(ctx->idf("%s$msb_route$compout", name.c_str(ctx))); |
| 513 |
msb_route_comp->connectPort(id_COMPOUT, comp_conn); |
| 514 |
msb_route_lines->connectPort(id_COMPOUT, comp_conn); |
| 515 |
|
| 516 |
NetInfo *out_conn = ctx->createNet(ctx->idf("%s$msb_route$out", name.c_str(ctx))); |
| 517 |
msb_route_upper->connectPort(id_OUT, out_conn); |
| 518 |
msb_route_lines->connectPort(id_OUT2, out_conn); |
| 519 |
|
| 520 |
col.msb_route = MsbRoutingCell{msb_route_lower, msb_route_upper, msb_route_comp, msb_route_lines, name}; |
| 521 |
} |
| 522 |
|
| 523 |
return col; |
| 524 |
}; |
| 525 |
|
| 526 |
log_info("Packing multipliers...\n"); |
| 527 |
|
| 528 |
auto mults = std::vector<CellInfo *>{}; |
| 529 |
|
| 530 |
for (auto &cell : ctx->cells) { |
| 531 |
CellInfo *ci = cell.second.get(); |
| 532 |
if (ci->type == id_CC_MULT) |
| 533 |
mults.push_back(ci); |
| 534 |
} |
| 535 |
|
| 536 |
for (auto *mult : mults) { |
| 537 |
auto a_width = int_or_default(mult->params, id_A_WIDTH); |
| 538 |
auto b_width = int_or_default(mult->params, id_B_WIDTH); |
| 539 |
auto p_width = int_or_default(mult->params, id_P_WIDTH); |
| 540 |
mult->renamePort(id_A, ctx->id("A[0]")); |
| 541 |
mult->renamePort(id_B, ctx->id("B[0]")); |
| 542 |
mult->renamePort(id_P, ctx->id("P[0]")); |
| 543 |
|
| 544 |
int a_size = (((a_width + 1) / 2) + 1) * 2; |
| 545 |
int b_size = (((b_width + 1) / 2) + 1) * 2; |
| 546 |
// Sign-extend odd A_WIDTH to even, because we're working with 2x2 multiplier cells. |
| 547 |
while (a_width < a_size) { |
| 548 |
mult->copyPortTo(ctx->idf("A[%d]", a_width - 1), mult, ctx->idf("A[%d]", a_width)); |
| 549 |
a_width += 1; |
| 550 |
} |
| 551 |
|
| 552 |
// Sign-extend odd B_WIDTH to even, because we're working with 2x2 multiplier cells. |
| 553 |
while (b_width < b_size) { |
| 554 |
mult->copyPortTo(ctx->idf("B[%d]", b_width - 1), mult, ctx->idf("B[%d]", b_width)); |
| 555 |
b_width += 1; |
| 556 |
} |
| 557 |
|
| 558 |
log_info(" Configuring '%s' as a %d-bit * %d-bit = %d-bit multiplier.\n", mult->name.c_str(ctx), a_width, |
| 559 |
b_width, p_width); |
| 560 |
|
| 561 |
auto m = Multiplier{}; |
| 562 |
|
| 563 |
// Step 1: instantiate all the CPEs. |
| 564 |
m.zero = create_zero_driver(ctx->idf("%s$col0", mult->name.c_str(ctx))); |
| 565 |
for (int a = 0; a < a_width / 2; a++) |
| 566 |
m.a_passthrus.push_back(create_a_passthru(ctx->idf("%s$col0$row%d", mult->name.c_str(ctx), a))); |
| 567 |
for (int b = 0; b < b_width / 2; b++) |
| 568 |
m.cols.push_back( |
| 569 |
create_mult_col(ctx->idf("%s$col%d", mult->name.c_str(ctx), b + 1), a_width, b % 2 == 0, b > 0)); |
| 570 |
|
| 571 |
// Step 2: constrain them together. |
| 572 |
// We define (0, 0) to be the B passthrough cell of column 1. |
| 573 |
// we also constrain it to proper Z location |
| 574 |
auto *root = m.cols[0].b_passthru.upper; |
| 575 |
root->cluster = root->name; |
| 576 |
root->region = mult->region; |
| 577 |
root->constr_abs_z = true; |
| 578 |
root->constr_z = CPE_LT_U_Z; |
| 579 |
|
| 580 |
auto constrain_cell = [&](CellInfo *cell, int x_offset, int y_offset, int z_offset) { |
| 581 |
if (cell == root) |
| 582 |
return; |
| 583 |
root->constr_children.push_back(cell); |
| 584 |
cell->cluster = root->name; |
| 585 |
cell->region = root->region; |
| 586 |
cell->constr_abs_z = true; |
| 587 |
cell->constr_x = x_offset; |
| 588 |
cell->constr_y = y_offset; |
| 589 |
cell->constr_z = z_offset; |
| 590 |
}; |
| 591 |
|
| 592 |
// Constrain zero driver. |
| 593 |
constrain_cell(m.zero.lower, -1, 3, CPE_LT_L_Z); |
| 594 |
constrain_cell(m.zero.upper, -1, 3, CPE_LT_U_Z); |
| 595 |
|
| 596 |
// Constrain A passthrough cells. |
| 597 |
for (int a = 0; a < a_width / 2; a++) { |
| 598 |
auto &a_passthru = m.a_passthrus.at(a); |
| 599 |
constrain_cell(a_passthru.lower, -1, 4 + a, CPE_LT_L_Z); |
| 600 |
constrain_cell(a_passthru.upper, -1, 4 + a, CPE_LT_U_Z); |
| 601 |
constrain_cell(a_passthru.comp, -1, 4 + a, CPE_COMP_Z); |
| 602 |
constrain_cell(a_passthru.cplines, -1, 4 + a, CPE_CPLINES_Z); |
| 603 |
} |
| 604 |
|
| 605 |
// Constrain multiplier columns. |
| 606 |
for (int b = 0; b < b_width / 2; b++) { |
| 607 |
auto &col = m.cols.at(b); |
| 608 |
constrain_cell(col.b_passthru.lower, b, b, CPE_LT_L_Z); |
| 609 |
constrain_cell(col.b_passthru.upper, b, b, CPE_LT_U_Z); |
| 610 |
constrain_cell(col.b_passthru.cplines, b, b, CPE_CPLINES_Z); |
| 611 |
|
| 612 |
constrain_cell(col.carry.lower, b, b + 1, CPE_LT_L_Z); |
| 613 |
constrain_cell(col.carry.upper, b, b + 1, CPE_LT_U_Z); |
| 614 |
constrain_cell(col.carry.comp, b, b + 1, CPE_COMP_Z); |
| 615 |
constrain_cell(col.carry.cplines, b, b + 1, CPE_CPLINES_Z); |
| 616 |
|
| 617 |
constrain_cell(col.multfab.lower, b, b + 2, CPE_LT_L_Z); |
| 618 |
constrain_cell(col.multfab.upper, b, b + 2, CPE_LT_U_Z); |
| 619 |
constrain_cell(col.multfab.comp, b, b + 2, CPE_COMP_Z); |
| 620 |
constrain_cell(col.multfab.cplines, b, b + 2, CPE_CPLINES_Z); |
| 621 |
|
| 622 |
constrain_cell(col.f_route.lower, b, b + 3, CPE_LT_L_Z); |
| 623 |
constrain_cell(col.f_route.upper, b, b + 3, CPE_LT_U_Z); |
| 624 |
constrain_cell(col.f_route.comp, b, b + 3, CPE_COMP_Z); |
| 625 |
constrain_cell(col.f_route.cplines, b, b + 3, CPE_CPLINES_Z); |
| 626 |
|
| 627 |
for (size_t mult_idx = 0; mult_idx < col.mults.size(); mult_idx++) { |
| 628 |
constrain_cell(col.mults[mult_idx].lower, b, b + 4 + mult_idx, CPE_LT_L_Z); |
| 629 |
constrain_cell(col.mults[mult_idx].upper, b, b + 4 + mult_idx, CPE_LT_U_Z); |
| 630 |
} |
| 631 |
|
| 632 |
constrain_cell(col.msb_route.lower, b, b + 4 + col.mults.size(), CPE_LT_L_Z); |
| 633 |
constrain_cell(col.msb_route.upper, b, b + 4 + col.mults.size(), CPE_LT_U_Z); |
| 634 |
constrain_cell(col.msb_route.comp, b, b + 4 + col.mults.size(), CPE_COMP_Z); |
| 635 |
constrain_cell(col.msb_route.cplines, b, b + 4 + col.mults.size(), CPE_CPLINES_Z); |
| 636 |
} |
| 637 |
|
| 638 |
// Step 3: connect them. |
| 639 |
|
| 640 |
// Zero driver. |
| 641 |
auto *zero_net = ctx->createNet(ctx->idf("%s$out", m.zero.upper->name.c_str(ctx))); |
| 642 |
m.zero.upper->connectPort(id_OUT, zero_net); |
| 643 |
|
| 644 |
// A input. |
| 645 |
for (size_t a = 0; a < m.a_passthrus.size(); a++) { |
| 646 |
auto &a_passthru = m.a_passthrus.at(a); |
| 647 |
|
| 648 |
// Connect A input passthrough cell. |
| 649 |
mult->movePortTo(ctx->idf("A[%d]", 2 * a), a_passthru.lower, id_IN1); |
| 650 |
mult->movePortTo(ctx->idf("A[%d]", 2 * a + 1), a_passthru.upper, id_IN1); |
| 651 |
|
| 652 |
// Prepare A passthrough nets. |
| 653 |
auto lower_name = a_passthru.lower->name; |
| 654 |
auto upper_name = a_passthru.upper->name; |
| 655 |
auto lower_net_name = a_passthru.lower->ports.at(id_IN1).net->name; |
| 656 |
auto upper_net_name = a_passthru.upper->ports.at(id_IN1).net->name; |
| 657 |
|
| 658 |
auto *lower_net = ctx->createNet( |
| 659 |
ctx->idf("%s$%s$a%d_passthru", lower_name.c_str(ctx), lower_net_name.c_str(ctx), 2 * a)); |
| 660 |
a_passthru.lower->connectPort(id_OUT, lower_net); |
| 661 |
|
| 662 |
auto *upper_net = ctx->createNet( |
| 663 |
ctx->idf("%s$%s$a%d_passthru", upper_name.c_str(ctx), upper_net_name.c_str(ctx), 2 * a + 1)); |
| 664 |
a_passthru.upper->connectPort(id_OUT, upper_net); |
| 665 |
|
| 666 |
// Inputs may be GND/VCC; if so, clean them up. |
| 667 |
a_passthru.clean_up_cell(ctx, a_passthru.lower); |
| 668 |
a_passthru.clean_up_cell(ctx, a_passthru.upper); |
| 669 |
|
| 670 |
// Connect A passthrough outputs to multiplier inputs. |
| 671 |
{ |
| 672 |
// Sum output connections. |
| 673 |
auto &mult_row = m.cols.at(0).mults.at(a); |
| 674 |
|
| 675 |
auto *so1_net = ctx->createNet(ctx->idf("%s$so1", upper_name.c_str(ctx))); |
| 676 |
a_passthru.cplines->connectPort(id_COUTX, so1_net); |
| 677 |
mult_row.lower->connectPort(id_CINX, so1_net); |
| 678 |
|
| 679 |
auto *so2_net = ctx->createNet(ctx->idf("%s$so2", upper_name.c_str(ctx))); |
| 680 |
a_passthru.cplines->connectPort(id_POUTX, so2_net); |
| 681 |
mult_row.lower->connectPort(id_PINX, so2_net); |
| 682 |
} |
| 683 |
|
| 684 |
for (size_t b = 0; b < m.cols.size(); b++) { |
| 685 |
auto &mult_row = m.cols.at(b).mults.at(a); |
| 686 |
mult_row.lower->connectPort(id_IN1, lower_net); |
| 687 |
mult_row.upper->connectPort(id_IN1, upper_net); |
| 688 |
|
| 689 |
if (a == 0) { |
| 690 |
mult_row.lower->connectPort(id_IN4, zero_net); |
| 691 |
} else { |
| 692 |
auto &mult_row_below = m.cols.at(b).mults.at(a - 1); |
| 693 |
auto *a_net_below = mult_row_below.upper->ports.at(id_IN1).net; |
| 694 |
mult_row.lower->connectPort(id_IN4, a_net_below); |
| 695 |
} |
| 696 |
} |
| 697 |
} |
| 698 |
|
| 699 |
// B input. |
| 700 |
for (size_t b = 0; b < m.cols.size(); b++) { |
| 701 |
auto &b_passthru = m.cols.at(b).b_passthru; |
| 702 |
|
| 703 |
// Connect B input passthrough cell. |
| 704 |
mult->movePortTo(ctx->idf("B[%d]", 2 * b), b_passthru.lower, id_IN1); |
| 705 |
mult->movePortTo(ctx->idf("B[%d]", 2 * b + 1), b_passthru.upper, id_IN1); |
| 706 |
} |
| 707 |
|
| 708 |
// Intermediate multiplier connections. |
| 709 |
for (size_t b = 0; b < m.cols.size(); b++) { |
| 710 |
auto &b_passthru = m.cols.at(b).b_passthru; |
| 711 |
auto &b_carry = m.cols.at(b).carry; |
| 712 |
auto &b_multfab = m.cols.at(b).multfab; |
| 713 |
auto &b_f_route = m.cols.at(b).f_route; |
| 714 |
auto &b_msb_route = m.cols.at(b).msb_route; |
| 715 |
|
| 716 |
auto lower_net_name = b_passthru.lower->ports.at(id_IN1).net->name; |
| 717 |
auto upper_net_name = b_passthru.upper->ports.at(id_IN1).net->name; |
| 718 |
|
| 719 |
// B Passthrough (POUTY1, COUTY1) -> Carry Gen (PINY1, CINY1) |
| 720 |
{ |
| 721 |
auto lines_name = b_passthru.cplines->name; |
| 722 |
|
| 723 |
auto *lower_net = ctx->createNet( |
| 724 |
ctx->idf("%s$%s$b%d_passthru", lines_name.c_str(ctx), lower_net_name.c_str(ctx), 2 * b)); |
| 725 |
b_passthru.cplines->connectPort(id_POUTY1, lower_net); |
| 726 |
b_carry.cplines->connectPort(id_PINY1, lower_net); |
| 727 |
b_carry.lower->connectPort(id_PINY1, lower_net); |
| 728 |
|
| 729 |
auto *upper_net = ctx->createNet( |
| 730 |
ctx->idf("%s$%s$b%d_passthru", lines_name.c_str(ctx), upper_net_name.c_str(ctx), 2 * b + 1)); |
| 731 |
b_passthru.cplines->connectPort(id_COUTY1, upper_net); |
| 732 |
b_carry.cplines->connectPort(id_CINY1, upper_net); |
| 733 |
b_carry.lower->connectPort(id_CINY1, upper_net); |
| 734 |
} |
| 735 |
|
| 736 |
// Carry Gen (POUTY1, COUTY1, COUTY2) -> MULTFab (PINY1, CINY1, CINY2) |
| 737 |
{ |
| 738 |
auto lines_name = b_carry.cplines->name; |
| 739 |
|
| 740 |
auto *lower_net = ctx->createNet( |
| 741 |
ctx->idf("%s$%s$b%d_passthru", lines_name.c_str(ctx), lower_net_name.c_str(ctx), 2 * b)); |
| 742 |
b_carry.cplines->connectPort(id_POUTY1, lower_net); |
| 743 |
b_multfab.cplines->connectPort(id_PINY1, lower_net); |
| 744 |
b_multfab.lower->connectPort(id_PINY1, lower_net); |
| 745 |
b_multfab.upper->connectPort(id_PINY1, lower_net); |
| 746 |
|
| 747 |
auto *upper_net = ctx->createNet( |
| 748 |
ctx->idf("%s$%s$b%d_passthru", lines_name.c_str(ctx), upper_net_name.c_str(ctx), 2 * b + 1)); |
| 749 |
b_carry.cplines->connectPort(id_COUTY1, upper_net); |
| 750 |
b_multfab.cplines->connectPort(id_CINY1, upper_net); |
| 751 |
b_multfab.lower->connectPort(id_CINY1, upper_net); |
| 752 |
|
| 753 |
auto *ccs_net = ctx->createNet(ctx->idf("%s$ccs", lines_name.c_str(ctx))); |
| 754 |
b_carry.cplines->connectPort(id_COUTY2, ccs_net); |
| 755 |
b_multfab.cplines->connectPort(id_CINY2, ccs_net); |
| 756 |
} |
| 757 |
|
| 758 |
// MULTFab (POUTY1, COUTY1, COUTY2) -> FRoute (PINY1, CINY1, CINY2) |
| 759 |
{ |
| 760 |
auto lines_name = b_multfab.cplines->name; |
| 761 |
|
| 762 |
auto *lower_net = ctx->createNet( |
| 763 |
ctx->idf("%s$%s$f%d", lines_name.c_str(ctx), lower_net_name.c_str(ctx), 2 * b + 1)); |
| 764 |
b_multfab.cplines->connectPort(id_POUTY1, lower_net); |
| 765 |
b_f_route.cplines->connectPort(id_PINY1, lower_net); |
| 766 |
b_f_route.upper->connectPort(id_PINY1, lower_net); |
| 767 |
|
| 768 |
auto *upper_net = |
| 769 |
ctx->createNet(ctx->idf("%s$%s$f%d", lines_name.c_str(ctx), upper_net_name.c_str(ctx), 2 * b)); |
| 770 |
b_multfab.cplines->connectPort(id_COUTY1, upper_net); |
| 771 |
b_f_route.cplines->connectPort(id_CINY1, upper_net); |
| 772 |
b_f_route.lower->connectPort(id_CINY1, upper_net); |
| 773 |
|
| 774 |
auto *ccs_net = ctx->createNet(ctx->idf("%s$ccs", lines_name.c_str(ctx))); |
| 775 |
b_multfab.cplines->connectPort(id_COUTY2, ccs_net); |
| 776 |
b_f_route.cplines->connectPort(id_CINY2, ccs_net); |
| 777 |
} |
| 778 |
|
| 779 |
// MULTFab (COUTX) -> Carry Gen (CINX) |
| 780 |
if (b + 1 < m.cols.size()) { |
| 781 |
auto &b_carry_right = m.cols.at(b + 1).carry; |
| 782 |
|
| 783 |
auto lines_name = b_multfab.cplines->name; |
| 784 |
|
| 785 |
auto *cco_net = ctx->createNet(ctx->idf("%s$cco", lines_name.c_str(ctx))); |
| 786 |
b_multfab.cplines->connectPort(id_COUTX, cco_net); |
| 787 |
b_carry_right.cplines->connectPort(id_CINX, cco_net); |
| 788 |
b_carry_right.upper->connectPort(id_CINX, cco_net); |
| 789 |
} |
| 790 |
|
| 791 |
// FRoute (POUTY1, POUTY2, COUTY1, COUTY2) -> C_MULT (PINY1, PINY2, CINY1, CINY2) |
| 792 |
{ |
| 793 |
auto &b_mult = m.cols.at(b).mults.front(); |
| 794 |
|
| 795 |
auto lines_name = b_multfab.cplines->name; |
| 796 |
|
| 797 |
auto *f_p1_net = ctx->createNet( |
| 798 |
ctx->idf("%s$%s$f%d_p1", lines_name.c_str(ctx), lower_net_name.c_str(ctx), 2 * b)); |
| 799 |
b_f_route.cplines->connectPort(id_POUTY1, f_p1_net); |
| 800 |
b_mult.lower->connectPort(id_PINY1, f_p1_net); |
| 801 |
|
| 802 |
auto *f_p2_net = ctx->createNet( |
| 803 |
ctx->idf("%s$%s$f%d_p2", lines_name.c_str(ctx), lower_net_name.c_str(ctx), 2 * b + 1)); |
| 804 |
b_f_route.cplines->connectPort(id_POUTY2, f_p2_net); |
| 805 |
b_mult.lower->connectPort(id_PINY2, f_p2_net); |
| 806 |
|
| 807 |
auto *f_c1_net = ctx->createNet( |
| 808 |
ctx->idf("%s$%s$f%d_c1", lines_name.c_str(ctx), upper_net_name.c_str(ctx), 2 * b)); |
| 809 |
b_f_route.cplines->connectPort(id_COUTY1, f_c1_net); |
| 810 |
b_mult.lower->connectPort(id_CINY1, f_c1_net); |
| 811 |
|
| 812 |
auto *f_c2_net = ctx->createNet( |
| 813 |
ctx->idf("%s$%s$f%d_c2", lines_name.c_str(ctx), upper_net_name.c_str(ctx), 2 * b + 1)); |
| 814 |
b_f_route.cplines->connectPort(id_COUTY2, f_c2_net); |
| 815 |
b_mult.lower->connectPort(id_CINY2, f_c2_net); |
| 816 |
} |
| 817 |
|
| 818 |
// FRoute (COUTX) -> MULTFab (CINX) |
| 819 |
if (b + 1 < m.cols.size()) { |
| 820 |
auto &b_multfab_right = m.cols.at(b + 1).multfab; |
| 821 |
|
| 822 |
auto lines_name = b_f_route.cplines->name; |
| 823 |
|
| 824 |
auto *cco_net = ctx->createNet(ctx->idf("%s$cco", lines_name.c_str(ctx))); |
| 825 |
b_f_route.cplines->connectPort(id_COUTX, cco_net); |
| 826 |
b_multfab_right.cplines->connectPort(id_CINX, cco_net); |
| 827 |
b_multfab_right.upper->connectPort(id_CINX, cco_net); |
| 828 |
} |
| 829 |
|
| 830 |
// C_MULT (POUTY1, POUTY2, COUTY1, COUTY2) -> C_MULT (PINY1, PINY2, CINY1, CINY2) |
| 831 |
for (size_t row = 0; row < m.cols.at(b).mults.size() - 1; row++) { |
| 832 |
auto &b_mult = m.cols.at(b).mults.at(row); |
| 833 |
auto &b_mult_up = m.cols.at(b).mults.at(row + 1); |
| 834 |
|
| 835 |
auto lines_name = b_mult.lower->name; |
| 836 |
|
| 837 |
auto *lower_b_net = |
| 838 |
ctx->createNet(ctx->idf("%s$%s$b%d", lines_name.c_str(ctx), lower_net_name.c_str(ctx), 2 * b)); |
| 839 |
b_mult.lower->connectPort(id_POUTY1, lower_b_net); |
| 840 |
b_mult_up.lower->connectPort(id_PINY1, lower_b_net); |
| 841 |
|
| 842 |
auto *upper_b_net = ctx->createNet( |
| 843 |
ctx->idf("%s$%s$b%d", lines_name.c_str(ctx), upper_net_name.c_str(ctx), 2 * b + 1)); |
| 844 |
b_mult.lower->connectPort(id_POUTY2, upper_b_net); |
| 845 |
b_mult_up.lower->connectPort(id_PINY2, upper_b_net); |
| 846 |
|
| 847 |
auto *lower_co_net = |
| 848 |
ctx->createNet(ctx->idf("%s$%s$co%d", lines_name.c_str(ctx), upper_net_name.c_str(ctx), 2 * b)); |
| 849 |
b_mult.lower->connectPort(id_COUTY1, lower_co_net); |
| 850 |
b_mult_up.lower->connectPort(id_CINY1, lower_co_net); |
| 851 |
|
| 852 |
auto *upper_co_net = ctx->createNet( |
| 853 |
ctx->idf("%s$%s$co%d", lines_name.c_str(ctx), upper_net_name.c_str(ctx), 2 * b + 1)); |
| 854 |
b_mult.lower->connectPort(id_COUTY2, upper_co_net); |
| 855 |
b_mult_up.lower->connectPort(id_CINY2, upper_co_net); |
| 856 |
} |
| 857 |
|
| 858 |
// C_MULT (POUTX, COUTX) -> C_MULT (PINX, CINX) |
| 859 |
if (b + 1 < m.cols.size()) { |
| 860 |
for (size_t row = 1; row < m.cols.at(b).mults.size(); row++) { |
| 861 |
auto &b_mult = m.cols.at(b).mults.at(row); |
| 862 |
auto &b_mult_right = m.cols.at(b + 1).mults.at(row - 1); |
| 863 |
|
| 864 |
auto lines_name = b_mult.lower->name; |
| 865 |
|
| 866 |
auto *so1_net = ctx->createNet(ctx->idf("%s$so1", lines_name.c_str(ctx))); |
| 867 |
b_mult.lower->connectPort(id_POUTX, so1_net); |
| 868 |
b_mult_right.lower->connectPort(id_PINX, so1_net); |
| 869 |
|
| 870 |
auto *so2_net = ctx->createNet(ctx->idf("%s$so2", lines_name.c_str(ctx))); |
| 871 |
b_mult.lower->connectPort(id_COUTX, so2_net); |
| 872 |
b_mult_right.lower->connectPort(id_CINX, so2_net); |
| 873 |
} |
| 874 |
} |
| 875 |
|
| 876 |
// C_MULT (POUTY1, POUTY2) -> MsbRouting (PINY1, PINY2) |
| 877 |
{ |
| 878 |
auto &b_mult = m.cols.at(b).mults.back(); |
| 879 |
|
| 880 |
auto lines_name = b_mult.lower->name; |
| 881 |
|
| 882 |
auto *lower_net = |
| 883 |
ctx->createNet(ctx->idf("%s$%s$b%d", lines_name.c_str(ctx), lower_net_name.c_str(ctx), 2 * b)); |
| 884 |
b_mult.lower->connectPort(id_POUTY1, lower_net); |
| 885 |
b_msb_route.cplines->connectPort(id_PINY1, lower_net); |
| 886 |
b_msb_route.upper->connectPort(id_PINY1, lower_net); |
| 887 |
|
| 888 |
auto *upper_net = ctx->createNet( |
| 889 |
ctx->idf("%s$%s$b%d", lines_name.c_str(ctx), lower_net_name.c_str(ctx), 2 * b + 1)); |
| 890 |
b_mult.lower->connectPort(id_POUTY2, upper_net); |
| 891 |
b_msb_route.cplines->connectPort(id_PINY2, upper_net); |
| 892 |
} |
| 893 |
|
| 894 |
// MsbRouting (POUTX, COUTX) -> C_MULT (PINX, CINX) |
| 895 |
if (b + 1 < m.cols.size()) { |
| 896 |
auto &b_mult_right = m.cols.at(b + 1).mults.back(); |
| 897 |
|
| 898 |
auto lines_name = b_msb_route.cplines->name; |
| 899 |
|
| 900 |
auto *so1_net = ctx->createNet(ctx->idf("%s$so1", lines_name.c_str(ctx))); |
| 901 |
b_msb_route.cplines->connectPort(id_POUTX, so1_net); |
| 902 |
b_mult_right.lower->connectPort(id_PINX, so1_net); |
| 903 |
|
| 904 |
auto *so2_net = ctx->createNet(ctx->idf("%s$so2", lines_name.c_str(ctx))); |
| 905 |
b_msb_route.cplines->connectPort(id_COUTX, so2_net); |
| 906 |
b_mult_right.lower->connectPort(id_CINX, so2_net); |
| 907 |
} |
| 908 |
} |
| 909 |
|
| 910 |
// P output. |
| 911 |
auto diagonal_p_width = std::min(b_width, p_width); |
| 912 |
auto vertical_p_width = std::max(p_width - b_width, 0); |
| 913 |
|
| 914 |
// Do all the P output registers have the same control set? |
| 915 |
bool should_pack_register = [&]() { |
| 916 |
// We're using how P[0] is used as a rough heuristic for the other bits of P. |
| 917 |
auto *p_zero_net = mult->getPort(ctx->idf("P[0]")); |
| 918 |
|
| 919 |
// P[0] disconnected(???) -> don't pack |
| 920 |
if (!p_zero_net) |
| 921 |
return false; |
| 922 |
|
| 923 |
// P[0] used by multiple signals -> don't pack (likely used in a combinational context) |
| 924 |
if (p_zero_net->users.entries() != 1) |
| 925 |
return false; |
| 926 |
|
| 927 |
auto *p_zero_sink = (*p_zero_net->users.begin()).cell; |
| 928 |
NPNR_ASSERT(p_zero_sink != nullptr); |
| 929 |
|
| 930 |
if (p_zero_sink->type != id_CC_DFF) |
| 931 |
// TODO: attempt to pack L2T4 + DFF combos. |
| 932 |
return false; |
| 933 |
|
| 934 |
for (int p = 1; p < p_width; p++) { |
| 935 |
auto *p_net = mult->getPort(ctx->idf("P[%d]", p)); |
| 936 |
if (p_net && p_net->users.entries() == 1) { |
| 937 |
auto *p_net_sink = (*p_net->users.begin()).cell; |
| 938 |
NPNR_ASSERT(p_net_sink != nullptr); |
| 939 |
if (p_net_sink->type == id_CC_DFF) { |
| 940 |
bool incompatible = false; |
| 941 |
if (p_zero_sink->getPort(id_CLK) != p_net_sink->getPort(id_CLK)) { |
| 942 |
const char *p_zero_clk = "(none)"; |
| 943 |
const char *p_net_clk = "(none)"; |
| 944 |
if (p_zero_sink->getPort(id_CLK) != nullptr) |
| 945 |
p_zero_clk = p_zero_sink->getPort(id_CLK)->name.c_str(ctx); |
| 946 |
if (p_net_sink->getPort(id_CLK) != nullptr) |
| 947 |
p_net_clk = p_net_sink->getPort(id_CLK)->name.c_str(ctx); |
| 948 |
log_info(" registers have inconsistent clocks: %s vs %s\n", p_zero_clk, p_net_clk); |
| 949 |
incompatible = true; |
| 950 |
} |
| 951 |
if (p_zero_sink->getPort(id_EN) != p_net_sink->getPort(id_EN)) { |
| 952 |
const char *p_zero_en = "(none)"; |
| 953 |
const char *p_net_en = "(none)"; |
| 954 |
if (p_zero_sink->getPort(id_EN) != nullptr) |
| 955 |
p_zero_en = p_zero_sink->getPort(id_EN)->name.c_str(ctx); |
| 956 |
if (p_net_sink->getPort(id_EN) != nullptr) |
| 957 |
p_net_en = p_net_sink->getPort(id_EN)->name.c_str(ctx); |
| 958 |
log_info(" registers have inconsistent enables: %s vs %s\n", p_zero_en, p_net_en); |
| 959 |
incompatible = true; |
| 960 |
} |
| 961 |
if (p_zero_sink->getPort(id_SR) != p_net_sink->getPort(id_SR)) { |
| 962 |
const char *p_zero_sr = "(none)"; |
| 963 |
const char *p_net_sr = "(none)"; |
| 964 |
if (p_zero_sink->getPort(id_SR) != nullptr) |
| 965 |
p_zero_sr = p_zero_sink->getPort(id_SR)->name.c_str(ctx); |
| 966 |
if (p_net_sink->getPort(id_SR) != nullptr) |
| 967 |
p_net_sr = p_net_sink->getPort(id_EN)->name.c_str(ctx); |
| 968 |
log_info(" registers have inconsistent resets: %s vs %s\n", p_zero_sr, p_net_sr); |
| 969 |
incompatible = true; |
| 970 |
} |
| 971 |
if (uarch->get_dff_config(p_zero_sink) != uarch->get_dff_config(p_net_sink)) |
| 972 |
log_info(" registers have different configurations\n"); |
| 973 |
if (incompatible) { |
| 974 |
log_info(" ...not packing output register\n"); |
| 975 |
return false; |
| 976 |
} |
| 977 |
} |
| 978 |
} |
| 979 |
} |
| 980 |
|
| 981 |
return true; |
| 982 |
}(); |
| 983 |
|
| 984 |
auto create_p_register = [&](CellInfo *cpe_half, CellInfo *sink, int x_offset, int y_offset, bool upper, |
| 985 |
int p) { |
| 986 |
// Instantiate a P passthrough L2T4 for the flop. |
| 987 |
auto *p_passthru = |
| 988 |
create_cell_ptr(id_CPE_L2T4, ctx->idf("%s$p[%d]_passthru", cpe_half->name.c_str(ctx), p)); |
| 989 |
|
| 990 |
p_passthru->params[id_INIT_L00] = Property(LUT_D0, 4); |
| 991 |
p_passthru->params[id_INIT_L01] = Property(LUT_ZERO, 4); |
| 992 |
p_passthru->params[id_INIT_L10] = Property(LUT_D0, 4); |
| 993 |
|
| 994 |
// Reconfigure the flop. |
| 995 |
sink->renamePort(id_D, id_DIN); |
| 996 |
sink->renamePort(id_Q, id_DOUT); |
| 997 |
sink->type = id_CPE_FF; |
| 998 |
|
| 999 |
// Connect the passthrough. |
| 1000 |
sink->movePortTo(id_DIN, p_passthru, id_IN1); |
| 1001 |
|
| 1002 |
auto *p_passthru_net = ctx->createNet(ctx->idf("%s$p", p_passthru->name.c_str(ctx))); |
| 1003 |
p_passthru->connectPort(id_OUT, p_passthru_net); |
| 1004 |
sink->connectPort(id_DIN, p_passthru_net); |
| 1005 |
|
| 1006 |
// Constrain the passthrough and flop. |
| 1007 |
constrain_cell(p_passthru, x_offset, y_offset, upper ? CPE_LT_U_Z : CPE_LT_L_Z); |
| 1008 |
|
| 1009 |
constrain_cell(sink, x_offset, y_offset, upper ? CPE_FF_U_Z : CPE_FF_L_Z); |
| 1010 |
|
| 1011 |
log_info(" Constrained '%s' as register for P[%d] at (%d, %d).\n", sink->name.c_str(ctx), p, |
| 1012 |
x_offset, y_offset); |
| 1013 |
}; |
| 1014 |
|
| 1015 |
for (int p = 0; p < diagonal_p_width; p++) { |
| 1016 |
auto &mult_cell = m.cols[p / 2].mults[0]; |
| 1017 |
auto *cpe_half = (p % 2 == 1) ? mult_cell.upper : mult_cell.lower; |
| 1018 |
|
| 1019 |
mult->movePortTo(ctx->idf("P[%d]", p), cpe_half, id_CPOUT); |
| 1020 |
|
| 1021 |
auto *cpe_half_cpout = cpe_half->getPort(id_CPOUT); |
| 1022 |
if (cpe_half_cpout && cpe_half_cpout->users.entries() == 1) { |
| 1023 |
auto cpe_half_cpout_user = *cpe_half_cpout->users.begin(); |
| 1024 |
auto *sink = cpe_half_cpout_user.cell; |
| 1025 |
NPNR_ASSERT(sink != nullptr); |
| 1026 |
if (sink->type == id_CC_DFF && should_pack_register) { |
| 1027 |
create_p_register(cpe_half, sink, b_width / 2, b_width / 2 + p / 2, p % 2 == 1, p); |
| 1028 |
} |
| 1029 |
} |
| 1030 |
} |
| 1031 |
|
| 1032 |
for (int p = 0; p < vertical_p_width; p++) { |
| 1033 |
auto &mult_cell = m.cols.back().mults[1 + (p / 2)]; |
| 1034 |
auto *cpe_half = (p % 2 == 1) ? mult_cell.upper : mult_cell.lower; |
| 1035 |
|
| 1036 |
mult->movePortTo(ctx->idf("P[%d]", p + diagonal_p_width), cpe_half, id_CPOUT); |
| 1037 |
|
| 1038 |
auto *cpe_half_cpout = cpe_half->getPort(id_CPOUT); |
| 1039 |
if (cpe_half_cpout && cpe_half_cpout->users.entries() == 1) { |
| 1040 |
auto cpe_half_cpout_user = *cpe_half_cpout->users.begin(); |
| 1041 |
auto *sink = cpe_half_cpout_user.cell; |
| 1042 |
NPNR_ASSERT(sink != nullptr); |
| 1043 |
if (sink->type == id_CC_DFF && should_pack_register) { |
| 1044 |
create_p_register(cpe_half, sink, b_width / 2, b_width / 2 + diagonal_p_width / 2 + p / 2, |
| 1045 |
p % 2 == 1, p + diagonal_p_width); |
| 1046 |
} |
| 1047 |
} |
| 1048 |
} |
| 1049 |
|
| 1050 |
// Clean up the multiplier. |
| 1051 |
for (size_t b = 0; b < m.cols.size(); b++) { |
| 1052 |
auto &b_passthru = m.cols.at(b).b_passthru; |
| 1053 |
|
| 1054 |
// This may be GND/VCC. |
| 1055 |
b_passthru.clean_up_cell(ctx, b_passthru.lower); |
| 1056 |
b_passthru.clean_up_cell(ctx, b_passthru.upper); |
| 1057 |
} |
| 1058 |
|
| 1059 |
ctx->cells.erase(mult->name); |
| 1060 |
|
| 1061 |
log_info(" Created %zu CPEs.\n", m.cpe_count()); |
| 1062 |
} |
| 1063 |
} |
| 1064 |
|
| 1065 |
NEXTPNR_NAMESPACE_END |