Hi Laura,
It can be confusing with Net.rename(), Net.setName() and Net.updateName(). Ideally we wouldn't have so many similar APIs, however, because the Net class is not open source, we have to provide some different functionality for different situations that has to compromise. To summarize their usage:
Net.rename() - Renames a physical net such that all locations where the physical net name is used is updated. However, as we already discussed, it doesn't update the logical name because of some complications due to hierarchy.
Net.setName() - Simply updates the name inside the Net object. It doesn't propagate the name change anywhere else it is used (SiteInst, Design, etc). Probably not one you'd want to use.
Net.updateName() - When instantiating modules (ModuleInst class), a level of physical hierarchy is created and this method is used for updating the name of the net accordingly.
Regarding the renaming of hierarchical net names, you have to be careful as a hierarchical name describes where the net resides in the hierarchy. Consider this simple netlist:
There are 3 logical nets, A, B, and C which form one physical net called disneyland/tomorrowland/monorail (The physical net name almost always takes on the logical name of the source of the net). If you wanted to change the net name from:
disneyland/tomorrowland/monorail -> disneyworld/adventureland/peoplemover
You'd be changing two instance names and one logical net name. Changing hierarchical netlists is doable, but comes with some overhead. To summarize:
- Cell instance "disneyland" -> "disneyworld"
- Cell instance "tomorrowland" -> "adventureland"
- Logical net "monorail" -> "peoplemover"
The local logical net name "monorail" in each cell type would stay the same except in the tomorrowland instance, so, to list out the new hierarchical names of A, B and C post transformation it would be:
A: disneyworld/adventureland/peoplemover
B: disneyworld/monorail
C: monorail
The A, B and C logical nets are called "Aliases" in Vivado if you select a physical net and navigate to the Net Properties window, for example:
Hope that helps.
Chris