From d9a19897c4f236906632e2d1c53bffebd3f9dacc Mon Sep 17 00:00:00 2001
From: David Shah <dave@ds0.me>
Date: Fri, 13 Nov 2020 14:17:40 +0000
Subject: nexus: More DSP primitive config

Signed-off-by: David Shah <dave@ds0.me>
---
 nexus/constids.inc |  9 +++++++++
 nexus/pack.cc      | 16 ++++++++++++++++
 nexus/pins.cc      | 43 ++++++++++++++++++++++++++++++++++++++++++-
 3 files changed, 67 insertions(+), 1 deletion(-)

(limited to 'nexus')

diff --git a/nexus/constids.inc b/nexus/constids.inc
index a996f0f8..0309bdd3 100644
--- a/nexus/constids.inc
+++ b/nexus/constids.inc
@@ -292,3 +292,12 @@ X(PREADDCAS_EN)
 X(SR_18BITSHIFT_EN)
 X(OPC)
 X(RESET)
+
+X(ASIGNED_OPERAND_EN)
+X(BYPASS_MULT9)
+X(REGBYPSA1)
+X(REGBYPSA2)
+X(REGBYPSB)
+X(SHIFTA)
+
+X(REGBYPS)
diff --git a/nexus/pack.cc b/nexus/pack.cc
index d39a1c89..811a7c3a 100644
--- a/nexus/pack.cc
+++ b/nexus/pack.cc
@@ -1393,6 +1393,22 @@ struct NexusPacker
             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");
+        } else if (type == id_MULT9_CORE) {
+            cell->params[id_ASIGNED_OPERAND_EN] = std::string("DISABLED");
+            cell->params[id_BYPASS_MULT9] = std::string("DISABLED");
+            cell->params[id_GSR] = std::string("DISABLED");
+            cell->params[id_REGBYPSA1] = std::string("DISABLED");
+            cell->params[id_REGBYPSA2] = std::string("DISABLED");
+            cell->params[id_REGBYPSB] = std::string("DISABLED");
+            cell->params[id_RESET] = std::string("SYNC");
+            cell->params[id_GSR] = std::string("DISABLED");
+            cell->params[id_SHIFTA] = std::string("DISABLED");
+            cell->params[id_SIGNEDSTATIC_EN] = std::string("DISABLED");
+            cell->params[id_SR_18BITSHIFT_EN] = std::string("DISABLED");
+        } else if (type == id_REG18_CORE) {
+            cell->params[id_GSR] = std::string("DISABLED");
+            cell->params[id_REGBYPS] = std::string("BYPASS");
+            cell->params[id_RESET] = std::string("SYNC");
         }
         return cell;
     }
diff --git a/nexus/pins.cc b/nexus/pins.cc
index e7be26f2..134565ad 100644
--- a/nexus/pins.cc
+++ b/nexus/pins.cc
@@ -83,7 +83,48 @@ static const std::unordered_map<IdString, Arch::CellPinsData> base_cell_pin_data
                  {id_HFOUTEN, PINSTYLE_PU},
                  {{}, PINSTYLE_CIB},
          }},
-};
+        {id_PREADD9_CORE,
+         {
+                 {id_CLK, PINSTYLE_CLK}, {id_RSTCL, PINSTYLE_LSR},   {id_RSTB, PINSTYLE_LSR}, {id_CECL, PINSTYLE_CE},
+                 {id_CEB, PINSTYLE_CE},
+
+                 {id_B0, PINSTYLE_CIB},  {id_B1, PINSTYLE_CIB},      {id_B2, PINSTYLE_CIB},   {id_B3, PINSTYLE_CIB},
+                 {id_B4, PINSTYLE_CIB},  {id_B5, PINSTYLE_CIB},      {id_B6, PINSTYLE_CIB},   {id_B7, PINSTYLE_CIB},
+                 {id_B8, PINSTYLE_CIB},  {id_BSIGNED, PINSTYLE_CIB},
+
+                 {id_C0, PINSTYLE_CIB},  {id_C1, PINSTYLE_CIB},      {id_C2, PINSTYLE_CIB},   {id_C3, PINSTYLE_CIB},
+                 {id_C4, PINSTYLE_CIB},  {id_C5, PINSTYLE_CIB},      {id_C6, PINSTYLE_CIB},   {id_C7, PINSTYLE_CIB},
+                 {id_C8, PINSTYLE_CIB},  {id_C9, PINSTYLE_CIB},
+
+                 {{}, PINSTYLE_DEDI},
+         }},
+        {id_MULT9_CORE,
+         {
+                 {id_CLK, PINSTYLE_CLK},
+                 {id_RSTA, PINSTYLE_LSR},
+                 {id_RSTP, PINSTYLE_LSR},
+                 {id_CEA, PINSTYLE_CE},
+                 {id_CEP, PINSTYLE_CE},
+
+                 {id_A0, PINSTYLE_CIB},
+                 {id_A1, PINSTYLE_CIB},
+                 {id_A2, PINSTYLE_CIB},
+                 {id_A3, PINSTYLE_CIB},
+                 {id_A4, PINSTYLE_CIB},
+                 {id_A5, PINSTYLE_CIB},
+                 {id_A6, PINSTYLE_CIB},
+                 {id_A7, PINSTYLE_CIB},
+                 {id_A8, PINSTYLE_CIB},
+                 {id_ASIGNED, PINSTYLE_CIB},
+
+                 {{}, PINSTYLE_DEDI},
+         }},
+        {id_REG18_CORE,
+         {
+                 {id_CLK, PINSTYLE_CLK},
+                 {id_RSTP, PINSTYLE_LSR},
+                 {id_CEP, PINSTYLE_CE},
+         }}};
 } // namespace
 
 void Arch::init_cell_pin_data() { cell_pins_db = base_cell_pin_data; }
-- 
cgit v1.2.3