Gowin. Fix cell creation

Signed-off-by: YRabbit <rabbit@yrabbit.cyou>
This commit is contained in:
YRabbit 2024-09-02 20:28:11 +10:00
parent e7223be18c
commit 0c9e733f29

View File

@ -3082,6 +3082,7 @@ struct GowinPacker
void pack_userflash()
{
log_info("Pack UserFlash cells...\n");
std::vector<std::unique_ptr<CellInfo>> new_cells;
for (auto &cell : ctx->cells) {
auto &ci = *cell.second;
@ -3128,7 +3129,10 @@ struct GowinPacker
return;
}
CellInfo *lut = ctx->createCell(create_aux_name(ci.name, lut_idx, "_lut$"), id_LUT4);
std::unique_ptr<CellInfo> lut_cell =
gwu.create_cell(create_aux_name(ci.name, lut_idx, "_lut$"), id_LUT4);
new_cells.push_back(std::move(lut_cell));
CellInfo *lut = new_cells.back().get();
lut->addInput(id_I0);
lut->addOutput(id_F);
lut->setParam(id_INIT, 0x5555);
@ -3157,6 +3161,9 @@ struct GowinPacker
}
}
}
for (auto &ncell : new_cells) {
ctx->cells[ncell->name] = std::move(ncell);
}
}
void run(void)