ABC: A System for Sequential Synthesis and Verification
 
Loading...
Searching...
No Matches
bac.h File Reference
#include "aig/gia/gia.h"
#include "misc/extra/extra.h"
#include "misc/util/utilNam.h"
Include dependency graph for bac.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  Bac_Ntk_t_
 
struct  Bac_Man_t_
 

Macros

#define Bac_ManForEachNtk(p, pNtk, i)
 MACRO DEFINITIONS ///.
 
#define Bac_NtkForEachPi(p, iObj, i)
 
#define Bac_NtkForEachPo(p, iObj, i)
 
#define Bac_NtkForEachPoDriver(p, iObj, i)
 
#define Bac_NtkForEachPiMain(p, iObj, i)
 
#define Bac_NtkForEachPoMain(p, iObj, i)
 
#define Bac_NtkForEachObj(p, i)
 
#define Bac_NtkForEachObjType(p, Type, i)
 
#define Bac_NtkForEachBox(p, i)
 
#define Bac_NtkForEachBoxUser(p, i)
 
#define Bac_NtkForEachBoxPrim(p, i)
 
#define Bac_NtkForEachCi(p, i)
 
#define Bac_NtkForEachCo(p, i)
 
#define Bac_NtkForEachCio(p, i)
 
#define Bac_NtkForEachBi(p, i)
 
#define Bac_NtkForEachBo(p, i)
 
#define Bac_NtkForEachBio(p, i)
 
#define Bac_BoxForEachBi(p, iBox, iTerm, i)
 
#define Bac_BoxForEachBo(p, iBox, iTerm, i)
 
#define Bac_BoxForEachBiReverse(p, iBox, iTerm, i)
 
#define Bac_BoxForEachBiMain(p, iBox, iTerm, i)
 
#define Bac_BoxForEachBoMain(p, iBox, iTerm, i)
 
#define Bac_BoxForEachFanin(p, iBox, iFanin, i)
 
#define Bac_BoxForEachFaninBox(p, iBox, iFanin, i)
 
#define Bac_ObjForEachFanout(p, iCi, iCo)
 
#define Bac_BoxForEachFanoutBox(p, iBox, iCo, iFanBox)
 

Typedefs

typedef struct Bac_Ntk_t_ Bac_Ntk_t
 
typedef struct Bac_Man_t_ Bac_Man_t
 

Enumerations

enum  Bac_ObjType_t {
  BAC_OBJ_NONE = 0 , BAC_OBJ_PI , BAC_OBJ_PO , BAC_OBJ_BI ,
  BAC_OBJ_BO , BAC_OBJ_BOX , BAC_BOX_CF , BAC_BOX_CT ,
  BAC_BOX_CX , BAC_BOX_CZ , BAC_BOX_BUF , BAC_BOX_INV ,
  BAC_BOX_AND , BAC_BOX_NAND , BAC_BOX_OR , BAC_BOX_NOR ,
  BAC_BOX_XOR , BAC_BOX_XNOR , BAC_BOX_SHARP , BAC_BOX_SHARPL ,
  BAC_BOX_MUX , BAC_BOX_MAJ , BAC_BOX_RAND , BAC_BOX_RNAND ,
  BAC_BOX_ROR , BAC_BOX_RNOR , BAC_BOX_RXOR , BAC_BOX_RXNOR ,
  BAC_BOX_LAND , BAC_BOX_LNAND , BAC_BOX_LOR , BAC_BOX_LNOR ,
  BAC_BOX_LXOR , BAC_BOX_LXNOR , BAC_BOX_NMUX , BAC_BOX_SEL ,
  BAC_BOX_PSEL , BAC_BOX_ENC , BAC_BOX_PENC , BAC_BOX_DEC ,
  BAC_BOX_EDEC , BAC_BOX_ADD , BAC_BOX_SUB , BAC_BOX_MUL ,
  BAC_BOX_DIV , BAC_BOX_MOD , BAC_BOX_REM , BAC_BOX_POW ,
  BAC_BOX_MIN , BAC_BOX_ABS , BAC_BOX_LTHAN , BAC_BOX_LETHAN ,
  BAC_BOX_METHAN , BAC_BOX_MTHAN , BAC_BOX_EQU , BAC_BOX_NEQU ,
  BAC_BOX_SHIL , BAC_BOX_SHIR , BAC_BOX_ROTL , BAC_BOX_ROTR ,
  BAC_BOX_GATE , BAC_BOX_LUT , BAC_BOX_ASSIGN , BAC_BOX_TRI ,
  BAC_BOX_RAM , BAC_BOX_RAMR , BAC_BOX_RAMW , BAC_BOX_RAMWC ,
  BAC_BOX_RAMBOX , BAC_BOX_LATCH , BAC_BOX_LATCHRS , BAC_BOX_DFF ,
  BAC_BOX_DFFRS , BAC_BOX_UNKNOWN
}
 INCLUDES ///. More...
 
enum  Bac_NameType_t { BAC_NAME_BIN = 0 , BAC_NAME_WORD , BAC_NAME_INFO , BAC_NAME_INDEX }
 

Functions

void Abc_FrameImportPtr (Vec_Ptr_t *vPtr)
 FUNCTION DEFINITIONS ///.
 
Vec_Ptr_tAbc_FrameExportPtr ()
 
int Bac_NtkBuildLibrary (Bac_Man_t *p)
 
Gia_Man_tBac_ManExtract (Bac_Man_t *p, int fBuffers, int fVerbose)
 
Bac_Man_tBac_ManInsertGia (Bac_Man_t *p, Gia_Man_t *pGia)
 
void * Bac_ManInsertAbc (Bac_Man_t *p, void *pAbc)
 
Bac_Man_tBac_ManReadBac (char *pFileName)
 
void Bac_ManWriteBac (char *pFileName, Bac_Man_t *p)
 
char * Bac_NtkGenerateName (Bac_Ntk_t *p, Bac_ObjType_t Type, Vec_Int_t *vBits)
 
Bac_ObjType_t Bac_NameToType (char *pName)
 
Vec_Int_tBac_NameToRanges (char *pName)
 
void Bac_NtkUpdateFanout (Bac_Ntk_t *p, int iOld, int iNew)
 FUNCTION DEFINITIONS ///.
 
void Bac_ManDeriveFanout (Bac_Man_t *p)
 
void Bac_ManAssignInternWordNames (Bac_Man_t *p)
 
Bac_Man_tBac_ManCollapse (Bac_Man_t *p)
 
void Bac_ManSetupTypes (char **pNames, char **pSymbs)
 
void Bac_PtrFree (Vec_Ptr_t *vDes)
 
int Bac_PtrMemory (Vec_Ptr_t *vDes)
 
void Bac_PtrDumpBlif (char *pFileName, Vec_Ptr_t *vDes)
 
void Bac_PtrDumpVerilog (char *pFileName, Vec_Ptr_t *vDes)
 
Vec_Ptr_tBac_PtrTransformTest (Vec_Ptr_t *vDes)
 
Bac_Man_tBac_PtrTransformToCba (Vec_Ptr_t *vDes)
 
Vec_Ptr_tBac_PtrDeriveFromCba (Bac_Man_t *p)
 
Bac_Man_tPsr_ManBuildCba (char *pFileName, Vec_Ptr_t *vDes)
 
Vec_Ptr_tPsr_ManReadBlif (char *pFileName)
 
Vec_Ptr_tPsr_ManReadSmt (char *pFileName)
 
Vec_Ptr_tPsr_ManReadVerilog (char *pFileName)
 
void Psr_ManWriteBlif (char *pFileName, Vec_Ptr_t *p)
 
void Bac_ManWriteBlif (char *pFileName, Bac_Man_t *p)
 
void Psr_ManWriteVerilog (char *pFileName, Vec_Ptr_t *p)
 
void Bac_ManWriteVerilog (char *pFileName, Bac_Man_t *p, int fUseAssign)
 

Macro Definition Documentation

◆ Bac_BoxForEachBi

#define Bac_BoxForEachBi ( p,
iBox,
iTerm,
i )
Value:
for ( iTerm = iBox - 1, i = 0; iTerm >= 0 && Bac_ObjIsBi(p, iTerm); iTerm--, i++ )
Cube * p
Definition exorList.c:222

Definition at line 375 of file bac.h.

375#define Bac_BoxForEachBi( p, iBox, iTerm, i ) \
376 for ( iTerm = iBox - 1, i = 0; iTerm >= 0 && Bac_ObjIsBi(p, iTerm); iTerm--, i++ )

◆ Bac_BoxForEachBiMain

#define Bac_BoxForEachBiMain ( p,
iBox,
iTerm,
i )
Value:
for ( iTerm = iBox - 1, i = 0; iTerm >= 0 && Bac_ObjIsBi(p, iTerm); iTerm--, i++ ) if ( Bac_ObjBit(p, iTerm) ) {} else

Definition at line 382 of file bac.h.

382#define Bac_BoxForEachBiMain( p, iBox, iTerm, i ) \
383 for ( iTerm = iBox - 1, i = 0; iTerm >= 0 && Bac_ObjIsBi(p, iTerm); iTerm--, i++ ) if ( Bac_ObjBit(p, iTerm) ) {} else

◆ Bac_BoxForEachBiReverse

#define Bac_BoxForEachBiReverse ( p,
iBox,
iTerm,
i )
Value:
for ( i = Bac_BoxBiNum(p, iBox), iTerm = iBox - i--; Bac_ObjIsBi(p, iTerm); iTerm++, i-- )

Definition at line 379 of file bac.h.

379#define Bac_BoxForEachBiReverse( p, iBox, iTerm, i ) \
380 for ( i = Bac_BoxBiNum(p, iBox), iTerm = iBox - i--; Bac_ObjIsBi(p, iTerm); iTerm++, i-- )

◆ Bac_BoxForEachBo

#define Bac_BoxForEachBo ( p,
iBox,
iTerm,
i )
Value:
for ( iTerm = iBox + 1, i = 0; iTerm < Bac_NtkObjNum(p) && Bac_ObjIsBo(p, iTerm); iTerm++, i++ )

Definition at line 377 of file bac.h.

377#define Bac_BoxForEachBo( p, iBox, iTerm, i ) \
378 for ( iTerm = iBox + 1, i = 0; iTerm < Bac_NtkObjNum(p) && Bac_ObjIsBo(p, iTerm); iTerm++, i++ )

◆ Bac_BoxForEachBoMain

#define Bac_BoxForEachBoMain ( p,
iBox,
iTerm,
i )
Value:
for ( iTerm = iBox + 1, i = 0; iTerm < Bac_NtkObjNum(p) && Bac_ObjIsBo(p, iTerm); iTerm++, i++ ) if ( Bac_ObjBit(p, iTerm) ) {} else

Definition at line 384 of file bac.h.

384#define Bac_BoxForEachBoMain( p, iBox, iTerm, i ) \
385 for ( iTerm = iBox + 1, i = 0; iTerm < Bac_NtkObjNum(p) && Bac_ObjIsBo(p, iTerm); iTerm++, i++ ) if ( Bac_ObjBit(p, iTerm) ) {} else

◆ Bac_BoxForEachFanin

#define Bac_BoxForEachFanin ( p,
iBox,
iFanin,
i )
Value:
for ( i = 0; iBox - 1 - i >= 0 && Bac_ObjIsBi(p, iBox - 1 - i) && (((iFanin) = Bac_BoxFanin(p, iBox, i)), 1); i++ )

Definition at line 387 of file bac.h.

387#define Bac_BoxForEachFanin( p, iBox, iFanin, i ) \
388 for ( i = 0; iBox - 1 - i >= 0 && Bac_ObjIsBi(p, iBox - 1 - i) && (((iFanin) = Bac_BoxFanin(p, iBox, i)), 1); i++ )

◆ Bac_BoxForEachFaninBox

#define Bac_BoxForEachFaninBox ( p,
iBox,
iFanin,
i )
Value:
for ( i = 0; iBox - 1 - i >= 0 && Bac_ObjIsBi(p, iBox - 1 - i) && (((iFanin) = Bac_BoxFaninBox(p, iBox, i)), 1); i++ )

Definition at line 389 of file bac.h.

389#define Bac_BoxForEachFaninBox( p, iBox, iFanin, i ) \
390 for ( i = 0; iBox - 1 - i >= 0 && Bac_ObjIsBi(p, iBox - 1 - i) && (((iFanin) = Bac_BoxFaninBox(p, iBox, i)), 1); i++ )

◆ Bac_BoxForEachFanoutBox

#define Bac_BoxForEachFanoutBox ( p,
iBox,
iCo,
iFanBox )
Value:
for ( assert(Bac_BoxBoNum(p, iBox) == 1), iCo = Bac_ObjFanout(p, Bac_BoxBo(p, iBox, 0)); iCo && ((iFanBox = Bac_BoxBiBox(p, iCo)), 1); iCo = Bac_ObjNextFanout(p, iCo) )
#define assert(ex)
Definition util_old.h:213

Definition at line 394 of file bac.h.

394#define Bac_BoxForEachFanoutBox( p, iBox, iCo, iFanBox ) \
395 for ( assert(Bac_BoxBoNum(p, iBox) == 1), iCo = Bac_ObjFanout(p, Bac_BoxBo(p, iBox, 0)); iCo && ((iFanBox = Bac_BoxBiBox(p, iCo)), 1); iCo = Bac_ObjNextFanout(p, iCo) )

◆ Bac_ManForEachNtk

#define Bac_ManForEachNtk ( p,
pNtk,
i )
Value:
for ( i = 1; (i <= Bac_ManNtkNum(p)) && (((pNtk) = Bac_ManNtk(p, i)), 1); i++ )

MACRO DEFINITIONS ///.

ITERATORS ///

Definition at line 334 of file bac.h.

334#define Bac_ManForEachNtk( p, pNtk, i ) \
335 for ( i = 1; (i <= Bac_ManNtkNum(p)) && (((pNtk) = Bac_ManNtk(p, i)), 1); i++ )

◆ Bac_NtkForEachBi

#define Bac_NtkForEachBi ( p,
i )
Value:
for ( i = 0; (i < Bac_NtkObjNum(p)); i++ ) if ( !Bac_ObjIsBi(p, i) ){} else

Definition at line 368 of file bac.h.

368#define Bac_NtkForEachBi( p, i ) \
369 for ( i = 0; (i < Bac_NtkObjNum(p)); i++ ) if ( !Bac_ObjIsBi(p, i) ){} else

◆ Bac_NtkForEachBio

#define Bac_NtkForEachBio ( p,
i )
Value:
for ( i = 0; (i < Bac_NtkObjNum(p)); i++ ) if ( !Bac_ObjIsBio(p, i) ){} else

Definition at line 372 of file bac.h.

372#define Bac_NtkForEachBio( p, i ) \
373 for ( i = 0; (i < Bac_NtkObjNum(p)); i++ ) if ( !Bac_ObjIsBio(p, i) ){} else

◆ Bac_NtkForEachBo

#define Bac_NtkForEachBo ( p,
i )
Value:
for ( i = 0; (i < Bac_NtkObjNum(p)); i++ ) if ( !Bac_ObjIsBo(p, i) ){} else

Definition at line 370 of file bac.h.

370#define Bac_NtkForEachBo( p, i ) \
371 for ( i = 0; (i < Bac_NtkObjNum(p)); i++ ) if ( !Bac_ObjIsBo(p, i) ){} else

◆ Bac_NtkForEachBox

#define Bac_NtkForEachBox ( p,
i )
Value:
for ( i = 0; (i < Bac_NtkObjNum(p)); i++ ) if ( !Bac_ObjIsBox(p, i) ) {} else

Definition at line 354 of file bac.h.

354#define Bac_NtkForEachBox( p, i ) \
355 for ( i = 0; (i < Bac_NtkObjNum(p)); i++ ) if ( !Bac_ObjIsBox(p, i) ) {} else

◆ Bac_NtkForEachBoxPrim

#define Bac_NtkForEachBoxPrim ( p,
i )
Value:
for ( i = 0; (i < Bac_NtkObjNum(p)); i++ ) if ( !Bac_ObjIsBoxPrim(p, i) ) {} else

Definition at line 358 of file bac.h.

358#define Bac_NtkForEachBoxPrim( p, i ) \
359 for ( i = 0; (i < Bac_NtkObjNum(p)); i++ ) if ( !Bac_ObjIsBoxPrim(p, i) ) {} else

◆ Bac_NtkForEachBoxUser

#define Bac_NtkForEachBoxUser ( p,
i )
Value:
for ( i = 0; (i < Bac_NtkObjNum(p)); i++ ) if ( !Bac_ObjIsBoxUser(p, i) ) {} else

Definition at line 356 of file bac.h.

356#define Bac_NtkForEachBoxUser( p, i ) \
357 for ( i = 0; (i < Bac_NtkObjNum(p)); i++ ) if ( !Bac_ObjIsBoxUser(p, i) ) {} else

◆ Bac_NtkForEachCi

#define Bac_NtkForEachCi ( p,
i )
Value:
for ( i = 0; (i < Bac_NtkObjNum(p)); i++ ) if ( !Bac_ObjIsCi(p, i) ) {} else

Definition at line 361 of file bac.h.

361#define Bac_NtkForEachCi( p, i ) \
362 for ( i = 0; (i < Bac_NtkObjNum(p)); i++ ) if ( !Bac_ObjIsCi(p, i) ) {} else

◆ Bac_NtkForEachCio

#define Bac_NtkForEachCio ( p,
i )
Value:
for ( i = 0; (i < Bac_NtkObjNum(p)); i++ ) if ( !Bac_ObjIsCio(p, i) ){} else

Definition at line 365 of file bac.h.

365#define Bac_NtkForEachCio( p, i ) \
366 for ( i = 0; (i < Bac_NtkObjNum(p)); i++ ) if ( !Bac_ObjIsCio(p, i) ){} else

