3
0
Fork 0
mirror of https://github.com/YosysHQ/sby.git synced 2025-04-23 05:15:30 +00:00

fix lookup of mangled path names

This commit is contained in:
N. Engelhardt 2024-10-16 13:55:50 +02:00
parent 117fb26c68
commit 0f13fc6bc7
2 changed files with 98 additions and 2 deletions

View file

@ -146,12 +146,12 @@ class SbyModule:
path_iter = iter(path)
mod = next(path_iter).translate(trans)
if self.name != mod:
if self.name.translate(trans) != mod:
raise ValueError(f"{self.name} is not the first module in hierarchical path {pretty_path(path)}.")
mod_hier = self
for mod in path_iter:
mod_hier = next((v for k, v in mod_hier.submodules.items() if mod == k.translate(trans)), None)
mod_hier = next((v for k, v in mod_hier.submodules.items() if mod.translate(trans) == k.translate(trans)), None)
if not mod_hier:
raise KeyError(f"Could not find {pretty_path(path)} in design hierarchy!")