Commit f365a440 authored by Kirill Smelkov's avatar Kirill Smelkov

software/ors-amarisoft: Merge gnb.jinja2.cfg into enb.jinja2.cfg

In MultiRU there will be only one ENB which supports all TDD, FDD, LTE and NR
cells and different types of radio units - all at the same time. This patch is
preparatory step for that: it merges gnb configuration template into enb
configuration template, so that enb.jinja2.cfg now serves both enb and gnb
instances.

In this patch for now we only move code from gnb.jinja2.cfg without changing
it(*) and wrap parts with `if do_lte` and `if do_nr` correspondingly.

The end result of rendered enb.cfg and gnb.cfg stays the same modulo space
changes and added innoccent `#define TDD` as Appendix shows.

(*) the only exception is set up of gtp_addr which has practically the same
code, was wrapped with `if mme_list` in enb and `if amf_list` in gnb, and is now
wrapped with `if mme_list or amf_list`.

/cc @lu.xu, @tomo, @xavier_thompson, @Daetalus
/reviewed-by @jhuge
/reviewed-on nexedi/slapos!1512

--------

Appendix. Diff for rendered enb.cfg and gnb.cfg before and after this patch.

```
$ ./pythonwitheggs slapos-render-config.py && (git diff -w --no-index config/enb.cfg.old config/enb.cfg ; git diff -w --no-index config/gnb.cfg.old config/gnb.cfg)
```

