From: Luke Kenneth Casson Leighton Date: Sat, 21 Jul 2018 11:17:51 +0000 (+0100) Subject: add sdcard dummy interface X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=037d95db590cfb1107f14dca3dc15d0d3a2fbd9a;p=pinmux.git add sdcard dummy interface --- diff --git a/src/bsv/peripheral_gen.py b/src/bsv/peripheral_gen.py index 805db2c..3fee9dc 100644 --- a/src/bsv/peripheral_gen.py +++ b/src/bsv/peripheral_gen.py @@ -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): diff --git a/src/bsv/pinmux_generator.py b/src/bsv/pinmux_generator.py index 7ec50a5..8b4d534 100644 --- a/src/bsv/pinmux_generator.py +++ b/src/bsv/pinmux_generator.py @@ -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),