◆ Bac_NtkForEachCo

#define Bac_NtkForEachCo ( p,
i )
Value:
for ( i = 0; (i < Bac_NtkObjNum(p)); i++ ) if ( !Bac_ObjIsCo(p, i) ) {} else

Definition at line 363 of file bac.h.

363#define Bac_NtkForEachCo( p, i ) \
364 for ( i = 0; (i < Bac_NtkObjNum(p)); i++ ) if ( !Bac_ObjIsCo(p, i) ) {} else

◆ Bac_NtkForEachObj

#define Bac_NtkForEachObj ( p,
i )
Value:
if ( !Bac_ObjType(p, i) ) {} else \
for ( i = 0; (i < Bac_NtkObjNum(p)); i++ )

Definition at line 349 of file bac.h.

349#define Bac_NtkForEachObj( p, i ) if ( !Bac_ObjType(p, i) ) {} else \
350 for ( i = 0; (i < Bac_NtkObjNum(p)); i++ )

◆ Bac_NtkForEachObjType

#define Bac_NtkForEachObjType ( p,
Type,
i )
Value:
for ( i = 0; (i < Bac_NtkObjNum(p)) && (((Type) = Bac_ObjType(p, i)), 1); i++ ) if ( !Type ) {} else

Definition at line 351 of file bac.h.

351#define Bac_NtkForEachObjType( p, Type, i ) \
352 for ( i = 0; (i < Bac_NtkObjNum(p)) && (((Type) = Bac_ObjType(p, i)), 1); i++ ) if ( !Type ) {} else

◆ Bac_NtkForEachPi

#define Bac_NtkForEachPi ( p,
iObj,
i )
Value:
for ( i = 0; (i < Bac_NtkPiNum(p)) && (((iObj) = Bac_NtkPi(p, i)), 1); i++ )

Definition at line 337 of file bac.h.

337#define Bac_NtkForEachPi( p, iObj, i ) \
338 for ( i = 0; (i < Bac_NtkPiNum(p)) && (((iObj) = Bac_NtkPi(p, i)), 1); i++ )

◆ Bac_NtkForEachPiMain

#define Bac_NtkForEachPiMain ( p,
iObj,
i )
Value:
for ( i = 0; (i < Bac_NtkPiNum(p)) && (((iObj) = Bac_NtkPi(p, i)), 1); i++ ) if ( Bac_ObjBit(p, iObj) ) {} else

Definition at line 344 of file bac.h.

344#define Bac_NtkForEachPiMain( p, iObj, i ) \
345 for ( i = 0; (i < Bac_NtkPiNum(p)) && (((iObj) = Bac_NtkPi(p, i)), 1); i++ ) if ( Bac_ObjBit(p, iObj) ) {} else

◆ Bac_NtkForEachPo

#define Bac_NtkForEachPo ( p,
iObj,
i )
Value:
for ( i = 0; (i < Bac_NtkPoNum(p)) && (((iObj) = Bac_NtkPo(p, i)), 1); i++ )

Definition at line 339 of file bac.h.

339#define Bac_NtkForEachPo( p, iObj, i ) \
340 for ( i = 0; (i < Bac_NtkPoNum(p)) && (((iObj) = Bac_NtkPo(p, i)), 1); i++ )

◆ Bac_NtkForEachPoDriver

#define Bac_NtkForEachPoDriver ( p,
iObj,
i )
Value:
for ( i = 0; (i < Bac_NtkPoNum(p)) && (((iObj) = Bac_ObjFanin(p, Bac_NtkPo(p, i))), 1); i++ )

Definition at line 341 of file bac.h.

341#define Bac_NtkForEachPoDriver( p, iObj, i ) \
342 for ( i = 0; (i < Bac_NtkPoNum(p)) && (((iObj) = Bac_ObjFanin(p, Bac_NtkPo(p, i))), 1); i++ )

◆ Bac_NtkForEachPoMain

#define Bac_NtkForEachPoMain ( p,
iObj,
i )
Value:
for ( i = 0; (i < Bac_NtkPoNum(p)) && (((iObj) = Bac_NtkPo(p, i)), 1); i++ ) if ( Bac_ObjBit(p, iObj) ) {} else

Definition at line 346 of file bac.h.

346#define Bac_NtkForEachPoMain( p, iObj, i ) \
347 for ( i = 0; (i < Bac_NtkPoNum(p)) && (((iObj) = Bac_NtkPo(p, i)), 1); i++ ) if ( Bac_ObjBit(p, iObj) ) {} else

◆ Bac_ObjForEachFanout

#define Bac_ObjForEachFanout ( p,
iCi,
iCo )
Value:
for ( iCo = Bac_ObjFanout(p, iCi); iCo; iCo = Bac_ObjNextFanout(p, iCo) )

Definition at line 392 of file bac.h.

392#define Bac_ObjForEachFanout( p, iCi, iCo ) \
393 for ( iCo = Bac_ObjFanout(p, iCi); iCo; iCo = Bac_ObjNextFanout(p, iCo) )

Typedef Documentation

◆ Bac_Man_t

typedef struct Bac_Man_t_ Bac_Man_t

Definition at line 142 of file bac.h.

◆ Bac_Ntk_t

typedef struct Bac_Ntk_t_ Bac_Ntk_t

Definition at line 141 of file bac.h.

Enumeration Type Documentation

◆ Bac_NameType_t

Enumerator
BAC_NAME_BIN 
BAC_NAME_WORD 
BAC_NAME_INFO 
BAC_NAME_INDEX 

Definition at line 133 of file bac.h.

