
        default: fsm_state  <= CNTRL_WORD_STRIP;          
      endcase
    end
  end

assign cws_axi_str_tvalid = (fsm_state == CNTRL_WORD_STRIP) ? 1'b0 : cws_axi_str_tvalid_in;
assign first_data_beat_en =  cws_axi_str_tvalid_in & (fsm_state == CNTRL_WORD_STRIP) ? 1'b1 : 1'b0;

always@(posedge axi_str_aclk)
if(first_data_beat_en)
begin
    cws_axi_str_tuser_out  <= cws_axi_str_tdata_in[PKT_LEN-1:0];
    rd_strb_val <= cws_axi_str_tdata_in[PKT_LEN+REM_WIDTH-1:PKT_LEN];
end

// Logic for generating tlast from packet length 

always@(posedge axi_str_aclk)
begin
if(~rst_n)
   cntr_to_gen_rd_tlast <= 'd0;
else if(first_data_beat_en)
begin
    if(cws_axi_str_tdata_in[PKT_LEN-1:0] <= STRB_WIDTH)  //Single cycle packet
       cntr_to_gen_rd_tlast <= 'd1;
    else
      if((cws_axi_str_tdata_in[PKT_LEN-1:0]%STRB_WIDTH) == 'd0)
          cntr_to_gen_rd_tlast <= (cws_axi_str_tdata_in[PKT_LEN-1:0]/STRB_WIDTH);
      else
          cntr_to_gen_rd_tlast <= (cws_axi_str_tdata_in[PKT_LEN-1:0]/STRB_WIDTH) + 'd1;
end
else i