data/full_repos/permissive/498471995/sume/felix/simple_sume_switch/test/ip_repo/std/cores/nf_riffa_dma_v1_0_0/hdl/riffa/tx_data_shift.v
1: b'%Error: data/full_repos/permissive/498471995/sume/felix/simple_sume_switch/test/ip_repo/std/cores/nf_riffa_dma_v1_0_0/hdl/riffa/tx_data_shift.v:72: Cannot find include file: trellis.vh\n`include "trellis.vh" \n         ^~~~~~~~~~~~\n        ... Looked in:\n             data/full_repos/permissive/498471995/sume/felix/simple_sume_switch/test/ip_repo/std/cores/nf_riffa_dma_v1_0_0/hdl/riffa,data/full_repos/permissive/498471995/trellis.vh\n             data/full_repos/permissive/498471995/sume/felix/simple_sume_switch/test/ip_repo/std/cores/nf_riffa_dma_v1_0_0/hdl/riffa,data/full_repos/permissive/498471995/trellis.vh.v\n             data/full_repos/permissive/498471995/sume/felix/simple_sume_switch/test/ip_repo/std/cores/nf_riffa_dma_v1_0_0/hdl/riffa,data/full_repos/permissive/498471995/trellis.vh.sv\n             trellis.vh\n             trellis.vh.v\n             trellis.vh.sv\n             obj_dir/trellis.vh\n             obj_dir/trellis.vh.v\n             obj_dir/trellis.vh.sv\n%Error: Exiting due to 1 error(s)\n'
module tx_data_shift
    #(
      parameter C_PIPELINE_OUTPUT = 1,
      parameter C_PIPELINE_INPUT = 1,
      parameter C_DATA_WIDTH = 128,
      parameter C_VENDOR = "ALTERA"
      )
    (

     input                               CLK,


     input                               RST_IN,


     input                               WR_TX_DATA_VALID,
     input [C_DATA_WIDTH-1:0]            WR_TX_DATA,
     input                               WR_TX_DATA_START_FLAG,
     input [clog2s(C_DATA_WIDTH/32)-1:0] WR_TX_DATA_START_OFFSET,
     input                               WR_TX_DATA_END_FLAG,
     input [clog2s(C_DATA_WIDTH/32)-1:0] WR_TX_DATA_END_OFFSET,
     output                              WR_TX_DATA_READY,


     input                               RD_TX_DATA_READY,
     output [C_DATA_WIDTH-1:0]           RD_TX_DATA,
     output                              RD_TX_DATA_START_FLAG,
     output [(C_DATA_WIDTH/32)-1:0]      RD_TX_DATA_WORD_VALID,
     output [(C_DATA_WIDTH/32)-1:0]      RD_TX_DATA_END_FLAGS,
     output                              RD_TX_DATA_VALID
     );
    localparam C_ROTATE_BITS = clog2s(C_DATA_WIDTH/32);
    localparam C_NUM_MUXES = (C_DATA_WIDTH/32);
    localparam C_SELECT_WIDTH = C_DATA_WIDTH/32;
    localparam C_MASK_WIDTH = C_DATA_WIDTH/32;
    localparam C_AGGREGATE_WIDTH = C_DATA_WIDTH;
    
    genvar                               i;

    wire                                 wWrTxDataValid;
    wire [C_DATA_WIDTH-1:0]              wWrTxData;
    wire                                 wWrTxDataStartFlag;
    wire [clog2s(C_DATA_WIDTH/32)-1:0]   wWrTxDataStartOffset;
    wire                                 wWrTxDataEndFlag;
    wire [clog2s(C_DATA_WIDTH/32)-1:0]   wWrTxDataEndOffset;
    wire [(C_DATA_WIDTH/32)-1:0]         wWrTxEndFlagMask;
    wire [(C_DATA_WIDTH/32)-1:0]         wWrTxDataEndFlags;
    wire                                 wWrTxDataReady;

    wire                                 wRdTxDataReady;
    wire [C_DATA_WIDTH-1:0]              wRdTxData;
    wire                                 wRdTxDataStartFlag;
    wire [(C_DATA_WIDTH/32)-1:0]         wRdTxDataEndFlags;
    wire [(C_DATA_WIDTH/32)-1:0]         wRdTxDataWordValid;
    wire [(C_DATA_WIDTH/32)-1:0]         wRdTxStartFlagMask;
    wire [(C_DATA_WIDTH/32)-1:0]         wRdTxEndFlagMask;
    wire                                 wRdTxDataValid;



    wire [C_SELECT_WIDTH-1:0]            wSelectDefault[C_NUM_MUXES-1:0]; 


    wire [C_SELECT_WIDTH-1:0]            wSelectRotated[C_NUM_MUXES-1:0];

    reg [C_SELECT_WIDTH-1:0]             rMuxSelect[C_NUM_MUXES-1:0],_rMuxSelect[C_NUM_MUXES-1:0];
    reg [clog2s(C_DATA_WIDTH/32)-1:0]    rStartOffset,_rStartOffset;

    assign wWrTxDataReady = wRdTxDataReady;

    assign wRdTxStartFlagMask = wWrTxDataStartFlag ? 
                                {(C_DATA_WIDTH/32){1'b1}} >> wWrTxDataStartOffset:
                                {(C_DATA_WIDTH/32){1'b1}};
    assign wRdTxDataWordValid = wRdTxEndFlagMask & wRdTxStartFlagMask;
    assign wRdTxDataStartFlag = wWrTxDataStartFlag;
    assign wRdTxDataValid = wWrTxDataValid;

    generate
        for (i = 0; i < C_NUM_MUXES; i = i + 1) begin : gen_mux_default
            assign wSelectDefault[i] = (1 << i);
        end
    endgenerate

    always @(*) begin
        _rStartOffset = WR_TX_DATA_START_OFFSET;
    end

    always @(posedge CLK) begin
        if(WR_TX_DATA_READY & WR_TX_DATA_START_FLAG & WR_TX_DATA_VALID) begin
            rStartOffset <= _rStartOffset;
        end
    end

    generate
        for (i = 0; i < C_NUM_MUXES; i = i + 1) begin : gen_mux_select
            always @(*) begin
                _rMuxSelect[i] = wSelectRotated[i];
            end

            always @(posedge CLK) begin
                if(WR_TX_DATA_READY & WR_TX_DATA_START_FLAG) begin
                    rMuxSelect[i] <= _rMuxSelect[i];
                end
            end
        end
    endgenerate
    
    pipeline
        #(
          .C_WIDTH                      (C_DATA_WIDTH+2*(1+clog2s(C_DATA_WIDTH/32))),
          .C_USE_MEMORY                 (0),
          .C_DEPTH                      (C_PIPELINE_INPUT?1:0)
)
    input_register
        (

         .WR_DATA_READY                 (WR_TX_DATA_READY),
         .RD_DATA                       ({wWrTxData,wWrTxDataStartFlag,wWrTxDataStartOffset,wWrTxDataEndFlag,wWrTxDataEndOffset}),
         .RD_DATA_VALID                 (wWrTxDataValid),

         .WR_DATA                       ({WR_TX_DATA,WR_TX_DATA_START_FLAG,WR_TX_DATA_START_OFFSET,
                                          WR_TX_DATA_END_FLAG,WR_TX_DATA_END_OFFSET}),
         .WR_DATA_VALID                 (WR_TX_DATA_VALID),
         .RD_DATA_READY                 (wWrTxDataReady),


         .CLK                           (CLK),
         .RST_IN                        (RST_IN));
    

    pipeline
        #(
          .C_WIDTH                      (C_DATA_WIDTH + 2*C_MASK_WIDTH + 1),
          .C_USE_MEMORY                 (0),
          .C_DEPTH                      ((C_PIPELINE_OUTPUT > 1) ? 1 : 0)
)
    output_register
        (

         .WR_DATA_READY                 (wRdTxDataReady),
         .RD_DATA                       ({RD_TX_DATA,RD_TX_DATA_START_FLAG,
                                          RD_TX_DATA_END_FLAGS,RD_TX_DATA_WORD_VALID}),
         .RD_DATA_VALID                 (RD_TX_DATA_VALID),

         .WR_DATA                       ({wRdTxData,wRdTxDataStartFlag,
                                          wRdTxDataEndFlags,wRdTxDataWordValid}),
         .WR_DATA_VALID                 (wRdTxDataValid),
         .RD_DATA_READY                 (RD_TX_DATA_READY),


         .CLK                           (CLK),
         .RST_IN                        (RST_IN));

    offset_to_mask
        #(
          .C_MASK_SWAP                  (0),


          .C_MASK_WIDTH                 (C_MASK_WIDTH))
    eof_convert
        (

         .MASK                      (wWrTxEndFlagMask),

         .OFFSET_ENABLE             (wWrTxDataEndFlag),
         .OFFSET                    (wWrTxDataEndOffset)
);
    rotate
        #(

          .C_DIRECTION                  ("RIGHT"),
          .C_WIDTH                      (C_DATA_WIDTH/32)
)
    em_rotate_inst
        (

         .RD_DATA                       (wRdTxEndFlagMask),

         .WR_DATA                       (wWrTxEndFlagMask),
         .WR_SHIFTAMT                   (rStartOffset[clog2s(C_DATA_WIDTH/32)-1:0])
);


    offset_flag_to_one_hot
        #(
          .C_WIDTH                      (C_DATA_WIDTH/32)
)
    ef_onehot_inst
        (

         .RD_ONE_HOT                    (wWrTxDataEndFlags),

         .WR_OFFSET                     (wWrTxDataEndOffset[clog2s(C_DATA_WIDTH/32)-1:0]),
         .WR_FLAG                       (wWrTxDataEndFlag)
);

    rotate
        #(

          .C_DIRECTION                  ("RIGHT"),
          .C_WIDTH                      (C_DATA_WIDTH/32)
)
    ef_rotate_inst
        (

         .RD_DATA                       (wRdTxDataEndFlags),

         .WR_DATA                       (wWrTxDataEndFlags),
         .WR_SHIFTAMT                   (rStartOffset[clog2s(C_DATA_WIDTH/32)-1:0])
);

    generate
        for (i = 0; i < C_NUM_MUXES; i = i + 1) begin : gen_rotates
            rotate
                 #(

                   .C_DIRECTION         ("LEFT"),
                   .C_WIDTH             ((C_DATA_WIDTH/32))
)
            select_rotate_inst_
                 (

                  .RD_DATA               (wSelectRotated[i]),

                  .WR_DATA               (wSelectDefault[i]),
                  .WR_SHIFTAMT           (WR_TX_DATA_START_OFFSET[C_ROTATE_BITS-1:0])
);
        end
    endgenerate

    generate
        for (i = 0; i < C_DATA_WIDTH/32; i = i + 1) begin : gen_multiplexers
            one_hot_mux
                 #(
                   .C_DATA_WIDTH        (32),


                   .C_SELECT_WIDTH      (C_SELECT_WIDTH),
                   .C_AGGREGATE_WIDTH   (C_AGGREGATE_WIDTH))
            mux_inst_
                 (

                  .ONE_HOT_SELECT       (rMuxSelect[i]),

                  .ONE_HOT_OUTPUT       (wRdTxData[32*i +: 32]),
                  .ONE_HOT_INPUTS       (wWrTxData)
);
        end
    endgenerate
