Skip to content

Commit

Permalink
Debugged and validated
Browse files Browse the repository at this point in the history
  • Loading branch information
JimLewis committed Oct 7, 2016
1 parent 8b0b056 commit fe9c209
Show file tree
Hide file tree
Showing 3 changed files with 113 additions and 117 deletions.
12 changes: 6 additions & 6 deletions CoveragePkg.vhd
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ package CoveragePkg is

------------------------------------------------------------ VendorCov
-- VendorCov Conversion for Vendor supported functional coverage modeling
function ToVendorCovBinVal (A : RangeArrayType) return VendorCovRangeArrayType ;
function ToVendorCovBinVal (BinVal : RangeArrayType) return VendorCovRangeArrayType ;

------------------------------------------------------------
function ToMinPoint (A : RangeArrayType) return integer ;
Expand Down Expand Up @@ -1117,7 +1117,7 @@ package body CoveragePkg is

------------------------------------------------------------ VendorCov
-- VendorCov Conversion for Vendor supported functional coverage modeling
function ToVendorCovBinVal (A : RangeArrayType) return VendorCovRangeArrayType is
function ToVendorCovBinVal (BinVal : RangeArrayType) return VendorCovRangeArrayType is
------------------------------------------------------------
variable VendorCovBinVal : VendorCovRangeArrayType(BinVal'range);
begin -- VendorCov
Expand Down Expand Up @@ -1329,7 +1329,7 @@ package body CoveragePkg is
CovNameVar.Set(Name) ;
-- VendorCov update if name updated after model created
if IsInitialized then -- VendorCov
VendorCovSetName(Name) ; -- VendorCov
VendorCovSetName(VendorCovHandleVar, Name) ; -- VendorCov
end if ; -- VendorCov
if not RvSeedInit then -- Init seed if not initialized
RV.InitSeed(Name) ;
Expand Down Expand Up @@ -1392,7 +1392,7 @@ package body CoveragePkg is
CovMessageVar.Set(Message) ;
-- VendorCov update if name updated after model created
if IsInitialized then -- VendorCov
VendorCovSetName(GetNamePlus) ; -- VendorCov
VendorCovSetName(VendorCovHandleVar, GetNamePlus) ; -- VendorCov
end if ; -- VendorCov
if not RvSeedInit then -- Init seed if not initialized
RV.InitSeed(Message) ;
Expand Down Expand Up @@ -1695,7 +1695,7 @@ package body CoveragePkg is
PercentCov : real := 0.0
) is
begin
VendorCovBinAdd(CovHandle, ToVendorCovBinVal(BinVal), Action, AtLeast, Name) ;
VendorCovBinAdd(VendorCovHandleVar, ToVendorCovBinVal(BinVal), Action, AtLeast, Name) ;
NumBins := NumBins + 1 ;
CovBinPtr.all(NumBins).BinVal := new RangeArrayType'(BinVal) ;
CovBinPtr.all(NumBins).Action := Action ;
Expand Down Expand Up @@ -2038,7 +2038,7 @@ package body CoveragePkg is
begin
-- Update Count, PercentCov
CovBinPtr(Index).Count := CovBinPtr(Index).Count + CovBinPtr(Index).action ;
VendorCovBinInc(CovHandle,Index); -- VendorCov
VendorCovBinInc(VendorCovHandleVar, Index); -- VendorCov
CovBinPtr(Index).PercentCov := real(CovBinPtr(Index).Count)*100.0/maximum(real(CovBinPtr(Index).AtLeast), 1.0) ;
-- OrderCount handling - Statistics
OrderCount := OrderCount + 1 ;
Expand Down
123 changes: 59 additions & 64 deletions VendorCovApiPkg.vhd
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@
--
-- Maintainer: Jim Lewis email: [email protected]
--
-- Based on work done in package VendorCovApiPkg_Aldec.vhd by:
-- ...
--
--
-- Package Defines
-- A set of foreign procedures that link OSVVM's CoveragePkg
-- coverage model creation and coverage capture with the
Expand Down Expand Up @@ -39,87 +43,78 @@

package VendorCovApiPkg is

subtype VendorCovHandleType is integer;
subtype VendorCovHandleType is integer;

-- Types for how coverage bins are represented. Matches OSVVM types.
type VendorCovRangeType is record
min: integer;
max: integer;
end record;
type VendorCovRangeType is record
min: integer;
max: integer;
end record;

