Issues with getting into state

OP #3642060
Rate this post
• ▲ useful
▼ not useful
I am having som problems with my code.


I've written some code which changes the state when the switches i press 
matches the sequence i check it for..
The sequence is in an array, and for reason is the array very weird (for 
me to understand)..
But for some reason , even when i press the correct sequence does it not 
enter the next state.

I tried simulating it, and i haven't been able to see where i am Going 
wrong so this is my last chance to find out where i am going wrong.

Please help..
Attached files:
Moderator (Company: Titel) #3643217
Rate this post
• ▲ useful
▼ not useful
John Mayer wrote:
> I've written some code
1
    if switch /= "0000" then
2
  if switch = LISTEN(pointer+1) and (pointer-1) < top_pointer  then
You MUST NOT use external asynchronous signals without synching them to 
the FPGAs clock with two flipflops. Otherwise you will experience 
strange and unexpected behaviour now and then...

John Mayer wrote:
> I tried simulating it,
With what simulator?
If it is ISIM its clear:
> and i haven't been able to see where i am Going wrong
You cannot trace variables with ISIM.
> so this is my last chance to find out where i am going wrong.
No, it isn't the last chance to let others do your work without saying 
WHAT you expect and WHAT you get.
> even when i press the correct sequence
What ist "the correct sequence"? Where can "the correct sequence" be 
found in your test bench? Why do you post the complete projekt when it 
would be enough to see the two questionable vhdl files?

So my conclusion is: use signals instead of all those variables!
You do not need those variables and without them you will not get in 
troubles with the behaviour of variables. And additionally you will be 
able to SEE and TRACE the signal in the simulator.

Reply

Note: the original post is older than 6 months. Please don't ask any new questions in this thread, but start a new one.

Formatting
  • [c]C-Code[/c]
  • [vhdl]VHDL-Code[/vhdl]
  • [code]code in other languages, ASCII drawings[/code]
  • [math]formula (LaTeX syntax)[/math]
  • [[Title]] – link to an article
  • Link to another post: right-click its post ID (#8078628), copy the address, paste it into the text

More about formatting

Post long source code as an attachment, not in the text.

Already registered? Log in

Not shown to anyone. We send you a link; your post appears once you confirm it there.

By submitting you create a free account and accept the terms of use.