ecp5: DELAY fixes

Signed-off-by: David Shah <dave@ds0.me>
This commit is contained in:
David Shah 2019-02-25 11:07:55 +00:00
parent 95a85c8ea7
commit df79d94944
2 changed files with 11 additions and 16 deletions

View File

@ -504,17 +504,13 @@ bool Arch::getBudgetOverride(const NetInfo *net_info, const PortRef &sink, delay
// -----------------------------------------------------------------------
<<<<<<< HEAD
bool Arch::place() { return placer1(getCtx(), Placer1Cfg(getCtx())); }
=======
bool Arch::place()
{
bool result = placer_heap(getCtx());
bool result = placer1(getCtx(), Placer1Cfg(getCtx()));
if (result)
permute_luts();
return result;
}
>>>>>>> 136e030... lut permutation
bool Arch::route()
{

View File

@ -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);