type VendorCovRangeArrayType is array ( integer range <> ) of VendorCovRangeType;

-- Create Initial Data Structure for Point/Item Functional Coverage Model
-- Sets initial name of the coverage model if available
impure function VendorCovPointCreate( name: string ) return VendorCovHandleType;
-- attribute foreign of VendorCovPointCreate[ string return VendorCovHandleType ]: function is "VHPI systf; cvg_CvpCreate";
type VendorCovRangeArrayType is array ( integer range <> ) of VendorCovRangeType;

-- Create Initial Data Structure for Point/Item Functional Coverage Model
-- Sets initial name of the coverage model if available
impure function VendorCovPointCreate( name: string ) return VendorCovHandleType;

-- Create Initial Data Structure for Cross Functional Coverage Model
-- Sets initial name of the coverage model if available
impure function VendorCovCrossCreate( name: string ) return VendorCovHandleType;
-- attribute foreign of VendorCovCrossCreate[ string return VendorCovHandleType ]: function is "VHPI systf; cvg_CrCreate";
-- Create Initial Data Structure for Cross Functional Coverage Model
-- Sets initial name of the coverage model if available
impure function VendorCovCrossCreate( name: string ) return VendorCovHandleType;

-- Sets/Updates the name of the Coverage Model.
-- Should not be called until the data structure is created by VendorCovPointCreate or VendorCovCrossCreate.
-- Replaces name that was set by VendorCovPointCreate or VendorCovCrossCreate.
procedure VendorCovSetName( obj: VendorCovHandleType; name: string );
-- attribute foreign of VendorCovSetName[ VendorCovHandleType, string ]: procedure is "VHPI systf; cvg_SetCoverName";
-- Sets/Updates the name of the Coverage Model.
-- Should not be called until the data structure is created by VendorCovPointCreate or VendorCovCrossCreate.
-- Replaces name that was set by VendorCovPointCreate or VendorCovCrossCreate.
procedure VendorCovSetName( obj: VendorCovHandleType; name: string );

-- Add a bin or set of bins to either a Point/Item or Cross Functional Coverage Model
-- Checking for sizing that is different from original sizing already done in OSVVM CoveragePkg
-- It is important to maintain an index that corresponds to the order the bins were entered as
-- that is used when coverage is recorded.
procedure VendorCovBinAdd( obj: VendorCovHandleType; bins: CovRangeArrayType; Action: integer; atleast: integer; name: string );
-- attribute foreign of CvpCrBinCreate[ VendorCovHandleType, CovRangeArrayType, integer, integer, string ]: procedure is "VHPI systf; cvg_CvpCrBinCreate";
-- Add a bin or set of bins to either a Point/Item or Cross Functional Coverage Model
-- Checking for sizing that is different from original sizing already done in OSVVM CoveragePkg
-- It is important to maintain an index that corresponds to the order the bins were entered as
-- that is used when coverage is recorded.
procedure VendorCovBinAdd( obj: VendorCovHandleType; bins: VendorCovRangeArrayType; Action: integer; atleast: integer; name: string );

-- Increment the coverage of bin identified by index number.
-- Index ranges from 1 to Number of Bins.
-- Index corresponds to the order the bins were entered (starting from 1)
procedure VendorCovBinInc( obj: VendorCovHandleType; index: integer );
-- attribute foreign of VendorCovBinInc[ VendorCovHandleType, integer ]: procedure is "VHPI systf; cvg_CvpCrBinIncr";

-- Action (integer):
-- constant COV_COUNT : integer := 1;
-- constant COV_IGNORE : integer := 0;
-- constant COV_ILLEGAL : integer := -1;
-- Increment the coverage of bin identified by index number.
-- Index ranges from 1 to Number of Bins.
-- Index corresponds to the order the bins were entered (starting from 1)
procedure VendorCovBinInc( obj: VendorCovHandleType; index: integer );


end package;

package body VendorCovApiPkg is
-- Create Initial Data Structure for Point/Item Functional Coverage Model
-- Sets initial name of the coverage model if available
-- Create Initial Data Structure for Point/Item Functional Coverage Model
-- Sets initial name of the coverage model if available
impure function VendorCovPointCreate( name: string ) return VendorCovHandleType is
begin
return 0 ;
end function VendorCovPointCreate ;
begin
return 0 ;
end function VendorCovPointCreate ;

