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
3eae30a3
Commit
3eae30a3
authored
Apr 24, 2011
by
Alan Mishchenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added support for AIG returned in the output file.
parent
affb43e2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
36 additions
and
9 deletions
+36
-9
src/aig/gia/giaAiger.c
+2
-1
src/base/cmd/cmdPlugin.c
+34
-8
No files found.
src/aig/gia/giaAiger.c
View file @
3eae30a3
...
...
@@ -763,7 +763,8 @@ Gia_Man_t * Gia_ReadAigerFromMemory( char * pContents, int nFileSize, int fCheck
// get terminal number
iTerm
=
atoi
(
(
char
*
)
++
pCur
);
while
(
*
pCur
++
!=
' '
);
// skip spaces
while
(
*
pCur
++
==
' '
);
while
(
*
pCur
==
' '
)
pCur
++
;
// decode the user numbers:
// flops are named: @l<num>
// PIs are named: @i<num>
...
...
src/base/cmd/cmdPlugin.c
View file @
3eae30a3
...
...
@@ -334,7 +334,6 @@ static unsigned textToBin(char* text, unsigned long text_sz)
unsigned
sz
,
i
;
sscanf
(
src
,
"%lu "
,
&
sz
);
while
(
*
src
++
!=
' '
);
for
(
i
=
0
;
i
<
sz
;
i
+=
3
)
{
dst
[
0
]
=
(
char
)(
(
unsigned
)
src
[
0
]
-
'0'
)
|
(((
unsigned
)
src
[
1
]
-
'0'
)
<<
6
);
...
...
@@ -362,7 +361,7 @@ Gia_Man_t * Abc_ManReadAig( char * pFileName, char * pToken )
Gia_Man_t
*
pGia
=
NULL
;
unsigned
nBinaryPart
;
Vec_Str_t
*
vStr
;
char
*
pStr
;
char
*
pStr
,
*
pEnd
;
vStr
=
Abc_ManReadFile
(
pFileName
);
if
(
vStr
==
NULL
)
return
NULL
;
...
...
@@ -370,8 +369,28 @@ Gia_Man_t * Abc_ManReadAig( char * pFileName, char * pToken )
pStr
=
strstr
(
pStr
,
pToken
);
if
(
pStr
!=
NULL
)
{
// skip token
pStr
+=
strlen
(
pToken
);
// skip spaces
while
(
*
pStr
==
' '
)
pStr
++
;
// set the end at newline
for
(
pEnd
=
pStr
;
*
pEnd
;
pEnd
++
)
if
(
*
pEnd
==
'\r'
||
*
pEnd
==
'\n'
)
{
*
pEnd
=
0
;
break
;
}
// convert into binary AIGER
nBinaryPart
=
textToBin
(
pStr
,
strlen
(
pStr
)
);
// dump it into file
if
(
0
)
{
FILE
*
pFile
=
fopen
(
"test.aig"
,
"wb"
);
fwrite
(
pStr
,
1
,
nBinaryPart
,
pFile
);
fclose
(
pFile
);
}
// derive AIG
pGia
=
Gia_ReadAigerFromMemory
(
pStr
,
nBinaryPart
,
0
);
}
Vec_StrFree
(
vStr
);
...
...
@@ -397,6 +416,7 @@ int Cmd_CommandAbcPlugIn( Abc_Frame_t * pAbc, int argc, char ** argv )
Vec_Str_t
*
vCommand
;
Vec_Int_t
*
vCex
;
FILE
*
pFile
;
Gia_Man_t
*
pGia
;
int
i
,
fd
,
clk
;
int
fLeaveFiles
;
/*
...
...
@@ -536,12 +556,15 @@ int Cmd_CommandAbcPlugIn( Abc_Frame_t * pAbc, int argc, char ** argv )
// process the output
if
(
Extra_FileSize
(
pFileOut
)
>
0
)
{
//
read program argument
s
//
get statu
s
pAbc
->
Status
=
Abc_ManReadStatus
(
pFileOut
,
"result:"
);
// get bug-free depth
pAbc
->
nFrames
=
Abc_ManReadInteger
(
pFileOut
,
"bug-free-depth:"
);
if
(
pAbc
->
nFrames
==
-
1
)
printf
(
"Gia_ManCexAbstractionStartNew(): Cannot read the number of frames covered by BMC.
\n
"
);
// get abstraction
pAbc
->
pGia
->
vFlopClasses
=
Abc_ManReadBinary
(
pFileOut
,
"abstraction:"
);
// get counter-example
vCex
=
Abc_ManReadBinary
(
pFileOut
,
"counter-example:"
);
if
(
vCex
)
{
...
...
@@ -588,11 +611,14 @@ int Cmd_CommandAbcPlugIn( Abc_Frame_t * pAbc, int argc, char ** argv )
}
Vec_IntFreeP
(
&
vCex
);
}
// derive AIG if present
}
// get AIG if present
pGia
=
Abc_ManReadAig
(
pFileOut
,
"aig:"
);
if
(
pGia
!=
NULL
)
{
Gia_ManStopP
(
&
pAbc
->
pGia
);
pAbc
->
pGia
=
pGia
;
}
}
// clean up
Util_SignalTmpFileRemove
(
pFileIn
,
fLeaveFiles
);
...
...
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