mirror of
https://github.com/YosysHQ/abc.git
synced 2026-09-04 00:31:14 +02:00
Updates to NDR format (bug fixes).
This commit is contained in:
@@ -397,13 +397,6 @@ Wlc_Ntk_t * Wlc_NtkFromNdr( void * pData )
|
||||
ABC_SWAP( int, Vec_IntEntryP(vFanins, 1)[0], Vec_IntEntryP(vFanins, 2)[0] );
|
||||
Wlc_ObjAddFanins( pNtk, Wlc_NtkObj(pNtk, iObj), vFanins );
|
||||
Wlc_ObjSetNameId( pNtk, iObj, NameId );
|
||||
if ( Type == ABC_OPER_ARI_SMUL )
|
||||
{
|
||||
pObj = Wlc_NtkObj(pNtk, iObj);
|
||||
assert( Wlc_ObjFaninNum(pObj) == 2 );
|
||||
Wlc_ObjFanin0(pNtk, pObj)->Signed = 1;
|
||||
Wlc_ObjFanin1(pNtk, pObj)->Signed = 1;
|
||||
}
|
||||
}
|
||||
// mark primary outputs
|
||||
Ndr_ModForEachPo( p, Mod, Obj )
|
||||
@@ -426,6 +419,12 @@ Wlc_Ntk_t * Wlc_NtkFromNdr( void * pData )
|
||||
int * pFanins = Wlc_ObjFanins(pObj);
|
||||
for ( k = 0; k < Wlc_ObjFaninNum(pObj); k++ )
|
||||
pFanins[k] = Vec_IntEntry(vName2Obj, pFanins[k]);
|
||||
if ( Wlc_ObjType(pObj) == WLC_OBJ_ARI_MULTI )
|
||||
{
|
||||
assert( Wlc_ObjFaninNum(pObj) == 2 );
|
||||
Wlc_ObjFanin0(pNtk, pObj)->Signed = 1;
|
||||
Wlc_ObjFanin1(pNtk, pObj)->Signed = 1;
|
||||
}
|
||||
}
|
||||
if ( pNtk->vInits )
|
||||
{
|
||||
|
||||
@@ -261,7 +261,7 @@ void Wlc_WriteVerInt( FILE * pFile, Wlc_Ntk_t * p, int fNoFlops )
|
||||
fprintf( pFile, " " );
|
||||
fprintf( pFile, "%s (", pObj->Type == WLC_OBJ_READ ? "ABC_READ" : "ABC_WRITE" );
|
||||
Wlc_ObjForEachFanin( pObj, iFanin, k )
|
||||
fprintf( pFile, " .%s(%s)", k==0 ? "mem_in" : (k==1 ? "addr": "data"), Wlc_ObjName(p, iFanin) );
|
||||
fprintf( pFile, " .%s(%s),", k==0 ? "mem_in" : (k==1 ? "addr": "data"), Wlc_ObjName(p, iFanin) );
|
||||
fprintf( pFile, " .%s(%s) ) ;\n", pObj->Type == WLC_OBJ_READ ? "data" : "mem_out", Wlc_ObjName(p, i) );
|
||||
continue;
|
||||
}
|
||||
@@ -276,19 +276,19 @@ void Wlc_WriteVerInt( FILE * pFile, Wlc_Ntk_t * p, int fNoFlops )
|
||||
fprintf( pFile, " " );
|
||||
fprintf( pFile, "%s_%d (", pObj->Type == WLC_OBJ_READ ? "CPL_MEM_READ" : "CPL_MEM_WRITE", Depth );
|
||||
Wlc_ObjForEachFanin( pObj, iFanin, k )
|
||||
fprintf( pFile, " .%s(%s)", k==0 ? "mem_data_in" : (k==1 ? "addr_in": "data_in"), Wlc_ObjName(p, iFanin) );
|
||||
fprintf( pFile, " .%s(%s),", k==0 ? "mem_data_in" : (k==1 ? "addr_in": "data_in"), Wlc_ObjName(p, iFanin) );
|
||||
fprintf( pFile, " .%s(%s) ) ;\n", "data_out", Wlc_ObjName(p, i) );
|
||||
continue;
|
||||
}
|
||||
}
|
||||
else if ( pObj->Type == WLC_OBJ_FF )
|
||||
{
|
||||
char * pInNames[7] = {"d", "clk", "reset", "set", "enable", "async", "init"};
|
||||
char * pInNames[8] = {"d", "clk", "reset", "set", "enable", "async", "sre", "init"};
|
||||
fprintf( pFile, "%s ;\n", Wlc_ObjName(p, i) );
|
||||
fprintf( pFile, " " );
|
||||
fprintf( pFile, "%s (", "ABC_DFFRSE" );
|
||||
Wlc_ObjForEachFanin( pObj, iFanin, k )
|
||||
fprintf( pFile, " .%s(%s)", pInNames[k], Wlc_ObjName(p, iFanin) );
|
||||
fprintf( pFile, " .%s(%s),", pInNames[k], Wlc_ObjName(p, iFanin) );
|
||||
fprintf( pFile, " .%s(%s) ) ;\n", "q", Wlc_ObjName(p, i) );
|
||||
continue;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user