@@ -1068,6 +1068,25 @@ struct t_pb_type {
10681068 t_pb_type_power* pb_type_power = nullptr ;
10691069
10701070 t_metadata_dict meta;
1071+
1072+ /* *
1073+ * @brief Check if t_pb_type is the root of the pb graph. Root pb_types correspond to a single top level block type and map to a particular type
1074+ * of location in the FPGA device grid (e.g. Logic, DSP, RAM etc.)
1075+ *
1076+ * @return if t_pb_type is root ot not
1077+ */
1078+ inline bool is_root () const {
1079+ return parent_mode == nullptr ;
1080+ }
1081+
1082+ /* *
1083+ * @brief Check if t_pb_type is a primitive block or equivalently a leaf of the pb graph.
1084+ *
1085+ * @return if t_pb_type is primitive/leaf ot not
1086+ */
1087+ inline bool is_primitive () const {
1088+ return num_modes == 0 ;
1089+ }
10711090};
10721091
10731092/* * Describes an operational mode of a clustered logic block
@@ -1353,7 +1372,7 @@ class t_pb_graph_node {
13531372 t_interconnect_pins** interconnect_pins; /* [0..num_modes-1][0..num_interconnect_in_mode] */
13541373
13551374 // Returns true if this pb_graph_node represents a primitive type (primitives have 0 modes)
1356- bool is_primitive () const { return this ->pb_type ->num_modes == 0 ; }
1375+ bool is_primitive () const { return this ->pb_type ->is_primitive () ; }
13571376
13581377 // Returns true if this pb_graph_node represents a root graph node (ex. clb)
13591378 bool is_root () const { return this ->parent_pb_graph_node == nullptr ; }
@@ -1567,7 +1586,7 @@ enum e_directionality {
15671586};
15681587
15691588/* X_AXIS: Data that describes an x-directed wire segment (CHANX) *
1570- * Y_AXIS: Data that describes an y-directed wire segment (CHANY) *
1589+ * Y_AXIS: Data that describes an y-directed wire segment (CHANY) *
15711590 * BOTH_AXIS: Data that can be applied to both x-directed and y-directed wire segment */
15721591enum e_parallel_axis {
15731592 X_AXIS,
@@ -1624,65 +1643,65 @@ enum e_Fc_type {
16241643 */
16251644struct t_segment_inf {
16261645 /* *
1627- * @brief The name of the segment type
1646+ * @brief The name of the segment type
16281647 */
16291648 std::string name;
16301649
16311650 /* *
1632- * @brief ratio of tracks which are of this segment type.
1651+ * @brief ratio of tracks which are of this segment type.
16331652 */
16341653 int frequency;
16351654
16361655 /* *
1637- * @brief Length (in clbs) of the segment.
1656+ * @brief Length (in clbs) of the segment.
16381657 */
16391658 int length;
16401659
16411660 /* *
1642- * @brief Index of the switch type that connects other wires to this segment.
1643- * Note that this index is in relation to the switches from the architecture file,
1644- * not the expanded list of switches that is built at the end of build_rr_graph.
1661+ * @brief Index of the switch type that connects other wires to this segment.
1662+ * Note that this index is in relation to the switches from the architecture file,
1663+ * not the expanded list of switches that is built at the end of build_rr_graph.
16451664 */
16461665 short arch_wire_switch;
16471666
16481667 /* *
1649- * @brief Index of the switch type that connects output pins to this segment.
1650- * Note that this index is in relation to the switches from the architecture file,
1651- * not the expanded list of switches that is built at the end of build_rr_graph.
1668+ * @brief Index of the switch type that connects output pins to this segment.
1669+ * Note that this index is in relation to the switches from the architecture file,
1670+ * not the expanded list of switches that is built at the end of build_rr_graph.
16521671 */
16531672 short arch_opin_switch;
16541673
16551674 /* *
1656- * @brief Same as arch_wire_switch but used only for decremental tracks if it is
1657- * specified in the architecture file. If -1, this value was not set in the
1658- * architecture file and arch_wire_switch should be used for "DEC_DIR" wire segments.
1675+ * @brief Same as arch_wire_switch but used only for decremental tracks if it is
1676+ * specified in the architecture file. If -1, this value was not set in the
1677+ * architecture file and arch_wire_switch should be used for "DEC_DIR" wire segments.
16591678 */
16601679 short arch_wire_switch_dec = -1 ;
16611680
16621681 /* *
1663- * @brief Same as arch_opin_switch but used only for decremental tracks if
1664- * it is specified in the architecture file. If -1, this value was not set in
1665- * the architecture file and arch_opin_switch should be used for "DEC_DIR" wire segments.
1682+ * @brief Same as arch_opin_switch but used only for decremental tracks if
1683+ * it is specified in the architecture file. If -1, this value was not set in
1684+ * the architecture file and arch_opin_switch should be used for "DEC_DIR" wire segments.
16661685 */
16671686 short arch_opin_switch_dec = -1 ;
16681687
16691688 /* *
1670- * @brief Index of the switch type that connects output pins (OPINs) to this
1671- * segment from another die (layer). Note that this index is in relation to
1672- * the switches from the architecture file, not the expanded list of switches
1673- * that is built at the end of build_rr_graph.
1689+ * @brief Index of the switch type that connects output pins (OPINs) to this
1690+ * segment from another die (layer). Note that this index is in relation to
1691+ * the switches from the architecture file, not the expanded list of switches
1692+ * that is built at the end of build_rr_graph.
16741693 */
16751694 short arch_inter_die_switch = -1 ;
16761695
16771696 /* *
1678- * @brief The fraction of logic blocks along its length to which this segment can connect.
1679- * (i.e. internal population).
1697+ * @brief The fraction of logic blocks along its length to which this segment can connect.
1698+ * (i.e. internal population).
16801699 */
16811700 float frac_cb;
16821701
16831702 /* *
1684- * @brief The fraction of the length + 1 switch blocks along the segment to which the segment can connect.
1685- * Segments that aren't long lines must connect to at least two switch boxes.
1703+ * @brief The fraction of the length + 1 switch blocks along the segment to which the segment can connect.
1704+ * Segments that aren't long lines must connect to at least two switch boxes.
16861705 */
16871706 float frac_sb;
16881707
@@ -1699,27 +1718,27 @@ struct t_segment_inf {
16991718 enum e_directionality directionality;
17001719
17011720 /* *
1702- * @brief Defines what axis the segment is parallel to. See e_parallel_axis
1703- * comments for more details on the values.
1721+ * @brief Defines what axis the segment is parallel to. See e_parallel_axis
1722+ * comments for more details on the values.
17041723 */
17051724 enum e_parallel_axis parallel_axis;
17061725
17071726 /* *
1708- * @brief A vector of booleans indicating whether the segment can connect to a logic block.
1727+ * @brief A vector of booleans indicating whether the segment can connect to a logic block.
17091728 */
17101729 std::vector<bool > cb;
17111730
17121731 /* *
1713- * @brief A vector of booleans indicating whether the segment can connect to a switch block.
1732+ * @brief A vector of booleans indicating whether the segment can connect to a switch block.
17141733 */
17151734 std::vector<bool > sb;
17161735
17171736 /* *
17181737 * @brief The index of the segment as stored in the appropriate Segs list.
1719- * Upon loading the architecture, we use this field to keep track of the
1720- * segment's index in the unified segment_inf vector. This is useful when
1721- * building the rr_graph for different Y & X channels in terms of track
1722- * distribution and segment type.
1738+ * Upon loading the architecture, we use this field to keep track of the
1739+ * segment's index in the unified segment_inf vector. This is useful when
1740+ * building the rr_graph for different Y & X channels in terms of track
1741+ * distribution and segment type.
17231742 */
17241743 int seg_index;
17251744
@@ -1728,7 +1747,7 @@ struct t_segment_inf {
17281747 * Possible values are:
17291748 * - GENERAL: The segment is part of the general routing resources.
17301749 * - GCLK: The segment is part of the global routing network.
1731- * For backward compatibility, this attribute is optional. If not specified,
1750+ * For backward compatibility, this attribute is optional. If not specified,
17321751 * the resource type for the segment is considered to be GENERAL.
17331752 */
17341753 enum SegResType res_type = SegResType::GENERAL;
@@ -1778,12 +1797,12 @@ constexpr std::array<const char*, size_t(SwitchType::NUM_SWITCH_TYPES)> SWITCH_T
17781797
17791798/* Constant/Reserved names for switches in architecture XML
17801799 * Delayless switch:
1781- * The zero-delay switch created by VPR internally
1800+ * The zero-delay switch created by VPR internally
17821801 * This is a special switch just to ease CAD algorithms
17831802 * It is mainly used in
1784- * - the edges between SOURCE and SINK nodes in routing resource graphs
1803+ * - the edges between SOURCE and SINK nodes in routing resource graphs
17851804 * - the edges in CLB-to-CLB connections (defined by <directlist> in arch XML)
1786- *
1805+ *
17871806 */
17881807constexpr const char * VPR_DELAYLESS_SWITCH_NAME = " __vpr_delayless_switch__" ;
17891808
0 commit comments