swap over uart class with quartq
authorNeel <neelgala@gmail.com>
Sat, 21 Jul 2018 06:40:42 +0000 (12:10 +0530)
committerNeel <neelgala@gmail.com>
Sat, 21 Jul 2018 06:40:42 +0000 (12:10 +0530)
src/bsv/peripheral_gen.py

index 98907643d0782a4835b5deebb27ec196e333d89e..010a0faaec2df2ab1987b2683da270266d6670b1 100644 (file)
@@ -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         :: *;"