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
686f8fda
Commit
686f8fda
authored
Jan 30, 2013
by
Alan Mishchenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Integration of timing manager.
parent
a2eb6f9a
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
146 additions
and
0 deletions
+146
-0
src/aig/gia/gia.h
+1
-0
src/aig/gia/giaDup.c
+134
-0
src/aig/gia/giaIf.c
+9
-0
src/misc/tim/timMan.c
+2
-0
No files found.
src/aig/gia/gia.h
View file @
686f8fda
...
...
@@ -826,6 +826,7 @@ extern Gia_Man_t * Gia_ManDupDfsCone( Gia_Man_t * p, Gia_Obj_t * pObj );
extern
Gia_Man_t
*
Gia_ManDupDfsLitArray
(
Gia_Man_t
*
p
,
Vec_Int_t
*
vLits
);
extern
Gia_Man_t
*
Gia_ManDupNormalize
(
Gia_Man_t
*
p
);
extern
Gia_Man_t
*
Gia_ManDupUnnomalize
(
Gia_Man_t
*
p
);
extern
Gia_Man_t
*
Gia_ManDupWithHierarchy
(
Gia_Man_t
*
p
);
extern
Gia_Man_t
*
Gia_ManDupTrimmed
(
Gia_Man_t
*
p
,
int
fTrimCis
,
int
fTrimCos
,
int
fDualOut
,
int
OutValue
);
extern
Gia_Man_t
*
Gia_ManDupOntop
(
Gia_Man_t
*
p
,
Gia_Man_t
*
p2
);
extern
Gia_Man_t
*
Gia_ManDupWithNewPo
(
Gia_Man_t
*
p1
,
Gia_Man_t
*
p2
);
...
...
src/aig/gia/giaDup.c
View file @
686f8fda
...
...
@@ -1131,6 +1131,140 @@ Gia_Man_t * Gia_ManDupUnnomalize( Gia_Man_t * p )
return
pNew
;
}
/**Function*************************************************************
Synopsis [Find the ordering of AIG objects.]
Description []
SideEffects []
SeeAlso []
***********************************************************************/
void
Gia_ManDupFindOrderWithHie_rec
(
Gia_Man_t
*
p
,
Gia_Obj_t
*
pObj
,
Vec_Int_t
*
vNodes
)
{
if
(
Gia_ObjIsTravIdCurrent
(
p
,
pObj
)
)
return
;
Gia_ObjSetTravIdCurrent
(
p
,
pObj
);
assert
(
Gia_ObjIsAnd
(
pObj
)
);
Gia_ManDupFindOrderWithHie_rec
(
p
,
Gia_ObjFanin0
(
pObj
),
vNodes
);
Gia_ManDupFindOrderWithHie_rec
(
p
,
Gia_ObjFanin1
(
pObj
),
vNodes
);
Vec_IntPush
(
vNodes
,
Gia_ObjId
(
p
,
pObj
)
);
}
Vec_Int_t
*
Gia_ManDupFindOrderWithHie
(
Gia_Man_t
*
p
)
{
Tim_Man_t
*
pTime
=
(
Tim_Man_t
*
)
p
->
pManTime
;
Vec_Int_t
*
vNodes
;
Gia_Obj_t
*
pObj
;
int
i
,
k
,
curCi
,
curCo
;
assert
(
p
->
pManTime
!=
NULL
);
assert
(
Gia_ManIsNormalized
(
p
)
);
// start trav IDs
Gia_ManIncrementTravId
(
p
);
// start the array
vNodes
=
Vec_IntAlloc
(
Gia_ManObjNum
(
p
)
);
// include constant
Vec_IntPush
(
vNodes
,
0
);
Gia_ObjSetTravIdCurrent
(
p
,
Gia_ManConst0
(
p
)
);
// include primary inputs
for
(
i
=
0
;
i
<
Tim_ManPiNum
(
pTime
);
i
++
)
{
pObj
=
Gia_ManPi
(
p
,
i
);
Vec_IntPush
(
vNodes
,
Gia_ObjId
(
p
,
pObj
)
);
Gia_ObjSetTravIdCurrent
(
p
,
pObj
);
assert
(
Gia_ObjId
(
p
,
pObj
)
==
i
+
1
);
//printf( "%d ", Gia_ObjId(p, pObj) );
}
// for each box, include box nodes
curCi
=
Tim_ManPiNum
(
pTime
);
curCo
=
0
;
for
(
i
=
0
;
i
<
Tim_ManBoxNum
(
pTime
);
i
++
)
{
// add internal nodes
for
(
k
=
0
;
k
<
Tim_ManBoxInputNum
(
pTime
,
i
);
k
++
)
{
pObj
=
Gia_ManPo
(
p
,
curCo
+
k
);
//Gia_ObjPrint( p, pObj );
//Gia_ObjPrint( p, Gia_ObjFanin0(pObj) );
Gia_ManDupFindOrderWithHie_rec
(
p
,
Gia_ObjFanin0
(
pObj
),
vNodes
);
}
// add POs corresponding to box inputs
for
(
k
=
0
;
k
<
Tim_ManBoxInputNum
(
pTime
,
i
);
k
++
)
{
pObj
=
Gia_ManPo
(
p
,
curCo
+
k
);
Vec_IntPush
(
vNodes
,
Gia_ObjId
(
p
,
pObj
)
);
}
curCo
+=
Tim_ManBoxInputNum
(
pTime
,
i
);
// add PIs corresponding to box outputs
for
(
k
=
0
;
k
<
Tim_ManBoxOutputNum
(
pTime
,
i
);
k
++
)
{
pObj
=
Gia_ManPi
(
p
,
curCi
+
k
);
Vec_IntPush
(
vNodes
,
Gia_ObjId
(
p
,
pObj
)
);
}
curCi
+=
Tim_ManBoxOutputNum
(
pTime
,
i
);
}
// add remaining nodes
for
(
i
=
Tim_ManCoNum
(
pTime
)
-
Tim_ManPoNum
(
pTime
);
i
<
Tim_ManCoNum
(
pTime
);
i
++
)
{
pObj
=
Gia_ManPo
(
p
,
i
);
Gia_ManDupFindOrderWithHie_rec
(
p
,
Gia_ObjFanin0
(
pObj
),
vNodes
);
}
// add POs
for
(
i
=
Tim_ManCoNum
(
pTime
)
-
Tim_ManPoNum
(
pTime
);
i
<
Tim_ManCoNum
(
pTime
);
i
++
)
{
pObj
=
Gia_ManPo
(
p
,
i
);
Vec_IntPush
(
vNodes
,
Gia_ObjId
(
p
,
pObj
)
);
}
curCo
+=
Tim_ManPoNum
(
pTime
);
// verify counts
assert
(
curCi
==
Gia_ManPiNum
(
p
)
);
assert
(
curCo
==
Gia_ManPoNum
(
p
)
);
assert
(
Vec_IntSize
(
vNodes
)
==
Gia_ManObjNum
(
p
)
);
return
vNodes
;
}
/**Function*************************************************************
Synopsis [Duplicates AIG according to the timing manager.]
Description []
SideEffects []
SeeAlso []
***********************************************************************/
Gia_Man_t
*
Gia_ManDupWithHierarchy
(
Gia_Man_t
*
p
)
{
Vec_Int_t
*
vNodes
;
Gia_Man_t
*
pNew
;
Gia_Obj_t
*
pObj
;
int
i
;
Gia_ManFillValue
(
p
);
pNew
=
Gia_ManStart
(
Gia_ManObjNum
(
p
)
);
pNew
->
pName
=
Abc_UtilStrsav
(
p
->
pName
);
pNew
->
pSpec
=
Abc_UtilStrsav
(
p
->
pSpec
);
vNodes
=
Gia_ManDupFindOrderWithHie
(
p
);
Gia_ManForEachObjVec
(
vNodes
,
p
,
pObj
,
i
)
{
if
(
Gia_ObjIsAnd
(
pObj
)
)
pObj
->
Value
=
Gia_ManAppendAnd
(
pNew
,
Gia_ObjFanin0Copy
(
pObj
),
Gia_ObjFanin1Copy
(
pObj
)
);
else
if
(
Gia_ObjIsCi
(
pObj
)
)
pObj
->
Value
=
Gia_ManAppendCi
(
pNew
);
else
if
(
Gia_ObjIsCo
(
pObj
)
)
pObj
->
Value
=
Gia_ManAppendCo
(
pNew
,
Gia_ObjFanin0Copy
(
pObj
)
);
else
if
(
Gia_ObjIsConst0
(
pObj
)
)
pObj
->
Value
=
0
;
else
assert
(
0
);
}
Gia_ManSetRegNum
(
pNew
,
Gia_ManRegNum
(
p
)
);
Vec_IntFree
(
vNodes
);
return
pNew
;
}
/**Function*************************************************************
Synopsis [Returns the array of non-const-0 POs of the dual-output miter.]
...
...
src/aig/gia/giaIf.c
View file @
686f8fda
...
...
@@ -624,6 +624,11 @@ Gia_Man_t * Gia_ManPerformMapping( Gia_Man_t * p, void * pp )
Gia_Man_t
*
pNew
;
If_Man_t
*
pIfMan
;
If_Par_t
*
pPars
=
(
If_Par_t
*
)
pp
;
// reconstruct GIA according to the hierarchy manager
if
(
p
->
pManTime
)
p
=
Gia_ManDupWithHierarchy
(
p
);
else
p
=
Gia_ManDup
(
p
);
// set the arrival times
assert
(
pPars
->
pTimesArr
==
NULL
);
pPars
->
pTimesArr
=
ABC_ALLOC
(
float
,
Gia_ManCiNum
(
p
)
);
...
...
@@ -631,12 +636,16 @@ Gia_Man_t * Gia_ManPerformMapping( Gia_Man_t * p, void * pp )
// translate into the mapper
pIfMan
=
Gia_ManToIf
(
p
,
pPars
);
if
(
pIfMan
==
NULL
)
{
Gia_ManStop
(
p
);
return
NULL
;
}
if
(
p
->
pManTime
)
pIfMan
->
pManTim
=
Tim_ManDup
(
(
Tim_Man_t
*
)
p
->
pManTime
,
0
);
if
(
!
If_ManPerformMapping
(
pIfMan
)
)
{
If_ManStop
(
pIfMan
);
Gia_ManStop
(
p
);
return
NULL
;
}
// transform the result of mapping into the new network
...
...
src/misc/tim/timMan.c
View file @
686f8fda
...
...
@@ -309,6 +309,8 @@ void Tim_ManPrint( Tim_Man_t * p )
if
(
p
==
NULL
)
return
;
printf
(
"TIMING MANAGER:
\n
"
);
printf
(
"PI = %d. CI = %d. PO = %d. CO = %d. Box = %d.
\n
"
,
Tim_ManPiNum
(
p
),
Tim_ManCiNum
(
p
),
Tim_ManPoNum
(
p
),
Tim_ManCoNum
(
p
),
Tim_ManBoxNum
(
p
)
);
// print CI info
pPrev
=
p
->
pCis
;
...
...
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