mirror of https://github.com/YosysHQ/abc.git
Bug fix in SMT parser.
This commit is contained in:
parent
44550a67fa
commit
7f3842e186
|
|
@ -648,6 +648,12 @@ int Smt_PrsBuildNode( Wlc_Ntk_t * pNtk, Smt_Prs_t * p, int iNode, int RangeOut,
|
||||||
// s3087
|
// s3087
|
||||||
int fFound, iObj = Abc_NamStrFindOrAdd( pNtk->pManName, pStr, &fFound );
|
int fFound, iObj = Abc_NamStrFindOrAdd( pNtk->pManName, pStr, &fFound );
|
||||||
assert( fFound );
|
assert( fFound );
|
||||||
|
// create buffer if the name of the fanin has different name
|
||||||
|
if ( pName && strcmp(pStr, pName) )
|
||||||
|
{
|
||||||
|
Vec_IntFill( &p->vTempFans, 1, iObj );
|
||||||
|
iObj = Smt_PrsCreateNode( pNtk, WLC_OBJ_BUF, 0, RangeOut, &p->vTempFans, pName );
|
||||||
|
}
|
||||||
return iObj;
|
return iObj;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -1192,7 +1198,7 @@ Wlc_Ntk_t * Smt_PrsBuild2( Smt_Prs_t * p )
|
||||||
Vec_Int_t * vFansRoot, * vFans, * vFans2;
|
Vec_Int_t * vFansRoot, * vFans, * vFans2;
|
||||||
Vec_Int_t * vAsserts = Vec_IntAlloc(100);
|
Vec_Int_t * vAsserts = Vec_IntAlloc(100);
|
||||||
int i, Root, Fan, iObj, NameId, Range, Status, nBits = 0;
|
int i, Root, Fan, iObj, NameId, Range, Status, nBits = 0;
|
||||||
char * pName, * pRange, * pValue;
|
char * pName, * pRange;
|
||||||
// start network and create primary inputs
|
// start network and create primary inputs
|
||||||
pNtk = Wlc_NtkAlloc( p->pName, 1000 );
|
pNtk = Wlc_NtkAlloc( p->pName, 1000 );
|
||||||
pNtk->pManName = Abc_NamStart( 1000, 24 );
|
pNtk->pManName = Abc_NamStart( 1000, 24 );
|
||||||
|
|
@ -1272,27 +1278,13 @@ Wlc_Ntk_t * Smt_PrsBuild2( Smt_Prs_t * p )
|
||||||
{
|
{
|
||||||
// (define-fun s_2 () Bool false)
|
// (define-fun s_2 () Bool false)
|
||||||
assert( !strcmp("Bool", Smt_VecEntryName(p, vFans, 3)) );
|
assert( !strcmp("Bool", Smt_VecEntryName(p, vFans, 3)) );
|
||||||
Range = 1;
|
iObj = Smt_PrsBuild2_rec( pNtk, p, Vec_IntEntry(vFans, 4), -1, pName );
|
||||||
pValue = Smt_VecEntryName(p, vFans, 4);
|
if ( iObj == 0 )
|
||||||
if ( pValue != NULL )
|
|
||||||
{
|
{
|
||||||
if ( !strcmp("false", pValue) )
|
Wlc_NtkFree( pNtk ); pNtk = NULL;
|
||||||
pValue = "#b0";
|
goto finish;
|
||||||
else if ( !strcmp("true", pValue) )
|
|
||||||
pValue = "#b1";
|
|
||||||
else assert( 0 );
|
|
||||||
Status = Smt_PrsBuildConstant( pNtk, pValue, Range, pName );
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
iObj = Smt_PrsBuild2_rec( pNtk, p, Vec_IntEntry(vFans, 4), -1, pName );
|
|
||||||
if ( iObj == 0 )
|
|
||||||
{
|
|
||||||
Wlc_NtkFree( pNtk ); pNtk = NULL;
|
|
||||||
goto finish;
|
|
||||||
}
|
|
||||||
continue;
|
|
||||||
}
|
}
|
||||||
|
continue;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue