51 fprintf( pFile,
" %s", Psr_NtkStr(
p, NameId) );
52 fprintf( pFile,
"\n" );
54static void Psr_ManWriteBlifLines( FILE * pFile,
Psr_Ntk_t *
p )
57 int i, k, FormId, ActId;
60 int NtkId = Psr_BoxNtk(
p, i);
61 assert( Psr_BoxIONum(
p, i) > 0 );
62 assert( Vec_IntSize(vBox) % 2 == 0 );
65 fprintf( pFile,
".latch" );
66 fprintf( pFile,
" %s", Psr_NtkStr(
p, Vec_IntEntry(vBox, 1)) );
67 fprintf( pFile,
" %s", Psr_NtkStr(
p, Vec_IntEntry(vBox, 3)) );
68 fprintf( pFile,
" %c\n",
'0' + Psr_BoxName(
p, i) );
70 else if ( Psr_BoxIsNode(
p, i) )
72 fprintf( pFile,
".names" );
74 fprintf( pFile,
" %s", Psr_NtkStr(
p, ActId) );
75 fprintf( pFile,
"\n%s", Psr_NtkStr(
p, NtkId) );
79 fprintf( pFile,
".subckt" );
80 fprintf( pFile,
" %s", Psr_NtkStr(
p, NtkId) );
82 fprintf( pFile,
" %s=%s", Psr_NtkStr(
p, FormId), Psr_NtkStr(
p, ActId) );
83 fprintf( pFile,
"\n" );
87static void Psr_ManWriteBlifNtk( FILE * pFile,
Psr_Ntk_t *
p )
90 fprintf( pFile,
".model %s\n", Psr_NtkStr(
p,
p->iModuleName) );
91 if ( Vec_IntSize(&
p->vInouts) )
92 fprintf( pFile,
".inouts" );
93 if ( Vec_IntSize(&
p->vInouts) )
94 Psr_ManWriteBlifArray( pFile,
p, &
p->vInouts );
95 fprintf( pFile,
".inputs" );
96 Psr_ManWriteBlifArray( pFile,
p, &
p->vInputs );
97 fprintf( pFile,
".outputs" );
98 Psr_ManWriteBlifArray( pFile,
p, &
p->vOutputs );
100 Psr_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 Psr_ManWriteBlifNtk( pFile, pNtk );
137 fprintf( pFile,
"\n" );
143 fprintf( pFile,
" %s", Bac_ObjNameStr(
p, iFanin) );
145 fprintf( pFile,
" %s", Bac_ObjNameStr(
p, iObj) );
146 fprintf( pFile,
"\n" );
153 fprintf( pFile,
" %s=%s", Bac_ObjNameStr(pModel, iTerm), Bac_ObjNameStr(
p, Bac_BoxBi(
p, iObj, i)) );
155 fprintf( pFile,
" %s=%s", Bac_ObjNameStr(pModel, iTerm), Bac_ObjNameStr(
p, Bac_BoxBo(
p, iObj, i)) );
156 fprintf( pFile,
"\n" );
163 if ( Bac_ObjIsBoxUser(
p, i) )
165 fprintf( pFile,
".subckt" );
166 fprintf( pFile,
" %s", Bac_NtkName(Bac_BoxNtk(
p, i)) );
169 else if ( Bac_ObjIsGate(
p, i) )
171 char * pGateName =
Abc_NamStr(
p->pDesign->pMods, Bac_BoxNtkId(
p, i));
174 fprintf( pFile,
".gate %s", pGateName );
179 fprintf( pFile,
"\n" );
183 fprintf( pFile,
".names" );
185 fprintf( pFile,
" %s", Bac_ObjNameStr(
p, Bac_ObjFanin(
p, iTerm)) );
187 fprintf( pFile,
" %s", Bac_ObjNameStr(
p, iTerm) );
188 fprintf( pFile,
"\n%s", Ptr_TypeToSop(Bac_ObjType(
p, i)) );
194 assert( Vec_IntSize(&
p->vFanin) == Bac_NtkObjNum(
p) );
196 fprintf( pFile,
".model %s\n", Bac_NtkName(
p) );
197 fprintf( pFile,
".inputs" );
199 fprintf( pFile,
".outputs" );
203 fprintf( pFile,
".end\n\n" );
213 printf(
"Genlib library used in the mapped design is not longer a current library.\n" );
216 pFile = fopen( pFileName,
"wb" );
219 printf(
"Cannot open output file \"%s\".\n", pFileName );
222 fprintf( pFile,
"# Design \"%s\" written via CBA package in ABC on %s\n\n", Bac_ManName(
p),
Extra_TimeStamp() );
#define ABC_NAMESPACE_IMPL_START
#define ABC_NAMESPACE_IMPL_END
struct Psr_Ntk_t_ Psr_Ntk_t
BASIC TYPES ///.
#define Psr_NtkForEachBox(p, vVec, i)
void Bac_ManWriteBlifGate(FILE *pFile, Bac_Ntk_t *p, Mio_Gate_t *pGate, Vec_Int_t *vFanins, int iObj)
void Bac_ManWriteBlifArray(FILE *pFile, Bac_Ntk_t *p, Vec_Int_t *vFanins, int iObj)
void Psr_ManWriteBlif(char *pFileName, Vec_Ptr_t *vPrs)
void Bac_ManWriteBlifArray2(FILE *pFile, Bac_Ntk_t *p, int iObj)
void Bac_ManWriteBlif(char *pFileName, Bac_Man_t *p)
void Bac_ManWriteBlifLines(FILE *pFile, Bac_Ntk_t *p)
void Bac_ManWriteBlifNtk(FILE *pFile, Bac_Ntk_t *p)
struct Bac_Man_t_ Bac_Man_t
struct Bac_Ntk_t_ Bac_Ntk_t
#define Bac_BoxForEachBo(p, iBox, iTerm, i)
#define Bac_NtkForEachPi(p, iObj, i)
void Bac_ManAssignInternWordNames(Bac_Man_t *p)
#define Bac_BoxForEachBi(p, iBox, iTerm, i)
#define Bac_NtkForEachPo(p, iObj, i)
#define Bac_ManForEachNtk(p, pNtk, i)
MACRO DEFINITIONS ///.
#define Bac_NtkForEachBox(p, i)
ABC_DLL void * Abc_FrameReadLibGen()
typedefABC_NAMESPACE_IMPL_START struct Vec_Int_t_ Vec_Int_t
DECLARATIONS ///.
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 ///.