Command Reference 2. Synopsys Commands set_fsm_encoding_style
NAME
set_fsm_encoding_style
Defines the encoding style for assigning
unencoded states.
SYNTAX
int set_fsm_encoding_style encoding_style
string encoding_style
ARGUMENTS
encoding_style The encoding style may be one of
one_hot, binary, gray, or auto. The
default encoding style used during state
assignment is auto.
The one_hot encoding style generates
codes with a bit length equal to the
number of states in the state machine,
each state being represented by one bit
position. The code is a string of
zeros, interrupted by a one in the
state's particular bit position. A
warning is generated if the number of
elements in the state vector is not
equal to the number of states, in which
case the length of the code is reset to
the number of states in the machine. If
the one_hot encoding style is specified,
all manually-assigned codes must also be
one_hot codes.
The binary and gray encoding styles
sequentially assign codes to unassigned
states using a binary numbering or gray
numbering sequence, respectively. The
binary numbering sequence consists of
using binary values to encode the
sequence of counting integers. For
example, four states encoded using two
bits would be numbered 0, 1, 2, and 3,
represented by the binary encodings of
00, 01, 10, and 11. The gray numbering
sequence assigns codes to states such
that successive codes never differ by
more than one bit. In this case, the
same four states encoded using the gray
encoding style would be numbered 0, 1,
3, and 2, represented by the encodings
of 00, 01, 11, and 10. Note that in
V3.1 Synopsys Inc. 1988-1994. All rights reserved. 2-1
set_fsm_encoding_style 2. Synopsys Commands Command Reference
this encoding sequence only one bit-
position changes value in going from one
to the next (e.g., 01 to 11.) The
sequence in which the codes are assigned
to the states is based upon the ordering
of the states. States are ordered via
their entry in the state table, or may
be manually assigned using the
set_fsm_order command. If any states
have manually assigned encodings, then
these states and their respective codes
are omitted from the ordering of binary
or gray codes. Additionally, if any
state is unordered, an arbitrary
ordering which does not affect any
existing order is used. The default code
length is base log2 of the number of
states in the machine.
The auto encoding style generates codes
chosen in a manner to best minimize the
logic of the state machine. If the
length of the bit encodings cannot be
determined using the criteria specified
below, the DC Compiler's auto encoding
style selects the code length that best
minimizes the state machine.
2-2 Synopsys Inc. 1988-1994. All rights reserved. V3.1
Command Reference 2. Synopsys Commands set_fsm_encoding_style
DESCRIPTION
Defines the encoding style to be used for determining
unencoded states during the generation of a state
machine design. (The process of determining encodings
for states is referred to as state assignment.) If you
have manually specified encodings for any of the states
in the design, state assignment does not reassign any
of these encodings. The code length is based on 1) the
length of any manually-assigned encodings, or 2) the
number of instance names specified in the
set_fsm_state_vector command. If the code length cannot
be determined by any of these criteria, it is
determined by the encoding style selected.
EXAMPLES
Following is an example of four states, "IDLE", "FIVE",
"TEN", and "OWE_DIME", with a one_hot encoding style:
dc_shell> set_fsm_encoding_style one_hot
During compile, the state assignment encodes the states
as 1000, 0100, 0010, and 0001, respectively.
Following is an example of the same machine with the
states ordered as "IDLE", "FIVE", "TEN", and
"OWE_DIME", with a binary encoding style:
dc_shell> set_fsm_encoding_style binary
During compile, the state assignment encodes the states
as 00, 01, 10, and 11, respectively.
SEE ALSO
compile(2), extract(2), set_fsm_order(2),
set_fsm_state_vector(2); current_design(3).
V3.1 Synopsys Inc. 1988-1994. All rights reserved. 2-3