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
3a1032c1
Commit
3a1032c1
authored
7 years ago
by
Alan Mishchenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Maintenance and updates.
parent
7e7ba156
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
138 additions
and
82 deletions
+138
-82
src/map/if/if.h
+1
-0
src/map/mio/mio.h
+1
-0
src/map/mio/mioFunc.c
+5
-0
src/map/mio/mioUtils.c
+49
-0
src/misc/util/utilTruth.h
+82
-0
src/opt/dau/dauCanon.c
+0
-82
No files found.
src/map/if/if.h
View file @
3a1032c1
...
...
@@ -267,6 +267,7 @@ struct If_Man_t_
Vec_Int_t
*
vCutData
;
// cut data storage
int
pArrTimeProfile
[
IF_MAX_FUNC_LUTSIZE
];
Vec_Ptr_t
*
vVisited
;
void
*
pUserMan
;
// timing manager
Tim_Man_t
*
pManTim
;
...
...
This diff is collapsed.
Click to expand it.
src/map/mio/mio.h
View file @
3a1032c1
...
...
@@ -198,6 +198,7 @@ extern Mio_Gate_t ** Mio_CollectRoots( Mio_Library_t * pLib, int nInputs, fl
extern
Mio_Cell_t
*
Mio_CollectRootsNew
(
Mio_Library_t
*
pLib
,
int
nInputs
,
int
*
pnGates
,
int
fVerbose
);
extern
Mio_Cell_t
*
Mio_CollectRootsNewDefault
(
int
nInputs
,
int
*
pnGates
,
int
fVerbose
);
extern
Mio_Cell2_t
*
Mio_CollectRootsNewDefault2
(
int
nInputs
,
int
*
pnGates
,
int
fVerbose
);
extern
int
Mio_CollectRootsNewDefault3
(
int
nInputs
,
Vec_Ptr_t
**
pvNames
,
Vec_Wrd_t
**
pvTruths
);
extern
word
Mio_DeriveTruthTable6
(
Mio_Gate_t
*
pGate
);
extern
void
Mio_DeriveTruthTable
(
Mio_Gate_t
*
pGate
,
unsigned
uTruthsIn
[][
2
],
int
nSigns
,
int
nInputs
,
unsigned
uTruthRes
[]
);
extern
void
Mio_DeriveGateDelays
(
Mio_Gate_t
*
pGate
,
...
...
This diff is collapsed.
Click to expand it.
src/map/mio/mioFunc.c
View file @
3a1032c1
...
...
@@ -268,6 +268,11 @@ int Mio_GateParseFormula( Mio_Gate_t * pGate )
// derive truth table
if
(
nPins
<=
6
)
pGate
->
uTruth
=
Exp_Truth6
(
nPins
,
pGate
->
vExpr
,
NULL
);
else
if
(
nPins
<=
8
)
{
pGate
->
pTruth
=
ABC_CALLOC
(
word
,
4
);
Exp_Truth8
(
nPins
,
pGate
->
vExpr
,
NULL
,
pGate
->
pTruth
);
}
/*
// verify
...
...
This diff is collapsed.
Click to expand it.
src/map/mio/mioUtils.c
View file @
3a1032c1
...
...
@@ -790,6 +790,55 @@ Mio_Cell2_t * Mio_CollectRootsNewDefault2( int nInputs, int * pnGates, int fVerb
SeeAlso []
***********************************************************************/
int
Mio_CollectRootsNewDefault3
(
int
nInputs
,
Vec_Ptr_t
**
pvNames
,
Vec_Wrd_t
**
pvTruths
)
{
Mio_Library_t
*
pLib
=
(
Mio_Library_t
*
)
Abc_FrameReadLibGen
();
int
i
,
iGate
=
0
,
nGates
=
pLib
?
Mio_LibraryReadGateNum
(
pLib
)
:
0
;
Mio_Gate_t
*
pGate0
,
**
ppGates
;
word
*
pTruth
;
if
(
pLib
==
NULL
)
return
0
;
ppGates
=
ABC_CALLOC
(
Mio_Gate_t
*
,
nGates
);
Mio_LibraryForEachGate
(
pLib
,
pGate0
)
ppGates
[
pGate0
->
Cell
]
=
pGate0
;
*
pvNames
=
Vec_PtrAlloc
(
nGates
);
*
pvTruths
=
Vec_WrdStart
(
nGates
*
4
);
for
(
i
=
0
;
i
<
nGates
;
i
++
)
{
pGate0
=
ppGates
[
i
];
if
(
pGate0
->
nInputs
>
nInputs
||
pGate0
->
pTwin
)
// skip large and multi-output
continue
;
Vec_PtrPush
(
*
pvNames
,
pGate0
->
pName
);
pTruth
=
Vec_WrdEntryP
(
*
pvTruths
,
iGate
++*
4
);
if
(
pGate0
->
nInputs
<=
6
)
pTruth
[
0
]
=
pTruth
[
1
]
=
pTruth
[
2
]
=
pTruth
[
3
]
=
pGate0
->
uTruth
;
else
if
(
pGate0
->
nInputs
==
7
)
{
pTruth
[
0
]
=
pTruth
[
2
]
=
pGate0
->
pTruth
[
0
];
pTruth
[
1
]
=
pTruth
[
3
]
=
pGate0
->
pTruth
[
1
];
}
else
if
(
pGate0
->
nInputs
==
8
)
memcpy
(
pTruth
,
pGate0
->
pTruth
,
4
*
sizeof
(
word
)
);
}
assert
(
iGate
==
nGates
);
assert
(
Vec_WrdEntry
(
*
pvTruths
,
0
)
==
0
);
assert
(
Vec_WrdEntry
(
*
pvTruths
,
4
)
==
~
(
word
)
0
);
assert
(
Vec_WrdEntry
(
*
pvTruths
,
8
)
==
s_Truths6
[
0
]
);
assert
(
Vec_WrdEntry
(
*
pvTruths
,
12
)
==
~
s_Truths6
[
0
]
);
ABC_FREE
(
ppGates
);
return
nGates
;
}
/**Function*************************************************************
Synopsis [Derives the truth table of the gate.]
Description []
SideEffects []
SeeAlso []
***********************************************************************/
word
Mio_DeriveTruthTable6
(
Mio_Gate_t
*
pGate
)
{
static
unsigned
uTruths6
[
6
][
2
]
=
{
...
...
This diff is collapsed.
Click to expand it.
src/misc/util/utilTruth.h
View file @
3a1032c1
...
...
@@ -420,6 +420,88 @@ static inline void Abc_TtConst1( word * pIn1, int nWords )
/**Function*************************************************************
Synopsis [Compares Cof0 and Cof1.]
Description []
SideEffects []
SeeAlso []
***********************************************************************/
static
inline
int
Abc_TtCompare1VarCofs
(
word
*
pTruth
,
int
nWords
,
int
iVar
)
{
if
(
nWords
==
1
)
{
word
Cof0
=
pTruth
[
0
]
&
s_Truths6Neg
[
iVar
];
word
Cof1
=
(
pTruth
[
0
]
>>
(
1
<<
iVar
))
&
s_Truths6Neg
[
iVar
];
if
(
Cof0
!=
Cof1
)
return
Cof0
<
Cof1
?
-
1
:
1
;
return
0
;
}
if
(
iVar
<=
5
)
{
word
Cof0
,
Cof1
;
int
w
,
shift
=
(
1
<<
iVar
);
for
(
w
=
0
;
w
<
nWords
;
w
++
)
{
Cof0
=
pTruth
[
w
]
&
s_Truths6Neg
[
iVar
];
Cof1
=
(
pTruth
[
w
]
>>
shift
)
&
s_Truths6Neg
[
iVar
];
if
(
Cof0
!=
Cof1
)
return
Cof0
<
Cof1
?
-
1
:
1
;
}
return
0
;
}
// if ( iVar > 5 )
{
word
*
pLimit
=
pTruth
+
nWords
;
int
i
,
iStep
=
Abc_TtWordNum
(
iVar
);
assert
(
nWords
>=
2
);
for
(
;
pTruth
<
pLimit
;
pTruth
+=
2
*
iStep
)
for
(
i
=
0
;
i
<
iStep
;
i
++
)
if
(
pTruth
[
i
]
!=
pTruth
[
i
+
iStep
]
)
return
pTruth
[
i
]
<
pTruth
[
i
+
iStep
]
?
-
1
:
1
;
return
0
;
}
}
static
inline
int
Abc_TtCompare1VarCofsRev
(
word
*
pTruth
,
int
nWords
,
int
iVar
)
{
if
(
nWords
==
1
)
{
word
Cof0
=
pTruth
[
0
]
&
s_Truths6Neg
[
iVar
];
word
Cof1
=
(
pTruth
[
0
]
>>
(
1
<<
iVar
))
&
s_Truths6Neg
[
iVar
];
if
(
Cof0
!=
Cof1
)
return
Cof0
<
Cof1
?
-
1
:
1
;
return
0
;
}
if
(
iVar
<=
5
)
{
word
Cof0
,
Cof1
;
int
w
,
shift
=
(
1
<<
iVar
);
for
(
w
=
nWords
-
1
;
w
>=
0
;
w
--
)
{
Cof0
=
pTruth
[
w
]
&
s_Truths6Neg
[
iVar
];
Cof1
=
(
pTruth
[
w
]
>>
shift
)
&
s_Truths6Neg
[
iVar
];
if
(
Cof0
!=
Cof1
)
return
Cof0
<
Cof1
?
-
1
:
1
;
}
return
0
;
}
// if ( iVar > 5 )
{
word
*
pLimit
=
pTruth
+
nWords
;
int
i
,
iStep
=
Abc_TtWordNum
(
iVar
);
assert
(
nWords
>=
2
);
for
(
pLimit
-=
2
*
iStep
;
pLimit
>=
pTruth
;
pLimit
-=
2
*
iStep
)
for
(
i
=
iStep
-
1
;
i
>=
0
;
i
--
)
if
(
pLimit
[
i
]
!=
pLimit
[
i
+
iStep
]
)
return
pLimit
[
i
]
<
pLimit
[
i
+
iStep
]
?
-
1
:
1
;
return
0
;
}
}
/**Function*************************************************************
Synopsis [Compute elementary truth tables.]
Description []
...
...
This diff is collapsed.
Click to expand it.
src/opt/dau/dauCanon.c
View file @
3a1032c1
...
...
@@ -43,88 +43,6 @@ static word s_CMasks6[5] = {
/**Function*************************************************************
Synopsis [Compares Cof0 and Cof1.]
Description []
SideEffects []
SeeAlso []
***********************************************************************/
static
inline
int
Abc_TtCompare1VarCofs
(
word
*
pTruth
,
int
nWords
,
int
iVar
)
{
if
(
nWords
==
1
)
{
word
Cof0
=
pTruth
[
0
]
&
s_Truths6Neg
[
iVar
];
word
Cof1
=
(
pTruth
[
0
]
>>
(
1
<<
iVar
))
&
s_Truths6Neg
[
iVar
];
if
(
Cof0
!=
Cof1
)
return
Cof0
<
Cof1
?
-
1
:
1
;
return
0
;
}
if
(
iVar
<=
5
)
{
word
Cof0
,
Cof1
;
int
w
,
shift
=
(
1
<<
iVar
);
for
(
w
=
0
;
w
<
nWords
;
w
++
)
{
Cof0
=
pTruth
[
w
]
&
s_Truths6Neg
[
iVar
];
Cof1
=
(
pTruth
[
w
]
>>
shift
)
&
s_Truths6Neg
[
iVar
];
if
(
Cof0
!=
Cof1
)
return
Cof0
<
Cof1
?
-
1
:
1
;
}
return
0
;
}
// if ( iVar > 5 )
{
word
*
pLimit
=
pTruth
+
nWords
;
int
i
,
iStep
=
Abc_TtWordNum
(
iVar
);
assert
(
nWords
>=
2
);
for
(
;
pTruth
<
pLimit
;
pTruth
+=
2
*
iStep
)
for
(
i
=
0
;
i
<
iStep
;
i
++
)
if
(
pTruth
[
i
]
!=
pTruth
[
i
+
iStep
]
)
return
pTruth
[
i
]
<
pTruth
[
i
+
iStep
]
?
-
1
:
1
;
return
0
;
}
}
static
inline
int
Abc_TtCompare1VarCofsRev
(
word
*
pTruth
,
int
nWords
,
int
iVar
)
{
if
(
nWords
==
1
)
{
word
Cof0
=
pTruth
[
0
]
&
s_Truths6Neg
[
iVar
];
word
Cof1
=
(
pTruth
[
0
]
>>
(
1
<<
iVar
))
&
s_Truths6Neg
[
iVar
];
if
(
Cof0
!=
Cof1
)
return
Cof0
<
Cof1
?
-
1
:
1
;
return
0
;
}
if
(
iVar
<=
5
)
{
word
Cof0
,
Cof1
;
int
w
,
shift
=
(
1
<<
iVar
);
for
(
w
=
nWords
-
1
;
w
>=
0
;
w
--
)
{
Cof0
=
pTruth
[
w
]
&
s_Truths6Neg
[
iVar
];
Cof1
=
(
pTruth
[
w
]
>>
shift
)
&
s_Truths6Neg
[
iVar
];
if
(
Cof0
!=
Cof1
)
return
Cof0
<
Cof1
?
-
1
:
1
;
}
return
0
;
}
// if ( iVar > 5 )
{
word
*
pLimit
=
pTruth
+
nWords
;
int
i
,
iStep
=
Abc_TtWordNum
(
iVar
);
assert
(
nWords
>=
2
);
for
(
pLimit
-=
2
*
iStep
;
pLimit
>=
pTruth
;
pLimit
-=
2
*
iStep
)
for
(
i
=
iStep
-
1
;
i
>=
0
;
i
--
)
if
(
pLimit
[
i
]
!=
pLimit
[
i
+
iStep
]
)
return
pLimit
[
i
]
<
pLimit
[
i
+
iStep
]
?
-
1
:
1
;
return
0
;
}
}
/**Function*************************************************************
Synopsis [Checks equality of pairs of cofactors w.r.t. adjacent variables.]
Description []
...
...
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