Skip to content

Commit

Permalink
Gowin. Fix cell creation
Browse files Browse the repository at this point in the history
Signed-off-by: YRabbit <rabbit@yrabbit.cyou>
  • Loading branch information
yrabbit committed Sep 2, 2024
1 parent e7223be commit 0c9e733
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion himbaechel/uarch/gowin/pack.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -3157,6 +3161,9 @@ struct GowinPacker
}
}
}
for (auto &ncell : new_cells) {
ctx->cells[ncell->name] = std::move(ncell);
}
}

void run(void)
Expand Down

0 comments on commit 0c9e733

Please sign in to comment.