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
2cb69e45
Commit
2cb69e45
authored
Oct 08, 2012
by
Alan Mishchenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bug fix in reading AIGER with both signal names and extensions.
parent
c7e8ad24
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
79 additions
and
79 deletions
+79
-79
src/aig/gia/giaAiger.c
+79
-79
No files found.
src/aig/gia/giaAiger.c
View file @
2cb69e45
...
...
@@ -820,86 +820,8 @@ Gia_Man_t * Gia_ReadAigerFromMemory( char * pContents, int nFileSize, int fSkipS
// create the latches
Gia_ManSetRegNum
(
pNew
,
nLatches
);
// check if there are other types of information to read
pCur
=
pSymbols
;
if
(
pCur
+
1
<
(
unsigned
char
*
)
pContents
+
nFileSize
&&
*
pCur
==
'c'
)
{
pCur
++
;
if
(
*
pCur
==
'e'
)
{
pCur
++
;
// read equivalence classes
pNew
->
pReprs
=
Gia_ReadEquivClasses
(
&
pCur
,
Gia_ManObjNum
(
pNew
)
);
pNew
->
pNexts
=
Gia_ManDeriveNexts
(
pNew
);
}
if
(
*
pCur
==
'f'
)
{
pCur
++
;
// read flop classes
pNew
->
vFlopClasses
=
Vec_IntStart
(
Gia_ManRegNum
(
pNew
)
);
Gia_ReadFlopClasses
(
&
pCur
,
pNew
->
vFlopClasses
,
Gia_ManRegNum
(
pNew
)
);
}
if
(
*
pCur
==
'g'
)
{
pCur
++
;
// read gate classes
pNew
->
vGateClasses
=
Vec_IntStart
(
Gia_ManObjNum
(
pNew
)
);
Gia_ReadFlopClasses
(
&
pCur
,
pNew
->
vGateClasses
,
Gia_ManObjNum
(
pNew
)
);
}
if
(
*
pCur
==
'v'
)
{
pCur
++
;
// read object classes
pNew
->
vObjClasses
=
Vec_IntStart
(
Gia_ReadInt
(
pCur
)
/
4
);
pCur
+=
4
;
memcpy
(
Vec_IntArray
(
pNew
->
vObjClasses
),
pCur
,
4
*
Vec_IntSize
(
pNew
->
vObjClasses
)
);
pCur
+=
4
*
Vec_IntSize
(
pNew
->
vObjClasses
);
}
if
(
*
pCur
==
'm'
)
{
pCur
++
;
// read mapping
pNew
->
pMapping
=
Gia_ReadMapping
(
&
pCur
,
Gia_ManObjNum
(
pNew
)
);
}
if
(
*
pCur
==
'p'
)
{
pCur
++
;
// read placement
pNew
->
pPlacement
=
Gia_ReadPlacement
(
&
pCur
,
Gia_ManObjNum
(
pNew
)
);
}
if
(
*
pCur
==
's'
)
{
pCur
++
;
// read switching activity
pNew
->
pSwitching
=
Gia_ReadSwitching
(
&
pCur
,
Gia_ManObjNum
(
pNew
)
);
}
if
(
*
pCur
==
't'
)
{
Vec_Str_t
*
vStr
;
pCur
++
;
// read timing manager
vStr
=
Vec_StrStart
(
Gia_ReadInt
(
pCur
)
);
pCur
+=
4
;
memcpy
(
Vec_StrArray
(
vStr
),
pCur
,
Vec_StrSize
(
vStr
)
);
pCur
+=
Vec_StrSize
(
vStr
);
pNew
->
pManTime
=
Tim_ManLoad
(
vStr
);
Vec_StrFree
(
vStr
);
}
if
(
*
pCur
==
'c'
)
{
pCur
++
;
// read number of constraints
pNew
->
nConstrs
=
Gia_ReadInt
(
pCur
);
pCur
+=
4
;
}
if
(
*
pCur
==
'n'
)
{
pCur
++
;
// read model name
ABC_FREE
(
pNew
->
pName
);
pNew
->
pName
=
Abc_UtilStrsav
(
(
char
*
)
pCur
);
}
}
// read signal names if they are of the special type
pCur
=
pSymbols
;
if
(
*
pCur
!=
'c'
)
{
int
fBreakUsed
=
0
;
...
...
@@ -1032,6 +954,84 @@ Gia_Man_t * Gia_ReadAigerFromMemory( char * pContents, int nFileSize, int fSkipS
}
}
// check if there are other types of information to read
if
(
pCur
+
1
<
(
unsigned
char
*
)
pContents
+
nFileSize
&&
*
pCur
==
'c'
)
{
pCur
++
;
if
(
*
pCur
==
'e'
)
{
pCur
++
;
// read equivalence classes
pNew
->
pReprs
=
Gia_ReadEquivClasses
(
&
pCur
,
Gia_ManObjNum
(
pNew
)
);
pNew
->
pNexts
=
Gia_ManDeriveNexts
(
pNew
);
}
if
(
*
pCur
==
'f'
)
{
pCur
++
;
// read flop classes
pNew
->
vFlopClasses
=
Vec_IntStart
(
Gia_ManRegNum
(
pNew
)
);
Gia_ReadFlopClasses
(
&
pCur
,
pNew
->
vFlopClasses
,
Gia_ManRegNum
(
pNew
)
);
}
if
(
*
pCur
==
'g'
)
{
pCur
++
;
// read gate classes
pNew
->
vGateClasses
=
Vec_IntStart
(
Gia_ManObjNum
(
pNew
)
);
Gia_ReadFlopClasses
(
&
pCur
,
pNew
->
vGateClasses
,
Gia_ManObjNum
(
pNew
)
);
}
if
(
*
pCur
==
'v'
)
{
pCur
++
;
// read object classes
pNew
->
vObjClasses
=
Vec_IntStart
(
Gia_ReadInt
(
pCur
)
/
4
);
pCur
+=
4
;
memcpy
(
Vec_IntArray
(
pNew
->
vObjClasses
),
pCur
,
4
*
Vec_IntSize
(
pNew
->
vObjClasses
)
);
pCur
+=
4
*
Vec_IntSize
(
pNew
->
vObjClasses
);
}
if
(
*
pCur
==
'm'
)
{
pCur
++
;
// read mapping
pNew
->
pMapping
=
Gia_ReadMapping
(
&
pCur
,
Gia_ManObjNum
(
pNew
)
);
}
if
(
*
pCur
==
'p'
)
{
pCur
++
;
// read placement
pNew
->
pPlacement
=
Gia_ReadPlacement
(
&
pCur
,
Gia_ManObjNum
(
pNew
)
);
}
if
(
*
pCur
==
's'
)
{
pCur
++
;
// read switching activity
pNew
->
pSwitching
=
Gia_ReadSwitching
(
&
pCur
,
Gia_ManObjNum
(
pNew
)
);
}
if
(
*
pCur
==
't'
)
{
Vec_Str_t
*
vStr
;
pCur
++
;
// read timing manager
vStr
=
Vec_StrStart
(
Gia_ReadInt
(
pCur
)
);
pCur
+=
4
;
memcpy
(
Vec_StrArray
(
vStr
),
pCur
,
Vec_StrSize
(
vStr
)
);
pCur
+=
Vec_StrSize
(
vStr
);
pNew
->
pManTime
=
Tim_ManLoad
(
vStr
);
Vec_StrFree
(
vStr
);
}
if
(
*
pCur
==
'c'
)
{
pCur
++
;
// read number of constraints
pNew
->
nConstrs
=
Gia_ReadInt
(
pCur
);
pCur
+=
4
;
}
if
(
*
pCur
==
'n'
)
{
pCur
++
;
// read model name
ABC_FREE
(
pNew
->
pName
);
pNew
->
pName
=
Abc_UtilStrsav
(
(
char
*
)
pCur
);
}
}
// skipping the comments
Vec_IntFree
(
vNodes
);
/*
...
...
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