From a3e62e64b459fe660eac557e73951c919bb27097 Mon Sep 17 00:00:00 2001 From: Luke Kenneth Casson Leighton Date: Sat, 21 Jul 2018 10:18:20 +0100 Subject: [PATCH] continue with eint --- src/bsv/bsv_lib/slow_peripherals_template.bsv | 3 +-- src/bsv/peripheral_gen.py | 8 ++++++++ 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/bsv/bsv_lib/slow_peripherals_template.bsv b/src/bsv/bsv_lib/slow_peripherals_template.bsv index 7afd7ac..b167d6c 100644 --- a/src/bsv/bsv_lib/slow_peripherals_template.bsv +++ b/src/bsv/bsv_lib/slow_peripherals_template.bsv @@ -48,7 +48,6 @@ package slow_peripherals; interface Ifc_slow_peripherals; interface AXI4_Slave_IFC#(`ADDR,`DATA,`USERSPACE) axi_slave; interface SP_dedicated_ios slow_ios; - method Action external_int(Bit#(32) in); `ifdef CLINT method Bit#(1) msip_int; method Bit#(1) mtip_int; @@ -361,7 +360,7 @@ package slow_peripherals; // NEEL EDIT interface iocell_side=pinmux.iocell_side; interface pad_config0= gpioa.pad_config; - method Action external_int(Bit#(32) in); + method Action external_int(Bit#(`NUM_EINTS) in); wr_interrupt<= in; endmethod // NEEL EDIT OVER diff --git a/src/bsv/peripheral_gen.py b/src/bsv/peripheral_gen.py index e7340a4..484c870 100644 --- a/src/bsv/peripheral_gen.py +++ b/src/bsv/peripheral_gen.py @@ -274,6 +274,14 @@ class twi(PBase): class eint(PBase): + def slowimport(self): + size = len(self.peripheral.pinspecs) + return " `define NUM_EINTS %d" % size + + def slowifdeclmux(self): + size = len(self.peripheral.pinspecs) + return " method Action external_int(Bit#(%d) in);" % size + def mkslow_peripheral(self, size=0): size = len(self.peripheral.pinspecs) return " Wire#(Bit#(%d)) wr_interrupt <- mkWire();" % size -- 2.30.2