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
ea7d10d4
Commit
ea7d10d4
authored
May 12, 2016
by
Alan Mishchenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adding 'read_pla -d' to read dc-set along with on-set (useful to derive offset).
parent
9e4d24aa
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
29 additions
and
14 deletions
+29
-14
src/base/io/io.c
+9
-5
src/base/io/ioAbc.h
+1
-1
src/base/io/ioReadPla.c
+18
-7
src/base/io/ioUtil.c
+1
-1
No files found.
src/base/io/io.c
View file @
ea7d10d4
...
...
@@ -903,10 +903,10 @@ int IoCommandReadPla( Abc_Frame_t * pAbc, int argc, char ** argv )
{
Abc_Ntk_t
*
pNtk
;
char
*
pFileName
;
int
c
,
fZeros
=
0
,
fBoth
=
0
,
fSkipPrepro
=
0
,
fCheck
=
1
;
int
c
,
fZeros
=
0
,
fBoth
=
0
,
f
OnDc
=
0
,
f
SkipPrepro
=
0
,
fCheck
=
1
;
Extra_UtilGetoptReset
();
while
(
(
c
=
Extra_UtilGetopt
(
argc
,
argv
,
"zbxch"
)
)
!=
EOF
)
while
(
(
c
=
Extra_UtilGetopt
(
argc
,
argv
,
"zb
d
xch"
)
)
!=
EOF
)
{
switch
(
c
)
{
...
...
@@ -916,6 +916,9 @@ int IoCommandReadPla( Abc_Frame_t * pAbc, int argc, char ** argv )
case
'b'
:
fBoth
^=
1
;
break
;
case
'd'
:
fOnDc
^=
1
;
break
;
case
'x'
:
fSkipPrepro
^=
1
;
break
;
...
...
@@ -933,10 +936,10 @@ int IoCommandReadPla( Abc_Frame_t * pAbc, int argc, char ** argv )
// get the input file name
pFileName
=
argv
[
globalUtilOptind
];
// read the file using the corresponding file reader
if
(
fZeros
||
fBoth
||
fSkipPrepro
)
if
(
fZeros
||
fBoth
||
f
OnDc
||
f
SkipPrepro
)
{
Abc_Ntk_t
*
pTemp
;
pNtk
=
Io_ReadPla
(
pFileName
,
fZeros
,
fBoth
,
fSkipPrepro
,
fCheck
);
pNtk
=
Io_ReadPla
(
pFileName
,
fZeros
,
fBoth
,
f
OnDc
,
f
SkipPrepro
,
fCheck
);
if
(
pNtk
==
NULL
)
{
printf
(
"Reading PLA file has failed.
\n
"
);
...
...
@@ -955,10 +958,11 @@ int IoCommandReadPla( Abc_Frame_t * pAbc, int argc, char ** argv )
return
0
;
usage:
fprintf
(
pAbc
->
Err
,
"usage: read_pla [-zbxch] <file>
\n
"
);
fprintf
(
pAbc
->
Err
,
"usage: read_pla [-zb
d
xch] <file>
\n
"
);
fprintf
(
pAbc
->
Err
,
"
\t
reads the network in PLA
\n
"
);
fprintf
(
pAbc
->
Err
,
"
\t
-z : toggle reading on-set and off-set [default = %s]
\n
"
,
fZeros
?
"off-set"
:
"on-set"
);
fprintf
(
pAbc
->
Err
,
"
\t
-b : toggle reading both on-set and off-set as on-set [default = %s]
\n
"
,
fBoth
?
"off-set"
:
"on-set"
);
fprintf
(
pAbc
->
Err
,
"
\t
-d : toggle reading both on-set and dc-set as on-set [default = %s]
\n
"
,
fOnDc
?
"off-set"
:
"on-set"
);
fprintf
(
pAbc
->
Err
,
"
\t
-x : toggle reading Exclusive SOP rather than SOP [default = %s]
\n
"
,
fSkipPrepro
?
"yes"
:
"no"
);
fprintf
(
pAbc
->
Err
,
"
\t
-c : toggle network check after reading [default = %s]
\n
"
,
fCheck
?
"yes"
:
"no"
);
fprintf
(
pAbc
->
Err
,
"
\t
-h : prints the command summary
\n
"
);
...
...
src/base/io/ioAbc.h
View file @
ea7d10d4
...
...
@@ -93,7 +93,7 @@ extern Abc_Ntk_t * Io_ReadEdif( char * pFileName, int fCheck );
/*=== abcReadEqn.c ============================================================*/
extern
Abc_Ntk_t
*
Io_ReadEqn
(
char
*
pFileName
,
int
fCheck
);
/*=== abcReadPla.c ============================================================*/
extern
Abc_Ntk_t
*
Io_ReadPla
(
char
*
pFileName
,
int
fZeros
,
int
fBoth
,
int
fSkipPrepro
,
int
fCheck
);
extern
Abc_Ntk_t
*
Io_ReadPla
(
char
*
pFileName
,
int
fZeros
,
int
fBoth
,
int
f
OnDc
,
int
f
SkipPrepro
,
int
fCheck
);
/*=== abcReadVerilog.c ========================================================*/
extern
Abc_Ntk_t
*
Io_ReadVerilog
(
char
*
pFileName
,
int
fCheck
);
/*=== abcWriteAiger.c =========================================================*/
...
...
src/base/io/ioReadPla.c
View file @
ea7d10d4
...
...
@@ -28,7 +28,7 @@ ABC_NAMESPACE_IMPL_START
/// DECLARATIONS ///
////////////////////////////////////////////////////////////////////////
static
Abc_Ntk_t
*
Io_ReadPlaNetwork
(
Extra_FileReader_t
*
p
,
int
fZeros
,
int
fBoth
,
int
fSkipPrepro
);
static
Abc_Ntk_t
*
Io_ReadPlaNetwork
(
Extra_FileReader_t
*
p
,
int
fZeros
,
int
fBoth
,
int
f
OnDc
,
int
f
SkipPrepro
);
////////////////////////////////////////////////////////////////////////
/// FUNCTION DEFINITIONS ///
...
...
@@ -326,7 +326,7 @@ void Io_ReadPlaCubePreprocess( Vec_Str_t * vSop, int iCover, int fVerbose )
SeeAlso []
***********************************************************************/
Abc_Ntk_t
*
Io_ReadPla
(
char
*
pFileName
,
int
fZeros
,
int
fBoth
,
int
fSkipPrepro
,
int
fCheck
)
Abc_Ntk_t
*
Io_ReadPla
(
char
*
pFileName
,
int
fZeros
,
int
fBoth
,
int
f
OnDc
,
int
f
SkipPrepro
,
int
fCheck
)
{
Extra_FileReader_t
*
p
;
Abc_Ntk_t
*
pNtk
;
...
...
@@ -338,7 +338,7 @@ Abc_Ntk_t * Io_ReadPla( char * pFileName, int fZeros, int fBoth, int fSkipPrepro
return
NULL
;
// read the network
pNtk
=
Io_ReadPlaNetwork
(
p
,
fZeros
,
fBoth
,
fSkipPrepro
);
pNtk
=
Io_ReadPlaNetwork
(
p
,
fZeros
,
fBoth
,
f
OnDc
,
f
SkipPrepro
);
Extra_FileReaderFree
(
p
);
if
(
pNtk
==
NULL
)
return
NULL
;
...
...
@@ -363,7 +363,7 @@ Abc_Ntk_t * Io_ReadPla( char * pFileName, int fZeros, int fBoth, int fSkipPrepro
SeeAlso []
***********************************************************************/
Abc_Ntk_t
*
Io_ReadPlaNetwork
(
Extra_FileReader_t
*
p
,
int
fZeros
,
int
fBoth
,
int
fSkipPrepro
)
Abc_Ntk_t
*
Io_ReadPlaNetwork
(
Extra_FileReader_t
*
p
,
int
fZeros
,
int
fBoth
,
int
f
OnDc
,
int
f
SkipPrepro
)
{
ProgressBar
*
pProgress
;
Vec_Ptr_t
*
vTokens
;
...
...
@@ -514,7 +514,18 @@ Abc_Ntk_t * Io_ReadPlaNetwork( Extra_FileReader_t * p, int fZeros, int fBoth, in
ABC_FREE
(
ppSops
);
return
NULL
;
}
if
(
fBoth
)
if
(
fZeros
)
{
for
(
i
=
0
;
i
<
nOutputs
;
i
++
)
{
if
(
pCubeOut
[
i
]
==
'0'
)
{
Vec_StrPrintStr
(
ppSops
[
i
],
pCubeIn
);
Vec_StrPrintStr
(
ppSops
[
i
],
" 1
\n
"
);
}
}
}
else
if
(
fBoth
)
{
for
(
i
=
0
;
i
<
nOutputs
;
i
++
)
{
...
...
@@ -525,11 +536,11 @@ Abc_Ntk_t * Io_ReadPlaNetwork( Extra_FileReader_t * p, int fZeros, int fBoth, in
}
}
}
else
if
(
f
Zeros
)
else
if
(
f
OnDc
)
{
for
(
i
=
0
;
i
<
nOutputs
;
i
++
)
{
if
(
pCubeOut
[
i
]
==
'
0
'
)
if
(
pCubeOut
[
i
]
==
'
-'
||
pCubeOut
[
i
]
==
'1
'
)
{
Vec_StrPrintStr
(
ppSops
[
i
],
pCubeIn
);
Vec_StrPrintStr
(
ppSops
[
i
],
" 1
\n
"
);
...
...
src/base/io/ioUtil.c
View file @
ea7d10d4
...
...
@@ -144,7 +144,7 @@ Abc_Ntk_t * Io_ReadNetlist( char * pFileName, Io_FileType_t FileType, int fCheck
else
if
(
FileType
==
IO_FILE_EQN
)
pNtk
=
Io_ReadEqn
(
pFileName
,
fCheck
);
else
if
(
FileType
==
IO_FILE_PLA
)
pNtk
=
Io_ReadPla
(
pFileName
,
0
,
0
,
0
,
fCheck
);
pNtk
=
Io_ReadPla
(
pFileName
,
0
,
0
,
0
,
0
,
fCheck
);
else
if
(
FileType
==
IO_FILE_VERILOG
)
pNtk
=
Io_ReadVerilog
(
pFileName
,
fCheck
);
else
...
...
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