add sdcard dummy interface
authorLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Sat, 21 Jul 2018 11:17:51 +0000 (12:17 +0100)
committerLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Sat, 21 Jul 2018 11:17:51 +0000 (12:17 +0100)
src/bsv/peripheral_gen.py
src/bsv/pinmux_generator.py

index 805db2cf22a6dfb6b6b4da51fef53e9dfd045fb1..3fee9dcc63872843bfd184d670a6c7b2d482bc1b 100644 (file)
@@ -332,6 +332,35 @@ eint_pincon_template = '''\
 '''
 
 
+class sdmmc(PBase):
+
+    def slowimport(self):
+        return "        import sdcard_dummy              :: *;"
+
+    def slowifdecl(self):
+        return "            interface QSPI_out sd{0}_out;\n" + \
+               "            method Bit#(1) sd{0}_isint;"
+
+    def num_axi_regs32(self):
+        return 13
+
+    def mkslow_peripheral(self):
+        return "        Ifc_sdcard_dummy sd{0} <-  mksdcard_dummy();"
+
+    def _mk_connection(self, name=None, count=0):
+        return "sd{0}.slave"
+
+    def pinname_in(self, pname):
+        return "out.%s_in" % pname
+
+    def pinname_out(self, pname):
+        return "out.%s_out" % pname
+
+    def pinname_outen(self, pname):
+        if pname.startswith('d'):
+            return "out.%s_outen" % pname
+
+
 class spi(PBase):
 
     def slowimport(self):
@@ -731,6 +760,7 @@ class PFactory(object):
                      'spi': spi,
                      'pwm': pwm,
                      'eint': eint,
+                     'sd': sdmmc,
                      'gpio': gpio
                      }.items():
             if name.startswith(k):
index 7ec50a58b25f82f2f1df911fa2ee6d3019529f08..8b4d534ed55c7d0c9c1115c210996524f3bc7489 100644 (file)
@@ -83,6 +83,7 @@ def pinmuxgen(pth=None, verify=True):
                   'plic.bsv', 'Cur_Cycle.bsv', 
                   'ClockDiv.bsv', 'axi_addr_generator.bsv', 
                   'jtagdtm_new.bsv', 'jtagdefines.bsv', 
+                  'sdcard_dummy.bsv',
                   'pwm.bsv', 'qspi.bsv', 'qspi.defs', 
                   ]:
         shutil.copyfile(os.path.join(cwd, fname),