简体   繁体   中英

Has VHDL-2008 standard type protected type implementations?

I need a shared variable of type 'boolean' in VHDL-2008.

I can't use the standard type BOOLEAN, because it's not a protected type, which is required for new style shared variables.

I saw many quick standard type implementations as a protected type and of cause 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?

Until now, I just saw user implemented 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 ; 

I will post user1155120's comments in an answer, so this question doesn't show as unanswered. Start quote:

If you were to look IEEE Std 1076-2008 Annex D Potentially nonportable constructs , shared variables are listed as "not guaranteed to be portable". A shared variable object shall be a protected type (6.4.2.4, para 3). 5.6.1 Protected type definitions:

... A protected type implements instantiatiable regions of sequential statements, each of which are guaranteed exclusive access to shared data. Shared data is a set of variable objects that may be potentially accessed as a unit by multiple processes..

Are you asking about standardized methods? (5.6.2 para 4). (The answer is no.)

Furthermore in 5.6.2 :

Each subprogram specified within a given protected type declaration defines an abstract operation, called a method, that operates atomically and exclusively on a single object of the protected type.

A method function is impure and exclusive access is abstract, there's no hardware imperative. There's no widely recognized set of useful objects and abstract operations that demonstrates a need for standardization in verification as yet. There are other verification methodologies.

All honors go to user155120

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM