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
e53ffc64
Commit
e53ffc64
authored
Jul 20, 2012
by
Alan Mishchenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
New procedures to generate NPN-classes for a library of 6-input functions.
parent
febe2c6a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
8 deletions
+16
-8
src/misc/extra/extraUtilMisc.c
+16
-8
No files found.
src/misc/extra/extraUtilMisc.c
View file @
e53ffc64
...
...
@@ -2330,12 +2330,14 @@ word * Extra_NpnRead( char * pFileName, int nFuncs )
pFuncs
=
ABC_CALLOC
(
word
,
nFuncs
);
pFile
=
fopen
(
pFileName
,
"rb"
);
while
(
fgets
(
pBuffer
,
100
,
pFile
)
)
Extra_ReadHex
(
(
unsigned
*
)(
pFuncs
+
i
++
),
pBuffer
+
2
,
16
);
// Extra_ReadHex( (unsigned *)(pFuncs + i++), pBuffer, 16 );
Extra_ReadHex
(
(
unsigned
*
)(
pFuncs
+
i
++
),
(
pBuffer
[
1
]
==
'x'
?
pBuffer
+
2
:
pBuffer
),
16
);
fclose
(
pFile
);
assert
(
i
==
nFuncs
);
for
(
i
=
0
;
i
<
Abc_MinInt
(
nFuncs
,
20
);
i
++
)
for
(
i
=
0
;
i
<
Abc_MinInt
(
nFuncs
,
10
);
i
++
)
{
printf
(
"Line %d : "
,
i
);
Extra_PrintHex
(
stdout
,
(
unsigned
*
)(
pFuncs
+
i
),
6
),
printf
(
"
\n
"
);
}
return
pFuncs
;
}
...
...
@@ -2394,13 +2396,14 @@ void Extra_NpnTest2()
}
void
Extra_NpnTest
()
{
int
nFuncs
=
5687661
;
//
int nFuncs = 5687661;
// int nFuncs = 400777;
//
int nFuncs = 10;
int
nFuncs
=
10
;
clock_t
clk
=
clock
();
word
*
pFuncs
;
int
*
pComp
,
*
pPerm
;
int
i
,
k
,
nUnique
=
0
;
/*
// read functions
pFuncs = Extra_NpnRead( "C:\\_projects\\abc\\_TEST\\allan\\lib6var5M.txt", nFuncs );
// pFuncs = Extra_NpnRead( "C:\\_projects\\abc\\_TEST\\allan\\lib6var5M_out_Total_minimal.txt", nFuncs );
...
...
@@ -2413,9 +2416,9 @@ void Extra_NpnTest()
pFuncs[k++] = pFuncs[i];
nFuncs = k;
printf( "Total number of unique functions = %d\n", nFuncs );
*/
// pFuncs = Extra_NpnRead( "C:\\_projects\\abc\\_TEST\\allan\\lib6var5M_out_Total_minimal.txt", nFuncs );
//
pFuncs = Extra_NpnRead( "C:\\_projects\\abc\\_TEST\\allan\\test.txt", nFuncs );
pFuncs
=
Extra_NpnRead
(
"C:
\\
_projects
\\
abc
\\
_TEST
\\
allan
\\
test.txt"
,
nFuncs
);
pComp
=
Extra_GreyCodeSchedule
(
6
);
pPerm
=
Extra_PermSchedule
(
6
);
// compute minimum forms
...
...
@@ -2426,6 +2429,7 @@ void Extra_NpnTest()
printf
(
"%d
\n
"
,
i
);
}
printf
(
"Finished deriving minimum form
\n
"
);
/*
// sort them by value
qsort( (void *)pFuncs, nFuncs, sizeof(word), (int(*)(const void *,const void *))CompareWords );
// count unique
...
...
@@ -2434,8 +2438,12 @@ void Extra_NpnTest()
if ( pFuncs[i] == pFuncs[i-1] )
nUnique--;
printf( "Total number of unique ones = %d\n", nUnique );
for
(
i
=
0
;
i
<
Abc_MinInt
(
nFuncs
,
20
);
i
++
)
*/
for
(
i
=
0
;
i
<
Abc_MinInt
(
nFuncs
,
10
);
i
++
)
{
printf
(
"Line %d : "
,
i
);
Extra_PrintHex
(
stdout
,
(
unsigned
*
)(
pFuncs
+
i
),
6
),
printf
(
"
\n
"
);
}
ABC_FREE
(
pPerm
);
ABC_FREE
(
pComp
);
ABC_FREE
(
pFuncs
);
...
...
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