The platform utils file should be refactored when the opportunity arises. Currently, the resources of the platforms are encoded as lists-of-lists, with the outer list representing SLRs and the inner list resource types. The mapping between list-index and resource type is only noted implicitly on multiple occasions through comments and method implementations. This is error-prone and can lead to very subtle bugs. One for example, would be Multi-FPGA #23, where a wrong comparison between actual resources of one type with available resources of another type can cause the partitioner model to generate a very different or even infeasible solution.
The resource types should thus be explicitly typed or indexed in a dictionary using their names as keys. Additionally typing should be added for better usability.
The platform utils file should be refactored when the opportunity arises. Currently, the resources of the platforms are encoded as lists-of-lists, with the outer list representing SLRs and the inner list resource types. The mapping between list-index and resource type is only noted implicitly on multiple occasions through comments and method implementations. This is error-prone and can lead to very subtle bugs. One for example, would be Multi-FPGA #23, where a wrong comparison between actual resources of one type with available resources of another type can cause the partitioner model to generate a very different or even infeasible solution.
The resource types should thus be explicitly typed or indexed in a dictionary using their names as keys. Additionally typing should be added for better usability.