FPGA Central - World's 1st FPGA / CPLD Portal

FPGA Central

World's 1st FPGA Portal

 

Go Back   FPGA Groups > NewsGroup > VHDL

VHDL comp.lang.vhdl newsgroup / Usenet

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 11-22-2006, 08:49 AM
Niv
Guest
 
Posts: n/a
Default Data checking

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.

Reply With Quote
  #2 (permalink)  
Old 11-22-2006, 05:25 PM
Guest
 
Posts: n/a
Default Re: Data checking

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.


Reply With Quote
  #3 (permalink)  
Old 11-22-2006, 07:29 PM
Niv
Guest
 
Posts: n/a
Default Re: Data checking


[email protected] 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.


Reply With Quote
  #4 (permalink)  
Old 11-22-2006, 08:31 PM
Paul Uiterlinden
Guest
 
Posts: n/a
Default Re: Data checking

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
Reply With Quote
  #5 (permalink)  
Old 11-28-2006, 12:27 AM
Guest
 
Posts: n/a
Default Re: Data checking

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

Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Bitfile checking Walters FPGA 6 10-29-2007 08:43 PM
Checking syntax GaLaKtIkUs™ FPGA 1 08-25-2006 12:51 AM
Equivalence checking Rick Jackson VHDL 5 11-24-2005 08:38 AM
Equivalence checking Rick Jackson Verilog 5 11-24-2005 08:38 AM
Re: Equivalence checking ALuPin VHDL 1 04-06-2004 07:56 AM


All times are GMT +1. The time now is 06:30 PM.


Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0
Copyright 2008 @ FPGA Central. All rights reserved