Commit 8a554113 by Zachary Snow

don't process global items when looking up identifiers in packages

parent 56c597e3
......@@ -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
......
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
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
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment