to the IO pads in the pinmux. However, at the time of writing this is
not fully understood by the author, so the fastifdecl and extfastifinstance
functions are modified to generate the correct output but the code is
-*commented out*:
+*commented out*, and the corresponding manual declarations of sdram_out
+removed.
def extfastifinstance(self, name, count):
return "// TODO" + self._extifinstance(name, count, "_out", "", True,
return "// (*always_ready*) interface " + \
"Ifc_sdram_out sdr{0}_out;".format(count)
+Next, again searching for signs of the "hand-written" code, we encounter
+the fabric connectivity, which wires the SDRAM to the AXI4. We note however
+that there is not just one AXI slave device but *two*: one for the SDRAM
+itself and one for *configuring* the SDRAM. We therefore need to be
+quite careful about assigning these, as will be subsequently explained.
+First however, the two AXI4 slave interfaces of this peripheral are
+declared:
+ class sdram(PBase):
+
+ ...
+ ...
+ def _mk_connection(self, name=None, count=0):
+ return ["sdr{0}.axi4_slave_sdram",
+ "sdr{0}.axi4_slave_cntrl_reg"]
+
+Note that, again, in case multiple instances are ever to be added, the
+python "format" string "{0}" is inserted so that it can be substituted
+with the numerical identifier suffix. Also note that the order
+of declaration of these two AXI4 slave is **important**.
name = self.name
print "PBase mk_master_conn", self.name, count
aname = self.axi_master_name(name, count, typ)
- con = self._mk_connection(name, count, True).format(count, aname)
- return self.__mk_master_connection(con, aname, fabricname)
+ ret = []
+ connections = self._mk_connection(name, count, True)
+ if not isinstance(connections, list):
+ connections = [connections]
+ for con in connections:
+ con = con.format(count, aname)
+ ret.append(self.__mk_master_connection(con, aname, fabricname))
+ return '\n'.join(ret)
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, typ)
- con = self._mk_connection(name, count).format(count, aname)
- return self.__mk_connection(con, aname, fabricname)
+ ret = []
+ connections = self._mk_connection(name, count)
+ if not isinstance(connections, list):
+ connections = [connections]
+ for con in connections:
+ con = con.format(count, aname)
+ ret.append(self.__mk_connection(con, aname, fabricname))
+ return '\n'.join(ret)
def _mk_connection(self, name=None, count=0):
return ''
return "Ifc_sdr_slave sdr{0} <- mksdr_axi4_slave(clk0);"
def _mk_connection(self, name=None, count=0):
- return "sdr{0}.axi_side"
+ return ["sdr{0}.axi4_slave_sdram",
+ "sdr{0}.axi4_slave_cntrl_reg"]
+
def pinname_in(self, pname):
return {'ta': 'sdram_side.m_tAn',