Skip to content
Snippets Groups Projects

Add support for removing empty resources from architecture

Merged Oscar Gustafsson requested to merge removeresource into master
2 files
+ 23
7
Compare changes
  • Side-by-side
  • Inline
Files
2
+ 21
1
@@ -801,8 +801,28 @@ of :class:`~b_asic.architecture.ProcessingElement`
if resource in self.memories:
self.memories.remove(resource)
else:
elif resource in self.processing_elements:
self.processing_elements.remove(resource)
else:
raise ValueError('Resource not in architecture')
def assign_resources(self, heuristic: str = "left_edge") -> None:
"""
Convenience method to assign all resources in the architecture.
Parameters
----------
heuristic : str, default: "left_edge"
The heurstic to use.
See Also
--------
Memory.assign
ProcessingElement.assign
"""
for resource in chain(self.memories, self.processing_elements):
resource.assign(heuristic=heuristic)
def move_process(
self,
Loading