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
26dc25b7
Commit
26dc25b7
authored
Oct 04, 2015
by
Alan Mishchenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adding support for flop init-states in extended AIG.
parent
7d9e3c2f
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
66 additions
and
2 deletions
+66
-2
src/aig/gia/gia.h
+1
-0
src/aig/gia/giaAiger.c
+23
-0
src/aig/gia/giaDup.c
+2
-0
src/aig/gia/giaIf.c
+1
-0
src/aig/gia/giaMan.c
+1
-0
src/aig/gia/giaMfs.c
+3
-0
src/aig/gia/giaSweep.c
+13
-2
src/aig/gia/giaTim.c
+22
-0
No files found.
src/aig/gia/gia.h
View file @
26dc25b7
...
@@ -144,6 +144,7 @@ struct Gia_Man_t_
...
@@ -144,6 +144,7 @@ struct Gia_Man_t_
Vec_Int_t
*
vObjClasses
;
// classes of objects 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
*
vInitClasses
;
// classes of flops for retiming/merging/etc
Vec_Int_t
*
vRegClasses
;
// classes of registers for sequential synthesis
Vec_Int_t
*
vRegClasses
;
// classes of registers for sequential synthesis
Vec_Int_t
*
vRegInits
;
// initial state
Vec_Int_t
*
vDoms
;
// dominators
Vec_Int_t
*
vDoms
;
// dominators
Vec_Int_t
*
vBarBufs
;
// barrier buffers
Vec_Int_t
*
vBarBufs
;
// barrier buffers
unsigned
char
*
pSwitching
;
// switching activity for each object
unsigned
char
*
pSwitching
;
// switching activity for each object
...
...
src/aig/gia/giaAiger.c
View file @
26dc25b7
...
@@ -671,6 +671,19 @@ Gia_Man_t * Gia_AigerReadFromMemory( char * pContents, int nFileSize, int fSkipS
...
@@ -671,6 +671,19 @@ Gia_Man_t * Gia_AigerReadFromMemory( char * pContents, int nFileSize, int fSkipS
assert
(
pCur
==
pCurTemp
);
assert
(
pCur
==
pCurTemp
);
if
(
fVerbose
)
printf
(
"Finished reading extension
\"
r
\"
.
\n
"
);
if
(
fVerbose
)
printf
(
"Finished reading extension
\"
r
\"
.
\n
"
);
}
}
// read register inits
else
if
(
*
pCur
==
's'
)
{
int
i
,
nRegs
;
pCur
++
;
pCurTemp
=
pCur
+
Gia_AigerReadInt
(
pCur
)
+
4
;
pCur
+=
4
;
nRegs
=
Gia_AigerReadInt
(
pCur
);
pCur
+=
4
;
pNew
->
vRegInits
=
Vec_IntAlloc
(
nRegs
);
for
(
i
=
0
;
i
<
nRegs
;
i
++
)
Vec_IntPush
(
pNew
->
vRegInits
,
Gia_AigerReadInt
(
pCur
)
),
pCur
+=
4
;
assert
(
pCur
==
pCurTemp
);
if
(
fVerbose
)
printf
(
"Finished reading extension
\"
s
\"
.
\n
"
);
}
// read configuration data
// read configuration data
else
if
(
*
pCur
==
'b'
)
else
if
(
*
pCur
==
'b'
)
{
{
...
@@ -1285,6 +1298,16 @@ void Gia_AigerWrite( Gia_Man_t * pInit, char * pFileName, int fWriteSymbols, int
...
@@ -1285,6 +1298,16 @@ void Gia_AigerWrite( Gia_Man_t * pInit, char * pFileName, int fWriteSymbols, int
for
(
i
=
0
;
i
<
Vec_IntSize
(
p
->
vRegClasses
);
i
++
)
for
(
i
=
0
;
i
<
Vec_IntSize
(
p
->
vRegClasses
);
i
++
)
Gia_FileWriteBufferSize
(
pFile
,
Vec_IntEntry
(
p
->
vRegClasses
,
i
)
);
Gia_FileWriteBufferSize
(
pFile
,
Vec_IntEntry
(
p
->
vRegClasses
,
i
)
);
}
}
// write register inits
if
(
p
->
vRegInits
)
{
int
i
;
fprintf
(
pFile
,
"s"
);
Gia_FileWriteBufferSize
(
pFile
,
4
*
(
Vec_IntSize
(
p
->
vRegInits
)
+
1
)
);
Gia_FileWriteBufferSize
(
pFile
,
Vec_IntSize
(
p
->
vRegInits
)
);
for
(
i
=
0
;
i
<
Vec_IntSize
(
p
->
vRegInits
);
i
++
)
Gia_FileWriteBufferSize
(
pFile
,
Vec_IntEntry
(
p
->
vRegInits
,
i
)
);
}
// write configuration data
// write configuration data
if
(
p
->
vConfigs
)
if
(
p
->
vConfigs
)
{
{
...
...
src/aig/gia/giaDup.c
View file @
26dc25b7
...
@@ -656,6 +656,8 @@ Gia_Man_t * Gia_ManDupWithAttributes( Gia_Man_t * p )
...
@@ -656,6 +656,8 @@ Gia_Man_t * Gia_ManDupWithAttributes( Gia_Man_t * p )
pNew
->
nAnd2Delay
=
p
->
nAnd2Delay
;
pNew
->
nAnd2Delay
=
p
->
nAnd2Delay
;
if
(
p
->
vRegClasses
)
if
(
p
->
vRegClasses
)
pNew
->
vRegClasses
=
Vec_IntDup
(
p
->
vRegClasses
);
pNew
->
vRegClasses
=
Vec_IntDup
(
p
->
vRegClasses
);
if
(
p
->
vRegInits
)
pNew
->
vRegInits
=
Vec_IntDup
(
p
->
vRegInits
);
if
(
p
->
vConfigs
)
if
(
p
->
vConfigs
)
pNew
->
vConfigs
=
Vec_IntDup
(
p
->
vConfigs
);
pNew
->
vConfigs
=
Vec_IntDup
(
p
->
vConfigs
);
if
(
p
->
pCellStr
)
if
(
p
->
pCellStr
)
...
...
src/aig/gia/giaIf.c
View file @
26dc25b7
...
@@ -2062,6 +2062,7 @@ void Gia_ManTransferTiming( Gia_Man_t * p, Gia_Man_t * pGia )
...
@@ -2062,6 +2062,7 @@ void Gia_ManTransferTiming( Gia_Man_t * p, Gia_Man_t * pGia )
p
->
pManTime
=
pGia
->
pManTime
;
pGia
->
pManTime
=
NULL
;
p
->
pManTime
=
pGia
->
pManTime
;
pGia
->
pManTime
=
NULL
;
p
->
pAigExtra
=
pGia
->
pAigExtra
;
pGia
->
pAigExtra
=
NULL
;
p
->
pAigExtra
=
pGia
->
pAigExtra
;
pGia
->
pAigExtra
=
NULL
;
p
->
vRegClasses
=
pGia
->
vRegClasses
;
pGia
->
vRegClasses
=
NULL
;
p
->
vRegClasses
=
pGia
->
vRegClasses
;
pGia
->
vRegClasses
=
NULL
;
p
->
vRegInits
=
pGia
->
vRegInits
;
pGia
->
vRegInits
=
NULL
;
p
->
nAnd2Delay
=
pGia
->
nAnd2Delay
;
pGia
->
nAnd2Delay
=
0
;
p
->
nAnd2Delay
=
pGia
->
nAnd2Delay
;
pGia
->
nAnd2Delay
=
0
;
}
}
...
...
src/aig/gia/giaMan.c
View file @
26dc25b7
...
@@ -102,6 +102,7 @@ void Gia_ManStop( Gia_Man_t * p )
...
@@ -102,6 +102,7 @@ void Gia_ManStop( Gia_Man_t * p )
Vec_IntFreeP
(
&
p
->
vObjClasses
);
Vec_IntFreeP
(
&
p
->
vObjClasses
);
Vec_IntFreeP
(
&
p
->
vInitClasses
);
Vec_IntFreeP
(
&
p
->
vInitClasses
);
Vec_IntFreeP
(
&
p
->
vRegClasses
);
Vec_IntFreeP
(
&
p
->
vRegClasses
);
Vec_IntFreeP
(
&
p
->
vRegInits
);
Vec_IntFreeP
(
&
p
->
vDoms
);
Vec_IntFreeP
(
&
p
->
vDoms
);
Vec_IntFreeP
(
&
p
->
vBarBufs
);
Vec_IntFreeP
(
&
p
->
vBarBufs
);
Vec_IntFreeP
(
&
p
->
vLevels
);
Vec_IntFreeP
(
&
p
->
vLevels
);
...
...
src/aig/gia/giaMfs.c
View file @
26dc25b7
...
@@ -348,6 +348,9 @@ Gia_Man_t * Gia_ManInsertMfs( Gia_Man_t * p, Sfm_Ntk_t * pNtk )
...
@@ -348,6 +348,9 @@ Gia_Man_t * Gia_ManInsertMfs( Gia_Man_t * p, Sfm_Ntk_t * pNtk )
// duplicated flops
// duplicated flops
if
(
p
->
vRegClasses
)
if
(
p
->
vRegClasses
)
pNew
->
vRegClasses
=
Vec_IntDup
(
p
->
vRegClasses
);
pNew
->
vRegClasses
=
Vec_IntDup
(
p
->
vRegClasses
);
// duplicated initial state
if
(
p
->
vRegInits
)
pNew
->
vRegInits
=
Vec_IntDup
(
p
->
vRegInits
);
// cleanup
// cleanup
Vec_WecFree
(
vGroups
);
Vec_WecFree
(
vGroups
);
...
...
src/aig/gia/giaSweep.c
View file @
26dc25b7
...
@@ -154,13 +154,24 @@ Gia_Man_t * Gia_ManDupWithBoxes( Gia_Man_t * p, int fSeq )
...
@@ -154,13 +154,24 @@ Gia_Man_t * Gia_ManDupWithBoxes( Gia_Man_t * p, int fSeq )
if
(
fSeq
)
if
(
fSeq
)
{
{
pNew
->
vRegClasses
=
Vec_IntAlloc
(
Gia_ManRegBoxNum
(
p
)
);
pNew
->
vRegClasses
=
Vec_IntAlloc
(
Gia_ManRegBoxNum
(
p
)
);
if
(
p
->
vRegInits
)
pNew
->
vRegInits
=
Vec_IntAlloc
(
Gia_ManRegBoxNum
(
p
)
);
iShift
=
Gia_ManPoNum
(
p
)
-
Gia_ManRegBoxNum
(
p
);
iShift
=
Gia_ManPoNum
(
p
)
-
Gia_ManRegBoxNum
(
p
);
for
(
i
=
0
;
i
<
Gia_ManRegBoxNum
(
p
);
i
++
)
for
(
i
=
0
;
i
<
Gia_ManRegBoxNum
(
p
);
i
++
)
if
(
Gia_ObjIsTravIdCurrent
(
p
,
Gia_ManCo
(
p
,
iShift
+
i
))
)
if
(
Gia_ObjIsTravIdCurrent
(
p
,
Gia_ManCo
(
p
,
iShift
+
i
))
)
{
Vec_IntPush
(
pNew
->
vRegClasses
,
Vec_IntEntry
(
p
->
vRegClasses
,
i
)
);
Vec_IntPush
(
pNew
->
vRegClasses
,
Vec_IntEntry
(
p
->
vRegClasses
,
i
)
);
if
(
p
->
vRegInits
)
Vec_IntPush
(
pNew
->
vRegInits
,
Vec_IntEntry
(
p
->
vRegInits
,
i
)
);
}
}
else
{
if
(
p
->
vRegClasses
)
pNew
->
vRegClasses
=
Vec_IntDup
(
p
->
vRegClasses
);
if
(
p
->
vRegInits
)
pNew
->
vRegInits
=
Vec_IntDup
(
p
->
vRegInits
);
}
}
else
if
(
p
->
vRegClasses
)
pNew
->
vRegClasses
=
Vec_IntDup
(
p
->
vRegClasses
);
// collect remaining boxes
// collect remaining boxes
vBoxesLeft
=
Vec_IntAlloc
(
Gia_ManBoxNum
(
p
)
);
vBoxesLeft
=
Vec_IntAlloc
(
Gia_ManBoxNum
(
p
)
);
curCi
=
Tim_ManPiNum
(
pManTime
);
curCi
=
Tim_ManPiNum
(
pManTime
);
...
...
src/aig/gia/giaTim.c
View file @
26dc25b7
...
@@ -842,6 +842,28 @@ Gia_Man_t * Gia_ManDupCollapse( Gia_Man_t * p, Gia_Man_t * pBoxes, Vec_Int_t * v
...
@@ -842,6 +842,28 @@ Gia_Man_t * Gia_ManDupCollapse( Gia_Man_t * p, Gia_Man_t * pBoxes, Vec_Int_t * v
Gia_ManStop
(
pTemp
);
Gia_ManStop
(
pTemp
);
assert
(
Tim_ManPoNum
(
pManTime
)
==
Gia_ManCoNum
(
pNew
)
);
assert
(
Tim_ManPoNum
(
pManTime
)
==
Gia_ManCoNum
(
pNew
)
);
assert
(
Tim_ManPiNum
(
pManTime
)
==
Gia_ManCiNum
(
pNew
)
);
assert
(
Tim_ManPiNum
(
pManTime
)
==
Gia_ManCiNum
(
pNew
)
);
// implement initial state if given
if
(
p
->
vRegInits
&&
Vec_IntSum
(
p
->
vRegInits
)
)
{
char
*
pInit
=
ABC_ALLOC
(
char
,
Vec_IntSize
(
p
->
vRegInits
)
+
1
);
Gia_Obj_t
*
pObj
;
int
i
;
assert
(
Vec_IntSize
(
p
->
vRegInits
)
==
Gia_ManRegNum
(
pNew
)
);
Gia_ManForEachRo
(
pNew
,
pObj
,
i
)
{
if
(
Vec_IntEntry
(
p
->
vRegInits
,
i
)
==
0
)
pInit
[
i
]
=
'0'
;
else
if
(
Vec_IntEntry
(
p
->
vRegInits
,
i
)
==
1
)
pInit
[
i
]
=
'1'
;
else
pInit
[
i
]
=
'X'
;
}
pInit
[
i
]
=
0
;
pNew
=
Gia_ManDupZeroUndc
(
pTemp
=
pNew
,
pInit
,
1
);
pNew
->
nConstrs
=
pTemp
->
nConstrs
;
pTemp
->
nConstrs
=
0
;
Gia_ManStop
(
pTemp
);
ABC_FREE
(
pInit
);
}
return
pNew
;
return
pNew
;
}
}
...
...
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