From owner-freebsd-hackers Tue Jun 25 10:34:34 1996 Return-Path: owner-hackers Received: (from root@localhost) by freefall.freebsd.org (8.7.5/8.7.3) id KAA20244 for hackers-outgoing; Tue, 25 Jun 1996 10:34:34 -0700 (PDT) Received: from who.cdrom.com (who.cdrom.com [204.216.27.3]) by freefall.freebsd.org (8.7.5/8.7.3) with SMTP id KAA20237; Tue, 25 Jun 1996 10:34:32 -0700 (PDT) Received: from seagull.rtd.com (root@seagull.rtd.com [198.102.68.2]) by who.cdrom.com (8.6.12/8.6.11) with ESMTP id KAA18090 ; Tue, 25 Jun 1996 10:34:20 -0700 Received: (from dgy@localhost) by seagull.rtd.com (8.7.5/1.2) id KAA11616; Tue, 25 Jun 1996 10:29:13 -0700 (MST) From: Don Yuniskis Message-Id: <199606251729.KAA11616@seagull.rtd.com> Subject: Re: LFSR To: jmb@freefall.FreeBSD.org (Jonathan M. Bresler) Date: Tue, 25 Jun 1996 10:29:13 -0700 (MST) Cc: freebsd-hackers@freefall.FreeBSD.org (FreeBSD hackers) In-Reply-To: <199606251709.KAA18295@freefall.freebsd.org> from "Jonathan M. Bresler" at Jun 25, 96 10:09:38 am X-Mailer: ELM [version 2.4 PL24] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-hackers@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk > don, > what's an LFSR? and where can i get one? Alfonzo's Produce Market has them on sale -- 5 pounds for a dollar (but make sure you get *fresh* ones... once they get stale, they aren't worth a damn...) Linear Feedback Shift Register -- a common technique used to produce "pseudo-random" numbers. A shift register of N bits is implemented (in this case, in software). Particular bits from the shift register are combined to form the "next" bit to be shifted into the register. By selecting a good N and carefully picking the bits to be combined, you can generate an arbitrarily long sequence of shift register values (you can, of course stroke the register multiple times to ensure that each M -- M < N -- bit sample from the register is not closely related to the previous sample). One advantage to this for memory testing is that it can be readily repeated. So, initialize the LFSR with a value X. Extract an 8 bit (or 32 bit, etc.) sample from the register and store it into memory. Advance the pointer to the next memory "location" (word, byte, etc.) and update the LFSR. Repeat until memory is full. Now, you have some hodgepodge of values in memory. Restart from the first address with a REINITIALIZED (that's "reinitialised" for you folks across the pond :>) LFSR and do a read/compare cycle to verify the contents of memory are unperturbed. This process (write then read/compare) can be repeated several times using different initialization values (i.e. at the start of each write/fill pass, use the *ending* value of the LFSR from the previous read/compare cycle to initialize the LFSR). It's not "exhaustive" but it gives a very fast check of the memory array with unstructured data. It's also pretty tiny to implement. I use this technique often in POST (Power On Self Test) for the embedded products I design. There, you have a fraction of a second to get some feel for any major failures that have crippled the hardware. The "fill all then check" approach is used just to give some added test of refresh failure (years ago, this was an issue... now it's not worth the trouble...) by letting the array sit dormant for a while. > I find use of a LFSR with a long, "relatively prime" period "Relatively prime" ensures that the pattern doesn't repeat in some way that is "realted" to the organization of the memory array. For example, if the LFSR produced samples like 0x00, 0xFF, 0x00, 0xFF :> it wouldn't be very good at detecting a decode error that affected odd (or even) addresses. Whereas 0x00, 0x00, 0xFF (still a pretty lame pattern) *would* detect that failure (0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, etc.) --don