From 189164e7c8a862aad7b7a2b57e1ad3b729f47775 Mon Sep 17 00:00:00 2001 From: Dan Ravensloft Date: Wed, 6 Jan 2021 18:07:59 +0000 Subject: Resolve feedback --- cyclonev/arch.cc | 6 +++--- cyclonev/arch.h | 6 +++--- cyclonev/archdefs.h | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/cyclonev/arch.cc b/cyclonev/arch.cc index 41c39876..f5dd35eb 100644 --- a/cyclonev/arch.cc +++ b/cyclonev/arch.cc @@ -24,7 +24,7 @@ NEXTPNR_NAMESPACE_BEGIN -using mistral::CycloneV; +using namespace mistral; Arch::Arch(ArchArgs args) { @@ -66,7 +66,7 @@ BelId Arch::getBelByName(IdString name) const int x = 0, y = 0, z = 0; BelId bel; - sscanf(name.c_str(this), "%s.%d.%d.%d", bel_type_str, &x, &y, &z); + sscanf(name.c_str(this), "%25s.%d.%d.%d", bel_type_str, &x, &y, &z); auto bel_type = cyclonev->block_type_lookup(std::string{bel_type_str}); @@ -82,7 +82,7 @@ IdString Arch::getBelName(BelId bel) const int x = CycloneV::pos2x(bel.pos); int y = CycloneV::pos2y(bel.pos); - int z = bel.pos & 0xFF; + int z = bel.z & 0xFF; int bel_type = bel.z >> 8; snprintf(bel_str, 80, "%s.%03d.%03d.%03d", cyclonev->block_type_names[bel_type], x, y, z); diff --git a/cyclonev/arch.h b/cyclonev/arch.h index 5ad13b51..cdf41f39 100644 --- a/cyclonev/arch.h +++ b/cyclonev/arch.h @@ -107,9 +107,9 @@ struct Arch : BaseCtx WireId getPipSrcWire(PipId pip) const; WireId getPipDstWire(PipId pip) const; DelayInfo getPipDelay(PipId pip) const; - const std::vector &getPipsDownhill(WireId wire) const; - const std::vector &getPipsUphill(WireId wire) const; - const std::vector &getWireAliases(WireId wire) const; + const std::vector &getPipsDownhill(WireId wire) const; + const std::vector &getPipsUphill(WireId wire) const; + const std::vector &getWireAliases(WireId wire) const; BelId getPackagePinBel(const std::string &pin) const; std::string getBelPackagePin(BelId bel) const; diff --git a/cyclonev/archdefs.h b/cyclonev/archdefs.h index a108bd6a..c522a83f 100644 --- a/cyclonev/archdefs.h +++ b/cyclonev/archdefs.h @@ -119,7 +119,7 @@ NEXTPNR_NAMESPACE_END namespace std { template <> struct hash { - std::size_t operator()(const NEXTPNR_NAMESPACE_PREFIX BelId &bel) const noexcept { return hash()(bel.index); } + std::size_t operator()(const NEXTPNR_NAMESPACE_PREFIX BelId &bel) const noexcept { return hash()((static_cast(bel.pos) << 16) | bel.z); } }; template <> struct hash -- cgit v1.2.3