gatemate: Handle missing INIT on BRAMs (#1707)

Signed-off-by: gatecat <gatecat@ds0.me>
This commit is contained in:
myrtle 2026-04-28 13:08:08 +02:00 committed by GitHub
parent 98c18d7f14
commit 3c29cc217e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 6 additions and 2 deletions

View File

@ -584,10 +584,14 @@ void GateMatePacker::repack_ram()
for (int i = 63; i >= 0; i--) {
std::vector<bool> orig_first;
if (ram.second.first)
orig_first = ram.second.first->params.at(ctx->idf("INIT_%02X", i)).extract(0, 320).as_bits();
orig_first = get_or_default(ram.second.first->params, ctx->idf("INIT_%02X", i), Property())
.extract(0, 320)
.as_bits();
std::vector<bool> orig_second;
if (ram.second.second)
orig_second = ram.second.second->params.at(ctx->idf("INIT_%02X", i)).extract(0, 320).as_bits();
orig_second = get_or_default(ram.second.second->params, ctx->idf("INIT_%02X", i), Property())
.extract(0, 320)
.as_bits();
std::string init[2];
for (int j = 0; j < 2; j++) {