Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
sv2v
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
sv2v
Commits
8a554113
Commit
8a554113
authored
Jul 19, 2021
by
Zachary Snow
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
don't process global items when looking up identifiers in packages
parent
56c597e3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
29 additions
and
3 deletions
+29
-3
src/Convert/Package.hs
+5
-3
test/core/package_ident.sv
+17
-0
test/core/package_ident.v
+7
-0
No files found.
src/Convert/Package.hs
View file @
8a554113
...
...
@@ -264,9 +264,11 @@ processItems topName packageName moduleItems = do
details
<-
lookupElemM
x
case
details
of
Nothing
->
if
null
topName
then
return
x
else
resolveGlobalIdent
x
-- only missing identifiers within parts should be looked up
-- in the global scope
if
null
packageName
&&
not
(
null
topName
)
then
resolveGlobalIdent
x
else
return
x
Just
([
_
,
_
],
_
,
Declared
)
->
if
null
packageName
then
return
x
...
...
test/core/package_ident.sv
0 → 100644
View file @
8a554113
package
P
;
typedef
struct
packed
{
integer
U
;
}
T
;
function
automatic
integer
F
;
input
integer
inp
;
return
$
clog2
(
inp
)
;
endfunction
localparam
X
=
F
(
100
)
;
localparam
T
Y
=
'
{
U
:
X
+
1
};
localparam
Z
=
Y
.
U
+
1
;
endpackage
import
P
::*;
localparam
V
=
Y
+
1
;
module
top
;
initial
$
display
(
"%0d %0d"
,
V
,
X
)
;
endmodule
test/core/package_ident.v
0 → 100644
View file @
8a554113
module
top
;
localparam
X
=
$
clog2
(
100
)
;
localparam
Y
=
X
+
1
;
localparam
Z
=
Y
+
1
;
localparam
V
=
Y
+
1
;
initial
$
display
(
"%0d %0d"
,
V
,
X
)
;
endmodule
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