add master connection
[pinmux.git] / src / bsv / pinmux_generator.py
index 5683b0057f35986dbddf949afa5f13f1083f7b3a..b348cf47465aa49c8574fe2745d2d8f9941f0ce5 100644 (file)
@@ -121,6 +121,7 @@ def write_slow(slow, slowt, slowmf, slowmt, p, ifaces, iocells):
     numsloirqs = ifaces.mk_sloirqsdef()
     ifacedef = ifaces.mk_ext_ifacedef()
     ifacedef = ifaces.mk_ext_ifacedef()
+    clockcon = ifaces.mk_slowclk_con()
 
     with open(slow, "w") as bsv_file:
         with open(slowt) as f:
@@ -129,7 +130,7 @@ def write_slow(slow, slowt, slowmf, slowmt, p, ifaces, iocells):
                                     fnaddrmap, mkslow, mkcon, mkcellcon,
                                     pincon, inst, mkplic,
                                     numsloirqs, ifacedef,
-                                    inst2))
+                                    inst2, clockcon))
 
     with open(slowmf, "w") as bsv_file:
         with open(slowmt) as f:
@@ -151,14 +152,16 @@ def write_soc(soc, soct, fastmf, fastmt, p, ifaces, iocells):
     fnaddrmap = ifaces.axi_fastaddr_map()
     mkfast = ifaces.mkfast_peripheral()
     mkcon = ifaces.mk_fast_connection()
+    mkmstcon = ifaces.mk_master_connection()
     mkcellcon = ifaces.mk_cellconn()
-    pincon = ifaces.mk_pincon()
+    pincon = ifaces.mk_fast_pincon()
     inst = ifaces.extfastifinstance()
     mkplic = ifaces.mk_plic()
     numsloirqs = ifaces.mk_sloirqsdef()
     ifacedef = ifaces.mk_ext_ifacedef()
     dma = ifaces.mk_dma_irq()
     num_dmachannels = ifaces.num_dmachannels()
+    clockcon = ifaces.mk_fastclk_con()
 
     with open(soc, "w") as bsv_file:
         with open(soct) as f:
@@ -167,6 +170,7 @@ def write_soc(soc, soct, fastmf, fastmt, p, ifaces, iocells):
                                    slavedecl, mastdecl, mkcon,
                                    inst, dma, num_dmachannels,
                                    pincon, regdef, fnaddrmap,
+                                   clockcon, mkmstcon,
                                    ))
 
     with open(fastmf, "w") as bsv_file:
@@ -443,11 +447,11 @@ def write_instances(idef, p, ifaces):
     with open(idef, 'w') as bsv_file:
         txt = '''\
 `define ADDR {0}
-`define PADDR {0}
+`define PADDR {2}
 `define DATA {1}
 `define Reg_width {1}
 `define USERSPACE 0
-//`define RV64
+`define RV64
 
 // TODO: work out if these are needed
 `define PWM_AXI4Lite
@@ -473,4 +477,6 @@ def write_instances(idef, p, ifaces):
   `define BAUD_RATE 5 //130 //
 `endif
 '''
-        bsv_file.write(txt.format(p.ADDR_WIDTH, p.DATA_WIDTH))
+        bsv_file.write(txt.format(p.ADDR_WIDTH,
+                                  p.DATA_WIDTH,
+                                  p.PADDR_WIDTH))