Browse Source

fix off-by-1 pin index when loading AOI and OAI cells

devel
Stefan Holst 3 years ago
parent
commit
775b13c694
  1. 4
      src/kyupy/techlib.py

4
src/kyupy/techlib.py

@ -30,8 +30,8 @@ class TechLib:
def pin_index(kind, pin): def pin_index(kind, pin):
"""Returns a pin list position for a given node kind and pin name.""" """Returns a pin list position for a given node kind and pin name."""
if kind[:3] in ('OAI', 'AOI'): if kind[:3] in ('OAI', 'AOI'):
if pin[0] == 'A': return int(pin[1]) if pin[0] == 'A': return int(pin[1]) - 1
if pin[0] == 'B': return int(pin[1]) + int(kind[4]) if pin[0] == 'B': return int(pin[1]) + int(kind[4]) - 1
for prefix, pins, index in [('HADD', ('B0', 'SO'), 1), for prefix, pins, index in [('HADD', ('B0', 'SO'), 1),
('MUX21', ('S', 'S0'), 2), ('MUX21', ('S', 'S0'), 2),
('MX2', ('S0',), 2), ('MX2', ('S0',), 2),

Loading…
Cancel
Save