-
Notifications
You must be signed in to change notification settings - Fork 22
CrossPoint
There is a subcategory of Cover constructs which use special bins that can contain cross ranges, meaning the range defined by the Cartesian product of multiple ranges. These special constructs are called Cross constructs.
abstract class Cross(name: String, ports: Seq[Data])(val bins: List[CrossBin]) extends Cover(name, ports)There are two types of Cross constructs:
-
CrossPoint: Defines a cover relation between two ports within the same cycle. -
TimedCross: Defines a cover relation between two ports within a given delay.
A CrossPoint defines a cover relation using a set of ranges, each associated with a given port.
case class CrossPoint(n: String, p: Data*)(b: CrossBin*)This works on an arbitrary number of ports. Each port is then associated to a range in each CrossBin. This is done while maintaining the order of the ports and the ranges, meaning that the port that is defined first will be associated to the range that is defined first.
A CrossBin is similar to a regular Bin but only considers a hit if each port in the CrossPointis sampled with a value within its associated range in the same cycle.
case class CrossBin(name: String, ranges: Range*)For example, if we define a cross range as such:
CrossBin("aAndb", 1 to 1, 1 to 1)Then it will only consider a hit when the two associated ports have the value 1 at the same time.
Here is an example of how to define a CrossPoint:
//Declare cross points
CrossPoint("accuAndTest", dut.io.outA, dut.io.outB)(
CrossBin("bothEven", 1 to 9 by 2, 1 to 1)
)The coverage report will then look like:
=========================================
CROSS_POINT accuAndTest
BIN both1 COVERING: CROSS(Range 1 to 9 by 2, Range 1 to 1) HAS 1 HIT(S) = 20,00%
=========================================
Next topic: TimedCross or return home.