-- Create Initial Data Structure for Cross Functional Coverage Model
-- Sets initial name of the coverage model if available
-- Create Initial Data Structure for Cross Functional Coverage Model
-- Sets initial name of the coverage model if available
impure function VendorCovCrossCreate( name: string ) return VendorCovHandleType is
begin
return 0 ;
end function VendorCovCrossCreate ;
begin
return 0 ;
end function VendorCovCrossCreate ;

-- Sets/Updates the name of the Coverage Model.
-- Should not be called until the data structure is created by VendorCovPointCreate or VendorCovCrossCreate.
-- Replaces name that was set by VendorCovPointCreate or VendorCovCrossCreate.
-- Sets/Updates the name of the Coverage Model.
-- Should not be called until the data structure is created by VendorCovPointCreate or VendorCovCrossCreate.
-- Replaces name that was set by VendorCovPointCreate or VendorCovCrossCreate.
procedure VendorCovSetName( obj: VendorCovHandleType; name: string ) is
begin
end procedure VendorCovSetName ;
begin
end procedure VendorCovSetName ;

-- Add a bin or set of bins to either a Point/Item or Cross Functional Coverage Model
-- Checking for sizing that is different from original sizing already done in OSVVM CoveragePkg
-- It is important to maintain an index that corresponds to the order the bins were entered as
-- that is used when coverage is recorded.
procedure VendorCovBinAdd( obj: VendorCovHandleType; bins: CovRangeArrayType; Action: integer; atleast: integer; name: string )is
begin
end procedure VendorCovBinAdd ;
-- Add a bin or set of bins to either a Point/Item or Cross Functional Coverage Model
-- Checking for sizing that is different from original sizing already done in OSVVM CoveragePkg
-- It is important to maintain an index that corresponds to the order the bins were entered as
-- that is used when coverage is recorded.
procedure VendorCovBinAdd( obj: VendorCovHandleType; bins: VendorCovRangeArrayType; Action: integer; atleast: integer; name: string )is
begin
end procedure VendorCovBinAdd ;

-- Increment the coverage of bin identified by index number.
-- Index ranges from 1 to Number of Bins.
-- Index corresponds to the order the bins were entered (starting from 1)
-- Increment the coverage of bin identified by index number.
-- Index ranges from 1 to Number of Bins.
-- Index corresponds to the order the bins were entered (starting from 1)
procedure VendorCovBinInc( obj: VendorCovHandleType; index: integer )is
begin
end procedure VendorCovBinInc ;
begin
end procedure VendorCovBinInc ;

end package;
end package body VendorCovApiPkg ;
95 changes: 48 additions & 47 deletions VendorCovApiPkg_Aldec.vhd
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
--
-- File Name: VendorCovApiPkg.vhd
-- File Name: VendorCovApiPkg_Aldec.vhd
-- Design Unit Name: VendorCovApiPkg
-- Revision: STANDARD VERSION
-- Revision: ALDEC VERSION
--
-- Maintainer: Jim Lewis email: [email protected]
-- Maintainer:
--
-- Package Defines
-- A set of foreign procedures that link OSVVM's CoveragePkg
Expand All @@ -16,7 +16,7 @@
-- 10/2016: 1.0 Initial revision
--
--
-- Copyright (c) 2016 by SynthWorks Design Inc. All rights reserved.
-- Copyright (c) 2016 by Aldec. All rights reserved.
--
-- Verbatim copies of this source file may be used and
-- distributed without restriction.
Expand All @@ -39,52 +39,53 @@

package VendorCovApiPkg is

subtype VendorCovHandleType is integer;

-- Types for how coverage bins are represented. Matches OSVVM types.
type VendorCovRangeType is record
min: integer;
max: integer;
end record;

type VendorCovRangeArrayType is array ( integer range <> ) of VendorCovRangeType;

-- Create Initial Data Structure for Point/Item Functional Coverage Model
-- Sets initial name of the coverage model if available
impure function VendorCovPointCreate( name: string ) return VendorCovHandleType;
attribute foreign of VendorCovPointCreate[ string return VendorCovHandleType ]: function is "VHPI systf; cvg_CvpCreate";

-- Create Initial Data Structure for Cross Functional Coverage Model
-- Sets initial name of the coverage model if available
impure function VendorCovCrossCreate( name: string ) return VendorCovHandleType;
attribute foreign of VendorCovCrossCreate[ string return VendorCovHandleType ]: function is "VHPI systf; cvg_CrCreate";

