This document provides instructions for using StateCAD software to generate VHDL code from state diagrams. It describes how to create a new state machine project, design a state diagram with 4 states and transitions between them controlled by an EN signal, set output conditions for each state, optimize the design for an FPGA target, and generate VHDL code along with an automatic test bench.
This document provides instructions for using StateCAD software to generate VHDL code from state diagrams. It describes how to create a new state machine project, design a state diagram with 4 states and transitions between them controlled by an EN signal, set output conditions for each state, optimize the design for an FPGA target, and generate VHDL code along with an automatic test bench.
Using StateCAD to generate VHDL from State Diagrams
Select Project => New Source and select State Diagram.
StateCAD starts
Select File => Design Wizard or click on the Draw State Machine button
Click on Next
To make our SM1 state machine, select 4 states
Click on Next
1 State Cad Tutorial J imDuckworth
Select Asynchronous reset then Next
The Optimization Wizard may open at this point (click cancel we will run this later)
2 State Cad Tutorial J imDuckworth
Now we need to add the transitions from state to state.
Click on the transition from State0 to State1 and add EN=1 as shown:
Click on OK
Repeat for the other transitions:
3 State Cad Tutorial J imDuckworth
Now we need to set the output conditions:
Double-click on State0 and add C <= 0; as shown
and repeat for the other states
4 State Cad Tutorial J imDuckworth
You can go straight to Generate HDL (Options =>Compile), but first click on the Optimize button. Click Next. Select FPGA in Select Target Device Window
5 State Cad Tutorial J imDuckworth
6 State Cad Tutorial J imDuckworth
Click on Next to end the Optimize wizard.
Click on the Generate HDL button:
Click on Close and the HDL code generated is shown:
7 State Cad Tutorial J imDuckworth
8 State Cad Tutorial J imDuckworth You can change the generated VHDL by Options => Configuration
Click OK or Cancel.
Click on the State Bench button then click on Automatic Test Bench