return res
def make_pad(res, dirn, name, suffix, cpup, iop):
- print ("make pad", dirn, name, suffix, cpup, iop)
cpud, iod = ('i', 'o') if dirn else ('o', 'i')
- res['%s_%s__core__%s' % (cpud, name, suffix)] = cpup
- res['%s_%s__pad__%s' % (iod, name, suffix)] = iop
+ cname = '%s_%s__core__%s' % (cpud, name, suffix)
+ pname = '%s_%s__pad__%s' % (iod, name, suffix)
+ print ("make pad", name, dirn, cpud, iod, cname, pname, suffix, cpup, iop)
+ res[cname], res[pname] = cpup, iop
def get_field(rec, name):
for f in rec.layout:
elif len(ps) == 2 and ps[-1].isdigit():
pin, idx = ps
idx = int(idx)
+ print ("ps split", pin, idx)
cpup = getattr(cpu, pin)[idx]
iop = getattr(io, pin)[idx]
elif pin.isdigit():
idx = int(pin)
+ print ("digit", idx)
cpup = cpu[idx]
iop = io[idx]
else:
elif iotype == IOType.In:
# input to the pad is routed through C4M JTAG and so
# is an *OUTPUT* into core. ls180soc connects this to "real" peripheral
- make_pad(res, False, name, "i", cpup, iop)
+ make_pad(res, True, name, "i", cpup, iop)
elif iotype == IOType.InTriOut:
if fn == 'gpio': # sigh decode GPIO special-case
oe_idx = 0
print ("gpio tri", fn, pin, iotype, pin_name, scan_idx, idx)
cpup, iop = get_field(cpu, "i")[idx], get_field(io, "i")[idx]
- make_pad(res, False, name, "i", cpup, iop)
+ make_pad(res, True, name, "i", cpup, iop)
cpup, iop = get_field(cpu, "o")[idx], get_field(io, "o")[idx]
make_pad(res, True, name, "o", cpup, iop)
cpup, iop = get_field(cpu, "oe")[oe_idx], get_field(io, "oe")[oe_idx]