From 63beb4595054c58d7c496d967c4c779369c7bd4f Mon Sep 17 00:00:00 2001 From: Miodrag Milanovic Date: Tue, 24 Dec 2024 09:29:48 +0100 Subject: [PATCH] Naive pack CC_DFF --- himbaechel/uarch/gatemate/constids.inc | 7 +++++++ himbaechel/uarch/gatemate/pack.cc | 21 +++++++++++++++++++++ 2 files changed, 28 insertions(+) diff --git a/himbaechel/uarch/gatemate/constids.inc b/himbaechel/uarch/gatemate/constids.inc index 930033d0..995a922f 100644 --- a/himbaechel/uarch/gatemate/constids.inc +++ b/himbaechel/uarch/gatemate/constids.inc @@ -109,3 +109,10 @@ X(INIT_L30) X(O1) X(O2) + +X(CC_DFF) +X(Q) +X(D) +X(R) +X(S) +X(FF_INIT) diff --git a/himbaechel/uarch/gatemate/pack.cc b/himbaechel/uarch/gatemate/pack.cc index 90cdc432..e4c52251 100644 --- a/himbaechel/uarch/gatemate/pack.cc +++ b/himbaechel/uarch/gatemate/pack.cc @@ -315,6 +315,27 @@ void GateMatePacker::pack_cpe() } ci.type = id_CPE; } + + for (auto &cell : ctx->cells) { + CellInfo &ci = *cell.second; + if (!ci.type.in(id_CC_DFF)) + continue; + ci.renamePort(id_D, id_IN1); + ci.renamePort(id_Q, id_OUT1); + ci.disconnectPort(id_EN); + ci.disconnectPort(id_SR); + ci.params[id_O1] = Property(0b11, 2); + ci.params[id_INIT_L20] = Property(0b1010, 4); + ci.params[id_INIT_L00] = Property(0b1010, 4); + ci.params[id_INIT_L10] = Property(0b1010, 4); + + ci.params[id_EN] = Property(0b11, 2); + ci.params[id_R] = Property(0b11, 2); + ci.params[id_S] = Property(0b11, 2); + ci.params[id_FF_INIT] = Property(0b10, 2); + ci.type = id_CPE; + } + } void GateMatePacker::pack_constants()