From 868740807d729490cc07d2e60e532885d25889bc Mon Sep 17 00:00:00 2001 From: sterin Date: Thu, 25 Jan 2024 05:17:14 -0700 Subject: [PATCH] Resolves: Exception when an interrupt controller is in a hierarchy (#1434) (#1433). Index 'PL.interrupt_controllers' by 'hierarchy_name' rather than 'name'. Signed-off-by: Baruch Sterin --- pynq/metadata/interrupt_controllers_view.py | 8 ++++---- pynq/metadata/interrupt_pins_view.py | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/pynq/metadata/interrupt_controllers_view.py b/pynq/metadata/interrupt_controllers_view.py index 8f0872984..357fe5423 100644 --- a/pynq/metadata/interrupt_controllers_view.py +++ b/pynq/metadata/interrupt_controllers_view.py @@ -86,17 +86,17 @@ def view(self) -> Dict: controller_list = controller_list + self._walk_for_irq_controllers(ps_irq) for controller in controller_list: - repr_dict[controller.name] = {} - repr_dict[controller.name]["parent"] = "" + repr_dict[controller.hierarchy_name] = {"name": controller.name} + repr_dict[controller.hierarchy_name]["parent"] = "" if "interrupt_controller_index" in controller.ext: - repr_dict[controller.name]["index"] = controller.ext[ + repr_dict[controller.hierarchy_name]["index"] = controller.ext[ "interrupt_controller_index" ].index else: raise RuntimeError( f"Cannot determine the index for interrupt controller {controller.ref}" ) - repr_dict[controller.name]["raw_irq"] = ps.irq_map[ + repr_dict[controller.hierarchy_name]["raw_irq"] = ps.irq_map[ controller.ext["interrupt_controller_index"].index ] diff --git a/pynq/metadata/interrupt_pins_view.py b/pynq/metadata/interrupt_pins_view.py index 045a84446..e77d13618 100644 --- a/pynq/metadata/interrupt_pins_view.py +++ b/pynq/metadata/interrupt_pins_view.py @@ -44,7 +44,7 @@ def __init__(self, module: Module, controllers) -> None: pins = [] for ctrler_name in self._controllers: - irq_controller = self._md.blocks[ctrler_name] + irq_controller = self._md.blocks[self._controllers[ctrler_name]["name"]] if "intr" in irq_controller.ports: pins = pins + self._walk_for_irq_pins( irq_controller.ports["intr"].sig() @@ -95,7 +95,7 @@ def view(self) -> Dict: for ctrler_name in self._controllers: pins = [] - irq_controller = self._md.blocks[ctrler_name] + irq_controller = self._md.blocks[self._controllers[ctrler_name]["name"]] if "intr" in irq_controller.ports: pins = pins + self._walk_for_irq_pins( irq_controller.ports["intr"].sig()