aboutsummaryrefslogtreecommitdiffstats
path: root/gowin
diff options
context:
space:
mode:
authorYRabbit <rabbit@yrabbit.cyou>2022-11-20 22:04:09 +1000
committerYRabbit <rabbit@yrabbit.cyou>2022-11-20 22:04:09 +1000
commit378ca60a2f29b7984c80f8ad9f665b5786fa524e (patch)
tree9f06998c3e355045370dabb8ddafcaeb19be9246 /gowin
parentc8406b71fe62860031a9be829a6e0378c6fcf1ee (diff)
downloadnextpnr-378ca60a2f29b7984c80f8ad9f665b5786fa524e.tar.gz
nextpnr-378ca60a2f29b7984c80f8ad9f665b5786fa524e.tar.bz2
nextpnr-378ca60a2f29b7984c80f8ad9f665b5786fa524e.zip
gowin: mark the PLL ports that are not in use
Unused ports are deactivated by special fuse combinations, rather than being left dangling in the air. Signed-off-by: YRabbit <rabbit@yrabbit.cyou>
Diffstat (limited to 'gowin')
-rw-r--r--gowin/constids.inc8
-rw-r--r--gowin/pack.cc8
2 files changed, 16 insertions, 0 deletions
diff --git a/gowin/constids.inc b/gowin/constids.inc
index 59f364e7..e0b37b49 100644
--- a/gowin/constids.inc
+++ b/gowin/constids.inc
@@ -931,6 +931,14 @@ X(CLKOUTD)
X(CLKOUTD3)
X(LOCK)
+// PLL parameters
+X(CLKOUTPS)
+X(CLKOUTDIV)
+X(CLKOUTDIV3)
+X(PWDEN)
+X(RSTEN)
+X(FLOCK)
+
// timing
X(X0)
X(FX1)
diff --git a/gowin/pack.cc b/gowin/pack.cc
index dc0b1461..1e0380c1 100644
--- a/gowin/pack.cc
+++ b/gowin/pack.cc
@@ -1019,6 +1019,14 @@ static void pack_plls(Context *ctx)
switch (ci->type.hash()) {
case ID_rPLL: {
if (parm_device == "GW1N-1" || parm_device == "GW1NZ-1") {
+ // Unused ports will be disabled during image generation. Here we add flags for such ports.
+ Property pr_enable("ENABLE"), pr_disable("DISABLE");
+ IdString ports[][2] = {{id_CLKOUTP, id_CLKOUTPS}, {id_CLKOUTD, id_CLKOUTDIV},
+ {id_CLKOUTD3, id_CLKOUTDIV3}, {id_LOCK, id_FLOCK},
+ {id_RESET_P, id_PWDEN}, {id_RESET, id_RSTEN}};
+ for (int i = 0; i < 6; ++i) {
+ ci->setParam(ports[i][1], port_used(ci, ports[i][0]) ? pr_enable : 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());