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
978b5db0
Commit
978b5db0
authored
Apr 22, 2020
by
Alan Mishchenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix a bug in comb loop detection.
parent
94a2cffe
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
22 additions
and
17 deletions
+22
-17
src/base/wlc/wlcCom.c
+10
-6
src/base/wln/wln.h
+1
-1
src/base/wln/wlnNdr.c
+5
-5
src/base/wln/wlnNtk.c
+6
-5
No files found.
src/base/wlc/wlcCom.c
View file @
978b5db0
...
...
@@ -1327,19 +1327,22 @@ usage:
******************************************************************************/
int
Abc_CommandRetime
(
Abc_Frame_t
*
pAbc
,
int
argc
,
char
**
argv
)
{
extern
void
Wln_NtkRetimeTest
(
char
*
pFileName
,
int
fSkipSimple
,
int
fVerbose
);
extern
void
Wln_NtkRetimeTest
(
char
*
pFileName
,
int
fSkipSimple
,
int
f
Dump
,
int
f
Verbose
);
FILE
*
pFile
;
char
*
pFileName
=
NULL
;
int
fSkipSimple
=
0
;
int
c
,
fVerbose
=
0
;
int
c
,
f
Dump
=
0
,
f
Verbose
=
0
;
Extra_UtilGetoptReset
();
while
(
(
c
=
Extra_UtilGetopt
(
argc
,
argv
,
"svh"
)
)
!=
EOF
)
while
(
(
c
=
Extra_UtilGetopt
(
argc
,
argv
,
"s
d
vh"
)
)
!=
EOF
)
{
switch
(
c
)
{
case
's'
:
fSkipSimple
^=
1
;
break
;
case
'd'
:
fDump
^=
1
;
break
;
case
'v'
:
fVerbose
^=
1
;
break
;
...
...
@@ -1352,7 +1355,7 @@ int Abc_CommandRetime( Abc_Frame_t * pAbc, int argc, char ** argv )
if
(
pAbc
->
pNdr
)
{
Vec_Int_t
*
vMoves
;
Wln_Ntk_t
*
pNtk
=
Wln_NtkFromNdr
(
pAbc
->
pNdr
);
Wln_Ntk_t
*
pNtk
=
Wln_NtkFromNdr
(
pAbc
->
pNdr
,
fDump
);
Wln_NtkRetimeCreateDelayInfo
(
pNtk
);
if
(
pNtk
==
NULL
)
{
...
...
@@ -1382,12 +1385,13 @@ int Abc_CommandRetime( Abc_Frame_t * pAbc, int argc, char ** argv )
return
0
;
}
fclose
(
pFile
);
Wln_NtkRetimeTest
(
pFileName
,
fSkipSimple
,
fVerbose
);
Wln_NtkRetimeTest
(
pFileName
,
fSkipSimple
,
f
Dump
,
f
Verbose
);
return
0
;
usage:
Abc_Print
(
-
2
,
"usage: %%retime [-svh]
\n
"
);
Abc_Print
(
-
2
,
"usage: %%retime [-s
d
vh]
\n
"
);
Abc_Print
(
-
2
,
"
\t
performs retiming for the NDR design
\n
"
);
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
-v : toggle printing verbose information [default = %s]
\n
"
,
fVerbose
?
"yes"
:
"no"
);
Abc_Print
(
-
2
,
"
\t
-h : print the command usage
\n
"
);
return
1
;
...
...
src/base/wln/wln.h
View file @
978b5db0
...
...
@@ -218,7 +218,7 @@ static inline int Wln_ObjRiToRo( Wln_Ntk_t * p, int i )
/*=== wlcNdr.c ========================================================*/
extern
Wln_Ntk_t
*
Wln_ReadNdr
(
char
*
pFileName
);
extern
void
Wln_WriteNdr
(
Wln_Ntk_t
*
pNtk
,
char
*
pFileName
);
extern
Wln_Ntk_t
*
Wln_NtkFromNdr
(
void
*
pData
);
extern
Wln_Ntk_t
*
Wln_NtkFromNdr
(
void
*
pData
,
int
fDump
);
extern
void
*
Wln_NtkToNdr
(
Wln_Ntk_t
*
pNtk
);
/*=== wlcNtk.c ========================================================*/
extern
Wln_Ntk_t
*
Wln_NtkAlloc
(
char
*
pName
,
int
nObjsMax
);
...
...
src/base/wln/wlnNdr.c
View file @
978b5db0
...
...
@@ -179,7 +179,7 @@ void Wln_NtkCheckIntegrity( void * pData )
}
Vec_IntFree
(
vMap
);
}
Wln_Ntk_t
*
Wln_NtkFromNdr
(
void
*
pData
)
Wln_Ntk_t
*
Wln_NtkFromNdr
(
void
*
pData
,
int
fDump
)
{
Ndr_Data_t
*
p
=
(
Ndr_Data_t
*
)
pData
;
Vec_Int_t
*
vName2Obj
,
*
vFanins
=
Vec_IntAlloc
(
100
);
...
...
@@ -298,7 +298,7 @@ Wln_Ntk_t * Wln_NtkFromNdr( void * pData )
Wln_Ntk_t
*
Wln_ReadNdr
(
char
*
pFileName
)
{
void
*
pData
=
Ndr_Read
(
pFileName
);
Wln_Ntk_t
*
pNtk
=
pData
?
Wln_NtkFromNdr
(
pData
)
:
NULL
;
Wln_Ntk_t
*
pNtk
=
pData
?
Wln_NtkFromNdr
(
pData
,
0
)
:
NULL
;
if
(
pNtk
)
return
NULL
;
//char * ppNames[10] = { NULL, "a", "b", "c", "d", "e", "f", "g", "h", "i" };
//Ndr_WriteVerilog( NULL, pData, ppNames );
...
...
@@ -314,17 +314,17 @@ void Wln_ReadNdrTest()
Wln_NtkStaticFanoutTest
(
pNtk
);
Wln_NtkFree
(
pNtk
);
}
void
Wln_NtkRetimeTest
(
char
*
pFileName
,
int
fSkipSimple
,
int
fVerbose
)
void
Wln_NtkRetimeTest
(
char
*
pFileName
,
int
fSkipSimple
,
int
f
Dump
,
int
f
Verbose
)
{
Vec_Int_t
*
vMoves
;
void
*
pData
=
Ndr_Read
(
pFileName
);
Wln_Ntk_t
*
pNtk
=
pData
?
Wln_NtkFromNdr
(
pData
)
:
NULL
;
Wln_Ntk_t
*
pNtk
=
pData
?
Wln_NtkFromNdr
(
pData
,
fDump
)
:
NULL
;
Ndr_Delete
(
pData
);
if
(
pNtk
==
NULL
)
{
printf
(
"Retiming network is not available.
\n
"
);
return
;
}
Ndr_Delete
(
pData
);
Wln_NtkRetimeCreateDelayInfo
(
pNtk
);
vMoves
=
Wln_NtkRetime
(
pNtk
,
fSkipSimple
,
fVerbose
);
//Vec_IntPrint( vMoves );
...
...
src/base/wln/wlnNtk.c
View file @
978b5db0
...
...
@@ -207,7 +207,7 @@ int Wln_NtkIsAcyclic( Wln_Ntk_t * p )
continue
;
// stop as soon as the first loop is detected
fprintf
(
stdout
,
"Primary output %16s (ID %6d)
\n
"
,
Wln_ObjName
(
p
,
iObj
),
iObj
);
break
;
goto
finish
;
}
Wln_NtkForEachFf
(
p
,
iObj
,
i
)
{
...
...
@@ -216,7 +216,7 @@ int Wln_NtkIsAcyclic( Wln_Ntk_t * p )
continue
;
// stop as soon as the first loop is detected
fprintf
(
stdout
,
"Flip-flop %16s (ID %6d)
\n
"
,
Wln_ObjName
(
p
,
iObj
),
iObj
);
break
;
goto
finish
;
}
Wln_NtkForEachObj
(
p
,
iObj
)
nUnvisited
+=
!
Wln_ObjIsTravIdPrevious
(
p
,
iObj
)
&&
!
Wln_ObjIsCi
(
p
,
iObj
);
...
...
@@ -227,14 +227,14 @@ int Wln_NtkIsAcyclic( Wln_Ntk_t * p )
printf
(
"The network has %d objects and %d (%6.2f %%) of them are not connected to the outputs.
\n
"
,
Wln_NtkObjNum
(
p
),
nUnvisited
,
100
.
0
*
nUnvisited
/
Wln_NtkObjNum
(
p
)
);
Wln_NtkForEachObj
(
p
,
iObj
)
if
(
!
Wln_ObjRefs
(
p
,
iObj
)
&&
!
Wln_ObjIsCi
(
p
,
iObj
)
&&
!
Wln_ObjIsFf
(
p
,
iObj
)
)
if
(
!
Wln_ObjRefs
(
p
,
iObj
)
&&
!
Wln_ObjIsCi
(
p
,
iObj
)
&&
!
Wln_ObjIs
Co
(
p
,
iObj
)
&&
!
Wln_ObjIs
Ff
(
p
,
iObj
)
)
nSinks
++
;
if
(
nSinks
)
{
int
nPrinted
=
0
;
printf
(
"These unconnected objects feed into %d sink objects without fanout:
\n
"
,
nSinks
);
Wln_NtkForEachObj
(
p
,
iObj
)
if
(
!
Wln_ObjRefs
(
p
,
iObj
)
&&
!
Wln_ObjIsCi
(
p
,
iObj
)
&&
!
Wln_ObjIsFf
(
p
,
iObj
)
)
if
(
!
Wln_ObjRefs
(
p
,
iObj
)
&&
!
Wln_ObjIsCi
(
p
,
iObj
)
&&
!
Wln_ObjIs
Co
(
p
,
iObj
)
&&
!
Wln_ObjIs
Ff
(
p
,
iObj
)
)
{
fprintf
(
stdout
,
"Node %16s (ID %6d) of type %5s (type ID %2d)
\n
"
,
Wln_ObjName
(
p
,
iObj
),
iObj
,
Abc_OperName
(
Wln_ObjType
(
p
,
iObj
)),
Wln_ObjType
(
p
,
iObj
)
);
...
...
@@ -252,9 +252,10 @@ int Wln_NtkIsAcyclic( Wln_Ntk_t * p )
continue
;
// stop as soon as the first loop is detected
fprintf
(
stdout
,
"Unconnected object %s
\n
"
,
Wln_ObjName
(
p
,
iObj
)
);
break
;
goto
finish
;
}
}
finish
:
return
fAcyclic
;
}
...
...
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