Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

how to print coverage model #181

Open
songzenghui opened this issue Jun 28, 2023 · 3 comments
Open

how to print coverage model #181

songzenghui opened this issue Jun 28, 2023 · 3 comments

Comments

@songzenghui
Copy link

I want to print my coverage model to confirm it met my exceptations. I use get_coverage_report_model, but the CoverageReport does not implement __str__ or __repr__.
Could you implement that to print the coverage model?

@mballance
Copy link
Member

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

@songzenghui
Copy link
Author

Yes, I use this api. But why it print two covergroup, actually i build one covergroup model.
image
Look, I want to print one. why there is TYPE and INST

@mballance
Copy link
Member

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants