aboutsummaryrefslogtreecommitdiffstats
path: root/ecp5/pack.cc
diff options
context:
space:
mode:
authorDavid Shah <dave@ds0.me>2019-09-13 16:50:07 +0100
committerDavid Shah <dave@ds0.me>2019-09-13 16:50:07 +0100
commit2ace9b5ad3685043470154f88d7e410e553be726 (patch)
tree73bb2e41405c36ddcd65ff6a944aa6f7dcef83d5 /ecp5/pack.cc
parent927077e03b2e71649a0d691dee8d09bfdf085146 (diff)
downloadnextpnr-2ace9b5ad3685043470154f88d7e410e553be726.tar.gz
nextpnr-2ace9b5ad3685043470154f88d7e410e553be726.tar.bz2
nextpnr-2ace9b5ad3685043470154f88d7e410e553be726.zip
ecp5: Move clock constraints across IO and DCCA
Signed-off-by: David Shah <dave@ds0.me>
Diffstat (limited to 'ecp5/pack.cc')
-rw-r--r--ecp5/pack.cc9
1 files changed, 9 insertions, 0 deletions
diff --git a/ecp5/pack.cc b/ecp5/pack.cc
index e610dfe5..509d33f3 100644
--- a/ecp5/pack.cc
+++ b/ecp5/pack.cc
@@ -377,6 +377,13 @@ class Ecp5Packer
log_error("Pin B of %s '%s' connected to more than a single top level IO.\n",
trio->type.c_str(ctx), trio->name.c_str(ctx));
if (net != nullptr) {
+ if (net->clkconstr != nullptr && trio->ports.count(ctx->id("O"))) {
+ NetInfo *onet = trio->ports.at(ctx->id("O")).net;
+ if (onet != nullptr && !onet->clkconstr) {
+ // Move clock constraint from IO pad to input buffer output
+ std::swap(net->clkconstr, onet->clkconstr);
+ }
+ }
ctx->nets.erase(net->name);
trio->ports.at(ctx->id("B")).net = nullptr;
}
@@ -2361,6 +2368,8 @@ class Ecp5Packer
copy_constraint(ci, id_CLKI, id_CDIVX, ratio);
} else if (ci->type == id_ECLKSYNCB || ci->type == id_TRELLIS_ECLKBUF) {
copy_constraint(ci, id_ECLKI, id_ECLKO, 1);
+ } else if (ci->type == id_DCCA) {
+ copy_constraint(ci, id_CLKI, id_CLKO, 1);
} else if (ci->type == id_EHXPLLL) {
delay_t period_in;
if (!get_period(ci, id_CLKI, period_in))