From 417913fd8509a44edf8421184c46d15d6763908b Mon Sep 17 00:00:00 2001 From: David Shah Date: Sun, 8 Jul 2018 13:29:13 +0200 Subject: ecp5: Architecture fixes Signed-off-by: David Shah --- ecp5/arch.h | 4 ++++ ecp5/trellis_import.py | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/ecp5/arch.h b/ecp5/arch.h index b9cedd2c..029caef0 100644 --- a/ecp5/arch.h +++ b/ecp5/arch.h @@ -672,7 +672,9 @@ struct Arch : BaseCtx PipRange range; NPNR_ASSERT(wire != WireId()); range.b.cursor = locInfo(wire)->wire_data[wire.index].pips_downhill.get(); + range.b.wire_loc = wire.location; range.e.cursor = range.b.cursor + locInfo(wire)->wire_data[wire.index].num_downhill; + range.e.wire_loc = wire.location; return range; } @@ -681,7 +683,9 @@ struct Arch : BaseCtx PipRange range; NPNR_ASSERT(wire != WireId()); range.b.cursor = locInfo(wire)->wire_data[wire.index].pips_uphill.get(); + range.b.wire_loc = wire.location; range.e.cursor = range.b.cursor + locInfo(wire)->wire_data[wire.index].num_uphill; + range.e.wire_loc = wire.location; return range; } diff --git a/ecp5/trellis_import.py b/ecp5/trellis_import.py index aabcffb1..62aa4d81 100755 --- a/ecp5/trellis_import.py +++ b/ecp5/trellis_import.py @@ -297,7 +297,7 @@ class BinaryBlobAssembler: assert len(self.data) % 2 == 0 if self.nodebug: comment = None - c2val = (~v + 1) if v < 0 else v + c2val = (((-v) ^ 0xffff) + 1) if v < 0 else v if self.endianness == "le": self.data.append(c2val & 255) self.data.append((c2val >> 8) & 255) -- cgit v1.2.3