# Data width is 128 bits but only LSB 32-bits are valid

**URL:** <https://verificationacademy.com/forums/t/data-width-is-128-bits-but-only-lsb-32-bits-are-valid/37806>\
**Category:** UVM\
**Tags:** UVM, AMBA-AXI\
**Created:** [July 5, 2020, 4:44am UTC](https://verificationacademy.com/forums/t/data-width-is-128-bits-but-only-lsb-32-bits-are-valid/37806 "2020-07-05T04:44:20Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![damera](https://verificationacademy.com/forums/letter_avatar_proxy/v4/letter/d/e274bd/32.png) [@damera](https://verificationacademy.com/forums/u/damera)\
**Post date:** [July 8, 2020, 1:26pm UTC](https://verificationacademy.com/forums/t/data-width-is-128-bits-but-only-lsb-32-bits-are-valid/37806/5 "2020-07-08T13:26:16Z")

</div>

Thank you for the suggestions. I have written this below .

```verilog
module allign( input [127:0] axi_in_data,
                  input [15:0] in_strobe ,
                  output reg [15:0]out_strobe,
                  output reg [127:0] axi_out_data
                ) ;
  bit [7:0] temp [];
  typedef bit [31:0] a;
  bit [127:0] wdata;
  bit [127:0] wdata2;
  bit [31:0] wdata1;
  integer i,j;
  assign wdata = axi_in_data;
  assign axi_out_data = wdata2;
  assign out_strobe = 16'h000f;

  task automatic masking(bit [15:0] strobe);
    begin
    temp=new[4];
    j=0;
    for(i = 0; i<16; i=i+1) begin
      if(strobe[i]==1) begin
        temp[3-j] = wdata[8*i+:8];
        j=j+1;
      end
    end
    wdata1=a'(temp); // unpacked to packed array casting
    wdata2 = {96'h0,wdata1};
    end
  endtask

  always@(*) begin
    masking(in_strobe);
  end
 endmodule

```

---

_[View the full topic](https://verificationacademy.com/forums/t/data-width-is-128-bits-but-only-lsb-32-bits-are-valid/37806)._
