aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYRabbit <rabbit@yrabbit.cyou>2022-12-09 12:55:22 +1000
committerYRabbit <rabbit@yrabbit.cyou>2022-12-09 12:55:22 +1000
commitaa8359c73e47ca3fed620dbab9ef7ce8d4a6732c (patch)
treeaeb5acbc8879a34f72486fc62bb4777c644e0555
parent0eb53d59d84ea1c46de7d9e25eb5a9901544202d (diff)
downloadnextpnr-aa8359c73e47ca3fed620dbab9ef7ce8d4a6732c.tar.gz
nextpnr-aa8359c73e47ca3fed620dbab9ef7ce8d4a6732c.tar.bz2
nextpnr-aa8359c73e47ca3fed620dbab9ef7ce8d4a6732c.zip
gowin: BUGFIX: Correctly handle resets
When a single primitive occupies several cells, care must be taken when manipulating the parameters of that primitive: when creating cells, each cell must receive a copy of all the parameters and not modify them unnecessarily. That is, if possible, it is better to make all parameter changes before dividing the primitive into cells. Signed-off-by: YRabbit <rabbit@yrabbit.cyou>
-rw-r--r--gowin/arch.cc13
-rw-r--r--gowin/pack.cc14
2 files changed, 14 insertions, 13 deletions
diff --git a/gowin/arch.cc b/gowin/arch.cc
index 04cf7af5..461b64c8 100644
--- a/gowin/arch.cc
+++ b/gowin/arch.cc
@@ -2051,19 +2051,6 @@ void Arch::fix_pll_nets(Context *ctx)
// This is general routing through CLK2 pip
ci->setParam(id_FBSEL, Property("CLKFB0"));
} while (0);
-
- // resets
- Property pr_enable("ENABLE"), pr_disable("DISABLE");
- NetInfo *net = ci->getPort(id_RESET);
- ci->setParam(id_RSTEN, pr_enable);
- if (!port_used(ci, id_RESET) || net->name == id("$PACKER_VCC_NET") || net->name == id("$PACKER_GND_NET")) {
- ci->setParam(id_RSTEN, pr_disable);
- }
- ci->setParam(id_PWDEN, pr_enable);
- net = ci->getPort(id_RESET_P);
- if (!port_used(ci, id_RESET_P) || net->name == id("$PACKER_VCC_NET") || net->name == id("$PACKER_GND_NET")) {
- ci->setParam(id_PWDEN, pr_disable);
- }
}
}
diff --git a/gowin/pack.cc b/gowin/pack.cc
index c36a4757..e1119dde 100644
--- a/gowin/pack.cc
+++ b/gowin/pack.cc
@@ -1026,6 +1026,20 @@ static void pack_plls(Context *ctx)
for (int i = 0; i < 4; ++i) {
ci->setParam(ports[i][1], port_used(ci, ports[i][0]) ? pr_enable : pr_disable);
}
+ // resets
+ NetInfo *net = ci->getPort(id_RESET);
+ ci->setParam(id_RSTEN, pr_enable);
+ if (!port_used(ci, id_RESET) || net->name == ctx->id("$PACKER_VCC_NET") ||
+ net->name == ctx->id("$PACKER_GND_NET")) {
+ ci->setParam(id_RSTEN, pr_disable);
+ }
+ ci->setParam(id_PWDEN, pr_enable);
+ net = ci->getPort(id_RESET_P);
+ if (!port_used(ci, id_RESET_P) || net->name == ctx->id("$PACKER_VCC_NET") ||
+ net->name == ctx->id("$PACKER_GND_NET")) {
+ ci->setParam(id_PWDEN, pr_disable);
+ }
+
// B half
std::unique_ptr<CellInfo> cell = create_generic_cell(ctx, id_RPLLB, ci->name.str(ctx) + "$rpllb");
reconnect_rpllb(ctx, ci, cell.get());