aboutsummaryrefslogtreecommitdiffstats
path: root/nexus/fasm.cc
diff options
context:
space:
mode:
authorDavid Shah <dave@ds0.me>2020-01-13 12:17:34 +0000
committerDavid Shah <dave@ds0.me>2020-11-30 08:45:27 +0000
commitf8f3ee06c71aa1726f32821a42193705b8056b82 (patch)
treee80510b9f83f34d526390b4634786b4978f6bc79 /nexus/fasm.cc
parent44f98c545b353c823692f91953c1ca74b6be2d4f (diff)
downloadnextpnr-f8f3ee06c71aa1726f32821a42193705b8056b82.tar.gz
nextpnr-f8f3ee06c71aa1726f32821a42193705b8056b82.tar.bz2
nextpnr-f8f3ee06c71aa1726f32821a42193705b8056b82.zip
nexus: Add SEIO18 support
Signed-off-by: David Shah <dave@ds0.me>
Diffstat (limited to 'nexus/fasm.cc')
-rw-r--r--nexus/fasm.cc19
1 files changed, 19 insertions, 0 deletions
diff --git a/nexus/fasm.cc b/nexus/fasm.cc
index 45c02514..5a2880da 100644
--- a/nexus/fasm.cc
+++ b/nexus/fasm.cc
@@ -205,6 +205,23 @@ struct NexusFasmWriter
write_bit(stringf("BASE_TYPE.%s_%s", iodir, str_or_default(cell->attrs, id_IO_TYPE, "LVCMOS33").c_str()));
pop(2);
}
+ void write_io18(const CellInfo *cell)
+ {
+ BelId bel = cell->bel;
+ push_tile(bel.tile);
+ push_belname(bel);
+ push("SEIO18");
+ const NetInfo *t = get_net_or_empty(cell, id_T);
+ bool is_input = false, is_output = false;
+ if (t == nullptr || t->name == ctx->id("$PACKER_VCC_NET")) {
+ is_input = true;
+ } else if (t->name == ctx->id("$PACKER_GND_NET")) {
+ is_output = true;
+ }
+ const char *iodir = is_input ? "INPUT" : (is_output ? "OUTPUT" : "BIDIR");
+ write_bit(stringf("BASE_TYPE.%s_%s", iodir, str_or_default(cell->attrs, id_IO_TYPE, "LVCMOS18H").c_str()));
+ pop(3);
+ }
void operator()()
{
// Write routing
@@ -221,6 +238,8 @@ struct NexusFasmWriter
write_ff(ci);
else if (ci->type == id_SEIO33_CORE)
write_io33(ci);
+ else if (ci->type == id_SEIO18_CORE)
+ write_io18(ci);
blank();
}
}