[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>
This commit is contained in:
parent
22fb2c1548
commit
5e96740451
@ -217,10 +217,15 @@ struct Arch : ArchAPI<ArchRanges>
|
|||||||
|
|
||||||
PhysicalNetlist::PhysNetlist::NetType get_net_type(NetInfo *net) const
|
PhysicalNetlist::PhysNetlist::NetType get_net_type(NetInfo *net) const
|
||||||
{
|
{
|
||||||
NPNR_ASSERT(net->driver.cell != nullptr);
|
NPNR_ASSERT(net != nullptr);
|
||||||
if (net->driver.cell->bel == get_gnd_bel()) {
|
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;
|
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;
|
return PhysicalNetlist::PhysNetlist::NetType::VCC;
|
||||||
} else {
|
} else {
|
||||||
return PhysicalNetlist::PhysNetlist::NetType::SIGNAL;
|
return PhysicalNetlist::PhysNetlist::NetType::SIGNAL;
|
||||||
|
@ -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)
|
static bool is_invalid_site_port(const SiteArch *ctx, const SiteNetInfo *net, const SitePip &pip)
|
||||||
{
|
{
|
||||||
SyntheticType type = ctx->pip_synthetic_type(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) {
|
if (type == SYNTH_GND) {
|
||||||
IdString gnd_net_name(ctx->ctx->chip_info->constants->gnd_net_name);
|
is_invalid = net_type != PhysicalNetlist::PhysNetlist::NetType::GND;
|
||||||
return net->net->name != gnd_net_name;
|
|
||||||
} else if (type == SYNTH_VCC) {
|
} else if (type == SYNTH_VCC) {
|
||||||
IdString vcc_net_name(ctx->ctx->chip_info->constants->vcc_net_name);
|
is_invalid = net_type != PhysicalNetlist::PhysNetlist::NetType::VCC;
|
||||||
return net->net->name != vcc_net_name;
|
|
||||||
} else {
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return is_invalid;
|
||||||
}
|
}
|
||||||
|
|
||||||
struct SiteExpansionLoop
|
struct SiteExpansionLoop
|
||||||
|
Loading…
Reference in New Issue
Block a user