from pprint import pprint
import json
-# map pins to litex name conventions, primarily for use in coriolis2
+# map pins to fabric name conventions, primarily for use in coriolis2
# yes this is a mess. it'll do the job though. improvements later
def pinparse(psp, pinspec):
p = Parse(pinspec, verify=False)
pinmap = {}
- litexmap = {}
+ fabricmap = {}
print ("muxed cells", p.muxed_cells)
print ("muxed cell banks", p.muxed_cells_bank)
name = clist[1]
x = clist[2]
orig_name = name
- litex_name = None
+ fabric_name = None
domain = None # TODO, get this from the PinSpec. sigh
padnum = int(padnum)
start = p.bankstart[bank]
prefix = 'spimaster_'
else:
prefix = 'spisdcard_'
- litex_name = name[:6] + suffix
+ fabric_name = name[:6] + suffix
name = prefix + suffix
pad = ['p_' + name, name, name]
# SD/MMC
else:
name = 'sdcard_' + name[4:]
pad = ['p_' + name, name, name]
- litex_name = orig_name[:4] + "_".join(name.split("_")[1:])
+ fabric_name = orig_name[:4] + "_".join(name.split("_")[1:])
# SDRAM
elif name.startswith('sdr'):
domain = 'SDR'
else:
name = 'sdram_' + name[4:]
pad = ['p_' + name, name, name]
- litex_name = orig_name[:4] + "_".join(name.split("_")[1:])
+ fabric_name = orig_name[:4] + "_".join(name.split("_")[1:])
# UART
elif name.startswith('uart'):
domain = 'UART'
name2 = 'gpio_%%s(%s)' % i
pad = ['p_' + name, name, name2 % 'o', name2 % 'i', name2 % 'oe']
print ("GPIO pad", name, pad)
- litex_name = "gpio_%s" % gbank + "_".join(name.split("_")[1:])
+ fabric_name = "gpio_%s" % gbank + "_".join(name.split("_")[1:])
# I2C master-only
elif name.startswith('mtwi'):
domain = 'MTWI'
suffix = name[4:]
- litex_name = 'mtwi' + suffix
+ fabric_name = 'mtwi' + suffix
name = 'i2c' + suffix
if name.startswith('i2c_sda'):
name2 = 'i2c_sda_%s'
pad = ['p_' + name, name, name]
print ("GPIO pad", name, pad)
- if litex_name is None:
- litex_name = name
+ if fabric_name is None:
+ fabric_name = name
# JTAG domain
if name and name.startswith('jtag'):
clocks[domain] = name
# record remap
pinmap[orig_name] = name
- litexmap[litex_name] = name
+ fabricmap[fabric_name] = name
# add pad to iopads
if domain and pad is not None:
'pads.instances' : iopads,
'pins.specs' : psp.byspec,
'pins.map' : pinmap,
- 'litex.map' : litexmap,
+ 'fabric.map' : fabricmap,
'chip.domains' : domains,
'chip.clocks' : clocks,
'chip.n_intpower': n_intpower,
with open(pyname, "w") as pyf:
ps = module.pinspec()
pinout, bankspec, pin_spec, fixedpins = ps.write(of)
- #chip['litex.map'] = litexmap
+ #chip['fabric.map'] = fabricmap
if testing:
dummytest(ps, output_dir, output_type)
else:
bankspec, ps.muxwidths, pin_spec, fixedpins,
ps.fastbus)
pm, chip = jsoncreate.pinparse(ps, pinspec)
- litexmap = ps.pywrite(pyf, pm)
+ fabricmap = ps.pywrite(pyf, pm)
jchip = json.dumps(chip)
- with open("%s/litex_pinpads.json" % pinspec, "w") as f:
+ with open("%s/fabric_pinpads.json" % pinspec, "w") as f:
f.write(jchip)
# octavius: please keep line-lengths to below 80 chars
# TODO: fix create_sv to allow different packages
print (pinmap)
pd = python_pindict(of, {}, pins, function_names, 'pindict', False)
- ld = python_pindict(of, pinmap, pins, function_names, 'litexdict', True)
+ ld = python_pindict(of, pinmap, pins, function_names, 'fabricdict', True)
print ("pd", pd)
print ("ld", ld)
# process results and create name map
- litexmap = OrderedDict()
+ fabricmap = OrderedDict()
for k in pd.keys():
pl = pd[k]
ll = ld[k]
lname = lname[:-1] # strip direction +/-/*
if k in ['eint', 'pwm', 'gpio', 'vdd', 'vss']: # sigh
lname = "%s_%s" % (k, lname)
- litexmap[pname] = lname
- print ("litexmap", litexmap)
- of.write("litexmap = {\n")
- for k, v in litexmap.items():
+ fabricmap[pname] = lname
+ print ("fabricmap", fabricmap)
+ of.write("fabricmap = {\n")
+ for k, v in fabricmap.items():
of.write("\t'%s': '%s',\n" % (k, v))
of.write("}\n")
- return litexmap
+ return fabricmap
def display_fns(of, bankspec, pins, function_names):
ps.vdd("E", ('N', 7), 0, 6, 1)
ps.vdd("I", ('N', 8), 0, 6, 1)
ps.vss("I", ('N', 9), 0, 6, 1)
- #ps.pwm("", ('N', 2), 0, 0, 2) comment out (litex problem 25mar2021)
- #ps.mspi("1", ('N', 7), 0) comment out (litex problem 25mar2021)
- #ps.sdmmc("0", ('N', 11), 0) # comment out (litex problem 25mar2021)
+ #ps.pwm("", ('N', 2), 0, 0, 2) comment out (fabric problem 25mar2021)
+ #ps.mspi("1", ('N', 7), 0) comment out (fabric problem 25mar2021)
+ #ps.sdmmc("0", ('N', 11), 0) # comment out (fabric problem 25mar2021)
ps.sys("", ('N', 27), 0, 0, 5) # all but analog out in top right
ps.vss("I", ('N', 22), 0, 7, 1)
ps.vdd("I", ('N', 23), 0, 7, 1)
# lists (interfaces, EINTs, PWMs) from available pins.
ls180 = [
- # 'SD0', litex problem 25mar2021
+ # 'SD0', fabric problem 25mar2021
'UART0', 'GPIOS', 'GPIOE', 'JTAG', 'PWM', 'EINT',
'VDD', 'VSS', 'SYS',
'MTWI', 'MSPI0',
- # 'MSPI1', litex problem 25mar2021
+ # 'MSPI1', fabric problem 25mar2021
'SDR']
ls180_eint = []
ls180_pwm = []#['B0:PWM_0']
ps.vss("I", ('N', 9), 0, 6, 1)
ps.gpio("", ('N', 10), 0, 6, 12) # GPIO 4-17
ps.rgmii("0", ('N', 10), 1, 6, 12) # more RGMII-1
- #ps.pwm("", ('N', 2), 0, 0, 2) comment out (litex problem 25mar2021)
- #ps.mspi("1", ('N', 7), 0) comment out (litex problem 25mar2021)
- #ps.sdmmc("0", ('N', 11), 0) # comment out (litex problem 25mar2021)
ps.sys("", ('N', 27), 0, 0, 5) # all but analog out in top right
ps.vss("I", ('N', 23), 0, 7, 1)
ps.vdd("I", ('N', 24), 0, 7, 1)
# lists (interfaces, EINTs, PWMs) from available pins.
ls180 = [
- # 'SD0', litex problem 25mar2021
'UART0', 'JTAG', 'PWM', 'EINT',
'VDD', 'VSS', 'SYS',
'MTWI', 'MSPI0',
'RG0', 'RG1',
- # 'MSPI1', litex problem 25mar2021
'SDR']
ls180_eint = []
ls180_pwm = []#['B0:PWM_0']