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
4359311d
Commit
4359311d
authored
Mar 02, 2020
by
Alan Mishchenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Changes to the old parser.
parent
73496629
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
6 deletions
+21
-6
src/base/acb/acbFunc.c
+21
-6
No files found.
src/base/acb/acbFunc.c
View file @
4359311d
...
...
@@ -187,15 +187,30 @@ Vec_Int_t * Acb_VerilogSimpleLex( char * pFileName, Abc_Nam_t * pNames )
{
Vec_Int_t
*
vBuffer
=
Vec_IntAlloc
(
1000
);
char
*
pBuffer
=
Extra_FileReadContents
(
pFileName
);
char
*
pToken
;
char
*
pToken
,
*
pStart
,
*
pLimit
=
pBuffer
+
strlen
(
pBuffer
)
;
if
(
pBuffer
==
NULL
)
return
NULL
;
Acb_VerilogRemoveComments
(
pBuffer
);
pToken
=
strtok
(
pBuffer
,
"
\n\r\t
(),"
);
pToken
=
strtok
(
pBuffer
,
"
\n\r\t
(),
;=
"
);
while
(
pToken
)
{
Vec_IntPush
(
vBuffer
,
Abc_NamStrFindOrAdd
(
pNames
,
pToken
,
NULL
)
);
pToken
=
strtok
(
NULL
,
"
\n\r\t
(),;"
);
int
iToken
=
Abc_NamStrFindOrAdd
(
pNames
,
pToken
,
NULL
);
if
(
!
strcmp
(
pToken
,
"assign"
)
)
Vec_IntPush
(
vBuffer
,
ACB_BUF
);
else
Vec_IntPush
(
vBuffer
,
iToken
);
if
(
iToken
>=
ACB_BUF
&&
iToken
<
ACB_UNUSED
)
{
for
(
pStart
=
pToken
;
pStart
<
pLimit
&&
*
pStart
!=
'\n'
;
pStart
++
)
if
(
*
pStart
==
'('
)
break
;
if
(
*
pStart
==
'('
)
{
pToken
=
strtok
(
pStart
,
"
\n\r\t
(),;="
);
continue
;
}
}
pToken
=
strtok
(
NULL
,
"
\n\r\t
(),;="
);
}
ABC_FREE
(
pBuffer
);
return
vBuffer
;
...
...
@@ -234,8 +249,8 @@ void * Acb_VerilogSimpleParse( Vec_Int_t * vBuffer, Abc_Nam_t * pNames )
Vec_IntPush
(
vTypes
,
Token
);
Vec_IntPush
(
vTypes
,
Vec_IntSize
(
vFanins
)
);
vCur
=
vFanins
;
if
(
pToken
[
1
]
==
'z'
&&
pToken
[
2
]
==
'_'
&&
pToken
[
3
]
==
'g'
&&
pToken
[
4
]
==
'_'
)
i
++
;
//
if ( pToken[1] == 'z' && pToken[2] == '_' && pToken[3] == 'g' && pToken[4] == '_' )
//
i++;
}
else
Vec_IntPush
(
vCur
,
Token
);
...
...
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