aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Shah <dave@ds0.me>2018-11-15 11:54:28 +0000
committerDavid Shah <dave@ds0.me>2018-11-15 11:54:28 +0000
commit7e1df8246241148acbe8a5bd74d588d9b493807a (patch)
tree204eb456194e39914b6c3c9f78aae946d92af7f5
parent91a09271965cf9652fd823d6df59051f35e0213d (diff)
downloadnextpnr-7e1df8246241148acbe8a5bd74d588d9b493807a.tar.gz
nextpnr-7e1df8246241148acbe8a5bd74d588d9b493807a.tar.bz2
nextpnr-7e1df8246241148acbe8a5bd74d588d9b493807a.zip
ecp5: Regression fix & format
Signed-off-by: David Shah <dave@ds0.me>
-rw-r--r--ecp5/archdefs.h15
-rw-r--r--ecp5/bitstream.cc3
2 files changed, 14 insertions, 4 deletions
diff --git a/ecp5/archdefs.h b/ecp5/archdefs.h
index 01cbad46..b2c23134 100644
--- a/ecp5/archdefs.h
+++ b/ecp5/archdefs.h
@@ -87,7 +87,10 @@ struct BelId
bool operator==(const BelId &other) const { return index == other.index && location == other.location; }
bool operator!=(const BelId &other) const { return index != other.index || location != other.location; }
- bool operator<(const BelId &other) const { return location == other.location ? index < other.index : location < other.location; }
+ bool operator<(const BelId &other) const
+ {
+ return location == other.location ? index < other.index : location < other.location;
+ }
};
struct WireId
@@ -97,7 +100,10 @@ struct WireId
bool operator==(const WireId &other) const { return index == other.index && location == other.location; }
bool operator!=(const WireId &other) const { return index != other.index || location != other.location; }
- bool operator<(const WireId &other) const { return location == other.location ? index < other.index : location < other.location; }
+ bool operator<(const WireId &other) const
+ {
+ return location == other.location ? index < other.index : location < other.location;
+ }
};
struct PipId
@@ -107,7 +113,10 @@ struct PipId
bool operator==(const PipId &other) const { return index == other.index && location == other.location; }
bool operator!=(const PipId &other) const { return index != other.index || location != other.location; }
- bool operator<(const PipId &other) const { return location == other.location ? index < other.index : location < other.location; }
+ bool operator<(const PipId &other) const
+ {
+ return location == other.location ? index < other.index : location < other.location;
+ }
};
struct GroupId
diff --git a/ecp5/bitstream.cc b/ecp5/bitstream.cc
index 5af051c7..b19bd1c6 100644
--- a/ecp5/bitstream.cc
+++ b/ecp5/bitstream.cc
@@ -426,7 +426,8 @@ void fix_tile_names(Context *ctx, ChipConfig &cc)
auto cibdcu = tile.first.find("CIB_DCU");
if (cibdcu != std::string::npos) {
// Add the V
- newname.insert(cibdcu, 1, 'V');
+ if (newname.at(cibdcu - 1) != 'V')
+ newname.insert(cibdcu, 1, 'V');
tiletype_xform[tile.first] = newname;
} else if (tile.first.substr(tile.first.size() - 7) == "BMID_0H") {
newname.back() = 'V';