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
a82b0a8a
Commit
a82b0a8a
authored
Feb 19, 2013
by
Alan Mishchenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
New command &cycle, which is faster than 'cycle'.
parent
59fe3268
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
111 additions
and
0 deletions
+111
-0
src/aig/gia/gia.h
+1
-0
src/aig/gia/giaDup.c
+49
-0
src/base/abci/abc.c
+61
-0
No files found.
src/aig/gia/gia.h
View file @
a82b0a8a
...
@@ -813,6 +813,7 @@ extern Gia_Man_t * Gia_ManDupOrderDfsReverse( Gia_Man_t * p );
...
@@ -813,6 +813,7 @@ extern Gia_Man_t * Gia_ManDupOrderDfsReverse( Gia_Man_t * p );
extern
Gia_Man_t
*
Gia_ManDupOutputGroup
(
Gia_Man_t
*
p
,
int
iOutStart
,
int
iOutStop
);
extern
Gia_Man_t
*
Gia_ManDupOutputGroup
(
Gia_Man_t
*
p
,
int
iOutStart
,
int
iOutStop
);
extern
Gia_Man_t
*
Gia_ManDupOrderAiger
(
Gia_Man_t
*
p
);
extern
Gia_Man_t
*
Gia_ManDupOrderAiger
(
Gia_Man_t
*
p
);
extern
Gia_Man_t
*
Gia_ManDupFlip
(
Gia_Man_t
*
p
,
int
*
pInitState
);
extern
Gia_Man_t
*
Gia_ManDupFlip
(
Gia_Man_t
*
p
,
int
*
pInitState
);
extern
Gia_Man_t
*
Gia_ManDupCycled
(
Gia_Man_t
*
pAig
,
int
nFrames
);
extern
Gia_Man_t
*
Gia_ManDup
(
Gia_Man_t
*
p
);
extern
Gia_Man_t
*
Gia_ManDup
(
Gia_Man_t
*
p
);
extern
Gia_Man_t
*
Gia_ManDupPerm
(
Gia_Man_t
*
p
,
Vec_Int_t
*
vPiPerm
);
extern
Gia_Man_t
*
Gia_ManDupPerm
(
Gia_Man_t
*
p
,
Vec_Int_t
*
vPiPerm
);
extern
void
Gia_ManDupAppend
(
Gia_Man_t
*
p
,
Gia_Man_t
*
pTwo
);
extern
void
Gia_ManDupAppend
(
Gia_Man_t
*
p
,
Gia_Man_t
*
pTwo
);
...
...
src/aig/gia/giaDup.c
View file @
a82b0a8a
...
@@ -395,6 +395,55 @@ Gia_Man_t * Gia_ManDupFlip( Gia_Man_t * p, int * pInitState )
...
@@ -395,6 +395,55 @@ Gia_Man_t * Gia_ManDupFlip( Gia_Man_t * p, int * pInitState )
/**Function*************************************************************
/**Function*************************************************************
Synopsis [Cycles AIG using random input.]
Description []
SideEffects []
SeeAlso []
***********************************************************************/
void
Gia_ManCycle
(
Gia_Man_t
*
p
,
int
nFrames
)
{
Gia_Obj_t
*
pObj
,
*
pObjRi
,
*
pObjRo
;
int
i
,
k
;
// Gia_ManRandom( 1 );
// assign random primary inputs
Gia_ManForEachPi
(
p
,
pObj
,
k
)
pObj
->
fMark0
=
(
1
&
Gia_ManRandom
(
0
));
// iterate for the given number of frames
for
(
i
=
0
;
i
<
nFrames
;
i
++
)
{
Gia_ManForEachAnd
(
p
,
pObj
,
k
)
pObj
->
fMark0
=
(
Gia_ObjFanin0
(
pObj
)
->
fMark0
^
Gia_ObjFaninC0
(
pObj
))
&
(
Gia_ObjFanin1
(
pObj
)
->
fMark0
^
Gia_ObjFaninC1
(
pObj
));
Gia_ManForEachCo
(
p
,
pObj
,
k
)
pObj
->
fMark0
=
Gia_ObjFanin0
(
pObj
)
->
fMark0
^
Gia_ObjFaninC0
(
pObj
);
Gia_ManForEachRiRo
(
p
,
pObjRi
,
pObjRo
,
k
)
pObjRo
->
fMark0
=
pObjRi
->
fMark0
;
}
}
Gia_Man_t
*
Gia_ManDupCycled
(
Gia_Man_t
*
p
,
int
nFrames
)
{
Gia_Man_t
*
pNew
;
Vec_Int_t
*
vInits
;
Gia_Obj_t
*
pObj
;
int
i
;
Gia_ManCleanMark0
(
p
);
Gia_ManCycle
(
p
,
nFrames
);
vInits
=
Vec_IntAlloc
(
Gia_ManRegNum
(
p
)
);
Gia_ManForEachRo
(
p
,
pObj
,
i
)
Vec_IntPush
(
vInits
,
pObj
->
fMark0
);
pNew
=
Gia_ManDupFlip
(
p
,
Vec_IntArray
(
vInits
)
);
Vec_IntFree
(
vInits
);
Gia_ManCleanMark0
(
p
);
return
pNew
;
}
/**Function*************************************************************
Synopsis [Duplicates AIG without any changes.]
Synopsis [Duplicates AIG without any changes.]
Description []
Description []
...
...
src/base/abci/abc.c
View file @
a82b0a8a
...
@@ -371,6 +371,7 @@ static int Abc_CommandAbc9ReachY ( Abc_Frame_t * pAbc, int argc, cha
...
@@ -371,6 +371,7 @@ static int Abc_CommandAbc9ReachY ( Abc_Frame_t * pAbc, int argc, cha
static
int
Abc_CommandAbc9Undo
(
Abc_Frame_t
*
pAbc
,
int
argc
,
char
**
argv
);
static
int
Abc_CommandAbc9Undo
(
Abc_Frame_t
*
pAbc
,
int
argc
,
char
**
argv
);
static
int
Abc_CommandAbc9Iso
(
Abc_Frame_t
*
pAbc
,
int
argc
,
char
**
argv
);
static
int
Abc_CommandAbc9Iso
(
Abc_Frame_t
*
pAbc
,
int
argc
,
char
**
argv
);
static
int
Abc_CommandAbc9CexInfo
(
Abc_Frame_t
*
pAbc
,
int
argc
,
char
**
argv
);
static
int
Abc_CommandAbc9CexInfo
(
Abc_Frame_t
*
pAbc
,
int
argc
,
char
**
argv
);
static
int
Abc_CommandAbc9Cycle
(
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 );
//static int Abc_CommandAbc9CexMin ( Abc_Frame_t * pAbc, int argc, char ** argv );
//static int Abc_CommandAbc9CexMin ( Abc_Frame_t * pAbc, int argc, char ** argv );
...
@@ -834,6 +835,7 @@ void Abc_Init( Abc_Frame_t * pAbc )
...
@@ -834,6 +835,7 @@ void Abc_Init( Abc_Frame_t * pAbc )
Cmd_CommandAdd
(
pAbc
,
"ABC9"
,
"&undo"
,
Abc_CommandAbc9Undo
,
0
);
Cmd_CommandAdd
(
pAbc
,
"ABC9"
,
"&undo"
,
Abc_CommandAbc9Undo
,
0
);
Cmd_CommandAdd
(
pAbc
,
"ABC9"
,
"&iso"
,
Abc_CommandAbc9Iso
,
0
);
Cmd_CommandAdd
(
pAbc
,
"ABC9"
,
"&iso"
,
Abc_CommandAbc9Iso
,
0
);
Cmd_CommandAdd
(
pAbc
,
"ABC9"
,
"&cexinfo"
,
Abc_CommandAbc9CexInfo
,
0
);
Cmd_CommandAdd
(
pAbc
,
"ABC9"
,
"&cexinfo"
,
Abc_CommandAbc9CexInfo
,
0
);
Cmd_CommandAdd
(
pAbc
,
"ABC9"
,
"&cycle"
,
Abc_CommandAbc9Cycle
,
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 );
// Cmd_CommandAdd( pAbc, "ABC9", "&cexmin", Abc_CommandAbc9CexMin, 0 );
// Cmd_CommandAdd( pAbc, "ABC9", "&cexmin", Abc_CommandAbc9CexMin, 0 );
...
@@ -29408,6 +29410,65 @@ usage:
...
@@ -29408,6 +29410,65 @@ usage:
return
1
;
return
1
;
}
}
/**Function*************************************************************
Synopsis []
Description []
SideEffects []
SeeAlso []
***********************************************************************/
int
Abc_CommandAbc9Cycle
(
Abc_Frame_t
*
pAbc
,
int
argc
,
char
**
argv
)
{
Gia_Man_t
*
pTemp
;
int
c
,
nFrames
=
10
,
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_CommandAbc9Cycle(): There is no AIG.
\n
"
);
return
1
;
}
pTemp
=
Gia_ManDupCycled
(
pAbc
->
pGia
,
nFrames
);
Abc_CommandUpdate9
(
pAbc
,
pTemp
);
return
0
;
usage:
Abc_Print
(
-
2
,
"usage: &cycle [-F num] [-vh]
\n
"
);
Abc_Print
(
-
2
,
"
\t
cycles sequential circuit for the given number of timeframes
\n
"
);
Abc_Print
(
-
2
,
"
\t
to derive a new initial state (which may be on the envelope)
\n
"
);
Abc_Print
(
-
2
,
"
\t
-F num : the number of frames to simulate [default = %d]
\n
"
,
nFrames
);
Abc_Print
(
-
2
,
"
\t
-v : toggle printing verbose information [default = %s]
\n
"
,
fVerbose
?
"yes"
:
"no"
);
Abc_Print
(
-
2
,
"
\t
-h : print the command usage
\n
"
);
return
1
;
}
/**Function*************************************************************
/**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