Skip to content

Commit

Permalink
OSVVM 2017.05
Browse files Browse the repository at this point in the history
  • Loading branch information
JimLewis committed Jun 8, 2017
1 parent dc4fe3d commit 8351ce7
Show file tree
Hide file tree
Showing 16 changed files with 758 additions and 143 deletions.
809 changes: 694 additions & 115 deletions AlertLogPkg.vhd

Large diffs are not rendered by default.

71 changes: 51 additions & 20 deletions CoveragePkg.vhd
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,9 @@
-- 01/2016 2016.01 Fixes for pure functions. Added bounds checking on ICover
-- 03/2016 2016.03 Added GetBinName(Index) to retrieve a bin's name
-- 11/2016 2016.11 Added VendorCovApiPkg and calls to bind it in.
-- 05/2017 2017.05 Updated WriteBin name printing
-- ClearCov (deprecates SetCovZero)
--
--
-- Development Notes:
-- The coverage procedures are named ICover to avoid conflicts with
Expand All @@ -56,7 +59,7 @@
-- composites with unconstrained elements
--
--
-- Copyright (c) 2010 - 2016 by SynthWorks Design Inc. All rights reserved.
-- Copyright (c) 2010 - 2017 by SynthWorks Design Inc. All rights reserved.
--
-- Verbatim copies of this source file may be used and
-- distributed without restriction.
Expand Down Expand Up @@ -385,6 +388,7 @@ package CoveragePkg is
procedure ICover( CovPoint : integer) ;
procedure ICover( CovPoint : integer_vector) ;

procedure ClearCov ;
procedure SetCovZero ;

impure function IsInitialized return boolean ;
Expand Down Expand Up @@ -1193,6 +1197,18 @@ package body CoveragePkg is
end loop ;
return aMessage ;
end function GetWord ;

