aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--common/timing.cc8
-rw-r--r--ecp5/arch.cc5
-rw-r--r--ecp5/arch.h1
-rw-r--r--generic/arch.cc5
-rw-r--r--generic/arch.h1
-rw-r--r--ice40/arch.cc6
-rw-r--r--ice40/arch.h1
7 files changed, 21 insertions, 6 deletions
diff --git a/common/timing.cc b/common/timing.cc
index 6b4a8b64..9723550b 100644
--- a/common/timing.cc
+++ b/common/timing.cc
@@ -215,12 +215,8 @@ void update_budget(Context *ctx)
auto pi = &user.cell->ports.at(user.port);
auto it = updates.find(pi);
if (it == updates.end()) continue;
- user.budget = delays.at(pi) + it->second;
-
- // HACK HACK HACK
- if (net.second->driver.port == ctx->id("COUT"))
- user.budget = 0;
- // HACK HACK HACK
+ auto budget = delays.at(pi) + it->second;
+ user.budget = ctx->getBudgetOverride(net.second->driver, budget);
// Post-update check
if (ctx->verbose) {
diff --git a/ecp5/arch.cc b/ecp5/arch.cc
index 1510a27f..90f88384 100644
--- a/ecp5/arch.cc
+++ b/ecp5/arch.cc
@@ -328,6 +328,11 @@ delay_t Arch::estimateDelay(WireId src, WireId dst) const
return abs(src.location.x - dst.location.x) + abs(src.location.y - dst.location.y);
}
+delay_t Arch::getBudgetOverride(const PortRef& pr, delay_t v) const
+{
+ return v;
+}
+
// -----------------------------------------------------------------------
bool Arch::place() { return placer1(getCtx()); }
diff --git a/ecp5/arch.h b/ecp5/arch.h
index bf36ef2f..ec98d029 100644
--- a/ecp5/arch.h
+++ b/ecp5/arch.h
@@ -757,6 +757,7 @@ struct Arch : BaseCtx
delay_t getRipupDelayPenalty() const { return 200; }
float getDelayNS(delay_t v) const { return v * 0.001; }
uint32_t getDelayChecksum(delay_t v) const { return v; }
+ delay_t getBudgetOverride(const PortRef& pr, delay_t v) const;
// -------------------------------------------------
diff --git a/generic/arch.cc b/generic/arch.cc
index b7ec847e..b9ec1695 100644
--- a/generic/arch.cc
+++ b/generic/arch.cc
@@ -372,6 +372,11 @@ delay_t Arch::estimateDelay(WireId src, WireId dst) const
return (dx + dy) * grid_distance_to_delay;
}
+delay_t Arch::getBudgetOverride(const PortRef& pr, delay_t v) const
+{
+ return v;
+}
+
// ---------------------------------------------------------------
bool Arch::place() { return placer1(getCtx()); }
diff --git a/generic/arch.h b/generic/arch.h
index e1516569..977cc4d5 100644
--- a/generic/arch.h
+++ b/generic/arch.h
@@ -190,6 +190,7 @@ struct Arch : BaseCtx
delay_t getRipupDelayPenalty() const { return 1.0; }
float getDelayNS(delay_t v) const { return v; }
uint32_t getDelayChecksum(delay_t v) const { return 0; }
+ delay_t getBudgetOverride(const PortRef& pr, delay_t v) const;
bool pack() { return true; }
bool place();
diff --git a/ice40/arch.cc b/ice40/arch.cc
index e9a7d2b6..fa0fd153 100644
--- a/ice40/arch.cc
+++ b/ice40/arch.cc
@@ -488,6 +488,12 @@ delay_t Arch::estimateDelay(WireId src, WireId dst) const
return xscale * abs(xd) + yscale * abs(yd) + offset;
}
+delay_t Arch::getBudgetOverride(const PortRef& pr, delay_t v) const
+{
+ if (pr.port == id("COUT")) return 0;
+ return v;
+}
+
// -----------------------------------------------------------------------
bool Arch::place() { return placer1(getCtx()); }
diff --git a/ice40/arch.h b/ice40/arch.h
index 21169298..1349365c 100644
--- a/ice40/arch.h
+++ b/ice40/arch.h
@@ -701,6 +701,7 @@ struct Arch : BaseCtx
delay_t getRipupDelayPenalty() const { return 200; }
float getDelayNS(delay_t v) const { return v * 0.001; }
uint32_t getDelayChecksum(delay_t v) const { return v; }
+ delay_t getBudgetOverride(const PortRef& pr, delay_t v) const;
// -------------------------------------------------