data/full_repos/permissive/489147019/Testcases/mempool/rtl/cluster_interconnect/rtl/peripheral_interco/ArbitrationTree_PE.sv
1: b'%Error: data/full_repos/permissive/489147019/Testcases/mempool/rtl/cluster_interconnect/rtl/peripheral_interco/ArbitrationTree_PE.sv:48: Cannot find include file: parameters.v\n`include "parameters.v" \n         ^~~~~~~~~~~~~~\n        ... Looked in:\n             data/full_repos/permissive/489147019/Testcases/mempool/rtl/cluster_interconnect/rtl/peripheral_interco,data/full_repos/permissive/489147019/parameters.v\n             data/full_repos/permissive/489147019/Testcases/mempool/rtl/cluster_interconnect/rtl/peripheral_interco,data/full_repos/permissive/489147019/parameters.v.v\n             data/full_repos/permissive/489147019/Testcases/mempool/rtl/cluster_interconnect/rtl/peripheral_interco,data/full_repos/permissive/489147019/parameters.v.sv\n             parameters.v\n             parameters.v.v\n             parameters.v.sv\n             obj_dir/parameters.v\n             obj_dir/parameters.v.v\n             obj_dir/parameters.v.sv\n%Error: data/full_repos/permissive/489147019/Testcases/mempool/rtl/cluster_interconnect/rtl/peripheral_interco/ArbitrationTree_PE.sv:90: Define or directive not defined: \'`log2\'\n    localparam LOG_MASTER       = `log2(N_MASTER-1);\n                                  ^~~~~\n%Error: Exiting due to 2 error(s)\n'
module ArbitrationTree_PE
#(
    parameter ADDR_WIDTH = 32,
    parameter ID_WIDTH   = 20,
    parameter N_MASTER   = 16,
    parameter DATA_WIDTH = 32,
    parameter BE_WIDTH   = DATA_WIDTH/8,
    parameter MAX_COUNT  = N_MASTER
) 
(
    input  logic                                 clk,
    input  logic                                 rst_n,


    input  logic [N_MASTER-1:0]                  data_req_i,
    input  logic [N_MASTER-1:0][ADDR_WIDTH-1:0]  data_add_i,
    input  logic [N_MASTER-1:0]                  data_wen_i,
    input  logic [N_MASTER-1:0][DATA_WIDTH-1:0]  data_wdata_i,
    input  logic [N_MASTER-1:0][BE_WIDTH-1:0]    data_be_i,
    input  logic [N_MASTER-1:0][ID_WIDTH-1:0]    data_ID_i,
`ifdef GNT_BASED_FC
    output logic [N_MASTER-1:0]                  data_gnt_o,
`else
    output logic [N_MASTER-1:0]                  data_stall_o,
`endif

    output logic                                 data_req_o,
    output logic [ADDR_WIDTH-1:0]                data_add_o,
    output logic                                 data_wen_o,
    output logic [DATA_WIDTH-1:0]                data_wdata_o,
    output logic [BE_WIDTH-1:0]                  data_be_o,
    output logic [ID_WIDTH-1:0]                  data_ID_o,
`ifdef GNT_BASED_FC
    input  logic                                 data_gnt_i
`else
    input  logic                                 data_stall_i
`endif
);

    localparam LOG_MASTER       = `log2(N_MASTER-1);
    localparam N_WIRE           =  N_MASTER - 2;

    logic [LOG_MASTER-1:0]      RR_FLAG;

    genvar j,k;

    generate
      if(N_MASTER == 2)
      begin : INCR

                FanInPrimitive_Req_PE 
                #( 
                        .ADDR_WIDTH ( ADDR_WIDTH ), 
                        .ID_WIDTH   ( ID_WIDTH   ),
                        .DATA_WIDTH ( DATA_WIDTH ),
                        .BE_WIDTH   ( BE_WIDTH   )
                )
                i_FanInPrimitive_Req_PE
                (
                  .RR_FLAG(RR_FLAG),

                  .data_wdata_o  ( data_wdata_o    ),
                  .data_add_o    ( data_add_o      ),
                  .data_req_o    ( data_req_o      ),
                  .data_wen_o    ( data_wen_o      ),
                  .data_ID_o     ( data_ID_o       ),
                  .data_be_o     ( data_be_o       ),
            `ifdef GNT_BASED_FC
                  .data_gnt_i    ( data_gnt_i      )
            `else
                  .data_stall_i  ( data_stall_i    )
            `endif
                  );
      end
      else
      begin : BINARY_TREE



          logic [N_WIRE-1:0][DATA_WIDTH-1:0]      data_wdata_LEVEL;
          logic [N_WIRE-1:0][ADDR_WIDTH-1:0]      data_add_LEVEL;
          logic [N_WIRE-1:0]                      data_req_LEVEL;
          logic [N_WIRE-1:0]                      data_wen_LEVEL;
          logic [N_WIRE-1:0][ID_WIDTH-1:0]        data_ID_LEVEL;
          logic [N_WIRE-1:0][BE_WIDTH-1:0]        data_be_LEVEL;
      `ifdef GNT_BASED_FC
          logic [N_WIRE-1:0]                      data_gnt_LEVEL;
      `else
          logic [N_WIRE-1:0]                      data_stall_LEVEL;
      `endif

            for(j=0; j < LOG_MASTER; j++)
            begin : STAGE
              for(k=0; k<2**j; k=k+1)
                begin : INCR_VERT
                  if (j == 0 )
                  begin : LAST_NODE
                    FanInPrimitive_Req_PE 
                    #( 
                        .ADDR_WIDTH ( ADDR_WIDTH ), 
                        .ID_WIDTH   ( ID_WIDTH   ),
                        .DATA_WIDTH ( DATA_WIDTH ),
                        .BE_WIDTH   ( BE_WIDTH   )
                    )
                    i_FanInPrimitive_Req_PE
                    (
                        .RR_FLAG       ( RR_FLAG[LOG_MASTER-j-1] ),

                        .data_wdata0_i ( data_wdata_LEVEL[2*k]   ),
                        .data_wdata1_i ( data_wdata_LEVEL[2*k+1] ),
                        .data_add0_i   ( data_add_LEVEL  [2*k]   ),
                        .data_add1_i   ( data_add_LEVEL  [2*k+1] ),
                        .data_req0_i   ( data_req_LEVEL  [2*k]   ),
                        .data_req1_i   ( data_req_LEVEL  [2*k+1] ),
                        .data_wen0_i   ( data_wen_LEVEL  [2*k]   ),
                        .data_wen1_i   ( data_wen_LEVEL  [2*k+1] ),
                        .data_ID0_i    ( data_ID_LEVEL   [2*k]   ),
                        .data_ID1_i    ( data_ID_LEVEL   [2*k+1] ),
                        .data_be0_i    ( data_be_LEVEL   [2*k]   ),
                        .data_be1_i    ( data_be_LEVEL   [2*k+1] ),
                    `ifdef GNT_BASED_FC
                        .data_gnt0_o   ( data_gnt_LEVEL  [2*k]   ),
                        .data_gnt1_o   ( data_gnt_LEVEL  [2*k+1] ),
                    `else
                        .data_stall0_o ( data_stall_LEVEL[2*k]   ),
                        .data_stall1_o ( data_stall_LEVEL[2*k+1] ),
                    `endif

                        .data_wdata_o  ( data_wdata_o            ),
                        .data_add_o    ( data_add_o              ),
                        .data_req_o    ( data_req_o              ),
                        .data_wen_o    ( data_wen_o              ),
                        .data_ID_o     ( data_ID_o               ),
                        .data_be_o     ( data_be_o               ),
                    `ifdef GNT_BASED_FC
                        .data_gnt_i    ( data_gnt_i              )
                    `else
                        .data_stall_i  ( data_stall_i            )
                    `endif
                    );
                  end 
                  else if ( j < LOG_MASTER - 1)
                        begin : MIDDLE_NODES
                          FanInPrimitive_Req_PE 
                          #( 
                              .ADDR_WIDTH ( ADDR_WIDTH ), 
                              .ID_WIDTH   ( ID_WIDTH   ),
                              .DATA_WIDTH ( DATA_WIDTH ),
                              .BE_WIDTH   ( BE_WIDTH   )
                          )
                          i_FanInPrimitive_Req_PE 
                          (
                              .RR_FLAG(RR_FLAG[LOG_MASTER-j-1]),

                              .data_wdata0_i (data_wdata_LEVEL [((2**j)*2-2) + 2*k]     ),
                              .data_wdata1_i (data_wdata_LEVEL [((2**j)*2-2) + 2*k +1]  ),
                              .data_add0_i   (data_add_LEVEL   [((2**j)*2-2) + 2*k]     ),
                              .data_add1_i   (data_add_LEVEL   [((2**j)*2-2) + 2*k+1]   ),
                              .data_req0_i   (data_req_LEVEL   [((2**j)*2-2) + 2*k]     ),
                              .data_req1_i   (data_req_LEVEL   [((2**j)*2-2) + 2*k+1]   ),
                              .data_wen0_i   (data_wen_LEVEL   [((2**j)*2-2) + 2*k]     ),
                              .data_wen1_i   (data_wen_LEVEL   [((2**j)*2-2) + 2*k+1]   ),
                              .data_ID0_i    (data_ID_LEVEL    [((2**j)*2-2) + 2*k]     ),
                              .data_ID1_i    (data_ID_LEVEL    [((2**j)*2-2) + 2*k+1]   ),
                              .data_be0_i    (data_be_LEVEL    [((2**j)*2-2) + 2*k]     ),
                              .data_be1_i    (data_be_LEVEL    [((2**j)*2-2) + 2*k+1]   ),
                        `ifdef GNT_BASED_FC
                              .data_gnt0_o   (data_gnt_LEVEL   [((2**j)*2-2) + 2*k]     ),
                              .data_gnt1_o   (data_gnt_LEVEL   [((2**j)*2-2) + 2*k+1]   ),
                        `else
                              .data_stall0_o (data_stall_LEVEL [((2**j)*2-2) + 2*k]     ),
                              .data_stall1_o (data_stall_LEVEL [((2**j)*2-2) + 2*k+1]   ),
                        `endif


                              .data_wdata_o  (data_wdata_LEVEL [((2**(j-1))*2-2) + k]   ),
                              .data_add_o    (data_add_LEVEL   [((2**(j-1))*2-2) + k]   ),
                              .data_req_o    (data_req_LEVEL   [((2**(j-1))*2-2) + k]   ),
                              .data_wen_o    (data_wen_LEVEL   [((2**(j-1))*2-2) + k]   ),
                              .data_ID_o     (data_ID_LEVEL    [((2**(j-1))*2-2) + k]   ),
                              .data_be_o     (data_be_LEVEL    [((2**(j-1))*2-2) + k]   ),
                        `ifdef GNT_BASED_FC
                              .data_gnt_i    (data_gnt_LEVEL   [((2**(j-1))*2-2) + k]   )
                        `else
                              .data_stall_i  (data_stall_LEVEL [((2**(j-1))*2-2) + k]   )
                        `endif
                          );
                        end
                     else
                        begin : LEAF_NODES
                            FanInPrimitive_Req_PE 
                            #( 
                                .ADDR_WIDTH ( ADDR_WIDTH ), 
                                .ID_WIDTH   ( ID_WIDTH   ),
                                .DATA_WIDTH ( DATA_WIDTH ),
                                .BE_WIDTH   ( BE_WIDTH   )
                            )
                            i_FanInPrimitive_Req_PE
                            (
                                .RR_FLAG(RR_FLAG[LOG_MASTER-j-1]),

                                .data_wdata0_i ( data_wdata_i [2*k]   ),
                                .data_wdata1_i ( data_wdata_i [2*k+1] ),
                                .data_add0_i   ( data_add_i   [2*k]   ),
                                .data_add1_i   ( data_add_i   [2*k+1] ),
                                .data_req0_i   ( data_req_i   [2*k]   ),
                                .data_req1_i   ( data_req_i   [2*k+1] ),
                                .data_wen0_i   ( data_wen_i   [2*k]   ),
                                .data_wen1_i   ( data_wen_i   [2*k+1] ),
                                .data_ID0_i    ( data_ID_i    [2*k]   ),
                                .data_ID1_i    ( data_ID_i    [2*k+1] ),
                                .data_be0_i    ( data_be_i    [2*k]   ),
                                .data_be1_i    ( data_be_i    [2*k+1] ),
                          `ifdef GNT_BASED_FC
                                .data_gnt0_o   ( data_gnt_o   [2*k]   ),
                                .data_gnt1_o   ( data_gnt_o   [2*k+1] ),
                          `else
                                .data_stall0_o ( data_stall_o [2*k]   ),
                                .data_stall1_o ( data_stall_o [2*k+1] ),
                          `endif
  

                                .data_wdata_o ( data_wdata_LEVEL [((2**(j-1))*2-2) + k] ),
                                .data_add_o   ( data_add_LEVEL   [((2**(j-1))*2-2) + k] ),
                                .data_req_o   ( data_req_LEVEL   [((2**(j-1))*2-2) + k] ),
                                .data_wen_o   ( data_wen_LEVEL   [((2**(j-1))*2-2) + k] ),
                                .data_ID_o    ( data_ID_LEVEL    [((2**(j-1))*2-2) + k] ),
                                .data_be_o    ( data_be_LEVEL    [((2**(j-1))*2-2) + k] ),
                          `ifdef GNT_BASED_FC
                                .data_gnt_i   ( data_gnt_LEVEL   [((2**(j-1))*2-2) + k] )
                          `else
                                .data_stall_i ( data_stall_LEVEL [((2**(j-1))*2-2) + k] )
                          `endif
                            );
                        end
                end

            end

    end
    endgenerate


    RR_Flag_Req_PE 
    #( 
        .WIDTH     ( LOG_MASTER),
        .MAX_COUNT ( MAX_COUNT)
    )  
    RR_REQ
    (
      .clk          ( clk          ),
      .rst_n        ( rst_n        ),
      .RR_FLAG_o    ( RR_FLAG      ),
      .data_req_i   ( data_req_o   ),
    `ifdef GNT_BASED_FC
      .data_gnt_i   ( data_gnt_i   )
    `else
      .data_stall_i ( data_stall_i )
    `endif
    );


