After compilation and after trying to simulate the design using quartus' simulator tool, i used node finder to add the idest_addr to my waveform file.
That's when i realised that the reg idest_addr (which is 3 bits wide) was represented as 8x1-bit wide registers with names 000,001,010...etc.
question 1 : Is this normal??Does this affect my design or is it just the way quartus represents state machine registers?
question 2 : My real problem is that one of those 8 registers is kind of stuck at 1. It gets 0 only when it is supposed to be 1!! (please take a look at the following image)
I've tried a few things but couldn't solve it.
Please guys take a look at my verilog file and give any suggestions.
1.if you search logs of quartus you should find a message
that your state machine is coded as 'one-hot';
what is preferred coding method in fpga world;
one-hot means one register for each state, each state
is coded as one register 'ON' others 'OFF';
so - 8 states gives 8 flip-flops;
2.probably your fsm 'idest_addr' after reset should be in
in state "00..0" - but the first state in 'one-hot'
should be "00..01" so after reset all registers get value '0'
but the 'first' register has an inverter;
Thanks a lot!
I think i understand how it works although it seems a little strange.
So in the end, is this going to work properly or am i going to have to change the first state to "001" instead of "000"??
The only thing that bothers my is that if i have to do this, i will also have to increase the width of idest_addr to 4 bits. The rest of my design will be also affected and so on...
Anyway, thanks again j_andr! You've been really helpful!!
I suggest to read the State Machine Processing paragraph of the Quartus II Handbook, Vol 1, Chap. 8 Quartus II Integrated Synthesis, Quartus II Synthesis Options.
why strange ?
'one-hot' needs more registers but less combo logic and
usually less interconection between cells;
modern fpga are rich of flip-flops, the bottelneck is
- first routing resources, then logic gates;
and FSM coded as 'one-hot' are faster;
/.../have to change the first state to "001" instead of "000"?
you do not need to change anything - but after reading suggested by FvM document you probably know it yourself
[quartus synthesis tool is pretty good contrary to ise ...]
--
I agree. I also had to learn, that the Quartus II Handbook is the book that contains nearly any relevant information related to the tool. In course of time, you understand it's systematic (if any) and know where to find a topic. I'm often using Acrobat text search with the Handbook by the way, the same with device handbooks and IP user guides.