From 987fdc1b29d9cb7478df49c72f68ce5f3f9f740c Mon Sep 17 00:00:00 2001 From: David Shah Date: Sun, 22 Jul 2018 17:07:38 +0200 Subject: ecp5: Adding new Bel pin API Signed-off-by: David Shah --- ecp5/trellis_import.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'ecp5/trellis_import.py') diff --git a/ecp5/trellis_import.py b/ecp5/trellis_import.py index af5386e7..b0cbdd90 100755 --- a/ecp5/trellis_import.py +++ b/ecp5/trellis_import.py @@ -407,6 +407,12 @@ def write_database(dev_name, ddrg, endianness): write_loc(db.bel.rel, "rel_bel_loc") bba.u32(db.bel.id, "bel_index") bba.u32(portpins[ddrg.to_str(db.pin)], "port") + if len(wire.belPins) > 0: + bba.l("loc%d_wire%d_belpins" % (idx, wire_idx), "BelPortPOD") + for bp in wire.belPins: + write_loc(bp.bel.rel, "rel_bel_loc") + bba.u32(bp.bel.id, "bel_index") + bba.u32(portpins[ddrg.to_str(bp.pin)], "port") bba.l("loc%d_wires" % idx, "WireInfoPOD") for wire_idx in range(len(loctype.wires)): wire = loctype.wires[wire_idx] @@ -424,14 +430,18 @@ def write_database(dev_name, ddrg, endianness): bba.u32(0xFFFFFFFF, "bel_uphill.bel_index") bba.u32(0, "bel_uphill.port") bba.r("loc%d_wire%d_downbels" % (idx, wire_idx) if len(wire.belsDownhill) > 0 else None, "bels_downhill") + bba.u32(len(wire.belPins), "num_bel_pins") + bba.r("loc%d_wire%d_belpins" % (idx, wire_idx) if len(wire.belPins) > 0 else None, "bel_pins") + if len(loctype.bels) > 0: for bel_idx in range(len(loctype.bels)): bel = loctype.bels[bel_idx] - bba.l("loc%d_bel%d_wires" % (idx, bel_idx), "BelPortPOD") + bba.l("loc%d_bel%d_wires" % (idx, bel_idx), "BelWirePOD") for pin in bel.wires: write_loc(pin.wire.rel, "rel_wire_loc") bba.u32(pin.wire.id, "wire_index") bba.u32(portpins[ddrg.to_str(pin.pin)], "port") + bba.u32(int(pin.dir), "dir") bba.l("loc%d_bels" % idx, "BelInfoPOD") for bel_idx in range(len(loctype.bels)): bel = loctype.bels[bel_idx] -- cgit v1.2.3 From d0ed23d673013b4fc44f5e938bc74103d1268c13 Mon Sep 17 00:00:00 2001 From: David Shah Date: Mon, 23 Jul 2018 10:32:42 +0200 Subject: ecp5: Remove obsolete db entries, add Bel z-position Signed-off-by: David Shah --- ecp5/trellis_import.py | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) (limited to 'ecp5/trellis_import.py') diff --git a/ecp5/trellis_import.py b/ecp5/trellis_import.py index b0cbdd90..b5cd53f1 100755 --- a/ecp5/trellis_import.py +++ b/ecp5/trellis_import.py @@ -401,12 +401,6 @@ def write_database(dev_name, ddrg, endianness): for up in wire.arcsUphill: write_loc(up.rel, "rel_loc") bba.u32(up.id, "index") - if len(wire.belsDownhill) > 0: - bba.l("loc%d_wire%d_downbels" % (idx, wire_idx), "BelPortPOD") - for db in wire.belsDownhill: - write_loc(db.bel.rel, "rel_bel_loc") - bba.u32(db.bel.id, "bel_index") - bba.u32(portpins[ddrg.to_str(db.pin)], "port") if len(wire.belPins) > 0: bba.l("loc%d_wire%d_belpins" % (idx, wire_idx), "BelPortPOD") for bp in wire.belPins: @@ -421,15 +415,6 @@ def write_database(dev_name, ddrg, endianness): bba.u32(len(wire.arcsDownhill), "num_downhill") bba.r("loc%d_wire%d_uppips" % (idx, wire_idx) if len(wire.arcsUphill) > 0 else None, "pips_uphill") bba.r("loc%d_wire%d_downpips" % (idx, wire_idx) if len(wire.arcsDownhill) > 0 else None, "pips_downhill") - bba.u32(len(wire.belsDownhill), "num_bels_downhill") - write_loc(wire.belUphill.bel.rel, "uphill_bel_loc") - if wire.belUphill.pin != -1: - bba.u32(wire.belUphill.bel.id, "uphill_bel_idx") - bba.u32(portpins[ddrg.to_str(wire.belUphill.pin)], "uphill_bel_pin") - else: - bba.u32(0xFFFFFFFF, "bel_uphill.bel_index") - bba.u32(0, "bel_uphill.port") - bba.r("loc%d_wire%d_downbels" % (idx, wire_idx) if len(wire.belsDownhill) > 0 else None, "bels_downhill") bba.u32(len(wire.belPins), "num_bel_pins") bba.r("loc%d_wire%d_belpins" % (idx, wire_idx) if len(wire.belPins) > 0 else None, "bel_pins") @@ -447,6 +432,7 @@ def write_database(dev_name, ddrg, endianness): bel = loctype.bels[bel_idx] bba.s(ddrg.to_str(bel.name), "name") bba.u32(bel_types[ddrg.to_str(bel.type)], "type") + bba.u32(bel.z, "z") bba.u32(len(bel.wires), "num_bel_wires") bba.r("loc%d_bel%d_wires" % (idx, bel_idx), "bel_wires") -- cgit v1.2.3