P4C
The P4 Compiler
Loading...
Searching...
No Matches
DecidePlacement::FinalPlacement Class Reference

Public Member Functions

 FinalPlacement (DecidePlacement &self, ordered_set< const GroupPlace * > &w, ordered_set< const IR::MAU::Table * > &p, const Placed *&a)
 
void add_complete_placement (BacktrackPlacement *bp)
 
void add_incomplete_placement (BacktrackPlacement *bp)
 
void select_best_final_placement ()
 

Detailed Description

Class used to select the best solution between multiple complete attempts. The best solution is defined as the first one that meet the target stage requirement or the least number of stages in case none of them meet it. The typical sequence being evaluated by the table placement is:

1 - Table selected by dependency only 2 - Table selected by dependency only with backtracking 3 - Table selected by a combination of resources tracking + dependency 4 - Table selected by a combination of resources tracking + dependency with backtracking

The table placement for each strategy will stop and be saved as an incomplete placement if at some point, the algorithm detect that downward dependency requirement are impossible to reach. When such incomplete placement is saved, the next strategy is selected. If none of these strategy is found to produce a placement that fit the target, all of the incomplete placement will be finalized and compared. The one that require the least stages will be selected as the final one. The first strategy are prioritize over the last if multiple strategy require the same number of stages.