#include "cba.h"
#include "cbaPrs.h"
Go to the source code of this file.
|
enum | Cba_BlifType_t {
CBA_BLIF_NONE = 0,
CBA_BLIF_MODEL,
CBA_BLIF_INOUTS,
CBA_BLIF_INPUTS,
CBA_BLIF_OUTPUTS,
CBA_BLIF_NAMES,
CBA_BLIF_SUBCKT,
CBA_BLIF_GATE,
CBA_BLIF_LATCH,
CBA_BLIF_SHORT,
CBA_BLIF_END,
CBA_BLIF_UNKNOWN
} |
| DECLARATIONS ///. More...
|
|
DECLARATIONS ///.
CFile****************************************************************
FileName [cbaReadBlif.c]
SystemName [ABC: Logic synthesis and verification system.]
PackageName [Verilog parser.]
Synopsis [Parses several flavors of word-level Verilog.]
Author [Alan Mishchenko]
Affiliation [UC Berkeley]
Date [Ver. 1.0. Started - November 29, 2014.]
Revision [
- Id:
- cbaReadBlif.c,v 1.00 2014/11/29 00:00:00 alanmi Exp
]
Enumerator |
---|
CBA_BLIF_NONE |
|
CBA_BLIF_MODEL |
|
CBA_BLIF_INOUTS |
|
CBA_BLIF_INPUTS |
|
CBA_BLIF_OUTPUTS |
|
CBA_BLIF_NAMES |
|
CBA_BLIF_SUBCKT |
|
CBA_BLIF_GATE |
|
CBA_BLIF_LATCH |
|
CBA_BLIF_SHORT |
|
CBA_BLIF_END |
|
CBA_BLIF_UNKNOWN |
|
Definition at line 31 of file cbaReadBlif.c.
Cba_BlifType_t
DECLARATIONS ///.
static int Cba_CharIsLit |
( |
char |
c | ) |
|
|
inlinestatic |
Definition at line 90 of file cbaReadBlif.c.
90 {
return c ==
'0' || c ==
'1' || c ==
'-'; }
static int Cba_CharIsSpace |
( |
char |
c | ) |
|
|
inlinestatic |
FUNCTION DEFINITIONS ///.
Function*************************************************************
Synopsis [Reading characters.]
Description []
SideEffects []
SeeAlso []
Definition at line 88 of file cbaReadBlif.c.
88 {
return c ==
' ' || c ==
'\t' || c ==
'\r'; }
static int Cba_CharIsStop |
( |
char |
c | ) |
|
|
inlinestatic |
Definition at line 89 of file cbaReadBlif.c.
89 {
return c ==
'#' || c ==
'\\' || c ==
'\n' || c ==
'='; }
static void Cba_PrsAddBlifDirectives |
( |
Cba_Prs_t * |
p | ) |
|
|
inlinestatic |
Definition at line 61 of file cbaReadBlif.c.
int Abc_NamObjNumMax(Abc_Nam_t *p)
int Abc_NamStrFindOrAdd(Abc_Nam_t *p, char *pStr, int *pfFound)
const char * s_BlifTypes[CBA_BLIF_UNKNOWN+1]
static int Cba_PrsIsChar |
( |
Cba_Prs_t * |
p, |
|
|
char |
c |
|
) |
| |
|
inlinestatic |
static int Cba_PrsIsChar2 |
( |
Cba_Prs_t * |
p, |
|
|
char |
c |
|
) |
| |
|
inlinestatic |
Definition at line 94 of file cbaReadBlif.c.
static int Cba_CharIsLit(char c)
Definition at line 92 of file cbaReadBlif.c.
static int Cba_CharIsSpace(char c)
FUNCTION DEFINITIONS ///.
Definition at line 93 of file cbaReadBlif.c.
static int Cba_CharIsStop(char c)
Cba_Man_t* Cba_PrsReadBlif |
( |
char * |
pFileName | ) |
|
Function*************************************************************
Synopsis []
Description []
SideEffects []
SeeAlso []
Definition at line 400 of file cbaReadBlif.c.
static int Cba_PrsReadLines(Cba_Prs_t *p)
#define ABC_SWAP(Type, a, b)
static Cba_Prs_t * Cba_PrsAlloc(char *pFileName)
static int Cba_PrsErrorPrint(Cba_Prs_t *p)
static void Cba_PrsAddBlifDirectives(Cba_Prs_t *p)
static void Cba_PrsFree(Cba_Prs_t *p)
void Cba_PrsReadBlifTest |
( |
char * |
pFileName | ) |
|
Function*************************************************************
Synopsis []
Description []
SideEffects []
SeeAlso []
Definition at line 425 of file cbaReadBlif.c.
431 printf(
"Finished reading %d networks. ",
Cba_ManNtkNum(p) );
433 printf(
"Memory = %.2f MB. ", 1.0*
Cba_ManMemory(p)/(1<<20) );
int Abc_NamObjNumMax(Abc_Nam_t *p)
static abctime Abc_Clock()
static void Abc_PrintTime(int level, const char *pStr, abctime time)
static void Cba_ManFree(Cba_Man_t *p)
static int Cba_ManMemory(Cba_Man_t *p)
static int Cba_ManNtkNum(Cba_Man_t *p)
Cba_Man_t * Cba_PrsReadBlif(char *pFileName)
void Cba_PrsWriteBlif(char *pFileName, Cba_Man_t *pDes)
static int Cba_PrsReadBox |
( |
Cba_Prs_t * |
p, |
|
|
int |
fGate |
|
) |
| |
|
inlinestatic |
Definition at line 273 of file cbaReadBlif.c.
276 if ( iToken == 0 )
return Cba_PrsErrorSet(p,
"Cannot read model name.", 1);
static int Cba_PrsReadList3(Cba_Prs_t *p)
static int Cba_PrsErrorSet(Cba_Prs_t *p, char *pError, int Value)
MACRO DEFINITIONS ///.
static Vec_Int_t * Vec_WecPushLevel(Vec_Wec_t *p)
static int Cba_PrsReadName(Cba_Prs_t *p)
static void Cba_PrsSetupVecInt(Cba_Prs_t *p, Vec_Int_t *vTo, Vec_Int_t *vFrom)
static void Vec_IntPush(Vec_Int_t *p, int Entry)
Function*************************************************************
Synopsis []
Description []
SideEffects []
SeeAlso []
Definition at line 201 of file cbaReadBlif.c.
static int Cba_PrsErrorSet(Cba_Prs_t *p, char *pError, int Value)
MACRO DEFINITIONS ///.
static char Cba_PrsSkip2(Cba_Prs_t *p)
static int Cba_PrsIsChar(Cba_Prs_t *p, char c)
static void Cba_PrsSkipSpaces(Cba_Prs_t *p)
static void Vec_StrPush(Vec_Str_t *p, char Entry)
static void Vec_StrWriteEntry(Vec_Str_t *p, int i, char Entry)
static char Vec_StrEntry(Vec_Str_t *p, int i)
static int Vec_StrSize(Vec_Str_t *p)
static int Cba_PrsIsLit(Cba_Prs_t *p)
static int Cba_PrsReadDirective |
( |
Cba_Prs_t * |
p | ) |
|
|
inlinestatic |
Definition at line 343 of file cbaReadBlif.c.
static int Cba_PrsReadBox(Cba_Prs_t *p, int fGate)
static int Cba_PrsReadCube(Cba_Prs_t *p)
static int Cba_PrsIsChar(Cba_Prs_t *p, char c)
static void Cba_PrsSaveCover(Cba_Prs_t *p)
static int Cba_PrsReadName(Cba_Prs_t *p)
static int Cba_PrsReadModel(Cba_Prs_t *p)
static int Cba_PrsReadNode(Cba_Prs_t *p)
static int Cba_PrsReadInputs(Cba_Prs_t *p)
static int Cba_PrsReadShort(Cba_Prs_t *p)
static int Cba_PrsReadEnd(Cba_Prs_t *p)
char * Abc_NamStr(Abc_Nam_t *p, int NameId)
static int Vec_StrSize(Vec_Str_t *p)
static int Cba_PrsReadInouts(Cba_Prs_t *p)
static int Cba_PrsReadOutputs(Cba_Prs_t *p)
static int Cba_PrsReadLatch(Cba_Prs_t *p)
Definition at line 332 of file cbaReadBlif.c.
static int Cba_PrsErrorSet(Cba_Prs_t *p, char *pError, int Value)
MACRO DEFINITIONS ///.
static int Cba_PrsIsChar(Cba_Prs_t *p, char c)
static void Cba_PrsSkipSpaces(Cba_Prs_t *p)
static Cba_Ntk_t * Cba_PrsAddCurrentModel(Cba_Prs_t *p, int iNameId)
static int Cba_PrsReadInouts |
( |
Cba_Prs_t * |
p | ) |
|
|
inlinestatic |
Function*************************************************************
Synopsis []
Description []
SideEffects []
SeeAlso []
Definition at line 246 of file cbaReadBlif.c.
static int Cba_PrsReadList(Cba_Prs_t *p)
static int Cba_PrsReadInputs |
( |
Cba_Prs_t * |
p | ) |
|
|
inlinestatic |
Definition at line 252 of file cbaReadBlif.c.
static int Cba_PrsReadList(Cba_Prs_t *p)
Definition at line 284 of file cbaReadBlif.c.
288 if ( iToken == 0 )
return Cba_PrsErrorSet(p,
"Cannot read latch input.", 1);
291 if ( iToken == 0 )
return Cba_PrsErrorSet(p,
"Cannot read latch output.", 1);
static int Cba_PrsErrorSet(Cba_Prs_t *p, char *pError, int Value)
MACRO DEFINITIONS ///.
static int Cba_PrsIsChar(Cba_Prs_t *p, char c)
static void Cba_PrsSkipSpaces(Cba_Prs_t *p)
static Vec_Int_t * Vec_WecPushLevel(Vec_Wec_t *p)
static int Cba_PrsReadName(Cba_Prs_t *p)
static void Vec_IntWriteEntry(Vec_Int_t *p, int i, int Entry)
static void Cba_PrsSetupVecInt(Cba_Prs_t *p, Vec_Int_t *vTo, Vec_Int_t *vFrom)
static void Vec_IntFill(Vec_Int_t *p, int nSize, int Fill)
static void Vec_IntPush(Vec_Int_t *p, int Entry)
static void Cba_PrsSkipToChar(Cba_Prs_t *p, char c)
Definition at line 374 of file cbaReadBlif.c.
376 while ( p->
pCur[1] !=
'\0' )
static int Cba_PrsIsChar(Cba_Prs_t *p, char c)
static void Cba_PrsSkipSpaces(Cba_Prs_t *p)
static void Cba_PrsSkip(Cba_Prs_t *p)
static int Cba_PrsReadDirective(Cba_Prs_t *p)
Definition at line 150 of file cbaReadBlif.c.
static int Cba_PrsErrorSet(Cba_Prs_t *p, char *pError, int Value)
MACRO DEFINITIONS ///.
static int Cba_PrsReadName(Cba_Prs_t *p)
static void Vec_IntPush(Vec_Int_t *p, int Entry)
static int Vec_IntSize(Vec_Int_t *p)
static void Vec_IntClear(Vec_Int_t *p)
Definition at line 159 of file cbaReadBlif.c.
static int Cba_PrsErrorSet(Cba_Prs_t *p, char *pError, int Value)
MACRO DEFINITIONS ///.
static int Cba_PrsReadName(Cba_Prs_t *p)
static void Vec_IntWriteEntry(Vec_Int_t *p, int i, int Entry)
static void Vec_IntFill(Vec_Int_t *p, int nSize, int Fill)
static void Vec_IntPush(Vec_Int_t *p, int Entry)
static int Vec_IntSize(Vec_Int_t *p)
Definition at line 170 of file cbaReadBlif.c.
176 if ( iToken == 0 )
return Cba_PrsErrorSet(p,
"Cannot read formal name.", 1);
181 if ( iToken == 0 )
return Cba_PrsErrorSet(p,
"Cannot read actual name.", 1);
static int Cba_PrsErrorSet(Cba_Prs_t *p, char *pError, int Value)
MACRO DEFINITIONS ///.
static int Cba_PrsIsChar(Cba_Prs_t *p, char c)
static void Cba_PrsSkipSpaces(Cba_Prs_t *p)
static int Cba_PrsReadName(Cba_Prs_t *p)
static int Cba_PrsIsChar2(Cba_Prs_t *p, char c)
static void Vec_IntPush(Vec_Int_t *p, int Entry)
static int Vec_IntSize(Vec_Int_t *p)
static void Vec_IntClear(Vec_Int_t *p)
Definition at line 324 of file cbaReadBlif.c.
static int Cba_PrsErrorSet(Cba_Prs_t *p, char *pError, int Value)
MACRO DEFINITIONS ///.
static int Cba_PrsIsChar(Cba_Prs_t *p, char c)
static void Cba_PrsSkipSpaces(Cba_Prs_t *p)
static int Cba_PrsReadName(Cba_Prs_t *p)
Definition at line 137 of file cbaReadBlif.c.
146 if ( pStart == p->
pCur )
static int Cba_PrsIsChar(Cba_Prs_t *p, char c)
static void Cba_PrsSkipSpaces(Cba_Prs_t *p)
static int Cba_PrsIsSpace(Cba_Prs_t *p)
int Abc_NamStrFindOrAddLim(Abc_Nam_t *p, char *pStr, char *pLim, int *pfFound)
static void Cba_PrsSkip(Cba_Prs_t *p)
static int Cba_PrsIsStop(Cba_Prs_t *p)
Definition at line 264 of file cbaReadBlif.c.
static Vec_Int_t * Vec_WecPushLevel(Vec_Wec_t *p)
static int Cba_PrsReadList2(Cba_Prs_t *p)
static void Cba_PrsSetupVecInt(Cba_Prs_t *p, Vec_Int_t *vTo, Vec_Int_t *vFrom)
static void Vec_IntPush(Vec_Int_t *p, int Entry)
static int Cba_PrsReadOutputs |
( |
Cba_Prs_t * |
p | ) |
|
|
inlinestatic |
Definition at line 258 of file cbaReadBlif.c.
static int Cba_PrsReadList(Cba_Prs_t *p)
Definition at line 307 of file cbaReadBlif.c.
311 if ( iToken == 0 )
return Cba_PrsErrorSet(p,
"Cannot read .short input.", 1);
314 if ( iToken == 0 )
return Cba_PrsErrorSet(p,
"Cannot read .short output.", 1);
static int Cba_PrsErrorSet(Cba_Prs_t *p, char *pError, int Value)
MACRO DEFINITIONS ///.
static int Cba_PrsIsChar(Cba_Prs_t *p, char c)
static void Cba_PrsSkipSpaces(Cba_Prs_t *p)
static Vec_Int_t * Vec_WecPushLevel(Vec_Wec_t *p)
static int Cba_PrsReadName(Cba_Prs_t *p)
static void Vec_IntWriteEntry(Vec_Int_t *p, int i, int Entry)
static void Cba_PrsSetupVecInt(Cba_Prs_t *p, Vec_Int_t *vTo, Vec_Int_t *vFrom)
static void Vec_IntFill(Vec_Int_t *p, int nSize, int Fill)
static void Vec_IntPush(Vec_Int_t *p, int Entry)
static void Cba_PrsSaveCover |
( |
Cba_Prs_t * |
p | ) |
|
|
inlinestatic |
Definition at line 224 of file cbaReadBlif.c.
static char * Vec_StrArray(Vec_Str_t *p)
static void Vec_StrClear(Vec_Str_t *p)
int Abc_NamStrFindOrAdd(Abc_Nam_t *p, char *pStr, int *pfFound)
static void Vec_StrPush(Vec_Str_t *p, char Entry)
static void Vec_IntWriteEntry(Vec_Int_t *p, int i, int Entry)
static int Vec_StrSize(Vec_Str_t *p)
static int Vec_IntEntryLast(Vec_Int_t *p)
static int Vec_IntSize(Vec_Int_t *p)
static void Cba_PrsSkipSpaces |
( |
Cba_Prs_t * |
p | ) |
|
|
inlinestatic |
Definition at line 119 of file cbaReadBlif.c.
static int Cba_PrsIsChar(Cba_Prs_t *p, char c)
static int Cba_PrsIsSpace(Cba_Prs_t *p)
static void Cba_PrsSkip(Cba_Prs_t *p)
static void Cba_PrsSkipToChar(Cba_Prs_t *p, char c)
static void Cba_PrsSkipToChar |
( |
Cba_Prs_t * |
p, |
|
|
char |
c |
|
) |
| |
|
inlinestatic |
Function*************************************************************
Synopsis [Reading names.]
Description []
SideEffects []
SeeAlso []
Definition at line 114 of file cbaReadBlif.c.
static int Cba_PrsIsChar(Cba_Prs_t *p, char c)
static void Cba_PrsSkip(Cba_Prs_t *p)
Initial value:= {
NULL,
".model",
".inouts",
".inputs",
".outputs",
".names",
".subckt",
".gate",
".latch",
".short",
".end",
NULL
}
Definition at line 46 of file cbaReadBlif.c.