⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 bchhwsim.h

📁 M-System DOC(Disk on a Chip) Flash芯片映像读写工具, 可以进行二片Flash芯片的内容互相拷贝, 提高烧录程序的效率.
💻 H
字号:
/* Simulaton of the ECC hardware                                             */
/* Prototypes of hardware simulation routines and global constant tables     */
/*                                                                           */ 
/* If ECC hardware exist these routines are not nesassary                    */
/*                                                                           */
/* Algorithms and programming were written by :                              */
/*                                                                           */
/*		Itai Dror                                                            */
/*                                                                           */
/*		Fortress Security Division, Omer                                     */
/*		M - Systems, Flash Disk Pioneers                                     */ 
/*		email: itaid@m-sys.com                                               */
/*                                                                           */
/*                                                                           */
/*      version 1.0, Feb. 2, 2002                                            */							
/*                                                                           */
/*		version 1.02, Dec 10, 2002											 */
/*		(Disk On Chip naming convention compliance)							 */						
/*                                                                           */

#ifndef __ECCHardwareSim_h

#define __ECCHardwareSim_h

#include "bch_hm.h"
	

/* ------------------------------------------------------------------------- */
/*                                                                           */
/* function:	                                                             */
/*                                                                           */
/* void BCH_Parity(FLByte bU[], FLSNative nsnumbytes, FLByte bP[])           */
/*                                                                           */
/* description:	Calculate parity bits for BCH 4 error correction code        */
/*			                                                                 */
/*                                                                           */
/* Perfomance in accelerated using multiplication tables of g(X)             */
/*                                                                           */
/* Input:                                                                    */
/*		bU[]		-		Page of data                                     */
/*		nsnumbytes	-		Number of data bytes                             */
/*							1 <= numbytes <= 2040                            */
/*                                                                           */
/* Output:                                                                   */
/* bP[]			- 7 bytes of BCH 4 ECC parity bits                           */
/*                                                                           */
/*                                                                           */
/* ------------------------------------------------------------------------- */
extern void BCH_Parity(FLByte bU[], FLSNative nsnumbytes, FLByte bP[]) ;


/* ------------------------------------------------------------------------- */
/*                                                                           */
/* function:	                                                             */
/*                                                                           */
/*	FLSNative BCH_Syndrome(FLByte bV[], FLSNative nsnumbytes, FLByte bS[])   */
/*                                                                           */  
/* description:	Calculate syndrome bits for BCH 4 error correction code      */
/*			                                                                 */
/*                                                                           */
/* Perfomance in accelerated using multiplication tables of g(X)             */
/*                                                                           */
/* Input:                                                                    */ 
/*		bV[]		-		Page of data + parity bytes                      */
/*		nsnumbytes	-		Number of data bytes                             */
/*							1 <= nsnumbytes <= 2040                          */
/*                                                                           */
/* Output:                                                                   */
/*		bS[]			- 7 bytes of BCH 4 ECC syndrome bits                 */
/*                                                                           */
/*                                                                           */
/* Returned value:                                                           */
/*		0	-	Syndrome is not 0 (There are errors)                         */                                            
/*      1   -   Syndrome is 0 (Data is correct)                              */
/*                                                                           */
/* ------------------------------------------------------------------------- */
extern FLSNative BCH_Syndrome(FLByte bV[], FLSNative nsnumbytes, FLByte bS[]) ;



/* ------------------------------------------------------------------------- */
/*                                                                           */
/* function:	FLByte Hamming_Parity(FLByte bU[],nsnumbytes)                */
/*                                                                           */
/* description:	                                                             */
/*                                                                           */
/*	Calculate Hamming parity bits for 1 error correction, 2 errors detection */
/*			                                                                 */
/* Perfomance in accelerated using multiplication tables of Hamming g(X)     */
/*                                                                           */
/* Input:                                                                    */
/*		bU[]		-		PageInfo bytes									 */
/*		nsnumbytes	-		Number of bytes                                  */
/*                          1 <= nsnumbytes <= 14                            */
/*                                                                           */
/* Returned value:                                                           */
/*                                                                           */
/*		1 byte of parity                                                     */
/*                                                                           */
/*                                                                           */ 
/* ------------------------------------------------------------------------- */
extern FLByte Hamming_Parity(FLByte bU[],FLSNative nsnumbytes) ;



/* ------------------------------------------------------------------------- */
/*                                                                           */
/* function: FLByte Hamming_Syndrome(FLByte bV[],FLSNative nsnumbytes)       */ 
/*                                                                           */ 
/* description:	                                                             */
/*                                                                           */
/* Calculate Hamming syndrome bits for 1 error correction, 2 errors detection*/
/*			                                                                 */
/*                                                                           */ 
/* Perfomance in accelerated using multiplication tables of Hamming g(X)     */
/*                                                                           */
/* Input:                                                                    */
/*		bV[]		-		PageInfo bytes + paritybyte                      */
/*		nsnumbytes	-		Number of bytes                                  */
/*                          1 <= nsnumbytes <= 14                            */
/*                                                                           */ 
/* Returned value:                                                           */
/*		1 byte of syndrome                                                   */
/*                                                                           */
/*                                                                           */ 
/* ------------------------------------------------------------------------- */
extern FLByte Hamming_Syndrome(FLByte bV[],FLSNative nsnumbytes) ;


/* ------------------------------------------------------------------------- */
/* BCH update function                                                       */
/*                                                                           */
/* Algorithms and programming were written by :                              */
/*                                                                           */
/*		Itai Dror                                                            */
/*                                                                           */
/*		Fortress Security Division, Omer                                     */
/*		M - Systems, Flash Disk Pioneers                                     */ 
/*		email: itaid@m-sys.com                                               */
/*                                                                           */
/*                                                                           */
/*      version 1.0, April. 20, 2002                                         */							
/*                                                                           */
/* ------------------------------------------------------------------------- */
/*                                                                           */
/* function:	                                                             */
/*                                                                           */
/* void BCH_ParityUpdate(FLByte bOldPageInfo[],                              */
/*		FLByte bNewPageInfo[], FLByte bBCHParity[] )                         */  
/*                                                                           */
/*                                                                           */
/* description:	                                                             */
/*                                                                           */
/*		UpDating BCH parity bytes accoring to the OldPageInfo,               */
/*      NewPageInfo, and the current BCHParity.                              */
/*      NewParity = OldParity ^ ParityOf( OldPageInfo ^ NewPageInfo )        */
/*      This is working because BCH codes are linear.                        */
/*                                                                           */
/*      Function updates also NewPageInfo[7] which is the hamming parity     */
/*      byte of NewPageInfo                                                  */ 
/*                                                                           */
/* Input:                                                                    */
/*                                                                           */ 
/*	bOldPageInfo	- The page info bytes                  					 */
/*                                                                           */
/*	bNewPageInfo	- The new page info bytes which replace the old ones	 */
/*                                                                           */
/* Input / Output:                                                           */
/*                                                                           */
/*  bBCHParity[]	- 7 BCH parity bytes. Byte of parity are updated by this */
/*                function.                                                  */
/*                                                                           */ 
/* Output:                                                                   */
/*                                                                           */
/*  bNewPageInfo[7] - Hamming parity of bNewPageInfo[0..6]                   */
/*                                                                           */
/*  Returned value :                                                         */
/*		                                                                     */
/*		None			                                                     */
/*                                                                           */
extern void BCH_ParityUpdate(FLByte bOldPageInfo[], FLByte bNewPageInfo[], 
					  FLByte bBCHParity[]) ;

#endif

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -