aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Shah <dave@ds0.me>2019-02-11 11:21:19 +0000
committerDavid Shah <davey1576@gmail.com>2019-02-24 10:28:25 +0100
commit5cfc7674c139f52826fd5f0267dfba691cd3351d (patch)
treef17743be85f716bcd617298d041587542dce6ef7
parent92a4a48f47fc544950201935db9532a970e2d5b8 (diff)
downloadnextpnr-5cfc7674c139f52826fd5f0267dfba691cd3351d.tar.gz
nextpnr-5cfc7674c139f52826fd5f0267dfba691cd3351d.tar.bz2
nextpnr-5cfc7674c139f52826fd5f0267dfba691cd3351d.zip
ecp5: Add DQS groupings to database
Signed-off-by: David Shah <dave@ds0.me>
-rw-r--r--ecp5/arch.h2
-rwxr-xr-xecp5/trellis_import.py17
2 files changed, 15 insertions, 4 deletions
diff --git a/ecp5/arch.h b/ecp5/arch.h
index 713c320e..61cc8283 100644
--- a/ecp5/arch.h
+++ b/ecp5/arch.h
@@ -103,7 +103,7 @@ NPNR_PACKED_STRUCT(struct PIOInfoPOD {
int32_t bel_index;
RelPtr<char> function_name;
int16_t bank;
- int16_t padding;
+ int16_t dqsgroup;
});
NPNR_PACKED_STRUCT(struct PackagePinPOD {
diff --git a/ecp5/trellis_import.py b/ecp5/trellis_import.py
index cdd3bd06..6acc32c5 100755
--- a/ecp5/trellis_import.py
+++ b/ecp5/trellis_import.py
@@ -119,9 +119,20 @@ def process_pio_db(ddrg, device):
pinfunc = metaitem["function"]
else:
pinfunc = None
+ dqs = -1
+ if "dqs" in metaitem:
+ tdqs = metaitem["dqs"]
+ if tdqs[0] == "L":
+ dqs = 0
+ elif tdqs[0] == "R":
+ dqs = 2048
+ suffix_size = 0
+ while tdqs[-(suffix_size+1)].isdigit():
+ suffix_size += 1
+ dqs |= int(tdqs[-suffix_size:])
bel_idx = get_bel_index(ddrg, loc, pio)
if bel_idx is not None:
- pindata.append((loc, bel_idx, bank, pinfunc))
+ pindata.append((loc, bel_idx, bank, pinfunc, dqs))
global_data = {}
quadrants = ["UL", "UR", "LL", "LR"]
@@ -360,7 +371,7 @@ def write_database(dev_name, chip, ddrg, endianness):
bba.l("pio_info", "PIOInfoPOD")
for pin in pindata:
- loc, bel_idx, bank, func = pin
+ loc, bel_idx, bank, func, dqs = pin
write_loc(loc, "abs_loc")
bba.u32(bel_idx, "bel_index")
if func is not None:
@@ -368,7 +379,7 @@ def write_database(dev_name, chip, ddrg, endianness):
else:
bba.r(None, "function_name")
bba.u16(bank, "bank")
- bba.u16(0, "padding")
+ bba.u16(dqs, "dqsgroup")
bba.l("tiletype_names", "RelPtr<char>")
for tt, idx in sorted(tiletype_names.items(), key=lambda x: x[1]):