------------------------------------------------------------
-- Local -- long term move to MessagePkg? Used by WriteCovDb
procedure WriteMessage ( file f : text ; variable Message : inout MessagePType ) is
------------------------------------------------------------
variable buf : line ;
begin
for i in 1 to Message.GetCount loop
write(buf, string'(Message.Get(i))) ;
writeline(f, buf) ;
end loop ;
end procedure WriteMessage ;

------------------------------------------------------------------------------------------
-- XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX CovPType XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Expand Down Expand Up @@ -1445,19 +1461,27 @@ package body CoveragePkg is
procedure WriteBinName ( file f : text ; S : string ; Prefix : string := "%% " ) is
------------------------------------------------------------
variable MessageCount : integer ;
variable MessageIndex : integer := 1 ;
variable buf : line ;
begin
MessageCount := CovMessageVar.GetCount ;
if MessageCount = 0 then
if Prefix'length + S'length > 0 then -- everything except WriteCovDb
write(buf, Prefix & S & GetCovModelName) ; -- Print name when no message
writeline(f, buf) ;
-- write(f, Prefix & S & LF);
end if ;
write(buf, Prefix & S & GetCovModelName) ; -- Print name when no message
writeline(f, buf) ;
else
write(buf, Prefix & S & string'(CovMessageVar.Get(1))) ;
if CovNameVar.IsSet then
-- Print Name if set
write(buf, Prefix & S & CovNameVar.Get) ;
elsif AlertLogIDVar /= OSVVM_ALERTLOG_ID then
-- otherwise Print AlertLogName if it is set
write(buf, Prefix & S & GetAlertLogName(AlertLogIDVar)) ;
else
-- otherwise print the first line of the message
MessageIndex := 2 ;
write(buf, Prefix & S & string'(CovMessageVar.Get(1))) ;
end if ;
writeline(f, buf) ;
for i in 2 to MessageCount loop
for i in MessageIndex to MessageCount loop
write(buf, Prefix & string'(CovMessageVar.Get(i))) ;
writeline(f, buf) ;
end loop ;
Expand Down Expand Up @@ -2103,7 +2127,7 @@ package body CoveragePkg is


------------------------------------------------------------
procedure SetCovZero is
procedure ClearCov is
------------------------------------------------------------
begin
for i in 1 to NumBins loop
Expand All @@ -2112,8 +2136,15 @@ package body CoveragePkg is
CovBinPtr(i).OrderCount := 0 ;
end loop ;
OrderCount := 0 ;
end procedure SetCovZero ;
end procedure ClearCov ;

------------------------------------------------------------
-- deprecated
procedure SetCovZero is
------------------------------------------------------------
begin
ClearCov ;
end procedure SetCovZero ;

------------------------------------------------------------
impure function IsInitialized return boolean is
Expand Down Expand Up @@ -2924,7 +2955,7 @@ package body CoveragePkg is
FailName : string := OSVVM_STRING_INIT_PARM_DETECT
) is
begin
if IsLoggingEnabled(AlertLogIDVar, LogLevel) then
if IsLogEnabled(AlertLogIDVar, LogLevel) then
WriteBin (
WritePassFail => WritePassFail,
WriteBinInfo => WriteBinInfo,
Expand Down Expand Up @@ -2990,7 +3021,7 @@ package body CoveragePkg is
FailName : string := OSVVM_STRING_INIT_PARM_DETECT
) is
begin
if IsLoggingEnabled(AlertLogIDVar, LogLevel) then
if IsLogEnabled(AlertLogIDVar, LogLevel) then
UsingLocalFile := TRUE ;
WriteBin (
FileName => FileName,
Expand Down Expand Up @@ -3051,7 +3082,7 @@ package body CoveragePkg is
procedure DumpBin (LogLevel : LogType := DEBUG) is
------------------------------------------------------------
begin
if IsLoggingEnabled(AlertLogIDVar, LogLevel) then
if IsLogEnabled(AlertLogIDVar, LogLevel) then
if WriteBinFileInit then
-- Write to Local WriteBinFile - Deprecated, recommend use TranscriptFile instead
DumpBin(WriteBinFile) ;
Expand Down Expand Up @@ -3136,7 +3167,7 @@ package body CoveragePkg is
procedure WriteCovHoles ( LogLevel : LogType := ALWAYS ) is
------------------------------------------------------------
begin
if IsLoggingEnabled(AlertLogIDVar, LogLevel) then
if IsLogEnabled(AlertLogIDVar, LogLevel) then
WriteCovHoles(CovTarget) ;
end if;
end procedure WriteCovHoles ;
Expand All @@ -3146,7 +3177,7 @@ package body CoveragePkg is
procedure WriteCovHoles ( LogLevel : LogType ; PercentCov : real ) is
------------------------------------------------------------
begin
if IsLoggingEnabled(AlertLogIDVar, LogLevel) then
if IsLogEnabled(AlertLogIDVar, LogLevel) then
WriteCovHoles(PercentCov) ;
end if;
end procedure WriteCovHoles ;
Expand All @@ -3167,7 +3198,7 @@ package body CoveragePkg is
procedure WriteCovHoles ( LogLevel : LogType ; FileName : string; OpenKind : File_Open_Kind := APPEND_MODE ) is
------------------------------------------------------------
begin
if IsLoggingEnabled(AlertLogIDVar, LogLevel) then
if IsLogEnabled(AlertLogIDVar, LogLevel) then
WriteCovHoles(FileName, OpenKind) ;
end if;
end procedure WriteCovHoles ;
Expand All @@ -3188,7 +3219,7 @@ package body CoveragePkg is
procedure WriteCovHoles ( LogLevel : LogType ; FileName : string; PercentCov : real ; OpenKind : File_Open_Kind := APPEND_MODE ) is
------------------------------------------------------------
begin
if IsLoggingEnabled(AlertLogIDVar, LogLevel) then
if IsLogEnabled(AlertLogIDVar, LogLevel) then
WriteCovHoles(FileName, PercentCov, OpenKind) ;
end if;
end procedure WriteCovHoles ;
Expand Down Expand Up @@ -3550,7 +3581,7 @@ package body CoveragePkg is
writeline(CovDbFile, buf) ;
write(buf, CovMessageVar.GetCount ) ;
writeline(CovDbFile, buf) ;
WriteBinName(CovDbFile, "", "") ;
WriteMessage(CovDbFile, CovMessageVar) ;
end procedure WriteCovDbVars ;


Expand Down Expand Up @@ -4085,7 +4116,7 @@ package body CoveragePkg is
procedure WriteCovHoles ( LogLevel : LogType ; AtLeast : integer ) is
------------------------------------------------------------
begin
if IsLoggingEnabled(AlertLogIDVar, LogLevel) then
if IsLogEnabled(AlertLogIDVar, LogLevel) then
WriteCovHoles(AtLeast) ;
end if;
end procedure WriteCovHoles ;
Expand All @@ -4105,7 +4136,7 @@ package body CoveragePkg is
procedure WriteCovHoles ( LogLevel : LogType ; FileName : string; AtLeast : integer ; OpenKind : File_Open_Kind := APPEND_MODE ) is
------------------------------------------------------------
begin
if IsLoggingEnabled(AlertLogIDVar, LogLevel) then
if IsLogEnabled(AlertLogIDVar, LogLevel) then
WriteCovHoles(FileName, AtLeast, OpenKind) ;
end if;
end procedure WriteCovHoles ;
Expand Down
3 changes: 2 additions & 1 deletion MessagePkg.vhd
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ package MessagePkg is
procedure Deallocate ; -- clear message

end protected MessagePType ;

end package MessagePkg ;

--- ///////////////////////////////////////////////////////////////////////////
Expand Down Expand Up @@ -161,4 +161,5 @@ package body MessagePkg is
end procedure Clear ;

end protected body MessagePType ;

end package body MessagePkg ;
12 changes: 7 additions & 5 deletions ScoreboardGenericPkg.vhd
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
-- Deprecated SetFinish and ReportMode - REPORT_NONE, FileOpen
-- Deallocate, Initialized, Function SetName
-- 11/2016 2016.11 Released as part of OSVVM
--
-- 05/2017 2017.05 First print Actual then only print Expected if mis-match
--
--
-- Copyright (c) 2006 - 2016 by SynthWorks Design Inc. All rights reserved.
Expand Down Expand Up @@ -241,7 +241,7 @@ package ScoreboardGenericPkg is
-- SetAlertLogID - associate an AlertLogID with a scoreboard to allow integrated error reporting
procedure SetAlertLogID(Index : Integer ; Name : string ; ParentID : AlertLogIDType := ALERTLOG_BASE_ID ; CreateHierarchy : Boolean := TRUE) ;
procedure SetAlertLogID(Name : string ; ParentID : AlertLogIDType := ALERTLOG_BASE_ID ; CreateHierarchy : Boolean := TRUE) ;
-- Use when an AlertLogID is used by multiple items (BFM or Scoreboards). See also AlertLogPkg.GetAlertLogID
-- Use when an AlertLogID is used by multiple items (Model or other Scoreboards). See also AlertLogPkg.GetAlertLogID
procedure SetAlertLogID (Index : Integer ; A : AlertLogIDType) ;
procedure SetAlertLogID (A : AlertLogIDType) ;
impure function GetAlertLogID(Index : Integer) return AlertLogIDType ;
Expand Down Expand Up @@ -925,7 +925,7 @@ package body ScoreboardGenericPkg is
FoundError := FALSE ;
end if ;

IncAffirmCheckCount ;
IncAffirmCount ;

-- if FoundError or ReportModeVar = REPORT_ALL then
if FoundError or GetLogEnable(AlertLogIDVar(Index), PASSED) then
Expand All @@ -937,8 +937,10 @@ package body ScoreboardGenericPkg is
if ArrayLengthVar > 1 then
write(WriteBuf, " (" & to_string(Index) & ") ") ;
end if ;
write(WriteBuf, " Expected: " & expected_to_string(ExpectedPtr.all)) ;
write(WriteBuf, " Actual: " & actual_to_string(ActualData)) ;
write(WriteBuf, " Received: " & actual_to_string(ActualData)) ;
if FoundError then
write(WriteBuf, " Expected: " & expected_to_string(ExpectedPtr.all)) ;
end if ;
if PopListPointer(Index).TagPtr.all /= "" then
write(WriteBuf, " Tag: " & PopListPointer(Index).TagPtr.all) ;
end if;
Expand Down
Binary file modified doc/AlertLogPkg_user_guide.pdf
Binary file not shown.
Binary file modified doc/CoveragePkg_user_guide.pdf
Binary file not shown.
Binary file modified doc/NamePkg_user_guide.pdf
Binary file not shown.
Binary file modified doc/OsvvmGlobalPkg_user_guide.pdf
Binary file not shown.
Binary file modified doc/RandomPkg_user_guide.pdf
Binary file not shown.
Binary file modified doc/ScoreboardPkg_user_guide.pdf
Binary file not shown.
Binary file modified doc/TbUtilPkg_user_guide.pdf
Binary file not shown.
Binary file modified doc/TextUtilPkg_user_guide.pdf
Binary file not shown.
Binary file modified doc/TranscriptPkg_user_guide.pdf
Binary file not shown.
Binary file modified doc/VendorCovApiPkg_user_guide.pdf
Binary file not shown.
Binary file modified doc/osvvm_release_notes.pdf
Binary file not shown.
6 changes: 4 additions & 2 deletions osvvm.do
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,11 @@
#
#
# Update OSVVM_DIR to match your environment:
set DIR_RUN [pwd]
set OSVVM_LIB_NAME osvvm
set OSVVM_DIR ${DIR_RUN}/../../../_osvvm/_github
set OSVVM_DIR [pwd]
if {$argc > 0} {
set OSVVM_DIR $1
}

vcom -2008 -work ${OSVVM_LIB_NAME} ${OSVVM_DIR}/NamePkg.vhd
vcom -2008 -work ${OSVVM_LIB_NAME} ${OSVVM_DIR}/OsvvmGlobalPkg.vhd
Expand Down

0 comments on commit 8351ce7

Please sign in to comment.