Open songzenghui opened 1 year ago
Hi @songzenghui,
Let me give that some thought. In general, it's a good idea to have Python objects be easily converted to a string representation.
Currently, you can use get_coverage_report
to get a string representation of the coverage. You can also use report_coverage to write the report to a file. See the information here:
Coverage Reports
Yes, I use this api. But why it print two covergroup, actually i build one covergroup model.
Look, I want to print one. why there is TYPE
and INST
Hi @songzenghui, Okay, so it sounds like you'd like to be able to selectively display portions of the coverage model, and having str/repr on the coverage model will help with that. To your specific question about Type vs Instance coverage, coverage tools generally maintain coverage information on a per-covergroup-type basis as well as a per-covergroup-instance basis. When you only have a single instance of a covergroup, the Type and Inst information is the same. I decided to keep the format of the coverage report the same, instead of changing the format depending on whether a single or multiple instances of a covergroup had been created.
I want to print my coverage model to confirm it met my exceptations. I use
get_coverage_report_model
, but theCoverageReport
does not implement__str__
or__repr__
. Could you implement that to print the coverage model?