Several small bug fixes.

This commit is contained in:
Alan Mishchenko
2015-01-17 20:48:42 -08:00
parent 17610c039f
commit d688af2601
4 changed files with 10 additions and 2 deletions
+1 -1
View File
@@ -50,7 +50,7 @@ void Cba_ManPrepareGates( Cba_Man_t * p )
if ( p->pMioLib == NULL )
return;
assert( p->ppGraphs == NULL );
p->ppGraphs = ABC_ALLOC( Dec_Graph_t *, Abc_NamObjNumMax(p->pFuncs) );
p->ppGraphs = (Dec_Graph_t **)ABC_ALLOC( Dec_Graph_t *, Abc_NamObjNumMax(p->pFuncs) );
p->ppGraphs[0] = NULL;
for ( i = 1; i < Abc_NamObjNumMax(p->pFuncs); i++ )
{
+7 -1
View File
@@ -167,13 +167,19 @@ void Cba_ManWriteBlifLines( FILE * pFile, Cba_Ntk_t * p )
{
if ( Type == CBA_OBJ_NODE ) // .names/assign/box2 (no formal/actual binding)
{
if ( Abc_NamObjNumMax(p->pDesign->pFuncs) > 1 ) // mapped
if ( p->pDesign->pMioLib ) // mapped
{
char * pGateName = Abc_NamStr( p->pDesign->pFuncs, Cba_ObjFuncId(p, i) );
Mio_Gate_t * pGate = Mio_LibraryReadGateByName( (Mio_Library_t *)p->pDesign->pMioLib, pGateName, NULL );
fprintf( pFile, ".gate" );
Cba_ManWriteBlifGate( pFile, p, pGate, Cba_ObjFaninVec(p, i), i );
}
else if ( Abc_NamObjNumMax(p->pDesign->pFuncs) > 1 ) // SOP functions
{
fprintf( pFile, ".names" );
Cba_ManWriteBlifArray( pFile, p, Cba_ObjFaninVec(p, i), i );
fprintf( pFile, "%s", Cba_ObjFuncStr(p, i) );
}
else
{
fprintf( pFile, ".names" );