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.

ISE Synthesis problem - need explanations concerning 2 codes

Status
Not open for further replies.

abionnnn

Member level 1
Joined
Jun 18, 2004
Messages
41
Helped
6
Reputation
12
Reaction score
3
Trophy points
1,288
Location
Hong Kong
Activity points
416
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.
 

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.
 

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
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top