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
61d46232
Commit
61d46232
authored
Oct 23, 2015
by
Alan Mishchenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adding switch in 'print_genlib' and 'write_genlib' to print area-min gates only.
parent
701565eb
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
38 additions
and
16 deletions
+38
-16
src/map/mio/mio.c
+17
-9
src/map/mio/mio.h
+1
-1
src/map/mio/mioUtils.c
+20
-6
No files found.
src/map/mio/mio.c
View file @
61d46232
...
...
@@ -401,23 +401,25 @@ int Mio_CommandWriteGenlib( Abc_Frame_t * pAbc, int argc, char **argv )
FILE
*
pOut
,
*
pErr
,
*
pFile
;
Abc_Ntk_t
*
pNet
;
char
*
pFileName
;
int
fVerbose
;
int
fSelected
=
0
;
int
fVerbose
=
0
;
int
c
;
pNet
=
Abc_FrameReadNtk
(
pAbc
);
pOut
=
Abc_FrameReadOut
(
pAbc
);
pErr
=
Abc_FrameReadErr
(
pAbc
);
// set the defaults
fVerbose
=
1
;
Extra_UtilGetoptReset
();
while
(
(
c
=
Extra_UtilGetopt
(
argc
,
argv
,
"vh"
))
!=
EOF
)
while
(
(
c
=
Extra_UtilGetopt
(
argc
,
argv
,
"v
a
h"
))
!=
EOF
)
{
switch
(
c
)
{
case
'v'
:
fVerbose
^=
1
;
break
;
case
'a'
:
fSelected
^=
1
;
break
;
case
'h'
:
goto
usage
;
break
;
...
...
@@ -443,15 +445,16 @@ int Mio_CommandWriteGenlib( Abc_Frame_t * pAbc, int argc, char **argv )
printf
(
"Error! Cannot open file
\"
%s
\"
for writing the library.
\n
"
,
pFileName
);
return
1
;
}
Mio_WriteLibrary
(
pFile
,
(
Mio_Library_t
*
)
Abc_FrameReadLibGen
(),
0
,
0
);
Mio_WriteLibrary
(
pFile
,
(
Mio_Library_t
*
)
Abc_FrameReadLibGen
(),
0
,
0
,
fSelected
);
fclose
(
pFile
);
printf
(
"The current genlib library is written into file
\"
%s
\"
.
\n
"
,
pFileName
);
return
0
;
usage:
fprintf
(
pErr
,
"
\n
usage: write_genlib [-vh] <file>
\n
"
);
fprintf
(
pErr
,
"
\n
usage: write_genlib [-v
a
h] <file>
\n
"
);
fprintf
(
pErr
,
"
\t
writes the current genlib library into a file
\n
"
);
fprintf
(
pErr
,
"
\t
-v : toggles enabling of verbose output [default = %s]
\n
"
,
fVerbose
?
"yes"
:
"no"
);
fprintf
(
pErr
,
"
\t
-a : toggles writing min-area gates [default = %s]
\n
"
,
fSelected
?
"yes"
:
"no"
);
fprintf
(
pErr
,
"
\t
-h : print the command usage
\n
"
);
fprintf
(
pErr
,
"
\t
<file> : optional file name to write the library
\n
"
);
return
1
;
...
...
@@ -473,6 +476,7 @@ int Mio_CommandPrintGenlib( Abc_Frame_t * pAbc, int argc, char **argv )
FILE
*
pOut
,
*
pErr
;
Abc_Ntk_t
*
pNet
;
int
fShort
=
0
;
int
fSelected
=
0
;
int
fVerbose
=
0
;
int
c
;
...
...
@@ -482,13 +486,16 @@ int Mio_CommandPrintGenlib( Abc_Frame_t * pAbc, int argc, char **argv )
// set the defaults
Extra_UtilGetoptReset
();
while
(
(
c
=
Extra_UtilGetopt
(
argc
,
argv
,
"svh"
))
!=
EOF
)
while
(
(
c
=
Extra_UtilGetopt
(
argc
,
argv
,
"s
a
vh"
))
!=
EOF
)
{
switch
(
c
)
{
case
's'
:
fShort
^=
1
;
break
;
case
'a'
:
fSelected
^=
1
;
break
;
case
'v'
:
fVerbose
^=
1
;
break
;
...
...
@@ -504,13 +511,14 @@ int Mio_CommandPrintGenlib( Abc_Frame_t * pAbc, int argc, char **argv )
printf
(
"Library is not available.
\n
"
);
return
1
;
}
Mio_WriteLibrary
(
stdout
,
(
Mio_Library_t
*
)
Abc_FrameReadLibGen
(),
0
,
fShort
);
Mio_WriteLibrary
(
stdout
,
(
Mio_Library_t
*
)
Abc_FrameReadLibGen
(),
0
,
fShort
,
fSelected
);
return
0
;
usage:
fprintf
(
pErr
,
"
\n
usage: print_genlib [-svh]
\n
"
);
fprintf
(
pErr
,
"
\n
usage: print_genlib [-s
a
vh]
\n
"
);
fprintf
(
pErr
,
"
\t
print the current genlib library
\n
"
);
fprintf
(
pErr
,
"
\t
-s : toggles writing short form [default = %s]
\n
"
,
fShort
?
"yes"
:
"no"
);
fprintf
(
pErr
,
"
\t
-a : toggles writing min-area gates [default = %s]
\n
"
,
fSelected
?
"yes"
:
"no"
);
fprintf
(
pErr
,
"
\t
-v : toggles enabling of verbose output [default = %s]
\n
"
,
fVerbose
?
"yes"
:
"no"
);
fprintf
(
pErr
,
"
\t
-h : print the command usage
\n
"
);
return
1
;
...
...
src/map/mio/mio.h
View file @
61d46232
...
...
@@ -180,7 +180,7 @@ extern void Mio_LibraryDelete( Mio_Library_t * pLib );
extern
void
Mio_GateDelete
(
Mio_Gate_t
*
pGate
);
extern
void
Mio_PinDelete
(
Mio_Pin_t
*
pPin
);
extern
Mio_Pin_t
*
Mio_PinDup
(
Mio_Pin_t
*
pPin
);
extern
void
Mio_WriteLibrary
(
FILE
*
pFile
,
Mio_Library_t
*
pLib
,
int
fPrintSops
,
int
fShort
);
extern
void
Mio_WriteLibrary
(
FILE
*
pFile
,
Mio_Library_t
*
pLib
,
int
fPrintSops
,
int
fShort
,
int
fSelected
);
extern
Mio_Gate_t
**
Mio_CollectRoots
(
Mio_Library_t
*
pLib
,
int
nInputs
,
float
tDelay
,
int
fSkipInv
,
int
*
pnGates
,
int
fVerbose
);
extern
Mio_Cell_t
*
Mio_CollectRootsNew
(
Mio_Library_t
*
pLib
,
int
nInputs
,
int
*
pnGates
,
int
fVerbose
);
extern
Mio_Cell_t
*
Mio_CollectRootsNewDefault
(
int
nInputs
,
int
*
pnGates
,
int
fVerbose
);
...
...
src/map/mio/mioUtils.c
View file @
61d46232
...
...
@@ -248,13 +248,26 @@ void Mio_WriteGate( FILE * pFile, Mio_Gate_t * pGate, int GateLen, int NameLen,
SeeAlso []
***********************************************************************/
void
Mio_WriteLibrary
(
FILE
*
pFile
,
Mio_Library_t
*
pLib
,
int
fPrintSops
,
int
fShort
)
void
Mio_WriteLibrary
(
FILE
*
pFile
,
Mio_Library_t
*
pLib
,
int
fPrintSops
,
int
fShort
,
int
fSelected
)
{
Mio_Gate_t
*
pGate
;
Mio_Pin_t
*
pPin
;
int
i
,
GateLen
=
0
,
NameLen
=
0
,
FormLen
=
0
;
Vec_Ptr_t
*
vGates
=
Vec_PtrAlloc
(
1000
);
int
i
,
nCells
,
GateLen
=
0
,
NameLen
=
0
,
FormLen
=
0
;
int
fAllPins
=
fShort
||
Mio_CheckGates
(
pLib
);
Mio_LibraryForEachGate
(
pLib
,
pGate
)
if
(
fSelected
)
{
Mio_Cell2_t
*
pCells
=
Mio_CollectRootsNewDefault2
(
6
,
&
nCells
,
0
);
for
(
i
=
0
;
i
<
nCells
;
i
++
)
Vec_PtrPush
(
vGates
,
pCells
[
i
].
pMioGate
);
ABC_FREE
(
pCells
);
}
else
{
for
(
i
=
0
;
i
<
pLib
->
nGates
;
i
++
)
Vec_PtrPush
(
vGates
,
pLib
->
ppGates0
[
i
]
);
}
Vec_PtrForEachEntry
(
Mio_Gate_t
*
,
vGates
,
pGate
,
i
)
{
GateLen
=
Abc_MaxInt
(
GateLen
,
strlen
(
pGate
->
pName
)
);
NameLen
=
Abc_MaxInt
(
NameLen
,
strlen
(
pGate
->
pOutName
)
);
...
...
@@ -262,9 +275,10 @@ void Mio_WriteLibrary( FILE * pFile, Mio_Library_t * pLib, int fPrintSops, int f
Mio_GateForEachPin
(
pGate
,
pPin
)
NameLen
=
Abc_MaxInt
(
NameLen
,
strlen
(
pPin
->
pName
)
);
}
fprintf
(
pFile
,
"# The genlib library
\"
%s
\"
written by ABC on %s
\n\n
"
,
pLib
->
pName
,
Extra_TimeStamp
()
);
for
(
i
=
0
;
i
<
pLib
->
nGates
;
i
++
)
Mio_WriteGate
(
pFile
,
pLib
->
ppGates0
[
i
],
GateLen
,
NameLen
,
FormLen
,
fPrintSops
,
fAllPins
);
fprintf
(
pFile
,
"# The genlib library
\"
%s
\"
with %d gates written by ABC on %s
\n
"
,
pLib
->
pName
,
Vec_PtrSize
(
vGates
),
Extra_TimeStamp
()
);
Vec_PtrForEachEntry
(
Mio_Gate_t
*
,
vGates
,
pGate
,
i
)
Mio_WriteGate
(
pFile
,
pGate
,
GateLen
,
NameLen
,
FormLen
,
fPrintSops
,
fAllPins
);
Vec_PtrFree
(
vGates
);
}
/**Function*************************************************************
...
...
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