add axi slave idx generator
authorLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Fri, 20 Jul 2018 05:35:00 +0000 (06:35 +0100)
committerLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Fri, 20 Jul 2018 05:35:00 +0000 (06:35 +0100)
src/bsv/peripheral_gen.py

index 9800cf13ab59208db84a7a5b84c28e2a8f807d67..5e4a18b8b1bd5b79e2ea00163487542130275d40 100644 (file)
@@ -20,6 +20,10 @@ class PBase(object):
                 "    `define%(bend)s  'h%(end)08X // %(comment)s" % locals(),
                 offs)
 
+    def axi_slave_idx(self, idx, name, ifacenum):
+        name = name.upper()
+        return "typedef {0} {1}{2}_slave_num;".format(idx, name, ifacenum)
+
 
 class uart(PBase):
     def importfn(self):