```diff
diff --git a/config/enb.cfg.old b/config/enb.cfg
index fdf3ab24d..cb46697ea 100644
--- a/config/enb.cfg.old
+++ b/config/enb.cfg
@@ -1,11 +1,15 @@

+
 #define TDD                 1

 #define N_RB_DL             50
+
 #define N_ANTENNA_DL        2
+
 #define N_ANTENNA_UL        2

+
 {

   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,phy.level=info,file.rota>
@@ -24,7 +28,6 @@
   rx_gain: 43,

   com_addr: "127.0.1.2:9001",
-
   mme_list: [

     {
@@ -33,9 +36,9 @@

   ],

+
   gtp_addr: "127.0.1.1",

-
   enb_id: 0x1A2D0,

   cell_list: [{
@@ -49,7 +52,6 @@
       ],
     }
   ],
-
   cell_default: {
     plmn_list: [
       "00101",
@@ -226,4 +228,6 @@
   meas_gap_config: "gp0",
   ho_from_meas: true,
   },
+
+
 }
\ No newline at end of file
diff --git a/config/gnb.cfg.old b/config/gnb.cfg
index e3d671e09..4e47a2094 100644
--- a/config/gnb.cfg.old
+++ b/config/gnb.cfg
@@ -1,15 +1,21 @@

+
+#define TDD                 1
+
+
 #define N_ANTENNA_DL        2

 #define N_ANTENNA_UL        2

+
 {

   log_options: "all.level=error,all.max_size=0,nas.level=debug,nas.max_size=1,ngap.level=debug,ngap.max_size=1,xnap.level=debug,xnap.max_size=1,rrc.level=debug,rrc.max_size=1,phy.level=info,file.rota>

   log_filename: "log/gnb.log",

+
   rf_driver: {
       name: "sdr",
       args: "dev0=/dev/sdr0",
@@ -30,15 +36,17 @@
   ],

-
-
   gtp_addr: "127.0.1.1",

   gnb_id_bits: 28,
   gnb_id: 0x12345,
   en_dc_support: true,
-  cell_list: [],
+
+  cell_list: [
+  ],
+
+
   nr_cell_list: [
   {
     rf_port: 0,
```
parent d078060c
Pipeline #32296 passed with stage
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
[template] [template]
filename = instance.cfg filename = instance.cfg
md5sum = 46556429e86a96f4cd49084e1c96123f md5sum = 12591aca22ddc61f9fb1ec7e596873e3
[slaplte.jinja2] [slaplte.jinja2]
_update_hash_filename_ = slaplte.jinja2 _update_hash_filename_ = slaplte.jinja2
...@@ -80,11 +80,11 @@ md5sum = 52da9fe3a569199e35ad89ae1a44c30e ...@@ -80,11 +80,11 @@ md5sum = 52da9fe3a569199e35ad89ae1a44c30e
[template-enb] [template-enb]
_update_hash_filename_ = instance-enb.jinja2.cfg _update_hash_filename_ = instance-enb.jinja2.cfg
md5sum = 78ca387cee8121771186c36c8044b536 md5sum = ae49a3a9a97407f9aea30981403ee1a2
[template-gnb] [template-gnb]
_update_hash_filename_ = instance-gnb.jinja2.cfg _update_hash_filename_ = instance-gnb.jinja2.cfg
md5sum = 2308c4cb644863ab322b91bb325d3460 md5sum = 54a0c7c3a2a1c905a15c58c650ee1095
[template-core-network] [template-core-network]
_update_hash_filename_ = instance-core-network.jinja2.cfg _update_hash_filename_ = instance-core-network.jinja2.cfg
...@@ -108,7 +108,7 @@ md5sum = dcaac06553a3222b14c0013a13f4a149 ...@@ -108,7 +108,7 @@ md5sum = dcaac06553a3222b14c0013a13f4a149
[enb.jinja2.cfg] [enb.jinja2.cfg]
filename = config/enb.jinja2.cfg filename = config/enb.jinja2.cfg
md5sum = d1ddb99444cdb5413781a900518c73f9 md5sum = 914d781af63f4214e6cc3be4ffe93215
[drb_lte.jinja2.cfg] [drb_lte.jinja2.cfg]
filename = config/drb_lte.jinja2.cfg filename = config/drb_lte.jinja2.cfg
...@@ -122,10 +122,6 @@ md5sum = 84d3cef8fc7f1c2aed7c348d500f5636 ...@@ -122,10 +122,6 @@ md5sum = 84d3cef8fc7f1c2aed7c348d500f5636
filename = config/sib23.jinja2.asn filename = config/sib23.jinja2.asn
md5sum = a1973ba6e43d40e510d61d461c2d13ac md5sum = a1973ba6e43d40e510d61d461c2d13ac
[gnb.jinja2.cfg]
filename = config/gnb.jinja2.cfg
md5sum = a4f91c1c9cfd91d000f4845a88cdb38a
[mme.jinja2.cfg] [mme.jinja2.cfg]
filename = config/mme.jinja2.cfg filename = config/mme.jinja2.cfg
md5sum = 3d7833ddba3242cedcd74c7db52390c6 md5sum = 3d7833ddba3242cedcd74c7db52390c6
......
...@@ -7,16 +7,37 @@ ...@@ -7,16 +7,37 @@
{%- do slaplte.load_cell(cell_list) %} {%- do slaplte.load_cell(cell_list) %}
{%- endif %} {%- endif %}
{#- do_lte/do_nr indicate whether we have LTE or NR cell #}
{%- do assert(do_lte or do_nr) %}
{%- do assert(not (do_lte and do_nr)) %}
{%- if do_lte %}
{%- if slapparameter_dict.get('tdd_ul_dl_config', '[Configuration 2] 5ms 2UL 6DL (default)') == '[Configuration 2] 5ms 2UL 6DL (default)' %} {%- if slapparameter_dict.get('tdd_ul_dl_config', '[Configuration 2] 5ms 2UL 6DL (default)') == '[Configuration 2] 5ms 2UL 6DL (default)' %}
{%- set tdd_config = 2 %} {%- set tdd_config = 2 %}
{%- elif slapparameter_dict.get('tdd_ul_dl_config', '[Configuration 2] 5ms 2UL 6DL (default)') == '[Configuration 6] 5ms 5UL 3DL (maximum uplink)' %} {%- elif slapparameter_dict.get('tdd_ul_dl_config', '[Configuration 2] 5ms 2UL 6DL (default)') == '[Configuration 6] 5ms 5UL 3DL (maximum uplink)' %}
{%- set tdd_config = 6 %} {%- set tdd_config = 6 %}
{%- endif %} {%- endif %}
{%- endif %}
{%- if do_nr %}
{%- if slapparameter_dict.get('tdd_ul_dl_config', '5ms 2UL 7DL 4/6 (default)') == '5ms 2UL 7DL 4/6 (default)' %}
{%- set tdd_config = 1 %}
{%- elif slapparameter_dict.get('tdd_ul_dl_config', '5ms 2UL 7DL 4/6 (default)') == '2.5ms 1UL 3DL 2/10' %}
{%- set tdd_config = 2 %}
{%- elif slapparameter_dict.get('tdd_ul_dl_config', '5ms 2UL 7DL 4/6 (default)') == '5ms 8UL 1DL 2/10 (maximum uplink)' %}
{%- set tdd_config = 3 %}
{%- endif %}
{%- endif %}
{% if rf_mode == 'tdd' %} {% if rf_mode == 'tdd' %}
#define TDD 1 #define TDD 1
{% else %} {% else %}
#define TDD 0 #define TDD 0
{% endif %} {% endif %}
{%- if do_lte %}
{%- if slapparameter_dict.get('bandwidth', slap_configuration['configuration.default_lte_bandwidth']) == '1.4 MHz' %} {%- if slapparameter_dict.get('bandwidth', slap_configuration['configuration.default_lte_bandwidth']) == '1.4 MHz' %}
#define N_RB_DL 6 #define N_RB_DL 6
{%- elif slapparameter_dict.get('bandwidth', slap_configuration['configuration.default_lte_bandwidth']) == '3 MHz' %} {%- elif slapparameter_dict.get('bandwidth', slap_configuration['configuration.default_lte_bandwidth']) == '3 MHz' %}
...@@ -30,16 +51,33 @@ ...@@ -30,16 +51,33 @@
{%- elif slapparameter_dict.get('bandwidth', slap_configuration['configuration.default_lte_bandwidth']) == '20 MHz' %} {%- elif slapparameter_dict.get('bandwidth', slap_configuration['configuration.default_lte_bandwidth']) == '20 MHz' %}
#define N_RB_DL 100 #define N_RB_DL 100
{%- endif %} {%- endif %}
{%- endif %}
#define N_ANTENNA_DL {{ slapparameter_dict.get('n_antenna_dl', slap_configuration['configuration.default_n_antenna_dl']) }} #define N_ANTENNA_DL {{ slapparameter_dict.get('n_antenna_dl', slap_configuration['configuration.default_n_antenna_dl']) }}
{% if ru == "m2ru" %}
#define N_ANTENNA_UL {{ slapparameter_dict.get('n_antenna_ul', 1) }}
{% else %}
#define N_ANTENNA_UL {{ slapparameter_dict.get('n_antenna_ul', slap_configuration['configuration.default_n_antenna_ul']) }} #define N_ANTENNA_UL {{ slapparameter_dict.get('n_antenna_ul', slap_configuration['configuration.default_n_antenna_ul']) }}
{% endif %}
{ {
{%- if do_lte %}
{% if slapparameter_dict.get('log_phy_debug', False) %} {% if slapparameter_dict.get('log_phy_debug', False) %}
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,phy.level=debug,file.rotate=1G,file.path=/dev/null", 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,phy.level=debug,file.rotate=1G,file.path=/dev/null",
{% else %} {% else %}
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,phy.level=info,file.rotate=1G,file.path=/dev/null", 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,phy.level=info,file.rotate=1G,file.path=/dev/null",
{% endif %} {% endif %}
log_filename: "{{ directory['log'] }}/enb.log", log_filename: "{{ directory['log'] }}/enb.log",
{%- endif %}
{%- if do_nr %}
{% if slapparameter_dict.get('log_phy_debug', False) %}
log_options: "all.level=error,all.max_size=0,nas.level=debug,nas.max_size=1,ngap.level=debug,ngap.max_size=1,xnap.level=debug,xnap.max_size=1,rrc.level=debug,rrc.max_size=1,phy.level=debug,file.rotate=1G,file.path=/dev/null",
{% else %}
log_options: "all.level=error,all.max_size=0,nas.level=debug,nas.max_size=1,ngap.level=debug,ngap.max_size=1,xnap.level=debug,xnap.max_size=1,rrc.level=debug,rrc.max_size=1,phy.level=info,file.rotate=1G,file.path=/dev/null",
{% endif %}
log_filename: "{{ directory['log'] }}/gnb.log",
{%- endif %}
{% if ru == "lopcomm" %} {% if ru == "lopcomm" %}
rf_driver: { rf_driver: {
...@@ -95,6 +133,23 @@ ...@@ -95,6 +133,23 @@
}, },
tx_gain: 0, tx_gain: 0,
rx_gain: 0, rx_gain: 0,
{% elif ru == "m2ru" %}
rf_driver: {
{%- if slapparameter_dict.get('disable_sdr', False) %}
name: "dummy",
{%- else %}
name: "sdr",
{%- endif %}
args: "dev0=/dev/sdr0@0",
cpri_mapping: "bf1",
cpri_mult: 16,
cpri_rx_delay: 11.0,
cpri_tx_delay: 0,
ifname: "cpri0",
cpri_tx_dbm: 42.0,
},
tx_gain: 0,
rx_gain: 0,
{% elif bbu == "ors" %} {% elif bbu == "ors" %}
rf_driver: { rf_driver: {
{%- if slapparameter_dict.get('disable_sdr', False) %} {%- if slapparameter_dict.get('disable_sdr', False) %}
...@@ -121,6 +176,7 @@ ...@@ -121,6 +176,7 @@
com_addr: "{{ slap_configuration['configuration.com_addr'] }}:{{ slap_configuration['configuration.com_ws_port'] }}", com_addr: "{{ slap_configuration['configuration.com_addr'] }}:{{ slap_configuration['configuration.com_ws_port'] }}",
{%- endif %} {%- endif %}
{%- if do_lte %}
mme_list: [ mme_list: [
{% if slapparameter_dict.get('mme_list', '') %} {% if slapparameter_dict.get('mme_list', '') %}
{%- for i, k in enumerate(slapparameter_dict['mme_list']) %} {%- for i, k in enumerate(slapparameter_dict['mme_list']) %}
...@@ -138,7 +194,29 @@ ...@@ -138,7 +194,29 @@
}, },
{% endif %} {% endif %}
], ],
{% if slapparameter_dict.get('mme_list', '') %} {%- endif %}
{%- if do_nr %}
amf_list: [
{% if slapparameter_dict.get('amf_list', '') %}
{%- for i, k in enumerate(slapparameter_dict['amf_list']) %}
{%- if i == 0 %}
{
{%- else -%}
, {
{%- endif %}
amf_addr: "{{ slapparameter_dict['amf_list'][k]['amf_addr'] }}",
}
{%- endfor -%}
{% else %}
{
amf_addr: "{{ slap_configuration['configuration.amf_addr'] }}",
},
{% endif %}
],
{%- endif %}
{% if slapparameter_dict.get('mme_list', '') or slapparameter_dict.get('amf_list', '') %}
{% if slapparameter_dict.get('gtp_addr') %} {% if slapparameter_dict.get('gtp_addr') %}
gtp_addr: "{{ slapparameter_dict.get('gtp_addr') }}", gtp_addr: "{{ slapparameter_dict.get('gtp_addr') }}",
{% else %} {% else %}
...@@ -152,9 +230,27 @@ ...@@ -152,9 +230,27 @@
gtp_addr: "{{ slap_configuration['configuration.gtp_addr'] }}", gtp_addr: "{{ slap_configuration['configuration.gtp_addr'] }}",
{% endif %} {% endif %}
{%- if do_nr %}
{% if slapparameter_dict.get('xn_peers', '') %}
xn_peers: [
{%- for k in slapparameter_dict['xn_peers'] -%}
"{{ slapparameter_dict['xn_peers'][k]['xn_addr'] }}",
{%- endfor -%}
],
{% endif %}
{%- endif %}
{%- if do_lte %}
enb_id: {{ slapparameter_dict.get('enb_id', '0x1A2D0') }}, enb_id: {{ slapparameter_dict.get('enb_id', '0x1A2D0') }},
{%- endif %}
{%- if do_nr %}
gnb_id_bits: {{ slapparameter_dict.get('gnb_id_bits', 28) }},
gnb_id: {{ slapparameter_dict.get('gnb_id', '0x12345') }},
en_dc_support: true,
{%- endif %}
cell_list: [ cell_list: [
{%- if do_lte %}
{%- for i, k in enumerate(cell_list) %} {%- for i, k in enumerate(cell_list) %}
{%- if i == 0 -%} {%- if i == 0 -%}
{ {
...@@ -203,8 +299,10 @@ ...@@ -203,8 +299,10 @@
], ],
} }
{%- endfor %} {%- endfor %}
{%- endif %}
], ],
{%- if do_lte %}
cell_default: { cell_default: {
plmn_list: [ plmn_list: [
{%- if slapparameter_dict.get('plmn_list', '') %} {%- if slapparameter_dict.get('plmn_list', '') %}
...@@ -394,4 +492,514 @@ ...@@ -394,4 +492,514 @@
meas_gap_config: "gp0", meas_gap_config: "gp0",
ho_from_meas: true, ho_from_meas: true,
}, },
{%- endif %}
{% if do_nr %}
nr_cell_list: [
{
rf_port: 0,
cell_id: {{ slapparameter_dict.get('cell_id', '0x01') }},
band: {{ nr_band }},
dl_nr_arfcn: {{ nr_arfcn }},
subcarrier_spacing: 30,
ssb_pos_bitmap: "{{ slapparameter_dict.get('ssb_pos_bitmap', slap_configuration['configuration.default_nr_ssb_pos_bitmap']) }}",
{%- if slapparameter_dict.get('ncell_list', '') %}
ncell_list: [
{%- for i, k in enumerate(slapparameter_dict['ncell_list']) %}
{%- if i == 0 -%}
{
{%- else -%}
, {
{%- endif %}
rat: "nr",
dl_nr_arfcn: {{ slapparameter_dict['ncell_list'][k].get('dl_nr_arfcn', '') }},
ssb_nr_arfcn: {{ slapparameter_dict['ncell_list'][k].get('ssb_nr_arfcn', '') }},
ul_nr_arfcn: {{ slapparameter_dict['ncell_list'][k].get('dl_nr_arfcn', '') }},
n_id_cell: {{ slapparameter_dict['ncell_list'][k].get('pci', '') }},
gnb_id_bits: {{ slapparameter_dict['ncell_list'][k].get('gnb_id_bits', '') }},
nr_cell_id: {{ slapparameter_dict['ncell_list'][k].get('nr_cell_id', '') }},
tac: {{ slapparameter_dict['ncell_list'][k].get('tac', 1) }},
band: {{ slapparameter_dict['ncell_list'][k].get('nr_band', '') }},
ssb_subcarrier_spacing: 30,
ssb_period: 20,
ssb_offset: 0,
ssb_duration: 1,
}
{%- endfor -%}
],
{% endif %}
},
],
nr_cell_default: {
bandwidth: {{ slapparameter_dict.get('nr_bandwidth', slap_configuration['configuration.default_nr_bandwidth']) }},
n_antenna_dl: N_ANTENNA_DL,
n_antenna_ul: N_ANTENNA_UL,
{%- if bbu == "ors" %}
manual_ref_signal_power: true,
{%- if one_watt == "True" %}
ss_pbch_block_power: {{ (tx_gain | int) - 54 }},
{%- else %}
ss_pbch_block_power: {{ (tx_gain | int) - 35 }},
{%- endif -%}
{%- endif %}
{% 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 %}
ssb_period: 20,
n_id_cell: {{ slapparameter_dict.get('pci', 500) }},
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,
root_sequence_index: 1,
sr_period: 40,
dmrs_type_a_pos: 2,
prach: {
prach_config_index: 160,
msg1_subcarrier_spacing: 30,
msg1_fdm: 1,
{% if ru == "m2ru" %}
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,
ra_response_window: 20,
restricted_set_config: "unrestricted_set",
ra_contention_resolution_timer: 64,
ssb_per_prach_occasion: 1,
cb_preambles_per_ssb: 8,
},
pdcch: {
{% if ru == "m2ru" %}
n_rb_coreset0: 48,
n_symb_coreset0: 1,
{% endif %}
search_space0_index: 0,
dedicated_coreset: {
rb_start: -1,
l_crb: -1,
{% if ru == "m2ru" %}
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,
{% if ru == "m2ru" %}
k0: 0,
k1: [ 8, 7, 7, 6, 5, 4, 12, 11 ],
{% elif tdd_config == 3 %}
k1: [4, 11],
{% endif %}
mcs_table: "qam256",
rar_mcs: 2,
si_mcs: 6,
},
csi_rs: {
nzp_csi_rs_resource: [
{
csi_rs_id: 0,
#if N_ANTENNA_DL == 1
n_ports: 1,
frequency_domain_allocation: "row2",
bitmap: "100000000000",
cdm_type: "no_cdm",
#elif N_ANTENNA_DL == 2
n_ports: 2,
frequency_domain_allocation: "other",
bitmap: "100000",
cdm_type: "fd_cdm2",
#elif N_ANTENNA_DL == 4
n_ports: 4,
frequency_domain_allocation: "row4",
bitmap: "100",
cdm_type: "fd_cdm2",
#elif N_ANTENNA_DL == 8
n_ports: 8,
frequency_domain_allocation: "other",
bitmap: "110011",
cdm_type: "fd_cdm2",
#else
#error unsupported number of DL antennas
#endif
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",
#if N_ANTENNA_DL > 1
codebook_config: {
codebook_type: "type1",
sub_type: "typeI_SinglePanel",
#if N_ANTENNA_DL == 2
#elif N_ANTENNA_DL == 4
n1: 2,
n2: 1,
codebook_mode: 1,
#elif N_ANTENNA_DL == 8
n1: 4,
n2: 1,
codebook_mode: 1,
#endif
},
#endif
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: {
dpc_snr_target: 25,
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,
{% if ru == "m2ru" %}
k2: 4,
msg3_k2: 7,
{% elif tdd_config == 3 %}
k2: [11, 12, 4, 5, 6, 7, 7, 8],
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']) }},
drb_config: "{{ drb_file }}",
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
},
},
{%- endif %}
} }
{%- if slapparameter_dict.get('tdd_ul_dl_config', '5ms 2UL 7DL 4/6 (default)') == '5ms 2UL 7DL 4/6 (default)' %}
{%- set tdd_config = 1 %}
{%- elif slapparameter_dict.get('tdd_ul_dl_config', '5ms 2UL 7DL 4/6 (default)') == '2.5ms 1UL 3DL 2/10' %}
{%- set tdd_config = 2 %}
{%- elif slapparameter_dict.get('tdd_ul_dl_config', '5ms 2UL 7DL 4/6 (default)') == '5ms 8UL 1DL 2/10 (maximum uplink)' %}
{%- set tdd_config = 3 %}
{%- endif %}
#define N_ANTENNA_DL {{ slapparameter_dict.get('n_antenna_dl', slap_configuration['configuration.default_n_antenna_dl']) }}
{% if ru == "m2ru" %}
#define N_ANTENNA_UL {{ slapparameter_dict.get('n_antenna_ul', 1) }}
{% else %}
#define N_ANTENNA_UL {{ slapparameter_dict.get('n_antenna_ul', slap_configuration['configuration.default_n_antenna_dl']) }}
{% endif %}
{
{% if slapparameter_dict.get('log_phy_debug', False) %}
log_options: "all.level=error,all.max_size=0,nas.level=debug,nas.max_size=1,ngap.level=debug,ngap.max_size=1,xnap.level=debug,xnap.max_size=1,rrc.level=debug,rrc.max_size=1,phy.level=debug,file.rotate=1G,file.path=/dev/null",
{% else %}
log_options: "all.level=error,all.max_size=0,nas.level=debug,nas.max_size=1,ngap.level=debug,ngap.max_size=1,xnap.level=debug,xnap.max_size=1,rrc.level=debug,rrc.max_size=1,phy.level=info,file.rotate=1G,file.path=/dev/null",
{% endif %}
log_filename: "{{ directory['log'] }}/gnb.log",
{% if ru == "m2ru" %}
rf_driver: {
{%- if slapparameter_dict.get('disable_sdr', False) %}
name: "dummy",
{%- else %}
name: "sdr",
{%- endif %}
args: "dev0=/dev/sdr0@0",
cpri_mapping: "bf1",
cpri_mult: 16,
cpri_rx_delay: 11.0,
cpri_tx_delay: 0,
ifname: "cpri0",
cpri_tx_dbm: 42.0,
},
tx_gain: 0,
rx_gain: 0,
{% else %}
rf_driver: {
{%- if slapparameter_dict.get('disable_sdr', False) %}
name: "dummy",
{%- else %}
name: "sdr",
{%- endif %}
args: "dev0=/dev/sdr0",
{% if slapparameter_dict.get('gps_sync', False) %}
sync: "gps",
{% endif %}
rx_antenna: "tx_rx",
tdd_tx_mod: 1,
},
tx_gain: {{ tx_gain }},
rx_gain: {{ rx_gain }},
{% endif %}
{%- if slapparameter_dict.get('websocket_password', '') %}
com_addr: "[{{ gtp_addr_v6 }}]:{{ slap_configuration['configuration.com_ws_port'] }}",
com_auth: {
password: "{{ slapparameter_dict['websocket_password'] }}",
},
{%- else %}
com_addr: "{{ slap_configuration['configuration.com_addr'] }}:{{ slap_configuration['configuration.com_ws_port'] }}",
{%- endif %}
amf_list: [
{% if slapparameter_dict.get('amf_list', '') %}
{%- for i, k in enumerate(slapparameter_dict['amf_list']) %}
{%- if i == 0 %}
{
{%- else -%}
, {
{%- endif %}
amf_addr: "{{ slapparameter_dict['amf_list'][k]['amf_addr'] }}",
}
{%- endfor -%}
{% else %}
{
amf_addr: "{{ slap_configuration['configuration.amf_addr'] }}",
},
{% endif %}
],
{% 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('amf_list', '') %}
{% if slapparameter_dict.get('use_ipv4', False) %}
gtp_addr: "{{ gtp_addr_v4 }}",
{% else %}
gtp_addr: "{{ gtp_addr_v6 }}",
{% endif %}
{% else %}
gtp_addr: "{{ slap_configuration['configuration.gtp_addr'] }}",
{% endif %}
gnb_id_bits: {{ slapparameter_dict.get('gnb_id_bits', 28) }},
gnb_id: {{ slapparameter_dict.get('gnb_id', '0x12345') }},
en_dc_support: true,
cell_list: [],
nr_cell_list: [
{
rf_port: 0,
cell_id: {{ slapparameter_dict.get('cell_id', '0x01') }},
band: {{ nr_band }},
dl_nr_arfcn: {{ nr_arfcn }},
subcarrier_spacing: 30,
ssb_pos_bitmap: "{{ slapparameter_dict.get('ssb_pos_bitmap', slap_configuration['configuration.default_nr_ssb_pos_bitmap']) }}",
{%- if slapparameter_dict.get('ncell_list', '') %}
ncell_list: [
{%- for i, k in enumerate(slapparameter_dict['ncell_list']) %}
{%- if i == 0 -%}
{
{%- else -%}
, {
{%- endif %}
rat: "nr",
dl_nr_arfcn: {{ slapparameter_dict['ncell_list'][k].get('dl_nr_arfcn', '') }},
ssb_nr_arfcn: {{ slapparameter_dict['ncell_list'][k].get('ssb_nr_arfcn', '') }},
ul_nr_arfcn: {{ slapparameter_dict['ncell_list'][k].get('dl_nr_arfcn', '') }},
n_id_cell: {{ slapparameter_dict['ncell_list'][k].get('pci', '') }},
gnb_id_bits: {{ slapparameter_dict['ncell_list'][k].get('gnb_id_bits', '') }},
nr_cell_id: {{ slapparameter_dict['ncell_list'][k].get('nr_cell_id', '') }},
tac: {{ slapparameter_dict['ncell_list'][k].get('tac', 1) }},
band: {{ slapparameter_dict['ncell_list'][k].get('nr_band', '') }},
ssb_subcarrier_spacing: 30,
ssb_period: 20,
ssb_offset: 0,
ssb_duration: 1,
}
{%- endfor -%}
],
{% endif %}
},
],
nr_cell_default: {
bandwidth: {{ slapparameter_dict.get('nr_bandwidth', slap_configuration['configuration.default_nr_bandwidth']) }},
n_antenna_dl: N_ANTENNA_DL,
n_antenna_ul: N_ANTENNA_UL,
{%- if bbu == "ors" %}
manual_ref_signal_power: true,
{%- if one_watt == "True" %}
ss_pbch_block_power: {{ (tx_gain | int) - 54 }},
{%- else %}
ss_pbch_block_power: {{ (tx_gain | int) - 35 }},
{%- endif -%}
{%- endif %}
{% 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 %}
ssb_period: 20,
n_id_cell: {{ slapparameter_dict.get('pci', 500) }},
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,
root_sequence_index: 1,
sr_period: 40,
dmrs_type_a_pos: 2,
prach: {
prach_config_index: 160,
msg1_subcarrier_spacing: 30,
msg1_fdm: 1,
{% if ru == "m2ru" %}
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,
ra_response_window: 20,
restricted_set_config: "unrestricted_set",
ra_contention_resolution_timer: 64,
ssb_per_prach_occasion: 1,
cb_preambles_per_ssb: 8,
},
pdcch: {
{% if ru == "m2ru" %}
n_rb_coreset0: 48,
n_symb_coreset0: 1,
{% endif %}
search_space0_index: 0,
dedicated_coreset: {
rb_start: -1,
l_crb: -1,
{% if ru == "m2ru" %}
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,
{% if ru == "m2ru" %}
k0: 0,
k1: [ 8, 7, 7, 6, 5, 4, 12, 11 ],
{% elif tdd_config == 3 %}
k1: [4, 11],
{% endif %}
mcs_table: "qam256",
rar_mcs: 2,
si_mcs: 6,
},
csi_rs: {
nzp_csi_rs_resource: [
{
csi_rs_id: 0,
#if N_ANTENNA_DL == 1
n_ports: 1,
frequency_domain_allocation: "row2",
bitmap: "100000000000",
cdm_type: "no_cdm",
#elif N_ANTENNA_DL == 2
n_ports: 2,
frequency_domain_allocation: "other",
bitmap: "100000",
cdm_type: "fd_cdm2",
#elif N_ANTENNA_DL == 4
n_ports: 4,
frequency_domain_allocation: "row4",
bitmap: "100",
cdm_type: "fd_cdm2",
#elif N_ANTENNA_DL == 8
n_ports: 8,
frequency_domain_allocation: "other",
bitmap: "110011",
cdm_type: "fd_cdm2",
#else
#error unsupported number of DL antennas
#endif
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",
#if N_ANTENNA_DL > 1
codebook_config: {
codebook_type: "type1",
sub_type: "typeI_SinglePanel",
#if N_ANTENNA_DL == 2
#elif N_ANTENNA_DL == 4
n1: 2,
n2: 1,
codebook_mode: 1,
#elif N_ANTENNA_DL == 8
n1: 4,
n2: 1,
codebook_mode: 1,
#endif
},
#endif
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: {
dpc_snr_target: 25,
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,
{% if ru == "m2ru" %}
k2: 4,
msg3_k2: 7,
{% elif tdd_config == 3 %}
k2: [11, 12, 4, 5, 6, 7, 7, 8],
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']) }},
drb_config: "{{ drb_file }}",
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
},
},
}
...@@ -190,6 +190,8 @@ context = ...@@ -190,6 +190,8 @@ context =
raw trx {{ trx }} raw trx {{ trx }}
raw bbu {{ bbu }} raw bbu {{ bbu }}
raw ru {{ ru }} raw ru {{ ru }}
json do_lte true
json do_nr false
import netaddr netaddr import netaddr netaddr
${:extra-context} ${:extra-context}
......
...@@ -242,6 +242,8 @@ context = ...@@ -242,6 +242,8 @@ context =
raw trx {{ trx }} raw trx {{ trx }}
raw bbu {{ bbu }} raw bbu {{ bbu }}
raw ru {{ ru }} raw ru {{ ru }}
json do_lte false
json do_nr true
import netaddr netaddr import netaddr netaddr
${:extra-context} ${:extra-context}
...@@ -255,11 +257,13 @@ output = ${directory:etc}/drb.cfg ...@@ -255,11 +257,13 @@ output = ${directory:etc}/drb.cfg
{% if slapparameter_dict.get("gnb_config_link", None) %} {% if slapparameter_dict.get("gnb_config_link", None) %}
url = ${gnb-config-dl:target} url = ${gnb-config-dl:target}
{% else %} {% else %}
url = {{ gnb_template }} url = {{ enb_template }}
{% endif %} {% endif %}
output = ${directory:etc}/gnb.cfg output = ${directory:etc}/gnb.cfg
extra-context = extra-context =
key drb_file drb-config:output key drb_file drb-config:output
import-list =
rawfile slaplte.jinja2 {{ slaplte_template }}
[publish-connection-information] [publish-connection-information]
<= monitor-publish <= monitor-publish
......
...@@ -316,7 +316,8 @@ extra-context = ...@@ -316,7 +316,8 @@ extra-context =
key lte_expiration amarisoft:lte-expiration key lte_expiration amarisoft:lte-expiration
key enb amarisoft:enb key enb amarisoft:enb
key sdr amarisoft:sdr key sdr amarisoft:sdr
raw gnb_template ${gnb.jinja2.cfg:target} raw enb_template ${enb.jinja2.cfg:target}
raw slaplte_template ${slaplte.jinja2:target}
raw drb_nr_template ${drb_nr.jinja2.cfg:target} raw drb_nr_template ${drb_nr.jinja2.cfg:target}
raw ru_amarisoft_stats_template ${ru_amarisoft-stats.jinja2.py:target} raw ru_amarisoft_stats_template ${ru_amarisoft-stats.jinja2.py:target}
raw ru_amarisoft_rf_info_template ${ru_amarisoft-rf-info.jinja2.py:target} raw ru_amarisoft_rf_info_template ${ru_amarisoft-rf-info.jinja2.py:target}
......
...@@ -9,8 +9,8 @@ from slapos.recipe.template import jinja2_template ...@@ -9,8 +9,8 @@ from slapos.recipe.template import jinja2_template
import json import json
# j2render renders config/<cfg>.jinja2.cfg into config/<cfg>.cfg with provided json parameters. # j2render renders config/<src> into config/<out> with provided json parameters.
def j2render(cfg, jcfg): def j2render(src, out, jcfg):
ctx = json.loads(jcfg) ctx = json.loads(jcfg)
assert '_standalone' not in ctx assert '_standalone' not in ctx
ctx['_standalone'] = True ctx['_standalone'] = True
...@@ -20,8 +20,8 @@ def j2render(cfg, jcfg): ...@@ -20,8 +20,8 @@ def j2render(cfg, jcfg):
buildout = None # stub buildout = None # stub
r = jinja2_template.Recipe(buildout, "recipe", { r = jinja2_template.Recipe(buildout, "recipe", {
'extensions': 'jinja2.ext.do', 'extensions': 'jinja2.ext.do',
'url': 'config/{}.jinja2.cfg'.format(cfg), 'url': 'config/{}'.format(src),
'output': 'config/{}.cfg'.format(cfg), 'output': 'config/{}'.format(out),
'context': textctx, 'context': textctx,
'import-list': ''' 'import-list': '''
rawfile slaplte.jinja2 slaplte.jinja2''', rawfile slaplte.jinja2 slaplte.jinja2''',
...@@ -34,11 +34,14 @@ def j2render(cfg, jcfg): ...@@ -34,11 +34,14 @@ def j2render(cfg, jcfg):
return f.read() return f.read()
r._read = _read r._read = _read
with open('config/{}.cfg'.format(cfg), 'w+') as f: with open('config/{}'.format(out), 'w+') as f:
f.write(r._render().decode()) f.write(r._render().decode())
def do(cfg, slapparameter_dict): def do(src, out, rat, slapparameter_dict):
assert rat in ('lte', 'nr')
jdo_lte = json.dumps(rat == 'lte')
jdo_nr = json.dumps(rat == 'nr')
jslapparameter_dict = json.dumps(slapparameter_dict) jslapparameter_dict = json.dumps(slapparameter_dict)
json_params_empty = """{ json_params_empty = """{
"rf_mode": 'fdd', "rf_mode": 'fdd',
...@@ -50,6 +53,8 @@ def do(cfg, slapparameter_dict): ...@@ -50,6 +53,8 @@ def do(cfg, slapparameter_dict):
}""" }"""
json_params = """{ json_params = """{
"rf_mode": "tdd", "rf_mode": "tdd",
"do_lte": %(jdo_lte)s,
"do_nr": %(jdo_nr)s,
"trx": "sdr", "trx": "sdr",
"bbu": "ors", "bbu": "ors",
"ru": "ors", "ru": "ors",
...@@ -88,7 +93,7 @@ def do(cfg, slapparameter_dict): ...@@ -88,7 +93,7 @@ def do(cfg, slapparameter_dict):
"slapparameter_dict": %(jslapparameter_dict)s "slapparameter_dict": %(jslapparameter_dict)s
}""" }"""
j2render(cfg, json_params % locals()) j2render(src, out, json_params % locals())
do('enb', {"tdd_ul_dl_config": "[Configuration 6] 5ms 5UL 3DL (maximum uplink)"}) do('enb.jinja2.cfg', 'enb.cfg', 'lte', {"tdd_ul_dl_config": "[Configuration 6] 5ms 5UL 3DL (maximum uplink)"})
do('gnb', {"tdd_ul_dl_config": "5ms 8UL 1DL 2/10 (maximum uplink)"}) do('enb.jinja2.cfg', 'gnb.cfg', 'nr', {"tdd_ul_dl_config": "5ms 8UL 1DL 2/10 (maximum uplink)"})
...@@ -26,7 +26,6 @@ parts += ...@@ -26,7 +26,6 @@ parts +=
dnsmasq-core-network.jinja2.cfg dnsmasq-core-network.jinja2.cfg
ims.jinja2.cfg ims.jinja2.cfg
enb.jinja2.cfg enb.jinja2.cfg
gnb.jinja2.cfg
ue_db.jinja2.cfg ue_db.jinja2.cfg
ue-lte.jinja2.cfg ue-lte.jinja2.cfg
ue-nr.jinja2.cfg ue-nr.jinja2.cfg
...@@ -118,9 +117,6 @@ filename = enb.jinja2.cfg ...@@ -118,9 +117,6 @@ filename = enb.jinja2.cfg
[sib23.jinja2.asn] [sib23.jinja2.asn]
<= copy-config-to-instance <= copy-config-to-instance
filename = sib23.jinja2.asn filename = sib23.jinja2.asn
[gnb.jinja2.cfg]
<= copy-config-to-instance
filename = gnb.jinja2.cfg
[ue_db.jinja2.cfg] [ue_db.jinja2.cfg]
<= copy-config-to-instance <= copy-config-to-instance
filename = ue_db.jinja2.cfg filename = ue_db.jinja2.cfg
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment