Commit 6404f810 authored by Kirill Smelkov's avatar Kirill Smelkov

software/ors-amarisoft: enb.jinja2.cfg: Switch ru to be a namespace to hold Radio Unit parameters

In the next patch we will switch usage of C Preprocessor to Jinja2, and in jinja2 doing set from under if, as e.g. in

    {%- if ru == 'm2ru' %}
    {%-   set n_antenna_ul = 1  %}
    {%- endif %}

does _not_ have the effect of setting n_antenna_ul=1 outside of the if block.

That, however, can be worked around with usage of namespace objects, so the following works as intended:

    {%- set x = namespace() %}
    {%- if ru == 'm2ru' %}
    {%-   set x.n_antenna_ul = 1  %}
    {%- endif %}

with x.n_antenna_ul=1 if ru was m2ru.

So taking into account this, and that in MultiRU ru will be denoting
RadioUnit-related configuration, let's switch ru to be a namespace object with
ru.ru_type denoting type of attached radio unit.

This both goes as a preparatory step for MultiRU and also allows to switch from
CPP to Jinja2 in the next patch.

/cc @lu.xu, @tomo, @xavier_thompson, @Daetalus
/reviewed-by @jhuge
/reviewed-on nexedi/slapos!1520
parent 2cff189e
...@@ -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 = ae49a3a9a97407f9aea30981403ee1a2 md5sum = 08cc07722022bfd9eee4fdd0044a2caf
[template-gnb] [template-gnb]
_update_hash_filename_ = instance-gnb.jinja2.cfg _update_hash_filename_ = instance-gnb.jinja2.cfg
md5sum = 54a0c7c3a2a1c905a15c58c650ee1095 md5sum = 6c13d7b2dea85a222fe4e589dd50df87
[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 = df74334b9713ccadac1d8242e186bf69 md5sum = 211d7d93ed5fa4e6c08001a59c1e7762
[drb_lte.jinja2.cfg] [drb_lte.jinja2.cfg]
filename = config/drb_lte.jinja2.cfg filename = config/drb_lte.jinja2.cfg
......
...@@ -13,6 +13,10 @@ ...@@ -13,6 +13,10 @@
{%- do assert(not (do_lte and do_nr)) %} {%- do assert(not (do_lte and do_nr)) %}
{#- ru is namespace object that holds Radio Unit related parameters #}
{%- set ru = namespace(ru_type=ru_type) %}
{%- if do_lte %} {%- 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 %}
...@@ -54,7 +58,7 @@ ...@@ -54,7 +58,7 @@
{%- 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" %} {% if ru.ru_type == "m2ru" %}
#define N_ANTENNA_UL {{ slapparameter_dict.get('n_antenna_ul', 1) }} #define N_ANTENNA_UL {{ slapparameter_dict.get('n_antenna_ul', 1) }}
{% else %} {% 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']) }}
...@@ -79,7 +83,7 @@ ...@@ -79,7 +83,7 @@
log_filename: "{{ directory['log'] }}/gnb.log", log_filename: "{{ directory['log'] }}/gnb.log",
{%- endif %} {%- endif %}
{% if ru == "lopcomm" %} {% if ru.ru_type == "lopcomm" %}
rf_driver: { rf_driver: {
{%- if slapparameter_dict.get('disable_sdr', False) %} {%- if slapparameter_dict.get('disable_sdr', False) %}
name: "dummy", name: "dummy",
...@@ -133,7 +137,7 @@ ...@@ -133,7 +137,7 @@
}, },
tx_gain: 0, tx_gain: 0,
rx_gain: 0, rx_gain: 0,
{% elif ru == "m2ru" %} {% elif ru.ru_type == "m2ru" %}
rf_driver: { rf_driver: {
{%- if slapparameter_dict.get('disable_sdr', False) %} {%- if slapparameter_dict.get('disable_sdr', False) %}
name: "dummy", name: "dummy",
...@@ -582,17 +586,17 @@ ...@@ -582,17 +586,17 @@
{% endif %} {% endif %}
prach: { prach: {
{% if ru == "m2ru" %} {% if ru.ru_type == "m2ru" %}
msg1_frequency_start: 0, msg1_frequency_start: 0,
{% endif %} {% endif %}
}, },
pdcch: { pdcch: {
{% if ru == "m2ru" %} {% if ru.ru_type == "m2ru" %}
n_rb_coreset0: 48, n_rb_coreset0: 48,
n_symb_coreset0: 1, n_symb_coreset0: 1,
dedicated_coreset: { dedicated_coreset: {
{% if ru == "m2ru" %} {% if ru.ru_type == "m2ru" %}
duration: 1, duration: 1,
{% endif %} {% endif %}
}, },
...@@ -611,7 +615,7 @@ ...@@ -611,7 +615,7 @@
}, },
pdsch: { pdsch: {
{% if ru == "m2ru" %} {% if ru.ru_type == "m2ru" %}
k0: 0, k0: 0,
k1: [ 8, 7, 7, 6, 5, 4, 12, 11 ], k1: [ 8, 7, 7, 6, 5, 4, 12, 11 ],
{% elif tdd_config == 3 %} {% elif tdd_config == 3 %}
...@@ -620,7 +624,7 @@ ...@@ -620,7 +624,7 @@
}, },
pusch: { pusch: {
{% if ru == "m2ru" %} {% if ru.ru_type == "m2ru" %}
k2: 4, k2: 4,
msg3_k2: 7, msg3_k2: 7,
{% elif tdd_config == 3 %} {% elif tdd_config == 3 %}
......
...@@ -189,7 +189,7 @@ context = ...@@ -189,7 +189,7 @@ context =
raw rf_mode {{ rf_mode }} raw rf_mode {{ rf_mode }}
raw trx {{ trx }} raw trx {{ trx }}
raw bbu {{ bbu }} raw bbu {{ bbu }}
raw ru {{ ru }} raw ru_type {{ ru }}
json do_lte true json do_lte true
json do_nr false json do_nr false
import netaddr netaddr import netaddr netaddr
......
...@@ -241,7 +241,7 @@ context = ...@@ -241,7 +241,7 @@ context =
raw rf_mode {{ rf_mode }} raw rf_mode {{ rf_mode }}
raw trx {{ trx }} raw trx {{ trx }}
raw bbu {{ bbu }} raw bbu {{ bbu }}
raw ru {{ ru }} raw ru_type {{ ru }}
json do_lte false json do_lte false
json do_nr true json do_nr true
import netaddr netaddr import netaddr netaddr
......
...@@ -57,7 +57,7 @@ def do(src, out, rat, slapparameter_dict): ...@@ -57,7 +57,7 @@ def do(src, out, rat, slapparameter_dict):
"do_nr": %(jdo_nr)s, "do_nr": %(jdo_nr)s,
"trx": "sdr", "trx": "sdr",
"bbu": "ors", "bbu": "ors",
"ru": "ors", "ru_type": "ors",
"one_watt": "True", "one_watt": "True",
"earfcn": 36100, "earfcn": 36100,
"nr_arfcn": 380000, "nr_arfcn": 380000,
......
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