4.5.3 LPM_FSM

 

Copyright © 1998 University of Manchester

Finite State Machine

Ports:
Port Name
Type
Usage
Description Comments
Data
I
Required
Data input Vector, LPM_WidthIn wide
Clock
I
Required
Clock for State transitions Positive edge triggered
State
O
Optional
Current State Vector Vector, LPM_WidthS wide. Note 1
Result
O
Required
Result of Logic Function Vector, LPM_WidthOut wide. Note 2
Aset
I
Optional
Asynchronous set control Note 3
TestEnab
I
Note 4
Test clock enable input
TestIn
I
Note 4
Serial test data input
TestOut
O
Note 4
Serial test data output TestOut = StateLPM_WidthS-1

Note 1: The state vector is always present inside the FSM. It may be brought out if needed elsewhere in the design by using the State port.

Note 2: The Result vectors are asynchronous. The outputs may be purely a function of the internal state vector (a Moore machine) or may be a function of both the internal state vector and the Data inputs (a Mealy machine).

Note 3: Aset will set the count to the value of LPM_Avalue, if that value is present. If no LPM_Avalue is specified, then Aset will set the count to all ones. Aset affects the outputs (Result and State ) values before the application of polarity to the ports.

Note 4: Either all of the Test ports must be connected or none of them.

Properties:
Property
Usage
ValueComments
LPM_WidthIn
Required
LPM Value > 0Width of input vector
LPM_WidthOut
Required
LPM Value > 0Width of output vector
LPM_WidthS
Optional
LPM Value > 0Width of the State vector
LPM_File
Required
String File NameName of file containing Truth Table file.
LPM_Pvalue
Optional
LPM ValuePower-up value of State Vector
LPM_Avalue
Optional
LPM ValueValue of State Vector when Aset is asserted.
LPM_TruthType
Optional
F | FD | FR | FDRDefault is FD

Functions:
Result = f(State)
Moore machine
Result = f(State, Data)
Mealy machine
StateT+1 = f(StateT, Data)

Example:

This diagram is for illustrative purposes only and is not intended to specify any implementation details.

The file FSM1.txt contains:
.start Kiss
.I 4
.o 3
.p 5
1 ­ ­ ­ dc idle 1 1 ­
0 1 ­ ­ idle reading 1 0 ­
0 0 1 ­ idle writing 0 1 ­
0 ­ ­ 1 reading idle 1 1 ­
0 ­ ­ 1 writing idle 1 1 ­
.code dc ­ ­
.code idle 0 0
.code reading 0 1
.code writing 1 0

This can be better understood by considering the ninth line form the FSM1.txt file:

0 ­ ­ 1 reading idle 1 1 ­
Data (input) From state To state Result (Output)

Although all LPM_FSMs have a valid state encoding, the fitter is free to re-encode the states. Care must be taken in re-encoding if the state is brought outside the LPM_FSM.