SEC:U Problem getting rid of bit latch errors

How do I get rid of bit latch warnings when I compile my code in ISE when I am assigning values to parts of bit vector type signals ?

e.g

if PROG_FULL

Reply to
maurizio.gencarelli
Loading thread data ...

How do I get rid of bit latch warnings when I compile my code in ISE when I am assigning values to parts of bit vector type signals ?

e.g

if PROG_FULL

Reply to
maurizio.gencarelli

How do I get rid of bit latch type warnings compiling with Xilinx ISE when I am assigning a value to part of a bit vector type signal in the if/case structure e.g. below the code gives FRAME_STATUS bit latch errors

if data_present=1 then

FRAME_STATUS(8)

Reply to
maurizio.gencarelli

What do you want from TEMP_DATA when NOT PROG_FULL

Reply to
John_H

The latch is created when there is some path through the code that does not result in an assignment to the signal. In your cases, you have

if data_present = 1 then....

Well if data_present is not 1 then there is no assignment to FRAME_STATUS in the first example, in the second example you did explicitly assign FRAME_STATUS but you assigned it to hold it's current state which is exactly the same thing as not having an assignment at all (therefore resulting in a latch). Your last example should not produce a latch since if data_present is not equal to 1 then you go down a path where it looks like you are trying to assign all the bits of FRAME_STATUS to 0 (although it looks like you missed a bit since FRAME_STATUS appears to be 9 bits wide and you've only got 8 zeros in your string.

The way to get rid of the latches is to make them flip flops so your process would be something like this instead process(Clock) begin if rising_edge(Clock) then -- Pasting your code from your first example here > if data_present=1 then >

KJ

Reply to
KJ

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.