75 static inline int Cba_IsSpace(
char c ) {
return (c ==
' ' || c ==
'\t' || c ==
'\r' || c ==
'\n'); }
76 static inline int Cba_IsDigit(
char c ) {
return (c >=
'0' && c <=
'9'); }
77 static inline int Cba_IsDigitB(
char c ) {
return (c ==
'0' || c ==
'1' || c ==
'x' || c ==
'z'); }
78 static inline int Cba_IsDigitH(
char c ) {
return (c >=
'0' && c <=
'9') || (c >=
'A' && c <= 'F') || (c >=
'a' && c <=
'f'); }
79 static inline int Cba_IsChar(
char c ) {
return (c >=
'a' && c <=
'z') || (c >=
'A' && c <=
'Z'); }
169 { p->
pCur++;
return 1; }
185 { p->
pCur++;
return 1; }
222 if ( pPlace == NULL )
return 1;
247 char * pStart = p->
pCur;
266 char * pStart = p->
pCur;
319 *pName = *pRange = 0;
324 if ( *pName == 0 )
return 0;
336 if ( *pRange == 0 )
return 0;
347 if ( NameId == 0 )
return Cba_PrsErrorSet(p,
"Cannot read signal in the list.", 0);
384 if ( Status == 0 )
return 0;
392 if ( *pName == 0 )
return Cba_PrsErrorSet(p,
"Cannot read formal name in the list.", 0);
403 if ( NameId == 0 )
return Cba_PrsErrorSet(p,
"Cannot read signal or concatenation in the list.", 0);
418 int FormId, NameId, RangeId;
425 if ( FormId == 0 )
return Cba_PrsErrorSet(p,
"Cannot read formal name of the instance.", 0);
426 if ( RangeId != 0 )
return Cba_PrsErrorSet(p,
"Formal signal cannot have range.", 0);
431 if ( NameId == 0 )
return Cba_PrsErrorSet(p,
"Cannot read actual name of the instance.", 0);
463 int NameId, RangeId, RangeIdTemp, i;
472 if ( RangeIdTemp )
return Cba_PrsErrorSet(p,
"Range is specified twice in the declaration.", 0);
479 int OutName = 0, InName = 0, RangeId = 0, fCompl = 0, Oper = 0;
483 if ( OutName == 0 )
return Cba_PrsErrorSet(p,
"Cannot read output in assign-statement.", 0);
496 if ( InName == 0 )
return Cba_PrsErrorSet(p,
"Cannot read first input name in the assign-statement.", 0);
516 else return Cba_PrsErrorSet(p,
"Unrecognized operator in the assign-statement.", 0);
520 if ( InName == 0 )
return Cba_PrsErrorSet(p,
"Cannot read second input name in the assign-statement.", 0);
531 if ( InName == 0 )
return Cba_PrsErrorSet(p,
"Cannot read third input name in the assign-statement.", 0);
546 int InstId, Status, Type;
558 if ( Status == 0 )
return 0;
563 if ( iFuncNew == 0 )
return Cba_PrsErrorSet(p,
"Cannot find elementary gate.", 0);
650 if ( !Status )
return 4;
653 return Cba_PrsErrorSet(p,
"Cannot find \";\" in the module definition.", 4);
691 printf(
" %s", pName );
695 printf(
" %s", pName );
699 printf(
" %s", pName );
737 printf(
"Finished reading %d networks. ",
Cba_ManNtkNum(p) );
739 printf(
"Memory = %.2f MB. ", 1.0*
Cba_ManMemory(p)/(1<<20) );
static int Cba_PrsReadSignalList2(Cba_Prs_t *p, Vec_Int_t *vTemp)
static void Vec_IntPushTwo(Vec_Int_t *p, int Entry1, int Entry2)
static int Cba_PrsReadConcat(Cba_Prs_t *p, Vec_Int_t *vTemp2)
void Cba_PrsPrintModules(Cba_Prs_t *p)
static int Cba_PrsErrorSet(Cba_Prs_t *p, char *pError, int Value)
MACRO DEFINITIONS ///.
void Cba_PrsWriteVerilog(char *pFileName, Cba_Man_t *pDes)
static int Cba_PrsReadInstance(Cba_Prs_t *p, int Func)
typedefABC_NAMESPACE_IMPL_START struct Vec_Int_t_ Vec_Int_t
DECLARATIONS ///.
static char * Vec_StrArray(Vec_Str_t *p)
static int Cba_PrsReadSignal(Cba_Prs_t *p, int *pName, int *pRange)
static int Cba_IsSymb2(char c)
static int Cba_IsDigitH(char c)
int Abc_NamObjNumMax(Abc_Nam_t *p)
static int Cba_IsSpace(char c)
static Vec_Int_t * Vec_WecPushLevel(Vec_Wec_t *p)
static int Cba_PrsUtilSkipUntil(Cba_Prs_t *p, char c)
static int Cba_PrsReadAssign(Cba_Prs_t *p)
static void Vec_StrClear(Vec_Str_t *p)
static int Cba_PrsReadRange(Cba_Prs_t *p)
const char * s_KnownModules[100]
FUNCTION DEFINITIONS ///.
int Abc_NamStrFindOrAdd(Abc_Nam_t *p, char *pStr, int *pfFound)
static abctime Abc_Clock()
static int Cba_PrsUtilSkipUntilWord(Cba_Prs_t *p, char *pWord)
static int Cba_IsDigit(char c)
static void Vec_StrPush(Vec_Str_t *p, char Entry)
static int Vec_WecSize(Vec_Wec_t *p)
static int Cba_PrsReadDesign(Cba_Prs_t *p)
#define ABC_SWAP(Type, a, b)
static int Cba_PrsIsDigit(Cba_Prs_t *p)
int Abc_NamStrFindOrAddLim(Abc_Nam_t *p, char *pStr, char *pLim, int *pfFound)
static void Vec_WecZero(Vec_Wec_t *p)
static void Abc_PrintTime(int level, const char *pStr, abctime time)
void Cba_PrsReadVerilogTest(char *pFileName)
static void Cba_ManFree(Cba_Man_t *p)
static void Cba_PrsErrorClear(Cba_Prs_t *p)
static void Cba_PrsSetupVecInt(Cba_Prs_t *p, Vec_Int_t *vTo, Vec_Int_t *vFrom)
static int Cba_PrsReadConstant(Cba_Prs_t *p)
static int Cba_PrsReadDeclaration(Cba_Prs_t *p, int Type)
static int Vec_IntEntry(Vec_Int_t *p, int i)
#define ABC_NAMESPACE_IMPL_END
static int Cba_PrsIsChar1(Cba_Prs_t *p, char c)
static Cba_Prs_t * Cba_PrsAlloc(char *pFileName)
static int Cba_PrsUtilSkipName(Cba_Prs_t *p)
static void Vec_IntPush(Vec_Int_t *p, int Entry)
static int Cba_PrsReadSignalList1(Cba_Prs_t *p, Vec_Int_t *vTemp)
static int Cba_PrsErrorPrint(Cba_Prs_t *p)
static int Cba_IsSymb1(char c)
static Cba_Ntk_t * Cba_PrsAddCurrentModel(Cba_Prs_t *p, int iNameId)
static int Cba_ManMemory(Cba_Man_t *p)
#define Vec_IntForEachEntryDouble(vVec, Entry1, Entry2, i)
static int Cba_PrsUtilSkipSpaces(Cba_Prs_t *p)
char * Abc_NamStr(Abc_Nam_t *p, int NameId)
Cba_Man_t * Cba_PrsReadVerilog(char *pFileName)
static int Cba_PrsReadModule(Cba_Prs_t *p)
#define ABC_NAMESPACE_IMPL_START
static int Cba_ManNtkNum(Cba_Man_t *p)
static int Cba_PrsUtilSkipComments(Cba_Prs_t *p)
const char * s_VerTypes[CBA_VER_UNKNOWN+1]
static int Cba_PrsIsChar(Cba_Prs_t *p, char c)
static int Vec_IntSize(Vec_Int_t *p)
Cba_VerType_t
DECLARATIONS ///.
static void Cba_PrsFree(Cba_Prs_t *p)
static int Cba_PrsReadSignalList(Cba_Prs_t *p, Vec_Int_t *vTemp, char LastSymb)
static int Cba_PrsReadSignalOrConcat(Cba_Prs_t *p, int *pName, int *pRange)
static int Cba_PrsReadName(Cba_Prs_t *p)
static int Cba_IsChar(char c)
static void Vec_IntClear(Vec_Int_t *p)
static int Cba_IsDigitB(char c)
static void Cba_PrsAddVerilogDirectives(Cba_Prs_t *p)
static int Cba_PrsIsKnownModule(Cba_Prs_t *p, char *pName)
#define Cba_PrsForEachModelVec(vVec, p, pName, i)