Download presentation
Presentation is loading. Please wait.
Published byLoren Eugenia Lee Modified over 8 years ago
1
1/8/2007 - L10 AttributesCopyright 2006 - Joanne DeGroat, ECE, OSU1 Language Attributes and Package Standard A very useful aspect of the language.
2
1/8/2007 - L10 AttributesCopyright 2006 - Joanne DeGroat, ECE, OSU2 Attributes What are attributes? VHDL Attributes Types Signal Variables Examples Signal Specific Other Package Standard
3
1/8/2007 - L10 AttributesCopyright 2006 - Joanne DeGroat, ECE, OSU3 What are attributes? John is just plain nasty!!!! Being nasty is an attribute of John. Language attributes Lovely, pretty and handsome are adjectives which describe and a attribute of the language element they apply to. Lovely Rita ….. (Do you remember the Beatles!)
4
1/8/2007 - L10 AttributesCopyright 2006 - Joanne DeGroat, ECE, OSU4 What are attributes? VHDL attributes provide additional information on the language element to which they are associated. For example They can tell you the size of an array and whether the index is X to Y or Y downto X. They can tell you a signal’s last value Etc.
5
1/8/2007 - L10 AttributesCopyright 2006 - Joanne DeGroat, ECE, OSU5 Attributes that relate to TYPES ATTRIBUTE: T’BASE Kind: Type Prefix: Any Type or Subtype T Result Type: The base type of T Result: Same – a type Restrictions: This attribute is allowed only as a prefix of the name of another attribute; T’BASE’LEFT Example: BIT’BASE’LEFT is ‘0’ Base Type: The base type of a type is the type itself
6
1/8/2007 - L10 AttributesCopyright 2006 - Joanne DeGroat, ECE, OSU6 Attributes that relate to TYPES ATTRIBUTE: T’LEFT Kind: Value Prefix: Any scalar type or subtype T Result Type: Same type a T Result: The left bound of T Example: BIT’LEFT has value ‘0’ Scalar type consist of enumeration, integer, physical, and floating point types.
7
1/8/2007 - L10 AttributesCopyright 2006 - Joanne DeGroat, ECE, OSU7 Attributes that relate to TYPES ATTRIBUTE: T’RIGHT Kind: Value Prefix: Any scalar type or subtype T Result Type: Same type a T Result: The right bound of T Example: BIT’RIGHT has value ‘1’
8
1/8/2007 - L10 AttributesCopyright 2006 - Joanne DeGroat, ECE, OSU8 Attributes that relate to TYPES ATTRIBUTE: T’HIGH Kind: Value Prefix: Any scalar type or subtype T Result Type: Same type a T Result: The upper bound of T Example: BIT’ HIGH has value ‘1’
9
1/8/2007 - L10 AttributesCopyright 2006 - Joanne DeGroat, ECE, OSU9 Attributes that relate to TYPES ATTRIBUTE: T’LOW Kind: Value Prefix: Any scalar type or subtype T Result Type: Same type a T Result: The lower bound of T Example: BIT’LOW has value ‘0’
10
1/8/2007 - L10 AttributesCopyright 2006 - Joanne DeGroat, ECE, OSU10 Attributes that relate to TYPES ATTRIBUTE: T’POS(X) Kind: Function Prefix: Any discrete or physical type or subtype T A discrete type is an enumeration or intger type. Parameter: Any expression whose type is the base type of T Result Type: Universal Integer Universal integer is an integer of an anonymous predefined integer type. An integer. Result: The position number of the value of the parameter. Example: type operations is (OPADD, OPSUB, OPAND, OPOR); signal oper : operations; Then operations’POS(OPSUB) has value 2 operations’POS(OPOR) has value 4
11
1/8/2007 - L10 AttributesCopyright 2006 - Joanne DeGroat, ECE, OSU11 Attributes that relate to TYPES ATTRIBUTE: T’VAL(X) Kind: Function Prefix: Any discrete or physical type or subtype T Parameter: Any expression of any integer type Result Type: The base type of T Result: The value from the type whose position number is the universal integer value corresponding to X Example: type operations is (OPADD, OPSUB, OPAND, OPOR); signal oper : operations; Then operations’VAL(2) has value OPSUB operations’VAL(4) has value OPOR
12
1/8/2007 - L10 AttributesCopyright 2006 - Joanne DeGroat, ECE, OSU12 Attributes that relate to TYPES ATTRIBUTE: T’SUCC(X) Kind: Function Prefix: Any discrete or physical type or subtype T Parameter: Any expression whose type is the base type of T Result Type: The base type of T Result: The value whose position number is one greater than that of the parameter. Restricitons: An error occurs if X equals T’BASE’HIGH Example: type operations is (OPADD, OPSUB, OPAND, OPOR); signal oper : operations; Then operations’SUCC(OPSUB) has value OPAND operations’SUCC(OPAND) has value OPOR
13
1/8/2007 - L10 AttributesCopyright 2006 - Joanne DeGroat, ECE, OSU13 Attributes that relate to TYPES ATTRIBUTE: T’PRED(X) Kind: Function Prefix: Any discrete or physical type or subtype T Parameter: Any expression whose type is the base type of T Result Type: The base type of T Result: The value whose position number is one less than that of the parameter. Restricitons: An error occurs if X equals T’BASE’LOW Example: type operations is (OPADD, OPSUB, OPAND, OPOR); signal oper : operations; Then operations’PRED(OPSUB) has value OPADD operations’PRED(OPAND) has value OPSUB
14
1/8/2007 - L10 AttributesCopyright 2006 - Joanne DeGroat, ECE, OSU14 Attributes that relate to TYPES ATTRIBUTE: T’LEFTOF(X) Kind: Function Prefix: Any discrete or physical type or subtype T Parameter: Any expression whose type is the base type of T Result Type: The base type of T Result: The value which is to the left of the parameter in the range of T. Restricitons: An error occurs if X equals T’BASE’LEFT Example: type operations is (OPADD, OPSUB, OPAND, OPOR); signal oper : operations; Then operations’LEFTOF(OPSUB) has value OPADD
15
1/8/2007 - L10 AttributesCopyright 2006 - Joanne DeGroat, ECE, OSU15 Attributes that relate to TYPES ATTRIBUTE: T’RIGHTOF(X) Kind: Function Prefix: Any discrete or physical type or subtype T Parameter: Any expression whose type is the base type of T Result Type: The base type of T Result: The value which is to the right of the parameter in the range of T. Restricitons: An error occurs if X equals T’BASE’RIGHT Example: type operations is (OPADD, OPSUB, OPAND, OPOR); signal oper : operations; Then operations’RIGHTOF(OPSUB) has value OPAND
16
1/8/2007 - L10 AttributesCopyright 2006 - Joanne DeGroat, ECE, OSU16 Attributes that relate to ARRAYS ATTRIBUTE: A’LEFT[(N)] Kind: Function Prefix: Any prefix A that is an array object Parameter: Locally static expression of type integer. Defaults to 1. Result Type: Type of the Nth index range of A Result: Left bound of the Nth index range of A. ATTRIBUTE: A’RIGHT[(N)] Kind: Function Prefix: Any prefix A that is an array object Parameter: Locally static expression of type integer. Defaults to 1. Result Type: Type of the Nth index range of A Result: Right bound of the Nth index range of A.
17
1/8/2007 - L10 AttributesCopyright 2006 - Joanne DeGroat, ECE, OSU17 Attributes that relate to ARRAYS ATTRIBUTE: A’HIGH[(N)] Kind: Function Prefix: Any prefix A that is an array object Parameter: Locally static expression of type integer. Defaults to 1. Result Type: Type of the Nth index range of A Result: Upper bound of the Nth index range of A. ATTRIBUTE: A’LOW[(N)] Kind: Function Prefix: Any prefix A that is an array object Parameter: Locally static expression of type integer. Defaults to 1. Result Type: Type of the Nth index range of A Result: Lower bound of the Nth index range of A.
18
1/8/2007 - L10 AttributesCopyright 2006 - Joanne DeGroat, ECE, OSU18 Attributes that relate to ARRAYS ATTRIBUTE: A’RANGE[(N)] Kind: Range Prefix: Any prefix A that is an array object Parameter: Locally static expression of type integer. Defaults to 1. Result Type: Type of the Nth index range of A Result: The range A’LEFT(N) to A’RIGHT(N) or A’LEFT(N) downto A’RIGHT(N) ATTRIBUTE: A’REVERSE_RANGE[(N)] Kind: Range Prefix: Any prefix A that is an array object Parameter: Locally static expression of type integer. Defaults to 1. Result Type: Type of the Nth index range of A Result:. The range A’ RIGHT(N) to A’ LEFT(N) or A’ RIGHT(N) downto A’ LEFT(N)
19
1/8/2007 - L10 AttributesCopyright 2006 - Joanne DeGroat, ECE, OSU19 Attributes that relate to ARRAYS ATTRIBUTE: A’LENGHT[(N)] Kind: Range Prefix: Any prefix A that is an array object Parameter: Locally static expression of type integer. Defaults to 1. Result Type: Universal Integer Result: Number of values in the Nth index range, i.e., A’HIGH(N) – A’LOW(N) +1
20
1/8/2007 - L10 AttributesCopyright 2006 - Joanne DeGroat, ECE, OSU20 Attributes that relate to ARRAYS EXAMPLE: signal mydt : bit_vector (31 downto 0); signal myto : bit_vector ( 0 to 15); Then the
21
1/8/2007 - L10 AttributesCopyright 2006 - Joanne DeGroat, ECE, OSU21 Attributes that relate to ARRAYS EXAMPLE: signal mydt : bit_vector (31 downto 0); signal myto : bit_vector ( 0 to 15); Then the
22
1/8/2007 - L10 AttributesCopyright 2006 - Joanne DeGroat, ECE, OSU22 Attributes that relate to ARRAYS EXAMPLE: signal mydt : bit_vector (31 downto 0); signal myto : bit_vector ( 0 to 15); Then the
23
1/8/2007 - L10 AttributesCopyright 2006 - Joanne DeGroat, ECE, OSU23 Attributes that relate to ARRAYS EXAMPLE: signal mydt : bit_vector (31 downto 0); signal myto : bit_vector ( 0 to 15); Then the
24
1/8/2007 - L10 AttributesCopyright 2006 - Joanne DeGroat, ECE, OSU24 Attributes that relate to ARRAYS EXAMPLE: signal mydt : bit_vector (31 downto 0); signal myto : bit_vector ( 0 to 15); Then the
25
1/8/2007 - L10 AttributesCopyright 2006 - Joanne DeGroat, ECE, OSU25 Attributes that relate to ARRAYS EXAMPLE: signal mydt : bit_vector (31 downto 0); signal myto : bit_vector ( 0 to 15); Then the
26
1/8/2007 - L10 AttributesCopyright 2006 - Joanne DeGroat, ECE, OSU26 Attributes that relate to ARRAYS EXAMPLE: signal mydt : bit_vector (31 downto 0); signal myto : bit_vector ( 0 to 15); Then the
27
1/8/2007 - L10 AttributesCopyright 2006 - Joanne DeGroat, ECE, OSU27 Attributes that relate to ARRAYS EXAMPLE: signal mydt : bit_vector (31 downto 0); signal myto : bit_vector ( 0 to 15); Then the
28
1/8/2007 - L10 AttributesCopyright 2006 - Joanne DeGroat, ECE, OSU28 Attributes that relate to SIGNALS ATTRIBUTE: S’DELAYED[(T)] Kind: Signal Prefix: Any signal Parameter: Any static expression of type TIME that evaluates to a non-negative value. Result Type: Base type of S Result: A signal equivalent to S delayed T units of time. The value of S’DELAYED(t) is always equal to the value of S t units of time previous.
29
1/8/2007 - L10 AttributesCopyright 2006 - Joanne DeGroat, ECE, OSU29 Attributes that relate to SIGNALS ATTRIBUTE: S’STABLE[(T)] Kind: Signal Prefix: Any signal Parameter: Any static expression of type TIME that evaluates to a non-negative value. Defaults to 0 if omitted. Result Type: Boolean Result: A signal that has value TRUE when an event has not occurred on signal S for T units of time, and the value FALSE otherwise.
30
1/8/2007 - L10 AttributesCopyright 2006 - Joanne DeGroat, ECE, OSU30 Attributes that relate to SIGNALS ATTRIBUTE: S’QUIET[(T)] Kind: Signal Prefix: Any signal Parameter: Any static expression of type TIME that evaluates to a non-negative value. Defaults to 0 if omitted. Result Type: Boolean Result: A signal that has value TRUE when the signal has been quiet (not had a change in value) for T units of time.
31
1/8/2007 - L10 AttributesCopyright 2006 - Joanne DeGroat, ECE, OSU31 Attributes that relate to SIGNALS ATTRIBUTE: S’TRANSACTION Kind: Signal Prefix: Any signal Result Type: Type BIT Result: A signal that toggles to the inverse of its previous value in each simulation cycle in which the signal S becomes active. ATTRIBUTE: S’EVENT Kind: Signal Prefix: Any signal Result Type: Type BOOLEAN Result: A value that indicates whether an event has just occurred on signal S.
32
1/8/2007 - L10 AttributesCopyright 2006 - Joanne DeGroat, ECE, OSU32 Attributes that relate to SIGNALS ATTRIBUTE: S’ACTIVE Kind: Function Prefix: Any signal Result Type: Type BOOLEAN Result: A value that indicated whether S is active, i.e., has a new value generated for it this simulation cycle. ATTRIBUTE: S’LAST_EVENT Kind: Function Prefix: Any signal Result Type: Type TIME Result: The amount of time that has elapsed since the last event on signal S.
33
1/8/2007 - L10 AttributesCopyright 2006 - Joanne DeGroat, ECE, OSU33 Attributes that relate to SIGNALS ATTRIBUTE: S’LAST_ACTIVE Kind: Function Prefix: Any signal Result Type: Type TIME Result: The amount of time that has elapsed since the last time the signal S was active. ATTRIBUTE: S’LAST_VALUE Kind: Function Prefix: Any signal Result Type: Base type of S Result: The previous value of S.
34
1/8/2007 - L10 AttributesCopyright 2006 - Joanne DeGroat, ECE, OSU34 Attributes that relate to Design Units ATTRIBUTE: B’BEHAVIOR Kind: Value Prefix: Any block denoted by a label or entity denoted by its architecture name. Result Type: BOOLEAN Result: The value if TRUE if the block defined by the block statement or entity does not contain a component instantiation statement. ATTRIBUTE: B’STRUCTURE The same except that TRUE when the block/entity contains only component instantiations
35
1/8/2007 - L10 AttributesCopyright 2006 - Joanne DeGroat, ECE, OSU35 Package STANDARD
36
1/8/2007 - L10 AttributesCopyright 2006 - Joanne DeGroat, ECE, OSU36 Package Standard (cont.)
37
1/8/2007 - L10 AttributesCopyright 2006 - Joanne DeGroat, ECE, OSU37 Package Standard (completed)
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.