PYNQ (v2.4, v2.5) > IRQ_F2Pとconcat接続でdictionary空エラー > 対処: 途中にAXI Interrupt Controllerを入れる

```txt:動作環境
Windows 10 Pro (v1909) 
PYNQ-Z1 (Digilent) (以下、PYNQと表記)
Vivado v2019.1 (64-bit)
```

### 前回

- [PYNQ > FIFO loopbackを含むDMA転送のBlock Design (Vivado v2019.1) > v2017.2の方法から変更](https://qiita.com/7of9/items/de3f3b62bac9eda99352)

### IRQの追加とエラー

前回のブロックデザインで[PYNQ v2.4用のDMA処理](https://pynq.readthedocs.io/en/v2.4/pynq_libraries/dma.html)を試そうとした。


```py
import numpy as np
from pynq import Xlnk
from pynq import Overlay

overlay = Overlay('/home/xilinx/pynq/overlays/base/DMA_200718.bit')
dma = overlay.axi_dma_0

xlnk = Xlnk()
input_buffer = xlnk.cma_array(shape=(5,), dtype=np.uint32)
output_buffer = xlnk.cma_array(shape=(5,), dtype=np.uint32)
```

下記のエラーが出た。

```
---------------------------------------------------------------------------
KeyError                                  Traceback (most recent call last)
<ipython-input-6-93fbb89f6aa1> in <module>()
      4 
      5 overlay = Overlay('/home/xilinx/pynq/overlays/base/DMA_200718.bit')
----> 6 dma = overlay.axi_dma_0
      7 
      8 xlnk = Xlnk()

/opt/python3.6/lib/python3.6/site-packages/pynq/overlay.py in __getattr__(self, key)
    314         """
    315         if self.is_loaded():
--> 316             return getattr(self._ip_map, key)
    317         else:
    318             raise RuntimeError("Overlay not currently loaded")

/opt/python3.6/lib/python3.6/site-packages/pynq/overlay.py in __getattr__(self, key)
    516         elif key in self._description['ip']:
    517             ipdescription = self._description['ip'][key]
--> 518             driver = ipdescription['driver'](ipdescription)
    519             setattr(self, key, driver)
    520             return driver

/opt/python3.6/lib/python3.6/site-packages/pynq/lib/dma.py in __init__(self, description, *args, **kwargs)
    688                                'has been deprecated and moved to '
    689                                'pynq.lib.deprecated')
--> 690         super().__init__(description=description)
    691         if 'mm2s_introut' in description['interrupts']:
    692             self.sendchannel = _DMAChannel(self.mmio, 0x0,

/opt/python3.6/lib/python3.6/site-packages/pynq/overlay.py in __init__(self, description)
    466             self._gpio = {}
    467         for interrupt, details in self._interrupts.items():
--> 468             setattr(self, interrupt, Interrupt(details['fullpath']))
    469         for gpio, entry in self._gpio.items():
    470             gpio_number = GPIO.get_gpio_pin(entry['index'])

/opt/python3.6/lib/python3.6/site-packages/pynq/interrupt.py in __init__(self, pinname)
     65         self.number = PL.interrupt_pins[pinname]['index']
     66         self.parent = weakref.ref(
---> 67             _InterruptController.get_controller(parentname))
     68         self.event = asyncio.Event()
     69         self.waiting = False

/opt/python3.6/lib/python3.6/site-packages/pynq/interrupt.py in get_controller(name)
    178             if con.name == name:
    179                 return con
--> 180         ret = _InterruptController(name)
    181         _InterruptController._controllers.append(ret)
    182         return ret

/opt/python3.6/lib/python3.6/site-packages/pynq/interrupt.py in __init__(self, name)
    196         """
    197         self.name = name
--> 198         self.mmio = MMIO(PL.ip_dict[name]['phys_addr'], 32)
    199         self.wait_handles = [[] for _ in range(32)]
    200         self.event_number = 0

KeyError: ''
```

### 対処

関連して以下を見つけた。

- [DMA irq ports cause python empty string dict lookup #964](https://github.com/Xilinx/PYNQ/issues/964)

上記から以下にリンクされている。
https://forums.xilinx.com/t5/Embedded-Linux/A-key-error-when-I-am-trying-to-access-a-DMA-IP-on-PYNQ-Z1-board/td-p/847817

対処としては以下らしい。

- concatからIRQ_F2Pに直接接続しない
- AXI Interrupt Controllerを経由する

実際に試したところ、エラーが出なくなった。

元々がPYNQ v2.5用の質問だったが、v2.4でも同じように対処できた。