#include "cba.h"
#include "cbaPrs.h"
Go to the source code of this file.
|
void | Cba_PrsWriteVerilogMux (FILE *pFile, Cba_Ntk_t *p, Vec_Int_t *vFanins) |
| FUNCTION DEFINITIONS ///. More...
|
|
void | Cba_PrsWriteVerilogConcat (FILE *pFile, Cba_Ntk_t *p, int Id) |
|
void | Cba_PrsWriteVerilogArray2 (FILE *pFile, Cba_Ntk_t *p, Vec_Int_t *vFanins) |
|
void | Cba_PrsWriteVerilogArray3 (FILE *pFile, Cba_Ntk_t *p, Vec_Int_t *vFanins) |
|
void | Cba_PrsWriteVerilogNodes (FILE *pFile, Cba_Ntk_t *p) |
|
void | Cba_PrsWriteVerilogBoxes (FILE *pFile, Cba_Ntk_t *p) |
|
void | Cba_PrsWriteVerilogSignals (FILE *pFile, Cba_Ntk_t *p, int SigType) |
|
void | Cba_PrsWriteVerilogSignalList (FILE *pFile, Cba_Ntk_t *p, int SigType, int fSkipComma) |
|
void | Cba_PrsWriteVerilogNtk (FILE *pFile, Cba_Ntk_t *p) |
|
void | Cba_PrsWriteVerilog (char *pFileName, Cba_Man_t *pDes) |
|
void Cba_PrsWriteVerilog |
( |
char * |
pFileName, |
|
|
Cba_Man_t * |
pDes |
|
) |
| |
Definition at line 207 of file cbaWriteVer.c.
212 pFile = fopen( pFileName,
"wb" );
215 printf(
"Cannot open output file \"%s\".\n", pFileName );
void Cba_PrsWriteVerilogNtk(FILE *pFile, Cba_Ntk_t *p)
static char * Cba_ManName(Cba_Man_t *p)
#define Cba_ManForEachNtk(p, pNtk, i)
MACRO DEFINITIONS ///.
Definition at line 101 of file cbaWriteVer.c.
103 int NameId, RangeId, i;
110 else if ( RangeId == -1 )
111 fprintf( pFile,
"%s",
Cba_NtkStr(p, NameId) );
114 fprintf( pFile,
"%s", (i ==
Vec_IntSize(vFanins) - 2) ?
"" :
", " );
static char * Cba_NtkStr(Cba_Ntk_t *p, int i)
#define Vec_IntForEachEntryDouble(vVec, Entry1, Entry2, i)
static int Vec_IntSize(Vec_Int_t *p)
void Cba_PrsWriteVerilogConcat(FILE *pFile, Cba_Ntk_t *p, int Id)
Definition at line 117 of file cbaWriteVer.c.
119 int FormId, NameId, RangeId, i;
123 fprintf( pFile,
".%s(",
Cba_NtkStr(p, FormId) );
126 else if ( RangeId == -1 )
127 fprintf( pFile,
"%s",
Cba_NtkStr(p, NameId) );
130 fprintf( pFile,
")%s", (i ==
Vec_IntSize(vFanins) - 3) ?
"" :
", " );
static char * Cba_NtkStr(Cba_Ntk_t *p, int i)
static int Vec_IntSize(Vec_Int_t *p)
#define Vec_IntForEachEntryTriple(vVec, Entry1, Entry2, Entry3, i)
void Cba_PrsWriteVerilogConcat(FILE *pFile, Cba_Ntk_t *p, int Id)
void Cba_PrsWriteVerilogBoxes |
( |
FILE * |
pFile, |
|
|
Cba_Ntk_t * |
p |
|
) |
| |
Definition at line 155 of file cbaWriteVer.c.
163 fprintf( pFile,
");\n" );
#define Cba_NtkForEachObjType(p, Type, i)
static Vec_Int_t * Cba_ObjFanins(Cba_Ntk_t *p, int i)
static char * Cba_ObjFuncStr(Cba_Ntk_t *p, int i)
static char * Cba_ObjInstStr(Cba_Ntk_t *p, int i)
void Cba_PrsWriteVerilogArray3(FILE *pFile, Cba_Ntk_t *p, Vec_Int_t *vFanins)
void Cba_PrsWriteVerilogConcat |
( |
FILE * |
pFile, |
|
|
Cba_Ntk_t * |
p, |
|
|
int |
Id |
|
) |
| |
Definition at line 94 of file cbaWriteVer.c.
97 fprintf( pFile,
"{" );
99 fprintf( pFile,
"}" );
typedefABC_NAMESPACE_IMPL_START struct Vec_Int_t_ Vec_Int_t
DECLARATIONS ///.
static Vec_Int_t * Cba_ObjFanins(Cba_Ntk_t *p, int i)
void Cba_PrsWriteVerilogArray2(FILE *pFile, Cba_Ntk_t *p, Vec_Int_t *vFanins)
FUNCTION DEFINITIONS ///.
Function*************************************************************
Synopsis [Writing parser state into a file.]
Description []
SideEffects []
SeeAlso []
Definition at line 83 of file cbaWriteVer.c.
85 int NameId, RangeId, i;
86 char * pStrs[4] = {
" = ",
" ? ",
" : ",
";\n" };
88 fprintf( pFile,
" assign " );
91 fprintf( pFile,
"%s%s%s",
Cba_NtkStr(p, NameId), RangeId > 0 ?
Cba_NtkStr(p, RangeId) :
"", pStrs[i/2] );
static char * Cba_NtkStr(Cba_Ntk_t *p, int i)
#define Vec_IntForEachEntryDouble(vVec, Entry1, Entry2, i)
static int Vec_IntSize(Vec_Int_t *p)
void Cba_PrsWriteVerilogNodes |
( |
FILE * |
pFile, |
|
|
Cba_Ntk_t * |
p |
|
) |
| |
Definition at line 133 of file cbaWriteVer.c.
144 fprintf( pFile,
");\n" );
void Cba_PrsWriteVerilogMux(FILE *pFile, Cba_Ntk_t *p, Vec_Int_t *vFanins)
FUNCTION DEFINITIONS ///.
static int Cba_ObjFuncId(Cba_Ntk_t *p, int i)
#define Cba_NtkForEachObjType(p, Type, i)
static Vec_Int_t * Cba_ObjFanins(Cba_Ntk_t *p, int i)
void Cba_PrsWriteVerilogArray2(FILE *pFile, Cba_Ntk_t *p, Vec_Int_t *vFanins)
ABC_NAMESPACE_IMPL_START const char * s_NodeTypes[CBA_NODE_UNKNOWN+1]
DECLARATIONS ///.
void Cba_PrsWriteVerilogNtk |
( |
FILE * |
pFile, |
|
|
Cba_Ntk_t * |
p |
|
) |
| |
Definition at line 181 of file cbaWriteVer.c.
189 for ( s = 0; s < 3; s++ )
193 fprintf( pFile,
" " );
195 fprintf( pFile,
"\n" );
197 fprintf( pFile,
" );\n" );
199 for ( s = 0; s < 4; s++ )
201 fprintf( pFile,
"\n" );
205 fprintf( pFile,
"endmodule\n\n" );
static char * Cba_NtkName(Cba_Ntk_t *p)
static int Cba_NtkObjNum(Cba_Ntk_t *p)
void Cba_PrsWriteVerilogSignalList(FILE *pFile, Cba_Ntk_t *p, int SigType, int fSkipComma)
static int Vec_IntSize(Vec_Int_t *p)
void Cba_PrsWriteVerilogSignals(FILE *pFile, Cba_Ntk_t *p, int SigType)
void Cba_PrsWriteVerilogNodes(FILE *pFile, Cba_Ntk_t *p)
void Cba_PrsWriteVerilogBoxes(FILE *pFile, Cba_Ntk_t *p)
void Cba_PrsWriteVerilogSignalList |
( |
FILE * |
pFile, |
|
|
Cba_Ntk_t * |
p, |
|
|
int |
SigType, |
|
|
int |
fSkipComma |
|
) |
| |
Definition at line 174 of file cbaWriteVer.c.
176 int NameId, RangeId, i;
179 fprintf( pFile, "%s%s",
Cba_NtkStr(p, NameId), (fSkipComma && i ==
Vec_IntSize(vSigs[SigType]) - 2) ? "" : ", " );
typedefABC_NAMESPACE_IMPL_START struct Vec_Int_t_ Vec_Int_t
DECLARATIONS ///.
static char * Cba_NtkStr(Cba_Ntk_t *p, int i)
#define Vec_IntForEachEntryDouble(vVec, Entry1, Entry2, i)
static int Vec_IntSize(Vec_Int_t *p)
void Cba_PrsWriteVerilogSignals |
( |
FILE * |
pFile, |
|
|
Cba_Ntk_t * |
p, |
|
|
int |
SigType |
|
) |
| |
Definition at line 166 of file cbaWriteVer.c.
168 int NameId, RangeId, i;
169 char * pSigNames[4] = {
"inout",
"input",
"output",
"wire" };
172 fprintf( pFile, " %s %s%s;\n", pSigNames[SigType], RangeId ?
Cba_NtkStr(p, RangeId) : "",
Cba_NtkStr(p, NameId) );
typedefABC_NAMESPACE_IMPL_START struct Vec_Int_t_ Vec_Int_t
DECLARATIONS ///.
static char * Cba_NtkStr(Cba_Ntk_t *p, int i)
#define Vec_IntForEachEntryDouble(vVec, Entry1, Entry2, i)
Initial value:= {
NULL,
"const",
"buf",
"not",
"and",
"nand",
"or",
"nor",
"xor",
"xnor",
"mux",
"maj",
"???"
"???"
}
DECLARATIONS ///.
CFile****************************************************************
FileName [cba.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:
- cba.c,v 1.00 2014/11/29 00:00:00 alanmi Exp
]
Definition at line 51 of file cbaWriteVer.c.