diff options
author | David Shah <davey1576@gmail.com> | 2018-08-07 15:12:55 +0200 |
---|---|---|
committer | David Shah <davey1576@gmail.com> | 2018-09-29 16:09:21 +0100 |
commit | 24414614d2896b6cbb62457e90f5d997d9a1d32a (patch) | |
tree | a1f56bc5f1c3407d595d6c854ec24e70c43b7793 | |
parent | dfdaaa6f57a0a9f87878491a24b659e94aaec5fd (diff) | |
download | nextpnr-24414614d2896b6cbb62457e90f5d997d9a1d32a.tar.gz nextpnr-24414614d2896b6cbb62457e90f5d997d9a1d32a.tar.bz2 nextpnr-24414614d2896b6cbb62457e90f5d997d9a1d32a.zip |
ecp5: Import SPINE data to database
Signed-off-by: David Shah <davey1576@gmail.com>
-rw-r--r-- | ecp5/arch.h | 2 | ||||
-rwxr-xr-x | ecp5/trellis_import.py | 9 |
2 files changed, 10 insertions, 1 deletions
diff --git a/ecp5/arch.h b/ecp5/arch.h index 1908f122..bbab3918 100644 --- a/ecp5/arch.h +++ b/ecp5/arch.h @@ -147,6 +147,8 @@ NPNR_PACKED_STRUCT(struct GlobalInfoPOD { int16_t tap_col; TapDirection tap_dir; GlobalQuadrant quad; + int16_t spine_row; + int16_t spine_col; }); NPNR_PACKED_STRUCT(struct ChipInfoPOD { diff --git a/ecp5/trellis_import.py b/ecp5/trellis_import.py index de8e9958..9a26b605 100755 --- a/ecp5/trellis_import.py +++ b/ecp5/trellis_import.py @@ -128,7 +128,12 @@ def process_loc_globals(chip): for x in range(0, max_col+1): quad = chip.global_data.get_quadrant(y, x) tapdrv = chip.global_data.get_tap_driver(y, x) - global_data[x, y] = (quadrants.index(quad), int(tapdrv.dir), tapdrv.col) + if tapdrv.col == x: + spinedrv = chip.global_data.get_spine_driver(quad, x) + spine = (spinedrv.second, spinedrv.first) + else: + spine = (-1, -1) + global_data[x, y] = (quadrants.index(quad), int(tapdrv.dir), tapdrv.col, spine) def get_wire_type(name): if "H00" in name or "V00" in name: @@ -282,6 +287,8 @@ def write_database(dev_name, chip, ddrg, endianness): bba.u16(global_data[x, y][2], "tap_col") bba.u8(global_data[x, y][1], "tap_dir") bba.u8(global_data[x, y][0], "quad") + bba.u16(global_data[x, y][3][1], "spine_row") + bba.u16(global_data[x, y][3][0], "spine_col") for package, pkgdata in sorted(packages.items()): bba.l("package_data_%s" % package, "PackagePinPOD") |