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
482c11a2
Commit
482c11a2
authored
Apr 24, 2014
by
Alan Mishchenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Experiments with permutations.
parent
1023908e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
80 additions
and
1 deletions
+80
-1
src/misc/extra/extraUtilCube.c
+80
-1
No files found.
src/misc/extra/extraUtilCube.c
View file @
482c11a2
...
...
@@ -50,7 +50,7 @@ static inline void Abc_StatePrint( char * pState ) { i
SeeAlso []
***********************************************************************/
void
Abc_EnumerateCubeStates
()
void
Abc_EnumerateCubeStates
2
()
{
int
pXYZ
[
3
][
9
][
2
]
=
{
{
{
3
,
5
},
{
3
,
17
},
{
3
,
15
},
{
1
,
6
},
{
1
,
16
},
{
1
,
14
},
{
2
,
4
},
{
2
,
18
},
{
2
,
13
}
},
...
...
@@ -148,6 +148,85 @@ Iter 11 -> 3674160 Time = 70.38 sec
Iter 12 -> 3674160 Time = 70.48 sec
*/
/**Function*************************************************************
Synopsis []
Description []
SideEffects []
SeeAlso []
***********************************************************************/
static
inline
int
Abc_DataHasBit
(
word
*
p
,
word
i
)
{
return
(
p
[(
i
)
>>
6
]
&
(
1
<<
((
i
)
&
63
)))
>
0
;
}
static
inline
void
Abc_DataSetBit
(
word
*
p
,
word
i
)
{
p
[(
i
)
>>
6
]
|=
(
1
<<
((
i
)
&
63
));
}
static
inline
void
Abc_DataXorBit
(
word
*
p
,
word
i
)
{
p
[(
i
)
>>
6
]
^=
(
1
<<
((
i
)
&
63
));
}
static
inline
int
Abc_DataGetCube
(
word
w
,
int
i
)
{
return
(
w
>>
(
5
*
i
))
&
31
;
}
static
inline
word
Abc_DataXorCube
(
word
w
,
int
i
,
int
c
)
{
return
w
^
(((
word
)
c
)
<<
(
5
*
i
));
}
void
Abc_EnumerateCubeStates
()
{
extern
word
Aig_ManRandom64
(
int
fReset
);
int
pXYZ
[
3
][
4
][
3
]
=
{
{
{
0
,
4
,
0
},
{
4
,
6
,
0
},
{
6
,
3
,
1
},
{
3
,
0
,
-
1
}
},
{
{
1
,
3
,
1
},
{
3
,
6
,
0
},
{
6
,
5
,
0
},
{
5
,
1
,
-
1
}
},
{
{
2
,
5
,
0
},
{
5
,
6
,
-
1
},
{
6
,
4
,
1
},
{
4
,
2
,
0
}
}
};
int
pPerms
[
9
][
4
][
3
]
=
{
0
};
int
i
,
k
,
v
,
u
,
Beg
,
End
,
Cube0
,
Cube1
;
Vec_Wrd_t
*
vStates
=
Vec_WrdAlloc
(
1
<<
22
);
// 16 MB
word
*
pHash
=
ABC_CALLOC
(
word
,
1
<<
29
);
// 4 GB
word
New
,
Init
=
0
;
// estimate
int
Counter
=
0
;
abctime
clk
=
Abc_Clock
();
Aig_ManRandom64
(
1
);
for
(
i
=
0
;
i
<
3674160
;
i
++
)
for
(
v
=
0
;
v
<
9
;
v
++
)
{
Init
=
Aig_ManRandom64
(
0
)
&
ABC_CONST
(
0x7FFFFFFFF
);
if
(
Abc_DataHasBit
(
pHash
,
Init
)
)
Counter
++
;
else
Abc_DataSetBit
(
pHash
,
Init
);
}
printf
(
"Counter = %d "
,
Counter
);
Abc_PrintTime
(
1
,
"Time"
,
Abc_Clock
()
-
clk
);
if
(
Counter
==
-
1
)
{
for
(
i
=
0
;
i
<
7
;
i
++
)
Init
=
Abc_DataXorCube
(
Init
,
i
,
i
<<
2
);
Vec_WrdPush
(
vStates
,
Init
);
Abc_DataSetBit
(
pHash
,
Init
);
Beg
=
0
;
End
=
1
;
for
(
i
=
1
;
i
<=
100
;
i
++
)
{
if
(
Beg
==
End
)
break
;
Vec_WrdForEachEntryStartStop
(
vStates
,
Init
,
k
,
Beg
,
End
)
for
(
v
=
0
;
v
<
9
;
v
++
)
{
New
=
Init
;
for
(
u
=
0
;
u
<
4
;
u
++
)
{
Cube0
=
Abc_DataGetCube
(
Init
,
pPerms
[
v
][
u
][
0
]
);
Cube1
=
Abc_DataGetCube
(
Init
,
pPerms
[
v
][
u
][
1
]
);
New
=
Abc_DataXorCube
(
New
,
pPerms
[
v
][
u
][
1
],
Cube0
-
pPerms
[
v
][
u
][
2
]
);
New
=
Abc_DataXorCube
(
New
,
pPerms
[
v
][
u
][
0
],
Cube1
+
pPerms
[
v
][
u
][
2
]
);
}
if
(
!
Abc_DataHasBit
(
pHash
,
New
)
)
Vec_WrdPush
(
vStates
,
New
);
}
}
}
Vec_WrdFree
(
vStates
);
ABC_FREE
(
pHash
);
}
////////////////////////////////////////////////////////////////////////
/// 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