You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a case of multiple inheritance and the classic C++ diamond hierarchy. When I inherit from fc4sc::covergroup, the crosses seem to be not created and the dumped XML file does not include crosses.
I have the following class Hierarchy for demonstration:
The idea is that CoverGroupBase defines some common coverpoints, then CoverGroupA and CoverGroupB each add their own coverpoints. CoverGroupTop will put groups together.
If issue #22 was supported, we could put some common coverpoints in our CoverGroupBase, but now we get two copies of each coverpoint in CoverGroupTop.
This requires that the base classes are inherited virtually. In the example attached, I have a define named VIRTUAL that allows putting virtual keyword in the class inheritance. A Makefile is provided for this:
$ make
Usage: make [target]
Targets:
main-non-virtual : build without VIRTUAL inheritance
main-virtual : build with VIRTUAL inheritance
conv : convert coverage data
view : view coverage data
help: print this help
$ make main-non-virtual makes the non-virtual version. Once that is built, we can run it and see:
$ ./main
Coverage = 42.8571%
$ make main-virtual makes the virtual version. Once that is built, we can run it and see:
$ ./main
Coverage = 50%
Even from these results, one can tell that something affected the coverage. And this is because crosses do not appear in the UCIS XML file.
Also, if one samples the crosses in the case of virtual inheritance, one would get segmentation fault. Seems like the crosses are not really instantiated/initialized.
Note
There seems to be a problem with the non-virtual version XML file and VCS seems to choke on this XML file.
`main.cpp instantiates both CoverGroupA, CoverGroupB as well as CoverGroupTop for illustration purposes.
I have a case of multiple inheritance and the classic C++ diamond hierarchy. When I inherit from
fc4sc::covergroup
, the crosses seem to be not created and the dumped XML file does not include crosses.I have the following class Hierarchy for demonstration:
The idea is that
CoverGroupBase
defines some common coverpoints, thenCoverGroupA
andCoverGroupB
each add their own coverpoints.CoverGroupTop
will put groups together.If issue #22 was supported, we could put some common coverpoints in our
CoverGroupBase
, but now we get two copies of each coverpoint inCoverGroupTop
.This requires that the base classes are inherited virtually. In the example attached, I have a define named
VIRTUAL
that allows puttingvirtual
keyword in the class inheritance. A Makefile is provided for this:$ make main-non-virtual
makes the non-virtual version. Once that is built, we can run it and see:$ make main-virtual
makes the virtual version. Once that is built, we can run it and see:Even from these results, one can tell that something affected the coverage. And this is because crosses do not appear in the UCIS XML file.
Also, if one samples the crosses in the case of virtual inheritance, one would get segmentation fault. Seems like the crosses are not really instantiated/initialized.
Note
There seems to be a problem with the non-virtual version XML file and VCS seems to choke on this XML file.
`main.cpp instantiates both CoverGroupA, CoverGroupB as well as CoverGroupTop for illustration purposes.
virtual.tar.gz
The text was updated successfully, but these errors were encountered: