add more mk_connections
authorLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Fri, 20 Jul 2018 08:05:25 +0000 (09:05 +0100)
committerLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Fri, 20 Jul 2018 08:05:25 +0000 (09:05 +0100)
src/bsv/bsv_lib/slow_peripherals_template.bsv
src/bsv/peripheral_gen.py

index 8881af57e558ff456694bda2d4f1b499991d2572..ceeafca9b0941048cf3bfac7d2d5ca1e365d0f45 100644 (file)
@@ -119,22 +119,10 @@ package slow_peripherals;
                        mkConnection (slow_fabric.v_to_slaves [fromInteger(valueOf(Plic_slave_num))],   
                     plic.axi4_slave_plic); //
                `endif
-               `ifdef QSPI0 
-                       mkConnection (slow_fabric.v_to_slaves [fromInteger(valueOf(Qspi0_slave_num))],  
-                    qspi0.slave); 
-               `endif
-               `ifdef QSPI1 
-                       mkConnection (slow_fabric.v_to_slaves [fromInteger(valueOf(Qspi1_slave_num))],  
-                    qspi1.slave); 
-               `endif
                `ifdef AXIEXP
                mkConnection (slow_fabric.v_to_slaves [fromInteger(valueOf(AxiExp1_slave_num))],        
                     axiexp1.axi_slave); //
                `endif
-    `ifdef PWM_AXI4Lite
-      mkConnection (slow_fabric.v_to_slaves [fromInteger(valueOf(Pwm_slave_num))],
-                    pwm_bus.axi4_slave);
-    `endif
 
     // NEEL EDIT
     mkConnection (slow_fabric.
index 969c1ff9705a0348341722ec56c4ae56f23ca925..f25a02a9f0ed9a58af8114004351b1ea7fec99ca 100644 (file)
@@ -45,8 +45,7 @@ class PBase(object):
     def mkslow_peripheral(self):
         return ''
 
-    def mk_connection(self, count):
-        aname = self.axi_slave_name(self.name, count)
+    def __mk_connection(self, aname, count):
         txt =  "        mkConnection (slow_fabric.v_to_slaves\n" + \
                "                    [fromInteger(valueOf({1}))],\n" + \
                "                    {0});"
@@ -56,6 +55,10 @@ class PBase(object):
             return ''
         return txt.format(con, aname)
 
+    def mk_connection(self, count):
+        aname = self.axi_slave_name(self.name, count)
+        return :elf.__mk_connection(aname, count)
+
     def _mk_connection(self):
         return ''
 
@@ -156,7 +159,10 @@ class pwm(PBase):
         return 4
 
     def mkslow_peripheral(self):
-        return "        Ifc_PWM_bus pwm_bus <- mkPWM_bus(sp_clock);"
+        return "        Ifc_PWM_bus pwm{0}_bus <- mkPWM_bus(sp_clock);"
+
+    def _mk_connection(self):
+        return "pwm{0}_bus.axi4_slave"
 
 
 class gpio(PBase):