diff options
Diffstat (limited to 'common')
-rw-r--r-- | common/design_utils.cc | 4 | ||||
-rw-r--r-- | common/nextpnr.cc | 28 | ||||
-rw-r--r-- | common/route.cc | 12 | ||||
-rw-r--r-- | common/rulecheck.cc | 14 |
4 files changed, 29 insertions, 29 deletions
diff --git a/common/design_utils.cc b/common/design_utils.cc index 58257bb7..6876babe 100644 --- a/common/design_utils.cc +++ b/common/design_utils.cc @@ -28,7 +28,7 @@ void replace_port(CellInfo *old_cell, IdString old_name, CellInfo *rep_cell, IdS { PortInfo &old = old_cell->ports.at(old_name); PortInfo &rep = rep_cell->ports.at(rep_name); - assert(old.type == rep.type); + NPNR_ASSERT(old.type == rep.type); rep.net = old.net; old.net = nullptr; @@ -47,7 +47,7 @@ void replace_port(CellInfo *old_cell, IdString old_name, CellInfo *rep_cell, IdS } } } else { - assert(false); + NPNR_ASSERT(false); } } diff --git a/common/nextpnr.cc b/common/nextpnr.cc index 40eb2536..a197eaff 100644 --- a/common/nextpnr.cc +++ b/common/nextpnr.cc @@ -47,8 +47,8 @@ const char *IdString::c_str(const BaseCtx *ctx) const { return str(ctx).c_str(); void IdString::initialize_add(const BaseCtx *ctx, const char *s, int idx) { - assert(ctx->idstring_str_to_idx->count(s) == 0); - assert(int(ctx->idstring_idx_to_str->size()) == idx); + NPNR_ASSERT(ctx->idstring_str_to_idx->count(s) == 0); + NPNR_ASSERT(int(ctx->idstring_idx_to_str->size()) == idx); auto insert_rc = ctx->idstring_str_to_idx->insert({s, idx}); ctx->idstring_idx_to_str->push_back(&insert_rc.first->first); } @@ -170,12 +170,12 @@ void Context::check() const { for (auto &n : nets) { auto ni = n.second.get(); - assert(n.first == ni->name); + NPNR_ASSERT(n.first == ni->name); for (auto &w : ni->wires) { - assert(n.first == getBoundWireNet(w.first)); + NPNR_ASSERT(n.first == getBoundWireNet(w.first)); if (w.second.pip != PipId()) { - assert(w.first == getPipDstWire(w.second.pip)); - assert(n.first == getBoundPipNet(w.second.pip)); + NPNR_ASSERT(w.first == getPipDstWire(w.second.pip)); + NPNR_ASSERT(n.first == getBoundPipNet(w.second.pip)); } } } @@ -183,24 +183,24 @@ void Context::check() const for (auto w : getWires()) { IdString net = getBoundWireNet(w); if (net != IdString()) { - assert(nets.at(net)->wires.count(w)); + NPNR_ASSERT(nets.at(net)->wires.count(w)); } } for (auto &c : cells) { - assert(c.first == c.second->name); + NPNR_ASSERT(c.first == c.second->name); if (c.second->bel != BelId()) - assert(getBoundBelCell(c.second->bel) == c.first); + NPNR_ASSERT(getBoundBelCell(c.second->bel) == c.first); for (auto &port : c.second->ports) { NetInfo *net = port.second.net; if (net != nullptr) { - assert(nets.find(net->name) != nets.end()); + NPNR_ASSERT(nets.find(net->name) != nets.end()); if (port.second.type == PORT_OUT) { - assert(net->driver.cell == c.second.get() && net->driver.port == port.first); + NPNR_ASSERT(net->driver.cell == c.second.get() && net->driver.port == port.first); } else if (port.second.type == PORT_IN) { - assert(std::count_if(net->users.begin(), net->users.end(), [&](const PortRef &pr) { - return pr.cell == c.second.get() && pr.port == port.first; - }) == 1); + NPNR_ASSERT(std::count_if(net->users.begin(), net->users.end(), [&](const PortRef &pr) { + return pr.cell == c.second.get() && pr.port == port.first; + }) == 1); } } } diff --git a/common/route.cc b/common/route.cc index 60965f84..82525fcc 100644 --- a/common/route.cc +++ b/common/route.cc @@ -95,7 +95,7 @@ void ripup_net(Context *ctx, IdString net_name) for (auto wire : wires) ctx->unbindWire(wire); - assert(net_info->wires.empty()); + NPNR_ASSERT(net_info->wires.empty()); } struct Router @@ -187,7 +187,7 @@ struct Router if (foundRipupNet) next_delay += ripup_penalty; - assert(next_delay >= 0); + NPNR_ASSERT(next_delay >= 0); if (visited.count(next_wire)) { if (visited.at(next_wire).delay <= next_delay + ctx->getDelayEpsilon()) @@ -358,8 +358,8 @@ struct Router IdString conflicting_wire_net = ctx->getConflictingWireNet(cursor); if (conflicting_wire_net != IdString()) { - assert(ripup); - assert(conflicting_wire_net != net_name); + NPNR_ASSERT(ripup); + NPNR_ASSERT(conflicting_wire_net != net_name); ctx->unbindWire(cursor); if (!ctx->checkWireAvail(cursor)) @@ -375,8 +375,8 @@ struct Router IdString conflicting_pip_net = ctx->getConflictingPipNet(pip); if (conflicting_pip_net != IdString()) { - assert(ripup); - assert(conflicting_pip_net != net_name); + NPNR_ASSERT(ripup); + NPNR_ASSERT(conflicting_pip_net != net_name); ctx->unbindPip(pip); if (!ctx->checkPipAvail(pip)) diff --git a/common/rulecheck.cc b/common/rulecheck.cc index 2570dd65..c696e548 100644 --- a/common/rulecheck.cc +++ b/common/rulecheck.cc @@ -23,18 +23,18 @@ bool check_all_nets_driven(Context *ctx) log_info(" Checking name of port \'%s\' " "against \'%s\'\n", port_entry.first.c_str(ctx), port.name.c_str(ctx)); - assert(port.name == port_entry.first); - assert(!port.name.empty()); + NPNR_ASSERT(port.name == port_entry.first); + NPNR_ASSERT(!port.name.empty()); if (port.net == NULL) { if (debug) log_warning(" Port \'%s\' in cell \'%s\' is unconnected\n", port.name.c_str(ctx), cell->name.c_str(ctx)); } else { - assert(port.net); + NPNR_ASSERT(port.net); if (debug) log_info(" Checking for a net named \'%s\'\n", port.net->name.c_str(ctx)); - assert(ctx->nets.count(port.net->name) > 0); + NPNR_ASSERT(ctx->nets.count(port.net->name) > 0); } } } @@ -42,13 +42,13 @@ bool check_all_nets_driven(Context *ctx) for (auto &net_entry : ctx->nets) { NetInfo *net = net_entry.second.get(); - assert(net->name == net_entry.first); + NPNR_ASSERT(net->name == net_entry.first); if ((net->driver.cell != NULL) && (net->driver.cell->type != ctx->id("GND")) && (net->driver.cell->type != ctx->id("VCC"))) { if (debug) log_info(" Checking for a driver cell named \'%s\'\n", net->driver.cell->name.c_str(ctx)); - assert(ctx->cells.count(net->driver.cell->name) > 0); + NPNR_ASSERT(ctx->cells.count(net->driver.cell->name) > 0); } for (auto user : net->users) { @@ -56,7 +56,7 @@ bool check_all_nets_driven(Context *ctx) if (debug) log_info(" Checking for a user cell named \'%s\'\n", user.cell->name.c_str(ctx)); - assert(ctx->cells.count(user.cell->name) > 0); + NPNR_ASSERT(ctx->cells.count(user.cell->name) > 0); } } } |