Commit 1584f390 by Zachary Snow

allow typename resolution of non-vector types

parent 111e04f8
...@@ -94,5 +94,5 @@ resolveType types (Alias Nothing st rs1) = ...@@ -94,5 +94,5 @@ resolveType types (Alias Nothing st rs1) =
(Union p l rs2) -> Union p l $ rs1 ++ rs2 (Union p l rs2) -> Union p l $ rs1 ++ rs2
(InterfaceT x my rs2) -> InterfaceT x my $ rs1 ++ rs2 (InterfaceT x my rs2) -> InterfaceT x my $ rs1 ++ rs2
(Alias ps x rs2) -> Alias ps x $ rs1 ++ rs2 (Alias ps x rs2) -> Alias ps x $ rs1 ++ rs2
(IntegerAtom kw _ ) -> error $ "resolveType encountered packed `" ++ (show kw) ++ "` on " ++ st (IntegerAtom kw sg ) -> nullRange (IntegerAtom kw sg) rs1
(NonInteger kw ) -> error $ "resolveType encountered packed `" ++ (show kw) ++ "` on " ++ st (NonInteger kw ) -> nullRange (NonInteger kw ) rs1
...@@ -17,6 +17,7 @@ module Language.SystemVerilog.AST.Type ...@@ -17,6 +17,7 @@ module Language.SystemVerilog.AST.Type
, IntegerAtomType (..) , IntegerAtomType (..)
, NonIntegerType (..) , NonIntegerType (..)
, typeRanges , typeRanges
, nullRange
) where ) where
import Text.Printf (printf) import Text.Printf (printf)
......
...@@ -31,6 +31,10 @@ typedef enum Foo_t { ...@@ -31,6 +31,10 @@ typedef enum Foo_t {
H_1 = 'b1, H_2 = 'b0 H_1 = 'b1, H_2 = 'b0
} EnumH; } EnumH;
typedef enum int {
I_1, I_2
} EnumI;
`define PRINT(name, val) \ `define PRINT(name, val) \
dummy``name = name``_``val; \ dummy``name = name``_``val; \
$display("%h %h %0d %0d", \ $display("%h %h %0d %0d", \
...@@ -50,6 +54,7 @@ module top; ...@@ -50,6 +54,7 @@ module top;
EnumF dummyF; EnumF dummyF;
EnumG dummyG; EnumG dummyG;
EnumH dummyH; EnumH dummyH;
EnumI dummyI;
initial begin initial begin
...@@ -85,5 +90,8 @@ module top; ...@@ -85,5 +90,8 @@ module top;
`PRINT_UNSIZED(H, 1) `PRINT_UNSIZED(H, 1)
`PRINT_UNSIZED(H, 2) `PRINT_UNSIZED(H, 2)
`PRINT_UNSIZED(I, 1)
`PRINT_UNSIZED(I, 2)
end end
endmodule endmodule
...@@ -18,6 +18,7 @@ module top; ...@@ -18,6 +18,7 @@ module top;
reg [0:0] dummyF; reg [0:0] dummyF;
reg [0:0] dummyG; reg [0:0] dummyG;
reg [3:0] dummyH; reg [3:0] dummyH;
reg [31:0] dummyI;
initial begin initial begin
...@@ -53,6 +54,9 @@ module top; ...@@ -53,6 +54,9 @@ module top;
`PRINT_UNSIZED(H, 'b1) `PRINT_UNSIZED(H, 'b1)
`PRINT_UNSIZED(H, 'b0) `PRINT_UNSIZED(H, 'b0)
`PRINT_UNSIZED(I, 'b0)
`PRINT_UNSIZED(I, 'b1)
end end
endmodule 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