Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

problem in state transitions

Status
Not open for further replies.

JoseNaveen

Newbie level 5
Joined
Jul 24, 2010
Messages
9
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,335
hi..i have written a code for a control unit to be used in my project.. when i simulate it i'm having some problems with the state transitions.. for eg., there is a state transition from state g1 to state c even though it is not possible under the code i have written..i have attached the vhdl files and the test bench..can sumone pls help me with this..?
 

Attachments

  • pro.rar
    5.5 KB · Views: 41

Hi,

Try disabling the following line:

process(curr_state,ur,ack,cw,tx_rdy)
begin
next_state<=curr_state; <<<<< ******** Is this required ?
case curr_state is
when A =>

See this reference on state machines:

**broken link removed**

You could also try setting "next_state" to "A" on initialization.

scanman
 

i haven't read the other lines of code, but the next_state <= curr_state is a fairly common line used to prevent latches as well as the need to place the next_state <= curr_state at multiple places inside the case statement. In VHDL, the last nonblocking assign reached will be the one that is used.
 

i have tried setting next_state to A but no use..still getting the same thing..i'm kinda urgent..::-?
 
Last edited:

Does the design meet timing? Does the state machine has async inputs? These two issues can corrupt a state machine.

for sim, you need to add rdbit, urt, ect... to the sensitivity list. basically anything in an "if (expression) then", or anything on the right-hand side of an assignment.
 

Id go with permute. If any of the signals in that sensitivity list are asynchronous then if they change between clock edges your state machine is going to go haywire jumping through multiple states in a single clock. This is the problem with the 2 process state machine template.

The best thing to do is put it all inside one clocked process. This way you dont need a next_state signal, you just assign the state directly to "current_state" and it can never change more than 1 state per clock.
 

ya thank u both..i'll try what u have suggested...
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top