enb.jinja2.cfg 24.4 KB
Newer Older
Kirill Smelkov's avatar
.  
Kirill Smelkov committed
1 2
{#- XXX ORS -> provide defaults for: slave_instance_list #}
{#- XXX icell vs cell / iru vs ru everyhere + document it #}
Kirill Smelkov's avatar
.  
Kirill Smelkov committed
3
{#- XXX TDD check   #}
Kirill Smelkov's avatar
.  
Kirill Smelkov committed
4

Kirill Smelkov's avatar
.  
Kirill Smelkov committed
5 6
{%- import 'amari_lte.jinja2'  as lte      with context %}
{%- import 'amari_slap.jinja2' as slaplte  with context %}
Kirill Smelkov's avatar
.  
Kirill Smelkov committed
7 8 9 10 11 12 13 14 15 16 17 18
{%- set J               = slaplte.J %}
{%- set jref_of_shared  = slaplte.jref_of_shared %}
{%- set jcell_ru_ref    = slaplte.jcell_ru_ref %}
{%- set cfg             = slaplte.cfg %}

{#- for standalone testing via slapos-render-config.py
    NOTE: keep in sync with instance-enb.jinja2.cfg and ru/libinstance.jinja2.cfg   #}
{%- if _standalone is defined                                                 %}
{%-   set iru_dict   = {}                                                     %}
{%-   set icell_dict = {}                                                     %}
{%-   set ipeercell_dict = {}                                                 %}
{%-   do slaplte.load_iru_and_icell(iru_dict, icell_dict, icell_kind='enb')   %}
Kirill Smelkov's avatar
.  
Kirill Smelkov committed
19
{%-   do slaplte.load_ipeercell(ipeercell_dict)                               %}
Kirill Smelkov's avatar
.  
Kirill Smelkov committed
20 21
{%-   do slaplte.check_loaded_everything()                                    %}
{%- endif                                                                     %}
Kirill Smelkov's avatar
.  
Kirill Smelkov committed
22

Kirill Smelkov's avatar
.  
Kirill Smelkov committed
23

Kirill Smelkov's avatar
.  
Kirill Smelkov committed
24
{#- start of the config -#}
25
{
Kirill Smelkov's avatar
.  
Kirill Smelkov committed
26
  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,
Kirill Smelkov's avatar
.  
Kirill Smelkov committed
27 28 29 30 31 32
{%- if slapparameter_dict.get('log_phy_debug', False) -%}
    phy.level=debug
{%- else -%}
    phy.level=info
{%- endif -%}
    ,file.rotate=1G,file.path=/dev/null",
33 34
  log_filename: "{{ directory['log'] }}/enb.log",

Kirill Smelkov's avatar
.  
Kirill Smelkov committed
35
{# instantiate radio units #}
Kirill Smelkov's avatar
.  
Kirill Smelkov committed
36
{{ lte.ru_config(iru_dict, slapparameter_dict) }}
Kirill Smelkov's avatar
.  
Kirill Smelkov committed
37

Kirill Smelkov's avatar
.  
Kirill Smelkov committed
38
  {%- if slapparameter_dict.get('websocket_password', '') %}
Kirill Smelkov's avatar
.  
Kirill Smelkov committed
39
  com_addr: "[{{ gtp_addr_v6 }}]:{{ slap_configuration['configuration.com_ws_port'] }}",
Kirill Smelkov's avatar
.  
Kirill Smelkov committed
40 41 42 43
  com_auth: {
    password: "{{ slapparameter_dict['websocket_password'] }}",
  },
  {%- else %}
Kirill Smelkov's avatar
.  
Kirill Smelkov committed
44
  com_addr: "{{ slap_configuration['configuration.com_addr'] }}:{{ slap_configuration['configuration.com_ws_port'] }}",
Kirill Smelkov's avatar
.  
Kirill Smelkov committed
45
  {%- endif %}
46

Kirill Smelkov's avatar
.  
Kirill Smelkov committed
47
  // XXX only if slapparameter_dict.get('mme_list') || has LTE cell ?
48
  mme_list: [
Kirill Smelkov's avatar
.  
Kirill Smelkov committed
49 50 51
{%- for _, mme in slapparameter_dict.get('mme_list',
                        {'1':{'mme_addr': slap_configuration['configuration.mme_addr']}})
                        | dictsort %}
52
    {
Kirill Smelkov's avatar
.  
Kirill Smelkov committed
53
      mme_addr: "{{ mme['mme_addr'] }}",
54
    },
Kirill Smelkov's avatar
.  
Kirill Smelkov committed
55
{%- endfor %}
56
  ],
Kirill Smelkov's avatar
.  
Kirill Smelkov committed
57 58 59

  // XXX only if slapparameter_dict.get('afm_list') || has NR cell ?
  afm_list: [
Kirill Smelkov's avatar
.  
Kirill Smelkov committed
60 61 62
{%- for _, afm in slapparameter_dict.get('afm_list',
                        {'1':{'afm_addr': slap_configuration['configuration.amf_addr']}})
                        | dictsort %}
Kirill Smelkov's avatar
.  
Kirill Smelkov committed
63 64 65 66 67 68
    {
      afm_addr: "{{ afm['afm_addr'] }}",
    },
{%- endfor %}
  ],

Kirill Smelkov's avatar
.  
Kirill Smelkov committed
69 70
{#- X2/Xn TODO:  add info about peers as shared instances - one instance per peer *ENB*.
          then query SlapOS Master about cells configured on that peer ENB and
Kirill Smelkov's avatar
.  
Kirill Smelkov committed
71 72 73 74 75 76 77 78 79 80
          depending on whether LTE and/or NR cells are there add X2 and/or Xn peers #}
{% if slapparameter_dict.get('xn_peers', '') %}
  xn_peers: [
{%- for k in slapparameter_dict['xn_peers'] -%}
    "{{ slapparameter_dict['xn_peers'][k]['xn_addr'] }}",
{%- endfor -%}
  ],
{% endif %}

{% if slapparameter_dict.get('mme_list', '')  or  slapparameter_dict.get('afm_list', '') %}
81 82 83 84 85
{%   if slapparameter_dict.get('use_ipv4', False) %}
  gtp_addr: "{{ gtp_addr_v4 }}",
{%   else %}
  gtp_addr: "{{ gtp_addr_v6 }}",
{%   endif %}
86
{% else %}
Kirill Smelkov's avatar
.  
Kirill Smelkov committed
87
  gtp_addr: "{{ slap_configuration['configuration.gtp_addr'] }}",
88
{% endif %}
89

Kirill Smelkov's avatar
.  
Kirill Smelkov committed
90
  enb_id: {{ cfg('enb_id') }},
Kirill Smelkov's avatar
.  
Kirill Smelkov committed
91 92 93
  gnb_id: {{ cfg('gnb_id') }},
  gnb_id_bits: {{ cfg('gnb_id_bits') }},
  en_dc_support: true,
94

95
  // LTE cells
96
  cell_list: [
Kirill Smelkov's avatar
.  
Kirill Smelkov committed
97
{%- for i, (cell_ref, icell) in enumerate(icell_dict|dictsort) %}
Kirill Smelkov's avatar
.  
Kirill Smelkov committed
98 99 100 101 102
{%-   set cell = icell['_']                               %}
{%-   if cell.cell_type == 'lte'                          %}
{%-     set ru_ref = J(jcell_ru_ref(icell, icell_dict))   %}
{%-     set iru = iru_dict[ru_ref]                        %}
{%-     set ru = iru['_']                                 %}
Kirill Smelkov's avatar
.  
Kirill Smelkov committed
103

Kirill Smelkov's avatar
.  
Kirill Smelkov committed
104
        // {{ cell_ref }}  ({{ ru_ref }})
Kirill Smelkov's avatar
.  
Kirill Smelkov committed
105
        {
106 107 108 109 110 111 112 113
          rf_port:      {{ ru._rf_port }},
          n_antenna_dl: {{ ru.n_antenna_dl }},
          n_antenna_ul: {{ ru.n_antenna_ul }},

          cell_id:      {{ cell.cell_id }},
          tac:          {{ cell.tac }},
          n_id_cell:    {{ cell.pci }},
          dl_earfcn:    {{ cell.dl_earfcn }},
Kirill Smelkov's avatar
.  
Kirill Smelkov committed
114
          ul_earfcn:    {{ cell.ul_earfcn }},
Kirill Smelkov's avatar
.  
Kirill Smelkov committed
115 116 117
          root_sequence_index: {{ cell.get('root_sequence_index',
                                    slapparameter_dict.get('root_sequence_index',
                                      204 + i)) }},
Kirill Smelkov's avatar
.  
Kirill Smelkov committed
118

Kirill Smelkov's avatar
.  
Kirill Smelkov committed
119
          // Handover   XXX same code for both LTE and NR
Kirill Smelkov's avatar
.  
Kirill Smelkov committed
120 121 122 123 124 125
          ncell_list: [
            // Intra-ENB HO
{%-       for cell2_ref, icell2 in icell_dict|dictsort %}
{%-         set cell2 = icell2['_']                   %}
{%-         if cell2_ref != cell_ref %} {#- NOTE: HO to both LTE and NR #}
            {
126
{%-           if cell2.cell_type == 'lte' %}
Kirill Smelkov's avatar
.  
Kirill Smelkov committed
127
              rat:        "eutra",
Kirill Smelkov's avatar
.  
Kirill Smelkov committed
128
              cell_id:    {{ cfg('enb_id') }}{{ cell2.cell_id.removeprefix('0x') }}, // -> {{ J(jref_of_shared(icell2)) }}
129 130
              n_id_cell:  {{ cell2.pci }},
              dl_earfcn:  {{ cell2.dl_earfcn }},
Kirill Smelkov's avatar
.  
Kirill Smelkov committed
131
              //ul_earfcn:  {{ cell2.ul_earfcn }},
132 133
              tac:        {{ cell2.tac }},
{%-           elif cell2.cell_type == 'nr' %}
Kirill Smelkov's avatar
.  
Kirill Smelkov committed
134
              rat:        "nr",
Kirill Smelkov's avatar
.  
Kirill Smelkov committed
135
              nr_cell_id: {{ cfg('gnb_id') }}{{ cell2.cell_id.removeprefix('0x') }}, // -> {{ J(jref_of_shared(icell2)) }}
136
              n_id_cell:  {{ cell2.pci }},
Kirill Smelkov's avatar
.  
Kirill Smelkov committed
137 138
              gnb_id_bits
              dl_nr_arfcn
Kirill Smelkov's avatar
.  
Kirill Smelkov committed
139
              ssb_nr_arfcn
Kirill Smelkov's avatar
.  
Kirill Smelkov committed
140 141 142 143 144 145 146 147 148 149
              ul_nr_arfcn
              tac
              band
              ssb_subcarrier_spacing: 30,
              ssb_period: 20,
              ssb_offset: 0,
              ssb_duration: 1,
{%-           else  %}
{%-             do bug('unreachable')   %}
{%-           endif %}
Kirill Smelkov's avatar
.  
Kirill Smelkov committed
150 151 152 153 154
            },
{%-         endif %}
{%-       endfor %}

            // Inter-ENB HO
Kirill Smelkov's avatar
.  
Kirill Smelkov committed
155 156 157
{#- TODO: add info about peers as shared instances - one instance per peer *ENB*.
          then query SlapOS Master about cells configured on that peer ENB and
          put them as peers here #}
Kirill Smelkov's avatar
.  
Kirill Smelkov committed
158 159 160 161 162

          ],

          // Carrier Aggregation
{#-       CA in between all LTE cells #}  // XXX + CA LTE-NR
Kirill Smelkov's avatar
.  
Kirill Smelkov committed
163
          scell_list: [
Kirill Smelkov's avatar
.  
Kirill Smelkov committed
164
{%-       for cell2_ref, icell2 in icell_dict|dictsort %}
Kirill Smelkov's avatar
.  
Kirill Smelkov committed
165
{%-         set cell2 = icell2['_']                   %}
166
{%-         if cell2_ref != cell_ref  and  cell2.cell_type == 'lte' %}
Kirill Smelkov's avatar
.  
Kirill Smelkov committed
167
            {
168
              cell_id: {{ cell2.cell_id }},  // + {{ J(jref_of_shared(icell2)) }}
Kirill Smelkov's avatar
.  
Kirill Smelkov committed
169 170 171 172
              cross_carrier_scheduling: false,
            },
{%-         endif %}
{%-       endfor %}
Kirill Smelkov's avatar
.  
Kirill Smelkov committed
173 174
          ],

Kirill Smelkov's avatar
.  
Kirill Smelkov committed
175

Kirill Smelkov's avatar
.  
Kirill Smelkov committed
176
          // tune LTE parameters for the cell
177
{%-       set tdd = (cell.rf_mode == 'tdd') %}
Kirill Smelkov's avatar
.  
Kirill Smelkov committed
178
{%-       if tdd %}
Kirill Smelkov's avatar
.  
Kirill Smelkov committed
179 180
          uldl_config: {{ lte.cell_tdd_config(cell) }},
          sp_config: 7,
Kirill Smelkov's avatar
.  
Kirill Smelkov committed
181 182
{%-       endif %}

Kirill Smelkov's avatar
.  
Kirill Smelkov committed
183
{%-       set n_rb_dl = lte.cell_n_rb_dl(cell) %}
Kirill Smelkov's avatar
.  
Kirill Smelkov committed
184
          n_rb_dl: {{ n_rb_dl }},
Kirill Smelkov's avatar
.  
Kirill Smelkov committed
185
          si_coderate: {{ 0.30  if n_rb_dl == 6  else 0.20 }},
Kirill Smelkov's avatar
.  
Kirill Smelkov committed
186 187

          pdsch_dedicated: {
188
            p_a: {{ {4: -6, 2: -3}.get(ru.n_antenna_dl, 0) }},
Kirill Smelkov's avatar
.  
Kirill Smelkov committed
189
            p_b: -1,
Kirill Smelkov's avatar
.  
Kirill Smelkov committed
190 191
          },

Kirill Smelkov's avatar
.  
Kirill Smelkov committed
192
          pdcch_format:       {{  1  if n_rb_dl == 6  else 2 }},
Kirill Smelkov's avatar
.  
Kirill Smelkov committed
193
          prach_config_index: {{ 15  if n_rb_dl == 6  else 4 }},
Kirill Smelkov's avatar
.  
Kirill Smelkov committed
194
          initial_cqi:        {{  5  if n_rb_dl == 6  else 3 }},
Kirill Smelkov's avatar
.  
Kirill Smelkov committed
195

Kirill Smelkov's avatar
.  
Kirill Smelkov committed
196 197 198
          pucch_dedicated: {
            n1_pucch_sr_count: 11,
            cqi_pucch_n_rb: 1,
Kirill Smelkov's avatar
.  
Kirill Smelkov committed
199
            n1_pucch_an_cs_count: 8,  {# XXX else "n1_pucch_an_cs_count must be > 0 for the CA Primary cell" #}
Kirill Smelkov's avatar
.  
Kirill Smelkov committed
200
            n3_pucch_an_n_rb: 3,      {# XXX else "n3_pucch_an_n_rb must be > 0 for the CA Primary cell" #}
Kirill Smelkov's avatar
.  
Kirill Smelkov committed
201
{%-         if tdd  %}
Kirill Smelkov's avatar
.  
Kirill Smelkov committed
202
            tdd_ack_nack_feedback_mode: "multiplexing", /* TDD only */
Kirill Smelkov's avatar
.  
Kirill Smelkov committed
203
{%-         endif %}
Kirill Smelkov's avatar
.  
Kirill Smelkov committed
204 205
          },

206
{%-       if ru.n_antenna_dl >= 2  %}
Kirill Smelkov's avatar
.  
Kirill Smelkov committed
207 208
          m_ri: 8,
          transmission_mode: 3,
Kirill Smelkov's avatar
.  
Kirill Smelkov committed
209 210
{%-       endif %}

Kirill Smelkov's avatar
.  
Kirill Smelkov committed
211
          srs_dedicated: {
Kirill Smelkov's avatar
.  
Kirill Smelkov committed
212
{%-       if n_rb_dl == 6  %}
Kirill Smelkov's avatar
.  
Kirill Smelkov committed
213 214
            srs_bandwidth_config: 7,
            srs_bandwidth: 1,
Kirill Smelkov's avatar
.  
Kirill Smelkov committed
215
{%-       elif n_rb_dl == 15  %}
Kirill Smelkov's avatar
.  
Kirill Smelkov committed
216 217
            srs_bandwidth_config: 6,
            srs_bandwidth: 1,
Kirill Smelkov's avatar
.  
Kirill Smelkov committed
218
{%-       elif n_rb_dl == 25  %}
Kirill Smelkov's avatar
.  
Kirill Smelkov committed
219 220
            srs_bandwidth_config: 3,
            srs_bandwidth: 1,
Kirill Smelkov's avatar
.  
Kirill Smelkov committed
221
{%-       elif n_rb_dl == 50  %}
Kirill Smelkov's avatar
.  
Kirill Smelkov committed
222 223
            srs_bandwidth_config: 2,
            srs_bandwidth: 2,
Kirill Smelkov's avatar
.  
Kirill Smelkov committed
224
{%-       elif n_rb_dl == 75  %}
Kirill Smelkov's avatar
.  
Kirill Smelkov committed
225 226 227 228 229 230 231 232 233 234
            srs_bandwidth_config: 2,
            srs_bandwidth: 2,
{%-       else  %}
            srs_bandwidth_config: 2,
            srs_bandwidth: 3,
{%-       endif %}
            srs_subframe_config: 3,
            srs_period: 40,
            srs_hopping_bandwidth: 0,
          },
Kirill Smelkov's avatar
.  
Kirill Smelkov committed
235

Kirill Smelkov's avatar
.  
Kirill Smelkov committed
236
{#- XXX do we want to differentiate whether it is ORS or Amarisoft SDR board ? #}
237
{%-       if ru.ru_type == 'sdr'   %}
Kirill Smelkov's avatar
.  
Kirill Smelkov committed
238
          manual_ref_signal_power: true,
Kirill Smelkov's avatar
.  
Kirill Smelkov committed
239
{%-       endif %}
Kirill Smelkov's avatar
.  
Kirill Smelkov committed
240

Kirill Smelkov's avatar
.  
Kirill Smelkov committed
241 242 243 244 245 246 247 248
          drb_config: "{{ cell_ref }}-drb.cfg",

          sib_sched_list: [
            {
              filename: "{{ cell_ref }}-sib23.asn",
              si_periodicity: 16,
            },
          ],
Kirill Smelkov's avatar
.  
Kirill Smelkov committed
249 250 251
        },
{%-   endif %}
{%- endfor %}
Joanne Hugé's avatar
Joanne Hugé committed
252 253 254
  ],

  cell_default: {
255
    plmn_list: [
256 257 258 259 260 261 262 263 264
{%- if slapparameter_dict.get('plmn_list', '') %}
{%- for i, k in enumerate(slapparameter_dict['plmn_list']) %}
{%- if i == 0 -%}
      {
{%- else -%}
      , {
{%- endif %}
      plmn: "{{ slapparameter_dict['plmn_list'][k]['plmn'] }}",
      reserved: {{ str(slapparameter_dict['plmn_list'][k].get('reserved', false)).lower() }},
Joanne Hugé's avatar
Joanne Hugé committed
265
      attach_without_pdn: {{ str(slapparameter_dict['plmn_list'][k].get('attach_without_pdn', false)).lower() }},
266 267 268 269 270
      }
{%- endfor -%}
{% else %}
      "00101",
{% endif %}
271 272 273 274
    ],
    cyclic_prefix: "normal",

    phich_duration: "normal",
275 276 277 278 279 280 281
    phich_resource: "1",

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

283
    si_pdcch_format: 2,
284

285
    n_symb_cch: 0,
286

287
    prach_freq_offset: -1,
288 289 290 291 292 293 294

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

295
    pusch_hopping_offset: -1,
296 297 298 299 300 301 302

    pusch_msg3_mcs: 0,


    dl_256qam: true,
    ul_64qam: true,

303
    sr_period: 20,
304

305
    cqi_period: 40,
306 307 308


    mac_config: {
309 310
       ul_max_harq_tx: 5,
       dl_max_harq_tx: 5,
311 312
    },

313
    pusch_max_its: 6,
314 315 316 317 318 319 320 321

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

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

Kirill Smelkov's avatar
.  
Kirill Smelkov committed
322
    // XXX -> cell ?
323
    inactivity_timer: {{ slapparameter_dict.get('inactivity_timer', slap_configuration['configuration.default_lte_inactivity_timer']) }},
324 325 326 327 328 329 330 331 332 333 334 335 336 337 338

    srb_config: [
      {
        id: 1,
        maxRetxThreshold: 32,
        t_Reordering: 45,
        t_PollRetransmit: 60,
      },
      {
        id: 2 ,
        maxRetxThreshold: 32,
        t_Reordering: 45,
        t_PollRetransmit: 60,
      }
    ],
Kirill Smelkov's avatar
.  
Kirill Smelkov committed
339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355

  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: {{ slapparameter_dict.get('lte_handover_a3_offset', 6) }},
    a3_hysteresis: 0,
    a3_time_to_trigger: {{ slapparameter_dict.get('lte_handover_a3_time_to_trigger', 480) }},
  },
  meas_gap_config: "gp0",
  ho_from_meas: true,
Kirill Smelkov's avatar
.  
Kirill Smelkov committed
356
  }
Kirill Smelkov's avatar
.  
Kirill Smelkov committed
357

358
  // NR cells   XXX restore
Kirill Smelkov's avatar
Kirill Smelkov committed
359
{#
Kirill Smelkov's avatar
.  
Kirill Smelkov committed
360 361
  nr_cell_list: [
{%- for i, (cell_ref, icell) in enumerate(icell_dict|dictsort) %}
Kirill Smelkov's avatar
.  
Kirill Smelkov committed
362 363 364 365 366
{%-   set cell = icell['_']                               %}
{%-   if cell.cell_type == 'nr'                           %}
{%-     set ru_ref = J(jcell_ru_ref(icell, icell_dict))   %}
{%-     set iru = iru_dict[ru_ref]                        %}
{%-     set ru = iru['_']                                 %}
Kirill Smelkov's avatar
.  
Kirill Smelkov committed
367

Kirill Smelkov's avatar
.  
Kirill Smelkov committed
368
        // {{ cell_ref }}  ({{ ru_ref }})
Kirill Smelkov's avatar
.  
Kirill Smelkov committed
369
        {
370 371 372
          rf_port:      {{ ru._rf_port }},
          n_antenna_dl: {{ ru.n_antenna_dl }},
          n_antenna_ul: {{ ru.n_antenna_ul }},
Kirill Smelkov's avatar
.  
Kirill Smelkov committed
373

374 375 376 377
          cell_id:      {{ cell.cell_id }},
          n_id_cell:    {{ cell.pci }},
          band:         {{ cell.nr_band }},
          dl_nr_arfcn:  {{ cell.dl_nr_arfcn }},
Kirill Smelkov's avatar
.  
Kirill Smelkov committed
378
          ul_nr_arfcn:  {{ cell.ul_nr_arfcn }},
379
          bandwidth:    {{ cell.bandwidth }},
Kirill Smelkov's avatar
.  
Kirill Smelkov committed
380

Kirill Smelkov's avatar
.  
Kirill Smelkov committed
381
          subcarrier_spacing: {{ 30  if cell.rf_mode == 'tdd'  else 15 }},
Kirill Smelkov's avatar
.  
Kirill Smelkov committed
382
          ssb_nr_arfcn:   {{ cell.ssb_nr_arfcn }},
383
          ssb_pos_bitmap: {{ cell.ssb_pos_bitmap }},
Kirill Smelkov's avatar
.  
Kirill Smelkov committed
384

Kirill Smelkov's avatar
.  
Kirill Smelkov committed
385 386 387
          root_sequence_index: 1,   // XXX adjust from cfg('root_sequence_index') XXX place


Kirill Smelkov's avatar
.  
Kirill Smelkov committed
388
        // XXX peers for HO
Kirill Smelkov's avatar
.  
Kirill Smelkov committed
389 390

        // XXX CA
Kirill Smelkov's avatar
.  
Kirill Smelkov committed
391 392 393 394 395 396 397 398 399 400 401

        // tune NR parameters for the cell
        {%- if slapparameter_dict.get('rrh', 'ORS') == "ORS" %}
            manual_ref_signal_power: true,
        {%- if 'XXX_one_watt' == "True" %}
            ss_pbch_block_power: {{ (tx_gain | int)  - 54 }},
        {%- else %}
            ss_pbch_block_power: {{ (tx_gain | int) - 35 }},
        {%- endif -%}
        {%- endif %}

402
{%-       set tdd = (cell.rf_mode == 'tdd') %}
Kirill Smelkov's avatar
.  
Kirill Smelkov committed
403
{%-       set tdd_config = lte.nr_cell_tdd_config(cell) if tdd else None %},
Kirill Smelkov's avatar
.  
Kirill Smelkov committed
404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435

{%        if tdd_config == 1 %}
           tdd_ul_dl_config: {
             pattern1: {
               period: 5,
               dl_slots: 7,
               dl_symbols: 6,
               ul_slots: 2,
               ul_symbols: 4,
             },
           },
{%        elif tdd_config == 2 %}
           tdd_ul_dl_config: {
             pattern1: {
               period: 2.5,
               dl_slots: 3,
               dl_symbols: 10,
               ul_slots: 1,
               ul_symbols: 2,
             },
           },
{%        elif tdd_config == 3 %}
           tdd_ul_dl_config: {
             pattern1: {
                period: 5, /* in ms */
                dl_slots: 1,
                dl_symbols: 10,
                ul_slots: 8,
                ul_symbols: 2,
             },
           },
{%        endif %}
Kirill Smelkov's avatar
.  
Kirill Smelkov committed
436

Kirill Smelkov's avatar
.  
Kirill Smelkov committed
437
        },
Kirill Smelkov's avatar
.  
Kirill Smelkov committed
438

Kirill Smelkov's avatar
.  
Kirill Smelkov committed
439 440 441
{%-   endif %}
{%- endfor %}
  ],
Kirill Smelkov's avatar
.  
Kirill Smelkov committed
442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519

  nr_cell_default: {
    ssb_period: 20,

    plmn_list: [
{%- if slapparameter_dict.get('plmn_list', '') %}
{%- for i, k in enumerate(slapparameter_dict['plmn_list']) %}
{%- if i == 0 -%}
      {
{%- else -%}
      , {
{%- endif %}
      plmn: "{{ slapparameter_dict['plmn_list'][k]['plmn'] }}",
      tac: {{ slapparameter_dict['plmn_list'][k].get('tac', 100) }},
{%- if slapparameter_dict['plmn_list'][k].get('ranac', '') %}
      ranac: {{ slapparameter_dict['plmn_list'][k]['ranac'] }},
{%- endif %}
      reserved: {{ str(slapparameter_dict['plmn_list'][k].get('reserved', false)).lower() }},
      nssai: [
{%- if slapparameter_dict.get('nssai', '') %}
{%- for j, k in enumerate(slapparameter_dict['nssai']) %}
{%- if j == 0 %}
        {
{%- else -%}
        , {
{%- endif %}
         sst: {{ slapparameter_dict['nssai'][k]['sst'] }},
{%- if slapparameter_dict['nssai'][k].get('sd', '') %}
         sd: {{ slapparameter_dict['nssai'][k]['sd'] }},
{%- endif %}
        }
{%- endfor -%}
{% else %}
        {
         sst: 1,
        },
{% endif %}
      ],
      }
{%- endfor -%}
{% else %}
      {
      plmn: "00101",
      tac: 100,
      reserved: false,
      nssai: [
{%- if slapparameter_dict.get('nssai', '') %}
{%- for j, k in enumerate(slapparameter_dict['nssai']) %}
{%- if j == 0 %}
        {
{%- else -%}
        , {
{%- endif %}
         sst: {{ slapparameter_dict['nssai'][k]['sst'] }},
{%- if slapparameter_dict['nssai'][k].get('sd', '') %}
         sd: {{ slapparameter_dict['nssai'][k]['sd'] }},
{%- endif %}
        }
{%- endfor -%}
{% else %}
        {
         sst: 1,
        },
{% endif %}
       ],
      },
{%- endif %}
    ],

    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: {
Kirill Smelkov's avatar
Kirill Smelkov committed
520
      prach_config_index: 160,      // XXX TDD only & TDD_CONFIG != 4
Kirill Smelkov's avatar
.  
Kirill Smelkov committed
521 522
      msg1_subcarrier_spacing: 30,
      msg1_fdm: 1,
Kirill Smelkov's avatar
.  
Kirill Smelkov committed
523
{% if ru.ru_type == 'sunwave' %}
Kirill Smelkov's avatar
.  
Kirill Smelkov committed
524 525 526 527 528 529 530 531
      msg1_frequency_start: 0,
{% else %}
      msg1_frequency_start: -1,
{% endif %}
      zero_correlation_zone_config: 15,
      preamble_received_target_power: -110,
      preamble_trans_max: 7,
      power_ramping_step: 4,
Kirill Smelkov's avatar
Kirill Smelkov committed
532
      ra_response_window: {{ 20 if tdd else 10 }},
Kirill Smelkov's avatar
.  
Kirill Smelkov committed
533 534 535 536 537 538
      restricted_set_config: "unrestricted_set",
      ra_contention_resolution_timer: 64,
      ssb_per_prach_occasion: 1,
      cb_preambles_per_ssb: 8,
    },
    pdcch: {
Kirill Smelkov's avatar
.  
Kirill Smelkov committed
539
{% if ru.ru_type == 'sunwave' %}
Kirill Smelkov's avatar
.  
Kirill Smelkov committed
540 541 542 543 544 545 546
      n_rb_coreset0: 48,
      n_symb_coreset0: 1,
{% endif %}
      search_space0_index: 0,
      dedicated_coreset: {
        rb_start: -1,
        l_crb: -1,
Kirill Smelkov's avatar
.  
Kirill Smelkov committed
547
{% if ru.ru_type == 'sunwave' %}
Kirill Smelkov's avatar
.  
Kirill Smelkov committed
548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576
        duration: 1,
{% else %}
        duration: 0,
{% endif %}
        precoder_granularity: "sameAsREG_bundle",
      },
      css: {
        n_candidates: [ 0, 0, 4, 0, 0 ],
      },
      rar_al_index: 2,
      si_al_index: 2,
{% if tdd_config == 3 %}
      uss: {
       n_candidates: [ 0, 8, 1, 0, 0 ],
       dci_0_1_and_1_1: true,
      },
{% else %}
      uss: {
        n_candidates: [ 0, 2, 1, 0, 0 ],
        dci_0_1_and_1_1: true,
      },
{% endif %}
      al_index: 1,
    },
    pdsch: {
      mapping_type: "typeA",
      dmrs_add_pos: 1,
      dmrs_type: 1,
      dmrs_max_len: 1,
Kirill Smelkov's avatar
.  
Kirill Smelkov committed
577
{% if ru.ru_type == 'sunwave' %}
Kirill Smelkov's avatar
.  
Kirill Smelkov committed
578 579 580
      k0: 0,
      k1: [ 8, 7, 7, 6, 5, 4, 12, 11 ],
{% elif tdd_config == 3 %}
Kirill Smelkov's avatar
.  
Kirill Smelkov committed
581
      k1: [4, 11],
Kirill Smelkov's avatar
.  
Kirill Smelkov committed
582 583 584 585 586 587 588 589 590
{% endif %}
      mcs_table: "qam256",
      rar_mcs: 2,
      si_mcs: 6,
    },
    csi_rs: {
      nzp_csi_rs_resource: [
        {
          csi_rs_id: 0,
Kirill Smelkov's avatar
.  
Kirill Smelkov committed
591
{%- if ru.n_antenna_dl == 1     %}
Kirill Smelkov's avatar
.  
Kirill Smelkov committed
592 593 594 595
          n_ports: 1,
          frequency_domain_allocation: "row2",
          bitmap: "100000000000",
          cdm_type: "no_cdm",
Kirill Smelkov's avatar
.  
Kirill Smelkov committed
596
{%- elif ru.n_antenna_dl == 2   %}
Kirill Smelkov's avatar
.  
Kirill Smelkov committed
597 598 599 600
          n_ports: 2,
          frequency_domain_allocation: "other",
          bitmap: "100000",
          cdm_type: "fd_cdm2",
Kirill Smelkov's avatar
.  
Kirill Smelkov committed
601
{%- elif ru.n_antenna_dl == 4   %}
Kirill Smelkov's avatar
.  
Kirill Smelkov committed
602 603 604 605
          n_ports: 4,
          frequency_domain_allocation: "row4",
          bitmap: "100",
          cdm_type: "fd_cdm2",
Kirill Smelkov's avatar
.  
Kirill Smelkov committed
606
{%- elif ru.n_antenna_dl == 8   %}
Kirill Smelkov's avatar
.  
Kirill Smelkov committed
607 608 609 610
          n_ports: 8,
          frequency_domain_allocation: "other",
          bitmap: "110011",
          cdm_type: "fd_cdm2",
Kirill Smelkov's avatar
.  
Kirill Smelkov committed
611 612 613
{%- else  %}
{%-  do error(icell, "unsupported number of DL antennas")   %}
{%- endif %}
Kirill Smelkov's avatar
.  
Kirill Smelkov committed
614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769
          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,
        },
{% if tdd_config != 3 %}
        {
          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,
        },
{% endif %}
      ],
      nzp_csi_rs_resource_set: [
        {
          csi_rs_set_id: 0,
          nzp_csi_rs_resources: [ 0 ],
          repetition: false,
        },
{% if tdd_config != 3 %}
        {
          csi_rs_set_id: 1,
          nzp_csi_rs_resources: [ 1, 2, 3, 4 ],
          repetition: false,
          trs_info: true,
        },
{% endif %}
      ],
     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",
        },
{% if tdd_config != 3 %}
        {
          csi_rsc_config_id: 2,
          nzp_csi_rs_resource_set_list: [ 1 ],
          resource_type: "periodic",
        },
{% endif %}
      ],
      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",
Kirill Smelkov's avatar
.  
Kirill Smelkov committed
770
{%- if ru.n_antenna_dl > 1  %}
Kirill Smelkov's avatar
.  
Kirill Smelkov committed
771 772 773
          codebook_config: {
            codebook_type: "type1",
            sub_type: "typeI_SinglePanel",
Kirill Smelkov's avatar
.  
Kirill Smelkov committed
774 775
{%-   if ru.n_antenna_dl == 2     %}
{%-   elif ru.n_antenna_dl == 4   %}
Kirill Smelkov's avatar
.  
Kirill Smelkov committed
776 777 778
            n1: 2,
            n2: 1,
            codebook_mode: 1,
Kirill Smelkov's avatar
.  
Kirill Smelkov committed
779
{%-   elif ru.n_antenna_dl == 8   %}
Kirill Smelkov's avatar
.  
Kirill Smelkov committed
780 781 782
            n1: 4,
            n2: 1,
            codebook_mode: 1,
Kirill Smelkov's avatar
.  
Kirill Smelkov committed
783
{%-   endif                       %}
Kirill Smelkov's avatar
.  
Kirill Smelkov committed
784
          },
Kirill Smelkov's avatar
.  
Kirill Smelkov committed
785
{%- endif   %}
Kirill Smelkov's avatar
.  
Kirill Smelkov committed
786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818
          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,
Kirill Smelkov's avatar
.  
Kirill Smelkov committed
819
{% if ru.ru_type == 'sunwave' %}
Kirill Smelkov's avatar
.  
Kirill Smelkov committed
820 821 822
      k2: 4,
      msg3_k2: 7,
{% elif tdd_config == 3 %}
Kirill Smelkov's avatar
.  
Kirill Smelkov committed
823
      k2: [11, 12, 4, 5, 6, 7, 7, 8],
Kirill Smelkov's avatar
.  
Kirill Smelkov committed
824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847
      msg3_k2: 7,
{% endif %}
      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: {{ slapparameter_dict.get('inactivity_timer', slap_configuration['configuration.default_nr_inactivity_timer']) }},
Kirill Smelkov's avatar
.  
Kirill Smelkov committed
848

Kirill Smelkov's avatar
.  
Kirill Smelkov committed
849
    drb_config: "{{ cell_ref }}-drb.cfg",
Kirill Smelkov's avatar
.  
Kirill Smelkov committed
850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870

  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: {{ slapparameter_dict.get('nr_handover_a3_offset', 6) }},
    a3_hysteresis: 0,
    a3_time_to_trigger: {{ slapparameter_dict.get('nr_handover_time_to_trigger', 100) }},
    ssb_rsrq_filter_coeff: 3,
    ssb_sinr_filter_coeff: 5
  },
  meas_gap_config: {
    pattern_id: 0
  },
  },
Kirill Smelkov's avatar
Kirill Smelkov committed
871
#}
Kirill Smelkov's avatar
.  
Kirill Smelkov committed
872
}