clangformat

Signed-off-by: gatecat <gatecat@ds0.me>
This commit is contained in:
gatecat 2021-04-30 18:38:30 +01:00
parent 3dd8986322
commit 4bdf4582f0

View File

@ -1580,10 +1580,8 @@ class Ecp5Packer
for (auto port : {id_MA0, id_MB0}) { for (auto port : {id_MA0, id_MB0}) {
CellInfo *mult = net_driven_by( CellInfo *mult = net_driven_by(
ctx, ci->ports.at(port).net, ctx, ci->ports.at(port).net,
[](const Context *ctx, const CellInfo *cell) { [](const Context *ctx, const CellInfo *cell) { return cell->type == id_MULT18X18D; },
return cell->type == id_MULT18X18D; id_P0);
}, id_P0
);
// We'll handle the mult not existing in check_alu below. // We'll handle the mult not existing in check_alu below.
if (mult == nullptr) if (mult == nullptr)
@ -1600,8 +1598,8 @@ class Ecp5Packer
mult->constr_y = 0; mult->constr_y = 0;
mult->constr_parent = ci; mult->constr_parent = ci;
ci->constr_children.push_back(mult); ci->constr_children.push_back(mult);
log_info("DSP: Constraining MULT18X18D '%s' to ALU54B '%s' port %s\n", log_info("DSP: Constraining MULT18X18D '%s' to ALU54B '%s' port %s\n", mult->name.c_str(ctx),
mult->name.c_str(ctx), cell.first.c_str(ctx), ctx->nameOf(port)); cell.first.c_str(ctx), ctx->nameOf(port));
} }
// Check existance of, and connectivity to, each MULT. // Check existance of, and connectivity to, each MULT.
@ -1615,11 +1613,9 @@ class Ecp5Packer
{ {
// MULT18X18Ds must be detected on both inputs. // MULT18X18Ds must be detected on both inputs.
if (mult_a == nullptr) { if (mult_a == nullptr) {
log_error("No MULT18X18D found connected to ALU54B '%s' port A\n", log_error("No MULT18X18D found connected to ALU54B '%s' port A\n", alu->name.c_str(ctx));
alu->name.c_str(ctx));
} else if (mult_b == nullptr) { } else if (mult_b == nullptr) {
log_error("No MULT18X18D found connected to ALU54B '%s' port B\n", log_error("No MULT18X18D found connected to ALU54B '%s' port B\n", alu->name.c_str(ctx));
alu->name.c_str(ctx));
} }
// Placement doesn't work if only one or the other of // Placement doesn't work if only one or the other of
@ -1642,8 +1638,7 @@ class Ecp5Packer
// MULT_BYPASS is also enabled. // MULT_BYPASS is also enabled.
for (auto mult : {mult_a, mult_b}) { for (auto mult : {mult_a, mult_b}) {
if (str_or_default(mult->params, ctx->id("REG_OUTPUT_CLK"), "NONE") != "NONE" && if (str_or_default(mult->params, ctx->id("REG_OUTPUT_CLK"), "NONE") != "NONE" &&
str_or_default(mult->params, ctx->id("MULT_BYPASS"), "DISABLED") != "ENABLED") str_or_default(mult->params, ctx->id("MULT_BYPASS"), "DISABLED") != "ENABLED") {
{
log_error("MULT18X18D '%s' REG_OUTPUT_CLK must be NONE when driving ALU without MULT_BYPASS\n", log_error("MULT18X18D '%s' REG_OUTPUT_CLK must be NONE when driving ALU without MULT_BYPASS\n",
mult->name.c_str(ctx)); mult->name.c_str(ctx));
} }
@ -1675,17 +1670,15 @@ class Ecp5Packer
IdString alu_port = ctx->id(std::string("A") + std::to_string(i)); IdString alu_port = ctx->id(std::string("A") + std::to_string(i));
net = alu->ports.at(alu_port).net; net = alu->ports.at(alu_port).net;
if (net == nullptr || net->driver.cell != mult_a || net->driver.port != mult_port) { if (net == nullptr || net->driver.cell != mult_a || net->driver.port != mult_port) {
log_error("ALU54B '%s' input %s must be driven by %s of MULT18X18D '%s'\n", log_error("ALU54B '%s' input %s must be driven by %s of MULT18X18D '%s'\n", alu->name.c_str(ctx),
alu->name.c_str(ctx), alu_port.c_str(ctx), mult_port.c_str(ctx), alu_port.c_str(ctx), mult_port.c_str(ctx), mult_a->name.c_str(ctx));
mult_a->name.c_str(ctx));
} }
alu_port = ctx->id(std::string("B") + std::to_string(i)); alu_port = ctx->id(std::string("B") + std::to_string(i));
net = alu->ports.at(alu_port).net; net = alu->ports.at(alu_port).net;
if (net == nullptr || net->driver.cell != mult_b || net->driver.port != mult_port) { if (net == nullptr || net->driver.cell != mult_b || net->driver.port != mult_port) {
log_error("ALU54B '%s' input %s must be driven by %s of MULT18X18D '%s'\n", log_error("ALU54B '%s' input %s must be driven by %s of MULT18X18D '%s'\n", alu->name.c_str(ctx),
alu->name.c_str(ctx), alu_port.c_str(ctx), mult_port.c_str(ctx), alu_port.c_str(ctx), mult_port.c_str(ctx), mult_b->name.c_str(ctx));
mult_b->name.c_str(ctx));
} }
mult_port = ctx->id(std::string("P") + std::to_string(i)); mult_port = ctx->id(std::string("P") + std::to_string(i));
@ -1693,20 +1686,17 @@ class Ecp5Packer
alu_port = ctx->id(std::string("MA") + std::to_string(i)); alu_port = ctx->id(std::string("MA") + std::to_string(i));
net = alu->ports.at(alu_port).net; net = alu->ports.at(alu_port).net;
if (net == nullptr || net->driver.cell != mult_a || net->driver.port != mult_port) { if (net == nullptr || net->driver.cell != mult_a || net->driver.port != mult_port) {
log_error("ALU54B '%s' input %s must be driven by %s of MULT18X18D '%s'\n", log_error("ALU54B '%s' input %s must be driven by %s of MULT18X18D '%s'\n", alu->name.c_str(ctx),
alu->name.c_str(ctx), alu_port.c_str(ctx), mult_port.c_str(ctx), alu_port.c_str(ctx), mult_port.c_str(ctx), mult_a->name.c_str(ctx));
mult_a->name.c_str(ctx));
} }
alu_port = ctx->id(std::string("MB") + std::to_string(i)); alu_port = ctx->id(std::string("MB") + std::to_string(i));
net = alu->ports.at(alu_port).net; net = alu->ports.at(alu_port).net;
if (net == nullptr || net->driver.cell != mult_b || net->driver.port != mult_port) { if (net == nullptr || net->driver.cell != mult_b || net->driver.port != mult_port) {
log_error("ALU54B '%s' input %s must be driven by %s of MULT18X18D '%s'\n", log_error("ALU54B '%s' input %s must be driven by %s of MULT18X18D '%s'\n", alu->name.c_str(ctx),
alu->name.c_str(ctx), alu_port.c_str(ctx), mult_port.c_str(ctx), alu_port.c_str(ctx), mult_port.c_str(ctx), mult_b->name.c_str(ctx));
mult_b->name.c_str(ctx));
} }
} }
} }
// "Pack" DCUs // "Pack" DCUs