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
cb5be511
Commit
cb5be511
authored
Nov 06, 2011
by
Alan Mishchenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Experiments with variable permutation.
parent
5c326464
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
55 additions
and
1 deletions
+55
-1
src/aig/kit/kitPerm.c
+55
-1
No files found.
src/aig/kit/kitPerm.c
View file @
cb5be511
...
...
@@ -235,6 +235,31 @@ void Kit_PermComputeNaive( word * F, int nVars )
If_CluReverseOrder
(
F
,
nVars
,
V2P
,
P2V
,
0
);
}
word
M
(
word
f1
,
word
f2
,
int
n
)
{
word
temp
=
0
;
word
a
=
1
;
int
i
;
for
(
i
=
0
;
i
<
n
;
i
++
)
temp
=
temp
+
(((
f1
>>
i
)
&
a
)
<<
(
2
*
i
)
)
+
(((
f2
>>
i
)
&
a
)
<<
(
2
*
i
+
1
));
return
temp
;
}
word
Tf
(
word
f
,
int
n
)
{
if
(
n
==
1
)
return
f
;
else
{
int
x
=
(
int
)
pow
(
2
,
n
-
1
);
// int x;
x
=
(
1
<<
(
n
-
1
));
return
(
M
(
Tf
(
(
f
<<
x
)
>>
x
,
n
-
1
),
Tf
(
(
f
>>
x
),
n
-
1
),
x
)
);
//def. of M just below the function
}
}
#define ABC_PRT(a,t) (printf("%s = ", (a)), printf("%7.2f sec\n", (float)(t)/(float)(CLOCKS_PER_SEC)))
#define NFUNCS (1<<20)
...
...
@@ -271,7 +296,8 @@ void Kit_PermComputeTest()
for
(
k
=
0
;
k
<
NFUNCS
;
k
++
)
{
i
=
T
[
k
];
Kit_PermComputeNaive
(
&
i
,
6
);
// Kit_PermComputeNaive( &i, 6 );
Tf
(
i
,
6
);
}
ABC_PRT
(
"Perm1 "
,
clock
()
-
clk
);
...
...
@@ -292,6 +318,34 @@ void Kit_PermComputeTest()
free
(
T
);
}
/**Function*************************************************************
Synopsis []
Description []
SideEffects []
SeeAlso []
`
***********************************************************************/
void
Kit_PermComputeTest_
()
{
word
t
,
s
;
t
=
0xacaccacaaccaacca
;
// Kit_DsdPrintFromTruth( &t, 6 ); printf( "\n" );
s
=
Tf
(
t
,
6
);
// Kit_PermComputeNaive( &t, 6 );
// Kit_DsdPrintFromTruth( &s, 6 ); printf( "\n" );
}
/*
{
extern void Kit_PermComputeTest();
Kit_PermComputeTest();
}
*/
////////////////////////////////////////////////////////////////////////
/// END OF FILE ///
////////////////////////////////////////////////////////////////////////
...
...
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