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
85c751fb
Commit
85c751fb
authored
Aug 16, 2016
by
Mathias Soeken
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Functions to compute T-count.
parent
2f149364
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
37 additions
and
0 deletions
+37
-0
src/base/exor/exor.c
+37
-0
No files found.
src/base/exor/exor.c
View file @
85c751fb
...
...
@@ -116,6 +116,43 @@ int ComputeQCostBits( Cube * p )
nLits
+=
nLitsN
;
return
QCost
[
Abc_MinInt
(
nLits
,
7
)][
Abc_MinInt
(
nLitsN
,
7
)];
}
int
ToffoliGateCount
(
int
controls
,
int
lines
)
{
switch
(
controls
)
{
case
0u
:
case
1u
:
return
0
;
break
;
case
2u
:
return
1
;
break
;
case
3u
:
return
4
;
break
;
case
4u
:
return
(
(
(
lines
+
1
)
/
2
)
>=
controls
)
?
8
:
10
;
break
;
default:
return
(
(
(
lines
+
1
)
/
2
)
>=
controls
)
?
4
*
(
controls
-
2
)
:
8
*
(
controls
-
3
);
}
}
int
ComputeQCostTcount
(
Vec_Int_t
*
vCube
)
{
return
7
*
ToffoliGateCount
(
Vec_IntSize
(
vCube
),
g_CoverInfo
.
nVarsIn
+
1
);
}
int
ComputeQCostTcountBits
(
Cube
*
p
)
{
extern
varvalue
GetVar
(
Cube
*
pC
,
int
Var
);
int
v
,
nLits
=
0
;
for
(
v
=
0
;
v
<
g_CoverInfo
.
nVarsIn
;
v
++
)
if
(
GetVar
(
p
,
v
)
!=
VAR_ABS
)
nLits
++
;
return
7
*
ToffoliGateCount
(
nLits
,
g_CoverInfo
.
nVarsIn
+
1
);
/* maybe just: 7 * ToffoliGateCount( p->a, g_CoverInfo.nVarsIn + 1 ); */
}
/**Function*************************************************************
...
...
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