Y
yhs2012
Guest
Hello all. I have a very strange thing happening with my FPGA.
I have Xilinx Spartan-3E FPGA, that I am programming to count externa
pulses in 1us time bins. The way I'm doing that, is I have a pulse inde
counter, that increments whenever there's a rising edge on the puls
counter. (No resetting, no enabling, etc.) Then I have another loop tha
checks the count on the pulse counter every 1us, and writes the "puls
index" to an off-board SDRAM chip.
So I have an always block like this:
always @(posedge pulse_in) begin
pulse_index <= pulse_index + 1;
end
This works fine 99.9% of the time, but about 100-200 times out of
1,000,000 time bins, the "pulse index" decreases between consecutive tim
bins. For example, it could go from 195 to 194. This does not seem to b
related to the counter being full either (for example reaching 255 on
8-bit counter), because this happens with different counter sizes, and i
happens near the mid range of the counter value.
Anyone have any idea what might be happening? I suspect some sort o
hardware-related issue, e.g. the pulses I am inputting is not clea
enough.
Some facts:
1. The number of errors seem to be roughly proportional the input puls
rate. So if I send 2MHz instead of 1MHz, I get roughly twice the number o
errors.
2. The value of "pulse_index" does not go directly into the SDRAM. Th
value is written to a different register every 1us, which is written into
FIFO, which finally goes into the SDRAM.
---------------------------------------
Posted through http://www.FPGARelated.com
I have Xilinx Spartan-3E FPGA, that I am programming to count externa
pulses in 1us time bins. The way I'm doing that, is I have a pulse inde
counter, that increments whenever there's a rising edge on the puls
counter. (No resetting, no enabling, etc.) Then I have another loop tha
checks the count on the pulse counter every 1us, and writes the "puls
index" to an off-board SDRAM chip.
So I have an always block like this:
always @(posedge pulse_in) begin
pulse_index <= pulse_index + 1;
end
This works fine 99.9% of the time, but about 100-200 times out of
1,000,000 time bins, the "pulse index" decreases between consecutive tim
bins. For example, it could go from 195 to 194. This does not seem to b
related to the counter being full either (for example reaching 255 on
8-bit counter), because this happens with different counter sizes, and i
happens near the mid range of the counter value.
Anyone have any idea what might be happening? I suspect some sort o
hardware-related issue, e.g. the pulses I am inputting is not clea
enough.
Some facts:
1. The number of errors seem to be roughly proportional the input puls
rate. So if I send 2MHz instead of 1MHz, I get roughly twice the number o
errors.
2. The value of "pulse_index" does not go directly into the SDRAM. Th
value is written to a different register every 1us, which is written into
FIFO, which finally goes into the SDRAM.
---------------------------------------
Posted through http://www.FPGARelated.com