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)
def output_callback(line):
nonlocal proc_status
nonlocal last_prop
+ smt2_trans = {'\\':'/', '|':'/'}
match = re.match(r"^## [0-9: ]+ Status: FAILED", line)
if match:
match = re.match(r"^## [0-9: ]+ Assert failed in (\S+): (\S+) \((\S+)\)", line)
if match:
cell_name = match[3]
- prop = task.design_hierarchy.find_property_by_cellname(cell_name)
+ prop = task.design_hierarchy.find_property_by_cellname(cell_name, trans_dict=smt2_trans)
prop.status = "FAIL"
last_prop = prop
return line
match = re.match(r"^## [0-9: ]+ Reached cover statement at (\S+) \((\S+)\) in step \d+.", line)
if match:
cell_name = match[2]
- prop = task.design_hierarchy.find_property_by_cellname(cell_name)
+ prop = task.design_hierarchy.find_property_by_cellname(cell_name, trans_dict=smt2_trans)
prop.status = "PASS"
last_prop = prop
return line
match = re.match(r"^## [0-9: ]+ Unreached cover statement at (\S+) \((\S+)\).", line)
if match:
cell_name = match[2]
- prop = task.design_hierarchy.find_property_by_cellname(cell_name)
+ prop = task.design_hierarchy.find_property_by_cellname(cell_name, trans_dict=smt2_trans)
prop.status = "FAIL"
return line