3
0
Fork 0
mirror of https://github.com/YosysHQ/sby.git synced 2025-08-14 17:05:31 +00:00

translate backslashes in cell names the same way as smt2 backend does

This commit is contained in:
N. Engelhardt 2022-03-18 16:36:41 +01:00
parent fa5d5ad831
commit 5dc7fc9a4d
3 changed files with 12 additions and 6 deletions

View file

@ -91,11 +91,13 @@ class SbyModule:
raise KeyError(f"Could not find assert at {location} in properties list!")
return prop
def find_property_by_cellname(self, cell_name):
def find_property_by_cellname(self, cell_name, trans_dict=dict()):
# backends may need to mangle names irreversibly, so allow applying
# the same transformation here
for prop in self:
if prop.name == cell_name:
if cell_name == prop.name.translate(str.maketrans(trans_dict)):
return prop
raise KeyError(f"No such property: {cell_name}")
raise KeyError(f"No such property: {smt2_name}")
def design_hierarchy(filename):
design_json = json.load(filename)