support default pattern unbased unsized port bindings

This commit is contained in:
Zachary Snow 2020-12-07 15:56:32 -07:00
parent 2b377cef04
commit ad18c583ab
3 changed files with 24 additions and 0 deletions

View File

@ -188,6 +188,8 @@ convertExpr _ (Cast te e) =
Cast te $ convertExpr SelfDetermined e
convertExpr _ (Concat exprs) =
Concat $ map (convertExpr SelfDetermined) exprs
convertExpr context (Pattern [(":default", e @ UU{})]) =
convertExpr context e
convertExpr _ (Pattern items) =
Pattern $ zip
(map fst items)

View File

@ -0,0 +1,11 @@
module Example(inp);
input [4][5] inp;
initial #1 $display("%b", inp);
endmodule
module top;
Example e1('{default:'0});
Example e2('{default:'1});
Example e3('{default:'x});
Example e4('{default:'z});
endmodule

View File

@ -0,0 +1,11 @@
module Example(inp);
input [19:0] inp;
initial #1 $display("%b", inp);
endmodule
module top;
Example e1({20 {1'sb0}});
Example e2({20 {1'sb1}});
Example e3({20 {1'sbx}});
Example e4({20 {1'sbz}});
endmodule