aboutsummaryrefslogtreecommitdiffstats
path: root/ecp5/arch.cc
diff options
context:
space:
mode:
authorDavid Shah <davey1576@gmail.com>2018-07-08 14:24:32 +0200
committerDavid Shah <davey1576@gmail.com>2018-07-11 10:42:09 +0200
commit981522b10ead3b3c2cbc5f9f270b9fae9320395b (patch)
tree671e464cc927f421fc3e42d40726779e46c2e3c0 /ecp5/arch.cc
parent417913fd8509a44edf8421184c46d15d6763908b (diff)
downloadnextpnr-981522b10ead3b3c2cbc5f9f270b9fae9320395b.tar.gz
nextpnr-981522b10ead3b3c2cbc5f9f270b9fae9320395b.tar.bz2
nextpnr-981522b10ead3b3c2cbc5f9f270b9fae9320395b.zip
ecp5: Blinky example places and routes
Signed-off-by: David Shah <davey1576@gmail.com>
Diffstat (limited to 'ecp5/arch.cc')
-rw-r--r--ecp5/arch.cc8
1 files changed, 7 insertions, 1 deletions
diff --git a/ecp5/arch.cc b/ecp5/arch.cc
index e80ad829..d0dc63f0 100644
--- a/ecp5/arch.cc
+++ b/ecp5/arch.cc
@@ -218,11 +218,14 @@ WireId Arch::getWireByName(IdString name) const
for (int i = 0; i < loci->num_wires; i++) {
if (std::strcmp(loci->wire_data[i].name.get(), basename.c_str()) == 0) {
ret.index = i;
+ ret.location = loc;
break;
}
}
if (ret.index >= 0)
wire_by_name[name] = ret;
+ else
+ ret.location = Location();
return ret;
}
@@ -278,7 +281,10 @@ void Arch::estimatePosition(BelId bel, int &x, int &y, bool &gb) const
gb = false;
}
-delay_t Arch::estimateDelay(WireId src, WireId dst) const { return 1; }
+delay_t Arch::estimateDelay(WireId src, WireId dst) const
+{
+ return abs(src.location.x - dst.location.x) + abs(src.location.y - dst.location.y);
+}
// -----------------------------------------------------------------------