diff --git a/AlertLogPkg.vhd b/AlertLogPkg.vhd index b67316c..c631291 100644 --- a/AlertLogPkg.vhd +++ b/AlertLogPkg.vhd @@ -69,7 +69,8 @@ use ieee.numeric_std.all ; package AlertLogPkg is - subtype AlertLogIDType is integer ; + type AlertLogIDType is range integer'low to integer'high ; + type AlertLogIDVectorType is array (integer range <>) of AlertLogIDType ; type AlertType is (FAILURE, ERROR, WARNING) ; -- NEVER subtype AlertIndexType is AlertType range FAILURE to WARNING ; type AlertCountType is array (AlertIndexType) of integer ; @@ -458,12 +459,12 @@ package body AlertLogPkg is ------------------------------------------------------------ procedure SetAlertLogName(Name : string ) ; - procedure SetNumAlertLogIDs (NewNumAlertLogIDs : integer) ; + procedure SetNumAlertLogIDs (NewNumAlertLogIDs : AlertLogIDType) ; impure function FindAlertLogID(Name : string ) return AlertLogIDType ; impure function FindAlertLogID(Name : string ; ParentID : AlertLogIDType) return AlertLogIDType ; impure function GetAlertLogID(Name : string ; ParentID : AlertLogIDType ; CreateHierarchy : Boolean) return AlertLogIDType ; impure function GetAlertLogParentID(AlertLogID : AlertLogIDType) return AlertLogIDType ; - procedure Initialize(NewNumAlertLogIDs : integer := MIN_NUM_AL_IDS) ; + procedure Initialize(NewNumAlertLogIDs : AlertLogIDType := MIN_NUM_AL_IDS) ; procedure Deallocate ; ------------------------------------------------------------ @@ -1061,7 +1062,7 @@ package body AlertLogPkg is ------------------------------------------------------------ -- PT Local -- Construct initial data structure - procedure LocalInitialize(NewNumAlertLogIDs : integer := MIN_NUM_AL_IDS) is + procedure LocalInitialize(NewNumAlertLogIDs : AlertLogIDType := MIN_NUM_AL_IDS) is ------------------------------------------------------------ begin if NumAllocatedAlertLogIDsVar /= 0 then @@ -1091,7 +1092,7 @@ package body AlertLogPkg is ------------------------------------------------------------ -- Construct initial data structure - procedure Initialize(NewNumAlertLogIDs : integer := MIN_NUM_AL_IDS) is + procedure Initialize(NewNumAlertLogIDs : AlertLogIDType := MIN_NUM_AL_IDS) is ------------------------------------------------------------ begin LocalInitialize(NewNumAlertLogIDs) ; @@ -1146,7 +1147,7 @@ package body AlertLogPkg is ------------------------------------------------------------ -- PT Local. - procedure GrowAlertStructure (NewNumAlertLogIDs : integer) is + procedure GrowAlertStructure (NewNumAlertLogIDs : AlertLogIDType) is ------------------------------------------------------------ variable oldAlertLogPtr : AlertLogArrayPtrType ; begin @@ -1165,7 +1166,7 @@ package body AlertLogPkg is -- Sets a AlertLogPtr to a particular size -- Use for small bins to save space or large bins to -- suppress the resize and copy as a CovBin autosizes. - procedure SetNumAlertLogIDs (NewNumAlertLogIDs : integer) is + procedure SetNumAlertLogIDs (NewNumAlertLogIDs : AlertLogIDType) is ------------------------------------------------------------ variable oldAlertLogPtr : AlertLogArrayPtrType ; begin diff --git a/ScoreboardGenericPkg.vhd b/ScoreboardGenericPkg.vhd index ed43425..ddc5665 100644 --- a/ScoreboardGenericPkg.vhd +++ b/ScoreboardGenericPkg.vhd @@ -448,12 +448,15 @@ package body ScoreboardGenericPkg is type IntegerArrayType is array (integer range <>) of Integer ; type IntegerArrayPointerType is access IntegerArrayType ; + type AlertLogIDArrayType is array (integer range <>) of AlertLogIDType ; + type AlertLogIDArrayPointerType is access AlertLogIDArrayType ; + variable ErrCntVar : IntegerArrayPointerType := new IntegerArrayType'(1 => 0) ; variable DropCountVar : IntegerArrayPointerType := new IntegerArrayType'(1 => 0) ; variable ItemNumberVar : IntegerArrayPointerType := new IntegerArrayType'(1 => 0) ; variable CheckCountVar : IntegerArrayPointerType := new IntegerArrayType'(1 => 0) ; - variable AlertLogIDVar : IntegerArrayPointerType := new IntegerArrayType'(1 => OSVVM_SCOREBOARD_ALERTLOG_ID) ; + variable AlertLogIDVar : AlertLogIDArrayPointerType := new AlertLogIDArrayType'(1 => OSVVM_SCOREBOARD_ALERTLOG_ID) ; variable NameVar : NamePType ; variable ReportModeVar : ScoreboardReportType ; @@ -509,7 +512,8 @@ package body ScoreboardGenericPkg is procedure SetArrayIndex(L, R : integer) is ------------------------------------------------------------ variable OldHeadPointer, OldTailPointer, OldPopListPointer : ListArrayPointerType ; - variable OldErrCnt, OldDropCount, OldItemNumber, OldCheckCount, OldAlertLogIDVar : IntegerArrayPointerType ; + variable OldErrCnt, OldDropCount, OldItemNumber, OldCheckCount : IntegerArrayPointerType ; + variable OldAlertLogIDVar : AlertLogIDArrayPointerType ; variable Min, Max, Len, OldLen, OldMax : integer ; begin Min := minimum(L, R) ; @@ -571,7 +575,7 @@ package body ScoreboardGenericPkg is end if ; OldAlertLogIDVar := AlertLogIDVar ; - AlertLogIDVar := new IntegerArrayType'(Min to Max => OSVVM_SCOREBOARD_ALERTLOG_ID) ; + AlertLogIDVar := new AlertLogIDArrayType'(Min to Max => OSVVM_SCOREBOARD_ALERTLOG_ID) ; if OldAlertLogIDVar /= NULL then AlertLogIDVar(Min to OldMax) := OldAlertLogIDVar.all ; Deallocate(OldAlertLogIDVar) ;