diff options
author | gatecat <gatecat@ds0.me> | 2023-02-27 10:38:25 +0100 |
---|---|---|
committer | myrtle <gatecat@ds0.me> | 2023-02-28 21:39:25 +0100 |
commit | 2f509734dff676b7543a574b64a46be4224a5aa4 (patch) | |
tree | c4200f2fa8363985ae461d18db10db1f1b721835 /generic/viaduct/fabulous/fasm.cc | |
parent | cdd7bb676fbb060c63ed2d0e285b3bdf324a5107 (diff) | |
download | nextpnr-2f509734dff676b7543a574b64a46be4224a5aa4.tar.gz nextpnr-2f509734dff676b7543a574b64a46be4224a5aa4.tar.bz2 nextpnr-2f509734dff676b7543a574b64a46be4224a5aa4.zip |
fabulous: Misc improvements
Signed-off-by: gatecat <gatecat@ds0.me>
Diffstat (limited to 'generic/viaduct/fabulous/fasm.cc')
-rw-r--r-- | generic/viaduct/fabulous/fasm.cc | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/generic/viaduct/fabulous/fasm.cc b/generic/viaduct/fabulous/fasm.cc index 159bb8ff..f1c0c648 100644 --- a/generic/viaduct/fabulous/fasm.cc +++ b/generic/viaduct/fabulous/fasm.cc @@ -223,6 +223,23 @@ struct FabFasmWriter } } + void write_iopass(const CellInfo *ci) + { + Loc loc = ctx->getBelLocation(ci->bel); + // We use 'nice' names based on function for the IOPass bels inside nextpnr + // but in the bitstream we need to use character names + NPNR_ASSERT(loc.z <= 26); + prefix = stringf("X%dY%d.%c.", loc.x, loc.y, 'A' + loc.z); + if (ci->params.count(id_I_reg)) { + uint64_t regval = int_or_default(ci->params, id_I_reg); + for (unsigned i = 0; i < 4; i++) { + if (regval & (1 << i)) + out << prefix << stringf("I%d_reg", i) << std::endl; + } + } + prefix = ""; + } + void write_cell(const CellInfo *ci) { out << stringf("# config for cell '%s'\n", ctx->nameOf(ci)) << std::endl; @@ -231,6 +248,8 @@ struct FabFasmWriter write_logic(ci); else if (ci->type == id_IO_1_bidirectional_frame_config_pass) write_io(ci); + else if (ci->type.in(id_InPass4_frame_config, id_OutPass4_frame_config)) + write_iopass(ci); else write_generic_cell(ci); // TODO: other cell types |