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
d82142cb
Commit
d82142cb
authored
Jul 07, 2012
by
Alan Mishchenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed &gla to work in the bridge mode.
parent
8b881d23
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
76 additions
and
29 deletions
+76
-29
src/aig/gia/giaAbsGla.c
+65
-10
src/aig/gia/giaAbsVta.c
+11
-19
No files found.
src/aig/gia/giaAbsGla.c
View file @
d82142cb
...
@@ -1678,6 +1678,42 @@ void Gla_ManReportMemory( Gla_Man_t * p )
...
@@ -1678,6 +1678,42 @@ void Gla_ManReportMemory( Gla_Man_t * p )
SeeAlso []
SeeAlso []
***********************************************************************/
***********************************************************************/
void
Gia_GlaSendAbsracted
(
Gla_Man_t
*
p
,
int
fVerbose
)
{
extern
int
Gia_ManToBridgeAbsNetlist
(
FILE
*
pFile
,
Gia_Man_t
*
p
);
Gia_Man_t
*
pAbs
;
Vec_Int_t
*
vGateClasses
;
assert
(
Abc_FrameIsBridgeMode
()
);
// if ( fVerbose )
// Abc_Print( 1, "Sending abstracted model...\n" );
// create abstraction
vGateClasses
=
Gla_ManTranslate
(
p
);
pAbs
=
Gia_ManDupAbsGates
(
p
->
pGia0
,
vGateClasses
);
Vec_IntFreeP
(
&
vGateClasses
);
// send it out
Gia_ManToBridgeAbsNetlist
(
stdout
,
pAbs
);
Gia_ManStop
(
pAbs
);
}
void
Gia_GlaSendCancel
(
Gla_Man_t
*
p
,
int
fVerbose
)
{
extern
int
Gia_ManToBridgeBadAbs
(
FILE
*
pFile
);
assert
(
Abc_FrameIsBridgeMode
()
);
// if ( fVerbose )
// Abc_Print( 1, "Cancelling previously sent model...\n" );
Gia_ManToBridgeBadAbs
(
stdout
);
}
/**Function*************************************************************
Synopsis [Send abstracted model or send cancel.]
Description [Counter-example will be sent automatically when &vta terminates.]
SideEffects []
SeeAlso []
***********************************************************************/
void
Gia_GlaDumpAbsracted
(
Gla_Man_t
*
p
,
int
fVerbose
)
void
Gia_GlaDumpAbsracted
(
Gla_Man_t
*
p
,
int
fVerbose
)
{
{
char
*
pFileName
=
p
->
pPars
->
pFileVabs
?
p
->
pPars
->
pFileVabs
:
"glabs.aig"
;
char
*
pFileName
=
p
->
pPars
->
pFileVabs
?
p
->
pPars
->
pFileVabs
:
"glabs.aig"
;
...
@@ -1685,8 +1721,6 @@ void Gia_GlaDumpAbsracted( Gla_Man_t * p, int fVerbose )
...
@@ -1685,8 +1721,6 @@ void Gia_GlaDumpAbsracted( Gla_Man_t * p, int fVerbose )
Vec_Int_t
*
vGateClasses
;
Vec_Int_t
*
vGateClasses
;
if
(
fVerbose
)
if
(
fVerbose
)
Abc_Print
(
1
,
"Dumping abstracted model into file
\"
%s
\"
...
\n
"
,
pFileName
);
Abc_Print
(
1
,
"Dumping abstracted model into file
\"
%s
\"
...
\n
"
,
pFileName
);
// if ( !Abc_FrameIsBridgeMode() )
// return;
// create abstraction
// create abstraction
vGateClasses
=
Gla_ManTranslate
(
p
);
vGateClasses
=
Gla_ManTranslate
(
p
);
pAbs
=
Gia_ManDupAbsGates
(
p
->
pGia0
,
vGateClasses
);
pAbs
=
Gia_ManDupAbsGates
(
p
->
pGia0
,
vGateClasses
);
...
@@ -1714,7 +1748,7 @@ int Gia_GlaPerform( Gia_Man_t * pAig, Gia_ParVta_t * pPars, int fStartVta )
...
@@ -1714,7 +1748,7 @@ int Gia_GlaPerform( Gia_Man_t * pAig, Gia_ParVta_t * pPars, int fStartVta )
Gla_Man_t
*
p
;
Gla_Man_t
*
p
;
Vec_Int_t
*
vCore
,
*
vPPis
;
Vec_Int_t
*
vCore
,
*
vPPis
;
Abc_Cex_t
*
pCex
=
NULL
;
Abc_Cex_t
*
pCex
=
NULL
;
int
i
,
f
,
nConfls
,
Status
,
nCoreSize
,
RetValue
=
-
1
;
int
f
,
i
,
iPrev
,
nConfls
,
Status
,
nCoreSize
,
fOneIsSent
=
0
,
RetValue
=
-
1
;
int
clk
=
clock
(),
clk2
;
int
clk
=
clock
(),
clk2
;
// preconditions
// preconditions
assert
(
Gia_ManPoNum
(
pAig
)
==
1
);
assert
(
Gia_ManPoNum
(
pAig
)
==
1
);
...
@@ -1769,7 +1803,7 @@ int Gia_GlaPerform( Gia_Man_t * pAig, Gia_ParVta_t * pPars, int fStartVta )
...
@@ -1769,7 +1803,7 @@ int Gia_GlaPerform( Gia_Man_t * pAig, Gia_ParVta_t * pPars, int fStartVta )
pPars
->
nFramesMax
,
pPars
->
nConfLimit
,
pPars
->
nLearntMax
,
pPars
->
nTimeOut
,
pPars
->
nRatioMin
);
pPars
->
nFramesMax
,
pPars
->
nConfLimit
,
pPars
->
nLearntMax
,
pPars
->
nTimeOut
,
pPars
->
nRatioMin
);
Abc_Print
(
1
,
"Frame %% Abs PPI FF LUT Confl Cex SatVar Core Time
\n
"
);
Abc_Print
(
1
,
"Frame %% Abs PPI FF LUT Confl Cex SatVar Core Time
\n
"
);
}
}
for
(
f
=
i
=
0
;
!
p
->
pPars
->
nFramesMax
||
f
<
p
->
pPars
->
nFramesMax
;
f
++
)
for
(
f
=
i
=
iPrev
=
0
;
!
p
->
pPars
->
nFramesMax
||
f
<
p
->
pPars
->
nFramesMax
;
f
++
,
iPrev
=
i
)
{
{
int
nConflsBeg
=
sat_solver2_nconflicts
(
p
->
pSat
);
int
nConflsBeg
=
sat_solver2_nconflicts
(
p
->
pSat
);
p
->
pPars
->
iFrame
=
f
;
p
->
pPars
->
iFrame
=
f
;
...
@@ -1807,6 +1841,14 @@ int Gia_GlaPerform( Gia_Man_t * pAig, Gia_ParVta_t * pPars, int fStartVta )
...
@@ -1807,6 +1841,14 @@ int Gia_GlaPerform( Gia_Man_t * pAig, Gia_ParVta_t * pPars, int fStartVta )
p
->
timeSat
+=
clock
()
-
clk2
;
p
->
timeSat
+=
clock
()
-
clk2
;
assert
(
Status
==
0
);
assert
(
Status
==
0
);
p
->
nCexes
++
;
p
->
nCexes
++
;
// cancel old one if it was sent
if
(
Abc_FrameIsBridgeMode
()
&&
fOneIsSent
)
{
Gia_GlaSendCancel
(
p
,
pPars
->
fVerbose
);
fOneIsSent
=
0
;
}
// perform the refinement
// perform the refinement
clk2
=
clock
();
clk2
=
clock
();
if
(
pPars
->
fAddLayer
)
if
(
pPars
->
fAddLayer
)
...
@@ -1876,13 +1918,26 @@ int Gia_GlaPerform( Gia_Man_t * pAig, Gia_ParVta_t * pPars, int fStartVta )
...
@@ -1876,13 +1918,26 @@ int Gia_GlaPerform( Gia_Man_t * pAig, Gia_ParVta_t * pPars, int fStartVta )
if
(
p
->
pPars
->
fVerbose
)
if
(
p
->
pPars
->
fVerbose
)
Gla_ManAbsPrintFrame
(
p
,
nCoreSize
,
f
+
1
,
sat_solver2_nconflicts
(
p
->
pSat
)
-
nConflsBeg
,
i
,
clock
()
-
clk
);
Gla_ManAbsPrintFrame
(
p
,
nCoreSize
,
f
+
1
,
sat_solver2_nconflicts
(
p
->
pSat
)
-
nConflsBeg
,
i
,
clock
()
-
clk
);
// dump the model
if
(
f
>
2
&&
iPrev
>
0
&&
i
==
0
)
// change has happened
if
(
p
->
pPars
->
fDumpVabs
&&
(
f
&
1
)
)
{
{
Abc_FrameSetCex
(
NULL
);
if
(
Abc_FrameIsBridgeMode
()
)
Abc_FrameSetNFrames
(
f
+
1
);
{
Cmd_CommandExecute
(
Abc_FrameGetGlobalFrame
(),
"write_status gla.status"
);
// cancel old one if it was sent
Gia_GlaDumpAbsracted
(
p
,
pPars
->
fVerbose
);
if
(
fOneIsSent
)
Gia_GlaSendCancel
(
p
,
pPars
->
fVerbose
);
// send new one
Gia_GlaSendAbsracted
(
p
,
pPars
->
fVerbose
);
fOneIsSent
=
1
;
}
// dump the model into file
if
(
p
->
pPars
->
fDumpVabs
)
{
Abc_FrameSetCex
(
NULL
);
Abc_FrameSetNFrames
(
f
+
1
);
Cmd_CommandExecute
(
Abc_FrameGetGlobalFrame
(),
"write_status gla.status"
);
Gia_GlaDumpAbsracted
(
p
,
pPars
->
fVerbose
);
}
}
}
// check if the number of objects is below limit
// check if the number of objects is below limit
...
...
src/aig/gia/giaAbsVta.c
View file @
d82142cb
...
@@ -1433,10 +1433,9 @@ void Gia_VtaSendAbsracted( Vta_Man_t * p, int fVerbose )
...
@@ -1433,10 +1433,9 @@ void Gia_VtaSendAbsracted( Vta_Man_t * p, int fVerbose )
{
{
extern
int
Gia_ManToBridgeAbsNetlist
(
FILE
*
pFile
,
Gia_Man_t
*
p
);
extern
int
Gia_ManToBridgeAbsNetlist
(
FILE
*
pFile
,
Gia_Man_t
*
p
);
Gia_Man_t
*
pAbs
;
Gia_Man_t
*
pAbs
;
assert
(
Abc_FrameIsBridgeMode
()
);
// if ( fVerbose )
// if ( fVerbose )
// Abc_Print( 1, "Sending abstracted model...\n" );
// Abc_Print( 1, "Sending abstracted model...\n" );
if
(
!
Abc_FrameIsBridgeMode
()
)
return
;
// create obj classes
// create obj classes
Vec_IntFreeP
(
&
p
->
pGia
->
vObjClasses
);
Vec_IntFreeP
(
&
p
->
pGia
->
vObjClasses
);
p
->
pGia
->
vObjClasses
=
Gia_VtaFramesToAbs
(
(
Vec_Vec_t
*
)
p
->
vCores
);
p
->
pGia
->
vObjClasses
=
Gia_VtaFramesToAbs
(
(
Vec_Vec_t
*
)
p
->
vCores
);
...
@@ -1454,10 +1453,9 @@ void Gia_VtaSendAbsracted( Vta_Man_t * p, int fVerbose )
...
@@ -1454,10 +1453,9 @@ void Gia_VtaSendAbsracted( Vta_Man_t * p, int fVerbose )
void
Gia_VtaSendCancel
(
Vta_Man_t
*
p
,
int
fVerbose
)
void
Gia_VtaSendCancel
(
Vta_Man_t
*
p
,
int
fVerbose
)
{
{
extern
int
Gia_ManToBridgeBadAbs
(
FILE
*
pFile
);
extern
int
Gia_ManToBridgeBadAbs
(
FILE
*
pFile
);
assert
(
Abc_FrameIsBridgeMode
()
);
// if ( fVerbose )
// if ( fVerbose )
// Abc_Print( 1, "Cancelling previously sent model...\n" );
// Abc_Print( 1, "Cancelling previously sent model...\n" );
if
(
!
Abc_FrameIsBridgeMode
()
)
return
;
Gia_ManToBridgeBadAbs
(
stdout
);
Gia_ManToBridgeBadAbs
(
stdout
);
}
}
...
@@ -1478,8 +1476,6 @@ void Gia_VtaDumpAbsracted( Vta_Man_t * p, int fVerbose )
...
@@ -1478,8 +1476,6 @@ void Gia_VtaDumpAbsracted( Vta_Man_t * p, int fVerbose )
Gia_Man_t
*
pAbs
;
Gia_Man_t
*
pAbs
;
if
(
fVerbose
)
if
(
fVerbose
)
Abc_Print
(
1
,
"Dumping abstracted model into file
\"
%s
\"
...
\n
"
,
pFileName
);
Abc_Print
(
1
,
"Dumping abstracted model into file
\"
%s
\"
...
\n
"
,
pFileName
);
// if ( !Abc_FrameIsBridgeMode() )
// return;
// create obj classes
// create obj classes
Vec_IntFreeP
(
&
p
->
pGia
->
vObjClasses
);
Vec_IntFreeP
(
&
p
->
pGia
->
vObjClasses
);
p
->
pGia
->
vObjClasses
=
Gia_VtaFramesToAbs
(
(
Vec_Vec_t
*
)
p
->
vCores
);
p
->
pGia
->
vObjClasses
=
Gia_VtaFramesToAbs
(
(
Vec_Vec_t
*
)
p
->
vCores
);
...
@@ -1674,22 +1670,18 @@ int Gia_VtaPerformInt( Gia_Man_t * pAig, Gia_ParVta_t * pPars )
...
@@ -1674,22 +1670,18 @@ int Gia_VtaPerformInt( Gia_Man_t * pAig, Gia_ParVta_t * pPars )
{
{
// reset the counter of frames without change
// reset the counter of frames without change
nCountNoChange
=
1
;
nCountNoChange
=
1
;
// cancel old one if it was sent
// if ( fOneIsSent )
// Gia_VtaSendCancel( p, pPars->fVerbose );
// fOneIsSent = 0;
}
}
else
if
(
++
nCountNoChange
==
2
)
// time to send
else
if
(
++
nCountNoChange
==
2
)
// time to send
{
{
// cancel old one if it was sent
if
(
Abc_FrameIsBridgeMode
()
)
if
(
fOneIsSent
)
{
Gia_VtaSendCancel
(
p
,
pPars
->
fVerbose
);
// cancel old one if it was sent
// send new one
if
(
fOneIsSent
)
Gia_VtaSendAbsracted
(
p
,
pPars
->
fVerbose
);
Gia_VtaSendCancel
(
p
,
pPars
->
fVerbose
);
fOneIsSent
=
1
;
// send new one
// dump the model
Gia_VtaSendAbsracted
(
p
,
pPars
->
fVerbose
);
// if ( p->pPars->fDumpVabs )
fOneIsSent
=
1
;
// Gia_VtaDumpAbsracted( p, pPars->fVerbose );
}
}
}
// dump the model
// dump the model
if
(
p
->
pPars
->
fDumpVabs
&&
(
f
&
1
)
)
if
(
p
->
pPars
->
fDumpVabs
&&
(
f
&
1
)
)
...
...
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