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.

120 lines
5.1 KiB

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