-- Sets/Updates the name of the Coverage Model.
-- Should not be called until the data structure is created by VendorCovPointCreate or VendorCovCrossCreate.
-- Replaces name that was set by VendorCovPointCreate or VendorCovCrossCreate.
procedure VendorCovSetName( obj: VendorCovHandleType; name: string );
attribute foreign of VendorCovSetName[ VendorCovHandleType, string ]: procedure is "VHPI systf; cvg_SetCoverName";
subtype VendorCovHandleType is integer;

-- Add a bin or set of bins to either a Point/Item or Cross Functional Coverage Model
-- Checking for sizing that is different from original sizing already done in OSVVM CoveragePkg
-- It is important to maintain an index that corresponds to the order the bins were entered as
-- that is used when coverage is recorded.
procedure VendorCovBinAdd( obj: VendorCovHandleType; bins: CovRangeArrayType; Action: integer; atleast: integer; name: string );
attribute foreign of CvpCrBinCreate[ VendorCovHandleType, CovRangeArrayType, integer, integer, string ]: procedure is "VHPI systf; cvg_CvpCrBinCreate";
-- Increment the coverage of bin identified by index number.
-- Index ranges from 1 to Number of Bins.
-- Index corresponds to the order the bins were entered (starting from 1)
procedure VendorCovBinInc( obj: VendorCovHandleType; index: integer );
attribute foreign of VendorCovBinInc[ VendorCovHandleType, integer ]: procedure is "VHPI systf; cvg_CvpCrBinIncr";
-- Action (integer):
-- constant COV_COUNT : integer := 1;
-- constant COV_IGNORE : integer := 0;
-- Types for how coverage bins are represented. Matches OSVVM types.
type VendorCovRangeType is record
min: integer;
max: integer;
end record;

type VendorCovRangeArrayType is array ( integer range <> ) of VendorCovRangeType;

-- Create Initial Data Structure for Point/Item Functional Coverage Model
-- Sets initial name of the coverage model if available
impure function VendorCovPointCreate( name: string ) return VendorCovHandleType;
attribute foreign of VendorCovPointCreate[ string return VendorCovHandleType ]: function is "VHPI systf; cvg_CvpCreate";

-- Create Initial Data Structure for Cross Functional Coverage Model
-- Sets initial name of the coverage model if available
impure function VendorCovCrossCreate( name: string ) return VendorCovHandleType;
attribute foreign of VendorCovCrossCreate[ string return VendorCovHandleType ]: function is "VHPI systf; cvg_CrCreate";

-- Sets/Updates the name of the Coverage Model.
-- Should not be called until the data structure is created by VendorCovPointCreate or VendorCovCrossCreate.
-- Replaces name that was set by VendorCovPointCreate or VendorCovCrossCreate.
procedure VendorCovSetName( obj: VendorCovHandleType; name: string );
attribute foreign of VendorCovSetName[ VendorCovHandleType, string ]: procedure is "VHPI systf; cvg_SetCoverName";
-- Add a bin or set of bins to either a Point/Item or Cross Functional Coverage Model
-- Checking for sizing that is different from original sizing already done in OSVVM CoveragePkg
-- It is important to maintain an index that corresponds to the order the bins were entered as
-- that is used when coverage is recorded.
procedure VendorCovBinAdd( obj: VendorCovHandleType; bins: VendorCovRangeArrayType; Action: integer; atleast: integer; name: string );
attribute foreign of CvpCrBinCreate[ VendorCovHandleType, VendorCovRangeArrayType, integer, integer, string ]: procedure is "VHPI systf; cvg_CvpCrBinCreate";
-- Increment the coverage of bin identified by index number.
-- Index ranges from 1 to Number of Bins.
-- Index corresponds to the order the bins were entered (starting from 1)
procedure VendorCovBinInc( obj: VendorCovHandleType; index: integer );
attribute foreign of VendorCovBinInc[ VendorCovHandleType, integer ]: procedure is "VHPI systf; cvg_CvpCrBinIncr";
-- Action (integer):
-- constant COV_COUNT : integer := 1;
-- constant COV_IGNORE : integer := 0;
-- constant COV_ILLEGAL : integer := -1;
end package;
package body VendorCovApiPkg is
-- Removes any previously compiled package body
end package;
-- Replace any existing package body for this package
end package body VendorCovApiPkg ;

0 comments on commit fe9c209

Please sign in to comment.