aboutsummaryrefslogtreecommitdiffstats
path: root/fpga_interchange/arch.h
diff options
context:
space:
mode:
authorKeith Rothman <537074+litghost@users.noreply.github.com>2021-03-23 10:57:37 -0700
committerKeith Rothman <537074+litghost@users.noreply.github.com>2021-03-25 17:14:53 -0700
commit5e96740451912cbd68aecdbe58d776831d282cba (patch)
treee8621f21f5b5eec074403c2c9e38261f4a07e79b /fpga_interchange/arch.h
parent22fb2c1548d8451e2247a160e71ca1667022204a (diff)
downloadnextpnr-5e96740451912cbd68aecdbe58d776831d282cba.tar.gz
nextpnr-5e96740451912cbd68aecdbe58d776831d282cba.tar.bz2
nextpnr-5e96740451912cbd68aecdbe58d776831d282cba.zip
[FPGA interchange] Small fix to get_net_type.
If get_net_type was called before the driver was placed, it could return the wrong value. Signed-off-by: Keith Rothman <537074+litghost@users.noreply.github.com>
Diffstat (limited to 'fpga_interchange/arch.h')
-rw-r--r--fpga_interchange/arch.h11
1 files changed, 8 insertions, 3 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;