opentitan icon indicating copy to clipboard operation
opentitan copied to clipboard

how to cover unknown transitions

Open rasmus-madsen opened this issue 5 years ago • 3 comments

For Xcelium/IMC transistions from 'x to either '0 or '1 and vice versa is not counted towards toggle coverage.

this means that ports in the AES register is not counted in the coverage even if the ports are exercised in the simulation.

as an example the key_share register port q and WD are both marked as uncovered. image

while they are infact exercised.

should we exclude these upon inspection or is there a smarter way to cover this? image

rasmus-madsen avatar Feb 08 '21 14:02 rasmus-madsen

We collect toggle coverage only on DUT ports. We do not attempt to cover any signals in the internal hierarchy, the motivation being that already manifests in the coverage of other metrics - line, condition, branch and fsm.

For VCS, we do this by adding this switch (hw/dv/tools/dvsim/vcs.json):

                   // Dump toggle coverage on mdas, array of structs and on ports only
                   "-cm_tgl mda+structarr+portsonly",

In combination with compile-time coverage 'pruning' to limit toggle coverage to only the DUT ports here (hw/dv/tools/vcs/cover.cfg):

begin tgl
  -tree tb
  +tree tb.dut 1
end

As such, attempting to cover all internal signals does not provide a good ROI (if all other metrics are fully covered, the things that show up as uncovered on the toggle coverage of internal DUT signals are unreachable / dead code). I have indicated this in the methodology doc as well: https://docs.opentitan.org/doc/ug/dv_methodology/#code-coverage

Thanks, -Sri

sriyerg avatar Feb 08 '21 18:02 sriyerg

Sri is indicating we don't collect coverage on the internals but FYI... xcelium default x's/z's are not treated as transitions but to enable use: set_toggle_includex, set_toggle_includez.

senelson7 avatar Feb 08 '21 19:02 senelson7

@sriyerg Thanks that detail slipped my mind. @senelson7 thank you for the solution

rasmus-madsen avatar Feb 08 '21 19:02 rasmus-madsen