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
ad5ee9ff
Commit
ad5ee9ff
authored
Oct 12, 2011
by
Alan Mishchenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Changes to the matching procedure.
parent
191de3e8
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
58 additions
and
36 deletions
+58
-36
src/base/io/ioWriteBlif.c
+58
-36
src/map/if/ifDec16.c
+0
-0
No files found.
src/base/io/ioWriteBlif.c
View file @
ad5ee9ff
...
@@ -840,36 +840,34 @@ void Io_NtkWriteNodeIntStruct( FILE * pFile, Abc_Obj_t * pNode, Vec_Int_t * vCov
...
@@ -840,36 +840,34 @@ void Io_NtkWriteNodeIntStruct( FILE * pFile, Abc_Obj_t * pNode, Vec_Int_t * vCov
{
{
Abc_Obj_t
*
pNet
;
Abc_Obj_t
*
pNet
;
int
nLeaves
=
Abc_ObjFaninNum
(
pNode
);
int
nLeaves
=
Abc_ObjFaninNum
(
pNode
);
int
i
,
nLutLeaf
,
nLut
Root
;
int
i
,
nLutLeaf
,
nLut
Leaf2
,
nLutRoot
,
Length
;
// quit if parameters are wrong
// quit if parameters are wrong
if
(
strlen
(
pStr
)
!=
2
)
Length
=
strlen
(
pStr
);
if
(
Length
!=
2
&&
Length
!=
3
)
{
{
printf
(
"Wrong LUT struct (%s)
\n
"
,
pStr
);
printf
(
"Wrong LUT struct (%s)
\n
"
,
pStr
);
return
;
return
;
}
}
nLutLeaf
=
pStr
[
0
]
-
'0'
;
for
(
i
=
0
;
i
<
Length
;
i
++
)
if
(
nLutLeaf
<
3
||
nLutLeaf
>
6
)
if
(
pStr
[
i
]
-
'0'
<
3
||
pStr
[
i
]
-
'0'
>
6
)
{
{
printf
(
"Leaf size (%d) should belong to {3,4,5,6}.
\n
"
,
nLutLeaf
);
printf
(
"The LUT size (%d) should belong to {3,4,5,6}.
\n
"
,
pStr
[
i
]
-
'0'
);
return
;
return
;
}
}
nLutRoot
=
pStr
[
1
]
-
'0'
;
if
(
nLutRoot
<
3
||
nLutRoot
>
6
)
nLutLeaf
=
pStr
[
0
]
-
'0'
;
{
nLutLeaf2
=
(
Length
==
3
)
?
pStr
[
1
]
-
'0'
:
0
;
printf
(
"Root size (%d) should belong to {3,4,5,6}.
\n
"
,
nLutRoot
);
nLutRoot
=
pStr
[
Length
-
1
]
-
'0'
;
return
;
if
(
nLeaves
>
nLutLeaf
-
1
+
(
nLutLeaf2
?
nLutLeaf2
-
1
:
0
)
+
nLutRoot
)
}
if
(
nLeaves
>
nLutLeaf
+
nLutRoot
-
1
)
{
{
printf
(
"Node
\"
%s
\"
has %d inputs (too many for the LUT structure
\"
%d%d
\"
). Writing BLIF has failed.
\n
"
,
printf
(
"The node size (%d) is too large for the LUT structure %s.
\n
"
,
nLeaves
,
pStr
);
Abc_ObjName
(
Abc_ObjFanout0
(
pNode
)),
nLeaves
,
nLutLeaf
,
nLutRoot
);
return
;
return
;
}
}
// consider easy case
// consider easy case
fprintf
(
pFile
,
"
\n
"
);
fprintf
(
pFile
,
"
\n
"
);
if
(
nLeaves
<=
Abc_MaxInt
(
nLutLeaf
,
nLutRoot
)
)
if
(
nLeaves
<=
Abc_MaxInt
(
nLutLeaf
2
,
Abc_MaxInt
(
nLutLeaf
,
nLutRoot
)
)
)
{
{
// write the .names line
// write the .names line
fprintf
(
pFile
,
".names"
);
fprintf
(
pFile
,
".names"
);
...
@@ -884,11 +882,14 @@ void Io_NtkWriteNodeIntStruct( FILE * pFile, Abc_Obj_t * pNode, Vec_Int_t * vCov
...
@@ -884,11 +882,14 @@ void Io_NtkWriteNodeIntStruct( FILE * pFile, Abc_Obj_t * pNode, Vec_Int_t * vCov
else
else
{
{
extern
int
If_CluMinimumBase
(
word
*
t
,
int
*
pSupp
,
int
nVarsAll
,
int
*
pnVars
);
extern
int
If_CluMinimumBase
(
word
*
t
,
int
*
pSupp
,
int
nVarsAll
,
int
*
pnVars
);
extern
int
If_CluCheckExt
(
void
*
p
,
word
*
pTruth
,
int
nVars
,
int
nLutLeaf
,
int
nLutRoot
,
char
*
pLut0
,
char
*
pLut1
,
word
*
pFunc0
,
word
*
pFunc1
);
extern
int
If_CluCheckExt
(
void
*
p
,
word
*
pTruth
,
int
nVars
,
int
nLutLeaf
,
int
nLutRoot
,
char
*
pLut0
,
char
*
pLut1
,
word
*
pFunc0
,
word
*
pFunc1
);
extern
int
If_CluCheckExt3
(
void
*
p
,
word
*
pTruth
,
int
nVars
,
int
nLutLeaf
,
int
nLutLeaf2
,
int
nLutRoot
,
char
*
pLut0
,
char
*
pLut1
,
char
*
pLut2
,
word
*
pFunc0
,
word
*
pFunc1
,
word
*
pFunc2
);
static
word
TruthStore
[
16
][
1
<<
10
]
=
{{
0
}},
*
pTruths
[
16
];
static
word
TruthStore
[
16
][
1
<<
10
]
=
{{
0
}},
*
pTruths
[
16
];
word
pCube
[
1
<<
10
],
pRes
[
1
<<
10
],
Func0
,
Func1
;
word
pCube
[
1
<<
10
],
pRes
[
1
<<
10
],
Func0
,
Func1
,
Func2
;
char
pLut0
[
32
],
pLut1
[
32
],
*
pSop
;
char
pLut0
[
32
],
pLut1
[
32
],
pLut2
[
32
]
=
{
0
},
*
pSop
;
// int nVarsMin[3], pVars[3][20];
// int nVarsMin[3], pVars[3][20];
if
(
TruthStore
[
0
][
0
]
==
0
)
if
(
TruthStore
[
0
][
0
]
==
0
)
...
@@ -921,17 +922,35 @@ void Io_NtkWriteNodeIntStruct( FILE * pFile, Abc_Obj_t * pNode, Vec_Int_t * vCov
...
@@ -921,17 +922,35 @@ void Io_NtkWriteNodeIntStruct( FILE * pFile, Abc_Obj_t * pNode, Vec_Int_t * vCov
// derive truth table
// derive truth table
Abc_SopToTruthBig
(
(
char
*
)
Abc_ObjData
(
pNode
),
nLeaves
,
pTruths
,
pCube
,
pRes
);
Abc_SopToTruthBig
(
(
char
*
)
Abc_ObjData
(
pNode
),
nLeaves
,
pTruths
,
pCube
,
pRes
);
if
(
Kit_TruthIsConst0
((
unsigned
*
)
pRes
,
nLeaves
)
||
Kit_TruthIsConst1
((
unsigned
*
)
pRes
,
nLeaves
)
)
{
fprintf
(
pFile
,
".names %s
\n
%d
\n
"
,
Abc_ObjName
(
Abc_ObjFanout0
(
pNode
)),
Kit_TruthIsConst1
((
unsigned
*
)
pRes
,
nLeaves
)
);
return
;
}
// Extra_PrintHex( stdout, (unsigned *)pRes, nLeaves ); printf( " " );
// Extra_PrintHex( stdout, (unsigned *)pRes, nLeaves ); printf( " " );
// Kit_DsdPrintFromTruth( (unsigned*)pRes, nLeaves ); printf( "\n" );
// Kit_DsdPrintFromTruth( (unsigned*)pRes, nLeaves ); printf( "\n" );
// perform decomposition
// perform decomposition
if
(
!
If_CluCheckExt
(
NULL
,
pRes
,
nLeaves
,
nLutLeaf
,
nLutRoot
,
pLut0
,
pLut1
,
&
Func0
,
&
Func1
)
)
if
(
Length
==
2
)
{
{
Extra_PrintHex
(
stdout
,
(
unsigned
*
)
pRes
,
nLeaves
);
printf
(
" "
);
if
(
!
If_CluCheckExt
(
NULL
,
pRes
,
nLeaves
,
nLutLeaf
,
nLutRoot
,
pLut0
,
pLut1
,
&
Func0
,
&
Func1
)
)
Kit_DsdPrintFromTruth
(
(
unsigned
*
)
pRes
,
nLeaves
);
printf
(
"
\n
"
);
{
printf
(
"Node
\"
%s
\"
is not decomposable. Writing BLIF has failed.
\n
"
,
Abc_ObjName
(
Abc_ObjFanout0
(
pNode
))
);
Extra_PrintHex
(
stdout
,
(
unsigned
*
)
pRes
,
nLeaves
);
printf
(
" "
);
return
;
Kit_DsdPrintFromTruth
(
(
unsigned
*
)
pRes
,
nLeaves
);
printf
(
"
\n
"
);
printf
(
"Node
\"
%s
\"
is not decomposable. Writing BLIF has failed.
\n
"
,
Abc_ObjName
(
Abc_ObjFanout0
(
pNode
))
);
return
;
}
}
else
{
if
(
!
If_CluCheckExt3
(
NULL
,
pRes
,
nLeaves
,
nLutLeaf
,
nLutLeaf2
,
nLutRoot
,
pLut0
,
pLut1
,
pLut2
,
&
Func0
,
&
Func1
,
&
Func2
)
)
{
Extra_PrintHex
(
stdout
,
(
unsigned
*
)
pRes
,
nLeaves
);
printf
(
" "
);
Kit_DsdPrintFromTruth
(
(
unsigned
*
)
pRes
,
nLeaves
);
printf
(
"
\n
"
);
printf
(
"Node
\"
%s
\"
is not decomposable. Writing BLIF has failed.
\n
"
,
Abc_ObjName
(
Abc_ObjFanout0
(
pNode
))
);
return
;
}
}
}
// write leaf node
// write leaf node
...
@@ -942,16 +961,19 @@ void Io_NtkWriteNodeIntStruct( FILE * pFile, Abc_Obj_t * pNode, Vec_Int_t * vCov
...
@@ -942,16 +961,19 @@ void Io_NtkWriteNodeIntStruct( FILE * pFile, Abc_Obj_t * pNode, Vec_Int_t * vCov
// write SOP
// write SOP
pSop
=
Io_NtkDeriveSop
(
(
Mem_Flex_t
*
)
Abc_ObjNtk
(
pNode
)
->
pManFunc
,
Func1
,
pLut1
[
0
],
vCover
);
pSop
=
Io_NtkDeriveSop
(
(
Mem_Flex_t
*
)
Abc_ObjNtk
(
pNode
)
->
pManFunc
,
Func1
,
pLut1
[
0
],
vCover
);
fprintf
(
pFile
,
"%s"
,
pSop
);
fprintf
(
pFile
,
"%s"
,
pSop
);
/*
// write leaf node
if
(
Length
==
3
&&
pLut2
[
0
]
>
0
)
fprintf( pFile, ".names" );
{
for ( i = 0; i < pLut2[0]; i++ )
// write leaf node
fprintf( pFile, " %s", Abc_ObjName(Abc_ObjFanin(pNode,pLut2[2+i])) );
fprintf
(
pFile
,
".names"
);
fprintf( pFile, " %s_lut1\n", Abc_ObjName(Abc_ObjFanout0(pNode)) );
for
(
i
=
0
;
i
<
pLut2
[
0
];
i
++
)
// write SOP
fprintf
(
pFile
,
" %s"
,
Abc_ObjName
(
Abc_ObjFanin
(
pNode
,
pLut2
[
2
+
i
]))
);
pSop = Io_NtkDeriveSop( (Mem_Flex_t *)Abc_ObjNtk(pNode)->pManFunc, Func2, pLut2[0], vCover );
fprintf
(
pFile
,
" %s_lut2
\n
"
,
Abc_ObjName
(
Abc_ObjFanout0
(
pNode
))
);
fprintf( pFile, "%s", pSop );
// write SOP
*/
pSop
=
Io_NtkDeriveSop
(
(
Mem_Flex_t
*
)
Abc_ObjNtk
(
pNode
)
->
pManFunc
,
Func2
,
pLut2
[
0
],
vCover
);
fprintf
(
pFile
,
"%s"
,
pSop
);
}
// write root node
// write root node
fprintf
(
pFile
,
".names"
);
fprintf
(
pFile
,
".names"
);
for
(
i
=
0
;
i
<
pLut0
[
0
];
i
++
)
for
(
i
=
0
;
i
<
pLut0
[
0
];
i
++
)
...
...
src/map/if/ifDec16.c
View file @
ad5ee9ff
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