data/full_repos/permissive/498471995/sume/felix/simple_sume_switch/test/ip_repo/std/cores/axis_fifo_v1_0_0/hdl/axis_fifo.v
1: b"%Error: data/full_repos/permissive/498471995/sume/felix/simple_sume_switch/test/ip_repo/std/cores/axis_fifo_v1_0_0/hdl/axis_fifo.v:125: Cannot find file containing module: 'fallthrough_small_fifo'\n   fallthrough_small_fifo \n   ^~~~~~~~~~~~~~~~~~~~~~\n        ... Looked in:\n             data/full_repos/permissive/498471995/sume/felix/simple_sume_switch/test/ip_repo/std/cores/axis_fifo_v1_0_0/hdl,data/full_repos/permissive/498471995/fallthrough_small_fifo\n             data/full_repos/permissive/498471995/sume/felix/simple_sume_switch/test/ip_repo/std/cores/axis_fifo_v1_0_0/hdl,data/full_repos/permissive/498471995/fallthrough_small_fifo.v\n             data/full_repos/permissive/498471995/sume/felix/simple_sume_switch/test/ip_repo/std/cores/axis_fifo_v1_0_0/hdl,data/full_repos/permissive/498471995/fallthrough_small_fifo.sv\n             fallthrough_small_fifo\n             fallthrough_small_fifo.v\n             fallthrough_small_fifo.sv\n             obj_dir/fallthrough_small_fifo\n             obj_dir/fallthrough_small_fifo.v\n             obj_dir/fallthrough_small_fifo.sv\n%Error: data/full_repos/permissive/498471995/sume/felix/simple_sume_switch/test/ip_repo/std/cores/axis_fifo_v1_0_0/hdl/axis_fifo.v:143: Cannot find file containing module: 'fallthrough_small_fifo'\n   fallthrough_small_fifo \n   ^~~~~~~~~~~~~~~~~~~~~~\n%Error: Exiting due to 2 error(s)\n"
module axis_fifo
#(

    parameter C_AXIS_DATA_WIDTH  = 64,
    parameter C_AXIS_TUSER_WIDTH = 128
)
(

    input                                        axis_aclk,
    input                                        axis_resetn,


    output     [C_AXIS_DATA_WIDTH - 1:0]         m_axis_tdata,
    output     [((C_AXIS_DATA_WIDTH / 8)) - 1:0] m_axis_tkeep,
    output     [C_AXIS_TUSER_WIDTH-1:0]          m_axis_tuser,
    output reg                                   m_axis_tvalid,
    input                                        m_axis_tready,
    output                                       m_axis_tlast,


    input [C_AXIS_DATA_WIDTH - 1:0]              s_axis_tdata,
    input [((C_AXIS_DATA_WIDTH / 8)) - 1:0]      s_axis_tkeep,
    input [C_AXIS_TUSER_WIDTH-1:0]               s_axis_tuser,
    input                                        s_axis_tvalid,
    output reg                                   s_axis_tready,
    input                                        s_axis_tlast

);

   function integer log2;
      input integer number;
      begin
         log2=0;
         while(2**log2<number) begin
            log2=log2+1;
         end
      end
   endfunction



   localparam WAIT_START     = 0;
   localparam RCV_WORD       = 1;
   localparam L2_IFSM_STATES = 1;


   localparam RFSM_START = 0;
   localparam RFSM_FINISH_PKT = 1;
   localparam L2_RFSM_STATES = 1;   

   localparam MAX_PKT_SIZE = 2048;
   localparam MIN_PKT_SIZE = 64;
   localparam MAX_PKTS = MAX_PKT_SIZE/MIN_PKT_SIZE;

   localparam MAX_DEPTH = MAX_PKT_SIZE/C_AXIS_DATA_WIDTH; 
   localparam L2_MAX_DEPTH = log2(MAX_DEPTH);
   localparam L2_MAX_PKTS = log2(MAX_PKTS);


   reg  d_fifo_wr_en;
   reg  d_fifo_rd_en;
   wire d_fifo_nearly_full;
   wire d_fifo_empty;

   reg  m_fifo_wr_en;
   reg  m_fifo_rd_en;
   wire m_fifo_nearly_full;
   wire m_fifo_empty;

   reg s_axis_fifo_tlast;

   reg [L2_IFSM_STATES-1:0] ifsm_state, ifsm_state_next;
   reg [L2_RFSM_STATES-1:0] rfsm_state, rfsm_state_next;



   fallthrough_small_fifo 
      #(
          .WIDTH(C_AXIS_DATA_WIDTH+C_AXIS_DATA_WIDTH/8+1),
          .MAX_DEPTH_BITS(L2_MAX_DEPTH)
      )
      data_fifo
        (.din         ({s_axis_fifo_tlast, s_axis_tkeep, s_axis_tdata}),
         .wr_en       (d_fifo_wr_en),
         .rd_en       (d_fifo_rd_en),
         .dout        ({m_axis_tlast, m_axis_tkeep, m_axis_tdata}),
         .full        (),
         .prog_full   (),
         .nearly_full (d_fifo_nearly_full),
         .empty       (d_fifo_empty),
         .reset       (~axis_resetn),
         .clk         (axis_aclk)
         );

   fallthrough_small_fifo 
      #(
          .WIDTH(C_AXIS_TUSER_WIDTH),
          .MAX_DEPTH_BITS(L2_MAX_PKTS)
      )
      meta_fifo
        (.din         (s_axis_tuser),
         .wr_en       (m_fifo_wr_en),
         .rd_en       (m_fifo_rd_en),
         .dout        (m_axis_tuser),
         .full        (),
         .prog_full   (),
         .nearly_full (m_fifo_nearly_full),
         .empty       (m_fifo_empty),
         .reset       (~axis_resetn),
         .clk         (axis_aclk)
         );



    always @(*) begin

        ifsm_state_next = ifsm_state;

        d_fifo_wr_en = 0;
        m_fifo_wr_en = 0;

        s_axis_fifo_tlast = s_axis_tlast;
        s_axis_tready = ~d_fifo_nearly_full & ~m_fifo_nearly_full;

        case(ifsm_state)
            WAIT_START: begin
                if (s_axis_tvalid & s_axis_tready) begin
                    d_fifo_wr_en = 1;
                    m_fifo_wr_en = 1;
                    ifsm_state_next = RCV_WORD;
                end
            end

            RCV_WORD: begin
                if (s_axis_tvalid & s_axis_tready) begin
                    d_fifo_wr_en = 1;
                    if (s_axis_tlast) begin
                        ifsm_state_next = WAIT_START;
                    end
                end
            end
        endcase
    end

    always @(posedge axis_aclk) begin
        if (~axis_resetn) begin
            ifsm_state <= WAIT_START;
        end
        else begin
            ifsm_state <= ifsm_state_next;
        end
    end


    always @(*) begin

        rfsm_state_next = rfsm_state;

        d_fifo_rd_en = 0;
        m_fifo_rd_en = 0;

        m_axis_tvalid = 0;

        case(rfsm_state)
            RFSM_START: begin
               if (~d_fifo_empty & ~m_fifo_empty) begin
                   m_axis_tvalid = 1;
                   if (m_axis_tready) begin
                       d_fifo_rd_en = 1;
                       m_fifo_rd_en = 1;
                       rfsm_state_next = RFSM_FINISH_PKT;
                   end
               end 
            end

            RFSM_FINISH_PKT: begin
               if (~d_fifo_empty) begin
                   m_axis_tvalid = 1;
                   if (m_axis_tready) begin
                       d_fifo_rd_en = 1;
                       if (m_axis_tlast)
                           rfsm_state_next = RFSM_START;
                   end
               end
            end
        endcase
    end

    always @(posedge axis_aclk) begin
        if (~axis_resetn) begin
            rfsm_state <= RFSM_START;
        end
        else begin
            rfsm_state <= rfsm_state_next;
        end
    end








   
endmodule
module axis_fifo
#(

    parameter C_AXIS_DATA_WIDTH  = 64,
    parameter C_AXIS_TUSER_WIDTH = 128
)
(

    input                                        axis_aclk,
    input                                        axis_resetn,


    output     [C_AXIS_DATA_WIDTH - 1:0]         m_axis_tdata,
    output     [((C_AXIS_DATA_WIDTH / 8)) - 1:0] m_axis_tkeep,
    output     [C_AXIS_TUSER_WIDTH-1:0]          m_axis_tuser,
    output reg                                   m_axis_tvalid,
    input                                        m_axis_tready,
    output                                       m_axis_tlast,


    input [C_AXIS_DATA_WIDTH - 1:0]              s_axis_tdata,
    input [((C_AXIS_DATA_WIDTH / 8)) - 1:0]      s_axis_tkeep,
    input [C_AXIS_TUSER_WIDTH-1:0]               s_axis_tuser,
    input                                        s_axis_tvalid,
    output reg                                   s_axis_tready,
    input                                        s_axis_tlast

);


   function integer log2;
      input integer number;
      begin
         log2=0;
         while(2**log2<number) begin
            log2=log2+1;
         end
      end
   endfunction



   localparam WAIT_START     = 0;
   localparam RCV_WORD       = 1;
   localparam L2_IFSM_STATES = 1;


   localparam RFSM_START = 0;
   localparam RFSM_FINISH_PKT = 1;
   localparam L2_RFSM_STATES = 1;   

   localparam MAX_PKT_SIZE = 2048;
   localparam MIN_PKT_SIZE = 64;
   localparam MAX_PKTS = MAX_PKT_SIZE/MIN_PKT_SIZE;

   localparam MAX_DEPTH = MAX_PKT_SIZE/C_AXIS_DATA_WIDTH; 
   localparam L2_MAX_DEPTH = log2(MAX_DEPTH);
   localparam L2_MAX_PKTS = log2(MAX_PKTS);


   reg  d_fifo_wr_en;
   reg  d_fifo_rd_en;
   wire d_fifo_nearly_full;
   wire d_fifo_empty;

   reg  m_fifo_wr_en;
   reg  m_fifo_rd_en;
   wire m_fifo_nearly_full;
   wire m_fifo_empty;

   reg s_axis_fifo_tlast;

   reg [L2_IFSM_STATES-1:0] ifsm_state, ifsm_state_next;
   reg [L2_RFSM_STATES-1:0] rfsm_state, rfsm_state_next;



   fallthrough_small_fifo 
      #(
          .WIDTH(C_AXIS_DATA_WIDTH+C_AXIS_DATA_WIDTH/8+1),
          .MAX_DEPTH_BITS(L2_MAX_DEPTH)
      )
      data_fifo
        (.din         ({s_axis_fifo_tlast, s_axis_tkeep, s_axis_tdata}),
         .wr_en       (d_fifo_wr_en),
         .rd_en       (d_fifo_rd_en),
         .dout        ({m_axis_tlast, m_axis_tkeep, m_axis_tdata}),
         .full        (),
         .prog_full   (),
         .nearly_full (d_fifo_nearly_full),
         .empty       (d_fifo_empty),
         .reset       (~axis_resetn),
         .clk         (axis_aclk)
         );

   fallthrough_small_fifo 
      #(
          .WIDTH(C_AXIS_TUSER_WIDTH),
          .MAX_DEPTH_BITS(L2_MAX_PKTS)
      )
      meta_fifo
        (.din         (s_axis_tuser),
         .wr_en       (m_fifo_wr_en),
         .rd_en       (m_fifo_rd_en),
         .dout        (m_axis_tuser),
         .full        (),
         .prog_full   (),
         .nearly_full (m_fifo_nearly_full),
         .empty       (m_fifo_empty),
         .reset       (~axis_resetn),
         .clk         (axis_aclk)
         );



    always @(*) begin

        ifsm_state_next = ifsm_state;

        d_fifo_wr_en = 0;
        m_fifo_wr_en = 0;

        s_axis_fifo_tlast = s_axis_tlast;
        s_axis_tready = ~d_fifo_nearly_full & ~m_fifo_nearly_full;

        case(ifsm_state)
            WAIT_START: begin
                if (s_axis_tvalid & s_axis_tready) begin
                    d_fifo_wr_en = 1;
                    m_fifo_wr_en = 1;
                    ifsm_state_next = RCV_WORD;
                end
            end

            RCV_WORD: begin
                if (s_axis_tvalid & s_axis_tready) begin
                    d_fifo_wr_en = 1;
                    if (s_axis_tlast) begin
                        ifsm_state_next = WAIT_START;
                    end
                end
            end
        endcase
    end

    always @(posedge axis_aclk) begin
        if (~axis_resetn) begin
            ifsm_state <= WAIT_START;
        end
        else begin
            ifsm_state <= ifsm_state_next;
        end
    end


    always @(*) begin

        rfsm_state_next = rfsm_state;

        d_fifo_rd_en = 0;
        m_fifo_rd_en = 0;

        m_axis_tvalid = 0;

        case(rfsm_state)
            RFSM_START: begin
               if (~d_fifo_empty & ~m_fifo_empty) begin
                   m_axis_tvalid = 1;
                   if (m_axis_tready) begin
                       d_fifo_rd_en = 1;
                       m_fifo_rd_en = 1;
                       rfsm_state_next = RFSM_FINISH_PKT;
                   end
               end 
            end

            RFSM_FINISH_PKT: begin
               if (~d_fifo_empty) begin
                   m_axis_tvalid = 1;
                   if (m_axis_tready) begin
                       d_fifo_rd_en = 1;
                       if (m_axis_tlast)
                           rfsm_state_next = RFSM_START;
                   end
               end
            end
        endcase
    end

    always @(posedge axis_aclk) begin
        if (~axis_resetn) begin
            rfsm_state <= RFSM_START;
        end
        else begin
            rfsm_state <= rfsm_state_next;
        end
    end








   
endmodule