From 98d5faed6e1a2cf10278fbe645e91e30f403bed6 Mon Sep 17 00:00:00 2001 From: Alex Mykyta Date: Tue, 6 Aug 2019 21:34:44 -0700 Subject: [PATCH] Fix missing array check on top-level export explode decision --- README.md | 4 +++- ralbot/ipxact/__about__.py | 2 +- ralbot/ipxact/exporter.py | 9 ++++++--- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 5ee5c4d..d36a93f 100644 --- a/README.md +++ b/README.md @@ -20,7 +20,9 @@ Pass the elaborated output of the [SystemRDL Compiler](http://systemrdl-compiler to the exporter. ```python -from ralbot.ipxact import RDLCompiler, IPXACTExporter +import sys +from systemrdl import RDLCompiler, RDLCompileError +from ralbot.ipxact import IPXACTExporter rdlc = RDLCompiler() diff --git a/ralbot/ipxact/__about__.py b/ralbot/ipxact/__about__.py index c68196d..a955fda 100644 --- a/ralbot/ipxact/__about__.py +++ b/ralbot/ipxact/__about__.py @@ -1 +1 @@ -__version__ = "1.2.0" +__version__ = "1.2.1" diff --git a/ralbot/ipxact/exporter.py b/ralbot/ipxact/exporter.py index 2c3add5..44469dd 100644 --- a/ralbot/ipxact/exporter.py +++ b/ralbot/ipxact/exporter.py @@ -74,8 +74,11 @@ def export(self, node, path): # addressBlock groups explode = False - # If top node is an addrmap, and it contains 1 or more children that are - # exclusively addrmap or mem, then it makes more sense to "explode" the + # If top node is an addrmap, and it contains 1 or more children that + # are: + # - exclusively addrmap or mem + # - and None of them are arrays + # ... then it makes more sense to "explode" the # top-level node and make each of it's children their own addressBlock # (explode --> True) # @@ -89,7 +92,7 @@ def export(self, node, path): if not isinstance(child, AddressableNode): continue - if isinstance(child, (AddrmapNode, MemNode)): + if isinstance(child, (AddrmapNode, MemNode)) and not child.is_array: addrblockable_children += 1 else: non_addrblockable_children += 1