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

Go to the source code of this file.

Functions

ABC_NAMESPACE_IMPL_START int Ndr_TypeWlc2Ndr (int Type)
 DECLARATIONS ///.
 
char * Wln_ConstFromBits (int *pBits, int nBits)
 FUNCTION DEFINITIONS ///.
 
char * Wln_ConstFromStr (char *pBits, int nBits)
 
int Wln_TrasformNameId (Wln_Ntk_t *pNew, Wlc_Ntk_t *p, Wlc_Obj_t *pObj)
 
Wln_Ntk_tWln_NtkFromWlc (Wlc_Ntk_t *p)
 
void Wln_NtkFromWlcTest (Wlc_Ntk_t *p)
 

Function Documentation

◆ Ndr_TypeWlc2Ndr()

ABC_NAMESPACE_IMPL_START int Ndr_TypeWlc2Ndr ( int Type)
extern

DECLARATIONS ///.

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

FileName [wlnWlc.c]

SystemName [ABC: Logic synthesis and verification system.]

PackageName [Word-level network.]

Synopsis [Network transformation.]

Author [Alan Mishchenko]

Affiliation [UC Berkeley]

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

Revision [

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

]

Definition at line 106 of file wlcNdr.c.

107{
108 if ( Type == WLC_OBJ_CONST ) return ABC_OPER_CONST; // 06: constant
109 if ( Type == WLC_OBJ_BUF ) return ABC_OPER_BIT_BUF; // 07: buffer
110 if ( Type == WLC_OBJ_MUX ) return ABC_OPER_BIT_MUX; // 08: multiplexer
111 if ( Type == WLC_OBJ_SHIFT_R ) return ABC_OPER_SHIFT_R; // 09: shift right
112 if ( Type == WLC_OBJ_SHIFT_RA ) return ABC_OPER_SHIFT_RA; // 10: shift right (arithmetic)
113 if ( Type == WLC_OBJ_SHIFT_L ) return ABC_OPER_SHIFT_L; // 11: shift left
114 if ( Type == WLC_OBJ_SHIFT_LA ) return ABC_OPER_SHIFT_LA; // 12: shift left (arithmetic)
115 if ( Type == WLC_OBJ_ROTATE_R ) return ABC_OPER_SHIFT_ROTR; // 13: rotate right
116 if ( Type == WLC_OBJ_ROTATE_L ) return ABC_OPER_SHIFT_ROTL; // 14: rotate left
117 if ( Type == WLC_OBJ_BIT_NOT ) return ABC_OPER_BIT_INV; // 15: bitwise NOT
118 if ( Type == WLC_OBJ_BIT_AND ) return ABC_OPER_BIT_AND; // 16: bitwise AND
119 if ( Type == WLC_OBJ_BIT_OR ) return ABC_OPER_BIT_OR; // 17: bitwise OR
120 if ( Type == WLC_OBJ_BIT_XOR ) return ABC_OPER_BIT_XOR; // 18: bitwise XOR
121 if ( Type == WLC_OBJ_BIT_NAND ) return ABC_OPER_BIT_NAND; // 19: bitwise AND
122 if ( Type == WLC_OBJ_BIT_NOR ) return ABC_OPER_BIT_NOR; // 20: bitwise OR
123 if ( Type == WLC_OBJ_BIT_NXOR ) return ABC_OPER_BIT_NXOR; // 21: bitwise NXOR
124 if ( Type == WLC_OBJ_BIT_SELECT ) return ABC_OPER_SLICE; // 22: bit selection
125 if ( Type == WLC_OBJ_BIT_CONCAT ) return ABC_OPER_CONCAT; // 23: bit concatenation
126 if ( Type == WLC_OBJ_BIT_ZEROPAD ) return ABC_OPER_ZEROPAD; // 24: zero padding
127 if ( Type == WLC_OBJ_BIT_SIGNEXT ) return ABC_OPER_SIGNEXT; // 25: sign extension
128 if ( Type == WLC_OBJ_LOGIC_NOT ) return ABC_OPER_LOGIC_NOT; // 26: logic NOT
129 if ( Type == WLC_OBJ_LOGIC_IMPL ) return ABC_OPER_LOGIC_IMPL; // 27: logic implication
130 if ( Type == WLC_OBJ_LOGIC_AND ) return ABC_OPER_LOGIC_AND; // 28: logic AND
131 if ( Type == WLC_OBJ_LOGIC_OR ) return ABC_OPER_LOGIC_OR; // 29: logic OR
132 if ( Type == WLC_OBJ_LOGIC_XOR ) return ABC_OPER_LOGIC_XOR; // 30: logic XOR
133 if ( Type == WLC_OBJ_SEL ) return ABC_OPER_SEL_SEL; // 57: selector
134 if ( Type == WLC_OBJ_DEC ) return ABC_OPER_SEL_DEC; // 58: decoder
135 if ( Type == WLC_OBJ_COMP_EQU ) return ABC_OPER_COMP_EQU; // 31: compare equal
136 if ( Type == WLC_OBJ_COMP_NOTEQU ) return ABC_OPER_COMP_NOTEQU; // 32: compare not equal
137 if ( Type == WLC_OBJ_COMP_LESS ) return ABC_OPER_COMP_LESS; // 33: compare less
138 if ( Type == WLC_OBJ_COMP_MORE ) return ABC_OPER_COMP_MORE; // 34: compare more
139 if ( Type == WLC_OBJ_COMP_LESSEQU ) return ABC_OPER_COMP_LESSEQU; // 35: compare less or equal
140 if ( Type == WLC_OBJ_COMP_MOREEQU ) return ABC_OPER_COMP_MOREEQU; // 36: compare more or equal
141 if ( Type == WLC_OBJ_REDUCT_AND ) return ABC_OPER_RED_AND; // 37: reduction AND
142 if ( Type == WLC_OBJ_REDUCT_OR ) return ABC_OPER_RED_OR; // 38: reduction OR
143 if ( Type == WLC_OBJ_REDUCT_XOR ) return ABC_OPER_RED_XOR; // 39: reduction XOR
144 if ( Type == WLC_OBJ_REDUCT_NAND ) return ABC_OPER_RED_NAND; // 40: reduction NAND
145 if ( Type == WLC_OBJ_REDUCT_NOR ) return ABC_OPER_RED_NOR; // 41: reduction NOR
146 if ( Type == WLC_OBJ_REDUCT_NXOR ) return ABC_OPER_RED_NXOR; // 42: reduction NXOR
147 if ( Type == WLC_OBJ_ARI_ADD ) return ABC_OPER_ARI_ADD; // 43: arithmetic addition
148 if ( Type == WLC_OBJ_ARI_SUB ) return ABC_OPER_ARI_SUB; // 44: arithmetic subtraction
149 if ( Type == WLC_OBJ_ARI_MULTI ) return ABC_OPER_ARI_MUL; // 45: arithmetic multiplier
150 if ( Type == WLC_OBJ_ARI_DIVIDE ) return ABC_OPER_ARI_DIV; // 46: arithmetic division
151 if ( Type == WLC_OBJ_ARI_REM ) return ABC_OPER_ARI_REM; // 47: arithmetic remainder
152 if ( Type == WLC_OBJ_ARI_MODULUS ) return ABC_OPER_ARI_MOD; // 48: arithmetic modulus
153 if ( Type == WLC_OBJ_ARI_POWER ) return ABC_OPER_ARI_POW; // 49: arithmetic power
154 if ( Type == WLC_OBJ_ARI_MINUS ) return ABC_OPER_ARI_MIN; // 50: arithmetic minus
155 if ( Type == WLC_OBJ_ARI_SQRT ) return ABC_OPER_ARI_SQRT; // 51: integer square root
156 if ( Type == WLC_OBJ_ARI_SQUARE ) return ABC_OPER_ARI_SQUARE; // 52: integer square
157 if ( Type == WLC_OBJ_ARI_ADDSUB ) return ABC_OPER_ARI_ADDSUB; // 56: adder-subtractor
158 if ( Type == WLC_OBJ_ARI_MULTI ) return ABC_OPER_ARI_SMUL; // 45: signed multiplier
159 if ( Type == WLC_OBJ_FO ) return ABC_OPER_DFFRSE; // 03: flop
160 if ( Type == WLC_OBJ_FF ) return ABC_OPER_DFFRSE; // 05: flop
161 if ( Type == WLC_OBJ_READ ) return ABC_OPER_RAMR; // 54: read port
162 if ( Type == WLC_OBJ_WRITE ) return ABC_OPER_RAMW; // 55: write port
163 if ( Type == WLC_OBJ_LUT ) return ABC_OPER_LUT; // 59: LUT
164 return -1;
165}
@ ABC_OPER_ARI_SMUL
Definition abcOper.h:102
@ ABC_OPER_ZEROPAD
Definition abcOper.h:148
@ ABC_OPER_COMP_LESS
Definition abcOper.h:112
@ ABC_OPER_LOGIC_IMPL
Definition abcOper.h:151
@ ABC_OPER_LUT
Definition abcOper.h:127
@ ABC_OPER_LOGIC_OR
Definition abcOper.h:86
@ ABC_OPER_RED_XOR
Definition abcOper.h:80
@ ABC_OPER_COMP_EQU
Definition abcOper.h:116
@ ABC_OPER_ARI_MUL
Definition abcOper.h:101
@ ABC_OPER_RED_NAND
Definition abcOper.h:77
@ ABC_OPER_DFFRSE
Definition abcOper.h:143
@ ABC_OPER_SIGNEXT
Definition abcOper.h:149
@ ABC_OPER_BIT_NAND
Definition abcOper.h:58
@ ABC_OPER_SHIFT_RA
Definition abcOper.h:122
@ ABC_OPER_RAMW
Definition abcOper.h:134
@ ABC_OPER_ARI_REM
Definition abcOper.h:105
@ ABC_OPER_BIT_XOR
Definition abcOper.h:61
@ ABC_OPER_COMP_MORE
Definition abcOper.h:115
@ ABC_OPER_RED_NXOR
Definition abcOper.h:81
@ ABC_OPER_SHIFT_L
Definition abcOper.h:119
@ ABC_OPER_SHIFT_ROTL
Definition abcOper.h:123
@ ABC_OPER_RED_NOR
Definition abcOper.h:79
@ ABC_OPER_LOGIC_NOT
Definition abcOper.h:83
@ ABC_OPER_ARI_DIV
Definition abcOper.h:103
@ ABC_OPER_RED_AND
Definition abcOper.h:76
@ ABC_OPER_RED_OR
Definition abcOper.h:78
@ ABC_OPER_ARI_SQUARE
Definition abcOper.h:152
@ ABC_OPER_SEL_SEL
Definition abcOper.h:92
@ ABC_OPER_ARI_POW
Definition abcOper.h:106
@ ABC_OPER_CONCAT
Definition abcOper.h:147
@ ABC_OPER_BIT_MUX
Definition abcOper.h:65
@ ABC_OPER_COMP_LESSEQU
Definition abcOper.h:113
@ ABC_OPER_LOGIC_AND
Definition abcOper.h:84
@ ABC_OPER_COMP_MOREEQU
Definition abcOper.h:114
@ ABC_OPER_ARI_MOD
Definition abcOper.h:104
@ ABC_OPER_SHIFT_R
Definition abcOper.h:120
@ ABC_OPER_RAMR
Definition abcOper.h:133
@ ABC_OPER_SHIFT_LA
Definition abcOper.h:121
@ ABC_OPER_BIT_INV
Definition abcOper.h:56
@ ABC_OPER_ARI_SQRT
Definition abcOper.h:108
@ ABC_OPER_BIT_AND
Definition abcOper.h:57
@ ABC_OPER_CONST
Definition abcOper.h:153
@ ABC_OPER_SEL_DEC
Definition abcOper.h:96
@ ABC_OPER_SLICE
Definition abcOper.h:146
@ ABC_OPER_ARI_ADDSUB
Definition abcOper.h:155
@ ABC_OPER_COMP_NOTEQU
Definition abcOper.h:117
@ ABC_OPER_BIT_NOR
Definition abcOper.h:60
@ ABC_OPER_SHIFT_ROTR
Definition abcOper.h:124
@ ABC_OPER_BIT_OR
Definition abcOper.h:59
@ ABC_OPER_BIT_BUF
Definition abcOper.h:55
@ ABC_OPER_LOGIC_XOR
Definition abcOper.h:88
@ ABC_OPER_ARI_SUB
Definition abcOper.h:100
@ ABC_OPER_BIT_NXOR
Definition abcOper.h:62
@ ABC_OPER_ARI_MIN
Definition abcOper.h:107
@ ABC_OPER_ARI_ADD
Definition abcOper.h:99
@ WLC_OBJ_ARI_MULTI
Definition wlc.h:90
@ WLC_OBJ_READ
Definition wlc.h:99
@ WLC_OBJ_BIT_SIGNEXT
Definition wlc.h:70
@ WLC_OBJ_COMP_LESSEQU
Definition wlc.h:80
@ WLC_OBJ_LOGIC_XOR
Definition wlc.h:75
@ WLC_OBJ_WRITE
Definition wlc.h:100
@ WLC_OBJ_SHIFT_LA
Definition wlc.h:57
@ WLC_OBJ_BIT_ZEROPAD
Definition wlc.h:69
@ WLC_OBJ_COMP_MOREEQU
Definition wlc.h:81
@ WLC_OBJ_BUF
Definition wlc.h:52
@ WLC_OBJ_COMP_MORE
Definition wlc.h:79
@ WLC_OBJ_REDUCT_AND
Definition wlc.h:82
@ WLC_OBJ_ARI_POWER
Definition wlc.h:94
@ WLC_OBJ_ARI_REM
Definition wlc.h:92
@ WLC_OBJ_ARI_SUB
Definition wlc.h:89
@ WLC_OBJ_LOGIC_OR
Definition wlc.h:74
@ WLC_OBJ_SEL
Definition wlc.h:102
@ WLC_OBJ_LOGIC_AND
Definition wlc.h:73
@ WLC_OBJ_COMP_LESS
Definition wlc.h:78
@ WLC_OBJ_ARI_SQUARE
Definition wlc.h:97
@ WLC_OBJ_REDUCT_NOR
Definition wlc.h:86
@ WLC_OBJ_BIT_NOT
Definition wlc.h:60
@ WLC_OBJ_SHIFT_R
Definition wlc.h:54
@ WLC_OBJ_BIT_AND
Definition wlc.h:61
@ WLC_OBJ_CONST
Definition wlc.h:51
@ WLC_OBJ_FO
Definition wlc.h:48
@ WLC_OBJ_ARI_DIVIDE
Definition wlc.h:91
@ WLC_OBJ_REDUCT_NAND
Definition wlc.h:85
@ WLC_OBJ_BIT_SELECT
Definition wlc.h:67
@ WLC_OBJ_REDUCT_OR
Definition wlc.h:83
@ WLC_OBJ_MUX
Definition wlc.h:53
@ WLC_OBJ_BIT_NAND
Definition wlc.h:64
@ WLC_OBJ_ARI_ADDSUB
Definition wlc.h:101
@ WLC_OBJ_LOGIC_NOT
Definition wlc.h:71
@ WLC_OBJ_COMP_NOTEQU
Definition wlc.h:77
@ WLC_OBJ_REDUCT_XOR
Definition wlc.h:84
@ WLC_OBJ_BIT_NOR
Definition wlc.h:65
@ WLC_OBJ_BIT_CONCAT
Definition wlc.h:68
@ WLC_OBJ_BIT_OR
Definition wlc.h:62
@ WLC_OBJ_BIT_XOR
Definition wlc.h:63
@ WLC_OBJ_ARI_MINUS
Definition wlc.h:95
@ WLC_OBJ_DEC
Definition wlc.h:103
@ WLC_OBJ_ARI_MODULUS
Definition wlc.h:93
@ WLC_OBJ_ARI_ADD
Definition wlc.h:88
@ WLC_OBJ_COMP_EQU
Definition wlc.h:76
@ WLC_OBJ_ARI_SQRT
Definition wlc.h:96
@ WLC_OBJ_LOGIC_IMPL
Definition wlc.h:72
@ WLC_OBJ_SHIFT_L
Definition wlc.h:56
@ WLC_OBJ_REDUCT_NXOR
Definition wlc.h:87
@ WLC_OBJ_BIT_NXOR
Definition wlc.h:66
@ WLC_OBJ_ROTATE_L
Definition wlc.h:59
@ WLC_OBJ_LUT
Definition wlc.h:104
@ WLC_OBJ_SHIFT_RA
Definition wlc.h:55
@ WLC_OBJ_FF
Definition wlc.h:50
@ WLC_OBJ_ROTATE_R
Definition wlc.h:58
Here is the caller graph for this function:

