IEEE 1076 standard.VHDL language reference manual.2000
.pdfIEEE |
|
Std 1076, 2000 Edition |
IEEE STANDARD VHDL |
13.7 Bit string literals
245A bit string literal is formed by a sequence of extended digits (possibly none) enclosed between two quotations used as bit string brackets, preceded by a base specifier.
bit_string_literal ::= base_specifier "[ bit_value ]" bit_value ::= extended_digit { [ underline ] extended_digit } base_specifier ::= B | O | X
250An underline character inserted between adjacent digits of a bit string literal does not affect the value of this literal. The only letters allowed as extended digits are the letters A through F for the digits ten through fifteen. A letter in a bit string literal (either an extended digit or the base specifier) can be written either in lowercase or in uppercase, with the same meaning.
If the base specifier is 'B', the extended digits in the bit value are restricted to 0 and 1. If the base specifier is
255'O', the extended digits in the bit value are restricted to legal digits in the octal number system, i.e., the digits 0 through 7. If the base specifier is 'X', the extended digits are all digits together with the letters A through F.
A bit string literal has a value that is a string literal consisting of the character literals '0' and '1'. If the base specifier is 'B', the value of the bit string literal is the sequence given explicitly by the bit value itself after any underlines have been removed.
260If the base specifier is 'O' (respectively 'X'), the value of the bit string literal is the sequence obtained by replacing each extended digit in the bit_value by a sequence consisting of the three (respectively four) values representing that extended digit taken from the character literals '0' and '1'; as in the case of the base specifier 'B', underlines are first removed. Each extended digit is replaced as follows:
|
Extended digit |
Replacement when the base specifier is |
Replacement when the base specifier is |
265 |
|
'O' |
'X' |
|
0 |
000 |
0000 |
|
1 |
001 |
0001 |
|
2 |
010 |
0010 |
|
3 |
011 |
0011 |
270 |
4 |
100 |
0100 |
|
5 |
101 |
0101 |
|
6 |
110 |
0110 |
|
7 |
111 |
0111 |
|
8 |
(illegal) |
1000 |
275 |
9 |
(illegal) |
1001 |
|
A |
(illegal) |
1010 |
|
B |
(illegal) |
1011 |
|
C |
(illegal) |
1100 |
|
D |
(illegal) |
1101 |
280 |
E |
(illegal) |
1110 |
|
F |
(illegal) |
1111 |
182 |
Copyright © 2000 IEEE. All rights reserved. |
|
IEEE |
LANGUAGE REFERENCE MANUAL |
Std 1076, 2000 Edition |
The length of a bit string literal is the length of its string literal value.
|
Example: |
|
|
|
B"1111_1111_1111" |
-- |
Equivalent to the string literal "111111111111". |
285 |
X"FFF" |
-- Equivalent to B"1111_1111_1111". |
|
|
O"777" |
-- Equivalent to B"111_111_111". |
|
|
X"777" |
-- |
Equivalent to B"0111_0111_0111". |
constant c1: STRING := B"1111_1111_1111";
constant c2: BIT_VECTOR := X"FFF";
290type MVL is ('X', '0', '1', 'Z');
type MVL_VECTOR is array (NATURAL range <>) of MVL; constant c3: MVL_VECTOR := O"777";
assert |
c1'LENGTH = 12 and |
|
c2'LENGTH = 12 and |
295 |
c3 = "111111111"; |
13.8 Comments
A comment starts with two adjacent hyphens and extends up to the end of the line. A comment can appear on any line of a VHDL description. The presence or absence of comments has no influence on whether a description is legal or illegal. Furthermore, comments do not influence the execution of a simulation module; their sole purpose is to enlighten the human reader.
300Examples:
--The last sentence above echoes the Algol 68 report.
end; -- Processing of LINE is complete.
-- A long comment may be split onto
-- |
two or more consecutive lines. |
305 ----------- |
The first two hyphens start the comment. |
NOTE—Horizontal tabulation can be used in comments, after the double hyphen, and is equivalent to one or more spaces (SPACE characters) (see 13.2).
Copyright © 2000 IEEE. All rights reserved. |
183 |
IEEE |
|
Std 1076, 2000 Edition |
IEEE STANDARD VHDL |
13.9 Reserved words
The identifiers listed below are called reserved words and are reserved for significance in the language. For readability of this standard, the reserved words appear in lowercase boldface.
310 |
abs |
file |
nand |
select |
|
|
access |
for |
new |
severity |
|
|
after |
function |
next |
signal |
|
|
alias |
|
nor |
shared |
|
|
all |
generate |
not |
sla |
|
315 |
and |
generic |
null |
sll |
|
|
architecture |
group |
|
sra |
|
|
array |
guarded |
of |
srl |
|
|
assert |
|
on |
subtype |
|
|
attribute |
if |
open |
|
|
320 |
|
impure |
or |
then |
|
begin |
in |
others |
to |
||
|
|||||
|
block |
inertial |
out |
transport |
|
|
body |
inout |
|
type |
|
|
buffer |
is |
package |
|
|
325 |
bus |
|
port |
unaffected |
|
|
|
label |
postponed |
units |
|
|
case |
library |
procedural |
until |
|
|
component |
linkage |
procedure |
use |
|
|
configuration |
literal |
process |
|
|
330 |
constant |
loop |
protected |
variable |
|
|
|
|
pure |
|
|
|
disconnect |
map |
|
wait |
|
|
downto |
mod |
range |
when |
|
|
|
|
record |
while |
|
335 |
else |
|
reference |
with |
|
|
elsif |
|
register |
|
|
|
end |
|
reject |
xnor |
|
|
entity |
|
rem |
xor |
|
|
exit |
|
report |
|
|
340 |
|
|
return |
|
|
|
|
|
rol |
|
|
|
|
|
ror |
|
A reserved word must not be used as an explicitly declared identifier.
NOTES
3451—Reserved words differing only in the use of corresponding uppercase and lowercase letters are considered as the same (see 13.3.1). The reserved word range is also used as the name of a predefined attribute.
2—An extended identifier whose sequence of characters inside the leading and trailing backslashes is identical to a reserved word is not a reserved word. For example, \next\ is a legal (extended) identifier and is not the reserved word next.
184 |
Copyright © 2000 IEEE. All rights reserved. |
|
IEEE |
LANGUAGE REFERENCE MANUAL |
Std 1076, 2000 Edition |
13.10 Allowable replacements of characters
350The following replacements are allowed for the vertical line, number sign, and quotation mark basic characters:
—A vertical line (|) can be replaced by an exclamation mark (!) where used as a delimiter.
—The number sign (#) of a based literal can be replaced by colons (:), provided that the replacement is done for both occurrences.
355— The quotation marks (") used as string brackets at both ends of a string literal can be replaced by percent signs (%), provided that the enclosed sequence of characters contains no quotation marks, and provided that both string brackets are replaced. Any percent sign within the sequence of characters must then be doubled, and each such doubled percent sign is interpreted as a single percent sign value. The same replacement is allowed for a bit string literal, provided that both bit string brackets
360 |
are replaced. |
These replacements do not change the meaning of the description.
NOTES
1—It is recommended that use of the replacements for the vertical line, number sign, and quotation marks be restricted to cases where the corresponding graphical symbols are not available. Note that the vertical line appears as a broken line
365on some equipment; replacement is not recommended in this case.
2—The rules given for identifiers and abstract literals are such that lowercase and uppercase letters can be used indifferently; these lexical elements can thus be written using only characters of the basic character set.
Copyright © 2000 IEEE. All rights reserved. |
185 |
IEEE |
|
Std 1076, 2000 Edition |
IEEE STANDARD VHDL |
186 |
Copyright © 2000 IEEE. All rights reserved. |
|
IEEE |
LANGUAGE REFERENCE MANUAL |
Std 1076, 2000 Edition |
14. Predefined language environment
This clause describes the predefined attributes of VHDL and the packages that all VHDL implementations must provide.
14.1 Predefined attributes
Predefined attributes denote values, functions, types, and ranges associated with various kinds of named entities. These attributes are described below. For each attribute, the following information is provided:
5
10
—The kind of attribute: value, type, range, function, or signal
—The prefixes for which the attribute is defined
—A description of the parameters or argument, if one exists
—The result of evaluating the attribute, and the result type (if applicable)
—Any further restrictions or comments that apply.
T'BASE
Kind: |
Type. |
Prefix: |
Any type or subtype T. |
Result: |
The base type of T. |
Restrictions: |
This attribute is allowed only as the prefix of the name of |
|
another attribute; for example, T'BASE'LEFT. |
15 |
T'LEFT |
|
|
Kind: |
Value. |
|
Prefix: |
Any scalar type or subtype T. |
|
Result Type: |
Same type as T. |
|
Result: |
The left bound of T. |
20 |
T'RIGHT |
|
|
Kind: |
Value. |
|
Prefix: |
Any scalar type or subtype T. |
|
Result Type: |
Same type as T. |
|
Result: |
The right bound of T. |
25 |
T'HIGH |
|
|
Kind: |
Value. |
|
Prefix: |
Any scalar type or subtype T. |
|
Result Type: |
Same type as T. |
|
Result: |
The upper bound of T. |
30 |
T'LOW |
|
|
Kind: |
Value. |
|
Prefix: |
Any scalar type or subtype T. |
|
Result Type: |
Same type as T. |
|
Result: |
The lower bound of T. |
Copyright © 2000 IEEE. All rights reserved. |
187 |
35
40
45
50
55
60
65
70
75
IEEE |
|
Std 1076, 2000 Edition |
IEEE STANDARD VHDL |
T'ASCENDING |
|
Kind: |
Value. |
Prefix: |
Any scalar type or subtype T. |
Result Type: |
Type Boolean |
Result: |
It is TRUE if T is defined with an ascending range; FALSE |
|
otherwise. |
T'IMAGE(X) |
|
Kind: |
Function. |
Prefix: |
Any scalar type or subtype T. |
Parameter: |
An expression whose type is the base type of T. |
Result Type: |
Type String. |
Result: |
The string representation of the parameter value, without |
|
leading or trailing whitespace. If T is an enumeration type or |
|
subtype and the parameter value is either an extended identifier |
|
or a character literal, the result is expressed with both a leading |
|
and trailing reverse solidus (backslash) (in the case of an |
|
extended identifier) or apostrophe (in the case of a character |
|
literal); in the case of an extended identifier that has a back- |
|
slash, the backslash is doubled in the string representation. If T |
|
is an enumeration type or subtype and the parameter value is a |
|
basic identifier, then the result is expressed in lowercase char- |
|
acters. If T is a numeric type or subtype, the result is expressed |
|
as the decimal representation of the parameter value without |
|
underlines or leading or trailing zeros (except as necessary to |
|
form the image of a legal literal with the proper value); more- |
|
over, an exponent may (but is not required to) be present and |
|
the language does not define under what conditions it is or is |
|
not present. If the exponent is present, the “e” is expressed as a |
|
lowercase character. If T is a physical type or subtype, the |
|
result is expressed in terms of the primary unit of T unless the |
|
base type of T is TIME, in which case the result is expressed in |
|
terms of the resolution limit (see 3.1.3.1); in either case, if the |
|
unit is a basic identifier, the image of the unit is expressed in |
|
lowercase characters. If T is a floating point type or subtype, |
|
the number of digits to the right of the decimal point corre- |
|
sponds to the standard form generated when the DIGITS |
|
parameter to TextIO. Write for type REAL is set to 0 (see |
|
14.3). The result never contains the replacement characters |
|
described in 13.10. |
Restrictions: |
It is an error if the parameter value does not belong to the sub- |
|
type implied by the prefix. |
188 |
Copyright © 2000 IEEE. All rights reserved. |
|
|
IEEE |
|
LANGUAGE REFERENCE MANUAL |
Std 1076, 2000 Edition |
|
T'VALUE(X) |
|
|
Kind: |
Function. |
|
Prefix: |
Any scalar type or subtype T. |
|
Parameter: |
An expression of type String. |
80 |
Result Type: |
The base type of T. |
|
Result: |
The value of T whose string representation (as defined in |
|
|
Clause 13) is given by the parameter. Leading and trailing |
|
|
whitespace is allowed and ignored. If T is a numeric type or |
|
|
subtype, the parameter may be expressed either as a decimal |
85 |
|
literal or as a based literal. If T is a physical type or subtype, |
|
|
the parameter may be expressed using a string representation of |
|
|
any of the unit names of T, with or without a leading abstract |
|
|
literal. The parameter must have whitespace between any |
|
|
abstract literal and the unit name. The replacement characters |
90 |
|
of 13.10 are allowed in the parameter. |
|
Restrictions: |
It is an error if the parameter is not a valid string representation |
|
|
of a literal of type T or if the result does not belong to the sub- |
|
|
type implied by T. |
|
T'POS(X) |
|
95 |
Kind: |
Function. |
|
Prefix: |
Any discrete or physical type or subtype T. |
|
Parameter: |
An expression whose type is the base type of T. |
|
Result Type: |
universal_integer. |
|
Result: |
The position number of the value of the parameter. |
100 |
T'VAL(X) |
|
|
Kind: |
Function. |
|
Prefix: |
Any discrete or physical type or subtype T. |
|
Parameter: |
An expression of any integer type. |
|
Result Type: |
The base type of T. |
105 |
Result: |
The value whose position number is the universal_integer |
|
|
value corresponding to X. |
|
Restrictions: |
It is an error if the result does not belong to the range T'LOW |
|
|
to T'HIGH. |
|
T'SUCC(X) |
|
110 |
Kind: |
Function. |
|
Prefix: |
Any discrete or physical type or subtype T. |
|
Parameter: |
An 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 |
115 |
|
parameter. |
|
Restrictions: |
An error occurs if X equals T'HIGH or if X does not belong to |
|
|
the range T'LOW to T'HIGH. |
Copyright © 2000 IEEE. All rights reserved. |
189 |
|
IEEE |
|
|
Std 1076, 2000 Edition |
IEEE STANDARD VHDL |
|
T'PRED(X) |
|
|
Kind: |
Function. |
120 |
Prefix: |
Any discrete or physical type or subtype T. |
|
Parameter: |
An 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. |
125 |
Restrictions: |
An error occurs if X equals T'LOW or if X does not belong to |
|
|
the range T'LOW to T'HIGH. |
|
T'LEFTOF(X) |
|
|
Kind: |
Function. |
|
Prefix: |
Any discrete or physical type or subtype T. |
130 |
Parameter: |
An expression whose type is the base type of T. |
|
Result Type: |
The base type of T. |
|
Result: |
The value that is to the left of the parameter in the range of T. |
|
Restrictions: |
An error occurs if X equals T'LEFT or if X does not belong to |
|
|
the range T'LOW to T'HIGH. |
135 |
T'RIGHTOF(X) |
|
|
Kind: |
Function. |
|
Prefix: |
Any discrete or physical type or subtype T. |
|
Parameter: |
An expression whose type is the base type of T. |
|
Result Type: |
The base type of T. |
140 |
Result: |
The value that is to the right of the parameter in the range of T. |
|
Restrictions: |
An error occurs if X equals T'RIGHT or if X does not belong to |
|
|
the range T'LOW to T'HIGH. |
|
A'LEFT [(N)] |
|
|
Kind: |
Function. |
145 |
Prefix: |
Any prefix A that is appropriate for an array object, or an alias |
|
|
thereof, or that denotes a constrained array subtype. |
|
Parameter: |
A locally static expression of type universal_integer, the value |
|
|
of which must not exceed the dimensionality of A. If omitted, it |
|
|
defaults to 1. |
150 |
Result Type: |
Type of the left bound of the Nth index range of A. |
|
Result: |
Left bound of the Nth index range of A. (If A is an alias for an |
|
|
array object, then the result is the left bound of the Nth index |
|
|
range from the declaration of A, not that of the object.) |
|
A'RIGHT [(N)] |
|
155 |
Kind: |
Function. |
|
Prefix: |
Any prefix A that is appropriate for an array object, or an alias |
|
|
thereof, or that denotes a constrained array subtype. |
|
Parameter: |
A locally static expression of type universal_integer, the value |
|
|
of which must not exceed the dimensionality of A. If omitted, it |
160 |
|
defaults to 1. |
|
Result Type: |
Type of the Nth index range of A. |
|
Result: |
Right bound of the Nth index range of A. (If A is an alias for an |
|
|
array object, then the result is the right bound of the Nth index |
|
|
range from the declaration of A, not that of the object.) |
190 |
Copyright © 2000 IEEE. All rights reserved. |
|
|
IEEE |
|
LANGUAGE REFERENCE MANUAL |
Std 1076, 2000 Edition |
165 |
A'HIGH [(N)] |
|
|
Kind: |
Function. |
|
Prefix: |
Any prefix A that is appropriate for an array object, or an alias |
|
|
thereof, or that denotes a constrained array subtype. |
|
Parameter: |
A locally static expression of type universal_integer, the value |
170 |
|
of which must not exceed the dimensionality of A. If omitted, it |
|
|
defaults to 1. |
|
Result Type: |
Type of the Nth index range of A. |
|
Result: |
Upper bound of the Nth index range of A. (If A is an alias for |
|
|
an array object, then the result is the upper bound of the Nth |
175 |
|
index range from the declaration of A, not that of the object.) |
|
A'LOW [(N)] |
|
|
Kind: |
Function. |
|
Prefix: |
Any prefix A that is appropriate for an array object, or an alias |
|
|
thereof, or that denotes a constrained array subtype. |
180 |
Parameter: |
A locally static expression of type universal_integer, the value |
|
|
of which must not exceed the dimensionality of A. If omitted, it |
|
|
defaults to 1. |
|
Result Type: |
Type of the Nth index range of A. |
|
Result: |
Lower bound of the Nth index range of A. (If A is an alias for |
185 |
|
an array object, then the result is the lower bound of the Nth |
|
|
index range from the declaration of A, not that of the object.) |
|
A'RANGE [(N)] |
|
|
Kind: |
Range. |
|
Prefix: |
Any prefix A that is appropriate for an array object, or an alias |
190 |
|
thereof, or that denotes a constrained array subtype. |
|
Parameter: |
A locally static expression of type universal_integer, the value |
|
|
of which must not exceed the dimensionality of A. If omitted, it |
|
|
defaults to 1. |
|
Result Type: |
The type of the Nth index range of A. |
195 |
Result: |
The range A'LEFT(N) to A'RIGHT(N) if the Nth index range |
|
|
of A is ascending, or the range A'LEFT(N) downto |
|
|
A'RIGHT(N) if the Nth index range of A is descending. (If A is |
|
|
an alias for an array object, then the result is determined by the |
|
|
Nth index range from the declaration of A, not that of the |
200 |
|
object.) |
|
A'REVERSE_RANGE [(N)] |
|
|
Kind: |
Range. |
|
Prefix: |
Any prefix A that is appropriate for an array object, or an alias |
|
|
thereof, or that denotes a constrained array subtype. |
205 |
Parameter: |
A locally static expression of type universal_integer, the value |
|
|
of which must not exceed the dimensionality of A. If omitted, it |
|
|
defaults to 1. |
|
Result Type: |
The type of the Nth index range of A. |
|
Result: |
The range A'RIGHT(N) downto A'LEFT(N) if the Nth index |
210 |
|
range of A is ascending, or the range A'RIGHT(N) to |
|
|
A'LEFT(N) if the Nth index range of A is descending. (If A is |
|
|
an alias for an array object, then the result is determined by the |
|
|
Nth index range from the declaration of A, not that of the |
|
|
object.) |
Copyright © 2000 IEEE. All rights reserved. |
191 |