Closed tpwrules closed 8 months ago
These MemoryMap
methods iterate by insertion order despite claiming to iterate on ascending order of addresses:
.resources()
.windows()
.window_patterns()
I think that the behavior should be fixed to match the docstring, rather than the opposite. Iterating in ascending order of addresses makes sense when generating files such as SVD definitions, headers, etc.
Many methods on
MemoryMap
claim to iterate objects "in ascending order of their address" but this appears to not be the case in the current code. The code as it stands appears to iterate in order of object addition, as this is how Python dicts natively iterate.This original documentation was written five years ago, so it's unclear something changed or this was never implemented. Iterating in address order is a useful property and will help determinism of downstream code, such as the SoC bus decoders, so the class should be modified to do this properly.