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
cf2f9364
Commit
cf2f9364
authored
Nov 21, 2014
by
Alan Mishchenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix in reading flop classes.
parent
c339e5b9
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
30 additions
and
15 deletions
+30
-15
src/aig/gia/gia.h
+1
-0
src/aig/gia/giaAiger.c
+23
-8
src/aig/gia/giaMan.c
+6
-7
No files found.
src/aig/gia/gia.h
View file @
cf2f9364
...
...
@@ -141,6 +141,7 @@ struct Gia_Man_t_
Vec_Int_t
*
vGateClasses
;
// classes of gates for abstraction
Vec_Int_t
*
vObjClasses
;
// classes of objects for abstraction
Vec_Int_t
*
vInitClasses
;
// classes of flops for retiming/merging/etc
Vec_Int_t
*
vRegClasses
;
// classes of registers for sequential synthesis
Vec_Int_t
*
vDoms
;
// dominators
Vec_Int_t
*
vBarBufs
;
// barrier buffers
unsigned
char
*
pSwitching
;
// switching activity for each object
...
...
src/aig/gia/giaAiger.c
View file @
cf2f9364
...
...
@@ -571,12 +571,10 @@ Gia_Man_t * Gia_AigerReadFromMemory( char * pContents, int nFileSize, int fSkipS
// read flop classes
else
if
(
*
pCur
==
'f'
)
{
int
nFlops
;
pCur
++
;
nFlops
=
Gia_AigerReadInt
(
pCur
);
pCur
+=
4
;
//assert( Gia_AigerReadInt(pCur) == 4*Gia_ManRegNum(pNew) ); pCur += 4;
pNew
->
vFlopClasses
=
Vec_IntStart
(
nFlops
);
memcpy
(
Vec_IntArray
(
pNew
->
vFlopClasses
),
pCur
,
4
*
nFlops
);
pCur
+=
4
*
nFlops
;
assert
(
Gia_AigerReadInt
(
pCur
)
==
4
*
Gia_ManRegNum
(
pNew
)
);
pCur
+=
4
;
pNew
->
vFlopClasses
=
Vec_IntStart
(
Gia_ManRegNum
(
pNew
)
);
memcpy
(
Vec_IntArray
(
pNew
->
vFlopClasses
),
pCur
,
4
*
Gia_ManRegNum
(
pNew
)
);
pCur
+=
4
*
Gia_ManRegNum
(
pNew
);
if
(
fVerbose
)
printf
(
"Finished reading extension
\"
f
\"
.
\n
"
);
}
// read gate classes
...
...
@@ -654,6 +652,16 @@ Gia_Man_t * Gia_AigerReadFromMemory( char * pContents, int nFileSize, int fSkipS
pNew
->
pPlacement
=
pPlacement
;
if
(
fVerbose
)
printf
(
"Finished reading extension
\"
p
\"
.
\n
"
);
}
// read register classes
else
if
(
*
pCur
==
'r'
)
{
int
nRegs
;
pCur
++
;
nRegs
=
Gia_AigerReadInt
(
pCur
);
pCur
+=
4
;
pNew
->
vRegClasses
=
Vec_IntStart
(
nRegs
);
memcpy
(
Vec_IntArray
(
pNew
->
vRegClasses
),
pCur
,
4
*
nRegs
);
pCur
+=
4
*
nRegs
;
if
(
fVerbose
)
printf
(
"Finished reading extension
\"
r
\"
.
\n
"
);
}
// read choices
else
if
(
*
pCur
==
'q'
)
{
...
...
@@ -1188,9 +1196,9 @@ void Gia_AigerWrite( Gia_Man_t * pInit, char * pFileName, int fWriteSymbols, int
if
(
p
->
vFlopClasses
)
{
fprintf
(
pFile
,
"f"
);
Gia_FileWriteBufferSize
(
pFile
,
4
*
Vec_IntSize
(
p
->
vFlopClasses
)
);
//
assert( Vec_IntSize(p->vFlopClasses) == Gia_ManRegNum(p) );
fwrite
(
Vec_IntArray
(
p
->
vFlopClasses
),
1
,
4
*
Vec_IntSize
(
p
->
vFlopClasses
),
pFile
);
Gia_FileWriteBufferSize
(
pFile
,
4
*
Gia_ManRegNum
(
p
)
);
assert
(
Vec_IntSize
(
p
->
vFlopClasses
)
==
Gia_ManRegNum
(
p
)
);
fwrite
(
Vec_IntArray
(
p
->
vFlopClasses
),
1
,
4
*
Gia_ManRegNum
(
p
),
pFile
);
}
// write gate classes
if
(
p
->
vGateClasses
)
...
...
@@ -1241,6 +1249,13 @@ void Gia_AigerWrite( Gia_Man_t * pInit, char * pFileName, int fWriteSymbols, int
Gia_FileWriteBufferSize
(
pFile
,
4
*
Gia_ManObjNum
(
p
)
);
fwrite
(
p
->
pPlacement
,
1
,
4
*
Gia_ManObjNum
(
p
),
pFile
);
}
// write register classes
if
(
p
->
vRegClasses
)
{
fprintf
(
pFile
,
"r"
);
Gia_FileWriteBufferSize
(
pFile
,
Vec_IntSize
(
p
->
vRegClasses
)
);
fwrite
(
Vec_IntArray
(
p
->
vRegClasses
),
1
,
4
*
Vec_IntSize
(
p
->
vRegClasses
),
pFile
);
}
// write choices
if
(
Gia_ManHasChoices
(
p
)
)
{
...
...
src/aig/gia/giaMan.c
View file @
cf2f9364
...
...
@@ -101,6 +101,7 @@ void Gia_ManStop( Gia_Man_t * p )
Vec_IntFreeP
(
&
p
->
vGateClasses
);
Vec_IntFreeP
(
&
p
->
vObjClasses
);
Vec_IntFreeP
(
&
p
->
vInitClasses
);
Vec_IntFreeP
(
&
p
->
vRegClasses
);
Vec_IntFreeP
(
&
p
->
vDoms
);
Vec_IntFreeP
(
&
p
->
vBarBufs
);
Vec_IntFreeP
(
&
p
->
vLevels
);
...
...
@@ -462,16 +463,14 @@ void Gia_ManPrintStats( Gia_Man_t * p, Gps_Par_t * pPars )
Gia_ManPrintPlacement
(
p
);
// if ( p->pManTime )
// Tim_ManPrintStats( (Tim_Man_t *)p->pManTime, p->nAnd2Delay );
// print register classes
if
(
p
->
vFlopClasses
&&
Gia_ManRegNum
(
p
)
==
0
)
{
printf
(
"The design has %d flops with the following class info: "
,
Vec_IntSize
(
p
->
vFlopClasses
)
);
Vec_IntPrint
(
p
->
vFlopClasses
);
}
else
Gia_ManPrintFlopClasses
(
p
);
Gia_ManPrintGateClasses
(
p
);
Gia_ManPrintObjClasses
(
p
);
if
(
p
->
vRegClasses
)
{
printf
(
"The design has %d flops with the following class info: "
,
Vec_IntSize
(
p
->
vRegClasses
)
);
Vec_IntPrint
(
p
->
vRegClasses
);
}
if
(
p
->
vInitClasses
)
Gia_ManPrintInitClasses
(
p
->
vInitClasses
);
if
(
pPars
&&
pPars
->
fTents
)
...
...
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