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.

Quartus II Generates incorrect state machine :(

Status
Not open for further replies.

JohnG300c

Advanced Member level 4
Joined
Dec 5, 2006
Messages
117
Helped
2
Reputation
4
Reaction score
2
Trophy points
1,298
Activity points
2,228
I'm using a Cyclone II to implement a small state machine. Quartus II 7.1 SP1 is giving me a headache since it refuses to generate a correct state machine which has two possible paths from a state (if 'A' then next state = X, if 'B' then next state = Y). The resulting state machine (accordingly to the state machine viewer and the actual functionality) only has next state transition to state X. Below is the code snippets and attached is the Verilog file.

The following next-state transition criteria (see linkstate.v in attached zip file):

WAIT_CONNECT_STATE:
begin
if(DIR == 1'b1 && DATA == LSJ_DATA)
nextstate = SEND_LS_CMD_STATE;

if(DIR == 1'b1 && DATA == FSJ_DATA)
nextstate = WAIT_FS_SE0_STATE;
end


Will result in the following next state table (See 'State Machine Viewer States.txt' in the attached zip file):


WAIT_CONNECT_STATE SEND_LS_CMD_STATE (N_RESET).(DIR).(Equal1:OUT) + (N_RESET).(DIR).(Equal0:OUT)
WAIT_CONNECT_STATE WAIT_CONNECT_STATE (N_RESET).(!DIR) + (N_RESET).(!Equal1:OUT).(!Equal0:OUT)
WAIT_CONNECT_STATE RESET_STATE (!N_RESET)

NOTE that the resulting state machine does not ever go to the WAIT_FS_SE0_STATE state. It doesn't matter how i change the transition critera, one or the other transntion will survive synthesis, never both.

Can anyone shed some light on this issue???

I have also attached an .xls file which contains the next state table per the design.

Thanks,
/John.
 

shouldn't the code be

You can try

WAIT_CONNECT_STATE:
if (DIR == 1'b1 && DATA == LSJ_DATA) begin
nextstate = SEND_LS_CMD_STATE;
end else if (DIR == 1'b1 && DATA == FSJ_DATA) begin
nextstate = WAIT_FS_SE0_STATE;
end
 

qu(at)rtus II Generates incorrect state machine :(

begin/end is only needed if more than one statement follows. I have tried this and many other things too but regardless what i try Quartus II will only generate next state to the SEND_LS_CMD_STATE state...

Can anyone give an example of a state machine that has TWO different next-states depending on an input criteria?
 

qu(at)rtus II Generates incorrect state machine :(

The problem has been fixed. Quartus II doesn't like to have the state names defined as 'parameter'. When changing to 'localparam' it works as intended.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top