{
  log_options: "all.level=error,all.max_size=0,nas.level=debug,nas.max_size=1,s1ap.level=debug,s1ap.max_size=1,x2ap.level=debug,x2ap.max_size=1,rrc.level=debug,rrc.max_size=1,ngap.level=debug,ngap.max_size=1,xnap.level=debug,xnap.max_size=1,phy.level=info,file.rotate=1G,file.path=/dev/null",
  log_filename: "log/enb.log",



  // Radio Units
  rf_driver: {
  // XXX vvv <- ru.txrx_active ?  XXX how to handle txrx_active for SDR ?
  // (tx_gain=-1000 does not work - it still sets tx_gain to min.possible value 14)
      name: "sdr",
      // RU2_a 2T1R  (lopcomm)
      // RU2_b 2T1R  (lopcomm)
      args: "dev0=/dev/sdr2@0,dev1=/dev/sdr2@1",
        cpri_mapping:  "standard,standard",
        cpri_mult:     "8,8",
        cpri_rx_delay: "10,10",
        cpri_tx_delay: "11,11",
        cpri_tx_dbm:   "50,50",
        ifname:        "slaptap9-1,slaptap9-2",
  },
  tx_gain: [-21, -21, -11, -11],
  rx_gain: [-22, -12],
  com_addr: "127.0.1.2:9001",


  // LTE core network
  mme_list: [
    {
      mme_addr: "127.0.1.100",
    },
  ],


  // NR core network
  amf_list: [
    {
      amf_addr: "127.0.1.100",
    },
  ],
  x2_peers: ["44.1.1.1", "44.1.1.2"],
  xn_peers: ["55.1.1.1", "55.1.1.2"],


  gtp_addr: "127.0.1.1",

  enb_id: 0x1A2D0,
  gnb_id: 0x12345,
  gnb_id_bits: 28,
  en_dc_support: true,

  // LTE cells
  cell_list: [

        // CELL2_a  (RU2_a)
        {
          rf_port:      0,
          n_antenna_dl: 2,
          n_antenna_ul: 1,

          cell_id:      0x21,
          tac:          0x0001,
          n_id_cell:    21,
          dl_earfcn:    3350,
          ul_earfcn:    21350,
          root_sequence_index: 204,

          // Handover
          ncell_list: [
            // Intra-ENB HO
            {
              rat:        "nr",
              cell_id:    0x22,  // -> CELL2_b
            },

            // Inter-ENB HO
            {
              rat:          "eutra",
              cell_id:      0x12345,  // -> PEER1
              n_id_cell:    35,
              dl_earfcn:    700,
              tac:          123,
            },
            {
              rat:          "nr",
              nr_cell_id:   0x77712, // -> PEER2
              gnb_id_bits:  22,
              n_id_cell:    75,
              dl_nr_arfcn:  520000,
              ssb_nr_arfcn: 519890,
              ul_nr_arfcn:  520000,
              tac:          321,
              band:         38,
              ssb_subcarrier_spacing: 30,
              ssb_period: 20,
              ssb_offset: 0,
              ssb_duration: 1,
            },
          ],

          // Carrier Aggregation: LTE + LTE
          scell_list: [
          ],
          // Carrier Aggregation: LTE + NR
          en_dc_scg_cell_list: [
              {
                cell_id: 0x22, // + CELL2_b
              },
          ],


          // tune LTE parameters for the cell
          n_rb_dl: 25,
          si_coderate: 0.2,

          pdsch_dedicated: {
            p_a: -3,
            p_b: -1,
          },

          pdcch_format:       2,
          prach_config_index: 4,
          initial_cqi:        3,

          pucch_dedicated: {
            n1_pucch_sr_count: 11,
            cqi_pucch_n_rb: 1,
            n1_pucch_an_cs_count: 8,  
            n3_pucch_an_n_rb: 3,      
          },
          m_ri: 8,
          transmission_mode: 3,

          srs_dedicated: {
            srs_bandwidth_config: 3,
            srs_bandwidth: 1,
            srs_subframe_config: 3,
            srs_period: 40,
            srs_hopping_bandwidth: 0,
          },

          drb_config: "CELL2_a-drb.cfg",

          sib_sched_list: [
            {
              filename: "CELL2_a-sib23.asn",
              si_periodicity: 16,
            },
          ],
        },
  ],

  cell_default: {
    plmn_list: [
      "00101",

    ],
    cyclic_prefix: "normal",

    phich_duration: "normal",
    phich_resource: "1",

    si_value_tag: 0,
    cell_barred: false,
    intra_freq_reselection: true,
    q_rx_lev_min: -70,
    si_window_length: 40,

    si_pdcch_format: 2,

    n_symb_cch: 0,

    prach_freq_offset: -1,

    pusch_dedicated: {
      beta_offset_ack_index: 9,
      beta_offset_ri_index: 6,
      beta_offset_cqi_index: 6,
    },

    pusch_hopping_offset: -1,

    pusch_msg3_mcs: 0,


    dl_256qam: true,
    ul_64qam: true,

    sr_period: 20,

    cqi_period: 40,


    mac_config: {
       ul_max_harq_tx: 5,
       dl_max_harq_tx: 5,
    },

    pusch_max_its: 6,

    dpc: true,
    dpc_pusch_snr_target: 25,
    dpc_pucch_snr_target: 25,

    cipher_algo_pref: [],
    integ_algo_pref: [2, 1],

    // XXX -> cell ?
    inactivity_timer: 10000,

    srb_config: [
      {
        id: 1,
        maxRetxThreshold: 32,
        t_Reordering: 45,
        t_PollRetransmit: 60,
      },
      {
        id: 2 ,
        maxRetxThreshold: 32,
        t_Reordering: 45,
        t_PollRetransmit: 60,
      }
    ],

  meas_config_desc: {
    a1_report_type: "rsrp",
    a1_rsrp: -70,
    a1_hysteresis: 0,
    a1_time_to_trigger: 640,
    a2_report_type: "rsrp",
    a2_rsrp: -80,
    a2_hysteresis: 0,
    a2_time_to_trigger: 640,
    a3_report_type: "rsrp",
    a3_offset: 6,
    a3_hysteresis: 0,
    a3_time_to_trigger: 480,
  },
  meas_gap_config: "gp0",
  ho_from_meas: true,
  },

  // NR cells
  nr_cell_list: [

        // CELL2_b  (RU2_b)
        {
          rf_port:      1,
          n_antenna_dl: 2,
          n_antenna_ul: 1,

          cell_id:      0x22,
          n_id_cell:    22,
          band:         7,
          dl_nr_arfcn:  537200,
          ul_nr_arfcn:  513200,
          bandwidth:    5,

          subcarrier_spacing: 15,
          ssb_nr_arfcn:   537170,
          ssb_pos_bitmap: "1000",

          root_sequence_index: 2,

          // Handover
          ncell_list: [
            // Intra-ENB HO
            {
              rat:        "eutra",
              cell_id:    0x1A2D021, // -> CELL2_a
              n_id_cell:  21,
              dl_earfcn:  3350,
              tac:        0x0001,
            },

            // Inter-ENB HO
            {
              rat:          "eutra",
              cell_id:      0x12345,  // -> PEER1
              n_id_cell:    35,
              dl_earfcn:    700,
              tac:          123,
            },
            {
              rat:          "nr",
              nr_cell_id:   0x77712, // -> PEER2
              gnb_id_bits:  22,
              n_id_cell:    75,
              dl_nr_arfcn:  520000,
              ssb_nr_arfcn: 519890,
              ul_nr_arfcn:  520000,
              tac:          321,
              band:         38,
              ssb_subcarrier_spacing: 30,
              ssb_period: 20,
              ssb_offset: 0,
              ssb_duration: 1,
            },
          ],

          // Carrier Aggregation: NR + NR
          scell_list: [
          ],
          // Carrier Aggregation: NR + LTE
          nr_dc_scg_cell_list: [
                {
                  cell_id: 0x21, // + CELL2_a
                },
          ],

          // tune NR parameters for the cell  XXX -> sdr/ors ? (see lte ^^^)
            manual_ref_signal_power: true,
            ss_pbch_block_power: -46,



          prach: {
            ra_response_window: 10,
          },

          pdcch: {
            uss: {
              n_candidates: [ 0, 2, 1, 0, 0 ],
              dci_0_1_and_1_1: true,
            },
          },

          pdsch: {
          },

          pusch: {
          },

          csi_rs: {
            nzp_csi_rs_resource: [
              {
                n_ports: 2,
                frequency_domain_allocation: "other",
                bitmap: "100000",
                cdm_type: "fd_cdm2",
              },
              {
                csi_rs_id: 1,
                n_ports: 1,
                frequency_domain_allocation: "row1",
                bitmap: "0001",
                cdm_type: "no_cdm",
                density: 3,
                first_symb: 4,
                rb_start: 0,
                l_crb: -1,
                power_control_offset: 0,
                power_control_offset_ss: 0,
                period: 40,
                offset: 11,
                qcl_info_periodic_csi_rs: 0,
              },
              {
                csi_rs_id: 2,
                n_ports: 1,
                frequency_domain_allocation: "row1",
                bitmap: "0001",
                cdm_type: "no_cdm",
                density: 3,
                first_symb: 8,
                rb_start: 0,
                l_crb: -1,
                power_control_offset: 0,
                power_control_offset_ss: 0,
                period: 40,
                offset: 11,
                qcl_info_periodic_csi_rs: 0,
              },
              {
                csi_rs_id: 3,
                n_ports: 1,
                frequency_domain_allocation: "row1",
                bitmap: "0001",
                cdm_type: "no_cdm",
                density: 3,
                first_symb: 4,
                rb_start: 0,
                l_crb: -1,
                power_control_offset: 0,
                power_control_offset_ss: 0,
                period: 40,
                offset: 12,
                qcl_info_periodic_csi_rs: 0,
              },
              {
                csi_rs_id: 4,
                n_ports: 1,
                frequency_domain_allocation: "row1",
                bitmap: "0001",
                cdm_type: "no_cdm",
                density: 3,
                first_symb: 8,
                rb_start: 0,
                l_crb: -1,
                power_control_offset: 0,
                power_control_offset_ss: 0,
                period: 40,
                offset: 12,
                qcl_info_periodic_csi_rs: 0,
              },
            ],

            nzp_csi_rs_resource_set: [
              {},
              {
                csi_rs_set_id: 1,
                nzp_csi_rs_resources: [ 1, 2, 3, 4 ],
                repetition: false,
                trs_info: true,
              },
            ],

            csi_resource_config: [
              {},
              {},
              {
                csi_rsc_config_id: 2,
                nzp_csi_rs_resource_set_list: [ 1 ],
                resource_type: "periodic",
              },
            ],

            csi_report_config: [
              {
                codebook_config: {
                  codebook_type: "type1",
                  sub_type: "typeI_SinglePanel",
                },
              },
            ],

          },

          drb_config: "CELL2_b-drb.cfg",

        },
  ],

  nr_cell_default: {
    ssb_period: 20,

    plmn_list: [
      {
      plmn: "00101",
      tac: 100,
      reserved: false,
      nssai: [
        {
         sst: 1,
        },

       ],
      },
    ],

    si_window_length: 40,
    cell_barred: false,
    intra_freq_reselection: true,
    q_rx_lev_min: -70,
    q_qual_min: -20,

    sr_period: 40,
    dmrs_type_a_pos: 2,
    prach: {
      prach_config_index: 160,      // XXX TDD only & TDD_CONFIG != 4
      msg1_subcarrier_spacing: 30,
      msg1_fdm: 1,
      msg1_frequency_start: -1,
      zero_correlation_zone_config: 15,
      preamble_received_target_power: -110,
      preamble_trans_max: 7,
      power_ramping_step: 4,
      restricted_set_config: "unrestricted_set",
      ra_contention_resolution_timer: 64,
      ssb_per_prach_occasion: 1,
      cb_preambles_per_ssb: 8,
    },
    pdcch: {
      search_space0_index: 0,
      dedicated_coreset: {
        rb_start: -1,
        l_crb: -1,
        duration: 0,
        precoder_granularity: "sameAsREG_bundle",
      },
      css: {
        n_candidates: [ 0, 0, 4, 0, 0 ],
      },
      rar_al_index: 2,
      si_al_index: 2,
      al_index: 1,
    },
    pdsch: {
      mapping_type: "typeA",
      dmrs_add_pos: 1,
      dmrs_type: 1,
      dmrs_max_len: 1,
      mcs_table: "qam256",
      rar_mcs: 2,
      si_mcs: 6,
    },
    csi_rs: {
      nzp_csi_rs_resource: [
        {
          csi_rs_id: 0,
          density: 1,
          first_symb: 4,
          rb_start: 0,
          l_crb: -1,
          power_control_offset: 0,
          power_control_offset_ss: 0,
          period: 80,
          offset: 1,
          qcl_info_periodic_csi_rs: 0,
        },
      ],
      nzp_csi_rs_resource_set: [
        {
          csi_rs_set_id: 0,
          nzp_csi_rs_resources: [ 0 ],
          repetition: false,
        },
      ],
     csi_im_resource: [
        {
          csi_im_id: 0,
          pattern: 1,
          subcarrier_location: 8,
          symbol_location: 8,
          rb_start: 0,
          l_crb: -1,
          period: 80,
          offset: 1,
        },
      ],
      csi_im_resource_set: [
        {
          csi_im_set_id: 0,
          csi_im_resources: [ 0 ],
        }
      ],
      zp_csi_rs_resource: [
        {
          csi_rs_id: 0,
          frequency_domain_allocation: "row4",
          bitmap: "100",
          n_ports: 4,
          cdm_type: "fd_cdm2",
          first_symb: 8,
          density: 1,
          rb_start: 0,
          l_crb: -1,
          period: 80,
          offset: 1,
        },
      ],
      p_zp_csi_rs_resource_set: [
        {
          zp_csi_rs_resources: [ 0 ],
        },
      ],
      csi_resource_config: [
        {
          csi_rsc_config_id: 0,
          nzp_csi_rs_resource_set_list: [ 0 ],
          resource_type: "periodic",
        },
        {
          csi_rsc_config_id: 1,
          csi_im_resource_set_list: [ 0 ],
          resource_type: "periodic",
        },
      ],
      csi_report_config: [
        {
          resources_for_channel_measurement: 0,
          csi_im_resources_for_interference: 1,
          report_config_type: "periodic",
          period: 80,
          report_quantity: "CRI_RI_PMI_CQI",
          cqi_table: 2,
          subband_size: "value1",
        },
      ],
    },
    pucch: {
      dpc_snr_target: 25,
      pucch_group_hopping: "neither",
      hopping_id: -1,
      p0_nominal: -90,
        pucch1: {
          n_cs: 3,
          n_occ: 3,
          freq_hopping: true,
        },
        pucch2: {
          n_symb: 2,
          n_prb: 1,
          freq_hopping: true,
          simultaneous_harq_ack_csi: false,
          max_code_rate: 0.25,
        },
    },
    pusch: {
      mapping_type: "typeA",
      n_symb: 14,
      dmrs_add_pos: 1,
      dmrs_type: 1,
      dmrs_max_len: 1,
      tf_precoding: false,
      mcs_table: "qam256",
      mcs_table_tp: "qam256",
      ldpc_max_its: 5,
      p0_nominal_with_grant: -84,
      msg3_mcs: 4,
      msg3_delta_power: 0,
      beta_offset_ack_index: 9,
    },
    mac_config: {
      msg3_max_harq_tx: 5,
      ul_max_harq_tx: 5,
      dl_max_harq_tx: 5,
      ul_max_consecutive_retx: 30,
      dl_max_consecutive_retx: 30,
      periodic_bsr_timer: 20,
      retx_bsr_timer: 320,
      periodic_phr_timer: 500,
      prohibit_phr_timer: 200,
      phr_tx_power_factor_change: "dB3",
      sr_prohibit_timer: 0,
      sr_trans_max: 64,
    },
    cipher_algo_pref: [],
    integ_algo_pref: [2, 1],
    inactivity_timer: 10000,

    meas_config_desc: {
      a1_report_type: "rsrp",
      a1_rsrp: -60,
      a1_hysteresis: 10,
      a1_time_to_trigger: 100,
      a2_report_type: "rsrp",
      a2_rsrp: -70,
      a2_hysteresis: 0,
      a2_time_to_trigger: 100,
      a3_report_type: "rsrp",
      a3_offset: 6,
      a3_hysteresis: 0,
      a3_time_to_trigger: 100,
      ssb_rsrq_filter_coeff: 3,
      ssb_sinr_filter_coeff: 5
    },
    meas_gap_config: {
      pattern_id: 0
    },
  },
}