vtr-verilog-to-routing
vtr-verilog-to-routing copied to clipboard
[Packer] Load The ClusteredNetlist Directly From The ClusterLegalizer
The current behaviour of the Packer is as follows:
- It performs prepacking on the atoms to create pack molecules (using the Prepacker)
- It uses these molecules to create LegalizationClusters (using the ClusterLegalizer)
- It writes these LegalizationClusters to a .net file (using output clustering) https://github.com/verilog-to-routing/vtr-verilog-to-routing/blob/e38c0f3d975decbafc112d18877a99506c7e845f/vpr/src/pack/pack.cpp#L271-L273
- It then destroys all of the LegalizationClusters
- Then it reads back in this .net file to generate the ClusteredNetlist (using load packing) https://github.com/verilog-to-routing/vtr-verilog-to-routing/blob/e38c0f3d975decbafc112d18877a99506c7e845f/vpr/src/base/vpr_api.cpp#L594-L599
This is very inefficient since a lot of the information from the clustering state is being regenerated again, which wastes a lot of time. It also means that a .net file MUST be made to run VPR, even though it is not necessary.
Instead, the ClusterLegalizer could have a method to convert all of its LegalizationClusters into a valid ClusteredNetlist. The write_packing_results_to_xml
method could then be used to write the ClusteredNetlist directly to a file (instead of generating it from the LegalizationClusters), if the .net file is needed.
https://github.com/verilog-to-routing/vtr-verilog-to-routing/blob/e38c0f3d975decbafc112d18877a99506c7e845f/vpr/src/pack/output_clustering.cpp#L720-L743
This should be a straightforward change, but the biggest thing is making sure that the ClusteredNetlist generated from the ClusterLegalizer EXACTLY matches the ClusteredNetlist generated from reading a .net file. A unit test should be added which compares these two ClusteredNetlists and ensures they exactly match.