aboutsummaryrefslogtreecommitdiffstats
path: root/nexus
diff options
context:
space:
mode:
authorDavid Shah <dave@ds0.me>2020-01-13 16:01:08 +0000
committerDavid Shah <dave@ds0.me>2020-11-30 08:45:27 +0000
commita280f893d4c7f516372302a03aee5299bbe13d5e (patch)
tree718621c7432d450e83ac628a9ae69139987086ea /nexus
parentf8f3ee06c71aa1726f32821a42193705b8056b82 (diff)
downloadnextpnr-a280f893d4c7f516372302a03aee5299bbe13d5e.tar.gz
nextpnr-a280f893d4c7f516372302a03aee5299bbe13d5e.tar.bz2
nextpnr-a280f893d4c7f516372302a03aee5299bbe13d5e.zip
nexus: Add oscillator support
Signed-off-by: David Shah <dave@ds0.me>
Diffstat (limited to 'nexus')
-rw-r--r--nexus/constids.inc2
-rw-r--r--nexus/fasm.cc15
2 files changed, 17 insertions, 0 deletions
diff --git a/nexus/constids.inc b/nexus/constids.inc
index edde3bc9..38df628e 100644
--- a/nexus/constids.inc
+++ b/nexus/constids.inc
@@ -107,4 +107,6 @@ X(IO_TYPE)
X(OSC_CORE)
X(HFCLKOUT)
X(LFCLKOUT)
+X(HF_CLK_DIV)
+
diff --git a/nexus/fasm.cc b/nexus/fasm.cc
index 5a2880da..f7841bde 100644
--- a/nexus/fasm.cc
+++ b/nexus/fasm.cc
@@ -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()));
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()()
{
// Write routing
@@ -240,6 +253,8 @@ struct NexusFasmWriter
write_io33(ci);
else if (ci->type == id_SEIO18_CORE)
write_io18(ci);
+ else if (ci->type == id_OSC_CORE)
+ write_osc(ci);
blank();
}
}