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
e162a261
Commit
e162a261
authored
Jul 31, 2021
by
Alan Mishchenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Allow retiming to skip some logic.
parent
692dd763
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
69 additions
and
9 deletions
+69
-9
src/base/wlc/wlcCom.c
+10
-5
src/base/wln/wln.h
+1
-1
src/base/wln/wlnNdr.c
+2
-2
src/base/wln/wlnRetime.c
+56
-1
No files found.
src/base/wlc/wlcCom.c
View file @
e162a261
...
@@ -1331,16 +1331,20 @@ usage:
...
@@ -1331,16 +1331,20 @@ usage:
******************************************************************************/
******************************************************************************/
int
Abc_CommandRetime
(
Abc_Frame_t
*
pAbc
,
int
argc
,
char
**
argv
)
int
Abc_CommandRetime
(
Abc_Frame_t
*
pAbc
,
int
argc
,
char
**
argv
)
{
{
extern
void
Wln_NtkRetimeTest
(
char
*
pFileName
,
int
fSkipSimple
,
int
fDump
,
int
fVerbose
);
extern
void
Wln_NtkRetimeTest
(
char
*
pFileName
,
int
f
IgnoreIO
,
int
f
SkipSimple
,
int
fDump
,
int
fVerbose
);
FILE
*
pFile
;
FILE
*
pFile
;
char
*
pFileName
=
NULL
;
char
*
pFileName
=
NULL
;
int
fIgnoreIO
=
0
;
int
fSkipSimple
=
0
;
int
fSkipSimple
=
0
;
int
c
,
fDump
=
0
,
fVerbose
=
0
;
int
c
,
fDump
=
0
,
fVerbose
=
0
;
Extra_UtilGetoptReset
();
Extra_UtilGetoptReset
();
while
(
(
c
=
Extra_UtilGetopt
(
argc
,
argv
,
"sdvh"
)
)
!=
EOF
)
while
(
(
c
=
Extra_UtilGetopt
(
argc
,
argv
,
"
i
sdvh"
)
)
!=
EOF
)
{
{
switch
(
c
)
switch
(
c
)
{
{
case
'i'
:
fIgnoreIO
^=
1
;
break
;
case
's'
:
case
's'
:
fSkipSimple
^=
1
;
fSkipSimple
^=
1
;
break
;
break
;
...
@@ -1366,7 +1370,7 @@ int Abc_CommandRetime( Abc_Frame_t * pAbc, int argc, char ** argv )
...
@@ -1366,7 +1370,7 @@ int Abc_CommandRetime( Abc_Frame_t * pAbc, int argc, char ** argv )
printf
(
"Transforming NDR into internal represnetation has failed.
\n
"
);
printf
(
"Transforming NDR into internal represnetation has failed.
\n
"
);
return
0
;
return
0
;
}
}
vMoves
=
Wln_NtkRetime
(
pNtk
,
fSkipSimple
,
fVerbose
);
vMoves
=
Wln_NtkRetime
(
pNtk
,
f
IgnoreIO
,
f
SkipSimple
,
fVerbose
);
Wln_NtkFree
(
pNtk
);
Wln_NtkFree
(
pNtk
);
ABC_FREE
(
pAbc
->
pNdrArray
);
ABC_FREE
(
pAbc
->
pNdrArray
);
if
(
vMoves
)
pAbc
->
pNdrArray
=
Vec_IntReleaseNewArray
(
vMoves
);
if
(
vMoves
)
pAbc
->
pNdrArray
=
Vec_IntReleaseNewArray
(
vMoves
);
...
@@ -1389,11 +1393,12 @@ int Abc_CommandRetime( Abc_Frame_t * pAbc, int argc, char ** argv )
...
@@ -1389,11 +1393,12 @@ int Abc_CommandRetime( Abc_Frame_t * pAbc, int argc, char ** argv )
return
0
;
return
0
;
}
}
fclose
(
pFile
);
fclose
(
pFile
);
Wln_NtkRetimeTest
(
pFileName
,
fSkipSimple
,
fDump
,
fVerbose
);
Wln_NtkRetimeTest
(
pFileName
,
f
IgnoreIO
,
f
SkipSimple
,
fDump
,
fVerbose
);
return
0
;
return
0
;
usage:
usage:
Abc_Print
(
-
2
,
"usage: %%retime [-sdvh]
\n
"
);
Abc_Print
(
-
2
,
"usage: %%retime [-
i
sdvh]
\n
"
);
Abc_Print
(
-
2
,
"
\t
performs retiming for the NDR design
\n
"
);
Abc_Print
(
-
2
,
"
\t
performs retiming for the NDR design
\n
"
);
Abc_Print
(
-
2
,
"
\t
-i : toggle ignoring delays of IO paths [default = %s]
\n
"
,
fIgnoreIO
?
"yes"
:
"no"
);
Abc_Print
(
-
2
,
"
\t
-s : toggle printing simple nodes [default = %s]
\n
"
,
!
fSkipSimple
?
"yes"
:
"no"
);
Abc_Print
(
-
2
,
"
\t
-s : toggle printing simple nodes [default = %s]
\n
"
,
!
fSkipSimple
?
"yes"
:
"no"
);
Abc_Print
(
-
2
,
"
\t
-d : toggle dumping the network in Verilog [default = %s]
\n
"
,
fDump
?
"yes"
:
"no"
);
Abc_Print
(
-
2
,
"
\t
-d : toggle dumping the network in Verilog [default = %s]
\n
"
,
fDump
?
"yes"
:
"no"
);
Abc_Print
(
-
2
,
"
\t
-v : toggle printing verbose information [default = %s]
\n
"
,
fVerbose
?
"yes"
:
"no"
);
Abc_Print
(
-
2
,
"
\t
-v : toggle printing verbose information [default = %s]
\n
"
,
fVerbose
?
"yes"
:
"no"
);
...
...
src/base/wln/wln.h
View file @
e162a261
...
@@ -246,7 +246,7 @@ extern int Wln_ObjClone( Wln_Ntk_t * pNew, Wln_Ntk_t * p, int iObj );
...
@@ -246,7 +246,7 @@ extern int Wln_ObjClone( Wln_Ntk_t * pNew, Wln_Ntk_t * p, int iObj );
extern
int
Wln_ObjCreateCo
(
Wln_Ntk_t
*
p
,
int
iFanin
);
extern
int
Wln_ObjCreateCo
(
Wln_Ntk_t
*
p
,
int
iFanin
);
extern
void
Wln_ObjPrint
(
Wln_Ntk_t
*
p
,
int
iObj
);
extern
void
Wln_ObjPrint
(
Wln_Ntk_t
*
p
,
int
iObj
);
/*=== wlcRetime.c ========================================================*/
/*=== wlcRetime.c ========================================================*/
extern
Vec_Int_t
*
Wln_NtkRetime
(
Wln_Ntk_t
*
p
,
int
fSkipSimple
,
int
fVerbose
);
extern
Vec_Int_t
*
Wln_NtkRetime
(
Wln_Ntk_t
*
p
,
int
f
IgnoreIO
,
int
f
SkipSimple
,
int
fVerbose
);
extern
void
Wln_NtkRetimeCreateDelayInfo
(
Wln_Ntk_t
*
pNtk
);
extern
void
Wln_NtkRetimeCreateDelayInfo
(
Wln_Ntk_t
*
pNtk
);
/*=== wlcWriteVer.c ========================================================*/
/*=== wlcWriteVer.c ========================================================*/
extern
void
Wln_WriteVer
(
Wln_Ntk_t
*
p
,
char
*
pFileName
);
extern
void
Wln_WriteVer
(
Wln_Ntk_t
*
p
,
char
*
pFileName
);
...
...
src/base/wln/wlnNdr.c
View file @
e162a261
...
@@ -314,7 +314,7 @@ void Wln_ReadNdrTest()
...
@@ -314,7 +314,7 @@ void Wln_ReadNdrTest()
Wln_NtkStaticFanoutTest
(
pNtk
);
Wln_NtkStaticFanoutTest
(
pNtk
);
Wln_NtkFree
(
pNtk
);
Wln_NtkFree
(
pNtk
);
}
}
void
Wln_NtkRetimeTest
(
char
*
pFileName
,
int
fSkipSimple
,
int
fDump
,
int
fVerbose
)
void
Wln_NtkRetimeTest
(
char
*
pFileName
,
int
f
IgnoreIO
,
int
f
SkipSimple
,
int
fDump
,
int
fVerbose
)
{
{
Vec_Int_t
*
vMoves
;
Vec_Int_t
*
vMoves
;
void
*
pData
=
Ndr_Read
(
pFileName
);
void
*
pData
=
Ndr_Read
(
pFileName
);
...
@@ -326,7 +326,7 @@ void Wln_NtkRetimeTest( char * pFileName, int fSkipSimple, int fDump, int fVerbo
...
@@ -326,7 +326,7 @@ void Wln_NtkRetimeTest( char * pFileName, int fSkipSimple, int fDump, int fVerbo
return
;
return
;
}
}
Wln_NtkRetimeCreateDelayInfo
(
pNtk
);
Wln_NtkRetimeCreateDelayInfo
(
pNtk
);
vMoves
=
Wln_NtkRetime
(
pNtk
,
fSkipSimple
,
fVerbose
);
vMoves
=
Wln_NtkRetime
(
pNtk
,
f
IgnoreIO
,
f
SkipSimple
,
fVerbose
);
//Vec_IntPrint( vMoves );
//Vec_IntPrint( vMoves );
Vec_IntFree
(
vMoves
);
Vec_IntFree
(
vMoves
);
Wln_NtkFree
(
pNtk
);
Wln_NtkFree
(
pNtk
);
...
...
src/base/wln/wlnRetime.c
View file @
e162a261
...
@@ -335,6 +335,55 @@ void Wln_RetFindSources( Wln_Ret_t * p )
...
@@ -335,6 +335,55 @@ void Wln_RetFindSources( Wln_Ret_t * p )
/**Function*************************************************************
/**Function*************************************************************
Synopsis [Mark paths from PIs to POs.]
Description []
SideEffects []
SeeAlso []
***********************************************************************/
int
Wln_RetMarkPaths_rec
(
Wln_Ntk_t
*
p
,
int
iObj
,
int
fVerbose
)
{
int
k
,
iFanin
,
fPrev
=
1
;
if
(
Wln_ObjIsTravIdPrevious
(
p
,
iObj
)
)
return
1
;
if
(
Wln_ObjIsTravIdCurrent
(
p
,
iObj
)
)
return
0
;
if
(
Wln_ObjIsCio
(
p
,
iObj
)
||
Wln_ObjIsFf
(
p
,
iObj
)
)
return
0
;
Wln_ObjForEachFanin
(
p
,
iObj
,
iFanin
,
k
)
fPrev
&=
Wln_RetMarkPaths_rec
(
p
,
iFanin
,
fVerbose
);
if
(
fPrev
)
{
Wln_ObjSetTravIdPrevious
(
p
,
iObj
);
if
(
Vec_IntEntry
(
&
p
->
vInstIds
,
iObj
)
>
0
)
{
if
(
fVerbose
)
printf
(
"Updating delay %5d -> %5d : "
,
Vec_IntEntry
(
&
p
->
vInstIds
,
iObj
),
1
);
if
(
fVerbose
)
Wln_ObjPrint
(
p
,
iObj
);
Vec_IntWriteEntry
(
&
p
->
vInstIds
,
iObj
,
1
);
}
return
1
;
}
Wln_ObjSetTravIdCurrent
(
p
,
iObj
);
return
0
;
}
void
Wln_RetMarkPaths
(
Wln_Ntk_t
*
p
,
int
fVerbose
)
{
int
i
,
iObj
;
Wln_NtkIncrementTravId
(
p
);
Wln_NtkIncrementTravId
(
p
);
Wln_NtkForEachPi
(
p
,
iObj
,
i
)
Wln_ObjSetTravIdPrevious
(
p
,
iObj
);
Wln_NtkForEachPo
(
p
,
iObj
,
i
)
Wln_RetMarkPaths_rec
(
p
,
Wln_ObjFanin0
(
p
,
iObj
),
fVerbose
);
}
/**Function*************************************************************
Synopsis [Retimability check.]
Synopsis [Retimability check.]
Description []
Description []
...
@@ -571,7 +620,7 @@ void Wln_NtkRetimeCreateDelayInfo( Wln_Ntk_t * pNtk )
...
@@ -571,7 +620,7 @@ void Wln_NtkRetimeCreateDelayInfo( Wln_Ntk_t * pNtk )
printf
(
"Assuming default delays: 10 units for most nodes and 1 unit for bit-slice, concat, and buffers driving COs.
\n
"
);
printf
(
"Assuming default delays: 10 units for most nodes and 1 unit for bit-slice, concat, and buffers driving COs.
\n
"
);
}
}
}
}
Vec_Int_t
*
Wln_NtkRetime
(
Wln_Ntk_t
*
pNtk
,
int
fSkipSimple
,
int
fVerbose
)
Vec_Int_t
*
Wln_NtkRetime
_int
(
Wln_Ntk_t
*
pNtk
,
int
fSkipSimple
,
int
fVerbose
)
{
{
Wln_Ret_t
*
p
=
Wln_RetAlloc
(
pNtk
);
Wln_Ret_t
*
p
=
Wln_RetAlloc
(
pNtk
);
Vec_Int_t
*
vSources
=
&
p
->
vSources
;
Vec_Int_t
*
vSources
=
&
p
->
vSources
;
...
@@ -666,6 +715,12 @@ Vec_Int_t * Wln_NtkRetime( Wln_Ntk_t * pNtk, int fSkipSimple, int fVerbose )
...
@@ -666,6 +715,12 @@ Vec_Int_t * Wln_NtkRetime( Wln_Ntk_t * pNtk, int fSkipSimple, int fVerbose )
}
}
return
vMoves
;
return
vMoves
;
}
}
Vec_Int_t
*
Wln_NtkRetime
(
Wln_Ntk_t
*
pNtk
,
int
fIgnoreIO
,
int
fSkipSimple
,
int
fVerbose
)
{
if
(
fIgnoreIO
)
Wln_RetMarkPaths
(
pNtk
,
fVerbose
);
return
Wln_NtkRetime_int
(
pNtk
,
fSkipSimple
,
fVerbose
);
}
////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////
/// END OF FILE ///
/// END OF FILE ///
...
...
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