fix a bug when yosys constants are already declared

This commit is contained in:
MyskYko 2025-06-17 16:41:32 -07:00
parent 6463f11625
commit e9845e534a
1 changed files with 3 additions and 3 deletions

View File

@ -1565,19 +1565,19 @@ void Abc_NtkFixNonDrivenNets( Abc_Ntk_t * pNtk )
// special case // special case
pNet = Abc_NtkFindNet( pNtk, "$false" ); pNet = Abc_NtkFindNet( pNtk, "$false" );
if ( pNet != NULL ) if ( pNet != NULL && !Abc_ObjFaninNum(pNet) )
{ {
pNode = Abc_NtkCreateNodeConst0( pNtk ); pNode = Abc_NtkCreateNodeConst0( pNtk );
Abc_ObjAddFanin( pNet, pNode ); Abc_ObjAddFanin( pNet, pNode );
} }
pNet = Abc_NtkFindNet( pNtk, "$undef" ); pNet = Abc_NtkFindNet( pNtk, "$undef" );
if ( pNet != NULL ) if ( pNet != NULL && !Abc_ObjFaninNum(pNet) )
{ {
pNode = Abc_NtkCreateNodeConst0( pNtk ); pNode = Abc_NtkCreateNodeConst0( pNtk );
Abc_ObjAddFanin( pNet, pNode ); Abc_ObjAddFanin( pNet, pNode );
} }
pNet = Abc_NtkFindNet( pNtk, "$true" ); pNet = Abc_NtkFindNet( pNtk, "$true" );
if ( pNet != NULL ) if ( pNet != NULL && !Abc_ObjFaninNum(pNet) )
{ {
pNode = Abc_NtkCreateNodeConst1( pNtk ); pNode = Abc_NtkCreateNodeConst1( pNtk );
Abc_ObjAddFanin( pNet, pNode ); Abc_ObjAddFanin( pNet, pNode );