data/full_repos/permissive/125531440/core/src/main/verilog/loopback/channel.v
1: b'%Error: data/full_repos/permissive/125531440/core/src/main/verilog/loopback/channel.v:35: Cannot find include file: riffa.vh\n`include "riffa.vh" \n         ^~~~~~~~~~\n        ... Looked in:\n             data/full_repos/permissive/125531440/core/src/main/verilog/loopback,data/full_repos/permissive/125531440/riffa.vh\n             data/full_repos/permissive/125531440/core/src/main/verilog/loopback,data/full_repos/permissive/125531440/riffa.vh.v\n             data/full_repos/permissive/125531440/core/src/main/verilog/loopback,data/full_repos/permissive/125531440/riffa.vh.sv\n             riffa.vh\n             riffa.vh.v\n             riffa.vh.sv\n             obj_dir/riffa.vh\n             obj_dir/riffa.vh.v\n             obj_dir/riffa.vh.sv\n%Error: Exiting due to 1 error(s)\n'
module channel
    #(
      parameter C_DATA_WIDTH = 128,
      parameter C_MAX_READ_REQ = 2,
      parameter C_DATA_WORD_WIDTH = clog2((C_DATA_WIDTH/32)+1)
      )
    (
     input                         CLK,
     input                         RST,
     input [2:0]                   CONFIG_MAX_READ_REQUEST_SIZE,
     input [2:0]                   CONFIG_MAX_PAYLOAD_SIZE,

     input [31:0]                  PIO_DATA,
     input [C_DATA_WIDTH-1:0]      ENG_DATA,

     output                        SG_RX_BUF_RECVD,
     input                         SG_RX_BUF_LEN_VALID,
     input                         SG_RX_BUF_ADDR_HI_VALID,
     input                         SG_RX_BUF_ADDR_LO_VALID,

     output                        SG_TX_BUF_RECVD,
     input                         SG_TX_BUF_LEN_VALID,
     input                         SG_TX_BUF_ADDR_HI_VALID,
     input                         SG_TX_BUF_ADDR_LO_VALID,

     input                         TXN_RX_LEN_VALID,
     input                         TXN_RX_OFF_LAST_VALID,
     output [31:0]                 TXN_RX_DONE_LEN,
     output                        TXN_RX_DONE,
     input                         TXN_RX_DONE_ACK,

     output                        TXN_TX,
     input                         TXN_TX_ACK,
     output [31:0]                 TXN_TX_LEN,
     output [31:0]                 TXN_TX_OFF_LAST,
     output [31:0]                 TXN_TX_DONE_LEN,
     output                        TXN_TX_DONE,
     input                         TXN_TX_DONE_ACK,

     output                        RX_REQ,
     input                         RX_REQ_ACK,
     output [1:0]                  RX_REQ_TAG,
     output [63:0]                 RX_REQ_ADDR,
     output [9:0]                  RX_REQ_LEN,

     output                        TX_REQ,
     input                         TX_REQ_ACK,
     output [63:0]                 TX_ADDR,
     output [9:0]                  TX_LEN,
     output [C_DATA_WIDTH-1:0]     TX_DATA,
     input                         TX_DATA_REN,
     input                         TX_SENT,

     input [C_DATA_WORD_WIDTH-1:0] MAIN_DATA_EN,
     input                         MAIN_DONE,
     input                         MAIN_ERR,

     input [C_DATA_WORD_WIDTH-1:0] SG_RX_DATA_EN,
     input                         SG_RX_DONE,
     input                         SG_RX_ERR,

     input [C_DATA_WORD_WIDTH-1:0] SG_TX_DATA_EN,
     input                         SG_TX_DONE,
     input                         SG_TX_ERR,

     input                         CHNL_RX_CLK,
     output                        CHNL_RX,
     input                         CHNL_RX_ACK,
     output                        CHNL_RX_LAST,
     output [31:0]                 CHNL_RX_LEN,
     output [30:0]                 CHNL_RX_OFF,
     output [C_DATA_WIDTH-1:0]     CHNL_RX_DATA,
     output                        CHNL_RX_DATA_VALID,
     input                         CHNL_RX_DATA_REN,

     input                         CHNL_TX_CLK,
     input                         CHNL_TX,
     output                        CHNL_TX_ACK,
     input                         CHNL_TX_LAST,
     input [31:0]                  CHNL_TX_LEN,
     input [30:0]                  CHNL_TX_OFF,
     input [C_DATA_WIDTH-1:0]      CHNL_TX_DATA,
     input                         CHNL_TX_DATA_VALID,
     output                        CHNL_TX_DATA_REN
     );
    generate
        if(C_DATA_WIDTH == 32) begin
            channel_32 
                #(
                  .C_DATA_WIDTH(C_DATA_WIDTH), 
                  .C_MAX_READ_REQ(C_MAX_READ_REQ)
                  )
            channel 
                (

                 .SG_RX_BUF_RECVD           (SG_RX_BUF_RECVD),
                 .SG_TX_BUF_RECVD           (SG_TX_BUF_RECVD),
                 .TXN_RX_DONE_LEN           (TXN_RX_DONE_LEN[31:0]),
                 .TXN_RX_DONE               (TXN_RX_DONE),
                 .TXN_TX                    (TXN_TX),
                 .TXN_TX_LEN                (TXN_TX_LEN[31:0]),
                 .TXN_TX_OFF_LAST           (TXN_TX_OFF_LAST[31:0]),
                 .TXN_TX_DONE_LEN           (TXN_TX_DONE_LEN[31:0]),
                 .TXN_TX_DONE               (TXN_TX_DONE),
                 .RX_REQ                    (RX_REQ),
                 .RX_REQ_TAG                (RX_REQ_TAG[1:0]),
                 .RX_REQ_ADDR               (RX_REQ_ADDR[63:0]),
                 .RX_REQ_LEN                (RX_REQ_LEN[9:0]),
                 .TX_REQ                    (TX_REQ),
                 .TX_ADDR                   (TX_ADDR[63:0]),
                 .TX_LEN                    (TX_LEN[9:0]),
                 .TX_DATA                   (TX_DATA[C_DATA_WIDTH-1:0]),
                 .CHNL_RX                   (CHNL_RX),
                 .CHNL_RX_LAST              (CHNL_RX_LAST),
                 .CHNL_RX_LEN               (CHNL_RX_LEN[31:0]),
                 .CHNL_RX_OFF               (CHNL_RX_OFF[30:0]),
                 .CHNL_RX_DATA              (CHNL_RX_DATA[C_DATA_WIDTH-1:0]),
                 .CHNL_RX_DATA_VALID        (CHNL_RX_DATA_VALID),
                 .CHNL_TX_ACK               (CHNL_TX_ACK),
                 .CHNL_TX_DATA_REN          (CHNL_TX_DATA_REN),

                 .CLK                       (CLK),
                 .RST                       (RST),
                 .CONFIG_MAX_READ_REQUEST_SIZE(CONFIG_MAX_READ_REQUEST_SIZE[2:0]),
                 .CONFIG_MAX_PAYLOAD_SIZE   (CONFIG_MAX_PAYLOAD_SIZE[2:0]),
                 .PIO_DATA                  (PIO_DATA[31:0]),
                 .ENG_DATA                  (ENG_DATA[C_DATA_WIDTH-1:0]),
                 .SG_RX_BUF_LEN_VALID       (SG_RX_BUF_LEN_VALID),
                 .SG_RX_BUF_ADDR_HI_VALID   (SG_RX_BUF_ADDR_HI_VALID),
                 .SG_RX_BUF_ADDR_LO_VALID   (SG_RX_BUF_ADDR_LO_VALID),
                 .SG_TX_BUF_LEN_VALID       (SG_TX_BUF_LEN_VALID),
                 .SG_TX_BUF_ADDR_HI_VALID   (SG_TX_BUF_ADDR_HI_VALID),
                 .SG_TX_BUF_ADDR_LO_VALID   (SG_TX_BUF_ADDR_LO_VALID),
                 .TXN_RX_LEN_VALID          (TXN_RX_LEN_VALID),
                 .TXN_RX_OFF_LAST_VALID     (TXN_RX_OFF_LAST_VALID),
                 .TXN_RX_DONE_ACK           (TXN_RX_DONE_ACK),
                 .TXN_TX_ACK                (TXN_TX_ACK),
                 .TXN_TX_DONE_ACK           (TXN_TX_DONE_ACK),
                 .RX_REQ_ACK                (RX_REQ_ACK),
                 .TX_REQ_ACK                (TX_REQ_ACK),
                 .TX_DATA_REN               (TX_DATA_REN),
                 .TX_SENT                   (TX_SENT),
                 .MAIN_DATA_EN              (MAIN_DATA_EN[C_DATA_WORD_WIDTH-1:0]),
                 .MAIN_DONE                 (MAIN_DONE),
                 .MAIN_ERR                  (MAIN_ERR),
                 .SG_RX_DATA_EN             (SG_RX_DATA_EN[C_DATA_WORD_WIDTH-1:0]),
                 .SG_RX_DONE                (SG_RX_DONE),
                 .SG_RX_ERR                 (SG_RX_ERR),
                 .SG_TX_DATA_EN             (SG_TX_DATA_EN[C_DATA_WORD_WIDTH-1:0]),
                 .SG_TX_DONE                (SG_TX_DONE),
                 .SG_TX_ERR                 (SG_TX_ERR),
                 .CHNL_RX_CLK               (CHNL_RX_CLK),
                 .CHNL_RX_ACK               (CHNL_RX_ACK),
                 .CHNL_RX_DATA_REN          (CHNL_RX_DATA_REN),
                 .CHNL_TX_CLK               (CHNL_TX_CLK),
                 .CHNL_TX                   (CHNL_TX),
                 .CHNL_TX_LAST              (CHNL_TX_LAST),
                 .CHNL_TX_LEN               (CHNL_TX_LEN[31:0]),
                 .CHNL_TX_OFF               (CHNL_TX_OFF[30:0]),
                 .CHNL_TX_DATA              (CHNL_TX_DATA[C_DATA_WIDTH-1:0]),
                 .CHNL_TX_DATA_VALID        (CHNL_TX_DATA_VALID));
        end else if(C_DATA_WIDTH == 64) begin
            channel_64 
                #(
                  .C_DATA_WIDTH(C_DATA_WIDTH), 
                  .C_MAX_READ_REQ(C_MAX_READ_REQ)
                  )
            channel 
                (

                 .SG_RX_BUF_RECVD           (SG_RX_BUF_RECVD),
                 .SG_TX_BUF_RECVD           (SG_TX_BUF_RECVD),
                 .TXN_RX_DONE_LEN           (TXN_RX_DONE_LEN[31:0]),
                 .TXN_RX_DONE               (TXN_RX_DONE),
                 .TXN_TX                    (TXN_TX),
                 .TXN_TX_LEN                (TXN_TX_LEN[31:0]),
                 .TXN_TX_OFF_LAST           (TXN_TX_OFF_LAST[31:0]),
                 .TXN_TX_DONE_LEN           (TXN_TX_DONE_LEN[31:0]),
                 .TXN_TX_DONE               (TXN_TX_DONE),
                 .RX_REQ                    (RX_REQ),
                 .RX_REQ_TAG                (RX_REQ_TAG[1:0]),
                 .RX_REQ_ADDR               (RX_REQ_ADDR[63:0]),
                 .RX_REQ_LEN                (RX_REQ_LEN[9:0]),
                 .TX_REQ                    (TX_REQ),
                 .TX_ADDR                   (TX_ADDR[63:0]),
                 .TX_LEN                    (TX_LEN[9:0]),
                 .TX_DATA                   (TX_DATA[C_DATA_WIDTH-1:0]),
                 .CHNL_RX                   (CHNL_RX),
                 .CHNL_RX_LAST              (CHNL_RX_LAST),
                 .CHNL_RX_LEN               (CHNL_RX_LEN[31:0]),
                 .CHNL_RX_OFF               (CHNL_RX_OFF[30:0]),
                 .CHNL_RX_DATA              (CHNL_RX_DATA[C_DATA_WIDTH-1:0]),
                 .CHNL_RX_DATA_VALID        (CHNL_RX_DATA_VALID),
                 .CHNL_TX_ACK               (CHNL_TX_ACK),
                 .CHNL_TX_DATA_REN          (CHNL_TX_DATA_REN),

                 .CLK                       (CLK),
                 .RST                       (RST),
                 .CONFIG_MAX_READ_REQUEST_SIZE(CONFIG_MAX_READ_REQUEST_SIZE[2:0]),
                 .CONFIG_MAX_PAYLOAD_SIZE   (CONFIG_MAX_PAYLOAD_SIZE[2:0]),
                 .PIO_DATA                  (PIO_DATA[31:0]),
                 .ENG_DATA                  (ENG_DATA[C_DATA_WIDTH-1:0]),
                 .SG_RX_BUF_LEN_VALID       (SG_RX_BUF_LEN_VALID),
                 .SG_RX_BUF_ADDR_HI_VALID   (SG_RX_BUF_ADDR_HI_VALID),
                 .SG_RX_BUF_ADDR_LO_VALID   (SG_RX_BUF_ADDR_LO_VALID),
                 .SG_TX_BUF_LEN_VALID       (SG_TX_BUF_LEN_VALID),
                 .SG_TX_BUF_ADDR_HI_VALID   (SG_TX_BUF_ADDR_HI_VALID),
                 .SG_TX_BUF_ADDR_LO_VALID   (SG_TX_BUF_ADDR_LO_VALID),
                 .TXN_RX_LEN_VALID          (TXN_RX_LEN_VALID),
                 .TXN_RX_OFF_LAST_VALID     (TXN_RX_OFF_LAST_VALID),
                 .TXN_RX_DONE_ACK           (TXN_RX_DONE_ACK),
                 .TXN_TX_ACK                (TXN_TX_ACK),
                 .TXN_TX_DONE_ACK           (TXN_TX_DONE_ACK),
                 .RX_REQ_ACK                (RX_REQ_ACK),
                 .TX_REQ_ACK                (TX_REQ_ACK),
                 .TX_DATA_REN               (TX_DATA_REN),
                 .TX_SENT                   (TX_SENT),
                 .MAIN_DATA_EN              (MAIN_DATA_EN[C_DATA_WORD_WIDTH-1:0]),
                 .MAIN_DONE                 (MAIN_DONE),
                 .MAIN_ERR                  (MAIN_ERR),
                 .SG_RX_DATA_EN             (SG_RX_DATA_EN[C_DATA_WORD_WIDTH-1:0]),
                 .SG_RX_DONE                (SG_RX_DONE),
                 .SG_RX_ERR                 (SG_RX_ERR),
                 .SG_TX_DATA_EN             (SG_TX_DATA_EN[C_DATA_WORD_WIDTH-1:0]),
                 .SG_TX_DONE                (SG_TX_DONE),
                 .SG_TX_ERR                 (SG_TX_ERR),
                 .CHNL_RX_CLK               (CHNL_RX_CLK),
                 .CHNL_RX_ACK               (CHNL_RX_ACK),
                 .CHNL_RX_DATA_REN          (CHNL_RX_DATA_REN),
                 .CHNL_TX_CLK               (CHNL_TX_CLK),
                 .CHNL_TX                   (CHNL_TX),
                 .CHNL_TX_LAST              (CHNL_TX_LAST),
                 .CHNL_TX_LEN               (CHNL_TX_LEN[31:0]),
                 .CHNL_TX_OFF               (CHNL_TX_OFF[30:0]),
                 .CHNL_TX_DATA              (CHNL_TX_DATA[C_DATA_WIDTH-1:0]),
                 .CHNL_TX_DATA_VALID        (CHNL_TX_DATA_VALID));
        end else if(C_DATA_WIDTH == 128) begin
            channel_128
                #(
                  .C_DATA_WIDTH(C_DATA_WIDTH), 
                  .C_MAX_READ_REQ(C_MAX_READ_REQ)
                  )
            channel 
                (

                 .SG_RX_BUF_RECVD           (SG_RX_BUF_RECVD),
                 .SG_TX_BUF_RECVD           (SG_TX_BUF_RECVD),
                 .TXN_RX_DONE_LEN           (TXN_RX_DONE_LEN[31:0]),
                 .TXN_RX_DONE               (TXN_RX_DONE),
                 .TXN_TX                    (TXN_TX),
                 .TXN_TX_LEN                (TXN_TX_LEN[31:0]),
                 .TXN_TX_OFF_LAST           (TXN_TX_OFF_LAST[31:0]),
                 .TXN_TX_DONE_LEN           (TXN_TX_DONE_LEN[31:0]),
                 .TXN_TX_DONE               (TXN_TX_DONE),
                 .RX_REQ                    (RX_REQ),
                 .RX_REQ_TAG                (RX_REQ_TAG[1:0]),
                 .RX_REQ_ADDR               (RX_REQ_ADDR[63:0]),
                 .RX_REQ_LEN                (RX_REQ_LEN[9:0]),
                 .TX_REQ                    (TX_REQ),
                 .TX_ADDR                   (TX_ADDR[63:0]),
                 .TX_LEN                    (TX_LEN[9:0]),
                 .TX_DATA                   (TX_DATA[C_DATA_WIDTH-1:0]),
                 .CHNL_RX                   (CHNL_RX),
                 .CHNL_RX_LAST              (CHNL_RX_LAST),
                 .CHNL_RX_LEN               (CHNL_RX_LEN[31:0]),
                 .CHNL_RX_OFF               (CHNL_RX_OFF[30:0]),
                 .CHNL_RX_DATA              (CHNL_RX_DATA[C_DATA_WIDTH-1:0]),
                 .CHNL_RX_DATA_VALID        (CHNL_RX_DATA_VALID),
                 .CHNL_TX_ACK               (CHNL_TX_ACK),
                 .CHNL_TX_DATA_REN          (CHNL_TX_DATA_REN),

                 .CLK                       (CLK),
                 .RST                       (RST),
                 .CONFIG_MAX_READ_REQUEST_SIZE(CONFIG_MAX_READ_REQUEST_SIZE[2:0]),
                 .CONFIG_MAX_PAYLOAD_SIZE   (CONFIG_MAX_PAYLOAD_SIZE[2:0]),
                 .PIO_DATA                  (PIO_DATA[31:0]),
                 .ENG_DATA                  (ENG_DATA[C_DATA_WIDTH-1:0]),
                 .SG_RX_BUF_LEN_VALID       (SG_RX_BUF_LEN_VALID),
                 .SG_RX_BUF_ADDR_HI_VALID   (SG_RX_BUF_ADDR_HI_VALID),
                 .SG_RX_BUF_ADDR_LO_VALID   (SG_RX_BUF_ADDR_LO_VALID),
                 .SG_TX_BUF_LEN_VALID       (SG_TX_BUF_LEN_VALID),
                 .SG_TX_BUF_ADDR_HI_VALID   (SG_TX_BUF_ADDR_HI_VALID),
                 .SG_TX_BUF_ADDR_LO_VALID   (SG_TX_BUF_ADDR_LO_VALID),
                 .TXN_RX_LEN_VALID          (TXN_RX_LEN_VALID),
                 .TXN_RX_OFF_LAST_VALID     (TXN_RX_OFF_LAST_VALID),
                 .TXN_RX_DONE_ACK           (TXN_RX_DONE_ACK),
                 .TXN_TX_ACK                (TXN_TX_ACK),
                 .TXN_TX_DONE_ACK           (TXN_TX_DONE_ACK),
                 .RX_REQ_ACK                (RX_REQ_ACK),
                 .TX_REQ_ACK                (TX_REQ_ACK),
                 .TX_DATA_REN               (TX_DATA_REN),
                 .TX_SENT                   (TX_SENT),
                 .MAIN_DATA_EN              (MAIN_DATA_EN[C_DATA_WORD_WIDTH-1:0]),
                 .MAIN_DONE                 (MAIN_DONE),
                 .MAIN_ERR                  (MAIN_ERR),
                 .SG_RX_DATA_EN             (SG_RX_DATA_EN[C_DATA_WORD_WIDTH-1:0]),
                 .SG_RX_DONE                (SG_RX_DONE),
                 .SG_RX_ERR                 (SG_RX_ERR),
                 .SG_TX_DATA_EN             (SG_TX_DATA_EN[C_DATA_WORD_WIDTH-1:0]),
                 .SG_TX_DONE                (SG_TX_DONE),
                 .SG_TX_ERR                 (SG_TX_ERR),
                 .CHNL_RX_CLK               (CHNL_RX_CLK),
                 .CHNL_RX_ACK               (CHNL_RX_ACK),
                 .CHNL_RX_DATA_REN          (CHNL_RX_DATA_REN),
                 .CHNL_TX_CLK               (CHNL_TX_CLK),
                 .CHNL_TX                   (CHNL_TX),
                 .CHNL_TX_LAST              (CHNL_TX_LAST),
                 .CHNL_TX_LEN               (CHNL_TX_LEN[31:0]),
                 .CHNL_TX_OFF               (CHNL_TX_OFF[30:0]),
                 .CHNL_TX_DATA              (CHNL_TX_DATA[C_DATA_WIDTH-1:0]),
                 .CHNL_TX_DATA_VALID        (CHNL_TX_DATA_VALID));
        end 
    endgenerate
