mirror of https://github.com/zachjs/sv2v.git
don't process global items when looking up identifiers in packages
This commit is contained in:
parent
56c597e35e
commit
8a554113c8
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -0,0 +1,17 @@
|
|||
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
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
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
|
||||
Loading…
Reference in New Issue