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
615d249e
Commit
615d249e
authored
Oct 31, 2013
by
Alan Mishchenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
GIA sweeper: adding APIs to return valid probe ID and run a command line.
parent
69523114
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
72 additions
and
0 deletions
+72
-0
src/aig/gia/gia.h
+2
-0
src/aig/gia/giaSweeper.c
+70
-0
No files found.
src/aig/gia/gia.h
View file @
615d249e
...
...
@@ -1183,6 +1183,7 @@ extern int Gia_SweeperProbeCreate( Gia_Man_t * p, int iLit );
extern
int
Gia_SweeperProbeDelete
(
Gia_Man_t
*
p
,
int
ProbeId
);
extern
int
Gia_SweeperProbeUpdate
(
Gia_Man_t
*
p
,
int
ProbeId
,
int
iLitNew
);
extern
int
Gia_SweeperProbeLit
(
Gia_Man_t
*
p
,
int
ProbeId
);
extern
Vec_Int_t
*
Gia_SweeperCollectValidProbeIds
(
Gia_Man_t
*
p
);
extern
int
Gia_SweeperCondPop
(
Gia_Man_t
*
p
);
extern
void
Gia_SweeperCondPush
(
Gia_Man_t
*
p
,
int
ProbeId
);
extern
Vec_Int_t
*
Gia_SweeperCondVector
(
Gia_Man_t
*
p
);
...
...
@@ -1192,6 +1193,7 @@ extern Gia_Man_t * Gia_SweeperExtractUserLogic( Gia_Man_t * p, Vec_Int_t
extern
Gia_Man_t
*
Gia_SweeperCleanup
(
Gia_Man_t
*
p
,
char
*
pCommLime
);
extern
Vec_Int_t
*
Gia_SweeperGraft
(
Gia_Man_t
*
pDst
,
Vec_Int_t
*
vProbes
,
Gia_Man_t
*
pSrc
);
extern
int
Gia_SweeperFraig
(
Gia_Man_t
*
p
,
Vec_Int_t
*
vProbeIds
,
char
*
pCommLime
,
int
nWords
,
int
nConfs
,
int
fVerbose
);
extern
int
Gia_SweeperRun
(
Gia_Man_t
*
p
,
Vec_Int_t
*
vProbeIds
,
char
*
pCommLime
,
int
fVerbose
);
/*=== giaSwitch.c ============================================================*/
extern
float
Gia_ManEvaluateSwitching
(
Gia_Man_t
*
p
);
extern
float
Gia_ManComputeSwitching
(
Gia_Man_t
*
p
,
int
nFrames
,
int
nPref
,
int
fProbOne
);
...
...
src/aig/gia/giaSweeper.c
View file @
615d249e
...
...
@@ -283,6 +283,30 @@ int Gia_SweeperProbeLit( Gia_Man_t * p, int ProbeId )
/**Function*************************************************************
Synopsis [This procedure returns indexes of all currently defined valid probes.]
Description []
SideEffects []
SeeAlso []
***********************************************************************/
Vec_Int_t
*
Gia_SweeperCollectValidProbeIds
(
Gia_Man_t
*
p
)
{
Swp_Man_t
*
pSwp
=
(
Swp_Man_t
*
)
p
->
pData
;
Vec_Int_t
*
vProbeIds
=
Vec_IntAlloc
(
1000
);
int
iLit
,
ProbeId
;
Vec_IntForEachEntry
(
pSwp
->
vProbes
,
iLit
,
ProbeId
)
{
if
(
iLit
<
0
)
continue
;
Vec_IntPush
(
vProbeIds
,
ProbeId
);
}
return
vProbeIds
;
}
/**Function*************************************************************
Synopsis []
Description []
...
...
@@ -1034,6 +1058,52 @@ int Gia_SweeperFraig( Gia_Man_t * p, Vec_Int_t * vProbeIds, char * pCommLime, in
/**Function*************************************************************
Synopsis [Executes given command line for the logic defined by the probes.]
Description [ ]
SideEffects []
SeeAlso []
***********************************************************************/
int
Gia_SweeperRun
(
Gia_Man_t
*
p
,
Vec_Int_t
*
vProbeIds
,
char
*
pCommLime
,
int
fVerbose
)
{
Gia_Man_t
*
pNew
;
Vec_Int_t
*
vLits
;
int
ProbeId
,
i
;
// sweeper is running
assert
(
Gia_SweeperIsRunning
(
p
)
);
// sweep the logic
pNew
=
Gia_SweeperExtractUserLogic
(
p
,
vProbeIds
,
NULL
,
NULL
);
// execute command line
if
(
pCommLime
)
{
if
(
fVerbose
)
printf
(
"GIA manager statistics before and after applying
\"
%s
\"
:
\n
"
,
pCommLine
);
if
(
fVerbose
)
Gia_ManPrintStats
(
pNew
,
NULL
);
// set pNew to be current GIA in ABC
Abc_FrameUpdateGia
(
Abc_FrameGetGlobalFrame
(),
pNew
);
// execute command line pCommLine using Abc_CmdCommandExecute()
Cmd_CommandExecute
(
Abc_FrameGetGlobalFrame
(),
pCommLime
);
// get pNew to be current GIA in ABC
pNew
=
Abc_FrameGetGia
(
Abc_FrameGetGlobalFrame
()
);
if
(
fVerbose
)
Gia_ManPrintStats
(
pNew
,
NULL
);
}
// return logic back into the main manager
vLits
=
Gia_SweeperGraft
(
p
,
NULL
,
pNew
);
Gia_ManStop
(
pNew
);
// update the array of probes
Vec_IntForEachEntry
(
vProbeIds
,
ProbeId
,
i
)
Gia_SweeperProbeUpdate
(
p
,
ProbeId
,
Vec_IntEntry
(
vLits
,
i
)
);
Vec_IntFree
(
vLits
);
return
1
;
}
/**Function*************************************************************
Synopsis [Sweeper sweeper test.]
Description []
...
...
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