Add minimize memory to PE connection resource algorithm
- Added min_mem_to_pe resource allocation/assignment algorithm.
- Fixed bug where two PEs/memories with the same name broke the architecture rendering by enforcing unique names.
- Fixed comments from !507 (merged)
Closes: #347 (closed)
Merge request reports
Activity
added Resource allocation label
assigned to @simbj106
added Architecture Bug labels
1125 1135 total_ports: int, 1126 1136 sequence: list[Process], 1127 1137 processing_elements: list["ProcessingElement"], 1138 sfg, 1128 1139 ) -> list["ProcessCollection"]: 1129 raise NotImplementedError() 1140 1141 if set(self.collection) != set(sequence): 1142 raise KeyError("processes in `sequence` must be equal to processes in self") - Comment on lines +1141 to +1142
I want to try different sorting orders later, so I will keep this.
Edited by Simon Bjurek
- Resolved by Simon Bjurek
added 2 commits
615 615 direct_interconnects: ProcessCollection | None = None, 616 616 ): 617 617 super().__init__(entity_name) 618 619 pe_names = [pe._entity_name for pe in processing_elements] Ahh, I mixed it up with https://gitlab.liu.se/da/B-ASIC/-/blob/master/b_asic/architecture.py?ref_type=heads#L83
But do you actually need to use the entity names here? It seems like the wrong place to check it.
It is optional because you probably do not want to come up with a name every time just to play around. One can also imagine some sort of automatic naming (as is the case for the top architecture or use something like GraphID). But, especially, since we do not have code generation yet, it seems inefficient to strictly require an entity name.
I think that the use case of evaluating different algorithms without having to specify names is a good enough reason at the moment to not require a name.
We may reevaluate it later if it becomes a problem, but there are things to consider that are not really clear yet.
617 617 super().__init__(entity_name) 618 619 pe_names = [pe._entity_name for pe in processing_elements] 620 if None in pe_names: 621 raise ValueError( 622 "Entity names must be defined for all processing elements." 623 ) 624 if len(pe_names) != len(set(pe_names)): 625 raise ValueError("Entity names of processing elements needs to be unique.") 618 626 self._processing_elements = ( 619 627 [processing_elements] 620 628 if isinstance(processing_elements, ProcessingElement) 621 629 else list(processing_elements) 622 630 ) 631 632 mem_names = [mem._entity_name for mem in memories] - Resolved by Simon Bjurek