◆ Wln_ConstFromBits()

char * Wln_ConstFromBits ( int * pBits,
int nBits )

FUNCTION DEFINITIONS ///.

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

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 47 of file wlnWlc.c.

48{
49 char * pBuffer = ABC_ALLOC( char, nBits+100 ); int i, Len;
50 sprintf( pBuffer, "%d\'b", nBits );
51 Len = strlen(pBuffer);
52 for ( i = nBits-1; i >= 0; i-- )
53 pBuffer[Len++] = '0' + Abc_InfoHasBit((unsigned *)pBits, i);
54 pBuffer[Len] = 0;
55 return pBuffer;
56}
#define ABC_ALLOC(type, num)
Definition abc_global.h:264
#define Len
Definition deflate.h:78
int strlen()
char * sprintf()
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Wln_ConstFromStr()

char * Wln_ConstFromStr ( char * pBits,
int nBits )

Definition at line 57 of file wlnWlc.c.

58{
59 char * pBuffer = ABC_ALLOC( char, nBits+100 ); int i, Len;
60 sprintf( pBuffer, "%d\'b", nBits );
61 Len = strlen(pBuffer);
62 for ( i = 0; i < nBits; i++ )
63 pBuffer[Len++] = pBits[i];
64 pBuffer[Len] = 0;
65 return pBuffer;
66}
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Wln_NtkFromWlc()

