ABC: A System for Sequential Synthesis and Verification
 
Loading...
Searching...
No Matches
ioReadBlifAig.c File Reference
#include "base/abc/abc.h"
#include "misc/vec/vecPtr.h"
Include dependency graph for ioReadBlifAig.c:

Go to the source code of this file.

Classes

struct  Io_BlifObj_t_
 
struct  Io_BlifMan_t_
 

Typedefs

typedef struct Io_BlifObj_t_ Io_BlifObj_t
 
typedef struct Io_BlifMan_t_ Io_BlifMan_t
 

Enumerations

enum  Io_BlifInit_t { IO_BLIF_INIT_NONE = 0 , IO_BLIF_INIT_ZERO , IO_BLIF_INIT_ONE , IO_BLIF_INIT_DC }
 DECLARATIONS ///. More...
 

Functions

Abc_Ntk_tIo_ReadBlifAsAig (char *pFileName, int fCheck)
 FUNCTION DEFINITIONS ///.
 

Typedef Documentation

◆ Io_BlifMan_t

typedef struct Io_BlifMan_t_ Io_BlifMan_t

Definition at line 55 of file ioReadBlifAig.c.

◆ Io_BlifObj_t

typedef struct Io_BlifObj_t_ Io_BlifObj_t

Definition at line 39 of file ioReadBlifAig.c.

Enumeration Type Documentation

◆ Io_BlifInit_t

DECLARATIONS ///.

CFile****************************************************************

FileName [ioReadBlifAig.c]

SystemName [ABC: Logic synthesis and verification system.]

PackageName [Command processing package.]

Synopsis [Procedures to read BLIF file into AIG.]

Author [Alan Mishchenko]

Affiliation [UC Berkeley]

Date [Ver. 1.0. Started - December 23, 2006.]

Revision [

Id
ioReadBlifAig.c,v 1.00 2006/12/23 00:00:00 alanmi Exp

]

Enumerator
IO_BLIF_INIT_NONE 
IO_BLIF_INIT_ZERO 
IO_BLIF_INIT_ONE 
IO_BLIF_INIT_DC 

Definition at line 32 of file ioReadBlifAig.c.

32 {
33 IO_BLIF_INIT_NONE = 0, // 0: unknown
34 IO_BLIF_INIT_ZERO, // 1: zero
35 IO_BLIF_INIT_ONE, // 2: one
36 IO_BLIF_INIT_DC // 3: don't-care
Io_BlifInit_t
DECLARATIONS ///.
@ IO_BLIF_INIT_ZERO
@ IO_BLIF_INIT_DC
@ IO_BLIF_INIT_ONE
@ IO_BLIF_INIT_NONE

Function Documentation

◆ Io_ReadBlifAsAig()

Abc_Ntk_t * Io_ReadBlifAsAig ( char * pFileName,
int fCheck )

FUNCTION DEFINITIONS ///.

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

Synopsis [Reads the network from the BLIF file as an AIG.]

Description []

SideEffects []

SeeAlso []

Definition at line 118 of file ioReadBlifAig.c.

119{
120 FILE * pFile;
121 Io_BlifMan_t * p;
122 Abc_Ntk_t * pAig;
123
124 // check that the file is available
125 pFile = fopen( pFileName, "rb" );
126 if ( pFile == NULL )
127 {
128 printf( "Io_Blif(): The file is unavailable (absent or open).\n" );
129 return 0;
130 }
131 fclose( pFile );
132
133 // start the file reader
134 p = Io_BlifAlloc();
135 p->pFileName = pFileName;
136 p->pBuffer = Io_BlifLoadFile( pFileName );
137 if ( p->pBuffer == NULL )
138 {
139 Io_BlifFree( p );
140 return NULL;
141 }
142 // prepare the file for parsing
143 Io_BlifReadPreparse( p );
144 // construct the network
145 pAig = Io_BlifParse( p );
146 if ( p->sError[0] )
147 fprintf( stdout, "%s\n", p->sError );
148 if ( pAig == NULL )
149 return NULL;
150 Io_BlifFree( p );
151
152 // make sure that everything is okay with the network structure
153 if ( fCheck && !Abc_NtkCheckRead( pAig ) )
154 {
155 printf( "Io_Blif: The network check has failed.\n" );
156 Abc_NtkDelete( pAig );
157 return NULL;
158 }
159 return pAig;
160}
ABC_DLL int Abc_NtkCheckRead(Abc_Ntk_t *pNtk)
Definition abcCheck.c:80
struct Abc_Ntk_t_ Abc_Ntk_t
Definition abc.h:115
ABC_DLL void Abc_NtkDelete(Abc_Ntk_t *pNtk)
Definition abcNtk.c:1421
Cube * p
Definition exorList.c:222
struct Io_BlifMan_t_ Io_BlifMan_t
Here is the call graph for this function: