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] );
97 fprintf( pFile,
"{" );
99 fprintf( pFile,
"}" );
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) ?
"" :
", " );
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) ?
"" :
", " );
144 fprintf( pFile,
");\n" );
163 fprintf( pFile,
");\n" );
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) );
176 int NameId, RangeId, i;
179 fprintf( pFile,
"%s%s",
Cba_NtkStr(p, NameId), (fSkipComma && i ==
Vec_IntSize(vSigs[SigType]) - 2) ?
"" :
", " );
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" );
212 pFile = fopen( pFileName,
"wb" );
215 printf(
"Cannot open output file \"%s\".\n", pFileName );
void Cba_PrsWriteVerilogMux(FILE *pFile, Cba_Ntk_t *p, Vec_Int_t *vFanins)
FUNCTION DEFINITIONS ///.
typedefABC_NAMESPACE_IMPL_START struct Vec_Int_t_ Vec_Int_t
DECLARATIONS ///.
static int Cba_ObjFuncId(Cba_Ntk_t *p, int i)
void Cba_PrsWriteVerilog(char *pFileName, Cba_Man_t *pDes)
static char * Cba_NtkName(Cba_Ntk_t *p)
#define Cba_NtkForEachObjType(p, Type, i)
static Vec_Int_t * Cba_ObjFanins(Cba_Ntk_t *p, int i)
void Cba_PrsWriteVerilogNtk(FILE *pFile, Cba_Ntk_t *p)
static int Cba_NtkObjNum(Cba_Ntk_t *p)
static char * Cba_ObjFuncStr(Cba_Ntk_t *p, int i)
void Cba_PrsWriteVerilogArray2(FILE *pFile, Cba_Ntk_t *p, Vec_Int_t *vFanins)
static char * Cba_ManName(Cba_Man_t *p)
#define ABC_NAMESPACE_IMPL_END
static char * Cba_NtkStr(Cba_Ntk_t *p, int i)
void Cba_PrsWriteVerilogSignalList(FILE *pFile, Cba_Ntk_t *p, int SigType, int fSkipComma)
static char * Cba_ObjInstStr(Cba_Ntk_t *p, int i)
#define Vec_IntForEachEntryDouble(vVec, Entry1, Entry2, i)
#define ABC_NAMESPACE_IMPL_START
void Cba_PrsWriteVerilogArray3(FILE *pFile, Cba_Ntk_t *p, Vec_Int_t *vFanins)
ABC_NAMESPACE_IMPL_START const char * s_NodeTypes[CBA_NODE_UNKNOWN+1]
DECLARATIONS ///.
static int Vec_IntSize(Vec_Int_t *p)
void Cba_PrsWriteVerilogSignals(FILE *pFile, Cba_Ntk_t *p, int SigType)
#define Vec_IntForEachEntryTriple(vVec, Entry1, Entry2, Entry3, i)
void Cba_PrsWriteVerilogConcat(FILE *pFile, Cba_Ntk_t *p, int Id)
void Cba_PrsWriteVerilogNodes(FILE *pFile, Cba_Ntk_t *p)
void Cba_PrsWriteVerilogBoxes(FILE *pFile, Cba_Ntk_t *p)
#define Cba_ManForEachNtk(p, pNtk, i)
MACRO DEFINITIONS ///.