Wln_Ntk_t * Wln_NtkFromWlc ( Wlc_Ntk_t * p)

Definition at line 71 of file wlnWlc.c.

72{
73 Wlc_Obj_t * pObj;
74 char Buffer[1000];
75 int i, j, n, Type, iFanin, iOutId, iBit = 0;
76 Vec_Int_t * vFanins = Vec_IntAlloc( 10 );
77 Vec_Int_t * vInits = Vec_IntAlloc( Wlc_NtkFfNum(p) );
78 Wln_Ntk_t * pNew = Wln_NtkAlloc( p->pName, Wlc_NtkObjNum(p)+Wlc_NtkCoNum(p)+Wlc_NtkFfNum(p) );
79 pNew->pManName = Abc_NamStart( Abc_NamObjNumMax(p->pManName), 10 );
80 if ( p->pSpec ) pNew->pSpec = Abc_UtilStrsav( p->pSpec );
81 pNew->fSmtLib = p->fSmtLib;
82 Wlc_NtkCleanCopy( p );
83 Wln_NtkCleanNameId( pNew );
84 // add primary inputs
85 Wlc_NtkForEachPi( p, pObj, i )
86 {
87 iOutId = Wln_ObjAlloc( pNew, ABC_OPER_CI, pObj->Signed, pObj->End, pObj->Beg );
88 Wln_ObjSetNameId( pNew, iOutId, Wln_TrasformNameId(pNew, p, pObj) );
89 Wlc_ObjSetCopy( p, Wlc_ObjId(p, pObj), iOutId );
90 }
91 // create initial state of the flops
92 Wlc_NtkForEachCi( p, pObj, i )
93 {
94 assert( i == Wlc_ObjCiId(pObj) );
95 if ( pObj->Type == WLC_OBJ_PI )
96 continue;
97 for ( j = 0; j < Wlc_ObjRange(pObj); j++ )
98 if ( p->pInits[iBit+j] == 'x' )
99 break;
100 // print flop init state
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 }
126 Type = j == Wlc_ObjRange(pObj) ? ABC_OPER_CONST : ABC_OPER_CI;
127 iOutId = Wln_ObjAlloc( pNew, Type, pObj->Signed, pObj->End, pObj->Beg );
128 if ( j == Wlc_ObjRange(pObj) ) // constant
129 {
130 char * pString = Wln_ConstFromStr(p->pInits + iBit, Wlc_ObjRange(pObj));
131 Wln_ObjSetConst( pNew, iOutId, Abc_NamStrFindOrAdd(pNew->pManName, pString, NULL) );
132 ABC_FREE( pString );
133 }
134 sprintf( Buffer, "ff_init_%d", Vec_IntSize(vInits) );
135 Wln_ObjSetNameId( pNew, iOutId, Abc_NamStrFindOrAdd(pNew->pManName, Buffer, NULL) );
136 Vec_IntPush( vInits, iOutId );
137 iBit += Wlc_ObjRange(pObj);
138 }
139 assert( p->pInits == NULL || iBit == (int)strlen(p->pInits) );
140 // add flop outputs
141 Wlc_NtkForEachCi( p, pObj, i )
142 {
143 assert( i == Wlc_ObjCiId(pObj) );
144 if ( pObj->Type == WLC_OBJ_PI )
145 continue;
146 iOutId = Wln_ObjAlloc( pNew, ABC_OPER_DFFRSE, pObj->Signed, pObj->End, pObj->Beg );
147 Wln_ObjSetNameId( pNew, iOutId, Wln_TrasformNameId(pNew, p, pObj) );
148 Wlc_ObjSetCopy( p, Wlc_ObjId(p, pObj), iOutId );
149 }
150 // add internal nodes
151 Wlc_NtkForEachObj( p, pObj, i )
152 {
153 if ( Wlc_ObjIsCi(pObj) || pObj->Type == 0 )
154 continue;
155 iOutId = Wln_ObjAlloc( pNew, Ndr_TypeWlc2Ndr(pObj->Type), pObj->Signed, pObj->End, pObj->Beg );
156 Vec_IntClear( vFanins );
157 Wlc_ObjForEachFanin( pObj, iFanin, n )
158 Vec_IntPush( vFanins, Wlc_ObjCopy(p, iFanin) );
159 Wln_ObjAddFanins( pNew, iOutId, vFanins );
160 if ( pObj->Type == WLC_OBJ_BIT_SELECT )
161 Wln_ObjSetSlice( pNew, iOutId, Hash_Int2ManInsert(pNew->pRanges, pObj->End, pObj->Beg, 0) );
162 else if ( pObj->Type == WLC_OBJ_CONST )
163 {
164 char * pString = Wln_ConstFromBits(Wlc_ObjConstValue(pObj), Wlc_ObjRange(pObj));
165 Wln_ObjSetConst( pNew, iOutId, Abc_NamStrFindOrAdd(pNew->pManName, pString, NULL) );
166 ABC_FREE( pString );
167 }
168// else if ( Type == ABC_OPER_BIT_MUX && Vec_IntSize(vFanins) == 3 )
169// ABC_SWAP( int, Wln_ObjFanins(p, iObj)[1], Wln_ObjFanins(p, iObj)[2] );
170 Wln_ObjSetNameId( pNew, iOutId, Wln_TrasformNameId(pNew, p, pObj) );
171 Wlc_ObjSetCopy( p, i, iOutId );
172 }
173 Wlc_NtkForEachPo( p, pObj, i )
174 {
175 iOutId = Wln_ObjAlloc( pNew, ABC_OPER_CO, pObj->Signed, pObj->End, pObj->Beg );
176 Wln_ObjAddFanin( pNew, iOutId, Wlc_ObjCopy(p, Wlc_ObjId(p, pObj)) );
177 //Wln_ObjSetNameId( pNew, iOutId, Wln_TrasformNameId(pNew, p, pObj) );
178 }
179 assert( Vec_IntSize(vInits) == Wlc_NtkCoNum(p) - Wlc_NtkPoNum(p) );
180 Wlc_NtkForEachCo( p, pObj, i )
181 {
182 if ( i < Wlc_NtkPoNum(p) )
183 continue;
184 //char * pInNames[8] = {"d", "clk", "reset", "set", "enable", "async", "sre", "init"};
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)) );
190 Wln_ObjAddFanins( pNew, Vec_IntEntry(&pNew->vFfs, i-Wlc_NtkPoNum(p)), vFanins );
191 }
192 Vec_IntFree( vFanins );
193 Vec_IntFree( vInits );
194 return pNew;
195}
@ ABC_OPER_CI
Definition abcOper.h:45
@ ABC_OPER_CO
Definition abcOper.h:46
#define ABC_FREE(obj)
Definition abc_global.h:267
typedefABC_NAMESPACE_IMPL_START struct Vec_Int_t_ Vec_Int_t
DECLARATIONS ///.
Definition bblif.c:37
Cube * p
Definition exorList.c:222
unsigned Type
Definition wlc.h:121
int End
Definition wlc.h:129
unsigned Signed
Definition wlc.h:122
int Beg
Definition wlc.h:130
Hash_IntMan_t * pRanges
Definition wln.h:67
int fSmtLib
Definition wln.h:60
char * pSpec
Definition wln.h:59
Abc_Nam_t * pManName
Definition wln.h:70
Vec_Int_t vFfs
Definition wln.h:63
int Abc_NamStrFindOrAdd(Abc_Nam_t *p, char *pStr, int *pfFound)
Definition utilNam.c:453
int Abc_NamObjNumMax(Abc_Nam_t *p)
Definition utilNam.c:231
Abc_Nam_t * Abc_NamStart(int nObjs, int nAveSize)
FUNCTION DEFINITIONS ///.
Definition utilNam.c:80
#define assert(ex)
Definition util_old.h:213
#define Wlc_NtkForEachPo(p, pPo, i)
Definition wlc.h:364
#define Wlc_NtkForEachCi(p, pCi, i)
Definition wlc.h:366
#define Wlc_NtkForEachPi(p, pPi, i)
Definition wlc.h:362
#define Wlc_NtkForEachObj(p, pObj, i)
MACRO DEFINITIONS ///.
Definition wlc.h:356
#define Wlc_ObjForEachFanin(pObj, iFanin, i)
Definition wlc.h:375
@ WLC_OBJ_PI
Definition wlc.h:46
struct Wlc_Obj_t_ Wlc_Obj_t
BASIC TYPES ///.
Definition wlc.h:118
#define Wlc_NtkForEachCo(p, pCo, i)
Definition wlc.h:368
int Wln_TrasformNameId(Wln_Ntk_t *pNew, Wlc_Ntk_t *p, Wlc_Obj_t *pObj)
Definition wlnWlc.c:67
char * Wln_ConstFromBits(int *pBits, int nBits)
FUNCTION DEFINITIONS ///.
Definition wlnWlc.c:47
char * Wln_ConstFromStr(char *pBits, int nBits)
Definition wlnWlc.c:57
ABC_NAMESPACE_IMPL_START int Ndr_TypeWlc2Ndr(int Type)
DECLARATIONS ///.
Definition wlcNdr.c:106
void Wln_ObjSetSlice(Wln_Ntk_t *p, int iObj, int SliceId)
Definition wlnObj.c:70
void Wln_ObjAddFanin(Wln_Ntk_t *p, int iObj, int i)
Definition wlnObj.c:75
int Wln_ObjAlloc(Wln_Ntk_t *p, int Type, int Signed, int End, int Beg)
Definition wlnObj.c:105
struct Wln_Ntk_t_ Wln_Ntk_t
Definition wln.h:55
void Wln_ObjSetConst(Wln_Ntk_t *p, int iObj, int NameId)
Definition wlnObj.c:65
Wln_Ntk_t * Wln_NtkAlloc(char *pName, int nObjsMax)
DECLARATIONS ///.
Definition wlnNtk.c:45
int Wln_ObjAddFanins(Wln_Ntk_t *p, int iObj, Vec_Int_t *vFanins)
Definition wlnObj.c:98
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Wln_NtkFromWlcTest()

void Wln_NtkFromWlcTest ( Wlc_Ntk_t * p)

Definition at line 196 of file wlnWlc.c.

197{
198 Wln_Ntk_t * pNew = Wln_NtkFromWlc( p );
199 Wln_WriteVer( pNew, "test_wlc2wln.v" );
200 Wln_NtkFree( pNew );
201}
Wln_Ntk_t * Wln_NtkFromWlc(Wlc_Ntk_t *p)
Definition wlnWlc.c:71
void Wln_WriteVer(Wln_Ntk_t *p, char *pFileName)
void Wln_NtkFree(Wln_Ntk_t *p)
Definition wlnNtk.c:68
Here is the call graph for this function:

◆ Wln_TrasformNameId()

int Wln_TrasformNameId ( Wln_Ntk_t * pNew,
Wlc_Ntk_t * p,
Wlc_Obj_t * pObj )

Definition at line 67 of file wlnWlc.c.

68{
69 return Abc_NamStrFindOrAdd( pNew->pManName, Wlc_ObjName(p, Wlc_ObjId(p, pObj)), NULL );
70}
char * Wlc_ObjName(Wlc_Ntk_t *p, int iObj)
Definition wlcNtk.c:225
Here is the call graph for this function:
Here is the caller graph for this function: