aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan Ravensloft <dan.ravensloft@gmail.com>2021-01-06 18:07:59 +0000
committergatecat <gatecat@ds0.me>2021-05-15 14:54:33 +0100
commit189164e7c8a862aad7b7a2b57e1ad3b729f47775 (patch)
treea00e867827dbc394e6482697ffe8075488f18e60
parentb8f58d558c3472280cb618343ddd8857c4073d20 (diff)
downloadnextpnr-189164e7c8a862aad7b7a2b57e1ad3b729f47775.tar.gz
nextpnr-189164e7c8a862aad7b7a2b57e1ad3b729f47775.tar.bz2
nextpnr-189164e7c8a862aad7b7a2b57e1ad3b729f47775.zip
Resolve feedback
-rw-r--r--cyclonev/arch.cc6
-rw-r--r--cyclonev/arch.h6
-rw-r--r--cyclonev/archdefs.h2
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<BelPin> &getPipsDownhill(WireId wire) const;
- const std::vector<BelPin> &getPipsUphill(WireId wire) const;
- const std::vector<BelPin> &getWireAliases(WireId wire) const;
+ const std::vector<PipId> &getPipsDownhill(WireId wire) const;
+ const std::vector<PipId> &getPipsUphill(WireId wire) const;
+ const std::vector<PipId> &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<NEXTPNR_NAMESPACE_PREFIX BelId>
{
- std::size_t operator()(const NEXTPNR_NAMESPACE_PREFIX BelId &bel) const noexcept { return hash<int>()(bel.index); }
+ std::size_t operator()(const NEXTPNR_NAMESPACE_PREFIX BelId &bel) const noexcept { return hash<uint32_t>()((static_cast<uint32_t>(bel.pos) << 16) | bel.z); }
};
template <> struct hash<NEXTPNR_NAMESPACE_PREFIX WireId>