Skip to content

Commit c3f8221

Browse files
committed
Merge branch 'Dev'
2 parents bee49a0 + e5bb353 commit c3f8221

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

CoveragePkg.vhd

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
-- Jim Lewis SynthWorks
99
-- Matthias Alles Creonic. Inspired GetMinBinVal, GetMinPoint, GetCov
1010
-- Jerry Kaczynski Aldec. Inspired GetBin function
11-
--
11+
-- Sebastian Dunst Inspired GetBinName function
1212
--
1313
-- Package Defines
1414
-- Functional coverage modeling utilities and data structure
@@ -43,6 +43,7 @@
4343
-- 01/2015 2015.01 Use AlertLogPkg to count assertions and filter log messages
4444
-- 06/2015 2015.06 AddCross[CovMatrix?Type], Mirroring for WriteBin
4545
-- 01/2016 2016.01 Fixes for pure functions. Added bounds checking on ICover
46+
-- 03/2016 2016.03 Added GetBinName(Index) to retrieve a bin's name
4647
--
4748
-- Development Notes:
4849
-- The coverage procedures are named ICover to avoid conflicts with
@@ -436,6 +437,7 @@ package CoveragePkg is
436437
impure function GetBin ( BinIndex : integer ) return CovMatrix7BaseType ;
437438
impure function GetBin ( BinIndex : integer ) return CovMatrix8BaseType ;
438439
impure function GetBin ( BinIndex : integer ) return CovMatrix9BaseType ;
440+
impure function GetBinName ( BinIndex : integer; DefaultName : string := "" ) return string ;
439441

440442
------------------------------------------------------------
441443
procedure WriteBin (
@@ -2716,6 +2718,17 @@ package body CoveragePkg is
27162718
result.Weight := CovBinPtr(BinIndex).Weight;
27172719
return result ;
27182720
end function GetBin ;
2721+
2722+
-- ------------------------------------------------------------
2723+
impure function GetBinName ( BinIndex : integer; DefaultName : string := "" ) return string is
2724+
-- ------------------------------------------------------------
2725+
begin
2726+
if CovBinPtr(BinIndex).Name.all /= "" then
2727+
return CovBinPtr(BinIndex).Name.all ;
2728+
else
2729+
return DefaultName ;
2730+
end if;
2731+
end function GetBinName;
27192732

27202733
------------------------------------------------------------
27212734
-- pt local for now -- file formal parameter not allowed with method

0 commit comments

Comments
 (0)