Closed zputrle closed 1 month ago
As far as I can see, this problem is not unique to assertions but it can also occur for cover statements. You can find possible places where a similar problem can manifest by searching find_property_by_cellname
in sby_engine_smtbmc.py.
sby reports that a wrong assumption has failed when you have a design where you instantiate a module two times and the assertion in the second module fails.
For example, if you have the following two modules:
where the main is the top module and you run a bounded model check with smtbmc + z3 engine with the following .sby file [1], you get the following output:
You can see that yosys-smtbmc reports that the assertion has failed in
main.m2
where in summary sby reports that it has failed inmain.m1
.This problem is present in SBY yosys-0.43 and probably in SBY yosys-0.44. (I only tested it with SBY yosys-0.43.)
Cause
It seems that a problem lies in the use of
find_property_by_cellname
function, in sby_engine_smtbmc.py, to find the right property that has failed in design hierarchy (design.hiarchy). In the case above, we have two instantiations of the same module which means that in the design hierarchy we'll have two properties with the same name (one in m1 and the other in m2). Becausefind_property_by_cellname
only uses the name (c_mod) to find the property, it will always return the property from m1 regardless if the property fails in m1 or in m2.Suggestion solution: Consider the entire path (including the module's names) when searching for the property in the design hierarchy. The following solution worked for me.
P.S.: I'm not completely sure what is the reason for the name translation and if it should also be applied to the entire path.
[1]