aboutsummaryrefslogtreecommitdiffstats
path: root/fpga_interchange
diff options
context:
space:
mode:
Diffstat (limited to 'fpga_interchange')
-rw-r--r--fpga_interchange/arch.h11
-rw-r--r--fpga_interchange/site_router.cc12
2 files changed, 14 insertions, 9 deletions
diff --git a/fpga_interchange/arch.h b/fpga_interchange/arch.h
index ece8be7f..2162ce90 100644
--- a/fpga_interchange/arch.h
+++ b/fpga_interchange/arch.h
@@ -217,10 +217,15 @@ struct Arch : ArchAPI<ArchRanges>
PhysicalNetlist::PhysNetlist::NetType get_net_type(NetInfo *net) const
{
- NPNR_ASSERT(net->driver.cell != nullptr);
- if (net->driver.cell->bel == get_gnd_bel()) {
+ NPNR_ASSERT(net != nullptr);
+ IdString gnd_cell_name(chip_info->constants->gnd_cell_name);
+ IdString gnd_cell_port(chip_info->constants->gnd_cell_port);
+
+ IdString vcc_cell_name(chip_info->constants->vcc_cell_name);
+ IdString vcc_cell_port(chip_info->constants->vcc_cell_port);
+ if (net->driver.cell->type == gnd_cell_name && net->driver.port == gnd_cell_port) {
return PhysicalNetlist::PhysNetlist::NetType::GND;
- } else if (net->driver.cell->bel == get_vcc_bel()) {
+ } else if (net->driver.cell->type == vcc_cell_name && net->driver.port == vcc_cell_port) {
return PhysicalNetlist::PhysNetlist::NetType::VCC;
} else {
return PhysicalNetlist::PhysNetlist::NetType::SIGNAL;
diff --git a/fpga_interchange/site_router.cc b/fpga_interchange/site_router.cc
index 630db37f..12707f37 100644
--- a/fpga_interchange/site_router.cc
+++ b/fpga_interchange/site_router.cc
@@ -98,15 +98,15 @@ bool check_initial_wires(const Context *ctx, SiteInformation *site_info)
static bool is_invalid_site_port(const SiteArch *ctx, const SiteNetInfo *net, const SitePip &pip)
{
SyntheticType type = ctx->pip_synthetic_type(pip);
+ PhysicalNetlist::PhysNetlist::NetType net_type = ctx->ctx->get_net_type(net->net);
+ bool is_invalid = false;
if (type == SYNTH_GND) {
- IdString gnd_net_name(ctx->ctx->chip_info->constants->gnd_net_name);
- return net->net->name != gnd_net_name;
+ is_invalid = net_type != PhysicalNetlist::PhysNetlist::NetType::GND;
} else if (type == SYNTH_VCC) {
- IdString vcc_net_name(ctx->ctx->chip_info->constants->vcc_net_name);
- return net->net->name != vcc_net_name;
- } else {
- return false;
+ is_invalid = net_type != PhysicalNetlist::PhysNetlist::NetType::VCC;
}
+
+ return is_invalid;
}
struct SiteExpansionLoop