Forum Discussion
JBurt2
New Contributor
7 years agoI got the following warning 10240 inferred latch on a variable. Is this a problem? if so how do I fix it.
module SPI_OUTPUTS(input ReSet, input SPI_CLK,SPI_CS,SPI_DIN,output SPI_DOUT,output reg [24:1] Outputs = 0); reg [23:0] SPI_shift = 0; //SPI Shift Reg reg Start = 0; assign SPI_DOUT = (Start =...
a_x_h_75
Contributor
7 years agoWhether it's a 'problem' is for you to determine. Generally latches should be avoided because it's very tricky to determine if they will cause timing issues. Sometimes designs require latches. In these cases you need to be careful and ensure they work by design and not rely on timing paths.
In your case there is certainly no need for a latch. I agree with ANico1 - redesign the code having removed SPI_CS from your sensitivity list. You should then have a synchronous design - without latches.
Cheers,
Alex