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
93b10316
Commit
93b10316
authored
Mar 19, 2013
by
Alan Mishchenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Replacing unsafe Aig_ManObjNum() by Aig_ManObjNumMax().
parent
a96436e8
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
5 deletions
+5
-5
src/aig/aig/aigUtil.c
+5
-5
No files found.
src/aig/aig/aigUtil.c
View file @
93b10316
...
...
@@ -1317,12 +1317,12 @@ void Aig_ManCounterExampleValueStart( Aig_Man_t * pAig, Abc_Cex_t * pCex )
assert
(
Aig_ManRegNum
(
pAig
)
>
0
);
// makes sense only for sequential AIGs
assert
(
pAig
->
pData2
==
NULL
);
// if this fail, there may be a memory leak
// allocate memory to store simulation bits for internal nodes
pAig
->
pData2
=
ABC_CALLOC
(
unsigned
,
Abc_BitWordNum
(
(
pCex
->
iFrame
+
1
)
*
Aig_ManObjNum
(
pAig
)
)
);
pAig
->
pData2
=
ABC_CALLOC
(
unsigned
,
Abc_BitWordNum
(
(
pCex
->
iFrame
+
1
)
*
Aig_ManObjNum
Max
(
pAig
)
)
);
// the register values in the counter-example should be zero
Saig_ManForEachLo
(
pAig
,
pObj
,
k
)
assert
(
Abc_InfoHasBit
(
pCex
->
pData
,
iBit
++
)
==
0
);
// iterate through the timeframes
nObjs
=
Aig_ManObjNum
(
pAig
);
nObjs
=
Aig_ManObjNum
Max
(
pAig
);
for
(
i
=
0
;
i
<=
pCex
->
iFrame
;
i
++
)
{
// set constant 1 node
...
...
@@ -1391,8 +1391,8 @@ void Aig_ManCounterExampleValueStop( Aig_Man_t * pAig )
***********************************************************************/
int
Aig_ManCounterExampleValueLookup
(
Aig_Man_t
*
pAig
,
int
Id
,
int
iFrame
)
{
assert
(
Id
>=
0
&&
Id
<
Aig_ManObjNum
(
pAig
)
);
return
Abc_InfoHasBit
(
(
unsigned
*
)
pAig
->
pData2
,
Aig_ManObjNum
(
pAig
)
*
iFrame
+
Id
);
assert
(
Id
>=
0
&&
Id
<
Aig_ManObjNum
Max
(
pAig
)
);
return
Abc_InfoHasBit
(
(
unsigned
*
)
pAig
->
pData2
,
Aig_ManObjNum
Max
(
pAig
)
*
iFrame
+
Id
);
}
/**Function*************************************************************
...
...
@@ -1408,7 +1408,7 @@ int Aig_ManCounterExampleValueLookup( Aig_Man_t * pAig, int Id, int iFrame )
***********************************************************************/
void
Aig_ManCounterExampleValueTest
(
Aig_Man_t
*
pAig
,
Abc_Cex_t
*
pCex
)
{
Aig_Obj_t
*
pObj
=
Aig_ManObj
(
pAig
,
Aig_ManObjNum
(
pAig
)
/
2
);
Aig_Obj_t
*
pObj
=
Aig_ManObj
(
pAig
,
Aig_ManObjNum
Max
(
pAig
)
/
2
);
int
iFrame
=
Abc_MaxInt
(
0
,
pCex
->
iFrame
-
1
);
printf
(
"
\n
Using counter-example, which asserts output %d in frame %d.
\n
"
,
pCex
->
iPo
,
pCex
->
iFrame
);
Aig_ManCounterExampleValueStart
(
pAig
,
pCex
);
...
...
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