@@ -829,36 +829,90 @@ struct t_annealing_sched {
829
829
float success_target;
830
830
};
831
831
832
- /* Various options for the placer. *
833
- * place_algorithm: BOUNDING_BOX_PLACE or PATH_TIMING_DRIVEN_PLACE *
834
- * timing_tradeoff: When TIMING_DRIVEN_PLACE mode, what is the tradeoff *
835
- * timing driven and BOUNDING_BOX_PLACE. *
836
- * place_cost_exp: Power to which denominator is raised for linear_cong. *
837
- * place_chan_width: The channel width assumed if only one placement is *
838
- * performed. *
839
- * pad_loc_type: Are pins free to move during placement or fixed randomly. *
840
- * constraints_file: File used to lock block locations during placement. *
841
- * place_freq: Should the placement be skipped, done once, or done for each *
842
- * channel width in the binary search. *
843
- * recompute_crit_iter: how many temperature stages pass before we recompute *
844
- * criticalities based on average point to point delay *
845
- * inner_loop_crit_divider: (move_lim/inner_loop_crit_divider) determines how*
846
- * many inner_loop iterations pass before a recompute of *
847
- * criticalities is done. *
848
- * td_place_exp_first: exponent that is used on the timing_driven criticlity *
849
- * it is the value that the exponent starts at. *
850
- * td_place_exp_last: value that the criticality exponent will be at the end *
851
- * doPlacement: true if placement is supposed to be done in the CAD flow, false otherwise */
832
+ /* *****************************************************************
833
+ * Placer data types
834
+ *******************************************************************/
835
+
836
+ /* *
837
+ * @brief Types of placement algorithms used in the placer.
838
+ *
839
+ * @param BOUNDING_BOX_PLACE
840
+ * Focuses purely on minimizing the bounding
841
+ * box wirelength of the circuit.
842
+ * @param CRITICALITY_TIMING_PLACE
843
+ * Focuses on minimizing both the wirelength and the
844
+ * connection timing costs (criticality * delay).
845
+ * @param SLACK_TIMING_PLACE
846
+ * Focuses on improving the circuit slack values
847
+ * to reduce critical path delay.
848
+ *
849
+ * The default is to use CRITICALITY_TIMING_PLACE. BOUNDING_BOX_PLACE
850
+ * is used when there is no timing information available (wiring only).
851
+ * SLACK_TIMING_PLACE is mainly feasible during placement quench.
852
+ */
852
853
enum e_place_algorithm {
853
854
BOUNDING_BOX_PLACE,
854
- PATH_TIMING_DRIVEN_PLACE
855
+ CRITICALITY_TIMING_PLACE,
856
+ SLACK_TIMING_PLACE
857
+ };
858
+
859
+ /* *
860
+ * @brief Provides a wrapper around enum e_place_algorithm.
861
+ *
862
+ * Supports the method is_timing_driven(), which allows flexible updates
863
+ * to the placer algorithms if more timing driven placement strategies
864
+ * are added in tht future. This method is used across various placement
865
+ * setup files, and it can be useful for major placer routines as well.
866
+ *
867
+ * More methods can be added to this class if the placement strategies
868
+ * will be further divided into more categories the future.
869
+ *
870
+ * Also supports assignments and comparisons between t_place_algorithm
871
+ * and e_place_algorithm so as not to break down previous codes.
872
+ */
873
+ class t_place_algorithm {
874
+ public:
875
+ // Constructors
876
+ t_place_algorithm () = default ;
877
+ t_place_algorithm (e_place_algorithm _algo)
878
+ : algo(_algo) {}
879
+ ~t_place_algorithm () = default ;
880
+
881
+ // Assignment operators
882
+ t_place_algorithm& operator =(const t_place_algorithm& rhs) {
883
+ algo = rhs.algo ;
884
+ return *this ;
885
+ }
886
+ t_place_algorithm& operator =(e_place_algorithm rhs) {
887
+ algo = rhs;
888
+ return *this ;
889
+ }
890
+
891
+ // Equality operators
892
+ bool operator ==(const t_place_algorithm& rhs) const { return algo == rhs.algo ; }
893
+ bool operator ==(e_place_algorithm rhs) const { return algo == rhs; }
894
+ bool operator !=(const t_place_algorithm& rhs) const { return algo != rhs.algo ; }
895
+ bool operator !=(e_place_algorithm rhs) const { return algo != rhs; }
896
+
897
+ // /@brief Check if the algorithm belongs to the timing driven category.
898
+ inline bool is_timing_driven () const {
899
+ return algo == CRITICALITY_TIMING_PLACE || algo == SLACK_TIMING_PLACE;
900
+ }
901
+
902
+ // /@brief Accessor: returns the underlying e_place_algorithm enum value.
903
+ e_place_algorithm get () const { return algo; }
904
+
905
+ private:
906
+ // /@brief The underlying algorithm. Default set to CRITICALITY_TIMING_PLACE.
907
+ e_place_algorithm algo = e_place_algorithm::CRITICALITY_TIMING_PLACE;
855
908
};
856
909
857
910
enum e_pad_loc_type {
858
911
FREE,
859
912
RANDOM
860
913
};
861
914
915
+ // /@brief Used to calculate the inner placer loop's block swapping limit move_lim.
862
916
enum e_place_effort_scaling {
863
917
CIRCUIT, // /<Effort scales based on circuit size only
864
918
DEVICE_CIRCUIT // /<Effort scales based on both circuit and device size
@@ -889,8 +943,54 @@ enum class e_place_delta_delay_algorithm {
889
943
DIJKSTRA_EXPANSION,
890
944
};
891
945
946
+ /* *
947
+ * @brief Various options for the placer.
948
+ *
949
+ * @param place_algorithm
950
+ * Controls which placement algorithm is used.
951
+ * @param place_quench_algorithm
952
+ * Controls which placement algorithm is used
953
+ * during placement quench.
954
+ * @param timing_tradeoff
955
+ * When in CRITICALITY_TIMING_PLACE mode, what is the
956
+ * tradeoff between timing and wiring costs.
957
+ * @param place_cost_exp
958
+ * Power to which denominator is raised for linear_cong.
959
+ * @param place_chan_width
960
+ * The channel width assumed if only one placement is performed.
961
+ * @param pad_loc_type
962
+ * Are pins FREE or fixed randomly.
963
+ * @param constraints_file
964
+ * File that specifies locations of locked down (constrained)
965
+ * blocks for placement. Empty string means no constraints file.
966
+ * @param pad_loc_file
967
+ * File to read pad locations from if pad_loc_type is USER.
968
+ * @param place_freq
969
+ * Should the placement be skipped, done once, or done
970
+ * for each channel width in the binary search.
971
+ * @param recompute_crit_iter
972
+ * How many temperature stages pass before we recompute
973
+ * criticalities based on the current placement and its
974
+ * estimated point-to-point delays.
975
+ * @param inner_loop_crit_divider
976
+ * (move_lim/inner_loop_crit_divider) determines how
977
+ * many inner_loop iterations pass before a recompute
978
+ * of criticalities is done.
979
+ * @param td_place_exp_first
980
+ * Exponent that is used in the CRITICALITY_TIMING_PLACE
981
+ * mode to specify the initial value of `crit_exponent`.
982
+ * After we map the slacks to criticalities, this value
983
+ * is used to `sharpen` the criticalities, making connections
984
+ * with worse slacks more critical.
985
+ * @param td_place_exp_last
986
+ * Value that the crit_exponent will be at the end.
987
+ * @param doPlacement
988
+ * True if placement is supposed to be done in the CAD flow.
989
+ * False if otherwise.
990
+ */
892
991
struct t_placer_opts {
893
- enum e_place_algorithm place_algorithm;
992
+ t_place_algorithm place_algorithm;
993
+ t_place_algorithm place_quench_algorithm;
894
994
float timing_tradeoff;
895
995
float place_cost_exp;
896
996
int place_chan_width;
0 commit comments