courses:system_design:vhdl_language_and_syntax:extended_data_types:start

Introduction

How?

Notes

The standard data types are of limited use for practical modelling tasks. Of course, it would be possible to implement the behavior of RAM or ROM cells via case constructs, yet the resulting VHDL would look pretty awkward. Coding would be much easier, if arrays of other data types were available.

Another case for additional types is based on readability issues. VHDL code should be usable as documentation as well. Symbolic, descriptive names for signal values usually lead to self- documenting code. This does not mean that comments are no longer necessary, though!

While relatively easy workarounds exist for these two problems, the modelling of bus systems is a nightmare when only predefined data types are to be used. The main characteristics of a data bus is the existence of multiple bus participants, i.e. the same signal wires are used by multiple modules. If such a device does not transmit anything, its output driver must be set to a value that does not destroy other data values.

Type Classification

  • Scalar types:
    • Contain exactly one value
    • Integer, real, bit, enumerated. physical
  • Composite types:
    • May contain more than on value
    • Array: value of one type, only
    • Record: values of different types
  • Other types:
    • “file”
    • “access”

Notes

In VHDL, data types are classified into three categories: scalar types, composite types and other types. Scalar types have exactly one value. Examples are the predefined integer, real and bit values. Physical data types (e.g. time) fall also into this category, as well as user defined data types whose range of values is declared via an enumeration. Scalar types do not have distinguishable elements. Composite types, on the other side, usually hold a collection of values. This collection is called an array if all values are of the same type; different data types may be present in records.

FILE and ACCESS types are data types that provide access to other objects. The FILE type is used to read or store data in a file; ACCESS types are comparable with pointers.


Chapters of System Design > VHDL Language and Syntax > Extended Data Types