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
3f6c08df
Commit
3f6c08df
authored
Sep 23, 2014
by
Alan Mishchenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Debugging the bit-blaster.
parent
15f54289
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
28 additions
and
8 deletions
+28
-8
src/base/cmd/cmdHist.c
+1
-1
src/base/wlc/wlcBlast.c
+27
-7
No files found.
src/base/cmd/cmdHist.c
View file @
3f6c08df
...
...
@@ -61,7 +61,7 @@ void Cmd_HistoryAddCommand( Abc_Frame_t * p, const char * command )
strncmp
(
Buffer
,
"set"
,
3
)
&&
strncmp
(
Buffer
,
"time"
,
4
)
&&
strncmp
(
Buffer
,
"quit"
,
4
)
&&
strncmp
(
Buffer
,
"source"
,
6
)
&&
//
strncmp(Buffer,"source",6) &&
strncmp
(
Buffer
,
"history"
,
7
)
&&
strncmp
(
Buffer
,
"hi "
,
3
)
&&
strcmp
(
Buffer
,
"hi"
)
&&
Buffer
[
strlen
(
Buffer
)
-
1
]
!=
'?'
)
{
...
...
src/base/wlc/wlcBlast.c
View file @
3f6c08df
...
...
@@ -87,6 +87,7 @@ void Wlc_BlastShiftRight( Gia_Man_t * pNew, int * pNum, int nNum, int * pShift,
int
*
pRes
=
Wlc_VecCopy
(
vRes
,
pNum
,
nNum
);
int
Fill
=
fSticky
?
pNum
[
nNum
-
1
]
:
0
;
int
i
,
j
,
fShort
=
0
;
assert
(
nShift
<=
32
);
for
(
i
=
0
;
i
<
nShift
;
i
++
)
for
(
j
=
0
;
j
<
nNum
-
fSticky
;
j
++
)
{
...
...
@@ -105,6 +106,7 @@ void Wlc_BlastShiftLeft( Gia_Man_t * pNew, int * pNum, int nNum, int * pShift, i
int
*
pRes
=
Wlc_VecCopy
(
vRes
,
pNum
,
nNum
);
int
Fill
=
fSticky
?
pNum
[
0
]
:
0
;
int
i
,
j
,
fShort
=
0
;
assert
(
nShift
<=
32
);
for
(
i
=
0
;
i
<
nShift
;
i
++
)
for
(
j
=
nNum
-
1
;
j
>=
fSticky
;
j
--
)
{
...
...
@@ -120,18 +122,22 @@ void Wlc_BlastShiftLeft( Gia_Man_t * pNew, int * pNum, int nNum, int * pShift, i
}
void
Wlc_BlastRotateRight
(
Gia_Man_t
*
pNew
,
int
*
pNum
,
int
nNum
,
int
*
pShift
,
int
nShift
,
Vec_Int_t
*
vRes
)
{
int
*
pRes
=
Wlc_VecCopy
(
vRes
,
pNum
,
nNum
);
int
i
,
j
,
*
pTemp
=
ABC_ALLOC
(
int
,
nNum
);
for
(
i
=
0
;
i
<
nShift
;
i
++
,
Wlc_VecCopy
(
vRes
,
pTemp
,
nNum
)
)
assert
(
nShift
<=
32
);
for
(
i
=
0
;
i
<
nShift
;
i
++
,
pRes
=
Wlc_VecCopy
(
vRes
,
pTemp
,
nNum
)
)
for
(
j
=
0
;
j
<
nNum
;
j
++
)
pTemp
[
j
]
=
Gia_ManHashMux
(
pNew
,
pShift
[
i
],
p
Num
[(
j
+
(
1
<<
i
))
%
nNum
],
pNum
[
j
]
);
pTemp
[
j
]
=
Gia_ManHashMux
(
pNew
,
pShift
[
i
],
p
Res
[(
j
+
(
1
<<
i
))
%
nNum
],
pRes
[
j
]
);
ABC_FREE
(
pTemp
);
}
void
Wlc_BlastRotateLeft
(
Gia_Man_t
*
pNew
,
int
*
pNum
,
int
nNum
,
int
*
pShift
,
int
nShift
,
Vec_Int_t
*
vRes
)
{
int
*
pRes
=
Wlc_VecCopy
(
vRes
,
pNum
,
nNum
);
int
i
,
j
,
*
pTemp
=
ABC_ALLOC
(
int
,
nNum
);
for
(
i
=
0
;
i
<
nShift
;
i
++
,
Wlc_VecCopy
(
vRes
,
pTemp
,
nNum
)
)
assert
(
nShift
<=
32
);
for
(
i
=
0
;
i
<
nShift
;
i
++
,
pRes
=
Wlc_VecCopy
(
vRes
,
pTemp
,
nNum
)
)
for
(
j
=
0
;
j
<
nNum
;
j
++
)
pTemp
[
j
]
=
Gia_ManHashMux
(
pNew
,
pShift
[
i
],
p
Num
[(
nNum
-
(
1
<<
i
)
+
j
)
%
nNum
],
pNum
[
j
]
);
pTemp
[
j
]
=
Gia_ManHashMux
(
pNew
,
pShift
[
i
],
p
Res
[((
unsigned
)(
nNum
-
(
1
<<
i
)
+
j
))
%
nNum
],
pRes
[
j
]
);
ABC_FREE
(
pTemp
);
}
int
Wlc_BlastReduction
(
Gia_Man_t
*
pNew
,
int
*
pFans
,
int
nFans
,
int
Type
)
...
...
@@ -187,6 +193,17 @@ void Wlc_BlastAdder( Gia_Man_t * pNew, int * pAdd0, int * pAdd1, int nBits ) //
pAdd0
[
b
]
=
iSum
;
}
}
void
Wlc_BlastSubtract
(
Gia_Man_t
*
pNew
,
int
*
pAdd0
,
int
*
pAdd1
,
int
nBits
)
// result is in pAdd0
{
int
borrow
=
0
,
top_bit
,
b
;
for
(
b
=
0
;
b
<
nBits
;
b
++
)
{
top_bit
=
Gia_ManHashMux
(
pNew
,
borrow
,
Abc_LitNot
(
pAdd0
[
b
]),
pAdd0
[
b
]);
borrow
=
Gia_ManHashMux
(
pNew
,
pAdd0
[
b
],
Gia_ManHashAnd
(
pNew
,
borrow
,
pAdd1
[
b
]),
Gia_ManHashOr
(
pNew
,
borrow
,
pAdd1
[
b
]));
pAdd0
[
b
]
=
Gia_ManHashXor
(
pNew
,
top_bit
,
pAdd1
[
b
]);
}
}
void
Wlc_BlastMultiplier
(
Gia_Man_t
*
pNew
,
int
*
pArg0
,
int
*
pArg1
,
int
nBits
,
Vec_Int_t
*
vTemp
,
Vec_Int_t
*
vRes
)
{
int
i
,
j
;
...
...
@@ -467,11 +484,14 @@ Gia_Man_t * Wlc_NtkBitBlast( Wlc_Ntk_t * p )
}
else
if
(
pObj
->
Type
==
WLC_OBJ_REDUCT_AND
||
pObj
->
Type
==
WLC_OBJ_REDUCT_OR
||
pObj
->
Type
==
WLC_OBJ_REDUCT_XOR
)
Vec_IntPush
(
vRes
,
Wlc_BlastReduction
(
pNew
,
pFans0
,
nRange
,
pObj
->
Type
)
);
else
if
(
pObj
->
Type
==
WLC_OBJ_ARI_ADD
||
pObj
->
Type
==
WLC_OBJ_ARI_SUB
)
// SUBTRACT is not implemented!
else
if
(
pObj
->
Type
==
WLC_OBJ_ARI_ADD
||
pObj
->
Type
==
WLC_OBJ_ARI_SUB
)
{
int
*
pArg0
=
Wlc_VecLoadFanins
(
vRes
,
pFans0
,
nRange0
,
nRange
,
Wlc_ObjFanin0
(
p
,
pObj
)
->
Signed
);
int
*
pArg1
=
Wlc_VecLoadFanins
(
vTemp1
,
pFans1
,
nRange1
,
nRange
,
Wlc_ObjFanin1
(
p
,
pObj
)
->
Signed
);
Wlc_BlastAdder
(
pNew
,
pArg0
,
pArg1
,
nRange
);
// result is in pFan0 (vRes)
if
(
pObj
->
Type
==
WLC_OBJ_ARI_ADD
)
Wlc_BlastAdder
(
pNew
,
pArg0
,
pArg1
,
nRange
);
// result is in pFan0 (vRes)
else
Wlc_BlastSubtract
(
pNew
,
pArg0
,
pArg1
,
nRange
);
// result is in pFan0 (vRes)
}
else
if
(
pObj
->
Type
==
WLC_OBJ_ARI_MULTI
)
{
...
...
@@ -485,7 +505,7 @@ Gia_Man_t * Wlc_NtkBitBlast( Wlc_Ntk_t * p )
int
*
pArg0
=
Wlc_VecLoadFanins
(
vTemp0
,
pFans0
,
nRange0
,
nRange
,
Wlc_ObjFanin0
(
p
,
pObj
)
->
Signed
);
int
*
pArg1
=
Wlc_VecLoadFanins
(
vTemp1
,
pFans1
,
nRange1
,
nRange
,
Wlc_ObjFanin1
(
p
,
pObj
)
->
Signed
);
assert
(
nRange0
<=
nRange
&&
nRange1
<=
nRange
);
Wlc_BlastDivider
(
pNew
,
pArg0
,
nRange
0
,
pArg1
,
nRange1
,
pObj
->
Type
==
WLC_OBJ_ARI_DIVIDE
,
vRes
);
Wlc_BlastDivider
(
pNew
,
pArg0
,
nRange
,
pArg1
,
nRange
,
pObj
->
Type
==
WLC_OBJ_ARI_DIVIDE
,
vRes
);
}
else
if
(
pObj
->
Type
==
WLC_OBJ_ARI_MINUS
)
{
...
...
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