def __init__(self, name):
self.name = name
+ def extifdecl(self, name, count):
+ sname = self.get_iname(count)
+ return " interface PeripheralSide%s %s;" % (name.upper(), sname)
+
def slowifdeclmux(self, name, count):
return ''
self.slow = slow(ifacename)
self.slow.peripheral = self
for fname in ['slowimport',
- 'extifinstance', 'slowifdecl', 'slowifdeclmux',
+ 'extifinstance', 'extifdecl',
+ 'slowifdecl', 'slowifdeclmux',
'mkslow_peripheral', 'mk_plic', 'mk_ext_ifacedef',
'mk_connection', 'mk_cellconn', 'mk_pincon']:
fn = CallFn(self, fname)
ret = []
for (name, count) in self.ifacecount:
for i in range(count):
+ iname = self.data[name].iname().format(i)
+ if not self.is_on_fastbus(name, i):
+ continue
ret.append(self.data[name].extifinstance(name, i))
return '\n'.join(list(filter(None, ret)))
+ def extifdecl(self, *args):
+ ret = []
+ for (name, count) in self.ifacecount:
+ for i in range(count):
+ if not self.is_on_fastbus(name, i):
+ continue
+ ret.append(self.data[name].extifdecl(name, i))
+ return '\n'.join(list(filter(None, ret)))
+
def slowifdeclmux(self, *args):
ret = []
for (name, count) in self.ifacecount:
ret = []
for (name, count) in self.ifacecount:
for i in range(count):
+ if self.is_on_fastbus(name, i):
+ continue
ret.append(self.data[name].slowifdecl().format(i, name))
return '\n'.join(list(filter(None, ret)))
start = 0x00011100 # start of AXI peripherals address
for (name, count) in self.ifacecount:
for i in range(count):
+ if self.is_on_fastbus(name, i):
+ continue
x = self.data[name].axi_reg_def(start, i)
#print ("ifc", name, x)
(rdef, offs) = x
start = 0
for (name, count) in self.ifacecount:
for i in range(count):
+ if self.is_on_fastbus(name, i):
+ continue
(rdef, offs) = self.data[name].axi_slave_idx(start, i)
#print ("ifc", name, rdef, offs)
ret.append(rdef)
ret = []
for (name, count) in self.ifacecount:
for i in range(count):
+ if self.is_on_fastbus(name, i):
+ continue
ret.append(self.data[name].axi_addr_map(i))
return '\n'.join(list(filter(None, ret)))
ret = []
for (name, count) in self.ifacecount:
for i in range(count):
+ if self.is_on_fastbus(name, i):
+ continue
print "mkslow", name, count
x = self.data[name].mkslow_peripheral()
print name, count, x
ret = []
for (name, count) in self.ifacecount:
for i in range(count):
- print "mk_conn", name, i
+ if self.is_on_fastbus(name, i):
+ continue
txt = self.data[name].mk_connection(i)
if name == 'gpioa':
print "txt", txt
cellcount = 0
for (name, count) in self.ifacecount:
for i in range(count):
+ if self.is_on_fastbus(name, i):
+ continue
res = self.data[name].mk_cellconn(cellcount, name, i)
if not res:
continue
ret = []
for (name, count) in self.ifacecount:
for i in range(count):
+ if self.is_on_fastbus(name, i):
+ continue
txt = self.data[name].mk_pincon(name, i)
ret.append(txt)
return '\n'.join(list(filter(None, ret)))
ret = []
for (name, count) in self.ifacecount:
for i in range(count):
+ if self.is_on_fastbus(name, i):
+ continue
txt = self.data[name].mk_ext_ifacedef(name, i)
ret.append(txt)
return '\n'.join(list(filter(None, ret)))
irq_offs = 8 # XXX: DMA scovers 0-7?
for (name, count) in self.ifacecount:
for i in range(count):
+ if self.is_on_fastbus(name, i):
+ continue
res = self.data[name].mk_plic(i, irq_offs)
if not res:
continue
def mk_sloirqsdef(self):
return " `define NUM_SLOW_IRQS {0}".format(self.num_slow_irqs)
+ def is_on_fastbus(self, name, i):
+ iname = self.data[name].iname().format(i)
+ return iname in self.fastbus
class PFactory(object):
def getcls(self, name):