soc/integration/soc_core: make nmi interrupt optional
authorFlorent Kermarrec <florent@enjoy-digital.fr>
Sun, 3 Dec 2017 22:06:22 +0000 (23:06 +0100)
committerFlorent Kermarrec <florent@enjoy-digital.fr>
Sun, 3 Dec 2017 22:07:41 +0000 (23:07 +0100)
litex/soc/integration/soc_core.py

index 512d105caa2a3aaec8b3e6c86872464f3f0af2f4..1e050c0fc045f692018528ab65474f47cbecf3b7 100644 (file)
@@ -50,7 +50,6 @@ class SoCCore(Module):
     }
     interrupt_map = {}
     soc_interrupt_map = {
-        "nmi":    0, # Reserve zero for "non-maskable interrupt"
         "timer0": 1, # LiteX Timer
         "uart":   2, # LiteX UART (IRQ 2 for UART matches mor1k standard config).
     }
@@ -69,6 +68,7 @@ class SoCCore(Module):
                 csr_data_width=8, csr_address_width=14,
                 with_uart=True, uart_baudrate=115200, uart_stub=False,
                 ident="", ident_version=False,
+                reserve_nmi_interrupt=True,
                 with_timer=True):
         self.config = dict()
 
@@ -132,6 +132,9 @@ class SoCCore(Module):
         self.add_constant("CSR_DATA_WIDTH", csr_data_width)
         self.register_mem("csr", self.mem_map["csr"], self.wishbone2csr.wishbone)
 
+        if reserve_nmi_interrupt:
+            self.soc_interrupt_map["nmi"] = 0 # Reserve zero for "non-maskable interrupt"
+
         if with_uart:
             if uart_stub:
                 self.submodules.uart  = uart.UARTStub()