Full instance scope of uhdmref_obj via vpiActual
mysoreanoop opened this issue · comments
You got it.
If you want to avoid going back and forth, you can invoke the optional UHDM uniquification phase:
- In Surelog option -elabuhdm, or
- after reloading UHDM, invoke the UHDM elaborator in your main: (2 lines of code) https://github.com/alainmarcel/UHDM/blob/4926f83bfe5b8d7f16ffd9572e280e6236fca25c/util/uhdm-dump.cpp#L131)
That way you can navigate the uhdmTopModules and don't need to go to the uhdmAllModules. Memory is larger or course, but all types and sizes are uniquified.
Originally posted by @alaindargelas in #319 (comment)
Hi @alaindargelas
We are able to uniquify uhdmallModules and uhdmtopModules structures, and we're able to fetch the full paths of, for example, nets in continuous assignments when we're walking through uhdmtopModules -- except that some objects of type uhdmref_obj do not produce full instance paths when queried for vpiFullName, and so, we instead fetch the handle for vpiActual (according to uhdm-dump) which gives us another uhdmref_obj with which we again query vpiFullName; this is giving a segmentation fault. However, vpiName (instead of vpiFullName) prints the local name as expected. Any idea what's going on here? Could segmentation error be for something else?
The relevant part of our code looks like this:
std::string visitref_obj(vpiHandle h) {
vpiHandle actual = vpi_handle(vpiActual, h);
if(actual) { //because some objects are directly resolved
result += "found actual: ";
result += vpi_get_str(vpiFullName, actual); //vpiName works just fine
}
else result += vpi_get_str(vpiFullName, h); //also works fine
return result;
}
If you need more details, I can share the entire code.
TIA
Anoop
Resolved the issue. So, vpiActual when available, will have a vpiFullName (at least we did). But the segmentation fault was because sometimes, this ref_obj would be of type uhdmenum_const in which case fetching vpiFullName was throwing the segmentation fault; we were able to mitigate this issue by having a conditional fetch of vpiDecompile for uhdmenum_const for our use case.