Advertisement
Guest User

Untitled

a guest
May 16th, 2019
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 1.15 KB | None | 0 0
  1. diff --git a/examples/litedram_gen.py b/examples/litedram_gen.py
  2. index 9450d39..a534041 100755
  3. --- a/examples/litedram_gen.py
  4. +++ b/examples/litedram_gen.py
  5. @@ -82,6 +82,11 @@ def get_csr_ios(aw, dw):
  6.          ),
  7.      ]
  8.  
  9. +def get_irq_ios(num_irqs):
  10. +    return [
  11. +        ("irq_lines", 0, Pins(num_irqs)),
  12. +    ]
  13. +
  14.  def get_native_user_port_ios(_id, aw, dw):
  15.      return [
  16.          ("user_port", _id,
  17. @@ -259,6 +264,16 @@ class LiteDRAMCore(SoCSDRAM):
  18.                  _csr_port_io.dat_r.eq(csr_port.dat_r),
  19.              ]
  20.  
  21. +        # interrupt lines
  22. +        num_irqs = len(self.soc_interrupt_map)
  23. +        platform.add_extension(get_irq_ios(num_irqs))
  24. +        _irq_lines = platform.request("irq_lines")
  25. +        for _name, _id in sorted(self.soc_interrupt_map.items()):
  26. +            if hasattr(self, _name):
  27. +                module = getattr(self, _name)
  28. +                assert hasattr(module, 'ev'), "Submodule %s does not have EventManager (xx.ev) module" % _name
  29. +                self.comb += _irq_lines[_id].eq(module.ev.irq)
  30. +
  31.          # user port
  32.          self.comb += [
  33.              platform.request("user_clk").eq(ClockSignal()),
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement