Data checking

N

Niv

Guest
Hi all, I need to transfer 64 bit data from a FLASH to a 32 bit FIFO,
embedded in FPGA, (very slow FLASH access, burst out FIFO to CPU when
FIFO full etc, FIFO has two writes per FLASH read). However, I also
want to check the data has transferred out of the FLASH without errors.

So, assuming 32 bit data operations, is it best to just successively
XOR each 32 bit value over my block transfer size (up to 1M x 64 = 8M
bytes) and compare to a preloaded value, or to perform
a 32 bit CRC (parallel implementation) on each 32 bit value and then
compare?

i.e. which is the most robust method for error detection for this
largish block size, (not worried about error correction).

Regards, Kev P.
 
Hi,

I wouldn't worry about the FLASH->FIFO path. That's not where the
errors will be.

Instead, the errors (IME) will be in the flash read operation.

If you're always reading 32-bits at a time, it's pretty simple to add
an ECC to the read operation. IIRC, an 8 bit code will correct all
single-bit, and detect all double-bit errors.

Then dump the corrected data to the FIFO. (Do the correction on the
slow side).

At least that's what I would do.

GH


Niv wrote:
Hi all, I need to transfer 64 bit data from a FLASH to a 32 bit FIFO,
embedded in FPGA, (very slow FLASH access, burst out FIFO to CPU when
FIFO full etc, FIFO has two writes per FLASH read). However, I also
want to check the data has transferred out of the FLASH without errors.

So, assuming 32 bit data operations, is it best to just successively
XOR each 32 bit value over my block transfer size (up to 1M x 64 = 8M
bytes) and compare to a preloaded value, or to perform
a 32 bit CRC (parallel implementation) on each 32 bit value and then
compare?

i.e. which is the most robust method for error detection for this
largish block size, (not worried about error correction).

Regards, Kev P.
 
ghelbig@lycos.com wrote:
Hi,

I wouldn't worry about the FLASH->FIFO path. That's not where the
errors will be.

Instead, the errors (IME) will be in the flash read operation.

If you're always reading 32-bits at a time, it's pretty simple to add
an ECC to the read operation. IIRC, an 8 bit code will correct all
single-bit, and detect all double-bit errors.

Then dump the corrected data to the FIFO. (Do the correction on the
slow side).

At least that's what I would do.

GH
That's exactly what intended, to check the data has been read from the
FLASH OK,
so doing a error detection as the data is read (64 bits at a time,
written to FIFO as two 32 bit words, and at the same time, perform some
sort of algorithm on each 32 bit word in a separate process to the
FIFO. So how do I perform a CRC or whatever on the 32 bits?
The block transfer size could be as large as 4Meg X 64 bits, or
32Mbytes.
As I said before, error correction isn't really needed, but detection
is.

Regards, KP.
Niv wrote:
Hi all, I need to transfer 64 bit data from a FLASH to a 32 bit FIFO,
embedded in FPGA, (very slow FLASH access, burst out FIFO to CPU when
FIFO full etc, FIFO has two writes per FLASH read). However, I also
want to check the data has transferred out of the FLASH without errors.

So, assuming 32 bit data operations, is it best to just successively
XOR each 32 bit value over my block transfer size (up to 1M x 64 = 8M
bytes) and compare to a preloaded value, or to perform
a 32 bit CRC (parallel implementation) on each 32 bit value and then
compare?

i.e. which is the most robust method for error detection for this
largish block size, (not worried about error correction).

Regards, Kev P.
 
Niv wrote:
So how do I perform a CRC or whatever on the 32 bits?
Check out http://www.easics.com/webtools/crctool

Choose your CRC and data width and generat the package. Apply the
resulting function nextCRCxx_Dyy on each word of the data. Something
like this:

crc := (OTHERS => '1'); -- Or was it '0'?
FOR i IN 0 TO block_size-1 LOOP
data := ...; -- get next word of data
crc := nextCRCxx_Dyy(data, crc);
END LOOP;

The end value of crc is your CRC value. Compare this calculated value
with the one you read back from flash. If they are identical the data
is correct.

Some CRC polynomial have the characteristic that if you calculate the
CRC over the data including the CRC, the result is a constant value.

--
Paul.
www.aimcom.nl
email address: switch x and s
 
Paul gave you some good pointers to CRC math. There are others.

Another idea would be to use page-mode flash. Your flash size is
getting close to the cost breakpoint of these larger devices.

The page-mode flashes I'm referring to have a meta-data area for
storing CRC values built in; they are commonly used in USB flash keys.

GH
 

Welcome to EDABoard.com

Sponsor

Back
Top