def has_axi_master(self):
return False
+ def fastifdecl(self, name, count):
+ return ''
+
def slowifdeclmux(self, name, count):
return ''
def mksuffix(self, name, i):
return i
- def __mk_connection(self, con, aname):
+ def __mk_connection(self, con, aname, fabricname):
+ txt = " mkConnection ({2}.v_to_slaves\n" + \
+ " [fromInteger(valueOf({1}))],\n" + \
+ " {0});"
+
+ print "PBase __mk_connection", self.name, aname
+ if not con:
+ return ''
+ return txt.format(con, aname, fabricname)
+
+ def __mk_master_connection(self, con, aname):
txt = " mkConnection (slow_fabric.v_to_slaves\n" + \
" [fromInteger(valueOf({1}))],\n" + \
" {0});"
return ''
return txt.format(con, aname)
- def mk_connection(self, count, name=None):
+ def mk_connection(self, count, fabricname, typ, name=None):
if name is None:
name = self.name
print "PBase mk_conn", self.name, count
- aname = self.axi_slave_name(name, count)
+ aname = self.axi_slave_name(name, count, typ)
#dname = self.mksuffix(name, count)
#dname = "{0}{1}".format(name, dname)
con = self._mk_connection(name, count).format(count, aname)
- return self.__mk_connection(con, aname)
+ return self.__mk_connection(con, aname, fabricname)
def _mk_connection(self, name=None, count=0):
return ''
def mk_ext_ifacedef(self, iname, inum):
return ''
- def extifinstance(self, name, count):
- sname = self.peripheral.iname().format(count)
+ def extfastifinstance(self, name, count):
+ return ''
+
+ def _extifinstance(self, name, count, suffix, prefix, samename=False):
pname = self.get_iname(count)
- template = " interface {0} = pinmux.peripheral_side.{1};"
- return template.format(pname, sname)
+ if samename:
+ sname = pname
+ else:
+ sname = self.peripheral.iname().format(count)
+ template = " interface {0}{3} = {2}{1};"
+ return template.format(pname, sname, prefix, suffix)
+
+ def extifinstance(self, name, count):
+ return self._extifinstance(name, count, "",
+ "pinmux.peripheral_side.")
mkplic_rule = """\
self.slow = slow(ifacename)
self.slow.peripheral = self
for fname in ['slowimport',
- 'extifinstance', 'extifdecl',
+ 'extfastifinstance', 'extifinstance', 'extifdecl',
'slowifdecl', 'slowifdeclmux',
+ 'fastifdecl',
'mkslow_peripheral',
'mkfast_peripheral',
'mk_plic', 'mk_ext_ifacedef',
ret.append(self.data[name].slowimport())
return '\n'.join(list(filter(None, ret)))
+ def extfastifinstance(self, *args):
+ ret = []
+ for (name, count) in self.ifacecount:
+ for i in range(count):
+ iname = self.data[name].iname().format(i)
+ print "extfast", iname, self.is_on_fastbus(name, i)
+ if self.is_on_fastbus(name, i):
+ continue
+ ret.append(self.data[name].extfastifinstance(name, i))
+ return '\n'.join(list(filter(None, ret)))
+
def extifinstance(self, *args):
ret = []
for (name, count) in self.ifacecount:
ret.append(self.data[name].slowifdeclmux(name, i))
return '\n'.join(list(filter(None, ret)))
+ def fastifdecl(self, *args):
+ ret = []
+ for (name, count) in self.ifacecount:
+ for i in range(count):
+ print "fastifdecl", name, i, self.is_on_fastbus(name, i)
+ if self.is_on_fastbus(name, i):
+ continue
+ ret.append(self.data[name].fastifdecl(name, i))
+ return '\n'.join(list(filter(None, ret)))
+
def slowifdecl(self, *args):
ret = []
for (name, count) in self.ifacecount:
ret.append(x.format(suffix))
return '\n'.join(list(filter(None, ret)))
+ def mk_fast_connection(self, *args):
+ 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_connection(i, "fabric", "fast")
+ if name == 'gpioa':
+ print "txt", txt
+ print self.data[name].mk_connection
+ ret.append(txt)
+ return '\n'.join(list(filter(None, ret)))
+
def mk_connection(self, *args):
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_connection(i)
+ txt = self.data[name].mk_connection(i, "slow_fabric", "")
if name == 'gpioa':
print "txt", txt
print self.data[name].mk_connection