aboutsummaryrefslogtreecommitdiffstats
path: root/python/functions.py
diff options
context:
space:
mode:
Diffstat (limited to 'python/functions.py')
-rw-r--r--python/functions.py23
1 files changed, 21 insertions, 2 deletions
diff --git a/python/functions.py b/python/functions.py
index 4f005456..8d2e2fb8 100644
--- a/python/functions.py
+++ b/python/functions.py
@@ -1,2 +1,21 @@
-def test_function():
- print("Hello World!")
+def get_drivers(wire):
+ wid = chip.getWireByName(wire)
+ assert not wid.nil(), "wire {} not found".format(wire)
+ bp = chip.getBelPinUphill(wid)
+ if not bp.bel.nil():
+ print("Bel pin: {}.{}".format(chip.getBelName(bp.bel), str(bp.pin)))
+ for pip in sorted(chip.getPipsUphill(wid), key=lambda x: x.index):
+ print("Pip: {}".format(chip.getWireName(chip.getPipSrcWire(pip))))
+
+
+def get_loads(wire):
+ wid = chip.getWireByName(wire)
+ assert not wid.nil(), "wire {} not found".format(wire)
+ for bp in sorted(chip.getBelPinsDownhill(wid), key=lambda x: (x.bel.index, x.pin)):
+ print("Bel pin: {}.{}".format(chip.getBelName(bp.bel), str(bp.pin)))
+ for pip in sorted(chip.getPipsDownhill(wid), key=lambda x: x.index):
+ print("Pip: {}".format(chip.getWireName(chip.getPipDstWire(pip))))
+
+
+#get_drivers("12_14_lutff_7/in_3")
+#get_loads("12_14_lutff_global/clk")