51 fprintf( pFile,
" %s", Prs_NtkStr(
p, NameId) );
52 fprintf( pFile,
"\n" );
54static void Prs_ManWriteBlifLines( FILE * pFile,
Prs_Ntk_t *
p )
57 int i, k, FormId, ActId;
60 int NtkId = Prs_BoxNtk(
p, i);
61 assert( Prs_BoxIONum(
p, i) > 0 );
62 assert( Vec_IntSize(vBox) % 2 == 0 );
65 fprintf( pFile,
".latch" );
66 fprintf( pFile,
" %s", Prs_NtkStr(
p, Vec_IntEntry(vBox, 1)) );
67 fprintf( pFile,
" %s", Prs_NtkStr(
p, Vec_IntEntry(vBox, 3)) );
68 fprintf( pFile,
" %c\n",
'0' + Prs_BoxName(
p, i) );
70 else if ( Prs_BoxIsNode(
p, i) )
72 fprintf( pFile,
".names" );
74 fprintf( pFile,
" %s", Prs_NtkStr(
p, ActId) );
75 fprintf( pFile,
"\n%s", Prs_NtkSop(
p, NtkId) );
79 fprintf( pFile,
".subckt" );
80 fprintf( pFile,
" %s", Prs_NtkStr(
p, NtkId) );
82 fprintf( pFile,
" %s=%s", Prs_NtkStr(
p, FormId), Prs_NtkStr(
p, ActId) );
83 fprintf( pFile,
"\n" );
87static void Prs_ManWriteBlifNtk( FILE * pFile,
Prs_Ntk_t *
p )
90 fprintf( pFile,
".model %s\n", Prs_NtkStr(
p,
p->iModuleName) );
91 if ( Vec_IntSize(&
p->vInouts) )
92 fprintf( pFile,
".inouts" );
93 if ( Vec_IntSize(&
p->vInouts) )
94 Prs_ManWriteBlifArray( pFile,
p, &
p->vInouts );
95 fprintf( pFile,
".inputs" );
96 Prs_ManWriteBlifArray( pFile,
p, &
p->vInputs );
97 fprintf( pFile,
".outputs" );
98 Prs_ManWriteBlifArray( pFile,
p, &
p->vOutputs );
100 Prs_ManWriteBlifLines( pFile,
p );
101 fprintf( pFile,
".end\n\n" );
106 FILE * pFile = fopen( pFileName,
"wb" );
int i;
109 printf(
"Cannot open output file \"%s\".\n", pFileName );
114 Prs_ManWriteBlifNtk( pFile, pNtk );
132 int k, iObj, iFin, iFon;
135 if ( Cba_ObjIsBoxUser(
p, iObj) )
138 fprintf( pFile,
".subckt" );
139 fprintf( pFile,
" %s", Cba_NtkName(pNtk) );
141 fprintf( pFile,
" %s=%s", Cba_ObjNameStr(pNtk, Cba_NtkPi(pNtk, k)), Cba_FonNameStr(
p, iFon) );
143 fprintf( pFile,
" %s=%s", Cba_ObjNameStr(pNtk, Cba_NtkPo(pNtk, k)), Cba_FonNameStr(
p, iFon) );
144 fprintf( pFile,
"\n" );
146 else if ( Cba_ObjIsGate(
p, iObj) )
148 char * pGateName =
Abc_NamStr(
p->pDesign->pMods, Cba_ObjNtkId(
p, iObj ));
151 fprintf( pFile,
".gate %s", pGateName );
156 fprintf( pFile,
"\n" );
160 fprintf( pFile,
".names" );
162 fprintf( pFile,
" %s", Cba_FonNameStr(
p, iFon) );
163 fprintf( pFile,
" %s", Cba_FonNameStr(
p, Cba_ObjFon0(
p, iObj)) );
164 fprintf( pFile,
"\n%s", Cba_NtkSop(
p, Cba_ObjFunc(
p, iObj)) );
172 fprintf( pFile,
" %s", Cba_ObjNameStr(
p, iObj) );
173 fprintf( pFile,
"\n" );
178 fprintf( pFile,
".model %s\n", Cba_NtkName(
p) );
179 fprintf( pFile,
".inputs" );
181 fprintf( pFile,
".outputs" );
185 fprintf( pFile,
".end\n\n" );
195 printf(
"Genlib library used in the mapped design is not longer a current library.\n" );
198 pFile = fopen( pFileName,
"wb" );
201 printf(
"Cannot open output file \"%s\".\n", pFileName );
204 fprintf( pFile,
"# Design \"%s\" written via CBA package in ABC on %s\n\n", Cba_ManName(
p),
Extra_TimeStamp() );
#define ABC_NAMESPACE_IMPL_START
#define ABC_NAMESPACE_IMPL_END
ABC_DLL void * Abc_FrameReadLibGen()
typedefABC_NAMESPACE_IMPL_START struct Vec_Int_t_ Vec_Int_t
DECLARATIONS ///.
struct Prs_Ntk_t_ Prs_Ntk_t
BASIC TYPES ///.
#define Prs_NtkForEachBox(p, vVec, i)
void Cba_ManWriteBlifLines(FILE *pFile, Cba_Ntk_t *p)
void Prs_ManWriteBlif(char *pFileName, Vec_Ptr_t *vPrs)
void Cba_ManWriteBlifNtk(FILE *pFile, Cba_Ntk_t *p)
void Cba_ManWriteBlifArray(FILE *pFile, Cba_Ntk_t *p, Vec_Int_t *vObjs)
void Cba_ManWriteBlif(char *pFileName, Cba_Man_t *p)
#define Cba_NtkForEachBox(p, i)
#define Cba_ObjForEachFinFon(p, iObj, iFin, iFon, k)
#define Cba_ObjForEachFon(p, iObj, iFon, k)
typedefABC_NAMESPACE_HEADER_START struct Cba_Ntk_t_ Cba_Ntk_t
INCLUDES ///.
struct Cba_Man_t_ Cba_Man_t
#define Cba_ManForEachNtk(p, pNtk, i)
ITERATORS ///.
struct Mio_LibraryStruct_t_ Mio_Library_t
Mio_Gate_t * Mio_LibraryReadGateByName(Mio_Library_t *pLib, char *pName, char *pOutName)
char * Mio_GateReadPinName(Mio_Gate_t *pGate, int iPin)
char * Mio_GateReadOutName(Mio_Gate_t *pGate)
struct Mio_GateStruct_t_ Mio_Gate_t
char * Abc_NamStr(Abc_Nam_t *p, int NameId)
#define Vec_IntForEachEntryDouble(vVec, Entry1, Entry2, i)
#define Vec_IntForEachEntry(vVec, Entry, i)
MACRO DEFINITIONS ///.
typedefABC_NAMESPACE_HEADER_START struct Vec_Ptr_t_ Vec_Ptr_t
INCLUDES ///.
#define Vec_PtrForEachEntry(Type, vVec, pEntry, i)
MACRO DEFINITIONS ///.