|
41 | 41 |
|
42 | 42 | #include "logic_types.h"
|
43 | 43 | #include "clock_types.h"
|
| 44 | +#include "switchblock_types.h" |
44 | 45 |
|
45 | 46 | //Forward declarations
|
46 | 47 | struct t_clock_network;
|
@@ -171,24 +172,6 @@ enum e_interconnect {
|
171 | 172 | MUX_INTERC = 3
|
172 | 173 | };
|
173 | 174 |
|
174 |
| -/* Orientations. */ |
175 |
| -enum e_side : unsigned char { |
176 |
| - TOP = 0, |
177 |
| - RIGHT = 1, |
178 |
| - BOTTOM = 2, |
179 |
| - LEFT = 3, |
180 |
| - NUM_2D_SIDES = 4, |
181 |
| - ABOVE = 5, |
182 |
| - UNDER = 7, |
183 |
| - NUM_3D_SIDES = 6, |
184 |
| -}; |
185 |
| - |
186 |
| -constexpr std::array<e_side, NUM_2D_SIDES> TOTAL_2D_SIDES = {{TOP, RIGHT, BOTTOM, LEFT}}; //Set of all side orientations |
187 |
| -constexpr std::array<const char*, NUM_2D_SIDES> TOTAL_2D_SIDE_STRINGS = {{"TOP", "RIGHT", "BOTTOM", "LEFT"}}; //String versions of side orientations |
188 |
| - |
189 |
| -constexpr std::array<e_side, NUM_3D_SIDES> TOTAL_3D_SIDES = {{TOP, RIGHT, BOTTOM, LEFT, ABOVE, UNDER}}; //Set of all side orientations including different layers |
190 |
| -constexpr std::array<const char*, NUM_3D_SIDES> TOTAL_3D_SIDE_STRINGS = {{"TOP", "RIGHT", "BOTTOM", "LEFT", "ABOVE", "UNDER"}}; //String versions of side orientations including different layers |
191 |
| - |
192 | 175 | /* pin location distributions */
|
193 | 176 | enum class e_pin_location_distr {
|
194 | 177 | SPREAD,
|
@@ -253,26 +236,6 @@ enum e_power_estimation_method_ {
|
253 | 236 | typedef enum e_power_estimation_method_ e_power_estimation_method;
|
254 | 237 | typedef enum e_power_estimation_method_ t_power_estimation_method;
|
255 | 238 |
|
256 |
| -/* Specifies what part of the FPGA a custom switchblock should be built in (i.e. perimeter, core, everywhere) */ |
257 |
| -enum class e_sb_location { |
258 |
| - E_PERIMETER = 0, |
259 |
| - E_CORNER, |
260 |
| - E_FRINGE, /* perimeter minus corners */ |
261 |
| - E_CORE, |
262 |
| - E_EVERYWHERE, |
263 |
| - E_XY_SPECIFIED |
264 |
| -}; |
265 |
| - |
266 |
| -/** |
267 |
| - * @brief Describes regions that a specific switch block specifications should be applied to |
268 |
| - */ |
269 |
| -struct t_sb_loc_spec { |
270 |
| - int start = -1; |
271 |
| - int repeat = -1; |
272 |
| - int incr = -1; |
273 |
| - int end = -1; |
274 |
| -}; |
275 |
| - |
276 | 239 | /*************************************************************************************************/
|
277 | 240 | /* FPGA grid layout data types */
|
278 | 241 | /*************************************************************************************************/
|
@@ -614,9 +577,6 @@ enum class e_sb_type {
|
614 | 577 |
|
615 | 578 | };
|
616 | 579 |
|
617 |
| -constexpr int NO_SWITCH = -1; |
618 |
| -constexpr int DEFAULT_SWITCH = -2; |
619 |
| - |
620 | 580 | /* Describes the type for a physical tile
|
621 | 581 | * name: unique identifier for type
|
622 | 582 | * num_pins: Number of pins for the block
|
@@ -1668,11 +1628,6 @@ struct t_chan_width_dist {
|
1668 | 1628 | t_chan chan_y_dist;
|
1669 | 1629 | };
|
1670 | 1630 |
|
1671 |
| -enum e_directionality { |
1672 |
| - UNI_DIRECTIONAL, |
1673 |
| - BI_DIRECTIONAL |
1674 |
| -}; |
1675 |
| - |
1676 | 1631 | /* X_AXIS: Data that describes an x-directed wire segment (CHANX) *
|
1677 | 1632 | * Y_AXIS: Data that describes an y-directed wire segment (CHANY) *
|
1678 | 1633 | * BOTH_AXIS: Data that can be applied to both x-directed and y-directed wire segment */
|
@@ -1730,95 +1685,83 @@ enum e_Fc_type {
|
1730 | 1685 | * used if the route_type is DETAILED. [0 .. det_routing_arch.num_segment]
|
1731 | 1686 | */
|
1732 | 1687 | struct t_segment_inf {
|
1733 |
| - /** |
1734 |
| - * @brief The name of the segment type |
1735 |
| - */ |
| 1688 | + /// The name of the segment type |
1736 | 1689 | std::string name;
|
1737 | 1690 |
|
1738 |
| - /** |
1739 |
| - * @brief ratio of tracks which are of this segment type. |
1740 |
| - */ |
| 1691 | + /// brief ratio of tracks which are of this segment type. |
1741 | 1692 | int frequency;
|
1742 | 1693 |
|
1743 |
| - /** |
1744 |
| - * @brief Length (in clbs) of the segment. |
1745 |
| - */ |
| 1694 | + /// Length (in clbs) of the segment. |
1746 | 1695 | int length;
|
1747 | 1696 |
|
1748 | 1697 | /**
|
1749 |
| - * @brief Index of the switch type that connects other wires to this segment. |
| 1698 | + * @brief Index of the switch type that connects other wires to this segment. |
1750 | 1699 | * Note that this index is in relation to the switches from the architecture file,
|
1751 | 1700 | * not the expanded list of switches that is built at the end of build_rr_graph.
|
1752 | 1701 | */
|
1753 | 1702 | short arch_wire_switch;
|
1754 | 1703 |
|
1755 | 1704 | /**
|
1756 |
| - * @brief Index of the switch type that connects output pins to this segment. |
| 1705 | + * @brief Index of the switch type that connects output pins to this segment. |
1757 | 1706 | * Note that this index is in relation to the switches from the architecture file,
|
1758 | 1707 | * not the expanded list of switches that is built at the end of build_rr_graph.
|
1759 | 1708 | */
|
1760 | 1709 | short arch_opin_switch;
|
1761 | 1710 |
|
1762 | 1711 | /**
|
1763 |
| - * @brief Same as arch_wire_switch but used only for decremental tracks if it is |
| 1712 | + * @brief Same as arch_wire_switch but used only for decremental tracks if it is |
1764 | 1713 | * specified in the architecture file. If -1, this value was not set in the
|
1765 | 1714 | * architecture file and arch_wire_switch should be used for "DEC_DIR" wire segments.
|
1766 | 1715 | */
|
1767 | 1716 | short arch_wire_switch_dec = -1;
|
1768 | 1717 |
|
1769 | 1718 | /**
|
1770 |
| - * @brief Same as arch_opin_switch but used only for decremental tracks if |
| 1719 | + * @brief Same as arch_opin_switch but used only for decremental tracks if |
1771 | 1720 | * it is specified in the architecture file. If -1, this value was not set in
|
1772 | 1721 | * the architecture file and arch_opin_switch should be used for "DEC_DIR" wire segments.
|
1773 | 1722 | */
|
1774 | 1723 | short arch_opin_switch_dec = -1;
|
1775 | 1724 |
|
1776 | 1725 | /**
|
1777 |
| - * @brief Index of the switch type that connects output pins (OPINs) to this |
| 1726 | + * @brief Index of the switch type that connects output pins (OPINs) to this |
1778 | 1727 | * segment from another die (layer). Note that this index is in relation to
|
1779 | 1728 | * the switches from the architecture file, not the expanded list of switches
|
1780 | 1729 | * that is built at the end of build_rr_graph.
|
1781 | 1730 | */
|
1782 | 1731 | short arch_inter_die_switch = -1;
|
1783 | 1732 |
|
1784 | 1733 | /**
|
1785 |
| - * @brief The fraction of logic blocks along its length to which this segment can connect. |
| 1734 | + * @brief The fraction of logic blocks along its length to which this segment can connect. |
1786 | 1735 | * (i.e. internal population).
|
1787 | 1736 | */
|
1788 | 1737 | float frac_cb;
|
1789 | 1738 |
|
1790 | 1739 | /**
|
1791 |
| - * @brief The fraction of the length + 1 switch blocks along the segment to which the segment can connect. |
| 1740 | + * @brief The fraction of the length + 1 switch blocks along the segment to which the segment can connect. |
1792 | 1741 | * Segments that aren't long lines must connect to at least two switch boxes.
|
1793 | 1742 | */
|
1794 | 1743 | float frac_sb;
|
1795 | 1744 |
|
1796 | 1745 | bool longline;
|
1797 | 1746 |
|
1798 |
| - /** |
1799 |
| - * @brief The resistance of a routing track, per unit logic block length. */ |
| 1747 | + /// The resistance of a routing track, per unit logic block length. |
1800 | 1748 | float Rmetal;
|
1801 | 1749 |
|
1802 |
| - /** |
1803 |
| - * @brief The capacitance of a routing track, per unit logic block length. */ |
| 1750 | + /// The capacitance of a routing track, per unit logic block length. |
1804 | 1751 | float Cmetal;
|
1805 | 1752 |
|
1806 | 1753 | enum e_directionality directionality;
|
1807 | 1754 |
|
1808 | 1755 | /**
|
1809 |
| - * @brief Defines what axis the segment is parallel to. See e_parallel_axis |
| 1756 | + * @brief Defines what axis the segment is parallel to. See e_parallel_axis |
1810 | 1757 | * comments for more details on the values.
|
1811 | 1758 | */
|
1812 | 1759 | enum e_parallel_axis parallel_axis;
|
1813 | 1760 |
|
1814 |
| - /** |
1815 |
| - * @brief A vector of booleans indicating whether the segment can connect to a logic block. |
1816 |
| - */ |
| 1761 | + /// A vector of booleans indicating whether the segment can connect to a logic block. |
1817 | 1762 | std::vector<bool> cb;
|
1818 | 1763 |
|
1819 |
| - /** |
1820 |
| - * @brief A vector of booleans indicating whether the segment can connect to a switch block. |
1821 |
| - */ |
| 1764 | + /// A vector of booleans indicating whether the segment can connect to a switch block. |
1822 | 1765 | std::vector<bool> sb;
|
1823 | 1766 |
|
1824 | 1767 | /**
|
@@ -2084,101 +2027,6 @@ struct t_direct_inf {
|
2084 | 2027 | int line;
|
2085 | 2028 | };
|
2086 | 2029 |
|
2087 |
| -enum class SwitchPointOrder { |
2088 |
| - FIXED, //Switchpoints are ordered as specified in architecture |
2089 |
| - SHUFFLED //Switchpoints are shuffled (more diversity) |
2090 |
| -}; |
2091 |
| - |
2092 |
| -//A collection of switchpoints associated with a segment |
2093 |
| -struct t_wire_switchpoints { |
2094 |
| - std::string segment_name; //The type of segment |
2095 |
| - std::vector<int> switchpoints; //The indices of wire points along the segment |
2096 |
| -}; |
2097 |
| - |
2098 |
| -/* Used to list information about a set of track segments that should connect through a switchblock */ |
2099 |
| -struct t_wireconn_inf { |
2100 |
| - std::vector<t_wire_switchpoints> from_switchpoint_set; //The set of segment/wirepoints representing the 'from' set (union of all t_wire_switchpoints in vector) |
2101 |
| - std::vector<t_wire_switchpoints> to_switchpoint_set; //The set of segment/wirepoints representing the 'to' set (union of all t_wire_switchpoints in vector) |
2102 |
| - SwitchPointOrder from_switchpoint_order = SwitchPointOrder::FIXED; //The desired from_switchpoint_set ordering |
2103 |
| - SwitchPointOrder to_switchpoint_order = SwitchPointOrder::FIXED; //The desired to_switchpoint_set ordering |
2104 |
| - int switch_override_indx = DEFAULT_SWITCH; // index in switch array of the switch used to override wire_switch of the 'to' set. |
2105 |
| - // DEFAULT_SWITCH is a sentinel value (i.e. the usual driving switch from a wire for the receiving wire will be used) |
2106 |
| - |
2107 |
| - std::string num_conns_formula; /* Specifies how many connections should be made for this wireconn. |
2108 |
| - * |
2109 |
| - * '<int>': A specific number of connections |
2110 |
| - * 'from': The number of generated connections between the 'from' and 'to' sets equals the |
2111 |
| - * size of the 'from' set. This ensures every element in the from set is connected |
2112 |
| - * to an element of the 'to' set. |
2113 |
| - * Note: this it may result in 'to' elements being driven by multiple 'from' |
2114 |
| - * elements (if 'from' is larger than 'to'), or in some elements of 'to' having |
2115 |
| - * no driving connections (if 'to' is larger than 'from'). |
2116 |
| - * 'to': The number of generated connections is set equal to the size of the 'to' set. |
2117 |
| - * This ensures that each element of the 'to' set has precisely one incoming connection. |
2118 |
| - * Note: this may result in 'from' elements driving multiple 'to' elements (if 'to' is |
2119 |
| - * larger than 'from'), or some 'from' elements driving to 'to' elements (if 'from' is |
2120 |
| - * larger than 'to') |
2121 |
| - */ |
2122 |
| -}; |
2123 |
| - |
2124 |
| -/* represents a connection between two sides of a switchblock */ |
2125 |
| -class SB_Side_Connection { |
2126 |
| - public: |
2127 |
| - /* specify the two SB sides that form a connection */ |
2128 |
| - enum e_side from_side = TOP; |
2129 |
| - enum e_side to_side = TOP; |
2130 |
| - |
2131 |
| - void set_sides(enum e_side from, enum e_side to) { |
2132 |
| - from_side = from; |
2133 |
| - to_side = to; |
2134 |
| - } |
2135 |
| - |
2136 |
| - SB_Side_Connection() = default; |
2137 |
| - |
2138 |
| - SB_Side_Connection(enum e_side from, enum e_side to) |
2139 |
| - : from_side(from) |
2140 |
| - , to_side(to) { |
2141 |
| - } |
2142 |
| - |
2143 |
| - /* overload < operator which will be used by std::map */ |
2144 |
| - bool operator<(const SB_Side_Connection& obj) const { |
2145 |
| - bool result; |
2146 |
| - |
2147 |
| - if (from_side < obj.from_side) { |
2148 |
| - result = true; |
2149 |
| - } else { |
2150 |
| - if (from_side == obj.from_side) { |
2151 |
| - result = (to_side < obj.to_side) ? true : false; |
2152 |
| - } else { |
2153 |
| - result = false; |
2154 |
| - } |
2155 |
| - } |
2156 |
| - |
2157 |
| - return result; |
2158 |
| - } |
2159 |
| -}; |
2160 |
| - |
2161 |
| -/* Use a map to index into the string permutation functions used to connect from one side to another */ |
2162 |
| -typedef std::map<SB_Side_Connection, std::vector<std::string>> t_permutation_map; |
2163 |
| - |
2164 |
| -/* Lists all information about a particular switch block specified in the architecture file */ |
2165 |
| -struct t_switchblock_inf { |
2166 |
| - std::string name; /* the name of this switchblock */ |
2167 |
| - e_sb_location location; /* where on the FPGA this switchblock should be built (i.e. perimeter, core, everywhere) */ |
2168 |
| - e_directionality directionality; /* the directionality of this switchblock (unidir/bidir) */ |
2169 |
| - |
2170 |
| - int x = -1; /* The exact x-axis location that this SB is used, meaningful when type is set to E_XY_specified */ |
2171 |
| - int y = -1; /* The exact y-axis location that this SB is used, meaningful when type is set to E_XY_specified */ |
2172 |
| - |
2173 |
| - /* We can also define a region to apply this SB to all locations falls into this region using regular expression in the architecture file*/ |
2174 |
| - t_sb_loc_spec reg_x; |
2175 |
| - t_sb_loc_spec reg_y; |
2176 |
| - |
2177 |
| - t_permutation_map permutation_map; /* map holding the permutation functions attributed to this switchblock */ |
2178 |
| - |
2179 |
| - std::vector<t_wireconn_inf> wireconns; /* list of wire types/groups this SB will connect */ |
2180 |
| -}; |
2181 |
| - |
2182 | 2030 | /* Clock related data types used for building a dedicated clock network */
|
2183 | 2031 | struct t_clock_arch_spec {
|
2184 | 2032 | std::vector<t_clock_network_arch> clock_networks_arch;
|
|
0 commit comments