diff options
Diffstat (limited to 'src/temp/ver')
-rw-r--r-- | src/temp/ver/module.make | 4 | ||||
-rw-r--r-- | src/temp/ver/verCore.c | 30 | ||||
-rw-r--r-- | src/temp/ver/verFormula.c | 27 | ||||
-rw-r--r-- | src/temp/ver/verParse.c | 6 |
4 files changed, 43 insertions, 24 deletions
diff --git a/src/temp/ver/module.make b/src/temp/ver/module.make new file mode 100644 index 00000000..a58a2c60 --- /dev/null +++ b/src/temp/ver/module.make @@ -0,0 +1,4 @@ +SRC += src/temp/ver/verCore.c \ + src/temp/ver/verFormula.c \ + src/temp/ver/verParse.c \ + src/temp/ver/verStream.c diff --git a/src/temp/ver/verCore.c b/src/temp/ver/verCore.c index 6c8192f5..d18d1820 100644 --- a/src/temp/ver/verCore.c +++ b/src/temp/ver/verCore.c @@ -285,7 +285,7 @@ int Ver_ParseModule( Ver_Man_t * pMan ) Abc_NtkFindOrCreateNet( pNtk, "1'b1" ); // make sure we stopped at the opening paranthesis - if ( Ver_StreamScanChar(p) != '(' ) + if ( Ver_StreamPopChar(p) != '(' ) { sprintf( pMan->sError, "Cannot find \"(\" after \"module\".", pNtk->pName ); Ver_ParsePrintErrorMessage( pMan ); @@ -293,19 +293,12 @@ int Ver_ParseModule( Ver_Man_t * pMan ) } // skip to the end of parantheses - while ( 1 ) - { - Extra_ProgressBarUpdate( pMan->pProgress, Ver_StreamGetCurPosition(p), NULL ); - Ver_StreamSkipToChars( p, ",/)" ); - while ( Ver_StreamScanChar(p) == '/' ) - { - Ver_ParseSkipComments( pMan ); - Ver_StreamSkipToChars( p, ",/)" ); - } + do { + if ( Ver_ParseGetName( pMan ) == NULL ) + return 0; Symbol = Ver_StreamPopChar(p); - if ( Symbol== ')' ) - break; - } + } while ( Symbol == ',' ); + assert( Symbol == ')' ); if ( !Ver_ParseSkipComments( pMan ) ) return 0; Symbol = Ver_StreamPopChar(p); @@ -482,7 +475,6 @@ int Ver_ParseAssign( Ver_Man_t * pMan ) return 0; } - while ( 1 ) { // get the name of the output signal @@ -495,6 +487,7 @@ int Ver_ParseAssign( Ver_Man_t * pMan ) { pWord++; pWord[strlen(pWord)-1] = 0; + assert( pWord[0] != '\\' ); } // get the fanout net pNet = Abc_NtkFindNet( pNtk, pWord ); @@ -740,7 +733,7 @@ int Ver_ParseGate( Ver_Man_t * pMan, Abc_Ntk_t * pNtkGate ) Abc_Ntk_t * pNtk = pMan->pNtkCur; Abc_Obj_t * pNetFormal, * pNetActual; Abc_Obj_t * pObj, * pNode; - char * pWord, Symbol; + char * pWord, Symbol, * pGateName; int i, fCompl, fComplUsed = 0; unsigned * pPolarity; @@ -754,6 +747,7 @@ int Ver_ParseGate( Ver_Man_t * pMan, Abc_Ntk_t * pNtkGate ) if ( pWord == NULL ) return 0; // this is gate name - throw it away + pGateName = pWord; if ( Ver_StreamPopChar(p) != '(' ) { sprintf( pMan->sError, "Cannot parse gate %s (expected opening paranthesis).", pNtkGate->pName ); @@ -893,6 +887,12 @@ int Ver_ParseGate( Ver_Man_t * pMan, Abc_Ntk_t * pNtkGate ) } // create box to represent this gate pNode = Abc_NtkCreateBlackbox( pMan->pNtkCur ); +/* + if ( pNode->Id == 57548 ) + { + int x = 0; + } +*/ pNode->pNext = (Abc_Obj_t *)pPolarity; pNode->pData = pNtkGate; // connect to fanin nets diff --git a/src/temp/ver/verFormula.c b/src/temp/ver/verFormula.c index 8bb21547..fd8777c3 100644 --- a/src/temp/ver/verFormula.c +++ b/src/temp/ver/verFormula.c @@ -95,7 +95,7 @@ void * Ver_FormulaParser( char * pFormula, void * pMan, Vec_Ptr_t * vNames, Vec_ sprintf( pErrorMessage, "Parse_FormulaParser(): Different number of opening and closing parantheses ()." ); return NULL; } - + // add parantheses pTemp = pFormula + strlen(pFormula) + 2; *pTemp-- = 0; *pTemp = ')'; @@ -114,7 +114,6 @@ void * Ver_FormulaParser( char * pFormula, void * pMan, Vec_Ptr_t * vNames, Vec_ case '\t': case '\r': case '\n': - case '\\': // skip name opening statement continue; // treat Constant 0 as a variable @@ -231,6 +230,8 @@ void * Ver_FormulaParser( char * pFormula, void * pMan, Vec_Ptr_t * vNames, Vec_ default: // scan the next name v = Ver_FormulaParserFindVar( pTemp, vNames ); + if ( *pTemp == '\\' ) + pTemp++; pTemp += (int)Vec_PtrEntry( vNames, 2*v ) - 1; // assume operation AND, if vars follow one another @@ -376,14 +377,24 @@ int Ver_FormulaParserFindVar( char * pString, Vec_Ptr_t * vNames ) { char * pTemp, * pTemp2; int nLength, nLength2, i; - // find the end of the string delimited by other characters + // start the string pTemp = pString; - while ( *pTemp && *pTemp != ' ' && *pTemp != '\t' && *pTemp != '\r' && *pTemp != '\n' && *pTemp != ',' && *pTemp != '}' && - *pTemp != VER_PARSE_SYM_OPEN && *pTemp != VER_PARSE_SYM_CLOSE && - *pTemp != VER_PARSE_SYM_NEGBEF1 && *pTemp != VER_PARSE_SYM_NEGBEF2 && - *pTemp != VER_PARSE_SYM_AND && *pTemp != VER_PARSE_SYM_OR && *pTemp != VER_PARSE_SYM_XOR && - *pTemp != VER_PARSE_SYM_MUX1 && *pTemp != VER_PARSE_SYM_MUX2 ) + // find the end of the string delimited by other characters + if ( *pTemp == '\\' ) + { + pString++; + while ( *pTemp && *pTemp != ' ' ) pTemp++; + } + else + { + while ( *pTemp && *pTemp != ' ' && *pTemp != '\t' && *pTemp != '\r' && *pTemp != '\n' && *pTemp != ',' && *pTemp != '}' && + *pTemp != VER_PARSE_SYM_OPEN && *pTemp != VER_PARSE_SYM_CLOSE && + *pTemp != VER_PARSE_SYM_NEGBEF1 && *pTemp != VER_PARSE_SYM_NEGBEF2 && + *pTemp != VER_PARSE_SYM_AND && *pTemp != VER_PARSE_SYM_OR && *pTemp != VER_PARSE_SYM_XOR && + *pTemp != VER_PARSE_SYM_MUX1 && *pTemp != VER_PARSE_SYM_MUX2 ) + pTemp++; + } // look for this string in the array nLength = pTemp - pString; for ( i = 0; i < Vec_PtrSize(vNames)/2; i++ ) diff --git a/src/temp/ver/verParse.c b/src/temp/ver/verParse.c index c8497932..8a78e75b 100644 --- a/src/temp/ver/verParse.c +++ b/src/temp/ver/verParse.c @@ -96,8 +96,12 @@ char * Ver_ParseGetName( Ver_Man_t * pMan ) return NULL; Symbol = Ver_StreamScanChar( p ); if ( Symbol == '\\' ) + { Ver_StreamPopChar( p ); - pWord = Ver_StreamGetWord( p, " \t\n\r(),;" ); + pWord = Ver_StreamGetWord( p, " " ); + } + else + pWord = Ver_StreamGetWord( p, " \t\n\r(),;" ); if ( !Ver_ParseSkipComments( pMan ) ) return NULL; return pWord; |