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

Go to the source code of this file.

Functions

ABC_NAMESPACE_IMPL_START char * Wln_ObjName (Wln_Ntk_t *p, int iObj)
 DECLARATIONS ///.
 
char * Wln_ObjConstString (Wln_Ntk_t *p, int iObj)
 
void Wln_ObjUpdateType (Wln_Ntk_t *p, int iObj, int Type)
 
void Wln_ObjSetConst (Wln_Ntk_t *p, int iObj, int NameId)
 
void Wln_ObjSetSlice (Wln_Ntk_t *p, int iObj, int SliceId)
 
void Wln_ObjAddFanin (Wln_Ntk_t *p, int iObj, int i)
 
int Wln_ObjAddFanins (Wln_Ntk_t *p, int iObj, Vec_Int_t *vFanins)
 
int Wln_ObjAlloc (Wln_Ntk_t *p, int Type, int Signed, int End, int Beg)
 
int Wln_ObjClone (Wln_Ntk_t *pNew, Wln_Ntk_t *p, int iObj)
 
int Wln_ObjCreateCo (Wln_Ntk_t *p, int iFanin)
 
void Wln_ObjPrint (Wln_Ntk_t *p, int iObj)
 

Function Documentation

◆ Wln_ObjAddFanin()

void Wln_ObjAddFanin ( Wln_Ntk_t * p,
int iObj,
int i )

Definition at line 75 of file wlnObj.c.

76{
77 Wln_Vec_t * pVec = p->vFanins + iObj;
78 if ( Wln_ObjFaninNum(p, iObj) < 2 )
79 pVec->Array[pVec->nSize++] = i;
80 else if ( Wln_ObjFaninNum(p, iObj) == 2 )
81 {
82 int * pArray = ABC_ALLOC( int, 4 );
83 pArray[0] = pVec->Array[0];
84 pArray[1] = pVec->Array[1];
85 pArray[2] = i;
86 pVec->pArray[0] = pArray;
87 pVec->nSize = 3;
88 pVec->nCap = 4;
89 }
90 else
91 {
92 if ( pVec->nSize == pVec->nCap )
93 pVec->pArray[0] = ABC_REALLOC( int, pVec->pArray[0], (pVec->nCap = 2*pVec->nSize) );
94 assert( pVec->nSize < pVec->nCap );
95 pVec->pArray[0][pVec->nSize++] = i;
96 }
97}
#define ABC_ALLOC(type, num)
Definition abc_global.h:264
#define ABC_REALLOC(type, obj, num)
Definition abc_global.h:268
Cube * p
Definition exorList.c:222
#define assert(ex)
Definition util_old.h:213
typedefABC_NAMESPACE_HEADER_START struct Wln_Vec_t_ Wln_Vec_t
INCLUDES ///.
Definition wln.h:46
Here is the caller graph for this function:

◆ Wln_ObjAddFanins()

int Wln_ObjAddFanins ( Wln_Ntk_t * p,
int iObj,
Vec_Int_t * vFanins )

Definition at line 98 of file wlnObj.c.

99{
100 int i, iFanin;
101 Vec_IntForEachEntry( vFanins, iFanin, i )
102 Wln_ObjAddFanin( p, iObj, iFanin );
103 return iObj;
104}
#define Vec_IntForEachEntry(vVec, Entry, i)
MACRO DEFINITIONS ///.
Definition vecInt.h:54
void Wln_ObjAddFanin(Wln_Ntk_t *p, int iObj, int i)
Definition wlnObj.c:75
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Wln_ObjAlloc()

int Wln_ObjAlloc ( Wln_Ntk_t * p,
int Type,
int Signed,
int End,
int Beg )

Definition at line 105 of file wlnObj.c.

106{
107 int iObj = Vec_IntSize(&p->vTypes);
108 if ( iObj == Vec_IntCap(&p->vTypes) )
109 {
110 p->vFanins = ABC_REALLOC( Wln_Vec_t, p->vFanins, 2 * iObj );
111 memset( p->vFanins + iObj, 0, sizeof(Wln_Vec_t) * iObj );
112 Vec_IntGrow( &p->vTypes, 2 * iObj );
113 }
114 assert( iObj == Vec_StrSize(&p->vSigns) );
115 assert( iObj == Vec_IntSize(&p->vRanges) );
116 Vec_IntPush( &p->vTypes, Type );
117 Vec_StrPush( &p->vSigns, (char)Signed );
118 Vec_IntPush( &p->vRanges, Hash_Int2ManInsert(p->pRanges, End, Beg, 0) );
119 if ( Wln_ObjIsCi(p, iObj) ) Wln_ObjSetFanin( p, iObj, 1, Vec_IntSize(&p->vCis) ), Vec_IntPush( &p->vCis, iObj );
120 if ( Wln_ObjIsCo(p, iObj) ) Wln_ObjSetFanin( p, iObj, 1, Vec_IntSize(&p->vCos) ), Vec_IntPush( &p->vCos, iObj );
121 if ( Wln_ObjIsFf(p, iObj) ) Vec_IntPush( &p->vFfs, iObj );
122 p->nObjs[Type]++;
123 return iObj;
124}
char * memset()
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Wln_ObjClone()

