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
6cb3817a
Commit
6cb3817a
authored
Mar 28, 2014
by
Alan Mishchenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Ternary simulation for multi-output miters.
parent
c6663b04
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
129 additions
and
0 deletions
+129
-0
src/aig/gia/giaUtil.c
+54
-0
src/base/abci/abc.c
+65
-0
src/python/pyabc.i
+10
-0
No files found.
src/aig/gia/giaUtil.c
View file @
6cb3817a
...
@@ -1820,6 +1820,60 @@ Vec_Int_t * Gia_ManGroupProve( Gia_Man_t * pInit, char * pCommLine, int nGroupSi
...
@@ -1820,6 +1820,60 @@ Vec_Int_t * Gia_ManGroupProve( Gia_Man_t * pInit, char * pCommLine, int nGroupSi
}
}
/**Function*************************************************************
Synopsis []
Description []
SideEffects []
SeeAlso []
***********************************************************************/
Vec_Int_t
*
Gia_ManPoXSim
(
Gia_Man_t
*
p
,
int
nFrames
,
int
fVerbose
)
{
Vec_Int_t
*
vRes
;
Gia_Obj_t
*
pObj
;
int
f
,
k
,
nLeft
=
Gia_ManPoNum
(
p
);
vRes
=
Vec_IntAlloc
(
Gia_ManPoNum
(
p
)
);
Vec_IntFill
(
vRes
,
Gia_ManPoNum
(
p
),
nFrames
);
Gia_ObjTerSimSet0
(
Gia_ManConst0
(
p
)
);
Gia_ManForEachRi
(
p
,
pObj
,
k
)
Gia_ObjTerSimSet0
(
pObj
);
for
(
f
=
0
;
f
<
nFrames
;
f
++
)
{
Gia_ManForEachPi
(
p
,
pObj
,
k
)
Gia_ObjTerSimSetX
(
pObj
);
Gia_ManForEachRo
(
p
,
pObj
,
k
)
Gia_ObjTerSimRo
(
p
,
pObj
);
Gia_ManForEachAnd
(
p
,
pObj
,
k
)
Gia_ObjTerSimAnd
(
pObj
);
Gia_ManForEachCo
(
p
,
pObj
,
k
)
Gia_ObjTerSimCo
(
pObj
);
if
(
fVerbose
)
{
Gia_ManForEachPo
(
p
,
pObj
,
k
)
Gia_ObjTerSimPrint
(
pObj
);
printf
(
"
\n
"
);
}
Gia_ManForEachPo
(
p
,
pObj
,
k
)
if
(
Vec_IntEntry
(
vRes
,
k
)
==
nFrames
&&
Gia_ObjTerSimGetX
(
pObj
)
)
Vec_IntWriteEntry
(
vRes
,
k
,
f
),
nLeft
--
;
if
(
nLeft
==
0
)
break
;
}
if
(
fVerbose
)
{
if
(
nLeft
==
0
)
printf
(
"Simulation converged after %d frames.
\n
"
,
f
+
1
);
else
printf
(
"Simulation terminated after %d frames.
\n
"
,
nFrames
);
}
// Vec_IntPrint( vRes );
return
vRes
;
}
////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////
/// END OF FILE ///
/// END OF FILE ///
////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////
...
...
src/base/abci/abc.c
View file @
6cb3817a
...
@@ -403,6 +403,7 @@ static int Abc_CommandAbc9FFTest ( Abc_Frame_t * pAbc, int argc, cha
...
@@ -403,6 +403,7 @@ static int Abc_CommandAbc9FFTest ( Abc_Frame_t * pAbc, int argc, cha
static
int
Abc_CommandAbc9Inse
(
Abc_Frame_t
*
pAbc
,
int
argc
,
char
**
argv
);
static
int
Abc_CommandAbc9Inse
(
Abc_Frame_t
*
pAbc
,
int
argc
,
char
**
argv
);
static
int
Abc_CommandAbc9Maxi
(
Abc_Frame_t
*
pAbc
,
int
argc
,
char
**
argv
);
static
int
Abc_CommandAbc9Maxi
(
Abc_Frame_t
*
pAbc
,
int
argc
,
char
**
argv
);
static
int
Abc_CommandAbc9Bmci
(
Abc_Frame_t
*
pAbc
,
int
argc
,
char
**
argv
);
static
int
Abc_CommandAbc9Bmci
(
Abc_Frame_t
*
pAbc
,
int
argc
,
char
**
argv
);
static
int
Abc_CommandAbc9PoXsim
(
Abc_Frame_t
*
pAbc
,
int
argc
,
char
**
argv
);
//static int Abc_CommandAbc9PoPart2 ( Abc_Frame_t * pAbc, int argc, char ** argv );
//static int Abc_CommandAbc9PoPart2 ( Abc_Frame_t * pAbc, int argc, char ** argv );
//static int Abc_CommandAbc9CexCut ( Abc_Frame_t * pAbc, int argc, char ** argv );
//static int Abc_CommandAbc9CexCut ( Abc_Frame_t * pAbc, int argc, char ** argv );
//static int Abc_CommandAbc9CexMerge ( Abc_Frame_t * pAbc, int argc, char ** argv );
//static int Abc_CommandAbc9CexMerge ( Abc_Frame_t * pAbc, int argc, char ** argv );
...
@@ -970,6 +971,7 @@ void Abc_Init( Abc_Frame_t * pAbc )
...
@@ -970,6 +971,7 @@ void Abc_Init( Abc_Frame_t * pAbc )
Cmd_CommandAdd
(
pAbc
,
"ABC9"
,
"&inse"
,
Abc_CommandAbc9Inse
,
0
);
Cmd_CommandAdd
(
pAbc
,
"ABC9"
,
"&inse"
,
Abc_CommandAbc9Inse
,
0
);
Cmd_CommandAdd
(
pAbc
,
"ABC9"
,
"&maxi"
,
Abc_CommandAbc9Maxi
,
0
);
Cmd_CommandAdd
(
pAbc
,
"ABC9"
,
"&maxi"
,
Abc_CommandAbc9Maxi
,
0
);
Cmd_CommandAdd
(
pAbc
,
"ABC9"
,
"&bmci"
,
Abc_CommandAbc9Bmci
,
0
);
Cmd_CommandAdd
(
pAbc
,
"ABC9"
,
"&bmci"
,
Abc_CommandAbc9Bmci
,
0
);
Cmd_CommandAdd
(
pAbc
,
"ABC9"
,
"&poxsim"
,
Abc_CommandAbc9PoXsim
,
0
);
// Cmd_CommandAdd( pAbc, "ABC9", "&popart2", Abc_CommandAbc9PoPart2, 0 );
// Cmd_CommandAdd( pAbc, "ABC9", "&popart2", Abc_CommandAbc9PoPart2, 0 );
// Cmd_CommandAdd( pAbc, "ABC9", "&cexcut", Abc_CommandAbc9CexCut, 0 );
// Cmd_CommandAdd( pAbc, "ABC9", "&cexcut", Abc_CommandAbc9CexCut, 0 );
// Cmd_CommandAdd( pAbc, "ABC9", "&cexmerge", Abc_CommandAbc9CexMerge, 0 );
// Cmd_CommandAdd( pAbc, "ABC9", "&cexmerge", Abc_CommandAbc9CexMerge, 0 );
...
@@ -33239,6 +33241,69 @@ usage:
...
@@ -33239,6 +33241,69 @@ usage:
SeeAlso []
SeeAlso []
***********************************************************************/
***********************************************************************/
int
Abc_CommandAbc9PoXsim
(
Abc_Frame_t
*
pAbc
,
int
argc
,
char
**
argv
)
{
extern
Vec_Int_t
*
Gia_ManPoXSim
(
Gia_Man_t
*
p
,
int
nFrames
,
int
fVerbose
);
int
c
,
nFrames
=
1000
,
fVerbose
=
0
;
Extra_UtilGetoptReset
();
while
(
(
c
=
Extra_UtilGetopt
(
argc
,
argv
,
"Fvh"
)
)
!=
EOF
)
{
switch
(
c
)
{
case
'F'
:
if
(
globalUtilOptind
>=
argc
)
{
Abc_Print
(
-
1
,
"Command line switch
\"
-F
\"
should be followed by an integer.
\n
"
);
goto
usage
;
}
nFrames
=
atoi
(
argv
[
globalUtilOptind
]);
globalUtilOptind
++
;
if
(
nFrames
<
0
)
goto
usage
;
break
;
case
'v'
:
fVerbose
^=
1
;
break
;
case
'h'
:
goto
usage
;
default:
goto
usage
;
}
}
if
(
pAbc
->
pGia
==
NULL
)
{
Abc_Print
(
-
1
,
"Abc_CommandAbc9Bmci(): There is no AIG.
\n
"
);
return
0
;
}
if
(
Gia_ManRegNum
(
pAbc
->
pGia
)
==
0
)
{
Abc_Print
(
-
1
,
"Abc_CommandAbc9Bmci(): AIG is combinational.
\n
"
);
return
0
;
}
Vec_IntFreeP
(
&
pAbc
->
vAbcObjIds
);
pAbc
->
vAbcObjIds
=
Gia_ManPoXSim
(
pAbc
->
pGia
,
nFrames
,
fVerbose
);
return
0
;
usage:
Abc_Print
(
-
2
,
"usage: &poxsim [-F num] [-vh]
\n
"
);
Abc_Print
(
-
2
,
"
\t
X-valued simulation of the multi-output sequential miter
\n
"
);
Abc_Print
(
-
2
,
"
\t
-F num : the number of timeframes [default = %d]
\n
"
,
nFrames
);
Abc_Print
(
-
2
,
"
\t
-v : toggles printing verbose information [default = %s]
\n
"
,
fVerbose
?
"yes"
:
"no"
);
Abc_Print
(
-
2
,
"
\t
-h : print the command usage
\n
"
);
return
1
;
}
/**Function*************************************************************
Synopsis []
Description []
SideEffects []
SeeAlso []
***********************************************************************/
int
Abc_CommandAbc9CexCut
(
Abc_Frame_t
*
pAbc
,
int
argc
,
char
**
argv
)
int
Abc_CommandAbc9CexCut
(
Abc_Frame_t
*
pAbc
,
int
argc
,
char
**
argv
)
{
{
return
-
1
;
return
-
1
;
src/python/pyabc.i
View file @
6cb3817a
...
@@ -373,6 +373,15 @@ void _pyabc_array_push(int i)
...
@@ -373,6 +373,15 @@ void _pyabc_array_push(int i)
Vec_IntPush( vObjIds, i );
Vec_IntPush( vObjIds, i );
}
}
int pyabc_array_read_entry(int i)
{
Abc_Frame_t* pAbc = Abc_FrameGetGlobalFrame();
Vec_Int_t *vObjIds = Abc_FrameReadObjIds(pAbc);
if( !vObjIds )
return -1;
return Vec_IntEntry( vObjIds, i );
}
static PyObject* pyabc_internal_python_command_callback = 0;
static PyObject* pyabc_internal_python_command_callback = 0;
void pyabc_internal_set_command_callback( PyObject* callback )
void pyabc_internal_set_command_callback( PyObject* callback )
...
@@ -709,6 +718,7 @@ PyObject* eq_classes();
...
@@ -709,6 +718,7 @@ PyObject* eq_classes();
void _pyabc_array_clear();
void _pyabc_array_clear();
void _pyabc_array_push(int i);
void _pyabc_array_push(int i);
int pyabc_array_read_entry(int i);
void pyabc_internal_set_command_callback( PyObject* callback );
void pyabc_internal_set_command_callback( PyObject* callback );
void pyabc_internal_register_command( char * sGroup, char * sName, int fChanges );
void pyabc_internal_register_command( char * sGroup, char * sName, int fChanges );
...
...
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