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
fb12c23a
Commit
fb12c23a
authored
Apr 17, 2017
by
Alan Mishchenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Logic restruturing after mapping.
parent
fea18c2d
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
141 additions
and
1 deletions
+141
-1
abclib.dsp
+4
-0
src/base/abci/abc.c
+69
-0
src/base/acb/acbAbc.c
+22
-0
src/base/acb/module.make
+1
-0
src/misc/util/utilTruth.h
+45
-1
No files found.
abclib.dsp
View file @
fb12c23a
...
...
@@ -1083,6 +1083,10 @@ SOURCE=.\src\base\acb\acbPar.h
# End Source File
# Begin Source File
SOURCE=.\src\base\acb\acbPush.c
# End Source File
# Begin Source File
SOURCE=.\src\base\acb\acbSets.c
# End Source File
# Begin Source File
...
...
src/base/abci/abc.c
View file @
fb12c23a
...
...
@@ -124,6 +124,7 @@ static int Abc_CommandMfs ( Abc_Frame_t * pAbc, int argc, cha
static
int
Abc_CommandMfs2
(
Abc_Frame_t
*
pAbc
,
int
argc
,
char
**
argv
);
static
int
Abc_CommandMfs3
(
Abc_Frame_t
*
pAbc
,
int
argc
,
char
**
argv
);
static
int
Abc_CommandMfse
(
Abc_Frame_t
*
pAbc
,
int
argc
,
char
**
argv
);
static
int
Abc_CommandLogicPush
(
Abc_Frame_t
*
pAbc
,
int
argc
,
char
**
argv
);
static
int
Abc_CommandTrace
(
Abc_Frame_t
*
pAbc
,
int
argc
,
char
**
argv
);
static
int
Abc_CommandGlitch
(
Abc_Frame_t
*
pAbc
,
int
argc
,
char
**
argv
);
static
int
Abc_CommandSpeedup
(
Abc_Frame_t
*
pAbc
,
int
argc
,
char
**
argv
);
...
...
@@ -781,6 +782,7 @@ void Abc_Init( Abc_Frame_t * pAbc )
Cmd_CommandAdd
(
pAbc
,
"Synthesis"
,
"mfs2"
,
Abc_CommandMfs2
,
1
);
Cmd_CommandAdd
(
pAbc
,
"Synthesis"
,
"mfs3"
,
Abc_CommandMfs3
,
1
);
Cmd_CommandAdd
(
pAbc
,
"Synthesis"
,
"mfse"
,
Abc_CommandMfse
,
1
);
Cmd_CommandAdd
(
pAbc
,
"Synthesis"
,
"logicpush"
,
Abc_CommandLogicPush
,
1
);
Cmd_CommandAdd
(
pAbc
,
"Synthesis"
,
"trace"
,
Abc_CommandTrace
,
0
);
Cmd_CommandAdd
(
pAbc
,
"Synthesis"
,
"glitch"
,
Abc_CommandGlitch
,
0
);
Cmd_CommandAdd
(
pAbc
,
"Synthesis"
,
"speedup"
,
Abc_CommandSpeedup
,
1
);
...
...
@@ -5807,6 +5809,73 @@ usage:
return
1
;
}
/**Function*************************************************************
Synopsis []
Description []
SideEffects []
SeeAlso []
***********************************************************************/
int
Abc_CommandLogicPush
(
Abc_Frame_t
*
pAbc
,
int
argc
,
char
**
argv
)
{
extern
Abc_Ntk_t
*
Abc_NtkOptPush
(
Abc_Ntk_t
*
pNtk
,
int
nLutSize
,
int
fVerbose
);
Abc_Ntk_t
*
pNtk
=
Abc_FrameReadNtk
(
pAbc
);
Abc_Ntk_t
*
pNtkRes
;
int
nLutSize
=
4
;
int
fVerbose
=
0
;
int
c
;
Extra_UtilGetoptReset
();
while
(
(
c
=
Extra_UtilGetopt
(
argc
,
argv
,
"Kvh"
)
)
!=
EOF
)
{
switch
(
c
)
{
case
'K'
:
if
(
globalUtilOptind
>=
argc
)
{
Abc_Print
(
-
1
,
"Command line switch
\"
-K
\"
should be followed by a positive integer.
\n
"
);
goto
usage
;
}
nLutSize
=
atoi
(
argv
[
globalUtilOptind
]);
globalUtilOptind
++
;
if
(
nLutSize
<
0
)
goto
usage
;
break
;
case
'v'
:
fVerbose
^=
1
;
break
;
case
'h'
:
goto
usage
;
default:
goto
usage
;
}
}
if
(
pNtk
==
NULL
)
{
Abc_Print
(
-
1
,
"Empty network.
\n
"
);
return
1
;
}
if
(
!
Abc_NtkIsLogic
(
pNtk
)
)
{
Abc_Print
(
-
1
,
"This command can only be applied to a logic network.
\n
"
);
return
1
;
}
Abc_NtkToSop
(
pNtk
,
-
1
,
ABC_INFINITY
);
pNtkRes
=
Abc_NtkOptPush
(
pNtk
,
nLutSize
,
fVerbose
);
Abc_FrameReplaceCurrentNetwork
(
pAbc
,
pNtkRes
);
return
0
;
usage:
Abc_Print
(
-
2
,
"usage: logicpush [-K num] [-vh]
\n
"
);
Abc_Print
(
-
2
,
"
\t
performs logic pushing to reduce structural bias
\n
"
);
Abc_Print
(
-
2
,
"
\t
-K <num> : the LUT size used in the mapping [default = %d]
\n
"
,
nLutSize
);
Abc_Print
(
-
2
,
"
\t
-v : toggle printing optimization summary [default = %s]
\n
"
,
fVerbose
?
"yes"
:
"no"
);
Abc_Print
(
-
2
,
"
\t
-h : print the command usage
\n
"
);
return
1
;
}
/**Function*************************************************************
src/base/acb/acbAbc.c
View file @
fb12c23a
...
...
@@ -271,6 +271,28 @@ Abc_Ntk_t * Abc_NtkOptMfse( Abc_Ntk_t * pNtk, Acb_Par_t * pPars )
return
pNtkNew
;
}
/**Function*************************************************************
Synopsis []
Description []
SideEffects []
SeeAlso []
***********************************************************************/
Abc_Ntk_t
*
Abc_NtkOptPush
(
Abc_Ntk_t
*
pNtk
,
int
nLutSize
,
int
fVerbose
)
{
extern
void
Acb_NtkPushLogic
(
Acb_Ntk_t
*
p
,
int
nLutSize
,
int
fVerbose
);
Abc_Ntk_t
*
pNtkNew
;
Acb_Ntk_t
*
p
=
Acb_NtkFromAbc
(
pNtk
);
Acb_NtkPushLogic
(
p
,
nLutSize
,
fVerbose
);
pNtkNew
=
Acb_NtkToAbc
(
pNtk
,
p
);
Acb_ManFree
(
p
->
pDesign
);
return
pNtkNew
;
}
////////////////////////////////////////////////////////////////////////
/// END OF FILE ///
////////////////////////////////////////////////////////////////////////
...
...
src/base/acb/module.make
View file @
fb12c23a
...
...
@@ -3,5 +3,6 @@ SRC += src/base/acb/acbAbc.c \
src/base/acb/acbCom.c
\
src/base/acb/acbFunc.c
\
src/base/acb/acbMfs.c
\
src/base/acb/acbPush.c
\
src/base/acb/acbSets.c
\
src/base/acb/acbUtil.c
src/misc/util/utilTruth.h
View file @
fb12c23a
...
...
@@ -2209,7 +2209,51 @@ static inline int Abc_Tt6EsopVerify( word t, int nVars )
/**Function*************************************************************
Synopsis [Check if the function is decomposable with the given pair.]
Synopsis [Check if the function is output-decomposable with the given var.]
Description []
SideEffects []
SeeAlso []
***********************************************************************/
static
inline
int
Abc_TtCheckOutAnd
(
word
t
,
int
i
,
word
*
pOut
)
{
word
c0
=
Abc_Tt6Cofactor0
(
t
,
i
);
word
c1
=
Abc_Tt6Cofactor1
(
t
,
i
);
assert
(
c0
==
c1
);
if
(
c0
==
0
)
// F = i * G
{
if
(
pOut
)
*
pOut
=
c1
;
return
0
;
}
if
(
c1
==
0
)
// F = ~i * G
{
if
(
pOut
)
*
pOut
=
c0
;
return
1
;
}
if
(
~
c0
==
0
)
// F = ~i + G
{
if
(
pOut
)
*
pOut
=
c1
;
return
2
;
}
if
(
~
c1
==
0
)
// F = i + G
{
if
(
pOut
)
*
pOut
=
c0
;
return
3
;
}
if
(
c0
==
~
c1
)
// F = i # G
{
if
(
pOut
)
*
pOut
=
c0
;
return
4
;
}
return
-
1
;
}
/**Function*************************************************************
Synopsis [Check if the function is input-decomposable with the given pair.]
Description []
...
...
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