nexus: Add oscillator support

Signed-off-by: David Shah <dave@ds0.me>
This commit is contained in:
David Shah 2020-01-13 16:01:08 +00:00
parent f8f3ee06c7
commit a280f893d4
2 changed files with 17 additions and 0 deletions

View File

@ -107,4 +107,6 @@ X(IO_TYPE)
X(OSC_CORE) X(OSC_CORE)
X(HFCLKOUT) X(HFCLKOUT)
X(LFCLKOUT) X(LFCLKOUT)
X(HF_CLK_DIV)

View File

@ -222,6 +222,19 @@ struct NexusFasmWriter
write_bit(stringf("BASE_TYPE.%s_%s", iodir, str_or_default(cell->attrs, id_IO_TYPE, "LVCMOS18H").c_str())); write_bit(stringf("BASE_TYPE.%s_%s", iodir, str_or_default(cell->attrs, id_IO_TYPE, "LVCMOS18H").c_str()));
pop(3); pop(3);
} }
void write_osc(const CellInfo *cell)
{
BelId bel = cell->bel;
push_tile(bel.tile);
push_belname(bel);
write_enum(cell, "HF_OSC_EN");
write_enum(cell, "HF_FABRIC_EN");
write_enum(cell, "HFDIV_FABRIC_EN", "ENABLED");
write_enum(cell, "LF_FABRIC_EN");
write_enum(cell, "LF_OUTPUT_EN");
write_int_vector(stringf("HF_CLK_DIV[7:0]"), int_or_default(cell->params, id_HF_CLK_DIV, 0), 8);
pop(2);
}
void operator()() void operator()()
{ {
// Write routing // Write routing
@ -240,6 +253,8 @@ struct NexusFasmWriter
write_io33(ci); write_io33(ci);
else if (ci->type == id_SEIO18_CORE) else if (ci->type == id_SEIO18_CORE)
write_io18(ci); write_io18(ci);
else if (ci->type == id_OSC_CORE)
write_osc(ci);
blank(); blank();
} }
} }