woffs = scale*40#-width/2
hoffs = scale*40#-height/2
- nepads = bondmap['N'].keys()
+ nepads = list(bondmap['N'].keys())
nepads.sort()
- wepads = bondmap['W'].keys()
+ wepads = list(bondmap['W'].keys())
wepads.sort()
- eepads = bondmap['E'].keys()
+ eepads = list(bondmap['E'].keys())
eepads.sort()
- sepads = bondmap['S'].keys()
+ sepads = list(bondmap['S'].keys())
sepads.sort()
owoffs = woffs + (width/2) - len(nepads)/2 * outerscale
def map_name(pinmap, fn, fblower, pin, rename):
if not rename:
if pin[:-1].isdigit():
- print "map name digit", pin, fn, fblower
+ print ("map name digit", pin, fn, fblower)
if fn in ['PWM', 'EINT', 'VDD', 'VSS']:
return fn.lower() + pin.lower()
if fn == 'GPIO':
pk = '%s%s_out' % (fblower, pin[:-1])
else:
pk = '%s_%s' % (fblower, pin[:-1])
- print "map name", pk, fblower, pinmap.has_key(pk)
- if not pinmap.has_key(pk):
+ print ("map name", pk, fblower, pk in pinmap)
+ if not pk in pinmap:
return pin.lower()
remapped = pinmap[pk]
uscore = remapped.find('_')
of.write("\n ")
count = 0
of.write("]\n")
- print " dict %s" % dname, a, n, pingroup
+ print (" dict %s" % dname, a, n, pingroup)
of.write("\n\n")
return res
fnidx = list(fns.keys())
fnidx.sort(key=fnsplit)
- print "python fnames", function_names
- print "python speckeys", pins.byspec.keys()
- print "python dict fns", dir(pins.gpio)
- print pins.gpio.pinfn('', '')
- print pins.pwm.pinfn('', '')
- print pins.sdmmc.pinfn('', '')
- print "by spec", pins.byspec
- print pinmap
+ print ("python fnames", function_names)
+ print ("python speckeys", pins.byspec.keys())
+ print ("python dict fns", dir(pins.gpio))
+ print (pins.gpio.pinfn('', ''))
+ print (pins.pwm.pinfn('', ''))
+ print (pins.sdmmc.pinfn('', ''))
+ print ("by spec", pins.byspec)
+ print (pinmap)
pd = python_pindict(of, {}, pins, function_names, 'pindict', False)
ld = python_pindict(of, pinmap, pins, function_names, 'litexdict', True)
- print "pd", pd
- print "ld", ld
+ print ("pd", pd)
+ print ("ld", ld)
# process results and create name map
litexmap = OrderedDict()
for k in pd.keys():
if k in ['eint', 'pwm', 'gpio', 'vdd', 'vss']: # sigh
lname = "%s_%s" % (k, lname)
litexmap[pname] = lname
- print "litexmap", litexmap
+ print ("litexmap", litexmap)
of.write("litexmap = {\n")
for k, v in litexmap.items():
of.write("\t'%s': '%s',\n" % (k, v))
of.write("# Pinmap for %s\n\n" % title)
- print "fn_idx", fnidx
- print "fns", fns
- print "fnspec", pins.fnspec.keys()
- print "required", required
+ print ("fn_idx", fnidx)
+ print ("fns", fns)
+ print ("fnspec", pins.fnspec.keys())
+ print ("required", required)
for name in required:
of.write("## %s\n\n" % name)
if descriptions and name in descriptions:
removedcount += 1
of.write("* %s %d %s%d/%d\n" % (fname, pin_, bank, pin, mux))
- print fns
+ print (fns)
if removedcount != count:
if fname is None:
- print "no match between required and available pins"
+ print ("no match between required and available pins")
else:
print ("not all found", name, removedcount, count, title, found,
fns[fname])
rev=False):
bank = offs[0]
pf = self.pinfn(suffix, bank)
- print "pf", suffix, bank, pf
+ print ("pf", suffix, bank, pf)
pingroup, gangedgroup, clock = pf
if clock:
self.pinouts.clocks[self.fname] = clock
if start and limit: # limit turns into an offset from start
limit = start + limit
sk = "%s:%s" % (self.fname, str(suffix))
- print "pingroup pre", sk, pingroup
+ print ("pingroup pre", sk, pingroup)
pingroup = pingroup[start:limit] # see comment in spec.pinfunctions
if rev:
# reverse order of pingroup
pingroup.reverse()
- print "pingroup post", sk, pingroup
- if self.pinouts.byspec.has_key(sk):
+ print ("pingroup post", sk, pingroup)
+ if sk in self.pinouts.byspec:
self.pinouts.byspec[sk] += pingroup
else:
self.pinouts.byspec[sk] = deepcopy(pingroup)
#ps.mquadspi("1", ('S', 0), 0)
- print "ps clocks", ps.clocks
+ print ("ps clocks", ps.clocks)
# Scenarios below can be spec'd out as either "find first interface"
# by name/number e.g. SPI1, or as "find in bank/mux" which must be
pinmap = {}
litexmap = {}
- print p.muxed_cells
- print p.muxed_cells_bank
+ print (p.muxed_cells)
+ print (p.muxed_cells_bank)
ps = [''] * 32
pn = [''] * 32
padnum = int(padnum)
start = p.bankstart[bank]
banknum = padnum - start
- print "bank", bank, banknum, "padname", name, padnum, x
+ print ("bank", bank, banknum, "padname", name, padnum, x)
padbank = pads[bank]
pad = None
# VSS
#name = 'p_sys_rst_1'
pad = [name, name, name]
padbank[banknum] = name
- print "sys_rst add", bank, banknum, name
+ print ("sys_rst add", bank, banknum, name)
name = None
elif name == 'sys_pllclk':
name = None # ignore
pad = [name, name2, name2]
#if name:
# iopads.append([pname, name, name])
- print "sys pad", name
+ print ("sys pad", name)
# SPI Card
elif name.startswith('mspi0') or name.startswith('mspi1'):
domain = 'MSPI'
fn, name = orig_name.split("_")
if domain == 'PWM':
name = fn[3:]
- print psp.byspec
+ print (psp.byspec)
spec = None
for k in psp.byspec.keys():
if k.startswith(domain):
spec = psp.byspec[k]
- print "spec found", domain, spec
+ print ("spec found", domain, spec)
assert spec is not None
found = None
for pname in spec:
if pname.lower().startswith(name):
found = pname
- print "found spec", found
+ print ("found spec", found)
assert found is not None
# whewwww. add the direction onto the pad spec list
dirn = found[-1]
iopads.append([name, name2, name2, "-"])
nc_idx += 1
- print p.bankstart
+ print (p.bankstart)
pprint(psp.clocks)
- print
- print "N pads", pn
- print "S pads", ps
- print "E pads", pe
- print "W pads", pw
+ print()
+ print ("N pads", pn)
+ print ("S pads", ps)
+ print ("E pads", pe)
+ print ("W pads", pw)
# do not want these
del clocks['SYS']
del domains['SYS']
- print "chip domains (excluding sys-default)"
+ print ("chip domains (excluding sys-default)")
pprint(domains)
- print "chip clocks (excluding sys-default)"
+ print ("chip clocks (excluding sys-default)")
pprint(clocks)
- print "pin spec"
+ print ("pin spec")
pprint(psp.byspec)
chip = {