133 {
134 BAC_NAME_BIN = 0, // 0: binary variable
135 BAC_NAME_WORD, // 1: first bit of word-level variable
136 BAC_NAME_INFO, // 2: first bit of special variable
137 BAC_NAME_INDEX, // 3: index of word-level variable
Bac_NameType_t
Definition bac.h:133
@ BAC_NAME_WORD
Definition bac.h:135
@ BAC_NAME_INFO
Definition bac.h:136
@ BAC_NAME_INDEX
Definition bac.h:137
@ BAC_NAME_BIN
Definition bac.h:134

◆ Bac_ObjType_t

INCLUDES ///.

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

FileName [bac.h]

SystemName [ABC: Logic synthesis and verification system.]

PackageName [Hierarchical word-level netlist.]

Synopsis [External declarations.]

Author [Alan Mishchenko]

Affiliation [UC Berkeley]

Date [Ver. 1.0. Started - November 29, 2014.]

Revision [

Id
bac.h,v 1.00 2014/11/29 00:00:00 alanmi Exp

] PARAMETERS /// BASIC TYPES ///

Enumerator
BAC_OBJ_NONE 
BAC_OBJ_PI 
BAC_OBJ_PO 
BAC_OBJ_BI 
BAC_OBJ_BO 
BAC_OBJ_BOX 
BAC_BOX_CF 
BAC_BOX_CT 
BAC_BOX_CX 
BAC_BOX_CZ 
BAC_BOX_BUF 
BAC_BOX_INV 
BAC_BOX_AND 
BAC_BOX_NAND 
BAC_BOX_OR 
BAC_BOX_NOR 
BAC_BOX_XOR 
BAC_BOX_XNOR 
BAC_BOX_SHARP 
BAC_BOX_SHARPL 
BAC_BOX_MUX 
BAC_BOX_MAJ 
BAC_BOX_RAND 
BAC_BOX_RNAND 
BAC_BOX_ROR 
BAC_BOX_RNOR 
BAC_BOX_RXOR 
BAC_BOX_RXNOR 
BAC_BOX_LAND 
BAC_BOX_LNAND 
BAC_BOX_LOR 
BAC_BOX_LNOR 
BAC_BOX_LXOR 
BAC_BOX_LXNOR 
BAC_BOX_NMUX 
BAC_BOX_SEL 
BAC_BOX_PSEL 
BAC_BOX_ENC 
BAC_BOX_PENC 
BAC_BOX_DEC 
BAC_BOX_EDEC 
BAC_BOX_ADD 
BAC_BOX_SUB 
BAC_BOX_MUL 
BAC_BOX_DIV 
BAC_BOX_MOD 
BAC_BOX_REM 
BAC_BOX_POW 
BAC_BOX_MIN 
BAC_BOX_ABS 
BAC_BOX_LTHAN 
BAC_BOX_LETHAN 
BAC_BOX_METHAN 
BAC_BOX_MTHAN 
BAC_BOX_EQU 
BAC_BOX_NEQU 
BAC_BOX_SHIL 
BAC_BOX_SHIR 
BAC_BOX_ROTL 
BAC_BOX_ROTR 
BAC_BOX_GATE 
BAC_BOX_LUT 
BAC_BOX_ASSIGN 
BAC_BOX_TRI 
BAC_BOX_RAM 
BAC_BOX_RAMR 
BAC_BOX_RAMW 
BAC_BOX_RAMWC 
BAC_BOX_RAMBOX 
BAC_BOX_LATCH 
BAC_BOX_LATCHRS 
BAC_BOX_DFF 
BAC_BOX_DFFRS 
BAC_BOX_UNKNOWN 

Definition at line 43 of file bac.h.

43 {
44 BAC_OBJ_NONE = 0, // 0: unused
45 BAC_OBJ_PI, // 1: input
46 BAC_OBJ_PO, // 2: output
47 BAC_OBJ_BI, // 3: box input
48 BAC_OBJ_BO, // 4: box output
49 BAC_OBJ_BOX, // 5: box
50
67
74
81
89
99
106
111
115
122
127
128 BAC_BOX_UNKNOWN // 67
Bac_ObjType_t
INCLUDES ///.
Definition bac.h:43
@ BAC_BOX_SHIR
Definition bac.h:108
@ BAC_BOX_DFFRS
Definition bac.h:126
@ BAC_BOX_ROR
Definition bac.h:70
@ BAC_BOX_UNKNOWN
Definition bac.h:128
@ BAC_BOX_ASSIGN
Definition bac.h:114
@ BAC_BOX_RAMWC
Definition bac.h:120
@ BAC_BOX_SHARP
Definition bac.h:63
@ BAC_BOX_MIN
Definition bac.h:97
@ BAC_BOX_ROTL
Definition bac.h:109
@ BAC_BOX_MUL
Definition bac.h:92
@ BAC_BOX_LATCH
Definition bac.h:123
@ BAC_BOX_XNOR
Definition bac.h:62
@ BAC_BOX_AND
Definition bac.h:57
@ BAC_BOX_RAND
Definition bac.h:68
@ BAC_BOX_INV
Definition bac.h:56
@ BAC_BOX_PSEL
Definition bac.h:84
@ BAC_BOX_PENC
Definition bac.h:86
@ BAC_BOX_TRI
Definition bac.h:116
@ BAC_BOX_LUT
Definition bac.h:113
@ BAC_BOX_RXOR
Definition bac.h:72
@ BAC_BOX_EDEC
Definition bac.h:88
@ BAC_BOX_SHIL
Definition bac.h:107
@ BAC_BOX_LNOR
Definition bac.h:78
@ BAC_BOX_RNOR
Definition bac.h:71
@ BAC_BOX_LATCHRS
Definition bac.h:124
@ BAC_BOX_SEL
Definition bac.h:83
@ BAC_BOX_ADD
Definition bac.h:90
@ BAC_BOX_MAJ
Definition bac.h:66
@ BAC_BOX_NMUX
Definition bac.h:82
@ BAC_OBJ_PO
Definition bac.h:46
@ BAC_BOX_CT
Definition bac.h:52
@ BAC_BOX_DIV
Definition bac.h:93
@ BAC_BOX_RXNOR
Definition bac.h:73
@ BAC_BOX_CX
Definition bac.h:53
@ BAC_BOX_ROTR
Definition bac.h:110
@ BAC_BOX_DEC
Definition bac.h:87
@ BAC_BOX_BUF
Definition bac.h:55
@ BAC_BOX_MTHAN
Definition bac.h:103
@ BAC_BOX_REM
Definition bac.h:95
@ BAC_OBJ_BI
Definition bac.h:47
@ BAC_BOX_LAND
Definition bac.h:75
@ BAC_BOX_ENC
Definition bac.h:85
@ BAC_BOX_CF
Definition bac.h:51
@ BAC_OBJ_NONE
Definition bac.h:44
@ BAC_BOX_RAMR
Definition bac.h:118
@ BAC_BOX_XOR
Definition bac.h:61
@ BAC_BOX_MUX
Definition bac.h:65
@ BAC_OBJ_BO
Definition bac.h:48
@ BAC_BOX_GATE
Definition bac.h:112
@ BAC_BOX_DFF
Definition bac.h:125
@ BAC_BOX_RAMBOX
Definition bac.h:121
@ BAC_BOX_OR
Definition bac.h:59
@ BAC_BOX_RAMW
Definition bac.h:119
@ BAC_BOX_LETHAN
Definition bac.h:101
@ BAC_BOX_NAND
Definition bac.h:58
@ BAC_BOX_LTHAN
Definition bac.h:100
@ BAC_BOX_SHARPL
Definition bac.h:64
@ BAC_BOX_CZ
Definition bac.h:54
@ BAC_OBJ_PI
Definition bac.h:45
@ BAC_BOX_POW
Definition bac.h:96
@ BAC_BOX_LXNOR
Definition bac.h:80
@ BAC_BOX_RNAND
Definition bac.h:69
@ BAC_BOX_NEQU
Definition bac.h:105
@ BAC_BOX_METHAN
Definition bac.h:102
@ BAC_BOX_RAM
Definition bac.h:117
@ BAC_BOX_EQU
Definition bac.h:104
@ BAC_BOX_ABS
Definition bac.h:98
@ BAC_BOX_NOR
Definition bac.h:60
@ BAC_BOX_SUB
Definition bac.h:91
@ BAC_BOX_LXOR
Definition bac.h:79
@ BAC_BOX_MOD
Definition bac.h:94
@ BAC_BOX_LNAND
Definition bac.h:76
@ BAC_OBJ_BOX
Definition bac.h:49
@ BAC_BOX_LOR
Definition bac.h:77

Function Documentation

◆ Abc_FrameExportPtr()

Vec_Ptr_t * Abc_FrameExportPtr ( )
extern

Definition at line 73 of file bacCom.c.

74{
75 Vec_Ptr_t * vPtr;
76 Bac_Man_t * p;
77 if ( Abc_FrameGetGlobalFrame() == NULL )
78 {
79 printf( "ABC framework is not started.\n" );
80 return NULL;
81 }
82 p = Bac_AbcGetMan( Abc_FrameGetGlobalFrame() );
83 if ( p == NULL )
84 printf( "There is no CBA design present.\n" );
85 vPtr = Bac_PtrDeriveFromCba( p );
86 if ( vPtr == NULL )
87 printf( "Converting to Ptr has failed.\n" );
88 return vPtr;
89}
ABC_DLL Abc_Frame_t * Abc_FrameGetGlobalFrame()
Definition mainFrame.c:643
struct Bac_Man_t_ Bac_Man_t
Definition bac.h:142
Vec_Ptr_t * Bac_PtrDeriveFromCba(Bac_Man_t *p)
Definition bacPtrAbc.c:459
typedefABC_NAMESPACE_HEADER_START struct Vec_Ptr_t_ Vec_Ptr_t
INCLUDES ///.
Definition vecPtr.h:42
Here is the call graph for this function:

◆ Abc_FrameImportPtr()

void Abc_FrameImportPtr ( Vec_Ptr_t * vPtr)
extern

FUNCTION DEFINITIONS ///.

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

Synopsis [Accessing current Bac_Ntk_t.]

Description []

SideEffects []

SeeAlso []

Definition at line 60 of file bacCom.c.

61{
62 Bac_Man_t * p;
63 if ( Abc_FrameGetGlobalFrame() == NULL )
64 {
65 printf( "ABC framework is not started.\n" );
66 return;
67 }
68 p = Bac_PtrTransformToCba( vPtr );
69 if ( p == NULL )
70 printf( "Converting from Ptr failed.\n" );
71 Bac_AbcUpdateMan( Abc_FrameGetGlobalFrame(), p );
72}
Bac_Man_t * Bac_PtrTransformToCba(Vec_Ptr_t *vDes)
Definition bacPtrAbc.c:355
Here is the call graph for this function:

◆ Bac_ManAssignInternWordNames()

void Bac_ManAssignInternWordNames ( Bac_Man_t * p)
extern

Definition at line 392 of file bacNtk.c.

393{
394 Vec_Int_t * vMap = Vec_IntStart( 2*Bac_ManObjNum(p) );
395 Bac_Ntk_t * pNtk; int i;
396 Bac_ManForEachNtk( p, pNtk, i )
398 assert( Vec_IntCountEntry(vMap, 0) == Vec_IntSize(vMap) );
399 Vec_IntFree( vMap );
400}
void Bac_ManAssignInternWordNamesNtk(Bac_Ntk_t *p, Vec_Int_t *vMap)
Definition bacNtk.c:302
struct Bac_Ntk_t_ Bac_Ntk_t
Definition bac.h:141
#define Bac_ManForEachNtk(p, pNtk, i)
MACRO DEFINITIONS ///.
Definition bac.h:334
typedefABC_NAMESPACE_IMPL_START struct Vec_Int_t_ Vec_Int_t
DECLARATIONS ///.
Definition bblif.c:37
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Bac_ManCollapse()

Bac_Man_t * Bac_ManCollapse ( Bac_Man_t * p)
extern

Definition at line 567 of file bacNtk.c.

568{
569 int i, iObj;
570 Vec_Int_t * vSigs = Vec_IntAlloc( 1000 );
571 Bac_Man_t * pNew = Bac_ManStart( p, 1 );
572 Bac_Ntk_t * pRoot = Bac_ManRoot( p );
573 Bac_Ntk_t * pRootNew = Bac_ManRoot( pNew );
574 Bac_NtkAlloc( pRootNew, Bac_NtkNameId(pRoot), Bac_NtkPiNum(pRoot), Bac_NtkPoNum(pRoot), Bac_ManClpObjNum(p) );
575 if ( Vec_IntSize(&pRoot->vInfo) )
576 Vec_IntAppend( &pRootNew->vInfo, &pRoot->vInfo );
577 Bac_NtkForEachPi( pRoot, iObj, i )
578 Vec_IntPush( vSigs, Bac_ObjAlloc(pRootNew, BAC_OBJ_PI, -1) );
579 Bac_NtkCollapse_rec( pRootNew, pRoot, vSigs );
580 assert( Vec_IntSize(vSigs) == Bac_NtkPoNum(pRoot) );
581 Bac_NtkForEachPo( pRoot, iObj, i )
582 Bac_ObjAlloc( pRootNew, BAC_OBJ_PO, Vec_IntEntry(vSigs, i) );
583 assert( Bac_NtkObjNum(pRootNew) == Bac_NtkObjNumAlloc(pRootNew) );
584 Vec_IntFree( vSigs );
585 // transfer PI/PO names
586 if ( Bac_NtkHasNames(pRoot) )
587 {
588 Bac_NtkStartNames( pRootNew );
589 Bac_NtkForEachPi( pRoot, iObj, i )
590 Bac_ObjSetName( pRootNew, Bac_NtkPi(pRootNew, i), Bac_ObjName(pRoot, iObj) );
591 Bac_NtkForEachPoDriver( pRoot, iObj, i )
592 if ( !Bac_ObjIsPi(pRoot, iObj) )
593 Bac_ObjSetName( pRootNew, Bac_ObjCopy(pRoot, iObj), Bac_ObjName(pRoot, iObj) );
594 }
595 return pNew;
596}
int Bac_ManClpObjNum(Bac_Man_t *p)
Definition bacNtk.c:423
void Bac_NtkCollapse_rec(Bac_Ntk_t *pNew, Bac_Ntk_t *p, Vec_Int_t *vSigs)
Definition bacNtk.c:523
#define Bac_NtkForEachPi(p, iObj, i)
Definition bac.h:337
#define Bac_NtkForEachPo(p, iObj, i)
Definition bac.h:339
#define Bac_NtkForEachPoDriver(p, iObj, i)
Definition bac.h:341
Vec_Int_t vInfo
Definition bac.h:157
Here is the call graph for this function:

◆ Bac_ManDeriveFanout()

void Bac_ManDeriveFanout ( Bac_Man_t * p)
extern

Definition at line 258 of file bacNtk.c.

259{
260 Bac_Ntk_t * pNtk; int i;
261 Bac_ManForEachNtk( p, pNtk, i )
262 Bac_NtkDeriveFanout( pNtk );
263}
void Bac_NtkDeriveFanout(Bac_Ntk_t *p)
Definition bacNtk.c:241
Here is the call graph for this function:

◆ Bac_ManExtract()

Gia_Man_t * Bac_ManExtract ( Bac_Man_t * p,
int fBuffers,
int fVerbose )
extern

Definition at line 216 of file bacBlast.c.

217{
218 Bac_Ntk_t * pNtk, * pRoot = Bac_ManRoot(p);
219 Gia_Man_t * pNew, * pTemp;
220 Vec_Int_t * vMap = NULL;
221 int i, iObj;
222
223 Vec_IntClear( &p->vBuf2LeafNtk );
224 Vec_IntClear( &p->vBuf2LeafObj );
225 Vec_IntClear( &p->vBuf2RootNtk );
226 Vec_IntClear( &p->vBuf2RootObj );
227
228 Bac_ManForEachNtk( p, pNtk, i )
229 {
230 Bac_NtkDeriveIndex( pNtk );
231 Bac_NtkStartCopies( pNtk );
232 }
233
234 // start the manager
235 pNew = Gia_ManStart( Bac_ManNodeNum(p) );
236 pNew->pName = Abc_UtilStrsav(p->pName);
237 pNew->pSpec = Abc_UtilStrsav(p->pSpec);
238
239 // primary inputs
240 Bac_NtkForEachPi( pRoot, iObj, i )
241 Bac_ObjSetCopy( pRoot, iObj, Gia_ManAppendCi(pNew) );
242
243 // internal nodes
244 Gia_ManHashAlloc( pNew );
245 pNew->vBarBufs = Vec_IntAlloc( 10000 );
246 vMap = Vec_IntStartFull( 10000 );
248 Bac_NtkForEachPo( pRoot, iObj, i )
249 Bac_ManExtract_rec( pNew, pRoot, iObj, fBuffers, vMap );
251 Vec_IntFreeP( &vMap );
252 Gia_ManHashStop( pNew );
253
254 // primary outputs
255 Bac_NtkForEachPo( pRoot, iObj, i )
256 Gia_ManAppendCo( pNew, Bac_ObjCopy(pRoot, iObj) );
257 assert( Vec_IntSize(&p->vBuf2LeafNtk) == pNew->nBufs );
258
259 // cleanup
260 pNew = Gia_ManCleanup( pTemp = pNew );
261 Gia_ManStop( pTemp );
262 //Gia_ManPrintStats( pNew, NULL );
263 return pNew;
264}
int Bac_ManExtract_rec(Gia_Man_t *pNew, Bac_Ntk_t *p, int i, int fBuffers, Vec_Int_t *vMap)
Definition bacBlast.c:109
ABC_NAMESPACE_IMPL_START void Bac_ManPrepareGates(Bac_Man_t *p)
DECLARATIONS ///.
Definition bacBlast.c:48
void Bac_ManUndoGates(Bac_Man_t *p)
Definition bacBlast.c:64
void Gia_ManStop(Gia_Man_t *p)
Definition giaMan.c:82
void Gia_ManHashAlloc(Gia_Man_t *p)
Definition giaHash.c:105
Gia_Man_t * Gia_ManStart(int nObjsMax)
FUNCTION DEFINITIONS ///.
Definition giaMan.c:57
struct Gia_Man_t_ Gia_Man_t
Definition gia.h:96
Gia_Man_t * Gia_ManCleanup(Gia_Man_t *p)
Definition giaScl.c:84
void Gia_ManHashStop(Gia_Man_t *p)
Definition giaHash.c:149
char * pSpec
Definition gia.h:100
int nBufs
Definition gia.h:109
Vec_Int_t * vBarBufs
Definition gia.h:163
char * pName
Definition gia.h:99
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Bac_ManInsertAbc()

void * Bac_ManInsertAbc ( Bac_Man_t * p,
void * pAbc )
extern

Definition at line 570 of file bacBlast.c.

571{
572 Abc_Ntk_t * pNtk = (Abc_Ntk_t *)pAbc;
573 Bac_Man_t * pNew = Bac_ManDupUserBoxes( p );
574 Bac_ManMarkNodesAbc( p, pNtk );
575 Bac_ManRemapBarbufs( pNew, p );
576 Bac_NtkInsertNtk( pNew, pNtk );
577 Bac_ManMoveNames( pNew, p );
578 return pNew;
579}
struct Abc_Ntk_t_ Abc_Ntk_t
Definition abc.h:115
void Bac_ManRemapBarbufs(Bac_Man_t *pNew, Bac_Man_t *p)
Definition bacBlast.c:301
void Bac_NtkInsertNtk(Bac_Man_t *p, Abc_Ntk_t *pNtk)
Definition bacBlast.c:520
void Bac_ManMarkNodesAbc(Bac_Man_t *p, Abc_Ntk_t *pNtk)
Definition bacBlast.c:443
Here is the call graph for this function:

◆ Bac_ManInsertGia()

Bac_Man_t * Bac_ManInsertGia ( Bac_Man_t * p,
Gia_Man_t * pGia )
extern

Definition at line 399 of file bacBlast.c.

400{
401 Bac_Man_t * pNew = Bac_ManDupUserBoxes( p );
402 Bac_ManMarkNodesGia( p, pGia );
403 Bac_ManRemapBarbufs( pNew, p );
404 Bac_NtkInsertGia( pNew, pGia );
405 Bac_ManMoveNames( pNew, p );
406 return pNew;
407}
void Bac_ManMarkNodesGia(Bac_Man_t *p, Gia_Man_t *pGia)
Definition bacBlast.c:277
void Bac_NtkInsertGia(Bac_Man_t *p, Gia_Man_t *pGia)
Definition bacBlast.c:336
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Bac_ManReadBac()

Bac_Man_t * Bac_ManReadBac ( char * pFileName)
extern

Definition at line 181 of file bacBac.c.

182{
183 Bac_Man_t * p;
184 FILE * pFile;
185 Vec_Str_t * vOut;
186 int nFileSize;
187 pFile = fopen( pFileName, "rb" );
188 if ( pFile == NULL )
189 {
190 printf( "Cannot open file \"%s\" for reading.\n", pFileName );
191 return NULL;
192 }
193 // get the file size, in bytes
194 fseek( pFile, 0, SEEK_END );
195 nFileSize = ftell( pFile );
196 rewind( pFile );
197 // load the contents
198 vOut = Vec_StrAlloc( nFileSize );
199 vOut->nSize = vOut->nCap;
200 assert( nFileSize == Vec_StrSize(vOut) );
201 nFileSize = fread( Vec_StrArray(vOut), 1, Vec_StrSize(vOut), pFile );
202 assert( nFileSize == Vec_StrSize(vOut) );
203 fclose( pFile );
204 // read the networks
205 p = Bac_ManReadBacInt( vOut );
206 if ( p != NULL )
207 {
208 ABC_FREE( p->pSpec );
209 p->pSpec = Abc_UtilStrsav( pFileName );
210 }
211 Vec_StrFree( vOut );
212 return p;
213}
#define ABC_FREE(obj)
Definition abc_global.h:267
Bac_Man_t * Bac_ManReadBacInt(Vec_Str_t *vOut)
Definition bacBac.c:142
struct Vec_Str_t_ Vec_Str_t
Definition bblif.c:46
int nCap
Definition bblif.c:49
int nSize
Definition bblif.c:50
VOID_HACK rewind()
#define SEEK_END
Definition zconf.h:392
Here is the call graph for this function:

◆ Bac_ManSetupTypes()

void Bac_ManSetupTypes ( char ** pNames,
char ** pSymbs )
extern

Definition at line 131 of file bacNtk.c.

132{
133 int Type;
134 for ( Type = 1; Type < BAC_BOX_UNKNOWN; Type++ )
135 {
136 int Id = Bac_GetTypeId( (Bac_ObjType_t)Type );
137 pNames[Type] = s_Types[Id].pName;
138 pSymbs[Type] = s_Types[Id].pSymb;
139 }
140}

◆ Bac_ManWriteBac()

void Bac_ManWriteBac ( char * pFileName,
Bac_Man_t * p )
extern

Definition at line 272 of file bacBac.c.

273{
274 Vec_Str_t * vOut;
275 assert( p->pMioLib == NULL );
276 vOut = Vec_StrAlloc( 10000 );
277 Bac_ManWriteBacInt( vOut, p );
278 if ( Vec_StrSize(vOut) > 0 )
279 {
280 FILE * pFile = fopen( pFileName, "wb" );
281 if ( pFile == NULL )
282 printf( "Cannot open file \"%s\" for writing.\n", pFileName );
283 else
284 {
285 fwrite( Vec_StrArray(vOut), 1, Vec_StrSize(vOut), pFile );
286 fclose( pFile );
287 }
288 }
289 Vec_StrFree( vOut );
290}
void Bac_ManWriteBacInt(Vec_Str_t *vOut, Bac_Man_t *p)
Definition bacBac.c:254
Here is the call graph for this function:

◆ Bac_ManWriteBlif()

void Bac_ManWriteBlif ( char * pFileName,
Bac_Man_t * p )
extern

Definition at line 205 of file bacWriteBlif.c.

206{
207 FILE * pFile;
208 Bac_Ntk_t * pNtk;
209 int i;
210 // check the library
211 if ( p->pMioLib && p->pMioLib != Abc_FrameReadLibGen() )
212 {
213 printf( "Genlib library used in the mapped design is not longer a current library.\n" );
214 return;
215 }
216 pFile = fopen( pFileName, "wb" );
217 if ( pFile == NULL )
218 {
219 printf( "Cannot open output file \"%s\".\n", pFileName );
220 return;
221 }
222 fprintf( pFile, "# Design \"%s\" written via CBA package in ABC on %s\n\n", Bac_ManName(p), Extra_TimeStamp() );
224 Bac_ManForEachNtk( p, pNtk, i )
225 Bac_ManWriteBlifNtk( pFile, pNtk );
226 fclose( pFile );
227}
void Bac_ManWriteBlifNtk(FILE *pFile, Bac_Ntk_t *p)
void Bac_ManAssignInternWordNames(Bac_Man_t *p)
Definition bacNtk.c:392
ABC_DLL void * Abc_FrameReadLibGen()
Definition mainFrame.c:59
char * Extra_TimeStamp()
Here is the call graph for this function:

◆ Bac_ManWriteVerilog()

void Bac_ManWriteVerilog ( char * pFileName,
Bac_Man_t * p,
int fUseAssign )
extern

Definition at line 660 of file bacWriteVer.c.

661{
662 Bac_Ntk_t * pNtk; int i;
663 // check the library
664 if ( p->pMioLib && p->pMioLib != Abc_FrameReadLibGen() )
665 {
666 printf( "Genlib library used in the mapped design is not longer a current library.\n" );
667 return;
668 }
669 // derive the stream
670 p->vOut = Vec_StrAlloc( 10000 );
671 p->vOut2 = Vec_StrAlloc( 1000 );
672 Vec_StrPrintStr( p->vOut, "// Design \"" );
673 Vec_StrPrintStr( p->vOut, Bac_ManName(p) );
674 Vec_StrPrintStr( p->vOut, "\" written via CBA package in ABC on " );
675 Vec_StrPrintStr( p->vOut, Extra_TimeStamp() );
676 Vec_StrPrintStr( p->vOut, "\n\n" );
678 Bac_ManForEachNtk( p, pNtk, i )
679 Bac_ManWriteVerilogNtk( pNtk, fUseAssign );
680 // dump into file
681 if ( p->vOut && Vec_StrSize(p->vOut) > 0 )
682 {
683 FILE * pFile = fopen( pFileName, "wb" );
684 if ( pFile == NULL )
685 printf( "Cannot open file \"%s\" for writing.\n", pFileName );
686 else
687 {
688 fwrite( Vec_StrArray(p->vOut), 1, Vec_StrSize(p->vOut), pFile );
689 fclose( pFile );
690 }
691 }
692 Vec_StrFreeP( &p->vOut );
693 Vec_StrFreeP( &p->vOut2 );
694}
void Bac_ManWriteVerilogNtk(Bac_Ntk_t *p, int fUseAssign)
Here is the call graph for this function:

◆ Bac_NameToRanges()

Vec_Int_t * Bac_NameToRanges ( char * pName)
extern

Definition at line 172 of file bacNtk.c.

173{
174 static Vec_Int_t Bits, * vBits = &Bits;
175 static int pArray[10];
176 char * pTemp;
177 int Num = 0, Count = 0;
178 // initialize array
179 vBits->pArray = pArray;
180 vBits->nSize = 0;
181 vBits->nCap = 10;
182 // check the name
183 assert( !strncmp(pName, s_Pref, strlen(s_Pref)) );
184 for ( pTemp = pName; *pTemp && !Bac_CharIsDigit(*pTemp); pTemp++ );
185 assert( Bac_CharIsDigit(*pTemp) );
186 for ( ; *pTemp; pTemp++ )
187 {
188 if ( Bac_CharIsDigit(*pTemp) )
189 Num = 10 * Num + *pTemp - '0';
190 else
191 Vec_IntPush( vBits, Num ), Count += Num, Num = 0;
192 }
193 assert( Num > 0 );
194 Vec_IntPush( vBits, Num ); Count += Num;
195 assert( Vec_IntSize(vBits) <= 10 );
196 return vBits;
197}
int strncmp()
int strlen()
Here is the call graph for this function:

◆ Bac_NameToType()

Bac_ObjType_t Bac_NameToType ( char * pName)
extern

Definition at line 161 of file bacNtk.c.

162{
163 int i;
164 if ( strncmp(pName, s_Pref, strlen(s_Pref)) )
165 return BAC_OBJ_NONE;
166 pName += strlen(s_Pref);
167 for ( i = 1; i < BAC_BOX_UNKNOWN; i++ )
168 if ( !strncmp(pName, s_Types[i].pName, strlen(s_Types[i].pName)) )
169 return s_Types[i].Type;
170 return BAC_OBJ_NONE;
171}
Here is the call graph for this function:

◆ Bac_NtkBuildLibrary()

int Bac_NtkBuildLibrary ( Bac_Man_t * p)
extern

Definition at line 509 of file bacBlast.c.

510{
511 int RetValue = 1;
513 if ( pLib == NULL )
514 printf( "The standard cell library is not available.\n" ), RetValue = 0;
515 else
516 Bac_NtkPrepareLibrary( p, pLib );
517 p->pMioLib = pLib;
518 return RetValue;
519}
void Bac_NtkPrepareLibrary(Bac_Man_t *p, Mio_Library_t *pLib)
Definition bacBlast.c:490
struct Mio_LibraryStruct_t_ Mio_Library_t
Definition mio.h:42
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Bac_NtkGenerateName()

char * Bac_NtkGenerateName ( Bac_Ntk_t * p,
Bac_ObjType_t Type,
Vec_Int_t * vBits )
extern

Definition at line 142 of file bacNtk.c.

143{
144 static char Buffer[100];
145 char * pTemp; int i, Bits;
146 char * pName = Bac_ManPrimName( p->pDesign, Type );
147 char * pSymb = Bac_ManPrimSymb( p->pDesign, Type );
148 assert( Vec_IntSize(vBits) == (int)strlen(pSymb) );
149 sprintf( Buffer, "%s%s_", s_Pref, pName );
150 pTemp = Buffer + strlen(Buffer);
151 Vec_IntForEachEntry( vBits, Bits, i )
152 {
153 sprintf( pTemp, "%c%d", pSymb[i], Bits );
154 pTemp += strlen(pTemp);
155 }
156 //Vec_IntPrint( vBits );
157 //printf( "%s\n", Buffer );
158 return Buffer;
159}
char * sprintf()
#define Vec_IntForEachEntry(vVec, Entry, i)
MACRO DEFINITIONS ///.
Definition vecInt.h:54
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Bac_NtkUpdateFanout()

void Bac_NtkUpdateFanout ( Bac_Ntk_t * p,
int iOld,
int iNew )
extern

FUNCTION DEFINITIONS ///.

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

Synopsis [Replaces fanin iOld by iNew in all fanouts.]

Description []

SideEffects []

SeeAlso []

Definition at line 215 of file bacNtk.c.

216{
217 int iCo;
218 assert( Bac_ObjIsCi(p, iOld) );
219 assert( Bac_ObjIsCi(p, iNew) );
220 Bac_ObjForEachFanout( p, iOld, iCo )
221 {
222 assert( Bac_ObjFanin(p, iCo) == iOld );
223 Bac_ObjCleanFanin( p, iCo );
224 Bac_ObjSetFanin( p, iCo, iNew );
225 }
226 Bac_ObjSetFanout( p, iNew, Bac_ObjFanout(p, iOld) );
227 Bac_ObjSetFanout( p, iOld, 0 );
228}
#define Bac_ObjForEachFanout(p, iCi, iCo)
Definition bac.h:392

◆ Bac_PtrDeriveFromCba()

Vec_Ptr_t * Bac_PtrDeriveFromCba ( Bac_Man_t * p)
extern

Definition at line 459 of file bacPtrAbc.c.

460{
461 Vec_Ptr_t * vDes;
462 Bac_Ntk_t * pTemp; int i;
463 if ( p == NULL )
464 return NULL;
465 if ( p->pMioLib == NULL )
466 {
467 printf( "Cannot transform CBA network into Ptr because it is not mapped.\n" );
468 return NULL;
469 }
471 vDes = Vec_PtrAllocExact( 1 + Bac_ManNtkNum(p) );
472 Vec_PtrPush( vDes, p->pName );
473 Bac_ManForEachNtk( p, pTemp, i )
474 Vec_PtrPush( vDes, Bac_NtkTransformToPtr(pTemp) );
475 assert( Ptr_CheckArray(vDes) );
476 return vDes;
477}
Vec_Ptr_t * Bac_NtkTransformToPtr(Bac_Ntk_t *p)
Definition bacPtrAbc.c:448
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Bac_PtrDumpBlif()

void Bac_PtrDumpBlif ( char * pFileName,
Vec_Ptr_t * vDes )
extern

Definition at line 192 of file bacPtr.c.

193{
194 FILE * pFile;
195 Vec_Ptr_t * vNtk; int i;
196 pFile = fopen( pFileName, "wb" );
197 if ( pFile == NULL )
198 {
199 printf( "Cannot open output file \"%s\".\n", pFileName );
200 return;
201 }
202 fprintf( pFile, "// Design \"%s\" written via Ptr in ABC on %s\n\n", (char *)Vec_PtrEntry(vDes, 0), Extra_TimeStamp() );
203 Vec_PtrForEachEntryStart( Vec_Ptr_t *, vDes, vNtk, i, 1 )
204 Bac_PtrDumpModuleBlif( pFile, vNtk );
205 fclose( pFile );
206}
void Bac_PtrDumpModuleBlif(FILE *pFile, Vec_Ptr_t *vNtk)
Definition bacPtr.c:179
#define Vec_PtrForEachEntryStart(Type, vVec, pEntry, i, Start)
Definition vecPtr.h:57
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Bac_PtrDumpVerilog()

void Bac_PtrDumpVerilog ( char * pFileName,
Vec_Ptr_t * vDes )
extern

Definition at line 256 of file bacPtr.c.

257{
258 FILE * pFile;
259 Vec_Ptr_t * vNtk; int i;
260 pFile = fopen( pFileName, "wb" );
261 if ( pFile == NULL )
262 {
263 printf( "Cannot open output file \"%s\".\n", pFileName );
264 return;
265 }
266 fprintf( pFile, "// Design \"%s\" written via Ptr in ABC on %s\n\n", (char *)Vec_PtrEntry(vDes, 0), Extra_TimeStamp() );
267 Vec_PtrForEachEntryStart( Vec_Ptr_t *, vDes, vNtk, i, 1 )
268 Bac_PtrDumpModuleVerilog( pFile, vNtk );
269 fclose( pFile );
270}
void Bac_PtrDumpModuleVerilog(FILE *pFile, Vec_Ptr_t *vNtk)
Definition bacPtr.c:240
Here is the call graph for this function:

◆ Bac_PtrFree()

void Bac_PtrFree ( Vec_Ptr_t * vDes)
extern

Definition at line 98 of file bacPtr.c.

99{
100 Vec_Ptr_t * vNtk; int i;
101 if ( !vDes ) return;
102 Vec_PtrForEachEntryStart( Vec_Ptr_t *, vDes, vNtk, i, 1 )
103 Bac_PtrFreeNtk( vNtk );
104 Vec_PtrFree( vDes );
105}
void Bac_PtrFreeNtk(Vec_Ptr_t *vNtk)
FUNCTION DEFINITIONS ///.
Definition bacPtr.c:86
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Bac_PtrMemory()

int Bac_PtrMemory ( Vec_Ptr_t * vDes)
extern

Definition at line 138 of file bacPtr.c.

139{
140 Vec_Ptr_t * vNtk; int i, nBytes = (int)Vec_PtrMemory(vDes);
141 Vec_PtrForEachEntryStart( Vec_Ptr_t *, vDes, vNtk, i, 1 )
142 nBytes += Bac_PtrMemoryNtk(vNtk);
143 return nBytes;
144}
int Bac_PtrMemoryNtk(Vec_Ptr_t *vNtk)
Definition bacPtr.c:129
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Bac_PtrTransformTest()

Vec_Ptr_t * Bac_PtrTransformTest ( Vec_Ptr_t * vDes)
extern

Definition at line 411 of file bacPtr.c.

412{
413 Mio_Library_t * pLib;
414 Vec_Ptr_t * vGatesNames;
415 Vec_Ptr_t * vNtk, * vNew; int i;
416 // dump BLIF before transformation
417 Bac_PtrDumpBlif( "test1.blif", vDes );
418 if ( Abc_FrameGetGlobalFrame() == NULL )
419 {
420 printf( "ABC framework is not started.\n" );
421 return NULL;
422 }
424 if ( pLib == NULL )
425 {
426 printf( "Standard cell library is not entered.\n" );
427 return NULL;
428 }
429 vGatesNames = Bac_ManCollectGateNamesByTruth( pLib );
430 // transform
431 vNew = Vec_PtrAllocExact( Vec_PtrSize(vDes) );
432 Vec_PtrPush( vNew, Abc_UtilStrsav((char *)Vec_PtrEntry(vDes, 0)) );
433 Vec_PtrForEachEntryStart( Vec_Ptr_t *, vDes, vNtk, i, 1 )
434 Vec_PtrPush( vNew, Bac_PtrTransformNtk(vNtk, vGatesNames) );
435 // dump BLIF after transformation
436 Bac_PtrDumpBlif( "test2.blif", vNew );
437 Vec_PtrFree( vGatesNames );
438 return vNew;
439}
Vec_Ptr_t * Bac_ManCollectGateNamesByTruth(Mio_Library_t *pLib)
Definition bacPtr.c:290
Vec_Ptr_t * Bac_PtrTransformNtk(Vec_Ptr_t *vNtk, Vec_Ptr_t *vGatesNames)
Definition bacPtr.c:397
void Bac_PtrDumpBlif(char *pFileName, Vec_Ptr_t *vDes)
Definition bacPtr.c:192
void Bac_PtrDumpBlif(char *pFileName, Vec_Ptr_t *vDes)
Definition bacPtr.c:192
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Bac_PtrTransformToCba()

Bac_Man_t * Bac_PtrTransformToCba ( Vec_Ptr_t * vDes)
extern

Definition at line 355 of file bacPtrAbc.c.

356{
357 char * pName = (char *)Vec_PtrEntry(vDes, 0);
358 Bac_Man_t * pNew = Bac_ManAlloc( pName, Vec_PtrSize(vDes) - 1 );
359 Vec_Int_t * vMap = Vec_IntStartFull( 1000 );
360 Vec_Int_t * vBox2Id = Vec_IntAlloc( 1000 );
361 // create interfaces
362 Bac_Ntk_t * pNtk; int i;
363 Bac_ManForEachNtk( pNew, pNtk, i )
364 {
365 Vec_Ptr_t * vNtk = (Vec_Ptr_t *)Vec_PtrEntry(vDes, i);
366 Vec_Ptr_t * vInputs = (Vec_Ptr_t *)Vec_PtrEntry(vNtk, 1);
367 Vec_Ptr_t * vOutputs = (Vec_Ptr_t *)Vec_PtrEntry(vNtk, 2);
368 int NameId = Abc_NamStrFindOrAdd( pNew->pStrs, (char *)Vec_PtrEntry(vNtk, 0), NULL );
369 Bac_NtkAlloc( pNtk, NameId, Vec_PtrSize(vInputs), Vec_PtrSize(vOutputs), Ptr_ManCountNtk(vNtk) );
370 Bac_NtkStartNames( pNtk );
371 }
372 // parse the networks
373 Bac_ManForEachNtk( pNew, pNtk, i )
374 {
375 Vec_Ptr_t * vNtk = (Vec_Ptr_t *)Vec_PtrEntry(vDes, i);
376 if ( !Bac_NtkDeriveFromPtr( pNtk, vNtk, vMap, vBox2Id ) )
377 break;
378 }
379 if ( i <= Bac_ManNtkNum(pNew) )
380 Bac_ManFree(pNew), pNew = NULL;
381 Vec_IntFree( vBox2Id );
382 Vec_IntFree( vMap );
383 return pNew;
384}
int Bac_NtkDeriveFromPtr(Bac_Ntk_t *pNtk, Vec_Ptr_t *vNtk, Vec_Int_t *vMap, Vec_Int_t *vBox2Id)
Definition bacPtrAbc.c:276
int Ptr_ManCountNtk(Vec_Ptr_t *vNtk)
Definition bacPtrAbc.c:255
Abc_Nam_t * pStrs
Definition bac.h:176
int Abc_NamStrFindOrAdd(Abc_Nam_t *p, char *pStr, int *pfFound)
Definition utilNam.c:453
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Psr_ManBuildCba()

Bac_Man_t * Psr_ManBuildCba ( char * pFileName,
Vec_Ptr_t * vDes )
extern

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

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 328 of file bacPrsBuild.c.

329{
330 Psr_Ntk_t * pNtk = Psr_ManRoot( vDes ); int i;
331 Bac_Man_t * pNew = Bac_ManAlloc( pFileName, Vec_PtrSize(vDes) );
332 Vec_Int_t * vMap = Vec_IntStartFull( Abc_NamObjNumMax(pNtk->pStrs) + 1 );
333 Vec_Int_t * vTmp = Vec_IntAlloc( Psr_NtkBoxNum(pNtk) );
334 Abc_NamDeref( pNew->pStrs );
335 pNew->pStrs = Abc_NamRef( pNtk->pStrs );
336 Vec_PtrForEachEntry( Psr_Ntk_t *, vDes, pNtk, i )
337 Bac_NtkAlloc( Bac_ManNtk(pNew, i+1), Psr_NtkId(pNtk), Psr_NtkPiNum(pNtk), Psr_NtkPoNum(pNtk), Psr_NtkCountObjects(pNtk) );
338 if ( (pNtk->fMapped || (pNtk->fSlices && Psr_ManIsMapped(pNtk))) && !Bac_NtkBuildLibrary(pNew) )
339 Bac_ManFree(pNew), pNew = NULL;
340 else
341 Vec_PtrForEachEntry( Psr_Ntk_t *, vDes, pNtk, i )
342 Psr_ManBuildNtk( Bac_ManNtk(pNew, i+1), vDes, pNtk, vMap, vTmp );
343 assert( Vec_IntCountEntry(vMap, -1) == Vec_IntSize(vMap) );
344 Vec_IntFree( vMap );
345 Vec_IntFree( vTmp );
346// Vec_StrPrint( &Bac_ManNtk(pNew, 1)->vType, 1 );
347 return pNew;
348}
ABC_NAMESPACE_IMPL_START int Psr_ManIsMapped(Psr_Ntk_t *pNtk)
DECLARATIONS ///.
Definition bacPrsBuild.c:47
int Psr_NtkCountObjects(Psr_Ntk_t *pNtk)
Definition bacPrsBuild.c:74
void Psr_ManBuildNtk(Bac_Ntk_t *pNew, Vec_Ptr_t *vDes, Psr_Ntk_t *pNtk, Vec_Int_t *vMap, Vec_Int_t *vBoxes)
struct Psr_Ntk_t_ Psr_Ntk_t
BASIC TYPES ///.
Definition bacPrs.h:51
int Bac_NtkBuildLibrary(Bac_Man_t *p)
Definition bacBlast.c:509
unsigned fMapped
Definition bacPrs.h:56
unsigned fSlices
Definition bacPrs.h:57
Abc_Nam_t * pStrs
Definition bacPrs.h:62
int Abc_NamObjNumMax(Abc_Nam_t *p)
Definition utilNam.c:231
void Abc_NamDeref(Abc_Nam_t *p)
Definition utilNam.c:212
Abc_Nam_t * Abc_NamRef(Abc_Nam_t *p)
Definition utilNam.c:195
#define Vec_PtrForEachEntry(Type, vVec, pEntry, i)
MACRO DEFINITIONS ///.
Definition vecPtr.h:55
Here is the call graph for this function:

◆ Psr_ManReadBlif()

Vec_Ptr_t * Psr_ManReadBlif ( char * pFileName)
extern

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

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 406 of file bacReadBlif.c.

407{
408 Vec_Ptr_t * vPrs = NULL;
409 Psr_Man_t * p = Psr_ManAlloc( pFileName );
410 if ( p == NULL )
411 return NULL;
412 Psr_NtkAddBlifDirectives( p );
413 Psr_ManReadLines( p );
414 if ( Psr_ManErrorPrint(p) )
415 ABC_SWAP( Vec_Ptr_t *, vPrs, p->vNtks );
416 Psr_ManFree( p );
417 return vPrs;
418}
#define ABC_SWAP(Type, a, b)
Definition abc_global.h:253
struct Psr_Man_t_ Psr_Man_t
Definition bacPrs.h:83
Here is the caller graph for this function:

◆ Psr_ManReadSmt()

Vec_Ptr_t * Psr_ManReadSmt ( char * pFileName)
extern

◆ Psr_ManReadVerilog()

Vec_Ptr_t * Psr_ManReadVerilog ( char * pFileName)
extern

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

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 834 of file bacReadVer.c.

835{
836 Vec_Ptr_t * vPrs = NULL;
837 Psr_Man_t * p = Psr_ManAlloc( pFileName );
838 if ( p == NULL )
839 return NULL;
840 Psr_NtkAddVerilogDirectives( p );
841 Psr_ManReadDesign( p );
842 //Psr_ManPrintModules( p );
843 if ( Psr_ManErrorPrint(p) )
844 ABC_SWAP( Vec_Ptr_t *, vPrs, p->vNtks );
845 Psr_ManFree( p );
846 return vPrs;
847}
Here is the caller graph for this function:

◆ Psr_ManWriteBlif()

void Psr_ManWriteBlif ( char * pFileName,
Vec_Ptr_t * p )
extern

Definition at line 103 of file bacWriteBlif.c.

104{
105 Psr_Ntk_t * pNtk = Psr_ManRoot(vPrs);
106 FILE * pFile = fopen( pFileName, "wb" ); int i;
107 if ( pFile == NULL )
108 {
109 printf( "Cannot open output file \"%s\".\n", pFileName );
110 return;
111 }
112 fprintf( pFile, "# Design \"%s\" written by ABC on %s\n\n", Psr_NtkStr(pNtk, pNtk->iModuleName), Extra_TimeStamp() );
113 Vec_PtrForEachEntry( Psr_Ntk_t *, vPrs, pNtk, i )
114 Psr_ManWriteBlifNtk( pFile, pNtk );
115 fclose( pFile );
116}
int iModuleName
Definition bacPrs.h:55
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Psr_ManWriteVerilog()

void Psr_ManWriteVerilog ( char * pFileName,
Vec_Ptr_t * p )
extern

Definition at line 166 of file bacWriteVer.c.

167{
168 Psr_Ntk_t * pNtk = Psr_ManRoot(vPrs); int i;
169 FILE * pFile = fopen( pFileName, "wb" );
170 if ( pFile == NULL )
171 {
172 printf( "Cannot open output file \"%s\".\n", pFileName );
173 return;
174 }
175 fprintf( pFile, "// Design \"%s\" written by ABC on %s\n\n", Psr_NtkStr(pNtk, pNtk->iModuleName), Extra_TimeStamp() );
176 Vec_PtrForEachEntry( Psr_Ntk_t *, vPrs, pNtk, i )
177 Psr_ManWriteVerilogNtk( pFile, pNtk );
178 fclose( pFile );
179}
Here is the call graph for this function:
Here is the caller graph for this function: