4
\$\begingroup\$

I am looking at some VHDL code and the following lines are present:

type obj_code_t is array(integer range <>) of std_logic_vector(7 downto 0);

and

OBJ_CODE : obj_code_t;

What does the <> signify?

\$\endgroup\$
1
  • 1
    \$\begingroup\$ IEEE Std 1076-2008 5.3.2 Array types, 5.3.2.1 "... The values of the left and right bounds of each index range are not defined, but shall belong to the corresponding index subtype; similarly, the direction of each index range is not defined. The symbol <> (called a box) in an index subtype definition stands for an undefined range (different objects of the type need not have the same bounds and direction)." \$\endgroup\$
    – user8352
    Commented Jun 7, 2018 at 0:25

1 Answer 1

4
\$\begingroup\$

The "array(integer range <>)" syntax is used to declare an array with an unconstrained length.

See this page for detailed info on VHDL ranges. Some snippets from the page are shown below.

range def

An example of an unconstrained array definition:

unconstrained range

\$\endgroup\$
1
  • \$\begingroup\$ Changed in -2008 to unbounded array definition where the element subtype can be unconstrained as well as the array index inheriting subtype from the index type. See IEEE Std 1076-2008 5.3.2 Array types, 5.3.2.1. \$\endgroup\$
    – user8352
    Commented Jun 8, 2018 at 2:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.