Skip to content

Commit c933d5c

Browse files
committed
[vpr][base] expand validate_and_update_traceback comment
1 parent 84462c2 commit c933d5c

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-6
lines changed

vpr/src/base/old_traceback.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,7 @@ bool validate_and_update_traceback(t_trace* trace, bool verify_switch_id /* = tr
148148

149149
std::set<int> seen_rr_nodes;
150150
std::stack<t_trace*> trace_stack;
151+
trace_stack.push(trace);
151152

152153
while (!trace_stack.empty()) {
153154
trace = trace_stack.top();
@@ -159,13 +160,13 @@ bool validate_and_update_traceback(t_trace* trace, bool verify_switch_id /* = tr
159160
continue;
160161
}
161162

162-
if (trace->iswitch == OPEN) { //End of a branch
163-
//Verify that the next element (branch point) has been already seen in the traceback so far
163+
if (trace->iswitch == OPEN) { // End of a branch
164+
// Verify that the next element (branch point) has been already seen in the traceback so far
164165
if (!seen_rr_nodes.count(next->index)) {
165166
VPR_FATAL_ERROR(VPR_ERROR_ROUTE, "Traceback branch point %d not found", next->index);
166167
}
167-
} else { //Midway along branch
168-
//Check there is an edge connecting trace and next
168+
} else { // Midway along branch
169+
// Check there is an edge connecting trace and next
169170
const auto& rr_graph = g_vpr_ctx.device().rr_graph;
170171
bool found = false;
171172
for (t_edge_size iedge = 0; iedge < rr_graph.num_edges(RRNodeId(trace->index)); ++iedge) {

vpr/src/base/old_traceback.h

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,11 @@ void free_traceback(t_trace* trace);
4848
void print_traceback(const t_trace* trace);
4949

5050
/**
51-
* @brief Validate the routing traceback if verify_switch_id is true, otherwise update the
52-
* switch IDs in the traceback to match the RR Graph.
51+
* @brief Validate the integrity of the traceback rooted a trace: it should contain only valid rr nodes, branches in the routing tree
52+
* should link to existing routing, and edges in the traceback should exist in the RRGraph.
53+
* If verify_switch_id is true, this routine also checks that the switch types used in the traceback match those in the
54+
* RRGraph. If verify_switch_id is false, the switch ids (types) are remapped to those in the RRGraph. This switch remapping is
55+
* useful when an RRGraph with a more detailed delay model (and hence more switch types) is used with a prior routing.
5356
*
5457
* @param trace Pointer to the head of the routing trace of the net to validate and update.
5558
* @param verify_switch_id Whether to verify the switch IDs in the traceback.

0 commit comments

Comments
 (0)