Skip to content

Commit 88f581d

Browse files
[Clustering] Moved Clustered Netlist Verification Into Load Packing
The verification and printing of the clustered netlsit made more sense inside of the load_packing method. Moved.
1 parent 357ca89 commit 88f581d

File tree

3 files changed

+29
-37
lines changed

3 files changed

+29
-37
lines changed

vpr/src/base/vpr_api.cpp

Lines changed: 25 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -623,50 +623,16 @@ bool vpr_pack_flow(t_vpr_setup& vpr_setup, const t_arch& arch) {
623623

624624
// generate a .net file by legalizing an input flat placement file
625625
if (packer_opts.load_flat_placement) {
626-
627626
//Load and legalizer flat placement file
628627
vpr_load_flat_placement(vpr_setup, arch);
629628

630629
//Load the result from the .net file
631630
vpr_load_packing(vpr_setup, arch);
632-
633631
} else {
634-
635632
//Load a previous packing from the .net file
636633
vpr_load_packing(vpr_setup, arch);
637-
638634
}
639-
640635
}
641-
642-
// Load cluster_constraints data structure.
643-
load_cluster_constraints();
644-
645-
/* Sanity check the resulting netlist */
646-
check_netlist(packer_opts.pack_verbosity);
647-
648-
// Independently verify the clusterings to ensure the clustering can be
649-
// used for the rest of the VPR flow.
650-
// NOTE: This is done here since it must be done after vpr_load_packing
651-
// and load_cluster_constraints.
652-
// TODO: If load_cluster_constraints was in vpr_load_packing, this could
653-
// also be in vpr_load_packing which would make more sense.
654-
unsigned num_errors = verify_clustering(g_vpr_ctx);
655-
if (num_errors == 0) {
656-
VTR_LOG("Completed clustering consistency check successfully.\n");
657-
} else {
658-
VPR_ERROR(VPR_ERROR_PACK,
659-
"%u errors found while performing clustering consistency "
660-
"check. Aborting program.\n",
661-
num_errors);
662-
}
663-
664-
/* Output the netlist stats to console and optionally to file. */
665-
writeClusteredNetlistStats(vpr_setup.FileNameOpts.write_block_usage);
666-
667-
// print the total number of used physical blocks for each
668-
// physical block type after finishing the packing stage
669-
print_pb_type_count(g_vpr_ctx.clustering().clb_nlist);
670636
}
671637

672638
return status;
@@ -759,6 +725,31 @@ void vpr_load_packing(t_vpr_setup& vpr_setup, const t_arch& arch) {
759725
std::ofstream ofs("packing_pin_util.rpt");
760726
report_packing_pin_usage(ofs, g_vpr_ctx);
761727
}
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);
762753
}
763754

764755
bool vpr_load_flat_placement(t_vpr_setup& vpr_setup, const t_arch& arch) {

vpr/src/pack/verify_clustering.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ static unsigned check_clustering_pb_consistency(const ClusteredNetlist& clb_nlis
222222
* with the floorplanning constraints on the atoms.
223223
*
224224
* This checks the following invariants:
225-
* - If a cluster is unconstrained, all of its atoms are unconrstrained.
225+
* - If a cluster is unconstrained, all of its atoms are unconstrained.
226226
* - If a cluster is constrained, at least one of its atoms are constrained.
227227
* - If a cluster is constrained, each of its constrained atoms can be placed
228228
* within its constrained region.

vpr/src/pack/verify_clustering.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,9 @@ unsigned verify_clustering(const ClusteredNetlist& clb_nlist,
7272
* given VPR context itself. This verifies that the actual clustering being used
7373
* through the rest of the flow is valid.
7474
*
75-
* NOTE: The above method is used when one wishes to verify a temporary
76-
* clustering befor updating the actual global VPR context.
75+
* NOTE: The verify_clustering method with more arguments is used when one
76+
* wishes to verify a temporary clustering befor updating the actual
77+
* global VPR context.
7778
*
7879
* @param ctx The global VPR context variable found in g_vpr_ctx.
7980
*

0 commit comments

Comments
 (0)