ecp5: Fixing EBR constant tie-offs
Signed-off-by: David Shah <dave@ds0.me>
This commit is contained in:
parent
85a95ec250
commit
cd688a2784
@ -88,6 +88,7 @@ static void tie_cib_signal(Context *ctx, ChipConfig &cc, WireId wire, bool value
|
|||||||
NPNR_ASSERT(uphill.begin() != uphill.end()); // At least one uphill pip
|
NPNR_ASSERT(uphill.begin() != uphill.end()); // At least one uphill pip
|
||||||
auto iter = uphill.begin();
|
auto iter = uphill.begin();
|
||||||
cibsig = ctx->getPipSrcWire(*iter);
|
cibsig = ctx->getPipSrcWire(*iter);
|
||||||
|
basename = ctx->getWireBasename(cibsig).str(ctx);
|
||||||
++iter;
|
++iter;
|
||||||
NPNR_ASSERT(!(iter != uphill.end())); // Exactly one uphill pip
|
NPNR_ASSERT(!(iter != uphill.end())); // Exactly one uphill pip
|
||||||
}
|
}
|
||||||
@ -454,7 +455,7 @@ void write_bitstream(Context *ctx, std::string base_config_file, std::string tex
|
|||||||
|
|
||||||
// Tie signals as appropriate
|
// Tie signals as appropriate
|
||||||
for (auto port : ci->ports) {
|
for (auto port : ci->ports) {
|
||||||
if (port.second.net == nullptr) {
|
if (port.second.net == nullptr && port.second.type == PORT_IN) {
|
||||||
if (port.first == id_CLKA || port.first == id_CLKB || port.first == id_WEA ||
|
if (port.first == id_CLKA || port.first == id_CLKB || port.first == id_WEA ||
|
||||||
port.first == id_WEB || port.first == id_CEA || port.first == id_CEB || port.first == id_OCEA ||
|
port.first == id_WEB || port.first == id_CEA || port.first == id_CEB || port.first == id_OCEA ||
|
||||||
port.first == id_OCEB || port.first == id_RSTA || port.first == id_RSTB)
|
port.first == id_OCEB || port.first == id_RSTA || port.first == id_RSTB)
|
||||||
|
49
ecp5/pack.cc
49
ecp5/pack.cc
@ -909,10 +909,59 @@ class Ecp5Packer
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void autocreate_empty_port(CellInfo *cell, IdString port)
|
||||||
|
{
|
||||||
|
if (!cell->ports.count(port)) {
|
||||||
|
cell->ports[port].name = port;
|
||||||
|
cell->ports[port].net = nullptr;
|
||||||
|
cell->ports[port].type = PORT_IN;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Pack EBR
|
||||||
|
void pack_ebr()
|
||||||
|
{
|
||||||
|
for (auto cell : sorted(ctx->cells)) {
|
||||||
|
CellInfo *ci = cell.second;
|
||||||
|
if (ci->type == id_DP16KD) {
|
||||||
|
// Add ports, even if disconnected, to ensure correct tie-offs
|
||||||
|
for (int i = 0; i < 14; i++) {
|
||||||
|
autocreate_empty_port(ci, ctx->id("ADA" + std::to_string(i)));
|
||||||
|
autocreate_empty_port(ci, ctx->id("ADB" + std::to_string(i)));
|
||||||
|
}
|
||||||
|
for (int i = 0; i < 18; i++) {
|
||||||
|
autocreate_empty_port(ci, ctx->id("DIA" + std::to_string(i)));
|
||||||
|
autocreate_empty_port(ci, ctx->id("DIB" + std::to_string(i)));
|
||||||
|
}
|
||||||
|
for (int i = 0; i < 3; i++) {
|
||||||
|
autocreate_empty_port(ci, ctx->id("CSA" + std::to_string(i)));
|
||||||
|
autocreate_empty_port(ci, ctx->id("CSB" + std::to_string(i)));
|
||||||
|
}
|
||||||
|
for (int i = 0; i < 3; i++) {
|
||||||
|
autocreate_empty_port(ci, ctx->id("CSA" + std::to_string(i)));
|
||||||
|
autocreate_empty_port(ci, ctx->id("CSB" + std::to_string(i)));
|
||||||
|
}
|
||||||
|
|
||||||
|
autocreate_empty_port(ci, id_CLKA);
|
||||||
|
autocreate_empty_port(ci, id_CEA);
|
||||||
|
autocreate_empty_port(ci, id_OCEA);
|
||||||
|
autocreate_empty_port(ci, id_WEA);
|
||||||
|
autocreate_empty_port(ci, id_RSTA);
|
||||||
|
|
||||||
|
autocreate_empty_port(ci, id_CLKB);
|
||||||
|
autocreate_empty_port(ci, id_CEB);
|
||||||
|
autocreate_empty_port(ci, id_OCEB);
|
||||||
|
autocreate_empty_port(ci, id_WEB);
|
||||||
|
autocreate_empty_port(ci, id_RSTB);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
void pack()
|
void pack()
|
||||||
{
|
{
|
||||||
pack_io();
|
pack_io();
|
||||||
|
pack_ebr();
|
||||||
pack_constants();
|
pack_constants();
|
||||||
pack_dram();
|
pack_dram();
|
||||||
pack_carries();
|
pack_carries();
|
||||||
|
Loading…
Reference in New Issue
Block a user