endmodule
module tx_data_shift
    #(
      parameter C_PIPELINE_OUTPUT = 1,
      parameter C_PIPELINE_INPUT = 1,
      parameter C_DATA_WIDTH = 128,
      parameter C_VENDOR = "ALTERA"
      )
    (

     input                               CLK,


     input                               RST_IN,


     input                               WR_TX_DATA_VALID,
     input [C_DATA_WIDTH-1:0]            WR_TX_DATA,
     input                               WR_TX_DATA_START_FLAG,
     input [clog2s(C_DATA_WIDTH/32)-1:0] WR_TX_DATA_START_OFFSET,
     input                               WR_TX_DATA_END_FLAG,
     input [clog2s(C_DATA_WIDTH/32)-1:0] WR_TX_DATA_END_OFFSET,
     output                              WR_TX_DATA_READY,


     input                               RD_TX_DATA_READY,
     output [C_DATA_WIDTH-1:0]           RD_TX_DATA,
     output                              RD_TX_DATA_START_FLAG,
     output [(C_DATA_WIDTH/32)-1:0]      RD_TX_DATA_WORD_VALID,
     output [(C_DATA_WIDTH/32)-1:0]      RD_TX_DATA_END_FLAGS,
     output                              RD_TX_DATA_VALID
     );

    localparam C_ROTATE_BITS = clog2s(C_DATA_WIDTH/32);
    localparam C_NUM_MUXES = (C_DATA_WIDTH/32);
    localparam C_SELECT_WIDTH = C_DATA_WIDTH/32;
    localparam C_MASK_WIDTH = C_DATA_WIDTH/32;
    localparam C_AGGREGATE_WIDTH = C_DATA_WIDTH;
    
    genvar                               i;

    wire                                 wWrTxDataValid;
    wire [C_DATA_WIDTH-1:0]              wWrTxData;
    wire                                 wWrTxDataStartFlag;
    wire [clog2s(C_DATA_WIDTH/32)-1:0]   wWrTxDataStartOffset;
    wire                                 wWrTxDataEndFlag;
    wire [clog2s(C_DATA_WIDTH/32)-1:0]   wWrTxDataEndOffset;
    wire [(C_DATA_WIDTH/32)-1:0]         wWrTxEndFlagMask;
    wire [(C_DATA_WIDTH/32)-1:0]         wWrTxDataEndFlags;
    wire                                 wWrTxDataReady;

    wire                                 wRdTxDataReady;
    wire [C_DATA_WIDTH-1:0]              wRdTxData;
    wire                                 wRdTxDataStartFlag;
    wire [(C_DATA_WIDTH/32)-1:0]         wRdTxDataEndFlags;
    wire [(C_DATA_WIDTH/32)-1:0]         wRdTxDataWordValid;
    wire [(C_DATA_WIDTH/32)-1:0]         wRdTxStartFlagMask;
    wire [(C_DATA_WIDTH/32)-1:0]         wRdTxEndFlagMask;
    wire                                 wRdTxDataValid;



    wire [C_SELECT_WIDTH-1:0]            wSelectDefault[C_NUM_MUXES-1:0]; 


    wire [C_SELECT_WIDTH-1:0]            wSelectRotated[C_NUM_MUXES-1:0];

    reg [C_SELECT_WIDTH-1:0]             rMuxSelect[C_NUM_MUXES-1:0],_rMuxSelect[C_NUM_MUXES-1:0];
    reg [clog2s(C_DATA_WIDTH/32)-1:0]    rStartOffset,_rStartOffset;

    assign wWrTxDataReady = wRdTxDataReady;

    assign wRdTxStartFlagMask = wWrTxDataStartFlag ? 
                                {(C_DATA_WIDTH/32){1'b1}} >> wWrTxDataStartOffset:
                                {(C_DATA_WIDTH/32){1'b1}};
    assign wRdTxDataWordValid = wRdTxEndFlagMask & wRdTxStartFlagMask;
    assign wRdTxDataStartFlag = wWrTxDataStartFlag;
    assign wRdTxDataValid = wWrTxDataValid;

    generate
        for (i = 0; i < C_NUM_MUXES; i = i + 1) begin : gen_mux_default
            assign wSelectDefault[i] = (1 << i);
        end
    endgenerate

    always @(*) begin
        _rStartOffset = WR_TX_DATA_START_OFFSET;
    end

    always @(posedge CLK) begin
        if(WR_TX_DATA_READY & WR_TX_DATA_START_FLAG & WR_TX_DATA_VALID) begin
            rStartOffset <= _rStartOffset;
        end
    end

    generate
        for (i = 0; i < C_NUM_MUXES; i = i + 1) begin : gen_mux_select
            always @(*) begin
                _rMuxSelect[i] = wSelectRotated[i];
            end

            always @(posedge CLK) begin
                if(WR_TX_DATA_READY & WR_TX_DATA_START_FLAG) begin
                    rMuxSelect[i] <= _rMuxSelect[i];
                end
            end
        end
    endgenerate
    
    pipeline
        #(
          .C_WIDTH                      (C_DATA_WIDTH+2*(1+clog2s(C_DATA_WIDTH/32))),
          .C_USE_MEMORY                 (0),
          .C_DEPTH                      (C_PIPELINE_INPUT?1:0)
)
    input_register
        (

         .WR_DATA_READY                 (WR_TX_DATA_READY),
         .RD_DATA                       ({wWrTxData,wWrTxDataStartFlag,wWrTxDataStartOffset,wWrTxDataEndFlag,wWrTxDataEndOffset}),
         .RD_DATA_VALID                 (wWrTxDataValid),

         .WR_DATA                       ({WR_TX_DATA,WR_TX_DATA_START_FLAG,WR_TX_DATA_START_OFFSET,
                                          WR_TX_DATA_END_FLAG,WR_TX_DATA_END_OFFSET}),
         .WR_DATA_VALID                 (WR_TX_DATA_VALID),
         .RD_DATA_READY                 (wWrTxDataReady),


         .CLK                           (CLK),
         .RST_IN                        (RST_IN));
    

    pipeline
        #(
          .C_WIDTH                      (C_DATA_WIDTH + 2*C_MASK_WIDTH + 1),
          .C_USE_MEMORY                 (0),
          .C_DEPTH                      ((C_PIPELINE_OUTPUT > 1) ? 1 : 0)
)
    output_register
        (

         .WR_DATA_READY                 (wRdTxDataReady),
         .RD_DATA                       ({RD_TX_DATA,RD_TX_DATA_START_FLAG,
                                          RD_TX_DATA_END_FLAGS,RD_TX_DATA_WORD_VALID}),
         .RD_DATA_VALID                 (RD_TX_DATA_VALID),

         .WR_DATA                       ({wRdTxData,wRdTxDataStartFlag,
                                          wRdTxDataEndFlags,wRdTxDataWordValid}),
         .WR_DATA_VALID                 (wRdTxDataValid),
         .RD_DATA_READY                 (RD_TX_DATA_READY),


         .CLK                           (CLK),
         .RST_IN                        (RST_IN));

    offset_to_mask
        #(
          .C_MASK_SWAP                  (0),


          .C_MASK_WIDTH                 (C_MASK_WIDTH))
    eof_convert
        (

         .MASK                      (wWrTxEndFlagMask),

         .OFFSET_ENABLE             (wWrTxDataEndFlag),
         .OFFSET                    (wWrTxDataEndOffset)
);
    rotate
        #(

          .C_DIRECTION                  ("RIGHT"),
          .C_WIDTH                      (C_DATA_WIDTH/32)
)
    em_rotate_inst
        (

         .RD_DATA                       (wRdTxEndFlagMask),

         .WR_DATA                       (wWrTxEndFlagMask),
         .WR_SHIFTAMT                   (rStartOffset[clog2s(C_DATA_WIDTH/32)-1:0])
);


    offset_flag_to_one_hot
        #(
          .C_WIDTH                      (C_DATA_WIDTH/32)
)
    ef_onehot_inst
        (

         .RD_ONE_HOT                    (wWrTxDataEndFlags),

         .WR_OFFSET                     (wWrTxDataEndOffset[clog2s(C_DATA_WIDTH/32)-1:0]),
         .WR_FLAG                       (wWrTxDataEndFlag)
);

    rotate
        #(

          .C_DIRECTION                  ("RIGHT"),
          .C_WIDTH                      (C_DATA_WIDTH/32)
)
    ef_rotate_inst
        (

         .RD_DATA                       (wRdTxDataEndFlags),

         .WR_DATA                       (wWrTxDataEndFlags),
         .WR_SHIFTAMT                   (rStartOffset[clog2s(C_DATA_WIDTH/32)-1:0])
);

    generate
        for (i = 0; i < C_NUM_MUXES; i = i + 1) begin : gen_rotates
            rotate
                 #(

                   .C_DIRECTION         ("LEFT"),
                   .C_WIDTH             ((C_DATA_WIDTH/32))
)
            select_rotate_inst_
                 (

                  .RD_DATA               (wSelectRotated[i]),

                  .WR_DATA               (wSelectDefault[i]),
                  .WR_SHIFTAMT           (WR_TX_DATA_START_OFFSET[C_ROTATE_BITS-1:0])
);
        end
    endgenerate

    generate
        for (i = 0; i < C_DATA_WIDTH/32; i = i + 1) begin : gen_multiplexers
            one_hot_mux
                 #(
                   .C_DATA_WIDTH        (32),


                   .C_SELECT_WIDTH      (C_SELECT_WIDTH),
                   .C_AGGREGATE_WIDTH   (C_AGGREGATE_WIDTH))
            mux_inst_
                 (

                  .ONE_HOT_SELECT       (rMuxSelect[i]),

                  .ONE_HOT_OUTPUT       (wRdTxData[32*i +: 32]),
                  .ONE_HOT_INPUTS       (wWrTxData)
);
        end
    endgenerate
endmodule