endmodule
module channel
    #(
      parameter C_DATA_WIDTH = 128,
      parameter C_MAX_READ_REQ = 2,
      parameter C_DATA_WORD_WIDTH = clog2((C_DATA_WIDTH/32)+1)
      )
    (
     input                         CLK,
     input                         RST,
     input [2:0]                   CONFIG_MAX_READ_REQUEST_SIZE,
     input [2:0]                   CONFIG_MAX_PAYLOAD_SIZE,

     input [31:0]                  PIO_DATA,
     input [C_DATA_WIDTH-1:0]      ENG_DATA,

     output                        SG_RX_BUF_RECVD,
     input                         SG_RX_BUF_LEN_VALID,
     input                         SG_RX_BUF_ADDR_HI_VALID,
     input                         SG_RX_BUF_ADDR_LO_VALID,

     output                        SG_TX_BUF_RECVD,
     input                         SG_TX_BUF_LEN_VALID,
     input                         SG_TX_BUF_ADDR_HI_VALID,
     input                         SG_TX_BUF_ADDR_LO_VALID,

     input                         TXN_RX_LEN_VALID,
     input                         TXN_RX_OFF_LAST_VALID,
     output [31:0]                 TXN_RX_DONE_LEN,
     output                        TXN_RX_DONE,
     input                         TXN_RX_DONE_ACK,

     output                        TXN_TX,
     input                         TXN_TX_ACK,
     output [31:0]                 TXN_TX_LEN,
     output [31:0]                 TXN_TX_OFF_LAST,
     output [31:0]                 TXN_TX_DONE_LEN,
     output                        TXN_TX_DONE,
     input                         TXN_TX_DONE_ACK,

     output                        RX_REQ,
     input                         RX_REQ_ACK,
     output [1:0]                  RX_REQ_TAG,
     output [63:0]                 RX_REQ_ADDR,
     output [9:0]                  RX_REQ_LEN,

     output                        TX_REQ,
     input                         TX_REQ_ACK,
     output [63:0]                 TX_ADDR,
     output [9:0]                  TX_LEN,
     output [C_DATA_WIDTH-1:0]     TX_DATA,
     input                         TX_DATA_REN,
     input                         TX_SENT,

     input [C_DATA_WORD_WIDTH-1:0] MAIN_DATA_EN,
     input                         MAIN_DONE,
     input                         MAIN_ERR,

     input [C_DATA_WORD_WIDTH-1:0] SG_RX_DATA_EN,
     input                         SG_RX_DONE,
     input                         SG_RX_ERR,

     input [C_DATA_WORD_WIDTH-1:0] SG_TX_DATA_EN,
     input                         SG_TX_DONE,
     input                         SG_TX_ERR,

     input                         CHNL_RX_CLK,
     output                        CHNL_RX,
     input                         CHNL_RX_ACK,
     output                        CHNL_RX_LAST,
     output [31:0]                 CHNL_RX_LEN,
     output [30:0]                 CHNL_RX_OFF,
     output [C_DATA_WIDTH-1:0]     CHNL_RX_DATA,
     output                        CHNL_RX_DATA_VALID,
     input                         CHNL_RX_DATA_REN,

     input                         CHNL_TX_CLK,
     input                         CHNL_TX,
     output                        CHNL_TX_ACK,
     input                         CHNL_TX_LAST,
     input [31:0]                  CHNL_TX_LEN,
     input [30:0]                  CHNL_TX_OFF,
     input [C_DATA_WIDTH-1:0]      CHNL_TX_DATA,
     input                         CHNL_TX_DATA_VALID,
     output                        CHNL_TX_DATA_REN
     );

    generate
        if(C_DATA_WIDTH == 32) begin
            channel_32 
                #(
                  .C_DATA_WIDTH(C_DATA_WIDTH), 
                  .C_MAX_READ_REQ(C_MAX_READ_REQ)
                  )
            channel 
                (

                 .SG_RX_BUF_RECVD           (SG_RX_BUF_RECVD),
                 .SG_TX_BUF_RECVD           (SG_TX_BUF_RECVD),
                 .TXN_RX_DONE_LEN           (TXN_RX_DONE_LEN[31:0]),
                 .TXN_RX_DONE               (TXN_RX_DONE),
                 .TXN_TX                    (TXN_TX),
                 .TXN_TX_LEN                (TXN_TX_LEN[31:0]),
                 .TXN_TX_OFF_LAST           (TXN_TX_OFF_LAST[31:0]),
                 .TXN_TX_DONE_LEN           (TXN_TX_DONE_LEN[31:0]),
                 .TXN_TX_DONE               (TXN_TX_DONE),
                 .RX_REQ                    (RX_REQ),
                 .RX_REQ_TAG                (RX_REQ_TAG[1:0]),
                 .RX_REQ_ADDR               (RX_REQ_ADDR[63:0]),
                 .RX_REQ_LEN                (RX_REQ_LEN[9:0]),
                 .TX_REQ                    (TX_REQ),
                 .TX_ADDR                   (TX_ADDR[63:0]),
                 .TX_LEN                    (TX_LEN[9:0]),
                 .TX_DATA                   (TX_DATA[C_DATA_WIDTH-1:0]),
                 .CHNL_RX                   (CHNL_RX),
                 .CHNL_RX_LAST              (CHNL_RX_LAST),
                 .CHNL_RX_LEN               (CHNL_RX_LEN[31:0]),
                 .CHNL_RX_OFF               (CHNL_RX_OFF[30:0]),
                 .CHNL_RX_DATA              (CHNL_RX_DATA[C_DATA_WIDTH-1:0]),
                 .CHNL_RX_DATA_VALID        (CHNL_RX_DATA_VALID),
                 .CHNL_TX_ACK               (CHNL_TX_ACK),
                 .CHNL_TX_DATA_REN          (CHNL_TX_DATA_REN),

                 .CLK                       (CLK),
                 .RST                       (RST),
                 .CONFIG_MAX_READ_REQUEST_SIZE(CONFIG_MAX_READ_REQUEST_SIZE[2:0]),
                 .CONFIG_MAX_PAYLOAD_SIZE   (CONFIG_MAX_PAYLOAD_SIZE[2:0]),
                 .PIO_DATA                  (PIO_DATA[31:0]),
                 .ENG_DATA                  (ENG_DATA[C_DATA_WIDTH-1:0]),
                 .SG_RX_BUF_LEN_VALID       (SG_RX_BUF_LEN_VALID),
                 .SG_RX_BUF_ADDR_HI_VALID   (SG_RX_BUF_ADDR_HI_VALID),
                 .SG_RX_BUF_ADDR_LO_VALID   (SG_RX_BUF_ADDR_LO_VALID),
                 .SG_TX_BUF_LEN_VALID       (SG_TX_BUF_LEN_VALID),
                 .SG_TX_BUF_ADDR_HI_VALID   (SG_TX_BUF_ADDR_HI_VALID),
                 .SG_TX_BUF_ADDR_LO_VALID   (SG_TX_BUF_ADDR_LO_VALID),
                 .TXN_RX_LEN_VALID          (TXN_RX_LEN_VALID),
                 .TXN_RX_OFF_LAST_VALID     (TXN_RX_OFF_LAST_VALID),
                 .TXN_RX_DONE_ACK           (TXN_RX_DONE_ACK),
                 .TXN_TX_ACK                (TXN_TX_ACK),
                 .TXN_TX_DONE_ACK           (TXN_TX_DONE_ACK),
                 .RX_REQ_ACK                (RX_REQ_ACK),
                 .TX_REQ_ACK                (TX_REQ_ACK),
                 .TX_DATA_REN               (TX_DATA_REN),
                 .TX_SENT                   (TX_SENT),
                 .MAIN_DATA_EN              (MAIN_DATA_EN[C_DATA_WORD_WIDTH-1:0]),
                 .MAIN_DONE                 (MAIN_DONE),
                 .MAIN_ERR                  (MAIN_ERR),
                 .SG_RX_DATA_EN             (SG_RX_DATA_EN[C_DATA_WORD_WIDTH-1:0]),
                 .SG_RX_DONE                (SG_RX_DONE),
                 .SG_RX_ERR                 (SG_RX_ERR),
                 .SG_TX_DATA_EN             (SG_TX_DATA_EN[C_DATA_WORD_WIDTH-1:0]),
                 .SG_TX_DONE                (SG_TX_DONE),
                 .SG_TX_ERR                 (SG_TX_ERR),
                 .CHNL_RX_CLK               (CHNL_RX_CLK),
                 .CHNL_RX_ACK               (CHNL_RX_ACK),
                 .CHNL_RX_DATA_REN          (CHNL_RX_DATA_REN),
                 .CHNL_TX_CLK               (CHNL_TX_CLK),
                 .CHNL_TX                   (CHNL_TX),
                 .CHNL_TX_LAST              (CHNL_TX_LAST),
                 .CHNL_TX_LEN               (CHNL_TX_LEN[31:0]),
                 .CHNL_TX_OFF               (CHNL_TX_OFF[30:0]),
                 .CHNL_TX_DATA              (CHNL_TX_DATA[C_DATA_WIDTH-1:0]),
                 .CHNL_TX_DATA_VALID        (CHNL_TX_DATA_VALID));
        end else if(C_DATA_WIDTH == 64) begin
            channel_64 
                #(
                  .C_DATA_WIDTH(C_DATA_WIDTH), 
                  .C_MAX_READ_REQ(C_MAX_READ_REQ)
                  )
            channel 
                (

                 .SG_RX_BUF_RECVD           (SG_RX_BUF_RECVD),
                 .SG_TX_BUF_RECVD           (SG_TX_BUF_RECVD),
                 .TXN_RX_DONE_LEN           (TXN_RX_DONE_LEN[31:0]),
                 .TXN_RX_DONE               (TXN_RX_DONE),
                 .TXN_TX                    (TXN_TX),
                 .TXN_TX_LEN                (TXN_TX_LEN[31:0]),
                 .TXN_TX_OFF_LAST           (TXN_TX_OFF_LAST[31:0]),
                 .TXN_TX_DONE_LEN           (TXN_TX_DONE_LEN[31:0]),
                 .TXN_TX_DONE               (TXN_TX_DONE),
                 .RX_REQ                    (RX_REQ),
                 .RX_REQ_TAG                (RX_REQ_TAG[1:0]),
                 .RX_REQ_ADDR               (RX_REQ_ADDR[63:0]),
                 .RX_REQ_LEN                (RX_REQ_LEN[9:0]),
                 .TX_REQ                    (TX_REQ),
                 .TX_ADDR                   (TX_ADDR[63:0]),
                 .TX_LEN                    (TX_LEN[9:0]),
                 .TX_DATA                   (TX_DATA[C_DATA_WIDTH-1:0]),
                 .CHNL_RX                   (CHNL_RX),
                 .CHNL_RX_LAST              (CHNL_RX_LAST),
                 .CHNL_RX_LEN               (CHNL_RX_LEN[31:0]),
                 .CHNL_RX_OFF               (CHNL_RX_OFF[30:0]),
                 .CHNL_RX_DATA              (CHNL_RX_DATA[C_DATA_WIDTH-1:0]),
                 .CHNL_RX_DATA_VALID        (CHNL_RX_DATA_VALID),
                 .CHNL_TX_ACK               (CHNL_TX_ACK),
                 .CHNL_TX_DATA_REN          (CHNL_TX_DATA_REN),

                 .CLK                       (CLK),
                 .RST                       (RST),
                 .CONFIG_MAX_READ_REQUEST_SIZE(CONFIG_MAX_READ_REQUEST_SIZE[2:0]),
                 .CONFIG_MAX_PAYLOAD_SIZE   (CONFIG_MAX_PAYLOAD_SIZE[2:0]),
                 .PIO_DATA                  (PIO_DATA[31:0]),
                 .ENG_DATA                  (ENG_DATA[C_DATA_WIDTH-1:0]),
                 .SG_RX_BUF_LEN_VALID       (SG_RX_BUF_LEN_VALID),
                 .SG_RX_BUF_ADDR_HI_VALID   (SG_RX_BUF_ADDR_HI_VALID),
                 .SG_RX_BUF_ADDR_LO_VALID   (SG_RX_BUF_ADDR_LO_VALID),
                 .SG_TX_BUF_LEN_VALID       (SG_TX_BUF_LEN_VALID),
                 .SG_TX_BUF_ADDR_HI_VALID   (SG_TX_BUF_ADDR_HI_VALID),
                 .SG_TX_BUF_ADDR_LO_VALID   (SG_TX_BUF_ADDR_LO_VALID),
                 .TXN_RX_LEN_VALID          (TXN_RX_LEN_VALID),
                 .TXN_RX_OFF_LAST_VALID     (TXN_RX_OFF_LAST_VALID),
                 .TXN_RX_DONE_ACK           (TXN_RX_DONE_ACK),
                 .TXN_TX_ACK                (TXN_TX_ACK),
                 .TXN_TX_DONE_ACK           (TXN_TX_DONE_ACK),
                 .RX_REQ_ACK                (RX_REQ_ACK),
                 .TX_REQ_ACK                (TX_REQ_ACK),
                 .TX_DATA_REN               (TX_DATA_REN),
                 .TX_SENT                   (TX_SENT),
                 .MAIN_DATA_EN              (MAIN_DATA_EN[C_DATA_WORD_WIDTH-1:0]),
                 .MAIN_DONE                 (MAIN_DONE),
                 .MAIN_ERR                  (MAIN_ERR),
                 .SG_RX_DATA_EN             (SG_RX_DATA_EN[C_DATA_WORD_WIDTH-1:0]),
                 .SG_RX_DONE                (SG_RX_DONE),
                 .SG_RX_ERR                 (SG_RX_ERR),
                 .SG_TX_DATA_EN             (SG_TX_DATA_EN[C_DATA_WORD_WIDTH-1:0]),
                 .SG_TX_DONE                (SG_TX_DONE),
                 .SG_TX_ERR                 (SG_TX_ERR),
                 .CHNL_RX_CLK               (CHNL_RX_CLK),
                 .CHNL_RX_ACK               (CHNL_RX_ACK),
                 .CHNL_RX_DATA_REN          (CHNL_RX_DATA_REN),
                 .CHNL_TX_CLK               (CHNL_TX_CLK),
                 .CHNL_TX                   (CHNL_TX),
                 .CHNL_TX_LAST              (CHNL_TX_LAST),
                 .CHNL_TX_LEN               (CHNL_TX_LEN[31:0]),
                 .CHNL_TX_OFF               (CHNL_TX_OFF[30:0]),
                 .CHNL_TX_DATA              (CHNL_TX_DATA[C_DATA_WIDTH-1:0]),
                 .CHNL_TX_DATA_VALID        (CHNL_TX_DATA_VALID));
        end else if(C_DATA_WIDTH == 128) begin
            channel_128
                #(
                  .C_DATA_WIDTH(C_DATA_WIDTH), 
                  .C_MAX_READ_REQ(C_MAX_READ_REQ)
                  )
            channel 
                (

                 .SG_RX_BUF_RECVD           (SG_RX_BUF_RECVD),
                 .SG_TX_BUF_RECVD           (SG_TX_BUF_RECVD),
                 .TXN_RX_DONE_LEN           (TXN_RX_DONE_LEN[31:0]),
                 .TXN_RX_DONE               (TXN_RX_DONE),
                 .TXN_TX                    (TXN_TX),
                 .TXN_TX_LEN                (TXN_TX_LEN[31:0]),
                 .TXN_TX_OFF_LAST           (TXN_TX_OFF_LAST[31:0]),
                 .TXN_TX_DONE_LEN           (TXN_TX_DONE_LEN[31:0]),
                 .TXN_TX_DONE               (TXN_TX_DONE),
                 .RX_REQ                    (RX_REQ),
                 .RX_REQ_TAG                (RX_REQ_TAG[1:0]),
                 .RX_REQ_ADDR               (RX_REQ_ADDR[63:0]),
                 .RX_REQ_LEN                (RX_REQ_LEN[9:0]),
                 .TX_REQ                    (TX_REQ),
                 .TX_ADDR                   (TX_ADDR[63:0]),
                 .TX_LEN                    (TX_LEN[9:0]),
                 .TX_DATA                   (TX_DATA[C_DATA_WIDTH-1:0]),
                 .CHNL_RX                   (CHNL_RX),
                 .CHNL_RX_LAST              (CHNL_RX_LAST),
                 .CHNL_RX_LEN               (CHNL_RX_LEN[31:0]),
                 .CHNL_RX_OFF               (CHNL_RX_OFF[30:0]),
                 .CHNL_RX_DATA              (CHNL_RX_DATA[C_DATA_WIDTH-1:0]),
                 .CHNL_RX_DATA_VALID        (CHNL_RX_DATA_VALID),
                 .CHNL_TX_ACK               (CHNL_TX_ACK),
                 .CHNL_TX_DATA_REN          (CHNL_TX_DATA_REN),

                 .CLK                       (CLK),
                 .RST                       (RST),
                 .CONFIG_MAX_READ_REQUEST_SIZE(CONFIG_MAX_READ_REQUEST_SIZE[2:0]),
                 .CONFIG_MAX_PAYLOAD_SIZE   (CONFIG_MAX_PAYLOAD_SIZE[2:0]),
                 .PIO_DATA                  (PIO_DATA[31:0]),
                 .ENG_DATA                  (ENG_DATA[C_DATA_WIDTH-1:0]),
                 .SG_RX_BUF_LEN_VALID       (SG_RX_BUF_LEN_VALID),
                 .SG_RX_BUF_ADDR_HI_VALID   (SG_RX_BUF_ADDR_HI_VALID),
                 .SG_RX_BUF_ADDR_LO_VALID   (SG_RX_BUF_ADDR_LO_VALID),
                 .SG_TX_BUF_LEN_VALID       (SG_TX_BUF_LEN_VALID),
                 .SG_TX_BUF_ADDR_HI_VALID   (SG_TX_BUF_ADDR_HI_VALID),
                 .SG_TX_BUF_ADDR_LO_VALID   (SG_TX_BUF_ADDR_LO_VALID),
                 .TXN_RX_LEN_VALID          (TXN_RX_LEN_VALID),
                 .TXN_RX_OFF_LAST_VALID     (TXN_RX_OFF_LAST_VALID),
                 .TXN_RX_DONE_ACK           (TXN_RX_DONE_ACK),
                 .TXN_TX_ACK                (TXN_TX_ACK),
                 .TXN_TX_DONE_ACK           (TXN_TX_DONE_ACK),
                 .RX_REQ_ACK                (RX_REQ_ACK),
                 .TX_REQ_ACK                (TX_REQ_ACK),
                 .TX_DATA_REN               (TX_DATA_REN),
                 .TX_SENT                   (TX_SENT),
                 .MAIN_DATA_EN              (MAIN_DATA_EN[C_DATA_WORD_WIDTH-1:0]),
                 .MAIN_DONE                 (MAIN_DONE),
                 .MAIN_ERR                  (MAIN_ERR),
                 .SG_RX_DATA_EN             (SG_RX_DATA_EN[C_DATA_WORD_WIDTH-1:0]),
                 .SG_RX_DONE                (SG_RX_DONE),
                 .SG_RX_ERR                 (SG_RX_ERR),
                 .SG_TX_DATA_EN             (SG_TX_DATA_EN[C_DATA_WORD_WIDTH-1:0]),
                 .SG_TX_DONE                (SG_TX_DONE),
                 .SG_TX_ERR                 (SG_TX_ERR),
                 .CHNL_RX_CLK               (CHNL_RX_CLK),
                 .CHNL_RX_ACK               (CHNL_RX_ACK),
                 .CHNL_RX_DATA_REN          (CHNL_RX_DATA_REN),
                 .CHNL_TX_CLK               (CHNL_TX_CLK),
                 .CHNL_TX                   (CHNL_TX),
                 .CHNL_TX_LAST              (CHNL_TX_LAST),
                 .CHNL_TX_LEN               (CHNL_TX_LEN[31:0]),
                 .CHNL_TX_OFF               (CHNL_TX_OFF[30:0]),
                 .CHNL_TX_DATA              (CHNL_TX_DATA[C_DATA_WIDTH-1:0]),
                 .CHNL_TX_DATA_VALID        (CHNL_TX_DATA_VALID));
        end 
    endgenerate
endmodule