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

📄 svf2loopsvf.h

📁 在嵌入式系统中对Lattice CPLD软件升级时所需的VME文件生成所需源代码。将一个链上的不同厂家的CPLD产生的SVF文件转换成VME文件
💻 H
字号:
/************************************************************************
*						SVF2LOOPSVF.H									*
*																		*
*	  This header file contains the module to compress an SVF file		*
*	  by constructing loops in the SVF.  If successful, it writes a		*
*	  temporary LOP file, which is similar to SVF but has the			*
*	  looping constructs.  The .LOP file will be converted into VME.	*
*	  If the looping is not successful, the partially created LOP file	*
*	  is removed and the original SVF will be converted into VME.		*
*                                                                       *
*************************************************************************/

/* Global Variables */
#include <math.h>

#define MAXSIZE 8000
#define SIZE 1024
FILE *fp;				/*file pointer to loop SVF */
char* Pattern[SIZE];    /*holds the patterns*/
int numOfOccurrences[SIZE]; /*tracks the number of times a pattern occurs*/
long int startPositions[SIZE]; /*tracks the starting positions of each pattern */
char globalTemplate[MAXSIZE];/*matching template set */
char **globalValues;
char **tokenList1;
char **tokenList2;
int newTokenCounter;
int oldTokenCounter;
int numOccur;
int globalCounter;
int globalSDR;
int getGRA;
char globalRepeatAddress[MAXSIZE];
char tempGlobalRepeatAddress[MAXSIZE];
int SDRValues[SIZE];
int RepeatArray[SIZE];
char shiftdirection[4];
FILE * loopfptr;

int CreateLoopFile( char * a_pSVFFilename );
void DetermineLoops( char * a_pSVFFilename );
void BuildSDRTable( char * a_pSVFFilename );
long int GetNextSIRPos( long int a_liPosition, char * a_pSVFFilename );
void GetNextSIRLine( char * a_pszSIRLine, FILE * a_fptr );
void GetSIRCode( char * a_pszSIRCode, const char * a_pszSIRLine );
long int GetNextSetPos( const char * a_pszBegPattern, const char * a_pszSVFFilename, long int a_liStartPosition );
int CompareData( const char * a_pszSVFFilename );
int IsLineComplete( const char * a_pszSVFLine );
void GetCompleteLine( FILE * a_fptrRead, char * a_pszSVFLine );

int DetermineTemplateLine(char *string1, char *string2); 
												/* parses two strings to find common
												  elements */
void WriteToGlobalValues(int offset); /* writes data that is not repeatable */
int IsAllZeros(char *a_string);  /* determines if the string contains all zeros*/
int SetGlobalSDRValue(char *array[], int size);
void FormatGlobalTemplate(char* patternTemplate);
int DetermineShiftStatus(char *address1, char *address2, int *size); /* determines if
					          address is right shifted or left shifted and size of shift*/
void FreeMem();

⌨️ 快捷键说明

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