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
eb65c018
Commit
eb65c018
authored
Oct 06, 2016
by
Alan Mishchenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Change Verilog reader to take a string rather than file name.
parent
80327537
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
8 deletions
+10
-8
src/base/wlc/wlc.h
+1
-1
src/base/wlc/wlcCom.c
+1
-1
src/base/wlc/wlcReadVer.c
+8
-6
No files found.
src/base/wlc/wlc.h
View file @
eb65c018
...
@@ -286,7 +286,7 @@ extern void Wlc_NtkDeleteSim( Vec_Ptr_t * p );
...
@@ -286,7 +286,7 @@ extern void Wlc_NtkDeleteSim( Vec_Ptr_t * p );
/*=== wlcStdin.c ========================================================*/
/*=== wlcStdin.c ========================================================*/
extern
int
Wlc_StdinProcessSmt
(
Abc_Frame_t
*
pAbc
,
char
*
pCmd
);
extern
int
Wlc_StdinProcessSmt
(
Abc_Frame_t
*
pAbc
,
char
*
pCmd
);
/*=== wlcReadVer.c ========================================================*/
/*=== wlcReadVer.c ========================================================*/
extern
Wlc_Ntk_t
*
Wlc_ReadVer
(
char
*
pFileName
);
extern
Wlc_Ntk_t
*
Wlc_ReadVer
(
char
*
pFileName
,
char
*
pStr
);
/*=== wlcWriteVer.c ========================================================*/
/*=== wlcWriteVer.c ========================================================*/
extern
void
Wlc_WriteVer
(
Wlc_Ntk_t
*
p
,
char
*
pFileName
,
int
fAddCos
,
int
fNoFlops
);
extern
void
Wlc_WriteVer
(
Wlc_Ntk_t
*
p
,
char
*
pFileName
,
int
fAddCos
,
int
fNoFlops
);
...
...
src/base/wlc/wlcCom.c
View file @
eb65c018
...
@@ -161,7 +161,7 @@ int Abc_CommandReadWlc( Abc_Frame_t * pAbc, int argc, char ** argv )
...
@@ -161,7 +161,7 @@ int Abc_CommandReadWlc( Abc_Frame_t * pAbc, int argc, char ** argv )
// perform reading
// perform reading
if
(
!
strcmp
(
Extra_FileNameExtension
(
pFileName
),
"v"
)
)
if
(
!
strcmp
(
Extra_FileNameExtension
(
pFileName
),
"v"
)
)
pNtk
=
Wlc_ReadVer
(
pFileName
);
pNtk
=
Wlc_ReadVer
(
pFileName
,
NULL
);
else
if
(
!
strcmp
(
Extra_FileNameExtension
(
pFileName
),
"smt"
)
||
!
strcmp
(
Extra_FileNameExtension
(
pFileName
),
"smt2"
)
)
else
if
(
!
strcmp
(
Extra_FileNameExtension
(
pFileName
),
"smt"
)
||
!
strcmp
(
Extra_FileNameExtension
(
pFileName
),
"smt2"
)
)
pNtk
=
Wlc_ReadSmt
(
pFileName
,
fOldParser
,
fPrintTree
);
pNtk
=
Wlc_ReadSmt
(
pFileName
,
fOldParser
,
fPrintTree
);
else
else
...
...
src/base/wlc/wlcReadVer.c
View file @
eb65c018
...
@@ -75,14 +75,14 @@ static inline int Wlc_PrsStrCmp( char * pStr, char * pWhat ) { return
...
@@ -75,14 +75,14 @@ static inline int Wlc_PrsStrCmp( char * pStr, char * pWhat ) { return
SeeAlso []
SeeAlso []
***********************************************************************/
***********************************************************************/
Wlc_Prs_t
*
Wlc_PrsStart
(
char
*
pFileName
)
Wlc_Prs_t
*
Wlc_PrsStart
(
char
*
pFileName
,
char
*
pStr
)
{
{
Wlc_Prs_t
*
p
;
Wlc_Prs_t
*
p
;
if
(
!
Extra_FileCheck
(
pFileName
)
)
if
(
pFileName
&&
!
Extra_FileCheck
(
pFileName
)
)
return
NULL
;
return
NULL
;
p
=
ABC_CALLOC
(
Wlc_Prs_t
,
1
);
p
=
ABC_CALLOC
(
Wlc_Prs_t
,
1
);
p
->
pFileName
=
pFileName
;
p
->
pFileName
=
pFileName
;
p
->
pBuffer
=
Extra_FileReadContents
(
pFileName
);
p
->
pBuffer
=
pStr
?
Abc_UtilStrsav
(
pStr
)
:
Extra_FileReadContents
(
pFileName
);
p
->
nFileSize
=
strlen
(
p
->
pBuffer
);
assert
(
p
->
nFileSize
>
0
);
p
->
nFileSize
=
strlen
(
p
->
pBuffer
);
assert
(
p
->
nFileSize
>
0
);
p
->
vLines
=
Vec_IntAlloc
(
p
->
nFileSize
/
50
);
p
->
vLines
=
Vec_IntAlloc
(
p
->
nFileSize
/
50
);
p
->
vStarts
=
Vec_IntAlloc
(
p
->
nFileSize
/
50
);
p
->
vStarts
=
Vec_IntAlloc
(
p
->
nFileSize
/
50
);
...
@@ -1248,12 +1248,14 @@ startword:
...
@@ -1248,12 +1248,14 @@ startword:
}
}
return
1
;
return
1
;
}
}
Wlc_Ntk_t
*
Wlc_ReadVer
(
char
*
pFileName
)
Wlc_Ntk_t
*
Wlc_ReadVer
(
char
*
pFileName
,
char
*
pStr
)
{
{
Wlc_Prs_t
*
p
;
Wlc_Prs_t
*
p
;
Wlc_Ntk_t
*
pNtk
=
NULL
;
Wlc_Ntk_t
*
pNtk
=
NULL
;
// either file name or string is given
assert
(
(
pFileName
==
NULL
)
!=
(
pStr
==
NULL
)
);
// start the parser
// start the parser
p
=
Wlc_PrsStart
(
pFileName
);
p
=
Wlc_PrsStart
(
pFileName
,
pStr
);
if
(
p
==
NULL
)
if
(
p
==
NULL
)
return
NULL
;
return
NULL
;
// detect lines
// detect lines
...
@@ -1286,7 +1288,7 @@ finish:
...
@@ -1286,7 +1288,7 @@ finish:
void
Io_ReadWordTest
(
char
*
pFileName
)
void
Io_ReadWordTest
(
char
*
pFileName
)
{
{
Gia_Man_t
*
pNew
;
Gia_Man_t
*
pNew
;
Wlc_Ntk_t
*
pNtk
=
Wlc_ReadVer
(
pFileName
);
Wlc_Ntk_t
*
pNtk
=
Wlc_ReadVer
(
pFileName
,
NULL
);
if
(
pNtk
==
NULL
)
if
(
pNtk
==
NULL
)
return
;
return
;
Wlc_WriteVer
(
pNtk
,
"test.v"
,
0
,
0
);
Wlc_WriteVer
(
pNtk
,
"test.v"
,
0
,
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