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
929e5e16
Commit
929e5e16
authored
Mar 03, 2012
by
Niklas Een
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Some fixes to the Bridge code. More to do.
parent
1e40c5b7
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
8 deletions
+21
-8
src/misc/util/utilBridge.c
+21
-8
No files found.
src/misc/util/utilBridge.c
View file @
929e5e16
...
@@ -177,16 +177,28 @@ int Gia_ManToBridgeBadAbs( FILE * pFile )
...
@@ -177,16 +177,28 @@ int Gia_ManToBridgeBadAbs( FILE * pFile )
***********************************************************************/
***********************************************************************/
void
Gia_ManFromBridgeHolds
(
FILE
*
pFile
)
void
Gia_ManFromBridgeHolds
(
FILE
*
pFile
)
{
{
fprintf
(
pFile
,
"%.6d"
,
101
/*message type = Result*/
);
fprintf
(
pFile
,
" "
);
fprintf
(
pFile
,
"%.16d"
,
4
/*size in bytes*/
);
fprintf
(
pFile
,
" "
);
fputc
(
(
char
)
BRIDGE_VALUE_1
,
pFile
);
// true
fputc
(
(
char
)
BRIDGE_VALUE_1
,
pFile
);
// true
fputc
(
(
char
)
1
,
pFile
);
// size of vector (Armin's encoding)
fputc
(
(
char
)
1
,
pFile
);
// size of vector (Armin's encoding)
fputc
(
(
char
)
0
,
pFile
);
// number of the property (Armin's encoding)
fputc
(
(
char
)
0
,
pFile
);
// number of the property (Armin's encoding)
fputc
(
(
char
)
0
,
pFile
);
// no invariant
fputc
(
(
char
)
0
,
pFile
);
// no invariant
fflush
(
pFile
);
}
}
void
Gia_ManFromBridgeUnknown
(
FILE
*
pFile
)
void
Gia_ManFromBridgeUnknown
(
FILE
*
pFile
)
{
{
fprintf
(
pFile
,
"%.6d"
,
101
/*message type = Result*/
);
fprintf
(
pFile
,
" "
);
fprintf
(
pFile
,
"%.16d"
,
3
/*size in bytes*/
);
fprintf
(
pFile
,
" "
);
fputc
(
(
char
)
BRIDGE_VALUE_X
,
pFile
);
// undef
fputc
(
(
char
)
BRIDGE_VALUE_X
,
pFile
);
// undef
fputc
(
(
char
)
1
,
pFile
);
// size of vector (Armin's encoding)
fputc
(
(
char
)
1
,
pFile
);
// size of vector (Armin's encoding)
fputc
(
(
char
)
0
,
pFile
);
// number of the property (Armin's encoding)
fputc
(
(
char
)
0
,
pFile
);
// number of the property (Armin's encoding)
fflush
(
pFile
);
}
}
void
Gia_ManFromBridgeCex
(
FILE
*
pFile
,
Abc_Cex_t
*
pCex
)
void
Gia_ManFromBridgeCex
(
FILE
*
pFile
,
Abc_Cex_t
*
pCex
)
{
{
...
@@ -210,9 +222,11 @@ void Gia_ManFromBridgeCex( FILE * pFile, Abc_Cex_t * pCex )
...
@@ -210,9 +222,11 @@ void Gia_ManFromBridgeCex( FILE * pFile, Abc_Cex_t * pCex )
Vec_StrPush
(
vStr
,
(
char
)
1
);
// the number of frames (for a concrete counter-example)
Vec_StrPush
(
vStr
,
(
char
)
1
);
// the number of frames (for a concrete counter-example)
for
(
i
=
0
;
i
<
pCex
->
nRegs
;
i
++
)
for
(
i
=
0
;
i
<
pCex
->
nRegs
;
i
++
)
Vec_StrPush
(
vStr
,
(
char
)
BRIDGE_VALUE_0
);
// always zero!!!
Vec_StrPush
(
vStr
,
(
char
)
BRIDGE_VALUE_0
);
// always zero!!!
RetValue
=
fwrite
(
Vec_StrArray
(
vStr
),
Vec_StrSize
(
vStr
),
1
,
pFile
);
// RetValue = fwrite( Vec_StrArray(vStr), Vec_StrSize(vStr), 1, pFile );
assert
(
RetValue
==
1
);
Gia_CreateHeader
(
pFile
,
101
/*type=Result*/
,
Vec_StrSize
(
vStr
),
(
unsigned
char
*
)
Vec_StrArray
(
vStr
));
Vec_StrFree
(
vStr
);
Vec_StrFree
(
vStr
);
fflush
(
pFile
);
}
}
int
Gia_ManToBridgeResult
(
FILE
*
pFile
,
int
Result
,
Abc_Cex_t
*
pCex
)
int
Gia_ManToBridgeResult
(
FILE
*
pFile
,
int
Result
,
Abc_Cex_t
*
pCex
)
{
{
...
@@ -280,7 +294,7 @@ Gia_Man_t * Gia_ManFromBridgeReadBody( int Size, unsigned char * pBuffer, Vec_I
...
@@ -280,7 +294,7 @@ Gia_Man_t * Gia_ManFromBridgeReadBody( int Size, unsigned char * pBuffer, Vec_I
iFan1
=
Abc_LitNotCond
(
Vec_IntEntry
(
vLits
,
iFan1
>>
1
),
iFan1
&
1
);
iFan1
=
Abc_LitNotCond
(
Vec_IntEntry
(
vLits
,
iFan1
>>
1
),
iFan1
&
1
);
if
(
fHash
)
if
(
fHash
)
Vec_IntPush
(
vLits
,
Gia_ManHashAnd
(
p
,
iFan0
,
iFan1
)
);
Vec_IntPush
(
vLits
,
Gia_ManHashAnd
(
p
,
iFan0
,
iFan1
)
);
else
else
Vec_IntPush
(
vLits
,
Gia_ManAppendAnd
(
p
,
iFan0
,
iFan1
)
);
Vec_IntPush
(
vLits
,
Gia_ManAppendAnd
(
p
,
iFan0
,
iFan1
)
);
}
}
...
@@ -299,7 +313,7 @@ Gia_Man_t * Gia_ManFromBridgeReadBody( int Size, unsigned char * pBuffer, Vec_I
...
@@ -299,7 +313,7 @@ Gia_Man_t * Gia_ManFromBridgeReadBody( int Size, unsigned char * pBuffer, Vec_I
for
(
i
=
0
;
i
<
nProps
;
i
++
)
for
(
i
=
0
;
i
<
nProps
;
i
++
)
{
{
iFan0
=
Gia_ReadAigerDecode
(
&
pBuffer
);
iFan0
=
Gia_ReadAigerDecode
(
&
pBuffer
);
iFan0
=
Abc_LitNotCond
(
Vec_IntEntry
(
vLits
,
iFan0
>>
1
),
iFan0
&
1
);
iFan0
=
Abc_LitNotCond
(
Vec_IntEntry
(
vLits
,
iFan0
>>
1
),
iFan0
&
1
);
// complement property output!!!
// complement property output!!!
Gia_ManAppendCo
(
p
,
Abc_LitNot
(
iFan0
)
);
Gia_ManAppendCo
(
p
,
Abc_LitNot
(
iFan0
)
);
}
}
...
@@ -396,13 +410,13 @@ Gia_Man_t * Gia_ManFromBridge( FILE * pFile, Vec_Int_t ** pvInit )
...
@@ -396,13 +410,13 @@ Gia_Man_t * Gia_ManFromBridge( FILE * pFile, Vec_Int_t ** pvInit )
RetValue
=
Gia_ManFromBridgeReadPackage
(
pFile
,
&
Type
,
&
Size
,
&
pBuffer
);
RetValue
=
Gia_ManFromBridgeReadPackage
(
pFile
,
&
Type
,
&
Size
,
&
pBuffer
);
ABC_FREE
(
pBuffer
);
ABC_FREE
(
pBuffer
);
if
(
!
RetValue
)
if
(
!
RetValue
)
return
NULL
;
return
NULL
;
RetValue
=
Gia_ManFromBridgeReadPackage
(
pFile
,
&
Type
,
&
Size
,
&
pBuffer
);
RetValue
=
Gia_ManFromBridgeReadPackage
(
pFile
,
&
Type
,
&
Size
,
&
pBuffer
);
if
(
!
RetValue
)
if
(
!
RetValue
)
return
NULL
;
return
NULL
;
p
=
Gia_ManFromBridgeReadBody
(
Size
,
pBuffer
,
pvInit
);
p
=
Gia_ManFromBridgeReadBody
(
Size
,
pBuffer
,
pvInit
);
ABC_FREE
(
pBuffer
);
ABC_FREE
(
pBuffer
);
if
(
p
==
NULL
)
if
(
p
==
NULL
)
return
NULL
;
return
NULL
;
...
@@ -471,7 +485,7 @@ void Gia_ManFromBridgeTest( char * pFileName )
...
@@ -471,7 +485,7 @@ void Gia_ManFromBridgeTest( char * pFileName )
Gia_ManPrintStats
(
p
,
0
,
0
);
Gia_ManPrintStats
(
p
,
0
,
0
);
Gia_WriteAiger
(
p
,
"temp.aig"
,
0
,
0
);
Gia_WriteAiger
(
p
,
"temp.aig"
,
0
,
0
);
Gia_ManToBridgeAbsNetlistTest
(
"par_.dump"
,
p
);
Gia_ManToBridgeAbsNetlistTest
(
"par_.dump"
,
p
);
Gia_ManStop
(
p
);
Gia_ManStop
(
p
);
}
}
...
@@ -484,4 +498,3 @@ void Gia_ManFromBridgeTest( char * pFileName )
...
@@ -484,4 +498,3 @@ void Gia_ManFromBridgeTest( char * pFileName )
ABC_NAMESPACE_IMPL_END
ABC_NAMESPACE_IMPL_END
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