Commit d0d897b4 by Zachary Snow

package name resolution visits enum base types

parent dce7f149
......@@ -304,8 +304,9 @@ processItems topName packageName moduleItems = do
traverseTypeM (Alias x rs) =
resolveIdent x >>= \x' -> return $ Alias x' rs
traverseTypeM (Enum t enumItems rs) = do
t' <- traverseTypeM t
enumItems' <- mapM prefixEnumItem enumItems
return $ Enum t enumItems' rs
return $ Enum t' enumItems' rs
where prefixEnumItem (x, e) = prefixIdent x >>= \x' -> return (x', e)
traverseTypeM other = traverseSinglyNestedTypesM traverseTypeM other
......
package P;
localparam int W = 4;
typedef logic [W - 1:0] T;
typedef enum T {
A = 4'b1010,
B = 4'b0101
} E;
endpackage
module top;
initial $display("%d %d %d %b %b", $bits(P::A), $bits(P::T), $bits(P::E), P::A, P::B);
endmodule
module top;
localparam W = 4;
localparam A = 4'b1010;
localparam B = 4'b0101;
initial $display("%d %d %d %b %b", W, W, W, A, B);
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