From: Luke Kenneth Casson Leighton Date: Fri, 20 Jul 2018 08:05:25 +0000 (+0100) Subject: add more mk_connections X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=86b70096f210d0e2138cfac10cbdb9fe443266da;p=pinmux.git add more mk_connections --- diff --git a/src/bsv/bsv_lib/slow_peripherals_template.bsv b/src/bsv/bsv_lib/slow_peripherals_template.bsv index 8881af5..ceeafca 100644 --- a/src/bsv/bsv_lib/slow_peripherals_template.bsv +++ b/src/bsv/bsv_lib/slow_peripherals_template.bsv @@ -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. diff --git a/src/bsv/peripheral_gen.py b/src/bsv/peripheral_gen.py index 969c1ff..f25a02a 100644 --- a/src/bsv/peripheral_gen.py +++ b/src/bsv/peripheral_gen.py @@ -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):