This commit is contained in:
Arnav Sacheti
2025-10-23 22:33:36 -07:00
parent 4b87556135
commit 0ce469eb73
11 changed files with 17 additions and 291 deletions

View File

@@ -12,15 +12,15 @@ class APB3Cpuif(BaseCpuif):
def _port_declaration(self, child: AddressableNode) -> str:
base = f"apb3_intf.master m_apb_{child.inst_name}"
# When unrolled, current_idx is set - append it to the name
if child.current_idx is not None:
base = f"{base}_{'_'.join(map(str, child.current_idx))}"
# Only add array dimensions if this should be treated as an array
if self.check_is_array(child):
return f"{base} {''.join(f'[{dim}]' for dim in child.array_dimensions)}"
return base
@property

View File

@@ -12,15 +12,15 @@ class APB4Cpuif(BaseCpuif):
def _port_declaration(self, child: AddressableNode) -> str:
base = f"apb4_intf.master m_apb_{child.inst_name}"
# When unrolled, current_idx is set - append it to the name
if child.current_idx is not None:
base = f"{base}_{'_'.join(map(str, child.current_idx))}"
# Only add array dimensions if this should be treated as an array
if self.check_is_array(child):
return f"{base} {''.join(f'[{dim}]' for dim in child.array_dimensions)}"
return base
@property

View File

@@ -12,15 +12,15 @@ class AXI4LiteCpuif(BaseCpuif):
def _port_declaration(self, child: AddressableNode) -> str:
base = f"axi4lite_intf.master m_axil_{child.inst_name}"
# When unrolled, current_idx is set - append it to the name
if child.current_idx is not None:
base = f"{base}_{'_'.join(map(str, child.current_idx))}"
# Only add array dimensions if this should be treated as an array
if self.check_is_array(child):
return f"{base} {''.join(f'[{dim}]' for dim in child.array_dimensions)}"
return base
@property

View File

@@ -73,7 +73,7 @@ class BaseCpuif:
def check_is_array(self, node: AddressableNode) -> bool:
# When unrolling is enabled, children(unroll=True) returns individual
# array elements with current_idx set. These should NOT be treated as arrays.
if self.unroll and hasattr(node, 'current_idx') and node.current_idx is not None:
if self.unroll and hasattr(node, "current_idx") and node.current_idx is not None:
return False
return node.is_array

View File

@@ -34,7 +34,7 @@ class FanoutGenerator(BusDecoderListener):
if action == WalkerAction.Continue:
self._stack[-1] += self._cpuif.fanout(node)
return action
def exit_AddressableComponent(self, node: AddressableNode) -> None: