Skip to content

[BUG] Arrays of external write-buffered components crash #208

Description

@darsor

Describe the bug
Arrays of external components with write-buffered registers crash the exporter.

Details like these can be helpful:
peakrdl-regblock v1.3.1

Reproduced with

 external myreg ext_reg_array[2];

added to the read buffer/write buffer test RDL files.

Error message:

    @property
    def current_loop(self) -> Body:
>       return self._stack[-1]
E       IndexError: list index out of range

../src/peakrdl_regblock/forloop_generator.py:44: IndexError

Additional context
Bug introduced in #192. Specifically, this method was added to the read buffering/write buffering for loop implementations:

    def enter_AddressableComponent(self, node: AddressableNode) -> Optional[WalkerAction]:
        if node.external:
            return WalkerAction.SkipDescendants
        return super().enter_AddressableComponent(node)

Note that the parent's enter_AddressableComponent is not called if the node is external. If the node is an array, that means the array's dimensions are not "pushed" into the loop generator. However, the default exit_AddressableComponent method still tries to "pop" those dimensions from the generator.

PR incoming.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions