mirror of https://github.com/YosysHQ/yosys.git
Add test for rhs sign extension in array slice assignment
This commit is contained in:
parent
23cd23efc5
commit
e0566eafdb
|
@ -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
|
Loading…
Reference in New Issue