def slowifdeclmux(self, name, count):
return ''
- def slowifinstance(self, name, count):
- return ''
-
def slowimport(self):
return ''
def mk_ext_ifacedef(self, iname, inum):
return ''
+ def extifinstance(self, name, count):
+ sname = self.peripheral.iname().format(count)
+ pname = self.get_iname(count)
+ template = " interface {0} = pinmux.peripheral_side.{1};"
+ return template.format(pname, sname)
+
+
mkplic_rule = """\
rule rl_connect_{0}_to_plic_{2};
self.slow = slow(ifacename)
self.slow.peripheral = self
for fname in ['slowimport',
- 'slowifinstance', 'slowifdecl', 'slowifdeclmux',
+ 'extifinstance', 'slowifdecl', 'slowifdeclmux',
'mkslow_peripheral', 'mk_plic', 'mk_ext_ifacedef',
'mk_connection', 'mk_cellconn', 'mk_pincon']:
fn = CallFn(self, fname)
ret.append(self.data[name].slowimport())
return '\n'.join(list(filter(None, ret)))
- def slowifinstance(self, *args):
+ def extifinstance(self, *args):
ret = []
for (name, count) in self.ifacecount:
for i in range(count):
- ret.append(self.data[name].slowifinstance(name, i))
+ ret.append(self.data[name].extifinstance(name, i))
return '\n'.join(list(filter(None, ret)))
def slowifdeclmux(self, *args):
def slowifdeclmux(self, name, count):
sname = self.get_iname(count)
- return " interface PeripheralSideJTAG %s_out;" % sname
-
- def slowifinstance(self, name, count):
- sname = self.peripheral.iname().format(count)
- pname = self.get_iname(count)
- template = " interface {0}_out = pinmux.peripheral_side.{1};"
- return template.format(pname, sname)
+ return " interface PeripheralSideJTAG %s;" % sname
def slowifdeclmux(self, name, count):
sname = self.get_iname(count)
- return " interface PeripheralSideLCD %s_out;" % sname
-
- def slowifinstance(self, name, count):
- sname = self.peripheral.iname().format(count)
- pname = self.get_iname(count)
- template = " interface {0}_out = pinmux.peripheral_side.{1};"
- return template.format(pname, sname)
+ return " interface PeripheralSideLCD %s;" % sname
mkcon = ifaces.mk_connection()
mkcellcon = ifaces.mk_cellconn()
pincon = ifaces.mk_pincon()
- inst = ifaces.slowifinstance()
+ inst = ifaces.extifinstance()
mkplic = ifaces.mk_plic()
numsloirqs = ifaces.mk_sloirqsdef()
ifacedef = ifaces.mk_ext_ifacedef()
if testing:
dummytest(ps, output_dir, output_type)
else:
- specgen(of, output_dir, pinout, bankspec, pinspec, fixedpins)
+ specgen(of, output_dir, pinout,
+ bankspec, pinspec, fixedpins, ps.fastbus)
else:
if output_type == 'bsv':
from bsv.pinmux_generator import pinmuxgen as gentypes
class PinSpec(Pinouts):
- def __init__(self, pinbanks, fixedpins, function_names):
+ def __init__(self, pinbanks, fixedpins, function_names, fast=None):
+ self.fastbus = fast or []
self.pinbanks = pinbanks
self.fixedpins = fixedpins
self.function_names = function_names
from spec.interfaces import Pinouts
-def specgen(of, pth, pinouts, bankspec, pinbanks, fixedpins):
+def specgen(of, pth, pinouts, bankspec, pinbanks, fixedpins, fastbus):
""" generates a specification of pinouts (tsv files)
for reading in by pinmux.
with open(os.path.join(pth, 'interfaces.txt'), 'w') as f:
for k in pinouts.fnspec.keys():
s = pinouts.fnspec[k]
- f.write("%s\t%d\n" % (k.lower(), len(s)))
+ line = [k.lower(), str(len(s))]
+ for b in fastbus:
+ if b.startswith(k.lower()):
+ line.append(b)
+ line = '\t'.join(line)
+ f.write("%s\n" % line)
s0 = s[list(s.keys())[0]] # hack, take first
gangedgroup = pinouts.ganged[k]
with open(os.path.join(pth, '%s.txt' % k.lower()), 'w') as g:
'ULPI2': 'ULPI (USB Low Pin-count) 2',
}
- ps = PinSpec(pinbanks, fixedpins, function_names)
+ ps = PinSpec(pinbanks, fixedpins, function_names,
+ ['lcd0', 'jtag0'])
# Bank A, 0-27
ps.gpio("", ('A', 0), 0, 0, 28)