abc-master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
ioWriteBblif.c File Reference
#include "ioAbc.h"
#include "misc/bbl/bblif.h"

Go to the source code of this file.

Functions

ABC_NAMESPACE_IMPL_START
Bbl_Man_t
Bbl_ManFromAbc (Abc_Ntk_t *pNtk)
 DECLARATIONS ///. More...
 
void Io_WriteBblif (Abc_Ntk_t *pNtk, char *pFileName)
 

Function Documentation

ABC_NAMESPACE_IMPL_START Bbl_Man_t* Bbl_ManFromAbc ( Abc_Ntk_t pNtk)

DECLARATIONS ///.

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

FileName [ioWriteBblif.c]

SystemName [ABC: Logic synthesis and verification system.]

PackageName [Command processing package.]

Synopsis [Procedures to write AIG in the binary format.]

Author [Alan Mishchenko]

Affiliation [UC Berkeley]

Date [Ver. 1.0. Started - June 20, 2005.]

Revision [

Id:
ioWriteBblif.c,v 1.00 2005/06/20 00:00:00 alanmi Exp

]FUNCTION DEFINITIONS /// Fnction*************************************************************

Synopsis [Construct manager from the ABC network.]

Description [In the ABC network each object has a unique integer ID. This ID is used when we construct objects of the BBLIF manager corresponding to each object of the ABC network. The objects can be added to the manager in any order (although below they are added in the topological order), but by the time fanin/fanout connections are created, corresponding objects are already constructed. In the end the checking procedure is called.]

SideEffects []

SeeAlso []

Definition at line 54 of file ioWriteBblif.c.

55 {
56  Bbl_Man_t * p;
57  Vec_Ptr_t * vNodes;
58  Abc_Obj_t * pObj, * pFanin;
59  int i, k;
60  assert( Abc_NtkIsSopLogic(pNtk) );
61  // start the data manager
62  p = Bbl_ManStart( Abc_NtkName(pNtk) );
63  // collect internal nodes to be added
64  vNodes = Abc_NtkDfs( pNtk, 0 );
65  // create combinational inputs
66  Abc_NtkForEachCi( pNtk, pObj, i )
67  Bbl_ManCreateObject( p, BBL_OBJ_CI, Abc_ObjId(pObj), 0, NULL );
68  // create internal nodes
69  Vec_PtrForEachEntry( Abc_Obj_t *, vNodes, pObj, i )
70  Bbl_ManCreateObject( p, BBL_OBJ_NODE, Abc_ObjId(pObj), Abc_ObjFaninNum(pObj), (char *)pObj->pData );
71  // create combinational outputs
72  Abc_NtkForEachCo( pNtk, pObj, i )
73  Bbl_ManCreateObject( p, BBL_OBJ_CO, Abc_ObjId(pObj), 1, NULL );
74  // create fanin/fanout connections for internal nodes
75  Vec_PtrForEachEntry( Abc_Obj_t *, vNodes, pObj, i )
76  Abc_ObjForEachFanin( pObj, pFanin, k )
77  Bbl_ManAddFanin( p, Abc_ObjId(pObj), Abc_ObjId(pFanin) );
78  // create fanin/fanout connections for combinational outputs
79  Abc_NtkForEachCo( pNtk, pObj, i )
80  Abc_ObjForEachFanin( pObj, pFanin, k )
81  Bbl_ManAddFanin( p, Abc_ObjId(pObj), Abc_ObjId(pFanin) );
82  Vec_PtrFree( vNodes );
83  // sanity check
84  Bbl_ManCheck( p );
85  return p;
86 }
static unsigned Abc_ObjId(Abc_Obj_t *pObj)
Definition: abc.h:329
typedefABC_NAMESPACE_HEADER_START struct Vec_Ptr_t_ Vec_Ptr_t
INCLUDES ///.
Definition: vecPtr.h:42
void Bbl_ManAddFanin(Bbl_Man_t *p, int ObjId, int FaninId)
Definition: bblif.c:1023
Bbl_Man_t * Bbl_ManStart(char *pName)
MACRO DEFINITIONS ///.
Definition: bblif.c:806
static Llb_Mgr_t * p
Definition: llb3Image.c:950
static int Abc_ObjFaninNum(Abc_Obj_t *pObj)
Definition: abc.h:364
#define Abc_NtkForEachCo(pNtk, pCo, i)
Definition: abc.h:519
static int Abc_NtkIsSopLogic(Abc_Ntk_t *pNtk)
Definition: abc.h:264
ABC_DLL Vec_Ptr_t * Abc_NtkDfs(Abc_Ntk_t *pNtk, int fCollectAll)
Definition: abcDfs.c:81
int Bbl_ManCheck(Bbl_Man_t *p)
Definition: bblif.c:1062
static char * Abc_NtkName(Abc_Ntk_t *pNtk)
Definition: abc.h:270
#define Abc_NtkForEachCi(pNtk, pCi, i)
Definition: abc.h:515
#define Abc_ObjForEachFanin(pObj, pFanin, i)
Definition: abc.h:524
#define assert(ex)
Definition: util_old.h:213
#define Vec_PtrForEachEntry(Type, vVec, pEntry, i)
MACRO DEFINITIONS ///.
Definition: vecPtr.h:55
void Bbl_ManCreateObject(Bbl_Man_t *p, Bbl_Type_t Type, int ObjId, int nFanins, char *pSop)
Definition: bblif.c:988
static void Vec_PtrFree(Vec_Ptr_t *p)
Definition: vecPtr.h:223
void Io_WriteBblif ( Abc_Ntk_t pNtk,
char *  pFileName 
)

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

Synopsis [Writes the AIG in the binary format.]

Description []

SideEffects []

SeeAlso []

Definition at line 99 of file ioWriteBblif.c.

100 {
101  Bbl_Man_t * p;
102  p = Bbl_ManFromAbc( pNtk );
103 //Bbl_ManPrintStats( p );
104 //Bbl_ManDumpBlif( p, "test_bbl.blif" );
105  Bbl_ManDumpBinaryBlif( p, pFileName );
106  Bbl_ManStop( p );
107 }
static Llb_Mgr_t * p
Definition: llb3Image.c:950
ABC_NAMESPACE_IMPL_START Bbl_Man_t * Bbl_ManFromAbc(Abc_Ntk_t *pNtk)
DECLARATIONS ///.
Definition: ioWriteBblif.c:54
void Bbl_ManDumpBinaryBlif(Bbl_Man_t *p, char *pFileName)
Definition: bblif.c:691
void Bbl_ManStop(Bbl_Man_t *p)
Definition: bblif.c:775