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
028138a7
Commit
028138a7
authored
Mar 30, 2007
by
Alan Mishchenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Version abc70330
parent
4da784c0
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
192 additions
and
5 deletions
+192
-5
abc.dsp
+4
-0
src/base/abc/abc.h
+14
-0
src/base/abc/abcSop.c
+2
-2
src/base/abci/abc.c
+117
-0
src/base/abci/abcDsdRes.c
+0
-0
src/base/abci/module.make
+1
-0
src/base/cmd/cmd.c
+6
-0
src/base/io/io.c
+3
-3
src/misc/vec/vecPtr.h
+39
-0
src/opt/kit/kit.h
+6
-0
src/opt/kit/kitDsd.c
+0
-0
No files found.
abc.dsp
View file @
028138a7
...
@@ -226,6 +226,10 @@ SOURCE=.\src\base\abci\abcDsd.c
...
@@ -226,6 +226,10 @@ SOURCE=.\src\base\abci\abcDsd.c
# End Source File
# End Source File
# Begin Source File
# Begin Source File
SOURCE=.\src\base\abci\abcDsdRes.c
# End Source File
# Begin Source File
SOURCE=.\src\base\abci\abcEspresso.c
SOURCE=.\src\base\abci\abcEspresso.c
# End Source File
# End Source File
# Begin Source File
# Begin Source File
...
...
src/base/abc/abc.h
View file @
028138a7
...
@@ -227,6 +227,20 @@ struct Abc_Lib_t_
...
@@ -227,6 +227,20 @@ struct Abc_Lib_t_
void
*
pGenlib
;
// the genlib library used to map this design
void
*
pGenlib
;
// the genlib library used to map this design
};
};
typedef
struct
Lut_Par_t_
Lut_Par_t
;
struct
Lut_Par_t_
{
// user-controlled parameters
int
nLutsMax
;
// (N) the maximum number of LUTs in the structure
int
nLutsOver
;
// (Q) the maximum number of LUTs not in the MFFC
int
nVarsShared
;
// (S) the maximum number of shared variables (crossbars)
int
fVerbose
;
// the verbosiness flag
int
fVeryVerbose
;
// additional verbose info printout
// internal parameters
int
nLutSize
;
// (K) the LUT size (determined by the input network)
int
nVarsMax
;
// (V) the largest number of variables: V = N * (K-1) + 1
};
////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////
/// MACRO DEFINITIONS ///
/// MACRO DEFINITIONS ///
////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////
...
...
src/base/abc/abcSop.c
View file @
028138a7
...
@@ -922,8 +922,8 @@ char * Abc_SopFromTruthHex( char * pTruth )
...
@@ -922,8 +922,8 @@ char * Abc_SopFromTruthHex( char * pTruth )
{
{
pCube
=
pSopCover
+
i
*
(
nVars
+
3
);
pCube
=
pSopCover
+
i
*
(
nVars
+
3
);
for
(
b
=
0
;
b
<
nVars
;
b
++
)
for
(
b
=
0
;
b
<
nVars
;
b
++
)
if
(
Mint
&
(
1
<<
(
nVars
-
1
-
b
))
)
//
if ( Mint & (1 << (nVars-1-b)) )
//
if ( Mint & (1 << b) )
if
(
Mint
&
(
1
<<
b
)
)
pCube
[
b
]
=
'1'
;
pCube
[
b
]
=
'1'
;
else
else
pCube
[
b
]
=
'0'
;
pCube
[
b
]
=
'0'
;
...
...
src/base/abci/abc.c
View file @
028138a7
...
@@ -63,6 +63,7 @@ static int Abc_CommandSweep ( Abc_Frame_t * pAbc, int argc, char ** arg
...
@@ -63,6 +63,7 @@ static int Abc_CommandSweep ( Abc_Frame_t * pAbc, int argc, char ** arg
static
int
Abc_CommandFastExtract
(
Abc_Frame_t
*
pAbc
,
int
argc
,
char
**
argv
);
static
int
Abc_CommandFastExtract
(
Abc_Frame_t
*
pAbc
,
int
argc
,
char
**
argv
);
static
int
Abc_CommandDisjoint
(
Abc_Frame_t
*
pAbc
,
int
argc
,
char
**
argv
);
static
int
Abc_CommandDisjoint
(
Abc_Frame_t
*
pAbc
,
int
argc
,
char
**
argv
);
static
int
Abc_CommandImfs
(
Abc_Frame_t
*
pAbc
,
int
argc
,
char
**
argv
);
static
int
Abc_CommandImfs
(
Abc_Frame_t
*
pAbc
,
int
argc
,
char
**
argv
);
static
int
Abc_CommandLutjam
(
Abc_Frame_t
*
pAbc
,
int
argc
,
char
**
argv
);
static
int
Abc_CommandRewrite
(
Abc_Frame_t
*
pAbc
,
int
argc
,
char
**
argv
);
static
int
Abc_CommandRewrite
(
Abc_Frame_t
*
pAbc
,
int
argc
,
char
**
argv
);
static
int
Abc_CommandRefactor
(
Abc_Frame_t
*
pAbc
,
int
argc
,
char
**
argv
);
static
int
Abc_CommandRefactor
(
Abc_Frame_t
*
pAbc
,
int
argc
,
char
**
argv
);
...
@@ -217,6 +218,7 @@ void Abc_Init( Abc_Frame_t * pAbc )
...
@@ -217,6 +218,7 @@ void Abc_Init( Abc_Frame_t * pAbc )
Cmd_CommandAdd
(
pAbc
,
"Synthesis"
,
"fx"
,
Abc_CommandFastExtract
,
1
);
Cmd_CommandAdd
(
pAbc
,
"Synthesis"
,
"fx"
,
Abc_CommandFastExtract
,
1
);
Cmd_CommandAdd
(
pAbc
,
"Synthesis"
,
"dsd"
,
Abc_CommandDisjoint
,
1
);
Cmd_CommandAdd
(
pAbc
,
"Synthesis"
,
"dsd"
,
Abc_CommandDisjoint
,
1
);
Cmd_CommandAdd
(
pAbc
,
"Synthesis"
,
"imfs"
,
Abc_CommandImfs
,
1
);
Cmd_CommandAdd
(
pAbc
,
"Synthesis"
,
"imfs"
,
Abc_CommandImfs
,
1
);
Cmd_CommandAdd
(
pAbc
,
"Synthesis"
,
"lutjam"
,
Abc_CommandLutjam
,
1
);
Cmd_CommandAdd
(
pAbc
,
"Synthesis"
,
"rewrite"
,
Abc_CommandRewrite
,
1
);
Cmd_CommandAdd
(
pAbc
,
"Synthesis"
,
"rewrite"
,
Abc_CommandRewrite
,
1
);
Cmd_CommandAdd
(
pAbc
,
"Synthesis"
,
"refactor"
,
Abc_CommandRefactor
,
1
);
Cmd_CommandAdd
(
pAbc
,
"Synthesis"
,
"refactor"
,
Abc_CommandRefactor
,
1
);
...
@@ -2876,6 +2878,121 @@ usage:
...
@@ -2876,6 +2878,121 @@ usage:
return
1
;
return
1
;
}
}
/**Function*************************************************************
Synopsis []
Description []
SideEffects []
SeeAlso []
***********************************************************************/
int
Abc_CommandLutjam
(
Abc_Frame_t
*
pAbc
,
int
argc
,
char
**
argv
)
{
FILE
*
pOut
,
*
pErr
;
Abc_Ntk_t
*
pNtk
;
Lut_Par_t
Pars
,
*
pPars
=
&
Pars
;
int
c
;
extern
int
Abc_LutResynthesize
(
Abc_Ntk_t
*
pNtk
,
Lut_Par_t
*
pPars
);
// printf( "Implementation of this command is not finished.\n" );
// return 1;
pNtk
=
Abc_FrameReadNtk
(
pAbc
);
pOut
=
Abc_FrameReadOut
(
pAbc
);
pErr
=
Abc_FrameReadErr
(
pAbc
);
// set defaults
memset
(
pPars
,
0
,
sizeof
(
Lut_Par_t
)
);
pPars
->
nLutsMax
=
4
;
// (N) the maximum number of LUTs in the structure
pPars
->
nLutsOver
=
1
;
// (Q) the maximum number of LUTs not in the MFFC
pPars
->
nVarsShared
=
0
;
// (S) the maximum number of shared variables (crossbars)
pPars
->
fVerbose
=
0
;
pPars
->
fVeryVerbose
=
0
;
Extra_UtilGetoptReset
();
while
(
(
c
=
Extra_UtilGetopt
(
argc
,
argv
,
"NQSvwh"
)
)
!=
EOF
)
{
switch
(
c
)
{
case
'N'
:
if
(
globalUtilOptind
>=
argc
)
{
fprintf
(
pErr
,
"Command line switch
\"
-N
\"
should be followed by an integer.
\n
"
);
goto
usage
;
}
pPars
->
nLutsMax
=
atoi
(
argv
[
globalUtilOptind
]);
globalUtilOptind
++
;
if
(
pPars
->
nLutsMax
<
2
||
pPars
->
nLutsMax
>
8
)
goto
usage
;
break
;
case
'Q'
:
if
(
globalUtilOptind
>=
argc
)
{
fprintf
(
pErr
,
"Command line switch
\"
-Q
\"
should be followed by an integer.
\n
"
);
goto
usage
;
}
pPars
->
nLutsOver
=
atoi
(
argv
[
globalUtilOptind
]);
globalUtilOptind
++
;
if
(
pPars
->
nLutsOver
<
0
||
pPars
->
nLutsOver
>
8
)
goto
usage
;
break
;
case
'S'
:
if
(
globalUtilOptind
>=
argc
)
{
fprintf
(
pErr
,
"Command line switch
\"
-S
\"
should be followed by an integer.
\n
"
);
goto
usage
;
}
pPars
->
nVarsShared
=
atoi
(
argv
[
globalUtilOptind
]);
globalUtilOptind
++
;
if
(
pPars
->
nVarsShared
<
0
||
pPars
->
nVarsShared
>
4
)
goto
usage
;
break
;
case
'v'
:
pPars
->
fVerbose
^=
1
;
break
;
case
'w'
:
pPars
->
fVeryVerbose
^=
1
;
break
;
case
'h'
:
goto
usage
;
default:
goto
usage
;
}
}
if
(
pNtk
==
NULL
)
{
fprintf
(
pErr
,
"Empty network.
\n
"
);
return
1
;
}
if
(
!
Abc_NtkIsLogic
(
pNtk
)
)
{
fprintf
(
pErr
,
"This command can only be applied to a logic network.
\n
"
);
return
1
;
}
// modify the current network
if
(
!
Abc_LutResynthesize
(
pNtk
,
pPars
)
)
{
fprintf
(
pErr
,
"Resynthesis has failed.
\n
"
);
return
1
;
}
return
0
;
usage:
fprintf
(
pErr
,
"usage: lutjam [-N <num>] [-Q <num>] [-S <num>] [-vwh]
\n
"
);
fprintf
(
pErr
,
"
\t
performs
\"
rewriting
\"
for LUT networks
\n
"
);
fprintf
(
pErr
,
"
\t
-N <num> : the max number of LUTs in the structure (2 <= num) [default = %d]
\n
"
,
pPars
->
nLutsMax
);
fprintf
(
pErr
,
"
\t
-Q <num> : the max number of LUTs not in MFFC (0 <= num) [default = %d]
\n
"
,
pPars
->
nLutsOver
);
fprintf
(
pErr
,
"
\t
-S <num> : the max number of LUT inputs shared (0 <= num) [default = %d]
\n
"
,
pPars
->
nVarsShared
);
fprintf
(
pErr
,
"
\t
-v : toggle verbose printout [default = %s]
\n
"
,
pPars
->
fVerbose
?
"yes"
:
"no"
);
fprintf
(
pErr
,
"
\t
-w : toggle printout subgraph statistics [default = %s]
\n
"
,
pPars
->
fVeryVerbose
?
"yes"
:
"no"
);
fprintf
(
pErr
,
"
\t
-h : print the command usage
\n
"
);
return
1
;
}
/**Function*************************************************************
/**Function*************************************************************
...
...
src/base/abci/abcDsdRes.c
0 → 100644
View file @
028138a7
This diff is collapsed.
Click to expand it.
src/base/abci/module.make
View file @
028138a7
...
@@ -10,6 +10,7 @@ SRC += src/base/abci/abc.c \
...
@@ -10,6 +10,7 @@ SRC += src/base/abci/abc.c \
src/base/abci/abcDebug.c
\
src/base/abci/abcDebug.c
\
src/base/abci/abcDress.c
\
src/base/abci/abcDress.c
\
src/base/abci/abcDsd.c
\
src/base/abci/abcDsd.c
\
src/base/abci/abcDsdRes.c
\
src/base/abci/abcEspresso.c
\
src/base/abci/abcEspresso.c
\
src/base/abci/abcExtract.c
\
src/base/abci/abcExtract.c
\
src/base/abci/abcFpga.c
\
src/base/abci/abcFpga.c
\
...
...
src/base/cmd/cmd.c
View file @
028138a7
...
@@ -1265,6 +1265,8 @@ int CmdCommandSis( Abc_Frame_t * pAbc, int argc, char **argv )
...
@@ -1265,6 +1265,8 @@ int CmdCommandSis( Abc_Frame_t * pAbc, int argc, char **argv )
}
}
// write out the current network
// write out the current network
if
(
Abc_NtkIsLogic
(
pNtk
)
)
Abc_NtkToSop
(
pNtk
,
0
);
pNetlist
=
Abc_NtkToNetlist
(
pNtk
);
pNetlist
=
Abc_NtkToNetlist
(
pNtk
);
if
(
pNetlist
==
NULL
)
if
(
pNetlist
==
NULL
)
{
{
...
@@ -1406,6 +1408,8 @@ int CmdCommandMvsis( Abc_Frame_t * pAbc, int argc, char **argv )
...
@@ -1406,6 +1408,8 @@ int CmdCommandMvsis( Abc_Frame_t * pAbc, int argc, char **argv )
}
}
// write out the current network
// write out the current network
if
(
Abc_NtkIsLogic
(
pNtk
)
)
Abc_NtkToSop
(
pNtk
,
0
);
pNetlist
=
Abc_NtkToNetlist
(
pNtk
);
pNetlist
=
Abc_NtkToNetlist
(
pNtk
);
if
(
pNetlist
==
NULL
)
if
(
pNetlist
==
NULL
)
{
{
...
@@ -1552,6 +1556,8 @@ int CmdCommandCapo( Abc_Frame_t * pAbc, int argc, char **argv )
...
@@ -1552,6 +1556,8 @@ int CmdCommandCapo( Abc_Frame_t * pAbc, int argc, char **argv )
}
}
// write out the current network
// write out the current network
if
(
Abc_NtkIsLogic
(
pNtk
)
)
Abc_NtkToSop
(
pNtk
,
0
);
pNetlist
=
Abc_NtkToNetlist
(
pNtk
);
pNetlist
=
Abc_NtkToNetlist
(
pNtk
);
if
(
pNetlist
==
NULL
)
if
(
pNetlist
==
NULL
)
{
{
...
...
src/base/io/io.c
View file @
028138a7
...
@@ -525,13 +525,13 @@ usage:
...
@@ -525,13 +525,13 @@ usage:
fprintf
(
pAbc
->
Err
,
"
\t
parses a formula representing DSD of a function
\n
"
);
fprintf
(
pAbc
->
Err
,
"
\t
parses a formula representing DSD of a function
\n
"
);
fprintf
(
pAbc
->
Err
,
"
\t
-h : prints the command summary
\n
"
);
fprintf
(
pAbc
->
Err
,
"
\t
-h : prints the command summary
\n
"
);
fprintf
(
pAbc
->
Err
,
"
\t
formula : the formula representing disjoint-support decomposition (DSD)
\n
"
);
fprintf
(
pAbc
->
Err
,
"
\t
formula : the formula representing disjoint-support decomposition (DSD)
\n
"
);
fprintf
(
pAbc
->
Err
,
"
\t
Example of a formula: !(a*(b+CA(
c,!d,e*f
))*79B3(g,h,i,k))
\n
"
);
fprintf
(
pAbc
->
Err
,
"
\t
Example of a formula: !(a*(b+CA(
!d,e*f,c
))*79B3(g,h,i,k))
\n
"
);
fprintf
(
pAbc
->
Err
,
"
\t
where
\'
!
\'
is an INV,
\'
*
\'
is an AND,
\'
+
\'
is an XOR,
\n
"
);
fprintf
(
pAbc
->
Err
,
"
\t
where
\'
!
\'
is an INV,
\'
*
\'
is an AND,
\'
+
\'
is an XOR,
\n
"
);
fprintf
(
pAbc
->
Err
,
"
\t
CA and 79B3 are hexadecimal representations of truth tables
\n
"
);
fprintf
(
pAbc
->
Err
,
"
\t
CA and 79B3 are hexadecimal representations of truth tables
\n
"
);
fprintf
(
pAbc
->
Err
,
"
\t
(in this case CA=11001010 is truth table of MUX(
Ctrl,Data1,Data0
))
\n
"
);
fprintf
(
pAbc
->
Err
,
"
\t
(in this case CA=11001010 is truth table of MUX(
Data0,Data1,Ctrl
))
\n
"
);
fprintf
(
pAbc
->
Err
,
"
\t
The lower chars (a,b,c,etc) are reserved for elementary variables.
\n
"
);
fprintf
(
pAbc
->
Err
,
"
\t
The lower chars (a,b,c,etc) are reserved for elementary variables.
\n
"
);
fprintf
(
pAbc
->
Err
,
"
\t
The upper chars (A,B,C,etc) are reserved for hexadecimal digits.
\n
"
);
fprintf
(
pAbc
->
Err
,
"
\t
The upper chars (A,B,C,etc) are reserved for hexadecimal digits.
\n
"
);
fprintf
(
pAbc
->
Err
,
"
\t
No spaces are allowed in
the formula
.
\n
"
);
fprintf
(
pAbc
->
Err
,
"
\t
No spaces are allowed in
formulas. In parantheses, LSB goes first
.
\n
"
);
return
1
;
return
1
;
}
}
...
...
src/misc/vec/vecPtr.h
View file @
028138a7
...
@@ -177,6 +177,45 @@ static inline Vec_Ptr_t * Vec_PtrAllocSimInfo( int nEntries, int nWords )
...
@@ -177,6 +177,45 @@ static inline Vec_Ptr_t * Vec_PtrAllocSimInfo( int nEntries, int nWords )
/**Function*************************************************************
/**Function*************************************************************
Synopsis [Allocates the array of truth tables for the given number of vars.]
Description []
SideEffects []
SeeAlso []
***********************************************************************/
static
inline
Vec_Ptr_t
*
Vec_PtrAllocTruthTables
(
int
nVars
)
{
Vec_Ptr_t
*
p
;
unsigned
Masks
[
5
]
=
{
0xAAAAAAAA
,
0xCCCCCCCC
,
0xF0F0F0F0
,
0xFF00FF00
,
0xFFFF0000
};
unsigned
*
pTruth
;
int
i
,
k
,
nWords
;
nWords
=
(
nVars
<=
5
?
1
:
(
1
<<
(
nVars
-
5
)));
p
=
Vec_PtrAllocSimInfo
(
nVars
,
nWords
);
for
(
i
=
0
;
i
<
nVars
;
i
++
)
{
pTruth
=
p
->
pArray
[
i
];
if
(
i
<
5
)
{
for
(
k
=
0
;
k
<
nWords
;
k
++
)
pTruth
[
k
]
=
Masks
[
i
];
}
else
{
for
(
k
=
0
;
k
<
nWords
;
k
++
)
if
(
k
&
(
1
<<
(
i
-
5
))
)
pTruth
[
k
]
=
~
(
unsigned
)
0
;
else
pTruth
[
k
]
=
0
;
}
}
return
p
;
}
/**Function*************************************************************
Synopsis [Duplicates the integer array.]
Synopsis [Duplicates the integer array.]
Description []
Description []
...
...
src/opt/kit/kit.h
View file @
028138a7
...
@@ -293,6 +293,12 @@ static inline void Kit_TruthOr( unsigned * pOut, unsigned * pIn0, unsigned * pIn
...
@@ -293,6 +293,12 @@ static inline void Kit_TruthOr( unsigned * pOut, unsigned * pIn0, unsigned * pIn
for
(
w
=
Kit_TruthWordNum
(
nVars
)
-
1
;
w
>=
0
;
w
--
)
for
(
w
=
Kit_TruthWordNum
(
nVars
)
-
1
;
w
>=
0
;
w
--
)
pOut
[
w
]
=
pIn0
[
w
]
|
pIn1
[
w
];
pOut
[
w
]
=
pIn0
[
w
]
|
pIn1
[
w
];
}
}
static
inline
void
Kit_TruthXor
(
unsigned
*
pOut
,
unsigned
*
pIn0
,
unsigned
*
pIn1
,
int
nVars
)
{
int
w
;
for
(
w
=
Kit_TruthWordNum
(
nVars
)
-
1
;
w
>=
0
;
w
--
)
pOut
[
w
]
=
pIn0
[
w
]
^
pIn1
[
w
];
}
static
inline
void
Kit_TruthSharp
(
unsigned
*
pOut
,
unsigned
*
pIn0
,
unsigned
*
pIn1
,
int
nVars
)
static
inline
void
Kit_TruthSharp
(
unsigned
*
pOut
,
unsigned
*
pIn0
,
unsigned
*
pIn1
,
int
nVars
)
{
{
int
w
;
int
w
;
...
...
src/opt/kit/kitDsd.c
View file @
028138a7
This diff is collapsed.
Click to expand it.
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