Add test for rhs sign extension in array slice assignment

This commit is contained in:
Dag Lem 2023-12-12 14:16:45 +01:00
parent 23cd23efc5
commit e0566eafdb
1 changed files with 20 additions and 0 deletions

View File

@ -0,0 +1,20 @@
module test (
offset_i,
data_o,
data_ref_o
);
input wire [ 2:0] offset_i;
output reg [15:0] data_o;
output reg [15:0] data_ref_o;
always @(*) begin
// defaults
data_o = '0;
data_ref_o = '0;
// partial assigns
data_ref_o[offset_i+:4] = 4'b1111; // unsigned
data_o[offset_i+:4] = 1'sb1; // sign extension to 4'b1111
end
endmodule