diff options
Diffstat (limited to 'ecp5/arch_place.cc')
-rw-r--r-- | ecp5/arch_place.cc | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/ecp5/arch_place.cc b/ecp5/arch_place.cc index e5c9b31f..d5c345af 100644 --- a/ecp5/arch_place.cc +++ b/ecp5/arch_place.cc @@ -140,6 +140,10 @@ void Arch::permute_luts() std::vector<NetInfo *> orig_nets; for (int i = 0; i < 4; i++) { + if (!ci->ports.count(port_names.at(i))) { + ci->ports[port_names.at(i)].name = port_names.at(i); + ci->ports[port_names.at(i)].type = PORT_IN; + } auto &port = ci->ports.at(port_names.at(i)); float crit = 0; if (port.net != nullptr && nc.count(port.net->name)) { @@ -152,7 +156,10 @@ void Arch::permute_luts() inputs.emplace_back(crit, i); } // Least critical first (A input is slowest) - std::sort(inputs.begin(), inputs.end()); + + // Avoid permuting locked LUTs (e.g. from an OOC submodule) + if (ci->belStrength <= STRENGTH_STRONG) + std::sort(inputs.begin(), inputs.end()); for (int i = 0; i < 4; i++) { IdString p = port_names.at(i); // log_info("%s %s %f\n", p.c_str(ctx), port_names.at(inputs.at(i).second).c_str(ctx), inputs.at(i).first); @@ -162,7 +169,7 @@ void Arch::permute_luts() connect_port(getCtx(), orig_nets.at(inputs.at(i).second), ci, p); ci->params[id(p.str(this) + "MUX")] = p.str(this); } else { - ci->params[id(p.str(this) + "MUX")] = "1"; + ci->params[id(p.str(this) + "MUX")] = std::string("1"); } } // Rewrite function @@ -177,7 +184,7 @@ void Arch::permute_luts() if (old_init & (1 << old_index)) new_init |= (1 << i); } - ci->params[id("LUT" + std::to_string(lut) + "_INITVAL")] = std::to_string(new_init); + ci->params[id("LUT" + std::to_string(lut) + "_INITVAL")] = Property(new_init, 16); }; for (auto cell : sorted(cells)) { |