Fix max_decode_depth to control decoder hierarchy and port generation (#18)
* Initial plan * Fix max_decode_depth to properly control decoder hierarchy and port generation Co-authored-by: arnavsacheti <36746504+arnavsacheti@users.noreply.github.com> * Fix test that relied on old depth behavior Co-authored-by: arnavsacheti <36746504+arnavsacheti@users.noreply.github.com> * Update documentation for max_decode_depth parameter Co-authored-by: arnavsacheti <36746504+arnavsacheti@users.noreply.github.com> * fix format * Add variable_depth RDL file and smoke tests for max_decode_depth parameter Co-authored-by: arnavsacheti <36746504+arnavsacheti@users.noreply.github.com> * Add variable depth tests for APB3 and AXI4-Lite CPUIFs Co-authored-by: arnavsacheti <36746504+arnavsacheti@users.noreply.github.com> * fix * fix * bump --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: arnavsacheti <36746504+arnavsacheti@users.noreply.github.com>
This commit is contained in:
@@ -25,11 +25,7 @@ class BaseCpuif:
|
||||
|
||||
@property
|
||||
def addressable_children(self) -> list[AddressableNode]:
|
||||
return [
|
||||
child
|
||||
for child in self.exp.ds.top_node.children(unroll=self.unroll)
|
||||
if isinstance(child, AddressableNode)
|
||||
]
|
||||
return self.exp.ds.get_addressable_children_at_depth(unroll=self.unroll)
|
||||
|
||||
@property
|
||||
def addr_width(self) -> int:
|
||||
|
||||
@@ -27,6 +27,17 @@ class FaninGenerator(BusDecoderListener):
|
||||
def enter_AddressableComponent(self, node: AddressableNode) -> WalkerAction | None:
|
||||
action = super().enter_AddressableComponent(node)
|
||||
|
||||
should_generate = action == WalkerAction.SkipDescendants
|
||||
if not should_generate and self._ds.max_decode_depth == 0:
|
||||
for child in node.children():
|
||||
if isinstance(child, AddressableNode):
|
||||
break
|
||||
else:
|
||||
should_generate = True
|
||||
|
||||
if not should_generate:
|
||||
return action
|
||||
|
||||
if node.array_dimensions:
|
||||
for i, dim in enumerate(node.array_dimensions):
|
||||
fb = ForLoopBody(
|
||||
|
||||
@@ -23,6 +23,17 @@ class FanoutGenerator(BusDecoderListener):
|
||||
def enter_AddressableComponent(self, node: AddressableNode) -> WalkerAction | None:
|
||||
action = super().enter_AddressableComponent(node)
|
||||
|
||||
should_generate = action == WalkerAction.SkipDescendants
|
||||
if not should_generate and self._ds.max_decode_depth == 0:
|
||||
for child in node.children():
|
||||
if isinstance(child, AddressableNode):
|
||||
break
|
||||
else:
|
||||
should_generate = True
|
||||
|
||||
if not should_generate:
|
||||
return action
|
||||
|
||||
if node.array_dimensions:
|
||||
for i, dim in enumerate(node.array_dimensions):
|
||||
fb = ForLoopBody(
|
||||
|
||||
Reference in New Issue
Block a user