diff options
author | David Shah <dave@ds0.me> | 2020-11-13 15:25:57 +0000 |
---|---|---|
committer | David Shah <dave@ds0.me> | 2020-11-30 08:45:28 +0000 |
commit | 92031816257dbf76e79bce4dc9c4963824932c4d (patch) | |
tree | 002426696fcc0df545fe96502c21d69b915b6375 /nexus/fasm.cc | |
parent | d9a19897c4f236906632e2d1c53bffebd3f9dacc (diff) | |
download | nextpnr-92031816257dbf76e79bce4dc9c4963824932c4d.tar.gz nextpnr-92031816257dbf76e79bce4dc9c4963824932c4d.tar.bz2 nextpnr-92031816257dbf76e79bce4dc9c4963824932c4d.zip |
nexus: Support for unclocked 9x9 multiplies
Signed-off-by: David Shah <dave@ds0.me>
Diffstat (limited to 'nexus/fasm.cc')
-rw-r--r-- | nexus/fasm.cc | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/nexus/fasm.cc b/nexus/fasm.cc index 72efa5da..6aff3ae7 100644 --- a/nexus/fasm.cc +++ b/nexus/fasm.cc @@ -515,6 +515,27 @@ struct NexusFasmWriter pop(); } } + + bool is_mux_param(const std::string &key) + { + return (key.size() >= 3 && (key.compare(key.size() - 3, 3, "MUX") == 0)); + } + + // Write config for some kind of DSP cell + void write_dsp(const CellInfo *cell) + { + BelId bel = cell->bel; + push_bel(bel); + write_bit(stringf("MODE.%s", ctx->nameOf(cell->type))); + for (auto param : sorted_cref(cell->params)) { + const std::string ¶m_name = param.first.str(ctx); + if (is_mux_param(param_name)) + continue; + write_enum(cell, param_name); + } + write_cell_muxes(cell); + pop(); + } // Write out FASM for unused bels where needed void write_unused() { @@ -623,6 +644,10 @@ struct NexusFasmWriter write_osc(ci); else if (ci->type == id_OXIDE_EBR) write_bram(ci); + else if (ci->type == id_MULT9_CORE || ci->type == id_PREADD9_CORE || ci->type == id_MULT18_CORE || + ci->type == id_MULT18X36_CORE || ci->type == id_MULT36_CORE || ci->type == id_REG18_CORE || + ci->type == id_ACC54_CORE) + write_dsp(ci); blank(); } // Write config for unused bels |