|
70 | 70 | #include "place_util.h" |
71 | 71 | #include "timing_fail_error.h" |
72 | 72 | #include "analytical_placement_flow.h" |
| 73 | +#include "verify_clustering.h" |
73 | 74 |
|
74 | 75 | #include "vpr_constraints_writer.h" |
75 | 76 |
|
@@ -622,34 +623,16 @@ bool vpr_pack_flow(t_vpr_setup& vpr_setup, const t_arch& arch) { |
622 | 623 |
|
623 | 624 | // generate a .net file by legalizing an input flat placement file |
624 | 625 | if (packer_opts.load_flat_placement) { |
625 | | - |
626 | 626 | //Load and legalizer flat placement file |
627 | 627 | vpr_load_flat_placement(vpr_setup, arch); |
628 | 628 |
|
629 | 629 | //Load the result from the .net file |
630 | 630 | vpr_load_packing(vpr_setup, arch); |
631 | | - |
632 | 631 | } else { |
633 | | - |
634 | 632 | //Load a previous packing from the .net file |
635 | 633 | vpr_load_packing(vpr_setup, arch); |
636 | | - |
637 | 634 | } |
638 | | - |
639 | 635 | } |
640 | | - |
641 | | - // Load cluster_constraints data structure. |
642 | | - load_cluster_constraints(); |
643 | | - |
644 | | - /* Sanity check the resulting netlist */ |
645 | | - check_netlist(packer_opts.pack_verbosity); |
646 | | - |
647 | | - /* Output the netlist stats to console and optionally to file. */ |
648 | | - writeClusteredNetlistStats(vpr_setup.FileNameOpts.write_block_usage); |
649 | | - |
650 | | - // print the total number of used physical blocks for each |
651 | | - // physical block type after finishing the packing stage |
652 | | - print_pb_type_count(g_vpr_ctx.clustering().clb_nlist); |
653 | 636 | } |
654 | 637 |
|
655 | 638 | return status; |
@@ -742,6 +725,31 @@ void vpr_load_packing(t_vpr_setup& vpr_setup, const t_arch& arch) { |
742 | 725 | std::ofstream ofs("packing_pin_util.rpt"); |
743 | 726 | report_packing_pin_usage(ofs, g_vpr_ctx); |
744 | 727 | } |
| 728 | + |
| 729 | + // Load cluster_constraints data structure. |
| 730 | + load_cluster_constraints(); |
| 731 | + |
| 732 | + /* Sanity check the resulting netlist */ |
| 733 | + check_netlist(vpr_setup.PackerOpts.pack_verbosity); |
| 734 | + |
| 735 | + // Independently verify the clusterings to ensure the clustering can be |
| 736 | + // used for the rest of the VPR flow. |
| 737 | + unsigned num_errors = verify_clustering(g_vpr_ctx); |
| 738 | + if (num_errors == 0) { |
| 739 | + VTR_LOG("Completed clustering consistency check successfully.\n"); |
| 740 | + } else { |
| 741 | + VPR_ERROR(VPR_ERROR_PACK, |
| 742 | + "%u errors found while performing clustering consistency " |
| 743 | + "check. Aborting program.\n", |
| 744 | + num_errors); |
| 745 | + } |
| 746 | + |
| 747 | + /* Output the netlist stats to console and optionally to file. */ |
| 748 | + writeClusteredNetlistStats(vpr_setup.FileNameOpts.write_block_usage); |
| 749 | + |
| 750 | + // print the total number of used physical blocks for each |
| 751 | + // physical block type after finishing the packing stage |
| 752 | + print_pb_type_count(g_vpr_ctx.clustering().clb_nlist); |
745 | 753 | } |
746 | 754 |
|
747 | 755 | bool vpr_load_flat_placement(t_vpr_setup& vpr_setup, const t_arch& arch) { |
|
0 commit comments