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 ''
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
return " MUX#(%d) mux{0} <- mkmux();\n" % size + \
" GPIO#(%d) gpio{0} <- mkgpio();" % size
- def mk_connection(self, count):
+ def mk_connection(self, count, fabricname, typ):
print "GPIO mk_conn", self.name, count
res = []
dname = self.mksuffix(self.name, count)
for i, n in enumerate(['gpio' + dname, 'mux' + dname]):
- res.append(PBase.mk_connection(self, count, n))
+ res.append(PBase.mk_connection(self, count, fabricname, typ, n))
return '\n'.join(res)
def _mk_connection(self, name=None, count=0):
mastdecl = ifaces.axi_master_idx()
fnaddrmap = ifaces.axi_addr_map()
mkfast = ifaces.mkfast_peripheral()
- mkcon = ifaces.mk_connection()
+ mkcon = ifaces.mk_fast_connection()
mkcellcon = ifaces.mk_cellconn()
pincon = ifaces.mk_pincon()
inst = ifaces.extifinstance()
ifacedef = ifaces.mk_ext_ifacedef()
with open(soc, "w") as bsv_file:
bsv_file.write(soct.format(imports, ifdecl, mkfast,
- slavedecl, mastdecl,
+ slavedecl, mastdecl, mkcon,
#'', '' #regdef, slavedecl,
#'', mkslow, #fnaddrmap, mkslow, mkcon, mkcellcon,
#pincon, inst, mkplic,