Skip to content

Commit

Permalink
Add test for rhs sign extension in array slice assignment
Browse files Browse the repository at this point in the history
  • Loading branch information
daglem committed Dec 12, 2023
1 parent 5248753 commit 3449fbb
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions tests/simple/sign_part_assign.v
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 3449fbb

Please sign in to comment.