72{
74 char Buffer[1000];
75 int i, j, n, Type, iFanin, iOutId, iBit = 0;
77 Vec_Int_t * vInits = Vec_IntAlloc( Wlc_NtkFfNum(
p) );
80 if (
p->pSpec ) pNew->
pSpec = Abc_UtilStrsav(
p->pSpec );
82 Wlc_NtkCleanCopy(
p );
83 Wln_NtkCleanNameId( pNew );
84
86 {
89 Wlc_ObjSetCopy(
p, Wlc_ObjId(
p, pObj), iOutId );
90 }
91
93 {
94 assert( i == Wlc_ObjCiId(pObj) );
96 continue;
97 for ( j = 0; j < Wlc_ObjRange(pObj); j++ )
98 if (
p->pInits[iBit+j] ==
'x' )
99 break;
100
101 if ( 1 )
102 {
103 printf(
"Flop %3d init state: %d\'b", i-Wlc_NtkPiNum(
p), Wlc_ObjRange(pObj) );
104 if ( j == Wlc_ObjRange(pObj) )
105 {
106 int Count = 0;
107 for ( n = 0; n < Wlc_ObjRange(pObj); n++ )
108 Count +=
p->pInits[iBit+n] ==
'0';
109 if ( Count == Wlc_ObjRange(pObj) )
110 printf( "0" );
111 else
112 for ( n = 0; n < Wlc_ObjRange(pObj); n++ )
113 printf(
"%c",
p->pInits[iBit+n] );
114 }
115 else
116 {
117 int Count = 0;
118 for ( n = 0; n < Wlc_ObjRange(pObj); n++ )
119 Count +=
p->pInits[iBit+n] ==
'x';
120 printf( "x" );
121 if ( Count != Wlc_ObjRange(pObj) )
122 printf( " (range %d)", Wlc_ObjRange(pObj) );
123 }
124 printf( "\n" );
125 }
128 if ( j == Wlc_ObjRange(pObj) )
129 {
133 }
134 sprintf( Buffer,
"ff_init_%d", Vec_IntSize(vInits) );
136 Vec_IntPush( vInits, iOutId );
137 iBit += Wlc_ObjRange(pObj);
138 }
140
142 {
143 assert( i == Wlc_ObjCiId(pObj) );
145 continue;
148 Wlc_ObjSetCopy(
p, Wlc_ObjId(
p, pObj), iOutId );
149 }
150
152 {
153 if ( Wlc_ObjIsCi(pObj) || pObj->
Type == 0 )
154 continue;
156 Vec_IntClear( vFanins );
158 Vec_IntPush( vFanins, Wlc_ObjCopy(
p, iFanin) );
163 {
167 }
168
169
171 Wlc_ObjSetCopy(
p, i, iOutId );
172 }
174 {
177
178 }
179 assert( Vec_IntSize(vInits) == Wlc_NtkCoNum(
p) - Wlc_NtkPoNum(
p) );
181 {
182 if ( i < Wlc_NtkPoNum(
p) )
183 continue;
184
185 Vec_IntClear( vFanins );
186 Vec_IntPush( vFanins, Wlc_ObjCopy(
p, Wlc_ObjFaninId0(pObj)) );
187 for ( n = 0; n < 6; n++ )
188 Vec_IntPush( vFanins, 0 );
189 Vec_IntPush( vFanins, Vec_IntEntry(vInits, i-Wlc_NtkPoNum(
p)) );
191 }
192 Vec_IntFree( vFanins );
193 Vec_IntFree( vInits );
194 return pNew;
195}
typedefABC_NAMESPACE_IMPL_START struct Vec_Int_t_ Vec_Int_t
DECLARATIONS ///.
int Abc_NamStrFindOrAdd(Abc_Nam_t *p, char *pStr, int *pfFound)
int Abc_NamObjNumMax(Abc_Nam_t *p)
Abc_Nam_t * Abc_NamStart(int nObjs, int nAveSize)
FUNCTION DEFINITIONS ///.
#define Wlc_NtkForEachPo(p, pPo, i)
#define Wlc_NtkForEachCi(p, pCi, i)
#define Wlc_NtkForEachPi(p, pPi, i)
#define Wlc_NtkForEachObj(p, pObj, i)
MACRO DEFINITIONS ///.
#define Wlc_ObjForEachFanin(pObj, iFanin, i)
struct Wlc_Obj_t_ Wlc_Obj_t
BASIC TYPES ///.
#define Wlc_NtkForEachCo(p, pCo, i)
int Wln_TrasformNameId(Wln_Ntk_t *pNew, Wlc_Ntk_t *p, Wlc_Obj_t *pObj)
char * Wln_ConstFromBits(int *pBits, int nBits)
FUNCTION DEFINITIONS ///.
char * Wln_ConstFromStr(char *pBits, int nBits)
ABC_NAMESPACE_IMPL_START int Ndr_TypeWlc2Ndr(int Type)
DECLARATIONS ///.
void Wln_ObjSetSlice(Wln_Ntk_t *p, int iObj, int SliceId)
void Wln_ObjAddFanin(Wln_Ntk_t *p, int iObj, int i)
int Wln_ObjAlloc(Wln_Ntk_t *p, int Type, int Signed, int End, int Beg)
struct Wln_Ntk_t_ Wln_Ntk_t
void Wln_ObjSetConst(Wln_Ntk_t *p, int iObj, int NameId)
Wln_Ntk_t * Wln_NtkAlloc(char *pName, int nObjsMax)
DECLARATIONS ///.
int Wln_ObjAddFanins(Wln_Ntk_t *p, int iObj, Vec_Int_t *vFanins)