aboutsummaryrefslogtreecommitdiffstats
path: root/nexus
diff options
context:
space:
mode:
authorDavid Shah <dave@ds0.me>2020-11-13 13:44:10 +0000
committerDavid Shah <dave@ds0.me>2020-11-30 08:45:28 +0000
commit094bf419d4b7aa62a606b8c7bdbcfc1fc63cacf7 (patch)
tree903101e26532a05915019c82ef56df1c3822aab1 /nexus
parent90608f2c898c179cb95fb469633867e7adc64fc4 (diff)
downloadnextpnr-094bf419d4b7aa62a606b8c7bdbcfc1fc63cacf7.tar.gz
nextpnr-094bf419d4b7aa62a606b8c7bdbcfc1fc63cacf7.tar.bz2
nextpnr-094bf419d4b7aa62a606b8c7bdbcfc1fc63cacf7.zip
nexus: Miscellaneous DSP infrastructure
Signed-off-by: David Shah <dave@ds0.me>
Diffstat (limited to 'nexus')
-rw-r--r--nexus/constids.inc77
-rw-r--r--nexus/pack.cc48
2 files changed, 125 insertions, 0 deletions
diff --git a/nexus/constids.inc b/nexus/constids.inc
index a43104e2..a996f0f8 100644
--- a/nexus/constids.inc
+++ b/nexus/constids.inc
@@ -165,6 +165,16 @@ X(MULT18X36_CORE)
X(MULT36_CORE)
X(ACC54_CORE)
+X(PREADD9)
+X(MULT9)
+X(MULT18)
+X(REG18)
+X(M18X36)
+X(MULT36)
+X(ACC54)
+
+X(MULT9X9)
+
X(DCC)
X(CLKI)
X(CLKO)
@@ -215,3 +225,70 @@ X(DWS4)
X(WEAMUX)
X(VCC_DRV)
+
+X(RSTCL)
+X(CECL)
+X(B2)
+X(B3)
+X(B4)
+X(B5)
+X(B6)
+X(B7)
+X(B8)
+X(BSIGNED)
+X(C2)
+X(C3)
+X(C4)
+X(C5)
+X(C6)
+X(C7)
+X(C8)
+X(C9)
+
+X(RSTP)
+X(CEP)
+X(A2)
+X(A3)
+X(A4)
+X(A5)
+X(A6)
+X(A7)
+X(A8)
+X(ASIGNED)
+
+X(SFTCTRL0)
+X(SFTCTRL1)
+X(SFTCTRL2)
+X(SFTCTRL3)
+X(ROUNDEN)
+
+X(LOAD)
+X(M9ADDSUB1)
+X(M9ADDSUB0)
+X(ADDSUB1)
+X(ADDSUB0)
+
+X(CEO)
+X(RSTO)
+X(CEC)
+X(RSTC)
+X(SIGNEDI)
+X(CECIN)
+X(CECTRL)
+X(RSTCIN)
+X(RSTCTRL)
+
+X(SIGNEDSTATIC_EN)
+X(SUBSTRACT_EN)
+X(CSIGNED)
+X(BSIGNED_OPERAND_EN)
+X(BYPASS_PREADD9)
+X(REGBYPSBR0)
+X(REGBYPSBR1)
+X(REGBYPSBL)
+X(SHIFTBR)
+X(SHIFTBL)
+X(PREADDCAS_EN)
+X(SR_18BITSHIFT_EN)
+X(OPC)
+X(RESET)
diff --git a/nexus/pack.cc b/nexus/pack.cc
index 50278d48..d39a1c89 100644
--- a/nexus/pack.cc
+++ b/nexus/pack.cc
@@ -1351,6 +1351,54 @@ struct NexusPacker
auto_cascade_cell(child, cell2bel.at(child->name), bel2cell);
}
+ // Create a DSP cell
+ CellInfo *create_dsp_cell(IdString base_name, IdString type, CellInfo *constr_base, int dx, int dz)
+ {
+ IdString name = ctx->id(stringf("%s/%s_x%d_z%d", ctx->nameOf(base_name), ctx->nameOf(type), dx, dz));
+ CellInfo *cell = ctx->createCell(name, type);
+ if (constr_base != nullptr) {
+ // We might be constraining against an already-constrained cell
+ if (constr_base->constr_parent != nullptr) {
+ cell->constr_x = dx + constr_base->constr_x;
+ cell->constr_y = constr_base->constr_y;
+ cell->constr_z = dz + constr_base->constr_z;
+ cell->constr_abs_z = false;
+ cell->constr_parent = constr_base->constr_parent;
+ constr_base->constr_parent->constr_children.push_back(cell);
+ } else {
+ cell->constr_x = dx;
+ cell->constr_y = 0;
+ cell->constr_z = dz;
+ cell->constr_abs_z = false;
+ cell->constr_parent = constr_base;
+ constr_base->constr_children.push_back(cell);
+ }
+ }
+ // Setup some default parameters
+ if (type == id_PREADD9_CORE) {
+ cell->params[id_SIGNEDSTATIC_EN] = std::string("DISABLED");
+ cell->params[id_BYPASS_PREADD9] = std::string("BYPASS");
+ cell->params[id_CSIGNED] = std::string("DISABLED");
+ cell->params[id_GSR] = std::string("DISABLED");
+ cell->params[id_OPC] = std::string("INPUT_B_AS_PREADDER_OPERAND");
+ cell->params[id_PREADDCAS_EN] = std::string("DISABLED");
+ cell->params[id_PREADDCAS_EN] = std::string("DISABLED");
+ cell->params[id_PREADDCAS_EN] = std::string("DISABLED");
+ cell->params[id_REGBYPSBL] = std::string("REGISTER");
+ cell->params[id_REGBYPSBR0] = std::string("BYPASS");
+ cell->params[id_REGBYPSBR1] = std::string("BYPASS");
+ cell->params[id_RESET] = std::string("SYNC");
+ cell->params[id_SHIFTBL] = std::string("BYPASS");
+ cell->params[id_SHIFTBR] = std::string("REGISTER");
+ cell->params[id_SIGNEDSTATIC_EN] = std::string("DISABLED");
+ cell->params[id_SR_18BITSHIFT_EN] = std::string("DISABLED");
+ cell->params[id_SUBSTRACT_EN] = std::string("SUBTRACTION");
+ }
+ return cell;
+ }
+
+ void pack_dsps() { log_info("Packing DSPs...\n"); }
+
explicit NexusPacker(Context *ctx) : ctx(ctx) {}
void operator()()