Skip to content

Commit

Permalink
legalize traversal
Browse files Browse the repository at this point in the history
  • Loading branch information
alaindargelas committed May 9, 2021
1 parent 917e750 commit 873f28c
Showing 1 changed file with 15 additions and 13 deletions.
28 changes: 15 additions & 13 deletions util/uhdm-hier.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -95,34 +95,36 @@ int main(int argc, char** argv) {
path += objectName + ".";
}
// Recursive tree traversal
if (vpi_get(vpiType, obj_h) == vpiModule || vpi_get(vpiType, obj_h) == vpiGenScope) {
if (vpi_get(vpiType, obj_h) == vpiModule ||
vpi_get(vpiType, obj_h) == vpiGenScope) {
vpiHandle subItr = vpi_iterate(vpiModule, obj_h);
while (vpiHandle sub_h = vpi_scan(subItr)) {
res += inst_visit(sub_h, path);
vpi_release_handle(sub_h);
vpi_release_handle(sub_h);
}
vpi_release_handle(subItr);
}
if (vpi_get(vpiType, obj_h) == vpiModule || vpi_get(vpiType, obj_h) == vpiGenScope) {
vpi_release_handle(subItr);
}
if (vpi_get(vpiType, obj_h) == vpiModule ||
vpi_get(vpiType, obj_h) == vpiGenScope) {
vpiHandle subItr = vpi_iterate(vpiGenScopeArray, obj_h);
while (vpiHandle sub_h = vpi_scan(subItr)) {
res += inst_visit(sub_h, path);
vpi_release_handle(sub_h);
vpi_release_handle(sub_h);
}
vpi_release_handle(subItr);
}
if (vpi_get(vpiType, obj_h) == vpiGenScopeArray) {
vpi_release_handle(subItr);
}
if (vpi_get(vpiType, obj_h) == vpiGenScopeArray) {
vpiHandle subItr = vpi_iterate(vpiGenScope, obj_h);
while (vpiHandle sub_h = vpi_scan(subItr)) {
res += inst_visit(sub_h, path);
vpi_release_handle(sub_h);
vpi_release_handle(sub_h);
}
vpi_release_handle(subItr);
}
vpi_release_handle(subItr);
}
return res;
};
result += inst_visit(obj_h, "");
vpi_release_handle(obj_h);
vpi_release_handle(obj_h);
}
vpi_release_handle(instItr);
}
Expand Down

0 comments on commit 873f28c

Please sign in to comment.