Get coverpoint hit counter and reset

Hello, i have two questions

  1. Is there a way to reset a coverpoint counter (or reset all the coverpoint) while the test is running, from the test code.
  2. Is there a way to get the coverpoint hits while the test is running, from the test code. I know systemverilog doesn’t give handles to coverpoints, i was just wondering if there is an another way.

In reply to zacarry:

There’s no way to reset the bins of a coverpoint, and no way to get a hit count directly.
Covergroups are meant for passive use, so you should explain more what you are trying to accomplish.

I want to use coverage as feedback for my costraint random test. But i didnt want to check only the instance coverage. Is there an another way to get the hit count?

In reply to zacarry:

If you have a handle to a covergroup(cg_h), you can get the coverage data for a coverpoint (cp) using cg_h.cp.get_coverage(). See section 19.8 of the 1800-2017 LRM.

In reply to dave_59:

Interestingly for zacarry the type coverage is expressed as a percentage number, so it is usable for constrains.