From 1595c0726079e62313e0df82bdb31120b72bdc39 Mon Sep 17 00:00:00 2001 From: gatecat Date: Thu, 20 May 2021 14:54:23 +0100 Subject: router2: Add heatmap by routing resource type Signed-off-by: gatecat --- nexus/arch.cc | 11 +++++++++++ nexus/arch.h | 2 ++ nexus/constids.inc | 2 ++ 3 files changed, 15 insertions(+) (limited to 'nexus') diff --git a/nexus/arch.cc b/nexus/arch.cc index f804cdd9..d5bb9deb 100644 --- a/nexus/arch.cc +++ b/nexus/arch.cc @@ -325,6 +325,17 @@ std::vector> Arch::getWireAttrs(WireId wire) co return ret; } +IdString Arch::getWireType(WireId wire) const +{ + IdString basename(wire_data(wire).name); + const std::string &basename_str = basename.str(this); + // Interconnect - derive a type + if ((basename_str[0] == 'H' || basename_str[0] == 'V') && basename_str[1] == '0') + return id(basename_str.substr(0, 4)); + else + return id_GENERAL; +} + // ----------------------------------------------------------------------- PipId Arch::getPipByName(IdStringList name) const diff --git a/nexus/arch.h b/nexus/arch.h index 55e9becd..b3558413 100644 --- a/nexus/arch.h +++ b/nexus/arch.h @@ -1034,6 +1034,7 @@ struct Arch : BaseArch // ------------------------------------------------- WireId getWireByName(IdStringList name) const override; + IdStringList getWireName(WireId wire) const override { NPNR_ASSERT(wire != WireId()); @@ -1043,6 +1044,7 @@ struct Arch : BaseArch } std::vector> getWireAttrs(WireId wire) const override; + IdString getWireType(WireId wire) const override; DelayQuad getWireDelay(WireId wire) const override { return DelayQuad(0); } diff --git a/nexus/constids.inc b/nexus/constids.inc index 03b144a2..d75b6ea5 100644 --- a/nexus/constids.inc +++ b/nexus/constids.inc @@ -503,3 +503,5 @@ X(U2END2) X(U3END3) X(UED0THEN) X(URXCKINE) + +X(GENERAL) -- cgit v1.2.3