1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61
|
module top;
M64 m64;
M48 m48;
S s;
REP rep;
endmodule
module M64;
reg [31:0] a,b,c,d;
reg [63:0] x;
initial
begin
a = 32'h12345678;
b = 32'habcd0123;
x = {a,b};
{c,d} = x;
$display("a=%h b=%h x=%h c=%h d=%h",a,b,x,c,d);
end
endmodule
module M48;
reg [23:0] a,b,c,d;
reg [47:0] x;
initial
begin
a = 24'h345678;
b = 24'hcd0123;
x = {a,b};
{c,d} = x;
$display("a=%h b=%h x=%h c=%h d=%h",a,b,x,c,d);
end
endmodule
module S;
initial
begin
$display("%s",{"this ","is ","a test"," of some strings"," being concatenated."});
end
endmodule
module REP;
reg [159:0] s;
wire [159:0] w;
assign w = {4{"XYZ:"}};
initial
begin
$display("%s",{5{"hello world! "}});
$display("%s",{10{"abcd "}});
s = {4{"ABC:"}};
$display("%s",s);
#1 $display("%s",w);
end
endmodule
|