handle params with unpacked typenames

This commit is contained in:
Zachary Snow 2021-07-21 11:56:40 -04:00
parent b2fe865e17
commit dde734be26
3 changed files with 10 additions and 0 deletions

View File

@ -76,6 +76,11 @@ traverseDeclM decl = do
case decl' of
Variable{} -> return decl'
Net{} -> return decl'
Param s (UnpackedType t rs1) x e -> do
insertElem x UnknownType
let (tf, rs2) = typeRanges t
let t' = tf $ rs1 ++ rs2
return $ Param s t' x e
Param _ _ x _ ->
insertElem x UnknownType >> return decl'
ParamType Localparam x t -> do

View File

@ -9,4 +9,7 @@ module top;
end
end
end
typedef byte T [3];
localparam T X = '{ 5, 3, 2 };
initial $display("%0d %0d %0d", X[0], X[1], X[2]);
endmodule

View File

@ -9,4 +9,6 @@ module top;
end
end
end
localparam [23:0] X = { 8'd5, 8'd3, 8'd2 };
initial $display("%0d %0d %0d", X[16+:8], X[8+:8], X[0+:8]);
endmodule