I need a generic variable like "boolean" in VHDL-2008.
I cannot use the standard BOOLEAN type because it is not a protected type, which is required for common new-style variables.
I saw many quick implementations of the standard type as a protected type, and I could write my own set of bools, ints, pos, nats, ... but is this necessary?
Does VHDL-2008 have a set of such types in a common package?
So far, I just saw custom protected types.
Here is a protected BOOLEAN example from OSVVM .
type LocalBooleanPType is protected
procedure Set (A : boolean) ;
impure function get return boolean ;
end protected LocalBooleanPType ;
type LocalBooleanPType is protected body
variable GlobalVar : boolean := FALSE ;
procedure Set (A : boolean) is
begin
GlobalVar := A ;
end procedure Set ;
impure function get return boolean is
begin
return GlobalVar ;
end function get ;
end protected body LocalBooleanPType ;
source
share