summaryrefslogtreecommitdiffstats
path: root/src/base/io/ioWritePla.c
diff options
context:
space:
mode:
authorAlan Mishchenko <alanmi@berkeley.edu>2006-03-03 08:01:00 -0800
committerAlan Mishchenko <alanmi@berkeley.edu>2006-03-03 08:01:00 -0800
commit0e57e953062cd2d97573d8428f6f77853ba8535e (patch)
tree44eb008801aae04cd834aa0c02efd6cdd67a64b5 /src/base/io/ioWritePla.c
parent9e6f8406e80c55455c464b01033040a88fd12c40 (diff)
downloadabc-0e57e953062cd2d97573d8428f6f77853ba8535e.tar.gz
abc-0e57e953062cd2d97573d8428f6f77853ba8535e.tar.bz2
abc-0e57e953062cd2d97573d8428f6f77853ba8535e.zip
Version abc60303
Diffstat (limited to 'src/base/io/ioWritePla.c')
-rw-r--r--src/base/io/ioWritePla.c19
1 files changed, 17 insertions, 2 deletions
diff --git a/src/base/io/ioWritePla.c b/src/base/io/ioWritePla.c
index 12ac9ef7..4da8aca8 100644
--- a/src/base/io/ioWritePla.c
+++ b/src/base/io/ioWritePla.c
@@ -88,7 +88,7 @@ int Io_WritePlaOne( FILE * pFile, Abc_Ntk_t * pNtk )
nProducts = 0;
Abc_NtkForEachCo( pNtk, pNode, i )
{
- pDriver = Abc_ObjFanin0Ntk(pNode);
+ pDriver = Abc_ObjFanin0Ntk( Abc_ObjFanin0(pNode) );
if ( !Abc_ObjIsNode(pDriver) )
{
nProducts++;
@@ -138,9 +138,10 @@ int Io_WritePlaOne( FILE * pFile, Abc_Ntk_t * pNtk )
pCubeOut[i] = '1';
// consider special cases of nodes
- pDriver = Abc_ObjFanin0Ntk(pNode);
+ pDriver = Abc_ObjFanin0Ntk( Abc_ObjFanin0(pNode) );
if ( !Abc_ObjIsNode(pDriver) )
{
+ assert( Abc_ObjIsCi(pDriver) );
pCubeIn[(int)pDriver->pCopy] = '1' - Abc_ObjFaninC0(pNode);
fprintf( pFile, "%s %s\n", pCubeIn, pCubeOut );
pCubeIn[(int)pDriver->pCopy] = '-';
@@ -152,17 +153,29 @@ int Io_WritePlaOne( FILE * pFile, Abc_Ntk_t * pNtk )
fprintf( pFile, "%s %s\n", pCubeIn, pCubeOut );
continue;
}
+
+ // make sure the cover is not complemented
+ assert( !Abc_SopIsComplement( pDriver->pData ) );
+
// write the cubes
nFanins = Abc_ObjFaninNum(pDriver);
Abc_SopForEachCube( pDriver->pData, nFanins, pCube )
{
Abc_ObjForEachFanin( pDriver, pFanin, k )
+ {
+ pFanin = Abc_ObjFanin0Ntk(pFanin);
+ assert( (int)pFanin->pCopy < nInputs );
pCubeIn[(int)pFanin->pCopy] = pCube[k];
+ }
fprintf( pFile, "%s %s\n", pCubeIn, pCubeOut );
}
// clean the cube for future writing
Abc_ObjForEachFanin( pDriver, pFanin, k )
+ {
+ pFanin = Abc_ObjFanin0Ntk(pFanin);
+ assert( Abc_ObjIsCi(pFanin) );
pCubeIn[(int)pFanin->pCopy] = '-';
+ }
Extra_ProgressBarUpdate( pProgress, i, NULL );
}
Extra_ProgressBarStop( pProgress );
@@ -171,6 +184,8 @@ int Io_WritePlaOne( FILE * pFile, Abc_Ntk_t * pNtk )
// clean the CI nodes
Abc_NtkForEachCi( pNtk, pNode, i )
pNode->pCopy = NULL;
+ free( pCubeIn );
+ free( pCubeOut );
return 1;
}