aboutsummaryrefslogtreecommitdiffstats
path: root/ecp5/pack.cc
diff options
context:
space:
mode:
authorDavid Shah <dave@ds0.me>2019-02-25 11:07:55 +0000
committerDavid Shah <dave@ds0.me>2019-02-25 11:49:25 +0000
commitdf79d94944b4d92207be7ddedc6424b7c931f313 (patch)
tree49215217265802745407465c41f9b493e74f47b1 /ecp5/pack.cc
parent95a85c8ea76cdd0a1c5824200451569366c9eb8c (diff)
downloadnextpnr-df79d94944b4d92207be7ddedc6424b7c931f313.tar.gz
nextpnr-df79d94944b4d92207be7ddedc6424b7c931f313.tar.bz2
nextpnr-df79d94944b4d92207be7ddedc6424b7c931f313.zip
ecp5: DELAY fixes
Signed-off-by: David Shah <dave@ds0.me>
Diffstat (limited to 'ecp5/pack.cc')
-rw-r--r--ecp5/pack.cc21
1 files changed, 10 insertions, 11 deletions
diff --git a/ecp5/pack.cc b/ecp5/pack.cc
index 9f987f35..1b07c2ae 100644
--- a/ecp5/pack.cc
+++ b/ecp5/pack.cc
@@ -236,20 +236,21 @@ class Ecp5Packer
for (auto user : znet->users) {
if (is_lc(ctx, user.cell) || user.cell->type == ctx->id("DP16KD") || is_ff(ctx, user.cell)) {
for (auto port : user.cell->ports) {
- if (port.second.type != PORT_IN || port.second.net == nullptr || port.second.net == znet)
+ if (port.second.type != PORT_IN || port.second.net == nullptr ||
+ port.second.net == znet)
continue;
if (port.second.net->users.size() > 10)
continue;
CellInfo *drv = port.second.net->driver.cell;
if (drv == nullptr)
continue;
- if (is_lut(ctx, drv) && !procdLuts.count(drv->name) && can_pack_lutff(ci->name, drv->name)) {
+ if (is_lut(ctx, drv) && !procdLuts.count(drv->name) &&
+ can_pack_lutff(ci->name, drv->name)) {
procdLuts.insert(ci->name);
procdLuts.insert(drv->name);
lutPairs[ci->name] = drv->name;
goto paired_inlut;
}
-
}
}
}
@@ -261,9 +262,8 @@ class Ecp5Packer
if (innet != nullptr && innet->users.size() < 5 && innet->users.size() > 1)
inpnets.push_back(innet);
}
- std::sort(inpnets.begin(), inpnets.end(), [&](const NetInfo *a, const NetInfo *b) {
- return a->users.size() < b->users.size();
- });
+ std::sort(inpnets.begin(), inpnets.end(),
+ [&](const NetInfo *a, const NetInfo *b) { return a->users.size() < b->users.size(); });
for (auto inet : inpnets) {
for (auto &user : inet->users) {
if (user.cell == nullptr || user.cell == ci || !is_lut(ctx, user.cell))
@@ -276,7 +276,6 @@ class Ecp5Packer
lutPairs[ci->name] = user.cell->name;
goto paired_inlut;
}
-
}
}
@@ -294,7 +293,6 @@ class Ecp5Packer
}
}
-
// Return true if an port is a top level port that provides its own IOBUF
bool is_top_port(PortRef &port)
{
@@ -999,11 +997,11 @@ class Ecp5Packer
if (is_lut(ctx, ci)) {
std::unique_ptr<CellInfo> slice =
create_ecp5_cell(ctx, ctx->id("TRELLIS_SLICE"), ci->name.str(ctx) + "_SLICE");
- lut_to_slice(ctx, ci, slice.get(), 0);
+ lut_to_slice(ctx, ci, slice.get(), 1);
auto ff = lutffPairs.find(ci->name);
if (ff != lutffPairs.end()) {
- ff_to_slice(ctx, ctx->cells.at(ff->second).get(), slice.get(), 0, true);
+ ff_to_slice(ctx, ctx->cells.at(ff->second).get(), slice.get(), 1, true);
packed_cells.insert(ff->second);
fflutPairs.erase(ff->second);
lutffPairs.erase(ci->name);
@@ -1884,7 +1882,8 @@ class Ecp5Packer
}
iol->params[ctx->id("DELAY.DEL_VALUE")] =
std::to_string(lookup_delay(str_or_default(ci->params, ctx->id("DEL_MODE"), "USER_DEFINED")));
- if (ci->params.count(ctx->id("DEL_VALUE")) && ci->params.at(ctx->id("DEL_VALUE")) != "DELAY0")
+ if (ci->params.count(ctx->id("DEL_VALUE")) &&
+ ci->params.at(ctx->id("DEL_VALUE")).substr(0, 5) != "DELAY")
iol->params[ctx->id("DELAY.DEL_VALUE")] = ci->params.at(ctx->id("DEL_VALUE"));
if (ci->ports.count(id_LOADN))
replace_port(ci, id_LOADN, iol, id_LOADN);