endmodule
module ArbitrationTree_PE
#(
    parameter ADDR_WIDTH = 32,
    parameter ID_WIDTH   = 20,
    parameter N_MASTER   = 16,
    parameter DATA_WIDTH = 32,
    parameter BE_WIDTH   = DATA_WIDTH/8,
    parameter MAX_COUNT  = N_MASTER
) 
(
    input  logic                                 clk,
    input  logic                                 rst_n,


    input  logic [N_MASTER-1:0]                  data_req_i,
    input  logic [N_MASTER-1:0][ADDR_WIDTH-1:0]  data_add_i,
    input  logic [N_MASTER-1:0]                  data_wen_i,
    input  logic [N_MASTER-1:0][DATA_WIDTH-1:0]  data_wdata_i,
    input  logic [N_MASTER-1:0][BE_WIDTH-1:0]    data_be_i,
    input  logic [N_MASTER-1:0][ID_WIDTH-1:0]    data_ID_i,
`ifdef GNT_BASED_FC
    output logic [N_MASTER-1:0]                  data_gnt_o,
`else
    output logic [N_MASTER-1:0]                  data_stall_o,
`endif

    output logic                                 data_req_o,
    output logic [ADDR_WIDTH-1:0]                data_add_o,
    output logic                                 data_wen_o,
    output logic [DATA_WIDTH-1:0]                data_wdata_o,
    output logic [BE_WIDTH-1:0]                  data_be_o,
    output logic [ID_WIDTH-1:0]                  data_ID_o,
`ifdef GNT_BASED_FC
    input  logic                                 data_gnt_i
`else
    input  logic                                 data_stall_i
`endif
);


    localparam LOG_MASTER       = `log2(N_MASTER-1);
    localparam N_WIRE           =  N_MASTER - 2;

    logic [LOG_MASTER-1:0]      RR_FLAG;

    genvar j,k;

    generate
      if(N_MASTER == 2)
      begin : INCR

                FanInPrimitive_Req_PE 
                #( 
                        .ADDR_WIDTH ( ADDR_WIDTH ), 
                        .ID_WIDTH   ( ID_WIDTH   ),
                        .DATA_WIDTH ( DATA_WIDTH ),
                        .BE_WIDTH   ( BE_WIDTH   )
                )
                i_FanInPrimitive_Req_PE
                (
                  .RR_FLAG(RR_FLAG),

                  .data_wdata_o  ( data_wdata_o    ),
                  .data_add_o    ( data_add_o      ),
                  .data_req_o    ( data_req_o      ),
                  .data_wen_o    ( data_wen_o      ),
                  .data_ID_o     ( data_ID_o       ),
                  .data_be_o     ( data_be_o       ),
            `ifdef GNT_BASED_FC
                  .data_gnt_i    ( data_gnt_i      )
            `else
                  .data_stall_i  ( data_stall_i    )
            `endif
                  );
      end
      else
      begin : BINARY_TREE



          logic [N_WIRE-1:0][DATA_WIDTH-1:0]      data_wdata_LEVEL;
          logic [N_WIRE-1:0][ADDR_WIDTH-1:0]      data_add_LEVEL;
          logic [N_WIRE-1:0]                      data_req_LEVEL;
          logic [N_WIRE-1:0]                      data_wen_LEVEL;
          logic [N_WIRE-1:0][ID_WIDTH-1:0]        data_ID_LEVEL;
          logic [N_WIRE-1:0][BE_WIDTH-1:0]        data_be_LEVEL;
      `ifdef GNT_BASED_FC
          logic [N_WIRE-1:0]                      data_gnt_LEVEL;
      `else
          logic [N_WIRE-1:0]                      data_stall_LEVEL;
      `endif

            for(j=0; j < LOG_MASTER; j++)
            begin : STAGE
              for(k=0; k<2**j; k=k+1)
                begin : INCR_VERT
                  if (j == 0 )
                  begin : LAST_NODE
                    FanInPrimitive_Req_PE 
                    #( 
                        .ADDR_WIDTH ( ADDR_WIDTH ), 
                        .ID_WIDTH   ( ID_WIDTH   ),
                        .DATA_WIDTH ( DATA_WIDTH ),
                        .BE_WIDTH   ( BE_WIDTH   )
                    )
                    i_FanInPrimitive_Req_PE
                    (
                        .RR_FLAG       ( RR_FLAG[LOG_MASTER-j-1] ),

                        .data_wdata0_i ( data_wdata_LEVEL[2*k]   ),
                        .data_wdata1_i ( data_wdata_LEVEL[2*k+1] ),
                        .data_add0_i   ( data_add_LEVEL  [2*k]   ),
                        .data_add1_i   ( data_add_LEVEL  [2*k+1] ),
                        .data_req0_i   ( data_req_LEVEL  [2*k]   ),
                        .data_req1_i   ( data_req_LEVEL  [2*k+1] ),
                        .data_wen0_i   ( data_wen_LEVEL  [2*k]   ),
                        .data_wen1_i   ( data_wen_LEVEL  [2*k+1] ),
                        .data_ID0_i    ( data_ID_LEVEL   [2*k]   ),
                        .data_ID1_i    ( data_ID_LEVEL   [2*k+1] ),
                        .data_be0_i    ( data_be_LEVEL   [2*k]   ),
                        .data_be1_i    ( data_be_LEVEL   [2*k+1] ),
                    `ifdef GNT_BASED_FC
                        .data_gnt0_o   ( data_gnt_LEVEL  [2*k]   ),
                        .data_gnt1_o   ( data_gnt_LEVEL  [2*k+1] ),
                    `else
                        .data_stall0_o ( data_stall_LEVEL[2*k]   ),
                        .data_stall1_o ( data_stall_LEVEL[2*k+1] ),
                    `endif

                        .data_wdata_o  ( data_wdata_o            ),
                        .data_add_o    ( data_add_o              ),
                        .data_req_o    ( data_req_o              ),
                        .data_wen_o    ( data_wen_o              ),
                        .data_ID_o     ( data_ID_o               ),
                        .data_be_o     ( data_be_o               ),
                    `ifdef GNT_BASED_FC
                        .data_gnt_i    ( data_gnt_i              )
                    `else
                        .data_stall_i  ( data_stall_i            )
                    `endif
                    );
                  end 
                  else if ( j < LOG_MASTER - 1)
                        begin : MIDDLE_NODES
                          FanInPrimitive_Req_PE 
                          #( 
                              .ADDR_WIDTH ( ADDR_WIDTH ), 
                              .ID_WIDTH   ( ID_WIDTH   ),
                              .DATA_WIDTH ( DATA_WIDTH ),
                              .BE_WIDTH   ( BE_WIDTH   )
                          )
                          i_FanInPrimitive_Req_PE 
                          (
                              .RR_FLAG(RR_FLAG[LOG_MASTER-j-1]),

                              .data_wdata0_i (data_wdata_LEVEL [((2**j)*2-2) + 2*k]     ),
                              .data_wdata1_i (data_wdata_LEVEL [((2**j)*2-2) + 2*k +1]  ),
                              .data_add0_i   (data_add_LEVEL   [((2**j)*2-2) + 2*k]     ),
                              .data_add1_i   (data_add_LEVEL   [((2**j)*2-2) + 2*k+1]   ),
                              .data_req0_i   (data_req_LEVEL   [((2**j)*2-2) + 2*k]     ),
                              .data_req1_i   (data_req_LEVEL   [((2**j)*2-2) + 2*k+1]   ),
                              .data_wen0_i   (data_wen_LEVEL   [((2**j)*2-2) + 2*k]     ),
                              .data_wen1_i   (data_wen_LEVEL   [((2**j)*2-2) + 2*k+1]   ),
                              .data_ID0_i    (data_ID_LEVEL    [((2**j)*2-2) + 2*k]     ),
                              .data_ID1_i    (data_ID_LEVEL    [((2**j)*2-2) + 2*k+1]   ),
                              .data_be0_i    (data_be_LEVEL    [((2**j)*2-2) + 2*k]     ),
                              .data_be1_i    (data_be_LEVEL    [((2**j)*2-2) + 2*k+1]   ),
                        `ifdef GNT_BASED_FC
                              .data_gnt0_o   (data_gnt_LEVEL   [((2**j)*2-2) + 2*k]     ),
                              .data_gnt1_o   (data_gnt_LEVEL   [((2**j)*2-2) + 2*k+1]   ),
                        `else
                              .data_stall0_o (data_stall_LEVEL [((2**j)*2-2) + 2*k]     ),
                              .data_stall1_o (data_stall_LEVEL [((2**j)*2-2) + 2*k+1]   ),
                        `endif


                              .data_wdata_o  (data_wdata_LEVEL [((2**(j-1))*2-2) + k]   ),
                              .data_add_o    (data_add_LEVEL   [((2**(j-1))*2-2) + k]   ),
                              .data_req_o    (data_req_LEVEL   [((2**(j-1))*2-2) + k]   ),
                              .data_wen_o    (data_wen_LEVEL   [((2**(j-1))*2-2) + k]   ),
                              .data_ID_o     (data_ID_LEVEL    [((2**(j-1))*2-2) + k]   ),
                              .data_be_o     (data_be_LEVEL    [((2**(j-1))*2-2) + k]   ),
                        `ifdef GNT_BASED_FC
                              .data_gnt_i    (data_gnt_LEVEL   [((2**(j-1))*2-2) + k]   )
                        `else
                              .data_stall_i  (data_stall_LEVEL [((2**(j-1))*2-2) + k]   )
                        `endif
                          );
                        end
                     else
                        begin : LEAF_NODES
                            FanInPrimitive_Req_PE 
                            #( 
                                .ADDR_WIDTH ( ADDR_WIDTH ), 
                                .ID_WIDTH   ( ID_WIDTH   ),
                                .DATA_WIDTH ( DATA_WIDTH ),
                                .BE_WIDTH   ( BE_WIDTH   )
                            )
                            i_FanInPrimitive_Req_PE
                            (
                                .RR_FLAG(RR_FLAG[LOG_MASTER-j-1]),

                                .data_wdata0_i ( data_wdata_i [2*k]   ),
                                .data_wdata1_i ( data_wdata_i [2*k+1] ),
                                .data_add0_i   ( data_add_i   [2*k]   ),
                                .data_add1_i   ( data_add_i   [2*k+1] ),
                                .data_req0_i   ( data_req_i   [2*k]   ),
                                .data_req1_i   ( data_req_i   [2*k+1] ),
                                .data_wen0_i   ( data_wen_i   [2*k]   ),
                                .data_wen1_i   ( data_wen_i   [2*k+1] ),
                                .data_ID0_i    ( data_ID_i    [2*k]   ),
                                .data_ID1_i    ( data_ID_i    [2*k+1] ),
                                .data_be0_i    ( data_be_i    [2*k]   ),
                                .data_be1_i    ( data_be_i    [2*k+1] ),
                          `ifdef GNT_BASED_FC
                                .data_gnt0_o   ( data_gnt_o   [2*k]   ),
                                .data_gnt1_o   ( data_gnt_o   [2*k+1] ),
                          `else
                                .data_stall0_o ( data_stall_o [2*k]   ),
                                .data_stall1_o ( data_stall_o [2*k+1] ),
                          `endif
  

                                .data_wdata_o ( data_wdata_LEVEL [((2**(j-1))*2-2) + k] ),
                                .data_add_o   ( data_add_LEVEL   [((2**(j-1))*2-2) + k] ),
                                .data_req_o   ( data_req_LEVEL   [((2**(j-1))*2-2) + k] ),
                                .data_wen_o   ( data_wen_LEVEL   [((2**(j-1))*2-2) + k] ),
                                .data_ID_o    ( data_ID_LEVEL    [((2**(j-1))*2-2) + k] ),
                                .data_be_o    ( data_be_LEVEL    [((2**(j-1))*2-2) + k] ),
                          `ifdef GNT_BASED_FC
                                .data_gnt_i   ( data_gnt_LEVEL   [((2**(j-1))*2-2) + k] )
                          `else
                                .data_stall_i ( data_stall_LEVEL [((2**(j-1))*2-2) + k] )
                          `endif
                            );
                        end
                end

            end

    end
    endgenerate


    RR_Flag_Req_PE 
    #( 
        .WIDTH     ( LOG_MASTER),
        .MAX_COUNT ( MAX_COUNT)
    )  
    RR_REQ
    (
      .clk          ( clk          ),
      .rst_n        ( rst_n        ),
      .RR_FLAG_o    ( RR_FLAG      ),
      .data_req_i   ( data_req_o   ),
    `ifdef GNT_BASED_FC
      .data_gnt_i   ( data_gnt_i   )
    `else
      .data_stall_i ( data_stall_i )
    `endif
    );


endmodule