aboutsummaryrefslogtreecommitdiffstats
path: root/machxo2
diff options
context:
space:
mode:
authorWilliam D. Jones <thor0505@comcast.net>2021-01-30 12:39:57 -0500
committergatecat <gatecat@ds0.me>2021-02-12 10:36:59 +0000
commite1f72318e0b126de119cbc5e7f7b143e7beadd09 (patch)
treecea0468a80fa6271913e3a7e108cd02a08004cb2 /machxo2
parent447b3a060c791b926e954e8e36e63aba718fbeb6 (diff)
downloadnextpnr-e1f72318e0b126de119cbc5e7f7b143e7beadd09.tar.gz
nextpnr-e1f72318e0b126de119cbc5e7f7b143e7beadd09.tar.bz2
nextpnr-e1f72318e0b126de119cbc5e7f7b143e7beadd09.zip
machxo2: Tweak A-star parameters for acceptable performance.
Diffstat (limited to 'machxo2')
-rw-r--r--machxo2/arch.cc20
-rw-r--r--machxo2/arch.h9
2 files changed, 26 insertions, 3 deletions
diff --git a/machxo2/arch.cc b/machxo2/arch.cc
index 3410ec16..58c48044 100644
--- a/machxo2/arch.cc
+++ b/machxo2/arch.cc
@@ -365,9 +365,25 @@ const std::vector<GroupId> &Arch::getGroupGroups(GroupId group) const { return g
// ---------------------------------------------------------------
-delay_t Arch::estimateDelay(WireId src, WireId dst) const { return 0; }
+delay_t Arch::estimateDelay(WireId src, WireId dst) const
+{
+ // Taxicab distance multiplied by pipDelay (0.01) and fake wireDelay (0.01).
+ // TODO: This function will not work well for entrance to global routing,
+ // as the entrances are located physically far from the DCCAs.
+ return (abs(dst.location.x - src.location.x) + abs(dst.location.y - src.location.y)) * (0.01 + 0.01);
+}
+
+delay_t Arch::predictDelay(const NetInfo *net_info, const PortRef &sink) const
+{
+ BelId src = net_info->driver.cell->bel;
+ BelId dst = sink.cell->bel;
+
+ NPNR_ASSERT(src != BelId());
+ NPNR_ASSERT(dst != BelId());
-delay_t Arch::predictDelay(const NetInfo *net_info, const PortRef &sink) const { return 0; }
+ // TODO: Same deal applies here as with estimateDelay.
+ return (abs(dst.location.x - src.location.x) + abs(dst.location.y - src.location.y)) * (0.01 + 0.01);
+}
bool Arch::getBudgetOverride(const NetInfo *net_info, const PortRef &sink, delay_t &budget) const { return false; }
diff --git a/machxo2/arch.h b/machxo2/arch.h
index a438424f..8fdb63fc 100644
--- a/machxo2/arch.h
+++ b/machxo2/arch.h
@@ -850,7 +850,14 @@ struct Arch : BaseCtx
return wire;
}
- DelayInfo getPipDelay(PipId pip) const { return DelayInfo(); }
+ DelayInfo getPipDelay(PipId pip) const
+ {
+ DelayInfo delay;
+
+ delay.delay = 0.01;
+
+ return delay;
+ }
PipRange getPipsDownhill(WireId wire) const
{