aboutsummaryrefslogtreecommitdiffstats
path: root/ice40
diff options
context:
space:
mode:
authorgatecat <gatecat@ds0.me>2022-05-08 12:44:03 +0100
committergatecat <gatecat@ds0.me>2022-05-08 12:44:03 +0100
commit27966f101f52415b671cc794b3926a0fc9e667d7 (patch)
treeedd529ffb4511d00d7b221a708f5e25be4914d5d /ice40
parenta4949826465fdc5fde89a0f52cc4078fae319cf3 (diff)
downloadnextpnr-27966f101f52415b671cc794b3926a0fc9e667d7.tar.gz
nextpnr-27966f101f52415b671cc794b3926a0fc9e667d7.tar.bz2
nextpnr-27966f101f52415b671cc794b3926a0fc9e667d7.zip
ice40: Fix propagation of constraints through SB_GB
Signed-off-by: gatecat <gatecat@ds0.me>
Diffstat (limited to 'ice40')
-rw-r--r--ice40/pack.cc31
1 files changed, 24 insertions, 7 deletions
diff --git a/ice40/pack.cc b/ice40/pack.cc
index 92297e8e..9eff053e 100644
--- a/ice40/pack.cc
+++ b/ice40/pack.cc
@@ -671,13 +671,6 @@ static void insert_global(Context *ctx, NetInfo *net, bool is_reset, bool is_cen
for (auto &user : keep_users)
user.cell->ports[user.port].user_idx = net->users.add(user);
- if (net->clkconstr) {
- glbnet->clkconstr = std::unique_ptr<ClockConstraint>(new ClockConstraint());
- glbnet->clkconstr->low = net->clkconstr->low;
- glbnet->clkconstr->high = net->clkconstr->high;
- glbnet->clkconstr->period = net->clkconstr->period;
- }
-
ctx->cells[gb->name] = std::move(gb);
}
@@ -803,6 +796,29 @@ static void promote_globals(Context *ctx)
}
}
+static void copy_gb_constraints(Context *ctx)
+{
+ // Copy constraints through GBs and PLLs
+ bool did_something = false;
+ do {
+ did_something = false;
+ for (auto &cell : ctx->cells) {
+ CellInfo *ci = cell.second.get();
+ if (!is_gbuf(ctx, ci))
+ continue;
+ NetInfo *in = ci->getPort(id_USER_SIGNAL_TO_GLOBAL_BUFFER);
+ NetInfo *out = ci->getPort(id_GLOBAL_BUFFER_OUTPUT);
+ if (in && out && in->clkconstr && !out->clkconstr) {
+ out->clkconstr = std::unique_ptr<ClockConstraint>(new ClockConstraint());
+ out->clkconstr->low = in->clkconstr->low;
+ out->clkconstr->high = in->clkconstr->high;
+ out->clkconstr->period = in->clkconstr->period;
+ did_something = true;
+ }
+ }
+ } while (did_something);
+}
+
// Figure out where to place PLLs
static void place_plls(Context *ctx)
{
@@ -1711,6 +1727,7 @@ bool Arch::pack()
pack_plls(ctx);
if (!bool_or_default(ctx->settings, id_no_promote_globals, false))
promote_globals(ctx);
+ copy_gb_constraints(ctx);
ctx->assignArchInfo();
constrain_chains(ctx);
ctx->fixupHierarchy();