int Wln_ObjClone ( Wln_Ntk_t * pNew,
Wln_Ntk_t * p,
int iObj )

Definition at line 125 of file wlnObj.c.

126{
127 return Wln_ObjAlloc( pNew, Wln_ObjType(p, iObj), Wln_ObjIsSigned(p, iObj), Wln_ObjRangeEnd(p, iObj), Wln_ObjRangeBeg(p, iObj) );
128}
int Wln_ObjAlloc(Wln_Ntk_t *p, int Type, int Signed, int End, int Beg)
Definition wlnObj.c:105
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Wln_ObjConstString()

char * Wln_ObjConstString ( Wln_Ntk_t * p,
int iObj )

Definition at line 53 of file wlnObj.c.

54{
55 assert( Wln_ObjIsConst(p, iObj) );
56 return Abc_NamStr( p->pManName, Wln_ObjFanin0(p, iObj) );
57}
char * Abc_NamStr(Abc_Nam_t *p, int NameId)
Definition utilNam.c:555
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Wln_ObjCreateCo()

int Wln_ObjCreateCo ( Wln_Ntk_t * p,
int iFanin )

Definition at line 129 of file wlnObj.c.

130{
131 int iCo = Wln_ObjClone( p, p, iFanin );
133 Wln_ObjAddFanin( p, iCo, iFanin );
134 return iCo;
135}
@ ABC_OPER_CO
Definition abcOper.h:46
void Wln_ObjUpdateType(Wln_Ntk_t *p, int iObj, int Type)
Definition wlnObj.c:58
int Wln_ObjClone(Wln_Ntk_t *pNew, Wln_Ntk_t *p, int iObj)
Definition wlnObj.c:125
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Wln_ObjName()

ABC_NAMESPACE_IMPL_START char * Wln_ObjName ( Wln_Ntk_t * p,
int iObj )

DECLARATIONS ///.

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

FileName [wlnObj.c]

SystemName [ABC: Logic synthesis and verification system.]

PackageName [Word-level network.]

Synopsis [Object construction procedures.]

Author [Alan Mishchenko]

Affiliation [UC Berkeley]

Date [Ver. 1.0. Started - September 23, 2018.]

Revision [

Id
wlnObj.c,v 1.00 2018/09/23 00:00:00 alanmi Exp

] FUNCTION DEFINITIONS /// Function*************************************************************

Synopsis [Creating objects.]

Description []

SideEffects []

SeeAlso []

Definition at line 45 of file wlnObj.c.

46{
47 static char Buffer[100];
48 if ( Wln_NtkHasNameId(p) && Wln_ObjNameId(p, iObj) )
49 return Abc_NamStr( p->pManName, Wln_ObjNameId(p, iObj) );
50 sprintf( Buffer, "n%d", iObj );
51 return Buffer;
52}
char * sprintf()
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Wln_ObjPrint()

void Wln_ObjPrint ( Wln_Ntk_t * p,
int iObj )

Definition at line 136 of file wlnObj.c.

137{
138 int k, iFanin, Type = Wln_ObjType(p, iObj);
139 printf( "Obj %6d : Type = %6s Fanins = %d : ", iObj, Abc_OperName(Type), Wln_ObjFaninNum(p, iObj) );
140 Wln_ObjForEachFanin( p, iObj, iFanin, k )
141 printf( "%5d ", iFanin );
142 printf( "\n" );
143}
#define Wln_ObjForEachFanin(p, iObj, iFanin, i)
Definition wln.h:205
Here is the caller graph for this function:

◆ Wln_ObjSetConst()

void Wln_ObjSetConst ( Wln_Ntk_t * p,
int iObj,
int NameId )

Definition at line 65 of file wlnObj.c.

66{
67 assert( Wln_ObjIsConst(p, iObj) );
68 Wln_ObjSetFanin( p, iObj, 0, NameId );
69}
Here is the caller graph for this function:

◆ Wln_ObjSetSlice()

void Wln_ObjSetSlice ( Wln_Ntk_t * p,
int iObj,
int SliceId )

Definition at line 70 of file wlnObj.c.

71{
72 assert( Wln_ObjIsSlice(p, iObj) );
73 Wln_ObjSetFanin( p, iObj, 1, SliceId );
74}
Here is the caller graph for this function:

◆ Wln_ObjUpdateType()

void Wln_ObjUpdateType ( Wln_Ntk_t * p,
int iObj,
int Type )

Definition at line 58 of file wlnObj.c.

59{
60 assert( Wln_ObjIsNone(p, iObj) );
61 p->nObjs[Wln_ObjType(p, iObj)]--;
62 Vec_IntWriteEntry( &p->vTypes, iObj, Type );
63 p->nObjs[Wln_ObjType(p, iObj)]++;
64}
Here is the caller graph for this function: