data/full_repos/permissive/494664634/AxisDWC1x4/src/hdl/AxisDWC1x4.v
data/verilator_xmls/232cf71a-bbf0-479a-a418-be3f044f9036.xml
module AxisDWC1x4(

  (*
    X_INTERFACE_INFO = "xilinx.com:signal:clock:1.0 clock CLK", X_INTERFACE_PARAMETER = "ASSOCIATED_BUSIF M_AXIS:S_AXIS"
     *)
  input         clock,

  (* X_INTERFACE_INFO = "xilinx.com:signal:reset:1.0 reset RST", X_INTERFACE_PARAMETER = "POLARITY ACTIVE_HIGH" *)
  input         reset,

  (* X_INTERFACE_INFO = "xilinx.com:interface:axis:1.0 S_AXIS TDATA", X_INTERFACE_PARAMETER = "CLK_DOMAIN clock" *)
  input  [7:0]  s_axis_tdata,

  (* X_INTERFACE_INFO = "xilinx.com:interface:axis:1.0 S_AXIS TVALID" *)
  input         s_axis_tvalid,

  (* X_INTERFACE_INFO = "xilinx.com:interface:axis:1.0 S_AXIS TREADY" *)
  output        s_axis_tready,

  (* X_INTERFACE_INFO = "xilinx.com:interface:axis:1.0 S_AXIS TKEEP" *)
  input         s_axis_tkeep,

  (* X_INTERFACE_INFO = "xilinx.com:interface:axis:1.0 S_AXIS TLAST" *)
  input         s_axis_tlast,

  (* X_INTERFACE_INFO = "xilinx.com:interface:axis:1.0 M_AXIS TDATA", X_INTERFACE_PARAMETER = "CLK_DOMAIN clock" *)
  output [31:0] m_axis_tdata,

  (* X_INTERFACE_INFO = "xilinx.com:interface:axis:1.0 M_AXIS TVALID" *)
  output        m_axis_tvalid,

  (* X_INTERFACE_INFO = "xilinx.com:interface:axis:1.0 M_AXIS TREADY" *)
  input         m_axis_tready,

  (* X_INTERFACE_INFO = "xilinx.com:interface:axis:1.0 M_AXIS TKEEP" *)
  output [3:0]  m_axis_tkeep,

  (* X_INTERFACE_INFO = "xilinx.com:interface:axis:1.0 M_AXIS TLAST" *)
  output        m_axis_tlast
);
`ifdef RANDOMIZE_REG_INIT
  reg [31:0] _RAND_0;
  reg [31:0] _RAND_1;
  reg [31:0] _RAND_2;
  reg [31:0] _RAND_3;
  reg [31:0] _RAND_4;
  reg [31:0] _RAND_5;
  reg [31:0] _RAND_6;
  reg [31:0] _RAND_7;
  reg [31:0] _RAND_8;
`endif
  reg [7:0] data_0;
  reg [7:0] data_1;
  reg [7:0] data_2;
  reg [7:0] data_3;
  reg  keep_0;
  reg  keep_1;
  reg  keep_2;
  reg  keep_3;
  reg [1:0] cnt;
  wire  xfer = s_axis_tready & s_axis_tvalid;
  wire [1:0] _cnt_T_1 = cnt + 2'h1;
  wire [7:0] _GEN_0 = 2'h0 == cnt ? s_axis_tdata : data_0;
  wire [7:0] _GEN_1 = 2'h1 == cnt ? s_axis_tdata : data_1;
  wire [7:0] _GEN_2 = 2'h2 == cnt ? s_axis_tdata : data_2;
  wire [7:0] _GEN_3 = 2'h3 == cnt ? s_axis_tdata : data_3;
  wire  _GEN_4 = 2'h0 == cnt ? s_axis_tkeep : keep_0;
  wire  _GEN_5 = 2'h1 == cnt ? s_axis_tkeep : keep_1;
  wire  _GEN_6 = 2'h2 == cnt ? s_axis_tkeep : keep_2;
  wire  _GEN_7 = 2'h3 == cnt ? s_axis_tkeep : keep_3;
  wire [31:0] _m_axis_tdata_T = {data_3,data_2,data_1,data_0};
  wire [15:0] _m_axis_tdata_T_2 = {s_axis_tdata,_m_axis_tdata_T[7:0]};
  wire [23:0] _m_axis_tdata_T_5 = {s_axis_tdata,_m_axis_tdata_T[15:0]};
  wire [31:0] _m_axis_tdata_T_8 = {s_axis_tdata,_m_axis_tdata_T[23:0]};
  wire [15:0] _m_axis_tdata_T_10 = 2'h1 == cnt ? _m_axis_tdata_T_2 : {{8'd0}, s_axis_tdata};
  wire [23:0] _m_axis_tdata_T_12 = 2'h2 == cnt ? _m_axis_tdata_T_5 : {{8'd0}, _m_axis_tdata_T_10};
  wire [31:0] _m_axis_tdata_T_14 = 2'h3 == cnt ? _m_axis_tdata_T_8 : {{8'd0}, _m_axis_tdata_T_12};
  wire [3:0] _m_axis_tkeep_T = {keep_3,keep_2,keep_1,keep_0};
  wire [1:0] _m_axis_tkeep_T_2 = {s_axis_tkeep,_m_axis_tkeep_T[0]};
  wire [2:0] _m_axis_tkeep_T_5 = {s_axis_tkeep,_m_axis_tkeep_T[1:0]};
  wire [3:0] _m_axis_tkeep_T_8 = {s_axis_tkeep,_m_axis_tkeep_T[2:0]};
  wire [1:0] _m_axis_tkeep_T_10 = 2'h1 == cnt ? _m_axis_tkeep_T_2 : {{1'd0}, s_axis_tkeep};
  wire [2:0] _m_axis_tkeep_T_12 = 2'h2 == cnt ? _m_axis_tkeep_T_5 : {{1'd0}, _m_axis_tkeep_T_10};
  wire [3:0] _m_axis_tkeep_T_14 = 2'h3 == cnt ? _m_axis_tkeep_T_8 : {{1'd0}, _m_axis_tkeep_T_12};
  wire  _T_2 = cnt == 2'h3;
  wire [31:0] _GEN_8 = cnt == 2'h3 ? _m_axis_tdata_T_8 : 32'h0;
  wire [3:0] _GEN_9 = cnt == 2'h3 ? _m_axis_tkeep_T_8 : 4'h0;
  wire [31:0] _GEN_20 = s_axis_tlast ? _m_axis_tdata_T_14 : _GEN_8;
  wire [3:0] _GEN_21 = s_axis_tlast ? _m_axis_tkeep_T_14 : _GEN_9;
  wire  _GEN_23 = s_axis_tlast | _T_2;
  assign s_axis_tready = m_axis_tready;
  assign m_axis_tdata = xfer & s_axis_tkeep ? _GEN_20 : 32'h0;
  assign m_axis_tvalid = xfer & s_axis_tkeep & _GEN_23;
  assign m_axis_tkeep = xfer & s_axis_tkeep ? _GEN_21 : 4'h0;
  assign m_axis_tlast = xfer & s_axis_tkeep & s_axis_tlast;
  always @(posedge clock) begin
    if (reset) begin
      data_0 <= 8'h0;
    end else if (xfer & s_axis_tkeep) begin
      if (s_axis_tlast) begin
        data_0 <= 8'h0;
      end else if (cnt == 2'h3) begin
        data_0 <= 8'h0;
      end else begin
        data_0 <= _GEN_0;
      end
    end
    if (reset) begin
      data_1 <= 8'h0;
    end else if (xfer & s_axis_tkeep) begin
      if (s_axis_tlast) begin
        data_1 <= 8'h0;
      end else if (cnt == 2'h3) begin
        data_1 <= 8'h0;
      end else begin
        data_1 <= _GEN_1;
      end
    end
    if (reset) begin
      data_2 <= 8'h0;
    end else if (xfer & s_axis_tkeep) begin
      if (s_axis_tlast) begin
        data_2 <= 8'h0;
      end else if (cnt == 2'h3) begin
        data_2 <= 8'h0;
      end else begin
        data_2 <= _GEN_2;
      end
    end
    if (reset) begin
      data_3 <= 8'h0;
    end else if (xfer & s_axis_tkeep) begin
      if (s_axis_tlast) begin
        data_3 <= 8'h0;
      end else if (cnt == 2'h3) begin
        data_3 <= 8'h0;
      end else begin
        data_3 <= _GEN_3;
      end
    end
    if (reset) begin
      keep_0 <= 1'h0;
    end else if (xfer & s_axis_tkeep) begin
      if (s_axis_tlast) begin
        keep_0 <= 1'h0;
      end else if (cnt == 2'h3) begin
        keep_0 <= 1'h0;
      end else begin
        keep_0 <= _GEN_4;
      end
    end
    if (reset) begin
      keep_1 <= 1'h0;
    end else if (xfer & s_axis_tkeep) begin
      if (s_axis_tlast) begin
        keep_1 <= 1'h0;
      end else if (cnt == 2'h3) begin
        keep_1 <= 1'h0;
      end else begin
        keep_1 <= _GEN_5;
      end
    end
    if (reset) begin
      keep_2 <= 1'h0;
    end else if (xfer & s_axis_tkeep) begin
      if (s_axis_tlast) begin
        keep_2 <= 1'h0;
      end else if (cnt == 2'h3) begin
        keep_2 <= 1'h0;
      end else begin
        keep_2 <= _GEN_6;
      end
    end
    if (reset) begin
      keep_3 <= 1'h0;
    end else if (xfer & s_axis_tkeep) begin
      if (s_axis_tlast) begin
        keep_3 <= 1'h0;
      end else if (cnt == 2'h3) begin
        keep_3 <= 1'h0;
      end else begin
        keep_3 <= _GEN_7;
      end
    end
    if (reset) begin
      cnt <= 2'h0;
    end else if (xfer & s_axis_tkeep) begin
      if (s_axis_tlast) begin
        cnt <= 2'h0;
      end else if (cnt == 2'h3) begin
        cnt <= 2'h0;
      end else begin
        cnt <= _cnt_T_1;
      end
    end
  end

`ifdef RANDOMIZE_GARBAGE_ASSIGN
`define RANDOMIZE
`endif
`ifdef RANDOMIZE_INVALID_ASSIGN
`define RANDOMIZE
`endif
`ifdef RANDOMIZE_REG_INIT
`define RANDOMIZE
`endif
`ifdef RANDOMIZE_MEM_INIT
`define RANDOMIZE
`endif
`ifndef RANDOM
`define RANDOM $random
`endif
`ifdef RANDOMIZE_MEM_INIT
  integer initvar;
`endif
`ifndef SYNTHESIS
`ifdef FIRRTL_BEFORE_INITIAL
`FIRRTL_BEFORE_INITIAL
`endif
initial begin
  `ifdef RANDOMIZE
    `ifdef INIT_RANDOM
      `INIT_RANDOM
    `endif
    `ifndef VERILATOR
      `ifdef RANDOMIZE_DELAY
        #`RANDOMIZE_DELAY begin end
      `else
        #0.002 begin end
      `endif
    `endif
`ifdef RANDOMIZE_REG_INIT
  _RAND_0 = {1{`RANDOM}};
  data_0 = _RAND_0[7:0];
  _RAND_1 = {1{`RANDOM}};
  data_1 = _RAND_1[7:0];
  _RAND_2 = {1{`RANDOM}};
  data_2 = _RAND_2[7:0];
  _RAND_3 = {1{`RANDOM}};
  data_3 = _RAND_3[7:0];
  _RAND_4 = {1{`RANDOM}};
  keep_0 = _RAND_4[0:0];
  _RAND_5 = {1{`RANDOM}};
  keep_1 = _RAND_5[0:0];
  _RAND_6 = {1{`RANDOM}};
  keep_2 = _RAND_6[0:0];
  _RAND_7 = {1{`RANDOM}};
  keep_3 = _RAND_7[0:0];
  _RAND_8 = {1{`RANDOM}};
  cnt = _RAND_8[1:0];
`endif
  `endif
end
`ifdef FIRRTL_AFTER_INITIAL
`FIRRTL_AFTER_INITIAL
`endif
`endif
endmodule
module AxisDWC1x4(

  (*
    X_INTERFACE_INFO = "xilinx.com:signal:clock:1.0 clock CLK", X_INTERFACE_PARAMETER = "ASSOCIATED_BUSIF M_AXIS:S_AXIS"
     *)
  input         clock,

  (* X_INTERFACE_INFO = "xilinx.com:signal:reset:1.0 reset RST", X_INTERFACE_PARAMETER = "POLARITY ACTIVE_HIGH" *)
  input         reset,

  (* X_INTERFACE_INFO = "xilinx.com:interface:axis:1.0 S_AXIS TDATA", X_INTERFACE_PARAMETER = "CLK_DOMAIN clock" *)
  input  [7:0]  s_axis_tdata,

  (* X_INTERFACE_INFO = "xilinx.com:interface:axis:1.0 S_AXIS TVALID" *)
  input         s_axis_tvalid,

  (* X_INTERFACE_INFO = "xilinx.com:interface:axis:1.0 S_AXIS TREADY" *)
  output        s_axis_tready,

  (* X_INTERFACE_INFO = "xilinx.com:interface:axis:1.0 S_AXIS TKEEP" *)
  input         s_axis_tkeep,

  (* X_INTERFACE_INFO = "xilinx.com:interface:axis:1.0 S_AXIS TLAST" *)
  input         s_axis_tlast,

  (* X_INTERFACE_INFO = "xilinx.com:interface:axis:1.0 M_AXIS TDATA", X_INTERFACE_PARAMETER = "CLK_DOMAIN clock" *)
  output [31:0] m_axis_tdata,

  (* X_INTERFACE_INFO = "xilinx.com:interface:axis:1.0 M_AXIS TVALID" *)
  output        m_axis_tvalid,

  (* X_INTERFACE_INFO = "xilinx.com:interface:axis:1.0 M_AXIS TREADY" *)
  input         m_axis_tready,

  (* X_INTERFACE_INFO = "xilinx.com:interface:axis:1.0 M_AXIS TKEEP" *)
  output [3:0]  m_axis_tkeep,

  (* X_INTERFACE_INFO = "xilinx.com:interface:axis:1.0 M_AXIS TLAST" *)
  output        m_axis_tlast
);

`ifdef RANDOMIZE_REG_INIT
  reg [31:0] _RAND_0;
  reg [31:0] _RAND_1;
  reg [31:0] _RAND_2;
  reg [31:0] _RAND_3;
  reg [31:0] _RAND_4;
  reg [31:0] _RAND_5;
  reg [31:0] _RAND_6;
  reg [31:0] _RAND_7;
  reg [31:0] _RAND_8;
`endif
  reg [7:0] data_0;
  reg [7:0] data_1;
  reg [7:0] data_2;
  reg [7:0] data_3;
  reg  keep_0;
  reg  keep_1;
  reg  keep_2;
  reg  keep_3;
  reg [1:0] cnt;
  wire  xfer = s_axis_tready & s_axis_tvalid;
  wire [1:0] _cnt_T_1 = cnt + 2'h1;
  wire [7:0] _GEN_0 = 2'h0 == cnt ? s_axis_tdata : data_0;
  wire [7:0] _GEN_1 = 2'h1 == cnt ? s_axis_tdata : data_1;
  wire [7:0] _GEN_2 = 2'h2 == cnt ? s_axis_tdata : data_2;
  wire [7:0] _GEN_3 = 2'h3 == cnt ? s_axis_tdata : data_3;
  wire  _GEN_4 = 2'h0 == cnt ? s_axis_tkeep : keep_0;
  wire  _GEN_5 = 2'h1 == cnt ? s_axis_tkeep : keep_1;
  wire  _GEN_6 = 2'h2 == cnt ? s_axis_tkeep : keep_2;
  wire  _GEN_7 = 2'h3 == cnt ? s_axis_tkeep : keep_3;
  wire [31:0] _m_axis_tdata_T = {data_3,data_2,data_1,data_0};
  wire [15:0] _m_axis_tdata_T_2 = {s_axis_tdata,_m_axis_tdata_T[7:0]};
  wire [23:0] _m_axis_tdata_T_5 = {s_axis_tdata,_m_axis_tdata_T[15:0]};
  wire [31:0] _m_axis_tdata_T_8 = {s_axis_tdata,_m_axis_tdata_T[23:0]};
  wire [15:0] _m_axis_tdata_T_10 = 2'h1 == cnt ? _m_axis_tdata_T_2 : {{8'd0}, s_axis_tdata};
  wire [23:0] _m_axis_tdata_T_12 = 2'h2 == cnt ? _m_axis_tdata_T_5 : {{8'd0}, _m_axis_tdata_T_10};
  wire [31:0] _m_axis_tdata_T_14 = 2'h3 == cnt ? _m_axis_tdata_T_8 : {{8'd0}, _m_axis_tdata_T_12};
  wire [3:0] _m_axis_tkeep_T = {keep_3,keep_2,keep_1,keep_0};
  wire [1:0] _m_axis_tkeep_T_2 = {s_axis_tkeep,_m_axis_tkeep_T[0]};
  wire [2:0] _m_axis_tkeep_T_5 = {s_axis_tkeep,_m_axis_tkeep_T[1:0]};
  wire [3:0] _m_axis_tkeep_T_8 = {s_axis_tkeep,_m_axis_tkeep_T[2:0]};
  wire [1:0] _m_axis_tkeep_T_10 = 2'h1 == cnt ? _m_axis_tkeep_T_2 : {{1'd0}, s_axis_tkeep};
  wire [2:0] _m_axis_tkeep_T_12 = 2'h2 == cnt ? _m_axis_tkeep_T_5 : {{1'd0}, _m_axis_tkeep_T_10};
  wire [3:0] _m_axis_tkeep_T_14 = 2'h3 == cnt ? _m_axis_tkeep_T_8 : {{1'd0}, _m_axis_tkeep_T_12};
  wire  _T_2 = cnt == 2'h3;
  wire [31:0] _GEN_8 = cnt == 2'h3 ? _m_axis_tdata_T_8 : 32'h0;
  wire [3:0] _GEN_9 = cnt == 2'h3 ? _m_axis_tkeep_T_8 : 4'h0;
  wire [31:0] _GEN_20 = s_axis_tlast ? _m_axis_tdata_T_14 : _GEN_8;
  wire [3:0] _GEN_21 = s_axis_tlast ? _m_axis_tkeep_T_14 : _GEN_9;
  wire  _GEN_23 = s_axis_tlast | _T_2;
  assign s_axis_tready = m_axis_tready;
  assign m_axis_tdata = xfer & s_axis_tkeep ? _GEN_20 : 32'h0;
  assign m_axis_tvalid = xfer & s_axis_tkeep & _GEN_23;
  assign m_axis_tkeep = xfer & s_axis_tkeep ? _GEN_21 : 4'h0;
  assign m_axis_tlast = xfer & s_axis_tkeep & s_axis_tlast;
  always @(posedge clock) begin
    if (reset) begin
      data_0 <= 8'h0;
    end else if (xfer & s_axis_tkeep) begin
      if (s_axis_tlast) begin
        data_0 <= 8'h0;
      end else if (cnt == 2'h3) begin
        data_0 <= 8'h0;
      end else begin
        data_0 <= _GEN_0;
      end
    end
    if (reset) begin
      data_1 <= 8'h0;
    end else if (xfer & s_axis_tkeep) begin
      if (s_axis_tlast) begin
        data_1 <= 8'h0;
      end else if (cnt == 2'h3) begin
        data_1 <= 8'h0;
      end else begin
        data_1 <= _GEN_1;
      end
    end
    if (reset) begin
      data_2 <= 8'h0;
    end else if (xfer & s_axis_tkeep) begin
      if (s_axis_tlast) begin
        data_2 <= 8'h0;
      end else if (cnt == 2'h3) begin
        data_2 <= 8'h0;
      end else begin
        data_2 <= _GEN_2;
      end
    end
    if (reset) begin
      data_3 <= 8'h0;
    end else if (xfer & s_axis_tkeep) begin
      if (s_axis_tlast) begin
        data_3 <= 8'h0;
      end else if (cnt == 2'h3) begin
        data_3 <= 8'h0;
      end else begin
        data_3 <= _GEN_3;
      end
    end
    if (reset) begin
      keep_0 <= 1'h0;
    end else if (xfer & s_axis_tkeep) begin
      if (s_axis_tlast) begin
        keep_0 <= 1'h0;
      end else if (cnt == 2'h3) begin
        keep_0 <= 1'h0;
      end else begin
        keep_0 <= _GEN_4;
      end
    end
    if (reset) begin
      keep_1 <= 1'h0;
    end else if (xfer & s_axis_tkeep) begin
      if (s_axis_tlast) begin
        keep_1 <= 1'h0;
      end else if (cnt == 2'h3) begin
        keep_1 <= 1'h0;
      end else begin
        keep_1 <= _GEN_5;
      end
    end
    if (reset) begin
      keep_2 <= 1'h0;
    end else if (xfer & s_axis_tkeep) begin
      if (s_axis_tlast) begin
        keep_2 <= 1'h0;
      end else if (cnt == 2'h3) begin
        keep_2 <= 1'h0;
      end else begin
        keep_2 <= _GEN_6;
      end
    end
    if (reset) begin
      keep_3 <= 1'h0;
    end else if (xfer & s_axis_tkeep) begin
      if (s_axis_tlast) begin
        keep_3 <= 1'h0;
      end else if (cnt == 2'h3) begin
        keep_3 <= 1'h0;
      end else begin
        keep_3 <= _GEN_7;
      end
    end
    if (reset) begin
      cnt <= 2'h0;
    end else if (xfer & s_axis_tkeep) begin
      if (s_axis_tlast) begin
        cnt <= 2'h0;
      end else if (cnt == 2'h3) begin
        cnt <= 2'h0;
      end else begin
        cnt <= _cnt_T_1;
      end
    end
  end

`ifdef RANDOMIZE_GARBAGE_ASSIGN
`define RANDOMIZE
`endif
`ifdef RANDOMIZE_INVALID_ASSIGN
`define RANDOMIZE
`endif
`ifdef RANDOMIZE_REG_INIT
`define RANDOMIZE
`endif
`ifdef RANDOMIZE_MEM_INIT
`define RANDOMIZE
`endif
`ifndef RANDOM
`define RANDOM $random
`endif
`ifdef RANDOMIZE_MEM_INIT
  integer initvar;
`endif
`ifndef SYNTHESIS
`ifdef FIRRTL_BEFORE_INITIAL
`FIRRTL_BEFORE_INITIAL
`endif
initial begin
  `ifdef RANDOMIZE
    `ifdef INIT_RANDOM
      `INIT_RANDOM
    `endif
    `ifndef VERILATOR
      `ifdef RANDOMIZE_DELAY
        #`RANDOMIZE_DELAY begin end
      `else
        #0.002 begin end
      `endif
    `endif
`ifdef RANDOMIZE_REG_INIT
  _RAND_0 = {1{`RANDOM}};
  data_0 = _RAND_0[7:0];
  _RAND_1 = {1{`RANDOM}};
  data_1 = _RAND_1[7:0];
  _RAND_2 = {1{`RANDOM}};
  data_2 = _RAND_2[7:0];
  _RAND_3 = {1{`RANDOM}};
  data_3 = _RAND_3[7:0];
  _RAND_4 = {1{`RANDOM}};
  keep_0 = _RAND_4[0:0];
  _RAND_5 = {1{`RANDOM}};
  keep_1 = _RAND_5[0:0];
  _RAND_6 = {1{`RANDOM}};
  keep_2 = _RAND_6[0:0];
  _RAND_7 = {1{`RANDOM}};
  keep_3 = _RAND_7[0:0];
  _RAND_8 = {1{`RANDOM}};
  cnt = _RAND_8[1:0];
`endif
  `endif
end
`ifdef FIRRTL_AFTER_INITIAL
`FIRRTL_AFTER_INITIAL
`endif
`endif
endmodule