aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Shah <dave@ds0.me>2018-12-12 19:08:48 +0000
committerDavid Shah <dave@ds0.me>2018-12-12 19:08:48 +0000
commitb12a8c1a3086b5896f81b330bbabb8249514d496 (patch)
treef9682a405326365e8be6fabe292d7f1425a08d5a
parent9d852f02b620facc25255101bb9d6d07a1e705c7 (diff)
downloadnextpnr-b12a8c1a3086b5896f81b330bbabb8249514d496.tar.gz
nextpnr-b12a8c1a3086b5896f81b330bbabb8249514d496.tar.bz2
nextpnr-b12a8c1a3086b5896f81b330bbabb8249514d496.zip
ecp5: Add {S}IOLOGIC constids and cell
Signed-off-by: David Shah <dave@ds0.me>
-rw-r--r--ecp5/cells.cc46
-rw-r--r--ecp5/constids.inc40
2 files changed, 86 insertions, 0 deletions
diff --git a/ecp5/cells.cc b/ecp5/cells.cc
index 31839ee4..9621b35c 100644
--- a/ecp5/cells.cc
+++ b/ecp5/cells.cc
@@ -41,6 +41,22 @@ std::unique_ptr<CellInfo> create_ecp5_cell(Context *ctx, IdString type, std::str
new_cell->name = ctx->id(name);
}
new_cell->type = type;
+
+ auto copy_bel_ports = [&]() {
+ // First find a Bel of the target type
+ BelId tgt;
+ for (auto bel : ctx->getBels()) {
+ if (ctx->getBelType(bel) == type) {
+ tgt = bel;
+ break;
+ }
+ }
+ NPNR_ASSERT(tgt != BelId());
+ for (auto port : ctx->getBelPins(tgt)) {
+ add_port(ctx, new_cell.get(), port.str(ctx), ctx->getBelPinType(tgt, port));
+ }
+ };
+
if (type == ctx->id("TRELLIS_SLICE")) {
new_cell->params[ctx->id("MODE")] = "LOGIC";
new_cell->params[ctx->id("GSR")] = "DISABLED";
@@ -150,6 +166,36 @@ std::unique_ptr<CellInfo> create_ecp5_cell(Context *ctx, IdString type, std::str
add_port(ctx, new_cell.get(), "CLKI", PORT_IN);
add_port(ctx, new_cell.get(), "CLKO", PORT_OUT);
add_port(ctx, new_cell.get(), "CE", PORT_IN);
+ } else if (type == id_IOLOGIC || type == id_SIOLOGIC) {
+ new_cell->params[ctx->id("MODE")] = "NONE";
+ new_cell->params[ctx->id("GSR")] = "DISABLED";
+ new_cell->params[ctx->id("CLKIMUX")] = "CLK";
+ new_cell->params[ctx->id("CLKOMUX")] = "CLK";
+ new_cell->params[ctx->id("LSRIMUX")] = "0";
+ new_cell->params[ctx->id("LSROMUX")] = "0";
+ new_cell->params[ctx->id("LSRMUX")] = "LSR";
+
+ new_cell->params[ctx->id("OUTDEL")] = "DISABLED";
+ new_cell->params[ctx->id("DEL_VALUE")] = "0";
+ new_cell->params[ctx->id("WAIT_FOR_EDGE")] = "DISABLED";
+
+ new_cell->params[ctx->id("DATAMUX_ODDR")] = "PADDO";
+ if (type == id_IOLOGIC) {
+ new_cell->params[ctx->id("IDDRXN_MODE")] = "NONE";
+ new_cell->params[ctx->id("ODDRXN_MODE")] = "NONE";
+
+ new_cell->params[ctx->id("MIDDRX_MODE")] = "NONE";
+ new_cell->params[ctx->id("MODDRX_MODE")] = "NONE";
+ new_cell->params[ctx->id("MTDDRX_MODE")] = "NONE";
+
+ new_cell->params[ctx->id("IOLTOMUX")] = "NONE";
+ new_cell->params[ctx->id("MTDDRX_DQSW_INVERT")] = "DISABLED";
+ new_cell->params[ctx->id("MTDDRX_REGSET")] = "RESET";
+
+ new_cell->params[ctx->id("MIDDRX_MODDRX_WRCLKMUX")] = "NONE";
+ }
+ // Just copy ports from the Bel
+ copy_bel_ports();
} else {
log_error("unable to create ECP5 cell of type %s", type.c_str(ctx));
}
diff --git a/ecp5/constids.inc b/ecp5/constids.inc
index 250bc3fc..202a7eb2 100644
--- a/ecp5/constids.inc
+++ b/ecp5/constids.inc
@@ -1142,3 +1142,43 @@ X(PAD)
X(PADDI)
X(PADDO)
X(PADDT)
+
+X(IOLOGIC)
+X(SIOLOGIC)
+X(DI)
+X(IOLDO)
+X(IOLDOD)
+X(IOLDOI)
+X(IOLTO)
+X(INDD)
+X(LOADN)
+X(MOVE)
+X(DIRECTION)
+X(TSDATA0)
+X(TXDATA0)
+X(TXDATA1)
+X(RXDATA0)
+X(RXDATA1)
+X(INFF)
+X(CFLAG)
+X(ECLK)
+X(TSDATA1)
+X(TXDATA2)
+X(TXDATA3)
+X(RXDATA2)
+X(RXDATA3)
+X(TXDATA4)
+X(TXDATA5)
+X(TXDATA6)
+X(RXDATA4)
+X(RXDATA5)
+X(RXDATA6)
+X(DQSR90)
+X(DQSW270)
+X(DQSW)
+X(RDPNTR0)
+X(RDPNTR1)
+X(RDPNTR2)
+X(WRPNTR0)
+X(WRPNTR1)
+X(WRPNTR2)