Microsoft AGB-00001 Spécifications Page 76

  • Télécharger
  • Ajouter à mon manuel
  • Imprimer
  • Page
    / 144
  • Table des matières
  • MARQUE LIVRES
  • Noté. / 5. Basé sur avis des utilisateurs
Vue de la page 75
How to Control the Implementation of VHDL
4-18 VHDL Reference Manual
Enum_encoding Attribute
The enum_encoding attribute allows you to override the default
encoding of VHDL enumerated types. This is most useful when you
want to specify a non-sequential encoding for an enumerated type. For
example, you might want to use enum_encoding to specify the exact
encoding of each state in a state machine. The enum_encoding
attribute can also be used to encode don’t-care information into the
logic of an enumerated type output, or can be used to define
synthesizable 1-bit values for a multi-valued data type (such as the
IEEE 1164 type std_ulogic).
The syntax for the enum_encoding attribute is demonstrated in the
following example, which specifies an alternate encoding for a state
machine. To use the enum_encoding attribute, you must first define
it as a string type:
attribute enum_encoding: string;
and then write an attribute statement for the desired encoding values:
architecture behavior of state_machine is
type state_values is (Init, S1, S2, S3, S4, S5);
attribute enum_encoding: string;
attribute enum_encoding of state_values: type is
"000 001 011 111 110 100";
A special enum_encoding string, "one hot", can be used to specify
that an enumerated type represents a list of symbolic state machine
states, and is to be encoded using a one register per state (one hot)
encoding method. This method is particularly useful for state machines
that will be implemented in FPGA devices, and results in less
combinational logic being required for state decoding. The syntax for
the one hot encoding attribute is:
architecture behavior of state_machine is
type state_values is (Init, S1, S2, S3, S4, S5);
attribute enum_encoding: string;
attribute enum_encoding of state_values: type is
"one hot";
An example of one hot state encoding can be found in the tutorials
chapter in the VHDL Entry manual, in the complex state machine
example.
Vue de la page 75
1 2 ... 71 72 73 74 75 76 77 78 79 80 81 ... 143 144

Commentaires sur ces manuels

Pas de commentaire