Skip to content

Commit

Permalink
Resolves: Exception when an interrupt controller is in a hierarchy (#…
Browse files Browse the repository at this point in the history
…1434)

(#1433).

Index 'PL.interrupt_controllers' by 'hierarchy_name' rather than 'name'.

Signed-off-by: Baruch Sterin <baruchs@gmail.com>
  • Loading branch information
sterin committed Jan 25, 2024
1 parent de6b6fc commit 8687408
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions pynq/metadata/interrupt_controllers_view.py
Expand Up @@ -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
]

Expand Down
4 changes: 2 additions & 2 deletions pynq/metadata/interrupt_pins_view.py
Expand Up @@ -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()
Expand Down Expand Up @@ -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()
Expand Down

0 comments on commit 8687408

Please sign in to comment.