Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
abc
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lvzhengyang
abc
Commits
6bd77858
Commit
6bd77858
authored
Jul 07, 2015
by
Alan Mishchenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bug fixing in %blast when blasting MUX coming from always-statement.
parent
8efc9cb7
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
50 additions
and
20 deletions
+50
-20
src/aig/gia/giaDup.c
+1
-0
src/base/wlc/wlc.h
+1
-1
src/base/wlc/wlcBlast.c
+21
-2
src/base/wlc/wlcCom.c
+9
-4
src/base/wlc/wlcReadVer.c
+3
-1
src/base/wlc/wlcWriteVer.c
+15
-12
No files found.
src/aig/gia/giaDup.c
View file @
6bd77858
...
@@ -2462,6 +2462,7 @@ Gia_Man_t * Gia_ManDupZeroUndc( Gia_Man_t * p, char * pInit, int fVerbose )
...
@@ -2462,6 +2462,7 @@ Gia_Man_t * Gia_ManDupZeroUndc( Gia_Man_t * p, char * pInit, int fVerbose )
Gia_Obj_t
*
pObj
;
Gia_Obj_t
*
pObj
;
int
CountPis
=
Gia_ManPiNum
(
p
),
*
pPiLits
;
int
CountPis
=
Gia_ManPiNum
(
p
),
*
pPiLits
;
int
i
,
iResetFlop
=
-
1
,
Count1
=
0
;
int
i
,
iResetFlop
=
-
1
,
Count1
=
0
;
//printf( "Using %s\n", pInit );
// map X-valued flops into new PIs
// map X-valued flops into new PIs
assert
(
(
int
)
strlen
(
pInit
)
==
Gia_ManRegNum
(
p
)
);
assert
(
(
int
)
strlen
(
pInit
)
==
Gia_ManRegNum
(
p
)
);
pPiLits
=
ABC_FALLOC
(
int
,
Gia_ManRegNum
(
p
)
);
pPiLits
=
ABC_FALLOC
(
int
,
Gia_ManRegNum
(
p
)
);
...
...
src/base/wlc/wlc.h
View file @
6bd77858
...
@@ -270,7 +270,7 @@ extern int Wlc_StdinProcessSmt( Abc_Frame_t * pAbc, char * pCmd );
...
@@ -270,7 +270,7 @@ extern int Wlc_StdinProcessSmt( Abc_Frame_t * pAbc, char * pCmd );
/*=== wlcReadVer.c ========================================================*/
/*=== wlcReadVer.c ========================================================*/
extern
Wlc_Ntk_t
*
Wlc_ReadVer
(
char
*
pFileName
);
extern
Wlc_Ntk_t
*
Wlc_ReadVer
(
char
*
pFileName
);
/*=== wlcWriteVer.c ========================================================*/
/*=== wlcWriteVer.c ========================================================*/
extern
void
Wlc_WriteVer
(
Wlc_Ntk_t
*
p
,
char
*
pFileName
,
int
fAddCos
);
extern
void
Wlc_WriteVer
(
Wlc_Ntk_t
*
p
,
char
*
pFileName
,
int
fAddCos
,
int
fNoFlops
);
ABC_NAMESPACE_HEADER_END
ABC_NAMESPACE_HEADER_END
...
...
src/base/wlc/wlcBlast.c
View file @
6bd77858
...
@@ -411,7 +411,7 @@ Gia_Man_t * Wlc_NtkBitBlast( Wlc_Ntk_t * p, Vec_Int_t * vBoxIds )
...
@@ -411,7 +411,7 @@ Gia_Man_t * Wlc_NtkBitBlast( Wlc_Ntk_t * p, Vec_Int_t * vBoxIds )
int
fVerbose
=
0
;
int
fVerbose
=
0
;
Tim_Man_t
*
pManTime
=
NULL
;
Tim_Man_t
*
pManTime
=
NULL
;
Gia_Man_t
*
pTemp
,
*
pNew
,
*
pExtra
=
NULL
;
Gia_Man_t
*
pTemp
,
*
pNew
,
*
pExtra
=
NULL
;
Wlc_Obj_t
*
pObj
,
*
pPrev
=
NULL
;
Wlc_Obj_t
*
pObj
;
Vec_Int_t
*
vBits
=
&
p
->
vBits
,
*
vTemp0
,
*
vTemp1
,
*
vTemp2
,
*
vRes
;
Vec_Int_t
*
vBits
=
&
p
->
vBits
,
*
vTemp0
,
*
vTemp1
,
*
vTemp2
,
*
vRes
;
int
nBits
=
Wlc_NtkPrepareBits
(
p
);
int
nBits
=
Wlc_NtkPrepareBits
(
p
);
int
nRange
,
nRange0
,
nRange1
,
nRange2
;
int
nRange
,
nRange0
,
nRange1
,
nRange2
;
...
@@ -541,6 +541,23 @@ Gia_Man_t * Wlc_NtkBitBlast( Wlc_Ntk_t * p, Vec_Int_t * vBoxIds )
...
@@ -541,6 +541,23 @@ Gia_Man_t * Wlc_NtkBitBlast( Wlc_Ntk_t * p, Vec_Int_t * vBoxIds )
}
}
else
if
(
pObj
->
Type
==
WLC_OBJ_MUX
)
else
if
(
pObj
->
Type
==
WLC_OBJ_MUX
)
{
{
// It is strange and disturbing that Verilog standard treats these statements differently:
// Statement 1:
// assign o = i ? b : a;
// Statement 2:
// always @( i or a or b )
// begin
// case ( i )
// 0 : o = a ;
// 1 : o = b ;
// endcase
// end
// If a is signed and b is unsigned, Statement 1 does not sign-extend a, while Statement 2 does.
// The signedness of o does not matter.
//
// Below we (somewhat arbitrarily) distinguish these two by assuming that
// Statement 1 has three fanins, while Statement 2 has more than three fanins.
//
int
fSigned
=
1
;
int
fSigned
=
1
;
assert
(
nRange0
>=
1
&&
Wlc_ObjFaninNum
(
pObj
)
>=
3
);
assert
(
nRange0
>=
1
&&
Wlc_ObjFaninNum
(
pObj
)
>=
3
);
assert
(
1
+
(
1
<<
nRange0
)
==
Wlc_ObjFaninNum
(
pObj
)
);
assert
(
1
+
(
1
<<
nRange0
)
==
Wlc_ObjFaninNum
(
pObj
)
);
...
@@ -555,7 +572,10 @@ Gia_Man_t * Wlc_NtkBitBlast( Wlc_Ntk_t * p, Vec_Int_t * vBoxIds )
...
@@ -555,7 +572,10 @@ Gia_Man_t * Wlc_NtkBitBlast( Wlc_Ntk_t * p, Vec_Int_t * vBoxIds )
{
{
nRange1
=
Wlc_ObjRange
(
Wlc_NtkObj
(
p
,
iFanin
)
);
nRange1
=
Wlc_ObjRange
(
Wlc_NtkObj
(
p
,
iFanin
)
);
pFans1
=
Vec_IntEntryP
(
vBits
,
Wlc_ObjCopy
(
p
,
iFanin
)
);
pFans1
=
Vec_IntEntryP
(
vBits
,
Wlc_ObjCopy
(
p
,
iFanin
)
);
if
(
Wlc_ObjFaninNum
(
pObj
)
==
3
)
// Statement 1
Vec_IntPush
(
vTemp0
,
b
<
nRange1
?
pFans1
[
b
]
:
(
fSigned
?
pFans1
[
nRange1
-
1
]
:
0
)
);
Vec_IntPush
(
vTemp0
,
b
<
nRange1
?
pFans1
[
b
]
:
(
fSigned
?
pFans1
[
nRange1
-
1
]
:
0
)
);
else
// Statement 2
Vec_IntPush
(
vTemp0
,
b
<
nRange1
?
pFans1
[
b
]
:
(
Wlc_NtkObj
(
p
,
iFanin
)
->
Signed
?
pFans1
[
nRange1
-
1
]
:
0
)
);
}
}
Vec_IntPush
(
vRes
,
Wlc_NtkMuxTree_rec
(
pNew
,
pFans0
,
nRange0
,
vTemp0
,
0
)
);
Vec_IntPush
(
vRes
,
Wlc_NtkMuxTree_rec
(
pNew
,
pFans0
,
nRange0
,
vTemp0
,
0
)
);
}
}
...
@@ -765,7 +785,6 @@ Gia_Man_t * Wlc_NtkBitBlast( Wlc_Ntk_t * p, Vec_Int_t * vBoxIds )
...
@@ -765,7 +785,6 @@ Gia_Man_t * Wlc_NtkBitBlast( Wlc_Ntk_t * p, Vec_Int_t * vBoxIds )
else
assert
(
0
);
else
assert
(
0
);
assert
(
Vec_IntSize
(
vBits
)
==
Wlc_ObjCopy
(
p
,
i
)
);
assert
(
Vec_IntSize
(
vBits
)
==
Wlc_ObjCopy
(
p
,
i
)
);
Vec_IntAppend
(
vBits
,
vRes
);
Vec_IntAppend
(
vBits
,
vRes
);
pPrev
=
pObj
;
p
->
nAnds
[
pObj
->
Type
]
+=
Gia_ManAndNum
(
pNew
)
-
nAndPrev
;
p
->
nAnds
[
pObj
->
Type
]
+=
Gia_ManAndNum
(
pNew
)
-
nAndPrev
;
}
}
p
->
nAnds
[
0
]
=
Gia_ManAndNum
(
pNew
);
p
->
nAnds
[
0
]
=
Gia_ManAndNum
(
pNew
);
...
...
src/base/wlc/wlcCom.c
View file @
6bd77858
...
@@ -180,9 +180,10 @@ int Abc_CommandWriteWlc( Abc_Frame_t * pAbc, int argc, char ** argv )
...
@@ -180,9 +180,10 @@ int Abc_CommandWriteWlc( Abc_Frame_t * pAbc, int argc, char ** argv )
char
*
pFileName
=
NULL
;
char
*
pFileName
=
NULL
;
int
fAddCos
=
0
;
int
fAddCos
=
0
;
int
fSplitNodes
=
0
;
int
fSplitNodes
=
0
;
int
fNoFlops
=
0
;
int
c
,
fVerbose
=
0
;
int
c
,
fVerbose
=
0
;
Extra_UtilGetoptReset
();
Extra_UtilGetoptReset
();
while
(
(
c
=
Extra_UtilGetopt
(
argc
,
argv
,
"anvh"
)
)
!=
EOF
)
while
(
(
c
=
Extra_UtilGetopt
(
argc
,
argv
,
"an
f
vh"
)
)
!=
EOF
)
{
{
switch
(
c
)
switch
(
c
)
{
{
...
@@ -192,6 +193,9 @@ int Abc_CommandWriteWlc( Abc_Frame_t * pAbc, int argc, char ** argv )
...
@@ -192,6 +193,9 @@ int Abc_CommandWriteWlc( Abc_Frame_t * pAbc, int argc, char ** argv )
case
'n'
:
case
'n'
:
fSplitNodes
^=
1
;
fSplitNodes
^=
1
;
break
;
break
;
case
'f'
:
fNoFlops
^=
1
;
break
;
case
'v'
:
case
'v'
:
fVerbose
^=
1
;
fVerbose
^=
1
;
break
;
break
;
...
@@ -218,18 +222,19 @@ int Abc_CommandWriteWlc( Abc_Frame_t * pAbc, int argc, char ** argv )
...
@@ -218,18 +222,19 @@ int Abc_CommandWriteWlc( Abc_Frame_t * pAbc, int argc, char ** argv )
if
(
fSplitNodes
)
if
(
fSplitNodes
)
{
{
pNtk
=
Wlc_NtkDupSingleNodes
(
pNtk
);
pNtk
=
Wlc_NtkDupSingleNodes
(
pNtk
);
Wlc_WriteVer
(
pNtk
,
pFileName
,
fAddCos
);
Wlc_WriteVer
(
pNtk
,
pFileName
,
fAddCos
,
fNoFlops
);
Wlc_NtkFree
(
pNtk
);
Wlc_NtkFree
(
pNtk
);
}
}
else
else
Wlc_WriteVer
(
pNtk
,
pFileName
,
fAddCos
);
Wlc_WriteVer
(
pNtk
,
pFileName
,
fAddCos
,
fNoFlops
);
return
0
;
return
0
;
usage:
usage:
Abc_Print
(
-
2
,
"usage: %%write [-anvh]
\n
"
);
Abc_Print
(
-
2
,
"usage: %%write [-an
f
vh]
\n
"
);
Abc_Print
(
-
2
,
"
\t
writes the design into a file
\n
"
);
Abc_Print
(
-
2
,
"
\t
writes the design into a file
\n
"
);
Abc_Print
(
-
2
,
"
\t
-a : toggle adding a CO for each node [default = %s]
\n
"
,
fAddCos
?
"yes"
:
"no"
);
Abc_Print
(
-
2
,
"
\t
-a : toggle adding a CO for each node [default = %s]
\n
"
,
fAddCos
?
"yes"
:
"no"
);
Abc_Print
(
-
2
,
"
\t
-n : toggle splitting into individual nodes [default = %s]
\n
"
,
fSplitNodes
?
"yes"
:
"no"
);
Abc_Print
(
-
2
,
"
\t
-n : toggle splitting into individual nodes [default = %s]
\n
"
,
fSplitNodes
?
"yes"
:
"no"
);
Abc_Print
(
-
2
,
"
\t
-f : toggle skipping flops when writing file [default = %s]
\n
"
,
fNoFlops
?
"yes"
:
"no"
);
Abc_Print
(
-
2
,
"
\t
-v : toggle printing verbose information [default = %s]
\n
"
,
fVerbose
?
"yes"
:
"no"
);
Abc_Print
(
-
2
,
"
\t
-v : toggle printing verbose information [default = %s]
\n
"
,
fVerbose
?
"yes"
:
"no"
);
Abc_Print
(
-
2
,
"
\t
-h : print the command usage
\n
"
);
Abc_Print
(
-
2
,
"
\t
-h : print the command usage
\n
"
);
return
1
;
return
1
;
...
...
src/base/wlc/wlcReadVer.c
View file @
6bd77858
...
@@ -1083,6 +1083,8 @@ startword:
...
@@ -1083,6 +1083,8 @@ startword:
pObj
=
Wlc_NtkObj
(
p
->
pNtk
,
Vec_IntEntry
(
p
->
vFanins
,
0
)
);
pObj
=
Wlc_NtkObj
(
p
->
pNtk
,
Vec_IntEntry
(
p
->
vFanins
,
0
)
);
if
(
(
1
<<
Wlc_ObjRange
(
pObj
))
!=
Vec_IntSize
(
p
->
vFanins
)
-
1
)
if
(
(
1
<<
Wlc_ObjRange
(
pObj
))
!=
Vec_IntSize
(
p
->
vFanins
)
-
1
)
return
Wlc_PrsWriteErrorMessage
(
p
,
pStart
,
"The number of values in the case statement is wrong."
,
pName
);
return
Wlc_PrsWriteErrorMessage
(
p
,
pStart
,
"The number of values in the case statement is wrong."
,
pName
);
if
(
Wlc_ObjRange
(
pObj
)
==
1
)
return
Wlc_PrsWriteErrorMessage
(
p
,
pStart
,
"Always-statement with 1-bit control is not bit-blasted correctly."
,
pName
);
pObj
=
Wlc_NtkObj
(
p
->
pNtk
,
NameIdOut
);
pObj
=
Wlc_NtkObj
(
p
->
pNtk
,
NameIdOut
);
Wlc_ObjUpdateType
(
p
->
pNtk
,
pObj
,
WLC_OBJ_MUX
);
Wlc_ObjUpdateType
(
p
->
pNtk
,
pObj
,
WLC_OBJ_MUX
);
Wlc_ObjAddFanins
(
p
->
pNtk
,
pObj
,
p
->
vFanins
);
Wlc_ObjAddFanins
(
p
->
pNtk
,
pObj
,
p
->
vFanins
);
...
@@ -1194,7 +1196,7 @@ void Io_ReadWordTest( char * pFileName )
...
@@ -1194,7 +1196,7 @@ void Io_ReadWordTest( char * pFileName )
Wlc_Ntk_t
*
pNtk
=
Wlc_ReadVer
(
pFileName
);
Wlc_Ntk_t
*
pNtk
=
Wlc_ReadVer
(
pFileName
);
if
(
pNtk
==
NULL
)
if
(
pNtk
==
NULL
)
return
;
return
;
Wlc_WriteVer
(
pNtk
,
"test.v"
,
0
);
Wlc_WriteVer
(
pNtk
,
"test.v"
,
0
,
0
);
pNew
=
Wlc_NtkBitBlast
(
pNtk
,
NULL
);
pNew
=
Wlc_NtkBitBlast
(
pNtk
,
NULL
);
Gia_AigerWrite
(
pNew
,
"test.aig"
,
0
,
0
);
Gia_AigerWrite
(
pNew
,
"test.aig"
,
0
,
0
);
...
...
src/base/wlc/wlcWriteVer.c
View file @
6bd77858
...
@@ -144,20 +144,20 @@ void Wlc_WriteVerIntVec( FILE * pFile, Wlc_Ntk_t * p, Vec_Int_t * vVec, int Star
...
@@ -144,20 +144,20 @@ void Wlc_WriteVerIntVec( FILE * pFile, Wlc_Ntk_t * p, Vec_Int_t * vVec, int Star
NameCounter
++
;
NameCounter
++
;
}
}
}
}
void
Wlc_WriteVerInt
(
FILE
*
pFile
,
Wlc_Ntk_t
*
p
)
void
Wlc_WriteVerInt
(
FILE
*
pFile
,
Wlc_Ntk_t
*
p
,
int
fNoFlops
)
{
{
Wlc_Obj_t
*
pObj
;
Wlc_Obj_t
*
pObj
;
int
i
,
k
,
iFanin
;
int
i
,
k
,
iFanin
;
char
Range
[
100
];
char
Range
[
100
];
fprintf
(
pFile
,
"module %s ( "
,
p
->
pName
);
fprintf
(
pFile
,
"module %s ( "
,
p
->
pName
);
fprintf
(
pFile
,
"
\n
"
);
fprintf
(
pFile
,
"
\n
"
);
if
(
Wlc_NtkPiNum
(
p
)
>
0
)
if
(
Wlc_NtkPiNum
(
p
)
>
0
||
(
fNoFlops
&&
Wlc_NtkCiNum
(
p
))
)
{
{
Wlc_WriteVerIntVec
(
pFile
,
p
,
&
p
->
vPis
,
3
);
Wlc_WriteVerIntVec
(
pFile
,
p
,
fNoFlops
?
&
p
->
vCis
:
&
p
->
vPis
,
3
);
fprintf
(
pFile
,
",
\n
"
);
fprintf
(
pFile
,
",
\n
"
);
}
}
if
(
Wlc_NtkPoNum
(
p
)
>
0
)
if
(
Wlc_NtkPoNum
(
p
)
>
0
||
(
fNoFlops
&&
Wlc_NtkCoNum
(
p
))
)
Wlc_WriteVerIntVec
(
pFile
,
p
,
&
p
->
vPos
,
3
);
Wlc_WriteVerIntVec
(
pFile
,
p
,
fNoFlops
?
&
p
->
vCos
:
&
p
->
vPos
,
3
);
fprintf
(
pFile
,
" );
\n
"
);
fprintf
(
pFile
,
" );
\n
"
);
// mark fanins of rotation shifts
// mark fanins of rotation shifts
Wlc_NtkForEachObj
(
p
,
pObj
,
i
)
Wlc_NtkForEachObj
(
p
,
pObj
,
i
)
...
@@ -173,20 +173,20 @@ void Wlc_WriteVerInt( FILE * pFile, Wlc_Ntk_t * p )
...
@@ -173,20 +173,20 @@ void Wlc_WriteVerInt( FILE * pFile, Wlc_Ntk_t * p )
}
}
sprintf
(
Range
,
"%s[%d:%d]%*s"
,
Wlc_ObjIsSigned
(
pObj
)
?
"signed "
:
" "
,
pObj
->
End
,
pObj
->
Beg
,
8
-
nDigits
,
""
);
sprintf
(
Range
,
"%s[%d:%d]%*s"
,
Wlc_ObjIsSigned
(
pObj
)
?
"signed "
:
" "
,
pObj
->
End
,
pObj
->
Beg
,
8
-
nDigits
,
""
);
fprintf
(
pFile
,
" "
);
fprintf
(
pFile
,
" "
);
if
(
pObj
->
Type
==
WLC_OBJ_PI
)
if
(
pObj
->
Type
==
WLC_OBJ_PI
||
(
fNoFlops
&&
pObj
->
Type
==
WLC_OBJ_FO
)
)
fprintf
(
pFile
,
"input "
);
fprintf
(
pFile
,
"input "
);
else
if
(
pObj
->
fIsPo
)
else
if
(
pObj
->
fIsPo
||
(
fNoFlops
&&
pObj
->
fIsFi
)
)
fprintf
(
pFile
,
"output "
);
fprintf
(
pFile
,
"output "
);
else
else
fprintf
(
pFile
,
" "
);
fprintf
(
pFile
,
" "
);
if
(
Wlc_ObjIsCi
(
pObj
)
||
pObj
->
fIsPo
)
if
(
Wlc_ObjIsCi
(
pObj
)
||
pObj
->
fIsPo
||
(
fNoFlops
&&
pObj
->
fIsFi
)
)
{
{
fprintf
(
pFile
,
"wire %s %s ;
\n
"
,
Range
,
Wlc_ObjName
(
p
,
i
)
);
fprintf
(
pFile
,
"wire %s %s ;
\n
"
,
Range
,
Wlc_ObjName
(
p
,
i
)
);
if
(
Wlc_ObjIsCi
(
pObj
)
)
if
(
Wlc_ObjIsCi
(
pObj
)
)
continue
;
continue
;
Range
[
0
]
=
0
;
Range
[
0
]
=
0
;
}
}
if
(
pObj
->
fIsPo
)
if
(
pObj
->
fIsPo
||
(
fNoFlops
&&
pObj
->
fIsFi
)
)
fprintf
(
pFile
,
" assign "
);
fprintf
(
pFile
,
" assign "
);
else
if
(
pObj
->
Type
==
WLC_OBJ_MUX
&&
Wlc_ObjFaninNum
(
pObj
)
>
3
)
else
if
(
pObj
->
Type
==
WLC_OBJ_MUX
&&
Wlc_ObjFaninNum
(
pObj
)
>
3
)
fprintf
(
pFile
,
"reg %s "
,
Range
);
fprintf
(
pFile
,
"reg %s "
,
Range
);
...
@@ -332,6 +332,8 @@ void Wlc_WriteVerInt( FILE * pFile, Wlc_Ntk_t * p )
...
@@ -332,6 +332,8 @@ void Wlc_WriteVerInt( FILE * pFile, Wlc_Ntk_t * p )
}
}
iFanin
=
0
;
iFanin
=
0
;
assert
(
!
p
->
vInits
||
Wlc_NtkFfNum
(
p
)
==
Vec_IntSize
(
p
->
vInits
)
);
assert
(
!
p
->
vInits
||
Wlc_NtkFfNum
(
p
)
==
Vec_IntSize
(
p
->
vInits
)
);
if
(
!
fNoFlops
)
{
if
(
p
->
vInits
)
if
(
p
->
vInits
)
Wlc_NtkForEachCi
(
p
,
pObj
,
i
)
Wlc_NtkForEachCi
(
p
,
pObj
,
i
)
{
{
...
@@ -349,7 +351,7 @@ void Wlc_WriteVerInt( FILE * pFile, Wlc_Ntk_t * p )
...
@@ -349,7 +351,7 @@ void Wlc_WriteVerInt( FILE * pFile, Wlc_Ntk_t * p )
else
else
{
{
fprintf
(
pFile
,
"%d
\'
b"
,
Wlc_ObjRange
(
pObj
)
);
fprintf
(
pFile
,
"%d
\'
b"
,
Wlc_ObjRange
(
pObj
)
);
for
(
k
=
0
;
k
<
Wlc_ObjRange
(
pObj
);
k
++
)
for
(
k
=
Wlc_ObjRange
(
pObj
)
-
1
;
k
>=
0
;
k
--
)
fprintf
(
pFile
,
"%c"
,
p
->
pInits
[
iFanin
+
k
]
);
fprintf
(
pFile
,
"%c"
,
p
->
pInits
[
iFanin
+
k
]
);
}
}
fprintf
(
pFile
,
";
\n
"
);
fprintf
(
pFile
,
";
\n
"
);
...
@@ -379,9 +381,10 @@ void Wlc_WriteVerInt( FILE * pFile, Wlc_Ntk_t * p )
...
@@ -379,9 +381,10 @@ void Wlc_WriteVerInt( FILE * pFile, Wlc_Ntk_t * p )
fprintf
(
pFile
,
" ) ;
\n
"
);
fprintf
(
pFile
,
" ) ;
\n
"
);
}
}
assert
(
!
p
->
vInits
||
iFanin
==
(
int
)
strlen
(
p
->
pInits
)
);
assert
(
!
p
->
vInits
||
iFanin
==
(
int
)
strlen
(
p
->
pInits
)
);
}
fprintf
(
pFile
,
"endmodule
\n\n
"
);
fprintf
(
pFile
,
"endmodule
\n\n
"
);
}
}
void
Wlc_WriteVer
(
Wlc_Ntk_t
*
p
,
char
*
pFileName
,
int
fAddCos
)
void
Wlc_WriteVer
(
Wlc_Ntk_t
*
p
,
char
*
pFileName
,
int
fAddCos
,
int
fNoFlops
)
{
{
FILE
*
pFile
;
FILE
*
pFile
;
pFile
=
fopen
(
pFileName
,
"w"
);
pFile
=
fopen
(
pFileName
,
"w"
);
...
@@ -395,7 +398,7 @@ void Wlc_WriteVer( Wlc_Ntk_t * p, char * pFileName, int fAddCos )
...
@@ -395,7 +398,7 @@ void Wlc_WriteVer( Wlc_Ntk_t * p, char * pFileName, int fAddCos )
Wlc_WriteTables
(
pFile
,
p
);
Wlc_WriteTables
(
pFile
,
p
);
if
(
fAddCos
)
if
(
fAddCos
)
Wlc_WriteAddPos
(
p
);
Wlc_WriteAddPos
(
p
);
Wlc_WriteVerInt
(
pFile
,
p
);
Wlc_WriteVerInt
(
pFile
,
p
,
fNoFlops
);
fprintf
(
pFile
,
"
\n
"
);
fprintf
(
pFile
,
"
\n
"
);
fclose
(
pFile
);
fclose
(
pFile
);
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment