|
21 | 21 | #include "vtr_log.h" |
22 | 22 |
|
23 | 23 | #include "vpr_utils.h" |
| 24 | +#include "route_utils.h" |
24 | 25 |
|
25 | 26 | #include "globals.h" |
26 | 27 | #include "draw.h" |
|
30 | 31 | #include "intra_logic_block.h" |
31 | 32 | #include "atom_netlist.h" |
32 | 33 | #include "search_bar.h" |
| 34 | +#include "old_traceback.h" |
33 | 35 | #include "physical_types.h" |
34 | 36 | #include "place_macro.h" |
35 | 37 |
|
@@ -59,6 +61,8 @@ void search_and_highlight(GtkWidget* /*widget*/, ezgl::application* app) { |
59 | 61 | // reset |
60 | 62 | deselect_all(); |
61 | 63 |
|
| 64 | + t_draw_state* draw_state = get_draw_state_vars(); |
| 65 | + |
62 | 66 | if (search_type == "RR Node ID") { |
63 | 67 | int rr_node_id = -1; |
64 | 68 | ss >> rr_node_id; |
@@ -122,32 +126,73 @@ void search_and_highlight(GtkWidget* /*widget*/, ezgl::application* app) { |
122 | 126 | else if (search_type == "Net ID") { |
123 | 127 | int net_id = -1; |
124 | 128 | ss >> net_id; |
125 | | - |
126 | | - // valid net id check |
127 | | - if (!cluster_ctx.clb_nlist.valid_net_id(ClusterNetId(net_id))) { |
128 | | - warning_dialog_box("Invalid Net ID"); |
129 | | - app->refresh_drawing(); |
130 | | - return; |
| 129 | + if (draw_state->is_flat) { |
| 130 | + AtomNetId atom_net_id = AtomNetId(net_id); |
| 131 | + if (!atom_ctx.netlist().valid_net_id(atom_net_id)) { |
| 132 | + warning_dialog_box("Invalid Net ID"); |
| 133 | + app->refresh_drawing(); |
| 134 | + return; |
| 135 | + } |
| 136 | + if (!is_net_routed(atom_net_id)) { |
| 137 | + warning_dialog_box("Net is unrouted"); |
| 138 | + app->refresh_drawing(); |
| 139 | + return; |
| 140 | + } |
| 141 | + if (is_net_fully_absorbed(atom_net_id)) { |
| 142 | + warning_dialog_box("Net is fully absorbed"); |
| 143 | + app->refresh_drawing(); |
| 144 | + return; |
| 145 | + } |
| 146 | + highlight_nets((ClusterNetId)net_id); |
| 147 | + } else { |
| 148 | + // valid net id check |
| 149 | + if (!cluster_ctx.clb_nlist.valid_net_id(ClusterNetId(net_id))) { |
| 150 | + warning_dialog_box("Invalid Net ID"); |
| 151 | + app->refresh_drawing(); |
| 152 | + return; |
| 153 | + } |
| 154 | + highlight_nets((ClusterNetId)net_id); |
131 | 155 | } |
132 | | - |
133 | | - highlight_nets((ClusterNetId)net_id); |
134 | 156 | } |
135 | 157 |
|
136 | 158 | else if (search_type == "Net Name") { |
137 | 159 | //in this case, all nets (clb and non-clb) are contained in the atom netlist |
138 | 160 | //So we only need to search this one |
139 | 161 | std::string net_name; |
140 | 162 | ss >> net_name; |
141 | | - AtomNetId atom_net_id = atom_ctx.netlist().find_net(net_name); |
142 | 163 |
|
143 | | - if (atom_net_id == AtomNetId::INVALID()) { |
144 | | - warning_dialog_box("Invalid Net Name"); |
145 | | - return; //name not exist |
146 | | - } |
147 | | - |
148 | | - const auto clb_nets = atom_ctx.lookup().clb_nets(atom_net_id); |
149 | | - for (auto clb_net_id : clb_nets.value()) { |
150 | | - highlight_nets(clb_net_id); |
| 164 | + if (draw_state->is_flat) { |
| 165 | + AtomNetId atom_net_id = atom_ctx.netlist().find_net(net_name); |
| 166 | + if (atom_net_id == AtomNetId::INVALID()) { |
| 167 | + warning_dialog_box("Invalid Net Name"); |
| 168 | + app->refresh_drawing(); |
| 169 | + return; |
| 170 | + } |
| 171 | + if (!is_net_routed(atom_net_id)) { |
| 172 | + warning_dialog_box("Net is unrouted"); |
| 173 | + app->refresh_drawing(); |
| 174 | + return; |
| 175 | + } |
| 176 | + if (is_net_fully_absorbed(atom_net_id)) { |
| 177 | + warning_dialog_box("Net is fully absorbed"); |
| 178 | + app->refresh_drawing(); |
| 179 | + return; |
| 180 | + } |
| 181 | + highlight_nets(convert_to_cluster_net_id(atom_net_id)); |
| 182 | + } else { |
| 183 | + AtomNetId atom_net_id = atom_ctx.netlist().find_net(net_name); |
| 184 | + |
| 185 | + if (atom_net_id == AtomNetId::INVALID()) { |
| 186 | + warning_dialog_box("Invalid Net Name"); |
| 187 | + app->refresh_drawing(); |
| 188 | + return; |
| 189 | + } |
| 190 | + auto clb_net_ids_opt = atom_ctx.lookup().clb_nets(atom_net_id); |
| 191 | + if (clb_net_ids_opt.has_value()) { |
| 192 | + for (auto clb_net_id : clb_net_ids_opt.value()) { |
| 193 | + highlight_nets(clb_net_id); |
| 194 | + } |
| 195 | + } |
151 | 196 | } |
152 | 197 | } |
153 | 198 |
|
|
0 commit comments