Skip to content

Commit 08ea974

Browse files
Patrick LehmannPatrick Lehmann
Patrick Lehmann
authored and
Patrick Lehmann
committed
Updated files to OSVVM release 2015.06.
1 parent 00647e7 commit 08ea974

19 files changed

+2432
-1029
lines changed

AlertLogPkg.vhd

+771-240
Large diffs are not rendered by default.

AlertLogPkg_body_BVUL.vhd

-491
This file was deleted.

CoveragePkg.vhd

+481-268
Large diffs are not rendered by default.

MakeBin_Debug.vhd

+111
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
------------------------------------------------------------
2+
-- package local, Used by GenBin, IllegalBin, and IgnoreBin
3+
function MakeBin(
4+
------------------------------------------------------------
5+
Min, Max : integer ;
6+
NumBin : integer ;
7+
AtLeast : integer ;
8+
Weight : integer ;
9+
Action : integer
10+
) return CovBinType is
11+
variable iCovBin : CovBinType(1 to NumBin) ;
12+
variable TotalBins : integer ; -- either real or integer
13+
variable rMax, rCurMin, rNextMin, rNumItemsInBin, rRemainingBins : real ; -- must be real
14+
variable CurMin, Offset : integer ;
15+
begin
16+
if Min > Max then
17+
Alert(OSVVM_ALERTLOG_ID, "CoveragePkg.MakeBin (GenBin, IllegalBin, IgnoreBin): Min must be <= Max", FAILURE) ;
18+
return NULL_BIN ;
19+
20+
elsif NumBin <= 0 then
21+
Alert(OSVVM_ALERTLOG_ID, "CoveragePkg.MakeBin (GenBin, IllegalBin, IgnoreBin): NumBin must be <= 0", FAILURE) ;
22+
return NULL_BIN ;
23+
24+
elsif NumBin = 1 then
25+
iCovBin(1) := (
26+
BinVal => (1 => (Min, Max)),
27+
Action => Action,
28+
Count => 0,
29+
Weight => Weight,
30+
AtLeast => AtLeast
31+
) ;
32+
return iCovBin ;
33+
34+
else
35+
CurMin := Min ;
36+
TotalBins := integer( (minimum( real(NumBin), real(Max) - real(Min) + 1.0))) ;
37+
RemainingBins := TotalBins ;
38+
39+
for i in iCovBin'range loop
40+
exit when RemainingBins = 0 ;
41+
42+
Offset := CalcOffset(Min, Max, )
43+
RemainingBins := CALC_NUM_BINS - i ;
44+
NumItemsInBin := (Max - CurMin + 1) / RemainingBins ;
45+
NextMin := CurMin + NumItemsInBin ;
46+
iCovBin(i) := (
47+
BinVal => (1 => (CurMin, NextMin - 1)),
48+
Action => Action,
49+
Count => 0,
50+
Weight => Weight,
51+
AtLeast => AtLeast
52+
) ;
53+
CurMin := NextMin ;
54+
end loop ;
55+
return iCovBin ;
56+
57+
58+
rCurMin := real(Min) ;
59+
rMax := real(Max) ;
60+
rRemainingBins := (minimum( real(NumBin), rMax - rCurMin + 1.0 )) ;
61+
TotalBins := integer(rRemainingBins) ;
62+
for i in iCovBin'range loop
63+
exit when rRemainingBins = 0.0 ;
64+
rNumItemsInBin := trunc((rMax - rCurMin + 1.0) / rRemainingBins) ; -- can be too large
65+
rNextMin := rCurMin + rNumItemsInBin ; -- can be 2**31
66+
iCovBin(i) := (
67+
BinVal => (1 => (integer(rCurMin), integer(rNextMin - 1.0))),
68+
Action => Action,
69+
Count => 0,
70+
Weight => Weight,
71+
AtLeast => AtLeast
72+
) ;
73+
rCurMin := rNextMin ;
74+
rRemainingBins := rRemainingBins - 1.0 ;
75+
end loop ;
76+
return iCovBin(1 to TotalBins) ;
77+
end if ;
78+
end function MakeBin ;
79+
80+
81+
------------------------------------------------------------
82+
-- Local, Used by GenBin, IllegalBin, and IgnoreBin
83+
function MakeBin(
84+
------------------------------------------------------------
85+
Min, Max : integer ;
86+
NumBin : integer ;
87+
AtLeast : integer ;
88+
Weight : integer ;
89+
Action : integer
90+
) return CovBinType is
91+
constant CALC_NUM_BINS : integer := minimum(NumBin, Max-Min+1) ;
92+
variable iCovBin : CovBinType(0 to CALC_NUM_BINS -1) ;
93+
variable CurMin, NextMin, RemainingBins, NumItemsInBin : integer ;
94+
begin
95+
CurMin := Min ;
96+
for i in iCovBin'range loop
97+
RemainingBins := CALC_NUM_BINS - i ;
98+
NumItemsInBin := (Max - CurMin + 1) / RemainingBins ;
99+
NextMin := CurMin + NumItemsInBin ;
100+
iCovBin(i) := (
101+
BinVal => (1 => (CurMin, NextMin - 1)),
102+
Action => Action,
103+
Count => 0,
104+
Weight => Weight,
105+
AtLeast => AtLeast
106+
) ;
107+
CurMin := NextMin ;
108+
end loop ;
109+
return iCovBin ;
110+
end function MakeBin ;
111+

MakeBin_Debug.vhld

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
------------------------------------------------------------
2+
-- Local, Used by GenBin, IllegalBin, and IgnoreBin
3+
function MakeBin(
4+
------------------------------------------------------------
5+
Min, Max : integer ;
6+
NumBin : integer ;
7+
AtLeast : integer ;
8+
Weight : integer ;
9+
Action : integer
10+
) return CovBinType is
11+
constant CALC_NUM_BINS : integer := minimum(NumBin, Max-Min+1) ;
12+
variable iCovBin : CovBinType(0 to CALC_NUM_BINS -1) ;
13+
variable CurMin, NextMin, RemainingBins, NumItemsInBin : integer ;
14+
begin
15+
CurMin := Min ;
16+
for i in iCovBin'range loop
17+
RemainingBins := CALC_NUM_BINS - i ;
18+
NumItemsInBin := (Max - CurMin + 1) / RemainingBins ;
19+
NextMin := CurMin + NumItemsInBin ;
20+
iCovBin(i) := (
21+
BinVal => (1 => (CurMin, NextMin - 1)),
22+
Action => Action,
23+
Count => 0,
24+
Weight => Weight,
25+
AtLeast => AtLeast
26+
) ;
27+
CurMin := NextMin ;
28+
end loop ;
29+
return iCovBin ;
30+
end function MakeBin ;

0 commit comments

Comments
 (0)