ABC: A System for Sequential Synthesis and Verification
 
Loading...
Searching...
No Matches
ioWriteBench.c File Reference
#include "ioAbc.h"
Include dependency graph for ioWriteBench.c:

Go to the source code of this file.

Functions

int Io_WriteBench (Abc_Ntk_t *pNtk, const char *pFileName)
 FUNCTION DEFINITIONS ///.
 
int Io_WriteBenchLut (Abc_Ntk_t *pNtk, char *pFileName)
 

Function Documentation

◆ Io_WriteBench()

int Io_WriteBench ( Abc_Ntk_t * pNtk,
const char * pFileName )

FUNCTION DEFINITIONS ///.

Function*************************************************************

Synopsis [Writes the network in BENCH format.]

Description []

SideEffects []

SeeAlso []

Definition at line 53 of file ioWriteBench.c.

54{
55 Abc_Ntk_t * pExdc;
56 FILE * pFile;
57 assert( Abc_NtkIsSopNetlist(pNtk) );
58 if ( !Io_WriteBenchCheckNames(pNtk) )
59 {
60 fprintf( stdout, "Io_WriteBench(): Signal names in this benchmark contain parentheses making them impossible to reproduce in the BENCH format. Use \"short_names\".\n" );
61 return 0;
62 }
63 pFile = fopen( pFileName, "w" );
64 if ( pFile == NULL )
65 {
66 fprintf( stdout, "Io_WriteBench(): Cannot open the output file.\n" );
67 return 0;
68 }
69 fprintf( pFile, "# Benchmark \"%s\" written by ABC on %s\n", pNtk->pName, Extra_TimeStamp() );
70 // write the network
71 Io_WriteBenchOne( pFile, pNtk );
72 // write EXDC network if it exists
73 pExdc = Abc_NtkExdc( pNtk );
74 if ( pExdc )
75 printf( "Io_WriteBench: EXDC is not written (warning).\n" );
76 // finalize the file
77 fclose( pFile );
78 return 1;
79}
struct Abc_Ntk_t_ Abc_Ntk_t
Definition abc.h:115
char * Extra_TimeStamp()
char * pName
Definition abc.h:158
#define assert(ex)
Definition util_old.h:213
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Io_WriteBenchLut()

int Io_WriteBenchLut ( Abc_Ntk_t * pNtk,
char * pFileName )

Function*************************************************************

Synopsis [Writes the network in BENCH format with LUTs and DFFRSE.]

Description []

SideEffects []

SeeAlso []

Definition at line 175 of file ioWriteBench.c.

176{
177 Abc_Ntk_t * pExdc;
178 FILE * pFile;
179 assert( Abc_NtkIsAigNetlist(pNtk) );
180 if ( !Io_WriteBenchCheckNames(pNtk) )
181 {
182 fprintf( stdout, "Io_WriteBenchLut(): Signal names in this benchmark contain parentheses making them impossible to reproduce in the BENCH format. Use \"short_names\".\n" );
183 return 0;
184 }
185 pFile = fopen( pFileName, "w" );
186 if ( pFile == NULL )
187 {
188 fprintf( stdout, "Io_WriteBench(): Cannot open the output file.\n" );
189 return 0;
190 }
191 fprintf( pFile, "# Benchmark \"%s\" written by ABC on %s\n", pNtk->pName, Extra_TimeStamp() );
192 // write the network
193 Io_WriteBenchLutOne( pFile, pNtk );
194 // write EXDC network if it exists
195 pExdc = Abc_NtkExdc( pNtk );
196 if ( pExdc )
197 printf( "Io_WriteBench: EXDC is not written (warning).\n" );
198 // finalize the file
199 fclose( pFile );
200 return 1;
201}
Here is the call graph for this function: