| Author |
Message |
abionnnn
Joined: 18 Jun 2004 Posts: 39 Helped: 3
|
30 Jun 2009 3:43 ISE Synthesis problem |
|
|
|
|
I'm missing some fundemental understanding of the synthesis process in ISE. Can you explain why the following two pieces of code generate different behaviour?
| Code: |
if (filter_rota && !delayed_rota) begin
enable <= 1;
direction <= filter_rotb;
end
else begin
enable <= 0;
direction <= direction;
end
|
| Code: |
enable <= filter_rota && !delayed_rota;
if (enable)
direction <= filter_rotb;
|
As you may guess, the second one sends through the previous direction on edge detection.
|
|
| Back to top |
|
 |
abionnnn
Joined: 18 Jun 2004 Posts: 39 Helped: 3
|
30 Jun 2009 11:36 ISE Synthesis problem |
|
|
|
|
Obviously I've been writing too much procedural code write now, it was obvious when looking at the synthesised circuit. The first code is correct, the second is not.
Lets say that the condition filter_rota && !delayed_rota transitions to true. In the first case, the if true is traversed. In the second case, the result is written into enable, but before this is finalised, enable is tested and fails, thus not updating the direction until the next clock.
I hope this has helped.
|
|
| Back to top |
|
 |
Google AdSense

|
30 Jun 2009 11:36 Ads |
|
|
|
|
|
|
| Back to top |
|
 |
tariq786
Joined: 24 Feb 2004 Posts: 194 Helped: 28
|
01 Jul 2009 12:25 ISE Synthesis problem |
|
|
|
|
This is what i will try.
I shall put brackets around the expression in the second code and remove non blocking statement <= statement to blocking =
See if this helps.
This has nothing to do with ISE. This has to do with verilog coding
|
|
| Back to top |
|
 |