Merge pull request #1045 from yrabbit/unused-ports

gowin: mark the PLL ports that are not in use
This commit is contained in:
myrtle 2022-11-20 13:55:01 +01:00 committed by GitHub
commit c61d490bd4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 16 additions and 0 deletions

View File

@ -931,6 +931,14 @@ X(CLKOUTD)
X(CLKOUTD3)
X(LOCK)
// PLL parameters
X(CLKOUTPS)
X(CLKOUTDIV)
X(CLKOUTDIV3)
X(PWDEN)
X(RSTEN)
X(FLOCK)
// timing
X(X0)
X(FX1)

View File

@ -1019,6 +1019,14 @@ static void pack_plls(Context *ctx)
switch (ci->type.hash()) {
case ID_rPLL: {
if (parm_device == "GW1N-1" || parm_device == "GW1NZ-1") {
// Unused ports will be disabled during image generation. Here we add flags for such ports.
Property pr_enable("ENABLE"), pr_disable("DISABLE");
IdString ports[][2] = {{id_CLKOUTP, id_CLKOUTPS}, {id_CLKOUTD, id_CLKOUTDIV},
{id_CLKOUTD3, id_CLKOUTDIV3}, {id_LOCK, id_FLOCK},
{id_RESET_P, id_PWDEN}, {id_RESET, id_RSTEN}};
for (int i = 0; i < 6; ++i) {
ci->setParam(ports[i][1], port_used(ci, ports[i][0]) ? pr_enable : pr_disable);
}
// B half
std::unique_ptr<CellInfo> cell = create_generic_cell(ctx, id_RPLLB, ci->name.str(ctx) + "$rpllb");
reconnect_rpllb(ctx, ci, cell.get());