ecp5: Fix TQFP144 package import

Signed-off-by: gatecat <gatecat@ds0.me>
This commit is contained in:
gatecat 2023-08-17 11:42:29 +02:00 committed by myrtle
parent 053d89570f
commit 88714c54ec

View File

@ -242,11 +242,15 @@ def get_bel_index(ddrg, loc, name):
packages = {} packages = {}
pindata = [] pindata = []
def process_pio_db(ddrg, device): def process_pio_db(ddrg, device, package_filter=None):
piofile = path.join(database.get_db_root(), "ECP5", dev_names[device], "iodb.json") piofile = path.join(database.get_db_root(), "ECP5", device, "iodb.json")
with open(piofile, 'r') as f: with open(piofile, 'r') as f:
piodb = json.load(f) piodb = json.load(f)
for pkgname, pkgdata in sorted(piodb["packages"].items()): for pkgname, pkgdata in sorted(piodb["packages"].items()):
if package_filter is not None and pkgname not in package_filter:
# we need to get the TQ144 package only out of the non-SERDES device
# everything else comes from the SERDES device
continue
pins = [] pins = []
for name, pinloc in sorted(pkgdata.items()): for name, pinloc in sorted(pkgdata.items()):
x = pinloc["col"] x = pinloc["col"]
@ -257,6 +261,7 @@ def process_pio_db(ddrg, device):
if bel_idx is not None: if bel_idx is not None:
pins.append((name, loc, bel_idx)) pins.append((name, loc, bel_idx))
packages[pkgname] = pins packages[pkgname] = pins
if package_filter is None:
for metaitem in piodb["pio_metadata"]: for metaitem in piodb["pio_metadata"]:
x = metaitem["col"] x = metaitem["col"]
y = metaitem["row"] y = metaitem["row"]
@ -690,7 +695,10 @@ def main():
max_row = chip.get_max_row() max_row = chip.get_max_row()
max_col = chip.get_max_col() max_col = chip.get_max_col()
process_timing_data() process_timing_data()
process_pio_db(ddrg, args.device) process_pio_db(ddrg, dev_names[args.device])
# add TQFP144 package from non-SERDES device if appropriate
if args.device == "25k": process_pio_db(ddrg, "LFE5U-25F", {"TQFP144", })
if args.device == "45k": process_pio_db(ddrg, "LFE5U-45F", {"TQFP144", })
process_loc_globals(chip) process_loc_globals(chip)
# print("{} unique location types".format(len(ddrg.locationTypes))) # print("{} unique location types".format(len(ddrg.locationTypes)))
bba = write_database(args.device, chip, ddrg, "le") bba = write_database(args.device, chip, ddrg, "le")