From 568b20252ff9fb10dc021210b6738426022b3f40 Mon Sep 17 00:00:00 2001 From: Maciej Kurc Date: Thu, 19 Dec 2019 13:05:41 +0100 Subject: [PATCH] Added dumping of PS7 pins grouped by direction to JSON file. Signed-off-by: Maciej Kurc --- minitests/ps7/xtra/Makefile | 1 + minitests/ps7/xtra/make_cell.py | 22 ++++++++++++++++++++++ 2 files changed, 23 insertions(+) diff --git a/minitests/ps7/xtra/Makefile b/minitests/ps7/xtra/Makefile index af9920e4..b9d99d3a 100644 --- a/minitests/ps7/xtra/Makefile +++ b/minitests/ps7/xtra/Makefile @@ -6,6 +6,7 @@ clean: rm -rf xtra.ok rm -rf ps7_sim.v rm -rf ps7_map.v + rm -rf ps7_pins.json rm -rf ps7.csv rm -rf *.xml rm -rf *.log diff --git a/minitests/ps7/xtra/make_cell.py b/minitests/ps7/xtra/make_cell.py index 32bf7753..307f2ef4 100644 --- a/minitests/ps7/xtra/make_cell.py +++ b/minitests/ps7/xtra/make_cell.py @@ -1,6 +1,7 @@ #!/usr/bin/env python3 import argparse import csv +import json import re from collections import defaultdict @@ -100,6 +101,27 @@ def main(): bus["class"] = cls + # ..................................................... + # Generate JSON with PS7 pins grouped by direction + + ps7_pins = {"input": [], "output": [], "inout": []} + for name in sorted(buses.keys()): + bus = buses[name] + + # Skip not relevant pins + if bus["class"] not in ["normal", "mio"]: + continue + + if bus["width"] > 1: + for i in range(bus["min"], bus["max"]+1): + pin_name = "{}{}".format(name, i) + ps7_pins[bus["direction"]].append(pin_name) + else: + ps7_pins[bus["direction"]].append(name) + + with open("ps7_pins.json", "w") as fp: + json.dump(ps7_pins, fp, sort_keys=True, indent=2) + # ..................................................... # Generate XML model pb_name = "PS7"