Commit cddf6c82 authored by Kirill Smelkov's avatar Kirill Smelkov

software/ors-amarisoft: Merge ue-lte.jinja2.cfg and ue-nr.jinja2.cfg into ue.jinja2.cfg

Similarly to f365a440 (software/ors-amarisoft: Merge gnb.jinja2.cfg into
enb.jinja2.cfg) merge LTE and NR configuration files for UEsim into single
config as the preparation for MultiRU - there UEsim will be also handling TDD,
FDD, LTE and NR cells and UEs all at the same time.

In this patch for now we only move code without changing it and wrap parts with
`if do_lte` and `if do_nr` correspondingly.  The end result of rendered
ue-lte.cfg and ue-nr.cfg stays practically the same as shown in the appendix.

/cc @jhuge, @lu.xu, @tomo, @xavier_thompson, @Daetalus

--------

Appendix. Diff for rendered ue-*.cfg before and after this patch.

```
$ ./pythonwitheggs slapos-render-config.py && git diff --no-index -w config/old/ config/out/
```

```diff
diff --git a/config/old/ue-lte.cfg b/config/out/ue-lte.cfg
index 7f1530daf..836a95e79 100644
--- a/config/old/ue-lte.cfg
+++ b/config/out/ue-lte.cfg
@@ -1,5 +1,6 @@

 #define N_RB_DL             50
+
 {
   log_options: "all.level=error,all.max_size=0,nas.level=debug,nas.max_size=1,rrc.level=debug,rrc.max_size=1,phy.level=info,file.rotate=1G,file.path=/dev/null",
   log_filename: "log/ue.log",
@@ -14,7 +15,8 @@ rf_driver: {
 },
   tx_gain: 60,
   rx_gain: 40,
-  cell_groups: [{
+  cell_groups: [
+  {
     multi_ue: true,
     cells: [
       {
@@ -27,7 +29,8 @@ rf_driver: {
     ],
     pdcch_decode_opt: false,
     pdcch_decode_opt_threshold: 0.1,
-  }],
+  },
+  ],
   ue_list: [
     {
     sim_algo: "milenage",
@@ -38,8 +41,8 @@ rf_driver: {
     impi: "",
     imsi: "001010123456789",
     K: "00112233445566778899aabbccddeeff",
-    rue_addr: "host1",
     ue_category: 12,
+    rue_addr: "host1",
     tun_setup_script: "ue-ifup",
     apn: "internet",
     }
diff --git a/config/old/ue-nr.cfg b/config/out/ue-nr.cfg
index 41758ab6f..631e1ab1e 100644
--- a/config/old/ue-nr.cfg
+++ b/config/out/ue-nr.cfg
@@ -1,3 +1,5 @@
+
+
 {
   log_options: "all.level=error,all.max_size=0,nas.level=debug,nas.max_size=1,rrc.level=debug,rrc.max_size=1,phy.level=info,file.rotate=1G,file.path=/dev/null",
   log_filename: "log/ue.log",
@@ -12,7 +14,8 @@ rf_driver: {
 },
   tx_gain: 60,
   rx_gain: 40,
-    cell_groups: [{
+  cell_groups: [
+  {
     group_type: "nr",
     multi_ue: false,
     cells: [{
@@ -26,7 +29,8 @@ rf_driver: {
       n_antenna_ul: 2,
       }
     ],
-    }],
+  },
+  ],
   ue_list: [
     {
     sim_algo: "milenage",
@@ -37,11 +41,11 @@ rf_driver: {
     impi: "",
     imsi: "001010123456789",
     K: "00112233445566778899aabbccddeeff",
-      rue_addr: "host2",
     as_release: 15,
     ue_category: "nr",
+    rue_addr: "host2",
     tun_setup_script: "ue-ifup",
     apn: "internet",
     }
-    ]
+  ],
 }
```
parent 47d05f1c
......@@ -138,12 +138,8 @@ md5sum = 9bd5b08f23640f71ad109d186d060f2d
filename = config/ims.jinja2.cfg
md5sum = 36281b03597252cf75169417d02fc28c
[ue-lte.jinja2.cfg]
filename = config/ue-lte.jinja2.cfg
md5sum = c0313f9d15543361f7c8e19af96c737a
[ue-nr.jinja2.cfg]
filename = config/ue-nr.jinja2.cfg
[ue.jinja2.cfg]
filename = config/ue.jinja2.cfg
md5sum = 824233ab4d53ec428d358fb67bca8ba2
[ru_lopcomm_CreateProcessingEle.jinja2.xml]
......
{
log_options: "all.level=error,all.max_size=0,nas.level=debug,nas.max_size=1,rrc.level=debug,rrc.max_size=1,phy.level=info,file.rotate=1G,file.path=/dev/null",
log_filename: "{{ directory['log'] }}/ue.log",
rue_bind_addr: "{{ pub_info['rue_bind_addr'] }}",
com_addr: "{{ pub_info['com_addr'] }}",
rf_driver: {
name: "sdr",
args: "dev0=/dev/sdr0",
rx_antenna:"tx_rx",
},
tx_gain: {{ slapparameter_dict.get('tx_gain', 60) }},
rx_gain: {{ slapparameter_dict.get('rx_gain', 40) }},
cell_groups: [{
group_type: "nr",
multi_ue: false,
cells: [{
rf_port: 0,
bandwidth: {{ slapparameter_dict.get('bandwidth', slap_configuration['configuration.default_nr_bandwidth']) }},
band: {{ slapparameter_dict.get('nr_band', 0) }},
dl_nr_arfcn: {{ slapparameter_dict.get('dl_nr_arfcn', 0) }},
ssb_nr_arfcn: {{ slapparameter_dict.get('ssb_nr_arfcn', 0) }},
subcarrier_spacing: 30,
n_antenna_dl: {{ slapparameter_dict.get('n_antenna_dl', slap_configuration['configuration.default_n_antenna_dl']) }},
n_antenna_ul: {{ slapparameter_dict.get('n_antenna_ul', slap_configuration['configuration.default_n_antenna_ul']) }},
}
],
}],
ue_list: [
{
sim_algo: "{{ slapparameter_dict.get('sim_algo', 'milenage') }}",
opc: "{{ slapparameter_dict.get('opc', '') }}",
amf: {{ slapparameter_dict.get('amf', '0x9001') }},
sqn: "{{ slapparameter_dict.get('sqn', '000000000000') }}",
impu: "{{ slapparameter_dict.get('impu', '') }}",
impi: "{{ slapparameter_dict.get('impi', '') }}",
imsi: "{{ slapparameter_dict.get('imsi', slap_configuration['configuration.default_nr_imsi']) }}",
K: "{{ slapparameter_dict.get('k', slap_configuration['configuration.default_nr_k']) }}",
rue_addr: "{{ slapparameter_dict.get('rue_addr', '') }}",
as_release: 15,
ue_category: "nr",
tun_setup_script: "ue-ifup",
apn: "internet",
}
]
}
{#- do_lte/do_nr indicate whether we have LTE or NR UE/cells #}
{%- do assert(do_lte or do_nr) %}
{%- do assert(not (do_lte and do_nr)) %}
{%- if do_lte %}
{%- if slapparameter_dict.get('bandwidth', slap_configuration['configuration.default_lte_bandwidth']) == '1.4 MHz' %}
#define N_RB_DL 6
{%- elif slapparameter_dict.get('bandwidth', slap_configuration['configuration.default_lte_bandwidth']) == '3 MHz' %}
......@@ -11,6 +16,8 @@
{%- elif slapparameter_dict.get('bandwidth', slap_configuration['configuration.default_lte_bandwidth']) == '20 MHz' %}
#define N_RB_DL 100
{%- endif %}
{%- endif %}
{
log_options: "all.level=error,all.max_size=0,nas.level=debug,nas.max_size=1,rrc.level=debug,rrc.max_size=1,phy.level=info,file.rotate=1G,file.path=/dev/null",
log_filename: "{{ directory['log'] }}/ue.log",
......@@ -25,7 +32,9 @@ rf_driver: {
},
tx_gain: {{ slapparameter_dict.get('tx_gain', 60) }},
rx_gain: {{ slapparameter_dict.get('rx_gain', 40) }},
cell_groups: [{
cell_groups: [
{%- if do_lte %}
{
multi_ue: true,
cells: [
{
......@@ -38,7 +47,26 @@ rf_driver: {
],
pdcch_decode_opt: false,
pdcch_decode_opt_threshold: 0.1,
}],
},
{%- endif %}
{%- if do_nr %}
{
group_type: "nr",
multi_ue: false,
cells: [{
rf_port: 0,
bandwidth: {{ slapparameter_dict.get('bandwidth', slap_configuration['configuration.default_nr_bandwidth']) }},
band: {{ slapparameter_dict.get('nr_band', 0) }},
dl_nr_arfcn: {{ slapparameter_dict.get('dl_nr_arfcn', 0) }},
ssb_nr_arfcn: {{ slapparameter_dict.get('ssb_nr_arfcn', 0) }},
subcarrier_spacing: 30,
n_antenna_dl: {{ slapparameter_dict.get('n_antenna_dl', slap_configuration['configuration.default_n_antenna_dl']) }},
n_antenna_ul: {{ slapparameter_dict.get('n_antenna_ul', slap_configuration['configuration.default_n_antenna_ul']) }},
}
],
},
{%- endif %}
],
ue_list: [
{
sim_algo: "{{ slapparameter_dict.get('sim_algo', 'milenage') }}",
......@@ -47,10 +75,18 @@ rf_driver: {
sqn: "{{ slapparameter_dict.get('sqn', '000000000000') }}",
impu: "{{ slapparameter_dict.get('impu', '') }}",
impi: "{{ slapparameter_dict.get('impi', '') }}",
{%- if do_lte %}
imsi: "{{ slapparameter_dict.get('imsi', slap_configuration['configuration.default_lte_imsi']) }}",
K: "{{ slapparameter_dict.get('k', slap_configuration['configuration.default_lte_k']) }}",
rue_addr: "{{ slapparameter_dict.get('rue_addr', '') }}",
ue_category: 12,
{%- endif %}
{%- if do_nr %}
imsi: "{{ slapparameter_dict.get('imsi', slap_configuration['configuration.default_nr_imsi']) }}",
K: "{{ slapparameter_dict.get('k', slap_configuration['configuration.default_nr_k']) }}",
as_release: 15,
ue_category: "nr",
{%- endif %}
rue_addr: "{{ slapparameter_dict.get('rue_addr', '') }}",
tun_setup_script: "ue-ifup",
apn: "internet",
}
......
......@@ -101,13 +101,15 @@ context =
section slap_configuration slap-configuration
section pub_info publish-connection-information
key slapparameter_dict slap-configuration:configuration
json do_lte true
json do_nr false
[lte-ue-lte-config]
<= config-base
{% if slapparameter_dict.get("ue_lte_config_link", None) %}
url = ${ue-lte-config-dl:target}
{% else %}
url = {{ ue_lte_template }}
url = {{ ue_template }}
{% endif %}
output = ${directory:etc}/ue.cfg
......
......@@ -101,13 +101,15 @@ context =
section slap_configuration slap-configuration
section pub_info publish-connection-information
key slapparameter_dict slap-configuration:configuration
json do_lte false
json do_nr true
[lte-ue-nr-config]
<= config-base
{% if slapparameter_dict.get("ue_nr_config_link", None) %}
url = ${ue-nr-config-dl:target}
{% else %}
url = {{ ue_nr_template }}
url = {{ ue_template }}
{% endif %}
output = ${directory:etc}/ue.cfg
......
......@@ -359,7 +359,7 @@ extra-context =
raw monitor_template ${monitor2-template:output}
key ue amarisoft:ue
key sdr amarisoft:sdr
raw ue_lte_template ${ue-lte.jinja2.cfg:target}
raw ue_template ${ue.jinja2.cfg:target}
raw openssl_location ${openssl:location}
raw default_lte_bandwidth ${default-params:default-lte-bandwidth}
raw default_n_antenna_dl ${default-params:default-n-antenna-dl}
......@@ -376,7 +376,7 @@ extra-context =
raw monitor_template ${monitor2-template:output}
key ue amarisoft:ue
key sdr amarisoft:sdr
raw ue_nr_template ${ue-nr.jinja2.cfg:target}
raw ue_template ${ue.jinja2.cfg:target}
raw openssl_location ${openssl:location}
raw default_nr_bandwidth ${default-params:default-nr-bandwidth}
raw default_n_antenna_dl ${default-params:default-n-antenna-dl}
......
......@@ -105,8 +105,8 @@ def do_enb():
def do_ue():
do('ue-lte.jinja2.cfg', 'ue-lte.cfg', 'lte', {'rue_addr': 'host1'})
do('ue-nr.jinja2.cfg', 'ue-nr.cfg', 'nr', {'rue_addr': 'host2'})
do('ue.jinja2.cfg', 'ue-lte.cfg', 'lte', {'rue_addr': 'host1'})
do('ue.jinja2.cfg', 'ue-nr.cfg', 'nr', {'rue_addr': 'host2'})
def main():
......
......@@ -28,8 +28,7 @@ parts +=
ims.jinja2.cfg
enb.jinja2.cfg
ue_db.jinja2.cfg
ue-lte.jinja2.cfg
ue-nr.jinja2.cfg
ue.jinja2.cfg
drb_lte.jinja2.cfg
drb_nr.jinja2.cfg
sib23.jinja2.asn
......@@ -129,12 +128,9 @@ filename = mme.jinja2.cfg
[ims.jinja2.cfg]
<= copy-config-to-instance
filename = ims.jinja2.cfg
[ue-lte.jinja2.cfg]
[ue.jinja2.cfg]
<= copy-config-to-instance
filename = ue-lte.jinja2.cfg
[ue-nr.jinja2.cfg]
<= copy-config-to-instance
filename = ue-nr.jinja2.cfg
filename = ue.jinja2.cfg
[slaplte.jinja2]
<= download-base
......
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