continue with eint
authorLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Sat, 21 Jul 2018 09:18:20 +0000 (10:18 +0100)
committerLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Sat, 21 Jul 2018 09:18:20 +0000 (10:18 +0100)
src/bsv/bsv_lib/slow_peripherals_template.bsv
src/bsv/peripheral_gen.py

index 7afd7ac340a0b4a2d4e784efe0c5018dfc50492c..b167d6c137549d12dc07ecf1452b680861ee0a5f 100644 (file)
@@ -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
index e7340a4aabe9def529e4355f2c8ec4104a471400..484c870e51e24872a12e06a5fe3d951eec629fab 100644 (file)
@@ -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