aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorgatecat <gatecat@ds0.me>2023-02-23 15:36:28 +0100
committermyrtle <gatecat@ds0.me>2023-02-27 08:42:56 +0100
commit5d0aa7786173d698433c2b89634156e2c3928923 (patch)
tree0901c78e4860451c9d9a4fc69ea32ad02db61409
parent26fcf349ad9ef65e4f0758c7bb4a24d5a8b45bf7 (diff)
downloadnextpnr-5d0aa7786173d698433c2b89634156e2c3928923.tar.gz
nextpnr-5d0aa7786173d698433c2b89634156e2c3928923.tar.bz2
nextpnr-5d0aa7786173d698433c2b89634156e2c3928923.zip
fabulous: Add timing model for carries
Signed-off-by: gatecat <gatecat@ds0.me>
-rw-r--r--generic/viaduct/fabulous/fabulous.cc20
1 files changed, 20 insertions, 0 deletions
diff --git a/generic/viaduct/fabulous/fabulous.cc b/generic/viaduct/fabulous/fabulous.cc
index 3400be9a..f3d0878c 100644
--- a/generic/viaduct/fabulous/fabulous.cc
+++ b/generic/viaduct/fabulous/fabulous.cc
@@ -83,14 +83,21 @@ struct FabulousImpl : ViaductAPI
CellInfo *ci = cell.second.get();
if (ci->type == id_FABULOUS_LC) {
auto &lct = cell_tags.get(ci);
+ if (lct.comb.carry_used) {
+ ctx->addCellTimingDelay(ci->name, id_Ci, id_Co, 1.0);
+ }
if (lct.ff.ff_used) {
ctx->addCellTimingClock(ci->name, id_CLK);
for (unsigned i = 0; i < cfg.clb.lut_k; i++)
ctx->addCellTimingSetupHold(ci->name, ctx->idf("I%d", i), id_CLK, 2.5, 0.1);
ctx->addCellTimingClockToOut(ci->name, id_Q, id_CLK, 1.0);
+ if (bool_or_default(ci->params, id_I0MUX))
+ ctx->addCellTimingSetupHold(ci->name, id_Ci, id_CLK, 2.5, 0.1);
} else {
for (unsigned i = 0; i < cfg.clb.lut_k; i++)
ctx->addCellTimingDelay(ci->name, ctx->idf("I%d", i), id_O, 3.0);
+ if (bool_or_default(ci->params, id_I0MUX))
+ ctx->addCellTimingDelay(ci->name, id_Ci, id_O, 3.0);
}
} else if (ci->type == id_OutPass4_frame_config) {
for (unsigned i = 0; i < 4; i++)
@@ -610,6 +617,19 @@ struct FabulousImpl : ViaductAPI
return true;
}
}
+
+ delay_t predictDelay(BelId src_bel, IdString src_pin, BelId dst_bel, IdString dst_pin) const override
+ {
+ if (src_pin == id_Ci && dst_pin == id_Co)
+ return 0.5;
+
+ auto driver_loc = ctx->getBelLocation(src_bel);
+ auto sink_loc = ctx->getBelLocation(dst_bel);
+
+ int dx = abs(sink_loc.x - driver_loc.x);
+ int dy = abs(sink_loc.y - driver_loc.y);
+ return (dx + dy) * ctx->args.delayScale + ctx->args.delayOffset;
+ }
};
struct FabulousArch : ViaductArch