Commit 5f3e4c0f by Alan Mishchenko

Version abc70211

parent b9e0c95b
......@@ -454,6 +454,10 @@ SOURCE=.\src\base\io\ioReadPla.c
# End Source File
# Begin Source File
SOURCE=.\src\base\io\ioReadVerilog.c
# End Source File
# Begin Source File
SOURCE=.\src\base\io\ioUtil.c
# End Source File
# Begin Source File
......@@ -502,11 +506,7 @@ SOURCE=.\src\base\io\ioWritePla.c
# End Source File
# Begin Source File
SOURCE=.\src\base\io\ioWriteVer.c
# End Source File
# Begin Source File
SOURCE=.\src\base\io\ioWriteVerAux.c
SOURCE=.\src\base\io\ioWriteVerilog.c
# End Source File
# End Group
# Begin Group "main"
......
This diff is collapsed. Click to expand it.
......@@ -118,6 +118,8 @@ alias fflitmin "compress2rs; ren; sop; ps -f"
alias t0 "r res.blif; aig; mfs"
alias t "r res2.blif; aig; mfs"
alias tt "rh a/quip_opt/nut_002_opt.blif"
alias tt "rh a/quip_opt/nut_001_opt.blif"
alias ttb "wh a/quip_opt/nut_001_opt.blif 1.blif"
alias ttv "wh a/quip_opt/nut_001_opt.blif 1.v"
This diff is collapsed. Click to expand it.
<html>
<body>
<pre>
<h1>Build Log</h1>
<h3>
--------------------Configuration: abctestlib - Win32 Debug--------------------
</h3>
<h3>Command Lines</h3>
Creating temporary file "C:\DOCUME~1\alanmi\LOCALS~1\Temp\RSP1389.tmp" with contents
[
/nologo /MLd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /FR"Debug/" /Fp"Debug/abctestlib.pch" /YX /Fo"Debug/" /Fd"Debug/" /FD /GZ /c
"C:\_projects\abc\demo.c"
]
Creating command line "cl.exe @C:\DOCUME~1\alanmi\LOCALS~1\Temp\RSP1389.tmp"
Creating temporary file "C:\DOCUME~1\alanmi\LOCALS~1\Temp\RSP138A.tmp" with contents
[
kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib C:\_projects\abc\abclib\abclib_debug.lib /nologo /subsystem:console /incremental:yes /pdb:"Debug/abctestlib.pdb" /debug /machine:I386 /out:"_TEST/abctestlib.exe" /pdbtype:sept
.\Debug\demo.obj
]
Creating command line "link.exe @C:\DOCUME~1\alanmi\LOCALS~1\Temp\RSP138A.tmp"
<h3>Output Window</h3>
Compiling...
demo.c
Linking...
Creating command line "bscmake.exe /nologo /o"Debug/abctestlib.bsc" .\Debug\demo.sbr"
Creating browse info file...
<h3>Output Window</h3>
<h3>Results</h3>
abctestlib.exe - 0 error(s), 0 warning(s)
</pre>
</body>
</html>
......@@ -351,7 +351,7 @@ void Hop_ObjPrintVerilog( FILE * pFile, Hop_Obj_t * pObj, Vec_Vec_t * vLevels, i
// constant case
if ( Hop_ObjIsConst1(pObj) )
{
fprintf( pFile, "%d", !fCompl );
fprintf( pFile, "1\'b%d", !fCompl );
return;
}
// PI case
......
......@@ -140,6 +140,9 @@ bool Abc_NtkDoCheck( Abc_Ntk_t * pNtk )
if ( !Abc_NtkCheckPos( pNtk ) )
return 0;
if ( Abc_NtkHasBlackbox(pNtk) )
return 1;
// check the connectivity of objects
Abc_NtkForEachObj( pNtk, pObj, i )
if ( !Abc_NtkCheckObj( pNtk, pObj ) )
......@@ -236,23 +239,10 @@ bool Abc_NtkCheckNames( Abc_Ntk_t * pNtk )
Vec_Int_t * vNameIds;
char * pName;
int i, NameId;
/*
if ( Abc_NtkIsNetlist(pNtk) )
{
return 1;
// check that each net has a name
Abc_NtkForEachNet( pNtk, pObj, i )
{
if ( Nm_ManFindNameById(pObj->pNtk->pManName, pObj->Id) )
{
fprintf( stdout, "NetworkCheck: Net \"%s\" has different name in the name table and at the data pointer.\n", pObj->pData );
return 0;
}
}
}
else
*/
{
// check that each CI/CO has a name
Abc_NtkForEachCi( pNtk, pObj, i )
{
......@@ -272,7 +262,6 @@ bool Abc_NtkCheckNames( Abc_Ntk_t * pNtk )
return 0;
}
}
}
// return the array of all IDs, which have names
vNameIds = Nm_ManReturnNameIds( pNtk->pManName );
......
......@@ -265,7 +265,7 @@ Abc_Ntk_t * Abc_NtkConvertBlackboxes( Abc_Ntk_t * pNtk )
Abc_ObjForEachFanin( pObj, pTerm, k )
{
pNet = Abc_ObjFanin0(pTerm);
if ( pNet->pCopy )
if ( pNet->pCopy && !Abc_ObjIsCi(Abc_ObjFanin0(pNet)) )
{
Abc_NodeSetTravIdCurrent( pTerm );
continue;
......@@ -315,13 +315,14 @@ Abc_Ntk_t * Abc_NtkConvertBlackboxes( Abc_Ntk_t * pNtk )
***********************************************************************/
Abc_Ntk_t * Abc_NtkInsertNewLogic( Abc_Ntk_t * pNtkH, Abc_Ntk_t * pNtkL )
{
Abc_Lib_t * pDesign;
Abc_Ntk_t * pNtkNew;
Abc_Obj_t * pObjH, * pObjL, * pNetH, * pNetL, * pTermH;
int i, k;
assert( Abc_NtkIsNetlist(pNtkH) );
assert( Abc_NtkWhiteboxNum(pNtkH) == 0 );
assert( Abc_NtkBlackboxNum(pNtkL) > 0 );
assert( Abc_NtkBlackboxNum(pNtkH) > 0 );
assert( Abc_NtkIsNetlist(pNtkL) );
assert( Abc_NtkWhiteboxNum(pNtkL) == 0 );
......@@ -343,38 +344,73 @@ Abc_Ntk_t * Abc_NtkInsertNewLogic( Abc_Ntk_t * pNtkH, Abc_Ntk_t * pNtkL )
pNetL = Abc_NtkFindNet( pNtkL, Abc_ObjName(pNetH) );
if ( pNetL == NULL || !Abc_ObjIsPi( Abc_ObjFanin0(pNetL) ) )
{
printf( "There is no PI corresponding to the PI %s.\n", Abc_ObjName(pNetH) );
printf( "Error in Abc_NtkInsertNewLogic(): There is no PI corresponding to the PI %s.\n", Abc_ObjName(pNetH) );
Abc_NtkDelete( pNtkNew );
return NULL;
}
if ( pNetL->pCopy )
{
printf( "Error in Abc_NtkInsertNewLogic(): Primary input %s is repeated twice.\n", Abc_ObjName(pNetH) );
Abc_NtkDelete( pNtkNew );
return NULL;
}
// duplicate
// create the new net
pNetL->pCopy = Abc_NtkFindOrCreateNet( pNtkNew, Abc_ObjName(pNetH) );
Abc_NtkDupObj( pNtkNew, Abc_ObjFanin0(pNetL), 0 );
}
// make sure every BB has a PI/PO in the processed network
Abc_NtkForEachBlackbox( pNtkH, pObjH, i )
{
// duplicate the box
Abc_NtkDupBox( pNtkNew, pObjH, 0 );
pObjH->pCopy->pData = pObjH->pData;
// create PIs
Abc_ObjForEachFanout( pObjH, pTermH, k )
{
pNetH = Abc_ObjFanout0( pTermH );
pNetL = Abc_NtkFindNet( pNtkL, Abc_ObjName(pNetH) );
if ( pNetL == NULL || !Abc_ObjIsPi( Abc_ObjFanin0(pNetL) ) )
{
printf( "Error in Abc_NtkInsertNewLogic(): There is no PI corresponding to the inpout %s of blackbox %s.\n", Abc_ObjName(pNetH), Abc_ObjName(pObjH) );
Abc_NtkDelete( pNtkNew );
return NULL;
}
if ( pNetL->pCopy )
{
printf( "Error in Abc_NtkInsertNewLogic(): Box output %s is repeated twice.\n", Abc_ObjName(pNetH) );
Abc_NtkDelete( pNtkNew );
return NULL;
}
// create net and map the PI
pNetL->pCopy = Abc_NtkFindOrCreateNet( pNtkNew, Abc_ObjName(pNetH) );
Abc_ObjFanin0(pNetL)->pCopy = pTermH->pCopy;
}
}
Abc_NtkForEachPo( pNtkH, pObjH, i )
{
pNetH = Abc_ObjFanin0(pObjH);
pNetL = Abc_NtkFindNet( pNtkL, Abc_ObjName(pNetH) );
if ( pNetL == NULL || !Abc_ObjIsPo( Abc_ObjFanout0(pNetL) ) )
{
printf( "There is no PO corresponding to the PO %s.\n", Abc_ObjName(pNetH) );
printf( "Error in Abc_NtkInsertNewLogic(): There is no PO corresponding to the PO %s.\n", Abc_ObjName(pNetH) );
Abc_NtkDelete( pNtkNew );
return NULL;
}
// duplicate
if ( pNetL->pCopy )
continue;
// create the new net
pNetL->pCopy = Abc_NtkFindOrCreateNet( pNtkNew, Abc_ObjName(pNetH) );
Abc_NtkDupObj( pNtkNew, Abc_ObjFanout0(pNetL), 0 );
}
// make sure every BB has a PI/PO in the processed network
Abc_NtkForEachBlackbox( pNtkH, pObjH, i )
{
// duplicate the box
Abc_NtkDupObj( pNtkNew, pObjH, 1 );
// look and fanins/fanouts of the box
Abc_ObjForEachFanin( pObjH, pTermH, k )
{
char * pName;
pNetH = Abc_ObjFanin0( pTermH );
pName = Abc_ObjName(pNetH);
pNetL = Abc_NtkFindNet( pNtkL, Abc_ObjName(pNetH) );
if ( pNetL == NULL || !Abc_ObjIsPo( Abc_ObjFanout0(pNetL) ) )
{
......@@ -382,40 +418,40 @@ Abc_Ntk_t * Abc_NtkInsertNewLogic( Abc_Ntk_t * pNtkH, Abc_Ntk_t * pNtkL )
Abc_NtkDelete( pNtkNew );
return NULL;
}
// duplicate
pNetL->pCopy = Abc_NtkFindOrCreateNet( pNtkNew, Abc_ObjName(pNetH) );
Abc_NtkDupObj( pNtkNew, Abc_ObjFanout0(pNetL), 0 );
// connect
Abc_ObjAddFanin( pObjH->pCopy, Abc_ObjFanout0(pNetL)->pCopy );
}
Abc_ObjForEachFanout( pObjH, pTermH, k )
// create net and map the PO
if ( pNetL->pCopy )
{
pNetH = Abc_ObjFanout0( pTermH );
pNetL = Abc_NtkFindNet( pNtkL, Abc_ObjName(pNetH) );
if ( pNetL == NULL || !Abc_ObjIsPi( Abc_ObjFanin0(pNetL) ) )
{
printf( "There is no PI corresponding to the inpout %s of blackbox %s.\n", Abc_ObjName(pNetH), Abc_ObjName(pObjH) );
Abc_NtkDelete( pNtkNew );
return NULL;
if ( Abc_ObjFanout0(pNetL)->pCopy == NULL )
Abc_ObjFanout0(pNetL)->pCopy = pTermH->pCopy;
else
Abc_ObjAddFanin( pTermH->pCopy, pNetL->pCopy );
continue;
}
// duplicate
pNetL->pCopy = Abc_NtkFindOrCreateNet( pNtkNew, Abc_ObjName(pNetH) );
Abc_NtkDupObj( pNtkNew, Abc_ObjFanin0(pNetL), 0 );
// connect
Abc_ObjAddFanin( Abc_ObjFanin0(pNetL)->pCopy, pObjH->pCopy );
Abc_ObjFanout0(pNetL)->pCopy = pTermH->pCopy;
}
}
// duplicate other objects of the logic network
Abc_NtkForEachObj( pNtkL, pObjL, i )
if ( pObjL->pCopy )
Abc_NtkDupObj( pNtkNew, pObjL, 0 );
if ( pObjL->pCopy == NULL && !Abc_ObjIsPo(pObjL) ) // skip POs feeding into PIs
Abc_NtkDupObj( pNtkNew, pObjL, Abc_ObjIsNet(pObjL) );
// connect objects
Abc_NtkForEachObj( pNtkL, pObjL, i )
Abc_ObjForEachFanin( pObjL, pNetL, k )
if ( pObjL->pCopy )
Abc_ObjAddFanin( pObjL->pCopy, pNetL->pCopy );
// transfer the design
pDesign = pNtkH->pDesign; pNtkH->pDesign = NULL;
assert( Vec_PtrEntry( pDesign->vModules, 0 ) == pNtkH );
Vec_PtrWriteEntry( pDesign->vModules, 0, pNtkNew );
pNtkNew->pDesign = pDesign;
//Abc_NtkPrintStats( stdout, pNtkH, 0 );
//Abc_NtkPrintStats( stdout, pNtkNew, 0 );
// check integrity
if ( !Abc_NtkCheck( pNtkNew ) )
{
......
......@@ -329,7 +329,15 @@ Abc_Obj_t * Abc_NtkDupObj( Abc_Ntk_t * pNtkNew, Abc_Obj_t * pObj, int fCopyName
else if ( Abc_ObjIsCo(pObj) )
{
if ( !Abc_NtkIsNetlist(pNtkNew) )
{
if ( Abc_ObjIsPo(pObj) )
Abc_ObjAssignName( pObjNew, Abc_ObjName(Abc_ObjFanin0Ntk(pObj)), NULL );
else
{
assert( Abc_ObjIsLatch(Abc_ObjFanout0(pObj)) );
Abc_ObjAssignName( pObjNew, Abc_ObjName(pObj), NULL );
}
}
}
else if ( Abc_ObjIsBox(pObj) || Abc_ObjIsNet(pObj) )
Abc_ObjAssignName( pObjNew, Abc_ObjName(pObj), NULL );
......
......@@ -62,7 +62,8 @@ void Abc_NtkPrintStats( FILE * pFile, Abc_Ntk_t * pNtk, int fFactored )
{
fprintf( pFile, " net = %5d", Abc_NtkNetNum(pNtk) );
fprintf( pFile, " nd = %5d", Abc_NtkNodeNum(pNtk) );
fprintf( pFile, " box = %5d", Abc_NtkBoxNum(pNtk) );
fprintf( pFile, " wbox = %3d", Abc_NtkWhiteboxNum(pNtk) );
fprintf( pFile, " bbox = %3d", Abc_NtkBlackboxNum(pNtk) );
}
else if ( Abc_NtkIsStrash(pNtk) )
{
......
......@@ -85,7 +85,7 @@ void Io_Init( Abc_Frame_t * pAbc )
Cmd_CommandAdd( pAbc, "I/O", "read_eqn", IoCommandReadEqn, 1 );
Cmd_CommandAdd( pAbc, "I/O", "read_pla", IoCommandReadPla, 1 );
Cmd_CommandAdd( pAbc, "I/O", "read_truth", IoCommandReadTruth, 1 );
// Cmd_CommandAdd( pAbc, "I/O", "read_verilog", IoCommandReadVerilog, 1 );
Cmd_CommandAdd( pAbc, "I/O", "read_verilog", IoCommandReadVerilog, 1 );
// Cmd_CommandAdd( pAbc, "I/O", "read_ver", IoCommandReadVer, 1 );
// Cmd_CommandAdd( pAbc, "I/O", "read_verlib", IoCommandReadVerLib, 0 );
......@@ -103,7 +103,7 @@ void Io_Init( Abc_Frame_t * pAbc )
Cmd_CommandAdd( pAbc, "I/O", "write_gml", IoCommandWriteGml, 0 );
// Cmd_CommandAdd( pAbc, "I/O", "write_list", IoCommandWriteList, 0 );
Cmd_CommandAdd( pAbc, "I/O", "write_pla", IoCommandWritePla, 0 );
// Cmd_CommandAdd( pAbc, "I/O", "write_verilog", IoCommandWriteVerilog, 0 );
Cmd_CommandAdd( pAbc, "I/O", "write_verilog", IoCommandWriteVerilog, 0 );
// Cmd_CommandAdd( pAbc, "I/O", "write_verlib", IoCommandWriteVerLib, 0 );
}
......@@ -995,7 +995,7 @@ int IoCommandWriteHie( Abc_Frame_t * pAbc, int argc, char **argv )
pFileName = argv[globalUtilOptind+1];
// call the corresponding file writer
// Io_Write( pAbc->pNtkCur, pFileName, Io_ReadFileType(pFileName) );
Io_WriteHie( pAbc->pNtkCur, pFileName, Io_ReadFileType(pFileName), pBaseName );
Io_WriteHie( pAbc->pNtkCur, pBaseName, pFileName );
return 0;
usage:
......
......@@ -82,10 +82,10 @@ extern Abc_Ntk_t * Io_ReadBench( char * pFileName, int fCheck );
extern Abc_Ntk_t * Io_ReadEdif( char * pFileName, int fCheck );
/*=== abcReadEqn.c ============================================================*/
extern Abc_Ntk_t * Io_ReadEqn( char * pFileName, int fCheck );
/*=== abcReadVerilog.c ========================================================*/
extern Abc_Ntk_t * Io_ReadVerilog( char * pFileName, int fCheck );
/*=== abcReadPla.c ============================================================*/
extern Abc_Ntk_t * Io_ReadPla( char * pFileName, int fCheck );
/*=== abcReadVerilog.c ========================================================*/
extern Abc_Ntk_t * Io_ReadVerilog( char * pFileName, int fCheck );
/*=== abcWriteAiger.c =========================================================*/
extern void Io_WriteAiger( Abc_Ntk_t * pNtk, char * pFileName );
/*=== abcWriteBaf.c ===========================================================*/
......@@ -114,14 +114,14 @@ extern void Io_WriteList( Abc_Ntk_t * pNtk, char * pFileName, int
/*=== abcWritePla.c ===========================================================*/
extern int Io_WritePla( Abc_Ntk_t * pNtk, char * FileName );
/*=== abcWriteVerilog.c =======================================================*/
extern void Io_WriteVerilog( Abc_Ntk_t * pNtk, char * FileName, int fVerLibStyle );
extern void Io_WriteVerilog( Abc_Ntk_t * pNtk, char * FileName );
/*=== abcUtil.c ===============================================================*/
extern Io_FileType_t Io_ReadFileType( char * pFileName );
extern Abc_Ntk_t * Io_ReadNetlist( char * pFileName, Io_FileType_t FileType, int fCheck );
extern Abc_Ntk_t * Io_Read( char * pFileName, Io_FileType_t FileType, int fCheck );
extern Abc_Ntk_t * Io_ReadHie( char * pFileName, Io_FileType_t FileType, int fCheck );
extern void Io_Write( Abc_Ntk_t * pNtk, char * pFileName, Io_FileType_t FileType );
extern void Io_WriteHie( Abc_Ntk_t * pNtk, char * pFileName, Io_FileType_t FileType, char * pBaseName );
extern void Io_WriteHie( Abc_Ntk_t * pNtk, char * pBaseName, char * pFileName );
extern Abc_Obj_t * Io_ReadCreatePi( Abc_Ntk_t * pNtk, char * pName );
extern Abc_Obj_t * Io_ReadCreatePo( Abc_Ntk_t * pNtk, char * pName );
extern Abc_Obj_t * Io_ReadCreateAssert( Abc_Ntk_t * pNtk, char * pName );
......
......@@ -132,6 +132,8 @@ Abc_Ntk_t * Io_ReadNetlist( char * pFileName, Io_FileType_t FileType, int fCheck
pNtk = Io_ReadEqn( pFileName, fCheck );
else if ( FileType == IO_FILE_PLA )
pNtk = Io_ReadPla( pFileName, fCheck );
else if ( FileType == IO_FILE_VERILOG )
pNtk = Io_ReadVerilog( pFileName, fCheck );
else
{
fprintf( stderr, "Unknown file format.\n" );
......@@ -142,6 +144,12 @@ Abc_Ntk_t * Io_ReadNetlist( char * pFileName, Io_FileType_t FileType, int fCheck
fprintf( stdout, "Reading network from file has failed.\n" );
return NULL;
}
if ( Abc_NtkBlackboxNum(pNtk) || Abc_NtkBlackboxNum(pNtk) )
{
fprintf( stdout, "The network contains hierarchy. Use \"read_hie\".\n" );
Abc_NtkDelete( pNtk );
return NULL;
}
return pNtk;
}
......@@ -197,6 +205,8 @@ Abc_Ntk_t * Io_ReadHie( char * pFileName, Io_FileType_t FileType, int fCheck )
pNtk = Io_ReadBlifMv( pFileName, 0, fCheck );
// else if ( Io_ReadFileType(pFileName) == IO_FILE_BLIFMV )
// pNtk = Io_ReadBlifMv( pFileName, 1, fCheck );
else if ( Io_ReadFileType(pFileName) == IO_FILE_VERILOG )
pNtk = Io_ReadVerilog( pFileName, fCheck );
else
{
printf( "Wrong file type.\n" );
......@@ -220,7 +230,7 @@ Abc_Ntk_t * Io_ReadHie( char * pFileName, Io_FileType_t FileType, int fCheck )
// convert blackboxes
if ( Abc_NtkBlackboxNum(pNtk) > 0 )
{
printf( "Hierarchical parser is converting %d blackboxes.\n", Abc_NtkBlackboxNum(pNtk) );
printf( "Hierarchical parser converted %d blackboxes.\n", Abc_NtkBlackboxNum(pNtk) );
pNtk = Abc_NtkConvertBlackboxes( pTemp = pNtk );
Abc_NtkDelete( pTemp );
if ( pNtk == NULL )
......@@ -347,7 +357,7 @@ void Io_Write( Abc_Ntk_t * pNtk, char * pFileName, Io_FileType_t FileType )
{
if ( Abc_NtkIsSopNetlist(pNtkTemp) )
Abc_NtkSopToAig( pNtkTemp );
Io_WriteVerilog( pNtkTemp, pFileName, 1 );
Io_WriteVerilog( pNtkTemp, pFileName );
}
else
fprintf( stderr, "Unknown file format.\n" );
......@@ -365,36 +375,41 @@ void Io_Write( Abc_Ntk_t * pNtk, char * pFileName, Io_FileType_t FileType )
SeeAlso []
***********************************************************************/
void Io_WriteHie( Abc_Ntk_t * pNtk, char * pFileName, Io_FileType_t FileType, char * pBaseName )
void Io_WriteHie( Abc_Ntk_t * pNtk, char * pBaseName, char * pFileName )
{
Abc_Ntk_t * pNtkTemp, * pNtkBase, * pNtkResult;
Abc_Ntk_t * pNtkTemp, * pNtkResult, * pNtkBase = NULL;
// check if the current network is available
if ( pNtk == NULL )
{
fprintf( stdout, "Empty network.\n" );
return;
}
// check if the file extension if given
if ( FileType == IO_FILE_NONE || FileType == IO_FILE_UNKNOWN )
{
fprintf( stdout, "The generic file writer requires a known file extension.\n" );
return;
}
// write the AIG formats
if ( FileType == IO_FILE_BLIF )
{
// read the base network
assert( Abc_NtkIsStrash(pNtk) || Abc_NtkIsLogic(pNtk) );
if ( Io_ReadFileType(pBaseName) == IO_FILE_BLIF )
pNtkBase = Io_ReadBlifMv( pBaseName, 0, 1 );
if ( Abc_NtkWhiteboxNum(pNtk) > 0 )
else
fprintf( stderr, "Unknown input file format.\n" );
if ( pNtkBase == NULL )
return;
if ( Abc_NtkWhiteboxNum(pNtkBase) > 0 )
{
pNtkBase = Abc_NtkFlattenLogicHierarchy( pNtkTemp = pNtkBase );
if ( pNtkBase == NULL )
return;
Abc_NtkDelete( pNtkTemp );
}
if ( Abc_NtkBlackboxNum(pNtk) > 0 )
// reintroduce the boxes into the netlist
if ( Abc_NtkBlackboxNum(pNtkBase) > 0 )
{
pNtkResult = Abc_NtkLogicToNetlist( pNtk, 0 );
pNtkResult = Abc_NtkInsertNewLogic( pNtkBase, pNtkTemp = pNtkResult );
Abc_NtkDelete( pNtkTemp );
printf( "Hierarchy writer reintroduced %d blackboxes.\n", Abc_NtkBlackboxNum(pNtk) );
if ( pNtkResult )
printf( "Hierarchy writer reintroduced %d blackboxes.\n", Abc_NtkBlackboxNum(pNtkBase) );
}
else
{
......@@ -404,11 +419,20 @@ void Io_WriteHie( Abc_Ntk_t * pNtk, char * pFileName, Io_FileType_t FileType, ch
Abc_NtkDelete( pNtkBase );
if ( pNtkResult == NULL )
return;
Io_WriteBlif( pNtkResult, pFileName, 0 );
Abc_NtkDelete( pNtkResult );
// write the resulting network
if ( Io_ReadFileType(pFileName) == IO_FILE_BLIF )
Io_WriteBlif( pNtkResult, pFileName, 1 );
else if ( Io_ReadFileType(pFileName) == IO_FILE_VERILOG )
{
if ( Abc_NtkIsSopNetlist(pNtkResult) )
Abc_NtkSopToAig( pNtkResult );
Io_WriteVerilog( pNtkResult, pFileName );
}
else
fprintf( stderr, "Unknown file format.\n" );
fprintf( stderr, "Unknown output file format.\n" );
Abc_NtkDelete( pNtkResult );
}
/**Function*************************************************************
......
......@@ -102,6 +102,7 @@ void Io_WriteBlif( Abc_Ntk_t * pNtk, char * FileName, int fWriteLatches )
{
pNtkTemp = pObj->pData;
assert( pNtkTemp != NULL && Abc_NtkHasBlackbox(pNtkTemp) );
fprintf( pFile, "\n\n", Abc_NtkName(pNtk) );
Io_NtkWrite( pFile, pNtkTemp, fWriteLatches );
}
}
......
......@@ -8,6 +8,7 @@ SRC += src/base/io/io.c \
src/base/io/ioReadEdif.c \
src/base/io/ioReadEqn.c \
src/base/io/ioReadPla.c \
src/base/io/ioReadVerilog.c \
src/base/io/ioUtil.c \
src/base/io/ioWriteAiger.c \
src/base/io/ioWriteBaf.c \
......@@ -20,5 +21,4 @@ SRC += src/base/io/io.c \
src/base/io/ioWriteGml.c \
src/base/io/ioWriteList.c \
src/base/io/ioWritePla.c \
src/base/io/ioWriteVer.c \
src/base/io/ioWriteVerAux.c
src/base/io/ioWriteVerilog.c
......@@ -48,6 +48,7 @@ struct Ver_Man_t_
// input file stream
char * pFileName;
Ver_Stream_t * pReader;
int fNameLast;
ProgressBar * pProgress;
// current network and library
Abc_Ntk_t * pNtkCur; // the network under construction
......
......@@ -83,6 +83,11 @@ void * Ver_FormulaParser( char * pFormula, void * pMan, Vec_Ptr_t * vNames, Vec_
Vec_PtrClear( vStackFn );
Vec_IntClear( vStackOp );
if ( !strcmp(pFormula, "0") || !strcmp(pFormula, "1\'b0") )
return Hop_ManConst0(pMan);
if ( !strcmp(pFormula, "1") || !strcmp(pFormula, "1\'b1") )
return Hop_ManConst1(pMan);
// make sure that the number of opening and closing parantheses is the same
nParans = 0;
for ( pTemp = pFormula; *pTemp; pTemp++ )
......
......@@ -90,6 +90,7 @@ char * Ver_ParseGetName( Ver_Man_t * pMan )
Ver_Stream_t * p = pMan->pReader;
char Symbol;
char * pWord;
pMan->fNameLast = 0;
if ( !Ver_StreamIsOkey(p) )
return NULL;
if ( !Ver_ParseSkipComments( pMan ) )
......@@ -97,6 +98,7 @@ char * Ver_ParseGetName( Ver_Man_t * pMan )
Symbol = Ver_StreamScanChar( p );
if ( Symbol == '\\' )
{
pMan->fNameLast = 1;
Ver_StreamPopChar( p );
pWord = Ver_StreamGetWord( p, " " );
}
......
......@@ -279,6 +279,9 @@ char Ver_StreamPopChar( Ver_Stream_t * p )
p->fStop = 1;
return -1;
}
// count the lines
if ( *p->pBufferCur == '\n' )
p->nLineCounter++;
return *p->pBufferCur++;
}
......@@ -359,6 +362,9 @@ void Ver_StreamSkipToChars( Ver_Stream_t * p, char * pCharsToStop )
if ( *pTemp == 0 ) // pChar is not found in the list
continue;
// the symbol is found - move position and return
if ( *pChar == '\n' )
p->nLineCounter--;
// update buffer
p->pBufferCur = pChar;
return;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment