diff options
Diffstat (limited to 'ecp5')
-rw-r--r-- | ecp5/arch.h | 4 | ||||
-rwxr-xr-x | ecp5/trellis_import.py | 2 |
2 files changed, 5 insertions, 1 deletions
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) |