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

Go to the source code of this file.

Functions

ABC_NAMESPACE_IMPL_START Bbl_Man_tBbl_ManFromAbc (Abc_Ntk_t *pNtk)
 DECLARATIONS ///.
 
void Io_WriteBblif (Abc_Ntk_t *pNtk, char *pFileName)
 

Function Documentation

◆ Bbl_ManFromAbc()

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}
struct Abc_Obj_t_ Abc_Obj_t
Definition abc.h:116
#define Abc_NtkForEachCo(pNtk, pCo, i)
Definition abc.h:522
ABC_DLL Vec_Ptr_t * Abc_NtkDfs(Abc_Ntk_t *pNtk, int fCollectAll)
Definition abcDfs.c:82
#define Abc_ObjForEachFanin(pObj, pFanin, i)
Definition abc.h:527
#define Abc_NtkForEachCi(pNtk, pCi, i)
Definition abc.h:518
void Bbl_ManAddFanin(Bbl_Man_t *p, int ObjId, int FaninId)
Definition bblif.c:1023
int Bbl_ManCheck(Bbl_Man_t *p)
Definition bblif.c:1062
Bbl_Man_t * Bbl_ManStart(char *pName)
MACRO DEFINITIONS ///.
Definition bblif.c:806
void Bbl_ManCreateObject(Bbl_Man_t *p, Bbl_Type_t Type, int ObjId, int nFanins, char *pSop)
Definition bblif.c:988
@ BBL_OBJ_CI
Definition bblif.h:206
@ BBL_OBJ_NODE
Definition bblif.h:208
@ BBL_OBJ_CO
Definition bblif.h:207
struct Bbl_Man_t_ Bbl_Man_t
Definition bblif.h:213
Cube * p
Definition exorList.c:222
void * pData
Definition abc.h:145
#define assert(ex)
Definition util_old.h:213
typedefABC_NAMESPACE_HEADER_START struct Vec_Ptr_t_ Vec_Ptr_t
INCLUDES ///.
Definition vecPtr.h:42
#define Vec_PtrForEachEntry(Type, vVec, pEntry, i)
MACRO DEFINITIONS ///.
Definition vecPtr.h:55
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Io_WriteBblif()

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}
void Bbl_ManDumpBinaryBlif(Bbl_Man_t *p, char *pFileName)
Definition bblif.c:691
void Bbl_ManStop(Bbl_Man_t *p)
Definition bblif.c:775
ABC_NAMESPACE_IMPL_START Bbl_Man_t * Bbl_ManFromAbc(Abc_Ntk_t *pNtk)
DECLARATIONS ///.
Here is the call graph for this function:
Here is the caller graph for this function: