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
1116313d
Commit
1116313d
authored
Nov 11, 2012
by
Alan Mishchenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improved DSD.
parent
21e6a59e
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
126 additions
and
8 deletions
+126
-8
abclib.dsp
+4
-0
src/opt/dau/dau.h
+1
-1
src/opt/dau/dauDivs.c
+111
-0
src/opt/dau/dauDsd.c
+9
-7
src/opt/dau/module.make
+1
-0
No files found.
abclib.dsp
View file @
1116313d
...
...
@@ -1987,6 +1987,10 @@ SOURCE=.\src\opt\dau\dauCore.c
# End Source File
# Begin Source File
SOURCE=.\src\opt\dau\dauDivs.c
# End Source File
# Begin Source File
SOURCE=.\src\opt\dau\dauDsd.c
# End Source File
# Begin Source File
...
...
src/opt/dau/dau.h
View file @
1116313d
...
...
@@ -39,7 +39,7 @@
ABC_NAMESPACE_HEADER_START
#define DAU_MAX_VAR 1
6
// should be 6 or more
#define DAU_MAX_VAR 1
2
// should be 6 or more
#define DAU_MAX_STR 256
#define DAU_MAX_WORD (1<<(DAU_MAX_VAR-6))
...
...
src/opt/dau/dauDivs.c
0 → 100644
View file @
1116313d
/**CFile****************************************************************
FileName [dauDivs.c]
SystemName [ABC: Logic synthesis and verification system.]
PackageName [DAG-aware unmapping.]
Synopsis [Divisor computation.]
Author [Alan Mishchenko]
Affiliation [UC Berkeley]
Date [Ver. 1.0. Started - June 20, 2005.]
Revision [$Id: dauDivs.c,v 1.00 2005/06/20 00:00:00 alanmi Exp $]
***********************************************************************/
#include "dauInt.h"
#include "dau.h"
#include "misc/util/utilTruth.h"
ABC_NAMESPACE_IMPL_START
////////////////////////////////////////////////////////////////////////
/// DECLARATIONS ///
////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////
/// FUNCTION DEFINITIONS ///
////////////////////////////////////////////////////////////////////////
/**Function*************************************************************
Synopsis []
Description []
SideEffects []
SeeAlso []
***********************************************************************/
Vec_Int_t
*
Dau_DsdDivisors
(
word
*
pTruth
,
int
nVars
)
{
word
Copy
[
DAU_MAX_WORD
];
int
nWords
=
Abc_TtWordNum
(
nVars
);
int
nDigits
=
Abc_TtHexDigitNum
(
nVars
);
int
i
,
j
,
k
,
Digit
,
Counter
[
5
];
printf
(
" "
);
printf
(
" !a *!b"
);
printf
(
" !a * b"
);
printf
(
" a *!b"
);
printf
(
" a * b"
);
printf
(
" a + b"
);
printf
(
"
\n
"
);
for
(
i
=
0
;
i
<
nVars
;
i
++
)
for
(
j
=
i
+
1
;
j
<
nVars
;
j
++
)
{
Abc_TtCopy
(
Copy
,
pTruth
,
nWords
,
0
);
Abc_TtSwapVars
(
Copy
,
nVars
,
0
,
i
);
Abc_TtSwapVars
(
Copy
,
nVars
,
1
,
j
);
for
(
k
=
0
;
k
<
5
;
k
++
)
Counter
[
k
]
=
0
;
for
(
k
=
0
;
k
<
nDigits
;
k
++
)
{
Digit
=
Abc_TtGetHex
(
Copy
,
k
);
if
(
Digit
==
1
||
Digit
==
14
)
Counter
[
0
]
++
;
else
if
(
Digit
==
2
||
Digit
==
13
)
Counter
[
1
]
++
;
else
if
(
Digit
==
4
||
Digit
==
11
)
Counter
[
2
]
++
;
else
if
(
Digit
==
8
||
Digit
==
7
)
Counter
[
3
]
++
;
else
if
(
Digit
==
6
||
Digit
==
9
)
Counter
[
4
]
++
;
}
printf
(
"%c %c "
,
'a'
+
i
,
'a'
+
j
);
for
(
k
=
0
;
k
<
5
;
k
++
)
printf
(
"%7d"
,
Counter
[
k
]
);
printf
(
"
\n
"
);
}
return
NULL
;
}
void
Dau_DsdTest
()
{
// char * pDsd = "!(!(abc)!(def))";
// char * pDsd = "[(abc)(def)]";
char
*
pDsd
=
"<<abc>d(ef)>"
;
word
t
=
Dau_Dsd6ToTruth
(
pDsd
);
// word t = 0xCA88CA88CA88CA88;
// word t = 0x9ef7a8d9c7193a0f;
int
nVars
=
Abc_TtSupportSize
(
&
t
,
6
);
return
;
// word t = 0xCACACACACACACACA;
Dau_DsdDivisors
(
&
t
,
nVars
);
}
////////////////////////////////////////////////////////////////////////
/// END OF FILE ///
////////////////////////////////////////////////////////////////////////
ABC_NAMESPACE_IMPL_END
src/opt/dau/dauDsd.c
View file @
1116313d
...
...
@@ -1942,7 +1942,7 @@ void Dau_DsdTest888()
i
=
0
;
}
void
Dau_DsdTest
()
void
Dau_DsdTest
555
()
{
int
nVars
=
10
;
int
nWords
=
Abc_TtWordNum
(
nVars
);
...
...
@@ -1953,8 +1953,8 @@ void Dau_DsdTest()
char
pRes
[
DAU_MAX_STR
];
int
nSizeNonDec
;
int
i
,
Counter
=
0
;
clock_t
clk
=
clock
();
return
;
clock_t
clk
=
clock
()
,
clkDec
=
0
,
clk2
;
//
return;
while
(
fgets
(
pBuffer
,
DAU_MAX_STR
,
pFile
)
!=
NULL
)
{
...
...
@@ -1967,14 +1967,15 @@ void Dau_DsdTest()
continue
;
Counter
++
;
for
(
i
=
0
;
i
<
1
0
;
i
++
)
for
(
i
=
0
;
i
<
1
;
i
++
)
{
Dau_DsdPermute
(
pBuffer
);
// Dau_DsdPermute( pBuffer );
pTruth
=
Dau_DsdToTruth
(
pBuffer
[
0
]
==
'*'
?
pBuffer
+
1
:
pBuffer
,
nVars
);
Abc_TtCopy
(
Tru
[
0
],
pTruth
,
nWords
,
0
);
Abc_TtCopy
(
Tru
[
1
],
pTruth
,
nWords
,
0
);
clk2
=
clock
();
nSizeNonDec
=
Dau_DsdDecompose
(
Tru
[
1
],
nVars
,
0
,
pRes
);
clkDec
+=
clock
()
-
clk2
;
Dau_DsdNormalize
(
pRes
);
// pStr2 = Dau_DsdPerform( t ); nSizeNonDec = 0;
assert
(
nSizeNonDec
==
0
);
...
...
@@ -1990,7 +1991,8 @@ void Dau_DsdTest()
}
}
printf
(
"Finished trying %d decompositions. "
,
Counter
);
Abc_PrintTime
(
1
,
"Time"
,
clock
()
-
clk
);
Abc_PrintTime
(
1
,
"Time"
,
clkDec
);
Abc_PrintTime
(
1
,
"Total"
,
clock
()
-
clk
);
Abc_PrintTime
(
1
,
"Time1"
,
s_Times
[
0
]
);
Abc_PrintTime
(
1
,
"Time2"
,
s_Times
[
1
]
);
...
...
src/opt/dau/module.make
View file @
1116313d
SRC
+=
src/opt/dau/dau.c
\
src/opt/dau/dauCanon.c
\
src/opt/dau/dauCore.c
\
src/opt/dau/dauDivs.c
\
src/opt/dau/dauDsd.c
\
src/opt/dau/dauEnum.c
\
src/opt/dau/dauMerge.c
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