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
c1f8baaf
Commit
c1f8baaf
authored
Sep 21, 2012
by
Alan Mishchenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added switch '-E <filename>' to 'read_library' to exclude gates listed while reading a Genlib file.
parent
b5306c15
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
44 additions
and
35 deletions
+44
-35
src/map/mio/mio.c
+44
-35
No files found.
src/map/mio/mio.c
View file @
c1f8baaf
/**CFile****************************************************************
FileName [mio.c]
p
FileName [mio.c]
PackageName [MVSIS 1.3: Multi-valued logic synthesis system.]
...
...
@@ -153,7 +153,7 @@ int Mio_CommandReadLiberty( Abc_Frame_t * pAbc, int argc, char **argv )
FILE
*
pFile
;
FILE
*
pOut
,
*
pErr
;
Abc_Ntk_t
*
pNet
;
char
*
FileName
;
char
*
p
FileName
;
int
fVerbose
;
int
c
;
...
...
@@ -186,21 +186,21 @@ int Mio_CommandReadLiberty( Abc_Frame_t * pAbc, int argc, char **argv )
}
// get the input file name
FileName
=
argv
[
globalUtilOptind
];
if
(
(
pFile
=
Io_FileOpen
(
FileName
,
"open_path"
,
"r"
,
0
))
==
NULL
)
p
FileName
=
argv
[
globalUtilOptind
];
if
(
(
pFile
=
Io_FileOpen
(
p
FileName
,
"open_path"
,
"r"
,
0
))
==
NULL
)
{
fprintf
(
pErr
,
"Cannot open input file
\"
%s
\"
. "
,
FileName
);
if
(
(
FileName
=
Extra_FileGetSimilarName
(
FileName
,
".genlib"
,
".lib"
,
".gen"
,
".g"
,
NULL
))
)
fprintf
(
pErr
,
"Did you mean
\"
%s
\"
?"
,
FileName
);
fprintf
(
pErr
,
"Cannot open input file
\"
%s
\"
. "
,
p
FileName
);
if
(
(
pFileName
=
Extra_FileGetSimilarName
(
p
FileName
,
".genlib"
,
".lib"
,
".gen"
,
".g"
,
NULL
))
)
fprintf
(
pErr
,
"Did you mean
\"
%s
\"
?"
,
p
FileName
);
fprintf
(
pErr
,
"
\n
"
);
return
1
;
}
fclose
(
pFile
);
if
(
!
Amap_LibertyParse
(
FileName
,
fVerbose
)
)
if
(
!
Amap_LibertyParse
(
p
FileName
,
fVerbose
)
)
return
0
;
assert
(
strlen
(
FileName
)
<
900
);
sprintf
(
Command
,
"read_library %s"
,
Extra_FileNameGenericAppend
(
FileName
,
".genlib"
)
);
assert
(
strlen
(
p
FileName
)
<
900
);
sprintf
(
Command
,
"read_library %s"
,
Extra_FileNameGenericAppend
(
p
FileName
,
".genlib"
)
);
Cmd_CommandExecute
(
pAbc
,
Command
);
return
0
;
...
...
@@ -232,7 +232,8 @@ int Mio_CommandReadLibrary( Abc_Frame_t * pAbc, int argc, char **argv )
FILE
*
pOut
,
*
pErr
;
Mio_Library_t
*
pLib
;
Abc_Ntk_t
*
pNet
;
char
*
FileName
;
char
*
pFileName
;
char
*
pExcludeFile
=
NULL
;
int
fVerbose
;
double
WireDelay
;
int
c
;
...
...
@@ -245,7 +246,7 @@ int Mio_CommandReadLibrary( Abc_Frame_t * pAbc, int argc, char **argv )
WireDelay
=
0
.
0
;
fVerbose
=
1
;
Extra_UtilGetoptReset
();
while
(
(
c
=
Extra_UtilGetopt
(
argc
,
argv
,
"Wvh"
))
!=
EOF
)
while
(
(
c
=
Extra_UtilGetopt
(
argc
,
argv
,
"W
E
vh"
))
!=
EOF
)
{
switch
(
c
)
{
...
...
@@ -260,6 +261,15 @@ int Mio_CommandReadLibrary( Abc_Frame_t * pAbc, int argc, char **argv )
if
(
WireDelay
<=
0
.
0
)
goto
usage
;
break
;
case
'E'
:
if
(
globalUtilOptind
>=
argc
)
{
Abc_Print
(
-
1
,
"Command line switch
\"
-E
\"
should be followed by a file name.
\n
"
);
goto
usage
;
}
pExcludeFile
=
argv
[
globalUtilOptind
];
globalUtilOptind
++
;
break
;
case
'v'
:
fVerbose
^=
1
;
break
;
...
...
@@ -270,27 +280,25 @@ int Mio_CommandReadLibrary( Abc_Frame_t * pAbc, int argc, char **argv )
goto
usage
;
}
}
if
(
argc
!=
globalUtilOptind
+
1
)
{
goto
usage
;
}
// get the input file name
FileName
=
argv
[
globalUtilOptind
];
if
(
(
pFile
=
Io_FileOpen
(
FileName
,
"open_path"
,
"r"
,
0
))
==
NULL
)
p
FileName
=
argv
[
globalUtilOptind
];
if
(
(
pFile
=
Io_FileOpen
(
p
FileName
,
"open_path"
,
"r"
,
0
))
==
NULL
)
{
fprintf
(
pErr
,
"Cannot open input file
\"
%s
\"
. "
,
FileName
);
if
(
(
FileName
=
Extra_FileGetSimilarName
(
FileName
,
".genlib"
,
".lib"
,
".gen"
,
".g"
,
NULL
))
)
fprintf
(
pErr
,
"Did you mean
\"
%s
\"
?"
,
FileName
);
fprintf
(
pErr
,
"Cannot open input file
\"
%s
\"
. "
,
p
FileName
);
if
(
(
pFileName
=
Extra_FileGetSimilarName
(
p
FileName
,
".genlib"
,
".lib"
,
".gen"
,
".g"
,
NULL
))
)
fprintf
(
pErr
,
"Did you mean
\"
%s
\"
?"
,
p
FileName
);
fprintf
(
pErr
,
"
\n
"
);
return
1
;
}
fclose
(
pFile
);
// set the new network
pLib
=
Mio_LibraryRead
(
FileName
,
0
,
fVerbose
);
pLib
=
Mio_LibraryRead
(
pFileName
,
pExcludeFile
,
fVerbose
);
if
(
pLib
==
NULL
)
{
fprintf
(
pErr
,
"Reading GENLIB library has failed.
\n
"
);
...
...
@@ -312,7 +320,7 @@ int Mio_CommandReadLibrary( Abc_Frame_t * pAbc, int argc, char **argv )
Abc_FrameSetLibGen
(
pLib
);
// set the new network
pLib
=
(
Mio_Library_t
*
)
Amap_LibReadAndPrepare
(
FileName
,
0
,
0
);
pLib
=
(
Mio_Library_t
*
)
Amap_LibReadAndPrepare
(
p
FileName
,
0
,
0
);
if
(
pLib
==
NULL
)
{
fprintf
(
pErr
,
"Reading GENLIB library has failed.
\n
"
);
...
...
@@ -324,12 +332,13 @@ int Mio_CommandReadLibrary( Abc_Frame_t * pAbc, int argc, char **argv )
return
0
;
usage:
fprintf
(
pErr
,
"usage: read_library [-W float] [-vh]
\n
"
);
fprintf
(
pErr
,
"usage: read_library [-W float] [-
E filename] [-
vh]
\n
"
);
fprintf
(
pErr
,
"
\t
read the library from a genlib file
\n
"
);
fprintf
(
pErr
,
"
\t
(if the library contains more than one gate
\n
"
);
fprintf
(
pErr
,
"
\t
with the same Boolean function, only the gate
\n
"
);
fprintf
(
pErr
,
"
\t
with the smallest area will be used)
\n
"
);
Abc_Print
(
-
2
,
"
\t
-W float : wire delay (added to pin-to-pin gate delays) [default = %g]
\n
"
,
WireDelay
);
fprintf
(
pErr
,
"
\t
-W float : wire delay (added to pin-to-pin gate delays) [default = %g]
\n
"
,
WireDelay
);
fprintf
(
pErr
,
"
\t
-E file : the file name with gates to be excluded [default = none]
\n
"
);
fprintf
(
pErr
,
"
\t
-v : toggle verbose printout [default = %s]
\n
"
,
fVerbose
?
"yes"
:
"no"
);
fprintf
(
pErr
,
"
\t
-h : enable verbose output
\n
"
);
return
1
;
/* error exit */
...
...
@@ -352,7 +361,7 @@ int Mio_CommandReadLibrary2( Abc_Frame_t * pAbc, int argc, char **argv )
FILE
*
pOut
,
*
pErr
;
Mio_Library_t
*
pLib
;
Abc_Ntk_t
*
pNet
;
char
*
FileName
;
char
*
p
FileName
;
int
fVerbose
;
int
fVeryVerbose
;
int
c
;
...
...
@@ -390,19 +399,19 @@ int Mio_CommandReadLibrary2( Abc_Frame_t * pAbc, int argc, char **argv )
}
// get the input file name
FileName
=
argv
[
globalUtilOptind
];
if
(
(
pFile
=
Io_FileOpen
(
FileName
,
"open_path"
,
"r"
,
0
))
==
NULL
)
p
FileName
=
argv
[
globalUtilOptind
];
if
(
(
pFile
=
Io_FileOpen
(
p
FileName
,
"open_path"
,
"r"
,
0
))
==
NULL
)
{
fprintf
(
pErr
,
"Cannot open input file
\"
%s
\"
. "
,
FileName
);
if
(
(
FileName
=
Extra_FileGetSimilarName
(
FileName
,
".genlib"
,
".lib"
,
".gen"
,
".g"
,
NULL
))
)
fprintf
(
pErr
,
"Did you mean
\"
%s
\"
?"
,
FileName
);
fprintf
(
pErr
,
"Cannot open input file
\"
%s
\"
. "
,
p
FileName
);
if
(
(
pFileName
=
Extra_FileGetSimilarName
(
p
FileName
,
".genlib"
,
".lib"
,
".gen"
,
".g"
,
NULL
))
)
fprintf
(
pErr
,
"Did you mean
\"
%s
\"
?"
,
p
FileName
);
fprintf
(
pErr
,
"
\n
"
);
return
1
;
}
fclose
(
pFile
);
// set the new network
pLib
=
(
Mio_Library_t
*
)
Amap_LibReadAndPrepare
(
FileName
,
fVerbose
,
fVeryVerbose
);
pLib
=
(
Mio_Library_t
*
)
Amap_LibReadAndPrepare
(
p
FileName
,
fVerbose
,
fVeryVerbose
);
if
(
pLib
==
NULL
)
{
fprintf
(
pErr
,
"Reading GENLIB library has failed.
\n
"
);
...
...
@@ -442,7 +451,7 @@ int Mio_CommandPrintLibrary( Abc_Frame_t * pAbc, int argc, char **argv )
{
FILE
*
pOut
,
*
pErr
,
*
pFile
;
Abc_Ntk_t
*
pNet
;
char
*
FileName
;
char
*
p
FileName
;
int
fVerbose
;
int
c
;
...
...
@@ -472,18 +481,18 @@ int Mio_CommandPrintLibrary( Abc_Frame_t * pAbc, int argc, char **argv )
printf
(
"Library is not available.
\n
"
);
return
1
;
}
FileName
=
argv
[
globalUtilOptind
];
p
FileName
=
argv
[
globalUtilOptind
];
if
(
argc
==
globalUtilOptind
+
1
)
{
pFile
=
fopen
(
FileName
,
"w"
);
pFile
=
fopen
(
p
FileName
,
"w"
);
if
(
pFile
==
NULL
)
{
printf
(
"Error! Cannot open file
\"
%s
\"
for writing the library.
\n
"
,
FileName
);
printf
(
"Error! Cannot open file
\"
%s
\"
for writing the library.
\n
"
,
p
FileName
);
return
1
;
}
Mio_WriteLibrary
(
pFile
,
(
Mio_Library_t
*
)
Abc_FrameReadLibGen
(),
0
);
fclose
(
pFile
);
printf
(
"The current GENLIB library is written into file
\"
%s
\"
.
\n
"
,
FileName
);
printf
(
"The current GENLIB library is written into file
\"
%s
\"
.
\n
"
,
p
FileName
);
}
else
if
(
argc
==
globalUtilOptind
)
Mio_WriteLibrary
(
stdout
,
(
Mio_Library_t
*
)
Abc_FrameReadLibGen
(),
0
);
...
...
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