I have a code that is something like this –
logic [6:0] mask = 7'b001_1011;
logic [31:0] masked_number;
function void masks ();
masked_number[31: (32-mask)] = 'd1;
masked_number[32-mask-1):0] = 'd1;
endfunction
This gives me an error as below –
What is the right way to code this
Error-[IRIPS] Illegal range in part select
…/…/<file_name>, 221
The range of the part select is illegal:
Unknown range in part select.this.masked_number[31:(32 - this.mask)]
Error-[IRIPS] Illegal range in part select
…/…/<file_name>, 222
The range of the part select is illegal:
this.masked_number[((32 - this.mask) - 1):0]