Skip to content

Commit 64bf3b4

Browse files
Merge pull request #2946 from verilog-to-routing/3d_sb
3D SW Architecture
2 parents 53b0cad + 7bf5c1f commit 64bf3b4

File tree

8 files changed

+228
-123
lines changed

8 files changed

+228
-123
lines changed

libs/libarchfpga/src/echo_arch.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,7 @@ void PrintArchInfo(FILE* Echo, const t_arch* arch) {
297297
int num_layers = (int)layout.layers.size();
298298
if (num_layers > 1) {
299299
fprintf(Echo, "\t\t\t\ttype unidir mux_name for between two dice connections: %s\n",
300-
arch->switches[seg.arch_opin_between_dice_switch].name.c_str());
300+
arch->switches[seg.arch_inter_die_switch].name.c_str());
301301
}
302302
}
303303
} else { //Should be bidir

libs/libarchfpga/src/physical_types.h

Lines changed: 110 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -1599,88 +1599,138 @@ enum e_Fc_type {
15991599
FRACTIONAL
16001600
};
16011601

1602-
/* Lists all the important information about a certain segment type. Only *
1603-
* used if the route_type is DETAILED. [0 .. det_routing_arch.num_segment] *
1604-
* name: the name of this segment *
1605-
* frequency: ratio of tracks which are of this segment type. *
1606-
* length: Length (in clbs) of the segment. *
1607-
* arch_wire_switch: Index of the switch type that connects other wires *
1608-
* *to* this segment. Note that this index is in relation *
1609-
* to the switches from the architecture file, not the *
1610-
* expanded list of switches that is built at the end of *
1611-
* build_rr_graph. *
1612-
* arch_opin_switch: Index of the switch type that connects output pins *
1613-
* (OPINs) *to* this segment. Note that this index is in *
1614-
* relation to the switches from the architecture file, *
1615-
* not the expanded list of switches that is built *
1616-
* at the end of build_rr_graph *
1617-
* @param arch_wire_switch_dec: Same as arch_wire_switch but used only for *
1618-
* decremental tracks if it is specified in the *
1619-
* architecture file. If -1, this value was not set in *
1620-
* the architecture file and arch_wire_switch should be *
1621-
* used for "DEC_DIR" wire segments. *
1622-
* @param arch_opin_switch_dec: Same as arch_opin_switch but used only for *
1623-
* decremental tracks if it is specified in the *
1624-
* architecture file. If -1, this value was not set in *
1625-
* the architecture file and arch_opin_switch should be *
1626-
* used for "DEC_DIR" wire segments. *
1627-
* @param arch_opin_between_dice_switch: Index of the switch type that *
1628-
* connects output pins (OPINs) *to* this segment from *
1629-
* *another die (layer)*. Note that this index is in *
1630-
* relation to the switches from the architecture file, *
1631-
* not the expanded list of switches that is built at *
1632-
* the end of build_rr_graph *
1633-
* *
1634-
* frac_cb: The fraction of logic blocks along its length to which this *
1635-
* segment can connect. (i.e. internal population). *
1636-
* frac_sb: The fraction of the length + 1 switch blocks along the segment *
1637-
* to which the segment can connect. Segments that aren't long *
1638-
* lines must connect to at least two switch boxes. *
1639-
* parallel_axis: Defines what axis the segment is parallel to. See *
1640-
* e_parallel_axis comments for more details on the values. *
1641-
* Cmetal: Capacitance of a routing track, per unit logic block length. *
1642-
* Rmetal: Resistance of a routing track, per unit logic block length. *
1643-
* (UDSD by AY) drivers: How do signals driving a routing track connect to *
1644-
* the track? *
1645-
* seg_index: The index of the segment as stored in the appropriate Segs list*
1646-
* Upon loading the architecture, we use this field to keep track *
1647-
* the segment's index in the unified segment_inf vector. This is *
1648-
* useful when building the rr_graph for different Y & X channels *
1649-
* in terms of track distribution and segment type. *
1650-
* res_type: Determines the routing network to which the segment belongs. *
1651-
* Possible values are: *
1652-
* - GENERAL: The segment is part of the general routing *
1653-
* resources. *
1654-
* - GCLK: The segment is part of the global routing network. *
1655-
* For backward compatibility, this attribute is optional. If not *
1656-
* specified, the resource type for the segment is considered to *
1657-
* be GENERAL. *
1658-
* meta: Table storing extra arbitrary metadata attributes. */
1602+
/**
1603+
* @brief Lists all the important information about a certain segment type. Only
1604+
* used if the route_type is DETAILED. [0 .. det_routing_arch.num_segment]
1605+
*/
16591606
struct t_segment_inf {
1607+
/**
1608+
* @brief The name of the segment type
1609+
*/
16601610
std::string name;
1611+
1612+
/**
1613+
* @brief ratio of tracks which are of this segment type.
1614+
*/
16611615
int frequency;
1616+
1617+
/**
1618+
* @brief Length (in clbs) of the segment.
1619+
*/
16621620
int length;
1621+
1622+
/**
1623+
* @brief Index of the switch type that connects other wires to this segment.
1624+
* Note that this index is in relation to the switches from the architecture file,
1625+
* not the expanded list of switches that is built at the end of build_rr_graph.
1626+
*/
16631627
short arch_wire_switch;
1628+
1629+
/**
1630+
* @brief Index of the switch type that connects output pins to this segment.
1631+
* Note that this index is in relation to the switches from the architecture file,
1632+
* not the expanded list of switches that is built at the end of build_rr_graph.
1633+
*/
16641634
short arch_opin_switch;
1635+
1636+
/**
1637+
* @brief Same as arch_wire_switch but used only for decremental tracks if it is
1638+
* specified in the architecture file. If -1, this value was not set in the
1639+
* architecture file and arch_wire_switch should be used for "DEC_DIR" wire segments.
1640+
*/
16651641
short arch_wire_switch_dec = -1;
1642+
1643+
/**
1644+
* @brief Same as arch_opin_switch but used only for decremental tracks if
1645+
* it is specified in the architecture file. If -1, this value was not set in
1646+
* the architecture file and arch_opin_switch should be used for "DEC_DIR" wire segments.
1647+
*/
16661648
short arch_opin_switch_dec = -1;
1667-
short arch_opin_between_dice_switch = -1;
1649+
1650+
/**
1651+
* @brief Index of the switch type that connects output pins (OPINs) to this
1652+
* segment from another die (layer). Note that this index is in relation to
1653+
* the switches from the architecture file, not the expanded list of switches
1654+
* that is built at the end of build_rr_graph.
1655+
*/
1656+
short arch_inter_die_switch = -1;
1657+
1658+
/**
1659+
* @brief The fraction of logic blocks along its length to which this segment can connect.
1660+
* (i.e. internal population).
1661+
*/
16681662
float frac_cb;
1663+
1664+
/**
1665+
* @brief The fraction of the length + 1 switch blocks along the segment to which the segment can connect.
1666+
* Segments that aren't long lines must connect to at least two switch boxes.
1667+
*/
16691668
float frac_sb;
1669+
16701670
bool longline;
1671+
1672+
/**
1673+
* @brief The resistance of a routing track, per unit logic block length. */
16711674
float Rmetal;
1675+
1676+
/**
1677+
* @brief The capacitance of a routing track, per unit logic block length. */
16721678
float Cmetal;
1679+
16731680
enum e_directionality directionality;
1681+
1682+
/**
1683+
* @brief Defines what axis the segment is parallel to. See e_parallel_axis
1684+
* comments for more details on the values.
1685+
*/
16741686
enum e_parallel_axis parallel_axis;
1687+
1688+
/**
1689+
* @brief A vector of booleans indicating whether the segment can connect to a logic block.
1690+
*/
16751691
std::vector<bool> cb;
1692+
1693+
/**
1694+
* @brief A vector of booleans indicating whether the segment can connect to a switch block.
1695+
*/
16761696
std::vector<bool> sb;
1697+
1698+
/**
1699+
* @brief The index of the segment as stored in the appropriate Segs list.
1700+
* Upon loading the architecture, we use this field to keep track of the
1701+
* segment's index in the unified segment_inf vector. This is useful when
1702+
* building the rr_graph for different Y & X channels in terms of track
1703+
* distribution and segment type.
1704+
*/
16771705
int seg_index;
1706+
1707+
/**
1708+
* @brief Determines the routing network to which the segment belongs.
1709+
* Possible values are:
1710+
* - GENERAL: The segment is part of the general routing resources.
1711+
* - GCLK: The segment is part of the global routing network.
1712+
* For backward compatibility, this attribute is optional. If not specified,
1713+
* the resource type for the segment is considered to be GENERAL.
1714+
*/
16781715
enum SegResType res_type = SegResType::GENERAL;
1679-
//float Cmetal_per_m; /* Wire capacitance (per meter) */
16801716
};
16811717

16821718
inline bool operator==(const t_segment_inf& a, const t_segment_inf& b) {
1683-
return a.name == b.name && a.frequency == b.frequency && a.length == b.length && a.arch_wire_switch == b.arch_wire_switch && a.arch_opin_switch == b.arch_opin_switch && a.arch_opin_between_dice_switch == b.arch_opin_between_dice_switch && a.frac_cb == b.frac_cb && a.frac_sb == b.frac_sb && a.longline == b.longline && a.Rmetal == b.Rmetal && a.Cmetal == b.Cmetal && a.directionality == b.directionality && a.parallel_axis == b.parallel_axis && a.cb == b.cb && a.sb == b.sb;
1719+
return a.name == b.name
1720+
&& a.frequency == b.frequency
1721+
&& a.length == b.length
1722+
&& a.arch_wire_switch == b.arch_wire_switch
1723+
&& a.arch_opin_switch == b.arch_opin_switch
1724+
&& a.arch_inter_die_switch == b.arch_inter_die_switch
1725+
&& a.frac_cb == b.frac_cb
1726+
&& a.frac_sb == b.frac_sb
1727+
&& a.longline == b.longline
1728+
&& a.Rmetal == b.Rmetal
1729+
&& a.Cmetal == b.Cmetal
1730+
&& a.directionality == b.directionality
1731+
&& a.parallel_axis == b.parallel_axis
1732+
&& a.cb == b.cb
1733+
&& a.sb == b.sb;
16841734
}
16851735

16861736
/*provide hashing for t_segment_inf to enable the use of many std containers.

libs/libarchfpga/src/read_xml_arch_file.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3793,7 +3793,7 @@ static std::vector<t_segment_inf> ProcessSegments(pugi::xml_node Parent,
37933793
archfpga_throw(loc_data.filename_c_str(), loc_data.line(SubElem),
37943794
"'%s' is not a valid mux name.\n", tmp);
37953795
}
3796-
Segs[i].arch_opin_between_dice_switch = switch_idx;
3796+
Segs[i].arch_inter_die_switch = switch_idx;
37973797
}
37983798

37993799
/* Get the wire and opin switches, or mux switch if unidir */

vpr/src/base/vpr_types.h

Lines changed: 100 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -1359,70 +1359,124 @@ struct t_det_routing_arch {
13591359

13601360
/**
13611361
* @brief Lists detailed information about segmentation. [0 .. W-1].
1362-
*
1363-
* @param length length of segment.
1364-
* @param start index at which a segment starts in channel 0.
1365-
* @param longline true if this segment spans the entire channel.
1366-
* @param sb [0..length]: true for every channel intersection, relative to the
1367-
* segment start, at which there is a switch box.
1368-
* @param cb [0..length-1]: true for every logic block along the segment at
1369-
* which there is a connection box.
1370-
* @param arch_wire_switch Index of the switch type that connects other wires
1371-
* *to* this segment. Note that this index is in relation
1372-
* to the switches from the architecture file, not the
1373-
* expanded list of switches that is built at the end of
1374-
* build_rr_graph.
1375-
* @param arch_opin_switch Index of the switch type that connects output pins
1376-
* (OPINs) *to* this segment. Note that this index is in
1377-
* relation to the switches from the architecture file,
1378-
* not the expanded list of switches that is is built
1379-
* at the end of build_rr_graph
1380-
* @param arch_opin_between_dice_switch Index of the switch type that connects output
1381-
* pins (OPINs) *to* this segment from *another dice*.
1382-
* Note that this index is in relation to the switches from
1383-
* the architecture file, not the expanded list of switches that is built
1384-
* at the end of build_rr_graph
1385-
* @param Cmetal Capacitance of a routing track, per unit logic block length.
1386-
* @param Rmetal Resistance of a routing track, per unit logic block length.
1387-
* @param direction The direction of a routing track.
1388-
* @param index index of the segment type used for this track.
1389-
* Note that this index will store the index of the segment
1390-
* relative to its **parallel** segment types, not all segments
1391-
* as stored in device_ctx. Look in rr_graph.cpp: build_rr_graph
1392-
* for details but here is an example: say our segment_inf_vec in
1393-
* device_ctx is as follows: [seg_a_x, seg_b_x, seg_a_y, seg_b_y]
1394-
* when building the rr_graph, static segment_inf_vectors will be
1395-
* created for each direction, thus you will have the following
1396-
* 2 vectors: X_vec =[seg_a_x,seg_b_x] and Y_vec = [seg_a_y,seg_b_y].
1397-
* As a result, e.g. seg_b_y::index == 1 (index in Y_vec)
1398-
* and != 3 (index in device_ctx segment_inf_vec).
1399-
* @param abs_index index is relative to the segment_inf vec as stored in device_ctx.
1400-
* Note that the above vector is **unifies** both x-parallel and
1401-
* y-parallel segments and is loaded up originally in read_xml_arch_file.cpp
1402-
*
1403-
* @param type_name_ptr pointer to name of the segment type this track belongs
1404-
* to. points to the appropriate name in s_segment_inf
14051362
*/
14061363
struct t_seg_details {
1364+
/**
1365+
* @brief Length (in clbs) of the segment.
1366+
*/
14071367
int length = 0;
1368+
1369+
/**
1370+
* @brief Index at which a segment starts in channel 0.
1371+
*/
14081372
int start = 0;
1373+
1374+
/**
1375+
* @brief True if this segment spans the entire channel.
1376+
*/
14091377
bool longline = false;
1378+
1379+
/**
1380+
* @brief [0..length]: true for every channel intersection, relative to the
1381+
* segment start, at which there is a switch box.
1382+
*/
14101383
std::unique_ptr<bool[]> sb;
1384+
1385+
/**
1386+
* @brief [0..length]: true for every logic block along the segment at
1387+
* which there is a connection box.
1388+
*/
14111389
std::unique_ptr<bool[]> cb;
1390+
1391+
/**
1392+
* @brief Index of the switch type that connects other wires to this segment.
1393+
* Note that this index is in relation to the switches from the architecture
1394+
* file, not the expanded list of switches that is built at the end of build_rr_graph.
1395+
*/
14121396
short arch_wire_switch = 0;
1397+
1398+
/**
1399+
* @brief Index of the switch type that connects output pins (OPINs) *to* this segment.
1400+
* Note that this index is in relation to the switches from the architecture
1401+
* file, not the expanded list of switches that is built at the end of build_rr_graph.
1402+
*/
14131403
short arch_opin_switch = 0;
1414-
short arch_opin_between_dice_switch = 0;
1404+
1405+
/**
1406+
* @brief Index of the switch type that connects output pins (OPINs) *to* this segment
1407+
* from *another dice*. Note that this index is in relation to the switches from the
1408+
* architecture file, not the expanded list of switches that is built at the end of
1409+
* build_rr_graph.
1410+
*/
1411+
short arch_inter_die_switch = 0;
1412+
1413+
/**
1414+
* @brief Resistance of a routing track, per unit logic block length.
1415+
*/
14151416
float Rmetal = 0;
1417+
1418+
/**
1419+
* @brief Capacitance of a routing track, per unit logic block length.
1420+
*/
14161421
float Cmetal = 0;
1422+
14171423
bool twisted = false;
1424+
1425+
/**
1426+
* @brief Direction of the segment.
1427+
*/
14181428
enum Direction direction = Direction::NONE;
1429+
1430+
/**
1431+
* @brief Index of the first logic block in the group.
1432+
*/
14191433
int group_start = 0;
1434+
1435+
/**
1436+
* @brief Size of the group.
1437+
*/
14201438
int group_size = 0;
1439+
1440+
/**
1441+
* @brief Index of the first logic block in the segment.
1442+
*/
14211443
int seg_start = 0;
1444+
1445+
/**
1446+
* @brief Index of the last logic block in the segment.
1447+
*/
14221448
int seg_end = 0;
1449+
1450+
/**
1451+
* @brief index of the segment type used for this track.
1452+
* Note that this index will store the index of the segment
1453+
* relative to its **parallel** segment types, not all segments
1454+
* as stored in device_ctx. Look in rr_graph.cpp: build_rr_graph
1455+
* for details but here is an example: say our segment_inf_vec in
1456+
* device_ctx is as follows: [seg_a_x, seg_b_x, seg_a_y, seg_b_y]
1457+
* when building the rr_graph, static segment_inf_vectors will be
1458+
* created for each direction, thus you will have the following
1459+
* 2 vectors: X_vec =[seg_a_x,seg_b_x] and Y_vec = [seg_a_y,seg_b_y].
1460+
* As a result, e.g. seg_b_y::index == 1 (index in Y_vec)
1461+
* and != 3 (index in device_ctx segment_inf_vec).
1462+
*/
14231463
int index = 0;
1464+
1465+
/**
1466+
* @brief index is relative to the segment_inf vec as stored in device_ctx.
1467+
* Note that the above vector is **unifies** both x-parallel and
1468+
* y-parallel segments and is loaded up originally in read_xml_arch_file.cpp
1469+
*/
14241470
int abs_index = 0;
1425-
float Cmetal_per_m = 0; ///<Used for power
1471+
1472+
/**
1473+
* @brief Used for power
1474+
*/
1475+
float Cmetal_per_m = 0;
1476+
1477+
/**
1478+
* @brief Name of the segment type.
1479+
*/
14261480
std::string type_name;
14271481
};
14281482

@@ -1453,7 +1507,7 @@ class t_chan_seg_details {
14531507

14541508
short arch_wire_switch() const { return seg_detail_->arch_wire_switch; }
14551509
short arch_opin_switch() const { return seg_detail_->arch_opin_switch; }
1456-
short arch_opin_between_dice_switch() const { return seg_detail_->arch_opin_between_dice_switch; }
1510+
short arch_inter_die_switch() const { return seg_detail_->arch_inter_die_switch; }
14571511

14581512
Direction direction() const { return seg_detail_->direction; }
14591513

0 commit comments

Comments
 (0)