Tests: Add t_param_type
This commit is contained in:
parent
4a404bd92e
commit
48740a0dba
|
|
@ -49,6 +49,10 @@ module t (/*AUTOARG*/
|
|||
mod_typ #(.TYP (bit [23:0] )) mod_ar1d (clk, cnt_ar1d[24-1:0], siz_ar1d);
|
||||
mod_typ #(.TYP (bit [3:0][3:0])) mod_ar2d (clk, cnt_ar2d[16-1:0], siz_ar2d);
|
||||
|
||||
// double types
|
||||
mod_typ2 #(.WIDTH1(3), .WIDTH2(3), .TYP1(bit [2:0])) mod2_3_3();
|
||||
mod_typ2 #(.WIDTH1(3), .WIDTH2(5), .TYP1(bit [2:0]), .TYP2(bit[4:0])) mod2_3_5();
|
||||
|
||||
endmodule : t
|
||||
|
||||
|
||||
|
|
@ -68,3 +72,21 @@ module mod_typ #(
|
|||
assign siz = $bits (cnt);
|
||||
|
||||
endmodule
|
||||
|
||||
module mod_typ2 #(
|
||||
parameter int WIDTH1 = 0,
|
||||
parameter int WIDTH2 = WIDTH1,
|
||||
parameter type TYP1 = byte,
|
||||
//UNSUP not needing 'parameter type' below and implying it
|
||||
parameter type TYP2 = TYP1
|
||||
)();
|
||||
|
||||
TYP1 t1;
|
||||
TYP2 t2;
|
||||
|
||||
initial begin
|
||||
if ($bits(t1) != WIDTH1) $stop;
|
||||
if ($bits(t2) != WIDTH2) $stop;
|
||||
end
|
||||
|
||||
endmodule
|
||||
|
|
|
|||
Loading…
Reference in New Issue