Library of reusable VHDL components
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

92 lines
4.1 KiB

  1. --
  2. -- File Name: VendorCovApiPkg_Aldec.vhd
  3. -- Design Unit Name: VendorCovApiPkg
  4. -- Revision: ALDEC VERSION
  5. --
  6. -- Maintainer:
  7. --
  8. -- Package Defines
  9. -- A set of foreign procedures that link OSVVM's CoveragePkg
  10. -- coverage model creation and coverage capture with the
  11. -- built-in capability of a simulator.
  12. --
  13. --
  14. -- Revision History: For more details, see CoveragePkg_release_notes.pdf
  15. -- Date Version Description
  16. -- 11/2016: 2016.11 Initial revision
  17. -- 12/2016 2016.11a Fixed an issue with attributes
  18. --
  19. --
  20. -- Copyright (c) 2016 by Aldec. All rights reserved.
  21. --
  22. -- Verbatim copies of this source file may be used and
  23. -- distributed without restriction.
  24. --
  25. -- Modified copies of this source file may be distributed
  26. -- under the terms of the ARTISTIC License as published by
  27. -- The Perl Foundation; either version 2.0 of the License,
  28. -- or (at your option) any later version.
  29. --
  30. -- This source is distributed in the hope that it will be
  31. -- useful, but WITHOUT ANY WARRANTY; without even the implied
  32. -- warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
  33. -- PURPOSE. See the Artistic License for details.
  34. --
  35. -- You should have received a copy of the license with this source.
  36. -- If not download it from,
  37. -- http://www.perlfoundation.org/artistic_license_2_0
  38. -- --
  39. --------------------------------------------------------------------------
  40. package VendorCovApiPkg is
  41. subtype VendorCovHandleType is integer;
  42. -- Types for how coverage bins are represented. Matches OSVVM types.
  43. type VendorCovRangeType is record
  44. min: integer;
  45. max: integer;
  46. end record;
  47. type VendorCovRangeArrayType is array ( integer range <> ) of VendorCovRangeType;
  48. -- Create Initial Data Structure for Point/Item Functional Coverage Model
  49. -- Sets initial name of the coverage model if available
  50. impure function VendorCovPointCreate( name: string ) return VendorCovHandleType;
  51. attribute foreign of VendorCovPointCreate[ string return VendorCovHandleType ]: function is "VHPI systf; cvg_CvpCreate";
  52. -- Create Initial Data Structure for Cross Functional Coverage Model
  53. -- Sets initial name of the coverage model if available
  54. impure function VendorCovCrossCreate( name: string ) return VendorCovHandleType;
  55. attribute foreign of VendorCovCrossCreate[ string return VendorCovHandleType ]: function is "VHPI systf; cvg_CrCreate";
  56. -- Sets/Updates the name of the Coverage Model.
  57. -- Should not be called until the data structure is created by VendorCovPointCreate or VendorCovCrossCreate.
  58. -- Replaces name that was set by VendorCovPointCreate or VendorCovCrossCreate.
  59. procedure VendorCovSetName( obj: VendorCovHandleType; name: string );
  60. attribute foreign of VendorCovSetName[ VendorCovHandleType, string ]: procedure is "VHPI systf; cvg_SetCoverName";
  61. -- Add a bin or set of bins to either a Point/Item or Cross Functional Coverage Model
  62. -- Checking for sizing that is different from original sizing already done in OSVVM CoveragePkg
  63. -- It is important to maintain an index that corresponds to the order the bins were entered as
  64. -- that is used when coverage is recorded.
  65. procedure VendorCovBinAdd( obj: VendorCovHandleType; bins: VendorCovRangeArrayType; Action: integer; atleast: integer; name: string );
  66. attribute foreign of VendorCovBinAdd[ VendorCovHandleType, VendorCovRangeArrayType, integer, integer, string ]: procedure is "VHPI systf; cvg_CvpCrBinCreate";
  67. -- Increment the coverage of bin identified by index number.
  68. -- Index ranges from 1 to Number of Bins.
  69. -- Index corresponds to the order the bins were entered (starting from 1)
  70. procedure VendorCovBinInc( obj: VendorCovHandleType; index: integer );
  71. attribute foreign of VendorCovBinInc[ VendorCovHandleType, integer ]: procedure is "VHPI systf; cvg_CvpCrBinIncr";
  72. -- Action (integer):
  73. -- constant COV_COUNT : integer := 1;
  74. -- constant COV_IGNORE : integer := 0;
  75. -- constant COV_ILLEGAL : integer := -1;
  76. end package;
  77. package body VendorCovApiPkg is
  78. -- Replace any existing package body for this package
  79. end package body VendorCovApiPkg ;