Skip to content

Commit 16e8086

Browse files
committed
[libs][rr_graph] change sw_template_id_ to std::optional
1 parent dcfcc93 commit 16e8086

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

doc/src/vpr/custom_rr_graph.rst

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ See the figure below for an illustration:
3737

3838
.. figure:: lane_and_tap.png
3939
:alt: Lane and Tap
40-
:width: 50%
4140
:align: center
4241

4342
In the figure above, the taps for the red wire are shown, and the lanes are separated by dotted lines. Note that the figure is simplified for illustration purposes.
@@ -46,7 +45,6 @@ In the actual RR Graph, when a wire passes through a switch block, its track num
4645

4746
.. figure:: lane_and_tap_realistic.png
4847
:alt: Lane and Tap Realistic
49-
:width: 50%
5048
:align: center
5149

5250
A more realistic example of a lane and a tap. Each box contains a lane.

libs/librrgraph/src/base/rr_edge.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
#pragma once
22

33
#include <string>
4+
#include <optional>
45

56
#include "physical_types.h"
67
#include "librrgraph_types.h"
78
#include "rr_graph_fwd.h"
89

910
struct t_rr_edge_info {
10-
t_rr_edge_info(RRNodeId from, RRNodeId to, short type, bool is_remapped, std::string sw_template_id_="") noexcept
11+
t_rr_edge_info(RRNodeId from, RRNodeId to, short type, bool is_remapped, std::optional<std::string> sw_template_id_=std::nullopt) noexcept
1112
: from_node(from)
1213
, to_node(to)
1314
, switch_type(type)
@@ -18,7 +19,7 @@ struct t_rr_edge_info {
1819
RRNodeId to_node = RRNodeId::INVALID();
1920
short switch_type = LIBRRGRAPH_UNDEFINED_VAL;
2021
bool remapped = false;
21-
std::string sw_template_id = "";
22+
std::optional<std::string> sw_template_id;
2223

2324
friend bool operator<(const t_rr_edge_info& lhs, const t_rr_edge_info& rhs) {
2425
VTR_ASSERT(lhs.remapped == rhs.remapped);

0 commit comments

Comments
 (0)