From: Neel Date: Sat, 21 Jul 2018 06:40:42 +0000 (+0530) Subject: swap over uart class with quartq X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=090f495bc65378c48b9c39b2e0898f2ac90f4314;p=pinmux.git swap over uart class with quartq --- diff --git a/src/bsv/peripheral_gen.py b/src/bsv/peripheral_gen.py index 9890764..010a0fa 100644 --- a/src/bsv/peripheral_gen.py +++ b/src/bsv/peripheral_gen.py @@ -139,6 +139,34 @@ class PBase(object): class uart(PBase): + def slowimport(self): + return " import Uart_bs :: *;\n" + \ + " import RS232_modified::*;" + + def slowifdecl(self): + return " interface RS232 uart{0}_coe;\n" + \ + " method Bit#(1) uart{0}_intr;" + + def num_axi_regs32(self): + return 8 + + def mkslow_peripheral(self, size=0): + return " Ifc_Uart_bs uart{0} <- \n" + \ + " mkUart_bs(clocked_by uart_clock,\n" + \ + " reset_by uart_reset, sp_clock, sp_reset);" + + def _mk_connection(self, name=None, count=0): + return "uart{0}.slave_axi_uart" + + def pinname_out(self, pname): + return {'tx': 'coe_rs232.sout'}.get(pname, '') + + def pinname_in(self, pname): + return {'rx': 'coe_rs232.sin'}.get(pname, '') + + +class qquart(PBase): + def slowimport(self): return " import Uart16550 :: *;"