Commit e88a6b9d by Zachary Snow

fix type lookup of yet-unresolved types (resolves #111)

parent 7eed2fc5
......@@ -90,12 +90,14 @@ typeof (Call (Ident x) _) =
typeof (orig @ (Bit e _)) = do
t <- typeof e
case t of
TypeOf _ -> lookupTypeOf orig
TypeOf{} -> lookupTypeOf orig
Alias{} -> return $ TypeOf orig
_ -> return $ popRange t
typeof (orig @ (Range e mode r)) = do
t <- typeof e
return $ case t of
TypeOf _ -> TypeOf orig
TypeOf{} -> TypeOf orig
Alias{} -> TypeOf orig
_ -> replaceRange (lo, hi) t
where
lo = fst r
......
package P;
typedef logic [1:0][2:0] T;
endpackage
module top;
P::T w;
type(w[0]) x;
type(x[0]) y;
type(w[0][0]) z;
type(w[1:0]) a;
type(w[0][1:0]) b;
initial begin
$display("%b %b %b %b", w, x, y, z);
$display("%b %b", a, b);
end
endmodule
module top;
wire [5:0] w;
wire [2:0] x;
wire y;
wire z;
wire [5:0] a;
wire [1:0] b;
initial begin
$display("%b %b %b %b", w, x, y, z);
$display("%b %b", a, b);
end
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