@@ -1068,6 +1068,25 @@ struct t_pb_type {
1068
1068
t_pb_type_power* pb_type_power = nullptr ;
1069
1069
1070
1070
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
+ }
1071
1090
};
1072
1091
1073
1092
/* * Describes an operational mode of a clustered logic block
@@ -1353,7 +1372,7 @@ class t_pb_graph_node {
1353
1372
t_interconnect_pins** interconnect_pins; /* [0..num_modes-1][0..num_interconnect_in_mode] */
1354
1373
1355
1374
// 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 () ; }
1357
1376
1358
1377
// Returns true if this pb_graph_node represents a root graph node (ex. clb)
1359
1378
bool is_root () const { return this ->parent_pb_graph_node == nullptr ; }
@@ -1567,7 +1586,7 @@ enum e_directionality {
1567
1586
};
1568
1587
1569
1588
/* 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) *
1571
1590
* BOTH_AXIS: Data that can be applied to both x-directed and y-directed wire segment */
1572
1591
enum e_parallel_axis {
1573
1592
X_AXIS,
@@ -1624,65 +1643,65 @@ enum e_Fc_type {
1624
1643
*/
1625
1644
struct t_segment_inf {
1626
1645
/* *
1627
- * @brief The name of the segment type
1646
+ * @brief The name of the segment type
1628
1647
*/
1629
1648
std::string name;
1630
1649
1631
1650
/* *
1632
- * @brief ratio of tracks which are of this segment type.
1651
+ * @brief ratio of tracks which are of this segment type.
1633
1652
*/
1634
1653
int frequency;
1635
1654
1636
1655
/* *
1637
- * @brief Length (in clbs) of the segment.
1656
+ * @brief Length (in clbs) of the segment.
1638
1657
*/
1639
1658
int length;
1640
1659
1641
1660
/* *
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.
1645
1664
*/
1646
1665
short arch_wire_switch;
1647
1666
1648
1667
/* *
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.
1652
1671
*/
1653
1672
short arch_opin_switch;
1654
1673
1655
1674
/* *
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.
1659
1678
*/
1660
1679
short arch_wire_switch_dec = -1 ;
1661
1680
1662
1681
/* *
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.
1666
1685
*/
1667
1686
short arch_opin_switch_dec = -1 ;
1668
1687
1669
1688
/* *
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.
1674
1693
*/
1675
1694
short arch_inter_die_switch = -1 ;
1676
1695
1677
1696
/* *
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).
1680
1699
*/
1681
1700
float frac_cb;
1682
1701
1683
1702
/* *
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.
1686
1705
*/
1687
1706
float frac_sb;
1688
1707
@@ -1699,27 +1718,27 @@ struct t_segment_inf {
1699
1718
enum e_directionality directionality;
1700
1719
1701
1720
/* *
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.
1704
1723
*/
1705
1724
enum e_parallel_axis parallel_axis;
1706
1725
1707
1726
/* *
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.
1709
1728
*/
1710
1729
std::vector<bool > cb;
1711
1730
1712
1731
/* *
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.
1714
1733
*/
1715
1734
std::vector<bool > sb;
1716
1735
1717
1736
/* *
1718
1737
* @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.
1723
1742
*/
1724
1743
int seg_index;
1725
1744
@@ -1728,7 +1747,7 @@ struct t_segment_inf {
1728
1747
* Possible values are:
1729
1748
* - GENERAL: The segment is part of the general routing resources.
1730
1749
* - 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,
1732
1751
* the resource type for the segment is considered to be GENERAL.
1733
1752
*/
1734
1753
enum SegResType res_type = SegResType::GENERAL;
@@ -1778,12 +1797,12 @@ constexpr std::array<const char*, size_t(SwitchType::NUM_SWITCH_TYPES)> SWITCH_T
1778
1797
1779
1798
/* Constant/Reserved names for switches in architecture XML
1780
1799
* Delayless switch:
1781
- * The zero-delay switch created by VPR internally
1800
+ * The zero-delay switch created by VPR internally
1782
1801
* This is a special switch just to ease CAD algorithms
1783
1802
* 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
1785
1804
* - the edges in CLB-to-CLB connections (defined by <directlist> in arch XML)
1786
- *
1805
+ *
1787
1806
*/
1788
1807
constexpr const char * VPR_DELAYLESS_SWITCH_NAME = " __vpr_delayless_switch__" ;
1789
1808
0 commit comments