Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
abc
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kestrel Collaboration
Kestrel Tooling
abc
Commits
491e4ebf
Commit
491e4ebf
authored
Jun 03, 2020
by
Alan Mishchenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Experimental simulation.
parent
97c826a6
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
100 additions
and
1 deletion
+100
-1
src/aig/gia/giaSimBase.c
src/aig/gia/giaSimBase.c
+99
-0
src/base/abci/abc.c
src/base/abci/abc.c
+1
-1
No files found.
src/aig/gia/giaSimBase.c
View file @
491e4ebf
...
...
@@ -128,6 +128,67 @@ Vec_Wrd_t * Gia_ManSimPatSim( Gia_Man_t * pGia )
return
vSims
;
}
/**Function*************************************************************
Synopsis []
Description []
SideEffects []
SeeAlso []
***********************************************************************/
void
Gia_ManSimPatAssignInputs2
(
Gia_Man_t
*
p
,
int
nWords
,
Vec_Wrd_t
*
vSims
,
Vec_Wrd_t
*
vSimsIn
)
{
int
i
,
Id
;
assert
(
Vec_WrdSize
(
vSims
)
==
2
*
nWords
*
Gia_ManObjNum
(
p
)
);
assert
(
Vec_WrdSize
(
vSimsIn
)
==
nWords
*
Gia_ManCiNum
(
p
)
);
Gia_ManForEachCiId
(
p
,
Id
,
i
)
{
Abc_TtCopy
(
Vec_WrdEntryP
(
vSims
,
2
*
Id
*
nWords
+
0
),
Vec_WrdEntryP
(
vSimsIn
,
i
*
nWords
),
nWords
,
0
);
Abc_TtCopy
(
Vec_WrdEntryP
(
vSims
,
2
*
Id
*
nWords
+
1
),
Vec_WrdEntryP
(
vSimsIn
,
i
*
nWords
),
nWords
,
1
);
}
}
static
inline
void
Gia_ManSimPatSimAnd2
(
Gia_Man_t
*
p
,
int
i
,
Gia_Obj_t
*
pObj
,
int
nWords
,
Vec_Wrd_t
*
vSims
)
{
word
*
pSims
=
Vec_WrdArray
(
vSims
);
word
*
pSims0
=
pSims
+
nWords
*
Gia_ObjFaninLit0
(
pObj
,
i
);
word
*
pSims1
=
pSims
+
nWords
*
Gia_ObjFaninLit1
(
pObj
,
i
);
word
*
pSims2
=
pSims
+
nWords
*
(
2
*
i
+
0
);
word
*
pSims3
=
pSims
+
nWords
*
(
2
*
i
+
1
);
int
w
;
// if ( Gia_ObjIsXor(pObj) )
// for ( w = 0; w < nWords; w++ )
// pSims2[w] = pSims0[w] ^ pSims1[w];
// else
for
(
w
=
0
;
w
<
nWords
;
w
++
)
{
pSims2
[
w
]
=
pSims0
[
w
]
&
pSims1
[
w
];
pSims3
[
w
]
=
~
pSims2
[
w
];
}
}
static
inline
void
Gia_ManSimPatSimPo2
(
Gia_Man_t
*
p
,
int
i
,
Gia_Obj_t
*
pObj
,
int
nWords
,
Vec_Wrd_t
*
vSims
)
{
word
*
pSims
=
Vec_WrdArray
(
vSims
);
word
*
pSims0
=
pSims
+
nWords
*
Gia_ObjFaninLit0
(
pObj
,
i
);
word
*
pSims2
=
pSims
+
nWords
*
i
;
int
w
;
for
(
w
=
0
;
w
<
nWords
;
w
++
)
pSims2
[
w
]
=
pSims0
[
w
];
}
Vec_Wrd_t
*
Gia_ManSimPatSim2
(
Gia_Man_t
*
pGia
)
{
Gia_Obj_t
*
pObj
;
int
i
,
nWords
=
Vec_WrdSize
(
pGia
->
vSimsPi
)
/
Gia_ManCiNum
(
pGia
);
Vec_Wrd_t
*
vSims
=
Vec_WrdStart
(
Gia_ManObjNum
(
pGia
)
*
nWords
*
2
);
assert
(
Vec_WrdSize
(
pGia
->
vSimsPi
)
%
Gia_ManCiNum
(
pGia
)
==
0
);
Gia_ManSimPatAssignInputs2
(
pGia
,
nWords
,
vSims
,
pGia
->
vSimsPi
);
Gia_ManForEachAnd
(
pGia
,
pObj
,
i
)
Gia_ManSimPatSimAnd2
(
pGia
,
i
,
pObj
,
nWords
,
vSims
);
Gia_ManForEachCo
(
pGia
,
pObj
,
i
)
Gia_ManSimPatSimPo2
(
pGia
,
Gia_ObjId
(
pGia
,
pObj
),
pObj
,
nWords
,
vSims
);
return
vSims
;
}
/**Function*************************************************************
Synopsis []
...
...
@@ -1948,6 +2009,44 @@ void Gia_ManPatRareImprove( Gia_Man_t * p, int RareLimit, int fVerbose )
Abc_PrintTime
(
1
,
"Time"
,
Abc_Clock
()
-
clk
);
}
/**Function*************************************************************
Synopsis [Improving quality of simulation patterns.]
Description []
SideEffects []
SeeAlso []
***********************************************************************/
void
Gia_ManSimTest
(
Gia_Man_t
*
pGia
)
{
int
n
,
nWords
=
8
;
Vec_Wrd_t
*
vSim1
,
*
vSim2
;
Vec_Wrd_t
*
vSim0
=
Vec_WrdStartRandom
(
Gia_ManCiNum
(
pGia
)
*
nWords
);
abctime
clk
=
Abc_Clock
();
pGia
->
vSimsPi
=
vSim0
;
for
(
n
=
0
;
n
<
10
;
n
++
)
{
vSim1
=
Gia_ManSimPatSim
(
pGia
);
Vec_WrdFree
(
vSim1
);
}
Abc_PrintTime
(
1
,
"Time1"
,
Abc_Clock
()
-
clk
);
clk
=
Abc_Clock
();
for
(
n
=
0
;
n
<
10
;
n
++
)
{
vSim2
=
Gia_ManSimPatSim2
(
pGia
);
Vec_WrdFree
(
vSim2
);
}
Abc_PrintTime
(
1
,
"Time2"
,
Abc_Clock
()
-
clk
);
pGia
->
vSimsPi
=
NULL
;
Vec_WrdFree
(
vSim0
);
}
////////////////////////////////////////////////////////////////////////
/// END OF FILE ///
////////////////////////////////////////////////////////////////////////
...
...
src/base/abci/abc.c
View file @
491e4ebf
...
...
@@ -47944,7 +47944,7 @@ int Abc_CommandAbc9Test( Abc_Frame_t * pAbc, int argc, char ** argv )
// return 1;
// }
// Abc_FrameUpdateGia( pAbc, Abc_Procedure(pAbc->pGia) );
// Gia_ManTryResub
( pAbc->pGia );
Gia_ManSimTest
( pAbc->pGia );
return 0;
usage:
Abc_Print( -2, "usage: &test [-FW num] [-svh]\n" );
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