Commit 02b86f76 authored by Kirill Smelkov's avatar Kirill Smelkov

software/ors-amarisoft: enb: Start to generalize the code to handle multiple Radio Units

Add code to organize a registry of Radio Units and handle that registry generally everywhere.

RU registry is still populated from cell_list and in practice there still can
be radio units only of the same type, but besides slaplte.load_ru_and_cell
which is aware of that, the rest of the code tries to do everything as if
RUs of different type could be present simultaneously.

Now it is not only lopcomm who can do multiCELL, but also sunwave and SDR as well.

gNB also starts to gain support for cell_list, because cell_list loading is
uniformly applied to both eNB and gNB. However, since enb.cfg is not yet
prepared to handle multiple NR cells yet, there is an assert that in case of NR
there is only one RU/cell present there. We will remove this limitation in a
follow-up patch.

Later we will also change the loading to load RU descriptions from shared instances
and they won't be constrained to be Radio Units of the same type. But we need
to prepare a lot to be able to do that.

One more step forward towards MultiRU.

Tests will be added later as full tests for generic MultiRU.

Backward compatibility: no change for ORS and practically no breaking change for everything else.

--------

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/{old,out}
```

```diff
diff --git a/config/old/enb.cfg b/config/out/enb.cfg
index 884483b0a..cafdf42be 100644
--- a/config/old/enb.cfg
+++ b/config/out/enb.cfg
@@ -1,24 +1,22 @@

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

-
+  // Radio Units
   rf_driver: {
+      // default-RU 2T2R  (ors)
       name: "sdr",
       args: "dev0=/dev/sdr0",
-
       rx_antenna:"tx_rx",
       tdd_tx_mod: 1,
   },
-  tx_gain: 62,
-  rx_gain: 43,
-
+  tx_gain: [62, 62],
+  rx_gain: [43, 43],
   com_addr: "127.0.1.2:9001",
   // LTE core network
   mme_list: [
@@ -36,6 +34,8 @@

   // LTE cells
   cell_list: [
+
+    // default  (default-RU)
     {
       rf_port:      0,
       n_antenna_dl: 2,
diff --git a/config/old/gnb.cfg b/config/out/gnb.cfg
index fd57ca3dc..7818b4ea8 100644
--- a/config/old/gnb.cfg
+++ b/config/out/gnb.cfg
@@ -1,24 +1,22 @@

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

-
+  // Radio Units
   rf_driver: {
+      // default-RU 2T2R  (ors)
       name: "sdr",
       args: "dev0=/dev/sdr0",
-
       rx_antenna:"tx_rx",
       tdd_tx_mod: 1,
   },
-  tx_gain: 62,
-  rx_gain: 43,
-
+  tx_gain: [62, 62],
+  rx_gain: [43, 43],
   com_addr: "127.0.1.2:9001",
   // NR core network
   amf_list: [
```
parent 332fbf8f
...@@ -6,8 +6,9 @@ ...@@ -6,8 +6,9 @@
{#- for standalone testing via slapos-render-config.py {#- for standalone testing via slapos-render-config.py
NOTE: keep in sync with ru/libinstance.jinja2.cfg #} NOTE: keep in sync with ru/libinstance.jinja2.cfg #}
{%- if _standalone is defined %} {%- if _standalone is defined %}
{%- set ru_dict = {} %}
{%- set cell_dict = {} %} {%- set cell_dict = {} %}
{%- do slaplte.load_cell(cell_dict) %} {%- do slaplte.load_ru_and_cell(ru_dict, cell_dict) %}
{%- endif %} {%- endif %}
...@@ -16,13 +17,6 @@ ...@@ -16,13 +17,6 @@
{%- 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 ru.ru_type == 'm2ru' %}
{%- do ru.update({'ru_type': 'sunwave'}) %}
{%- endif %}
{#- handover_config emits handover configuration #} {#- handover_config emits handover configuration #}
{%- macro handover_config() %} {%- macro handover_config() %}
ncell_list: [ ncell_list: [
...@@ -110,12 +104,6 @@ ...@@ -110,12 +104,6 @@
{%- endif %} {%- endif %}
{%- endif %} {%- endif %}
{%- set ru.n_antenna_dl = slapparameter_dict.get('n_antenna_dl', int(default_n_antenna_dl)) %}
{% if ru.ru_type == "sunwave" %}
{%- set ru.n_antenna_ul = slapparameter_dict.get('n_antenna_ul', 1) %}
{% else %}
{%- set ru.n_antenna_ul = slapparameter_dict.get('n_antenna_ul', int(default_n_antenna_ul)) %}
{% endif %}
{ {
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, 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,
...@@ -128,7 +116,7 @@ ...@@ -128,7 +116,7 @@
log_filename: "{{ directory['log'] }}/enb.log", log_filename: "{{ directory['log'] }}/enb.log",
{# instantiate radio units #} {# instantiate radio units #}
{{ slaplte.ru_config(ru, cell_dict, slapparameter_dict) }} {{ slaplte.ru_config(ru_dict, slapparameter_dict) }}
{%- if slapparameter_dict.get('websocket_password', '') %} {%- if slapparameter_dict.get('websocket_password', '') %}
com_addr: "[{{ gtp_addr_v6 }}]:{{ slapparameter_dict.com_ws_port }}", com_addr: "[{{ gtp_addr_v6 }}]:{{ slapparameter_dict.com_ws_port }}",
...@@ -215,17 +203,21 @@ ...@@ -215,17 +203,21 @@
// LTE cells // LTE cells
cell_list: [ cell_list: [
{%- if do_lte %} {%- if do_lte %}
{%- for i, k in enumerate(cell_dict) %} {%- for i, (cell_ref, cell) in enumerate(cell_dict|dictsort) %}
{%- set ru_ref = cell.ru_ref %}
{%- set ru = ru_dict[ru_ref] %}
// {{ cell_ref }} ({{ ru_ref }})
{ {
rf_port: {{ i }}, rf_port: {{ ru._rf_port }},
n_antenna_dl: {{ ru.n_antenna_dl }}, n_antenna_dl: {{ ru.n_antenna_dl }},
n_antenna_ul: {{ ru.n_antenna_ul }}, n_antenna_ul: {{ ru.n_antenna_ul }},
cell_id: {{ cell_dict[k].get('cell_id', slapparameter_dict.get('cell_id', '0x0' + i|string)) }}, cell_id: {{ cell.get('cell_id', slapparameter_dict.get('cell_id', '0x0' + i|string)) }},
tac: {{ cell_dict[k].get('tac', slapparameter_dict.get('tac', '0x0001')) }}, tac: {{ cell.get('tac', slapparameter_dict.get('tac', '0x0001')) }},
n_id_cell: {{ cell_dict[k].get('pci', slapparameter_dict.get('pci', i)) }}, n_id_cell: {{ cell.get('pci', slapparameter_dict.get('pci', i)) }},
root_sequence_index: {{ cell_dict[k].get('root_sequence_index', slapparameter_dict.get('root_sequence_index', 204 + i)) }}, root_sequence_index: {{ cell.get('root_sequence_index', slapparameter_dict.get('root_sequence_index', 204 + i)) }},
dl_earfcn: {{ cell_dict[k].get('dl_earfcn', slapparameter_dict.get('dl_earfcn', earfcn)) }}, dl_earfcn: {{ cell.get('dl_earfcn', slapparameter_dict.get('dl_earfcn', earfcn)) }},
inactivity_timer: {{ slapparameter_dict.get('inactivity_timer', default_lte_inactivity_timer) }}, inactivity_timer: {{ slapparameter_dict.get('inactivity_timer', default_lte_inactivity_timer) }},
// Handover // Handover
...@@ -438,10 +430,12 @@ ...@@ -438,10 +430,12 @@
{%- endif %} {%- endif %}
{% if do_nr %} {% if do_nr %}
{%- do assert(len(ru_dict) == 1, 'MultiCELL/MultiRU is TODO for NR') %}
{%- set ru = list(ru_dict.values())[0] %}
// NR cells // NR cells
nr_cell_list: [ nr_cell_list: [
{ {
rf_port: 0, rf_port: {{ ru._rf_port }},
n_antenna_dl: {{ ru.n_antenna_dl }}, n_antenna_dl: {{ ru.n_antenna_dl }},
n_antenna_ul: {{ ru.n_antenna_ul }}, n_antenna_ul: {{ ru.n_antenna_ul }},
...@@ -463,9 +457,9 @@ ...@@ -463,9 +457,9 @@
{%- if ors %} {%- if ors %}
manual_ref_signal_power: true, manual_ref_signal_power: true,
{%- if ors['one-watt'] %} {%- if ors['one-watt'] %}
ss_pbch_block_power: {{ (tx_gain | int) - 54 }}, ss_pbch_block_power: {{ ru.tx_gain - 54 }},
{%- else %} {%- else %}
ss_pbch_block_power: {{ (tx_gain | int) - 35 }}, ss_pbch_block_power: {{ ru.tx_gain - 35 }},
{%- endif -%} {%- endif -%}
{%- endif %} {%- endif %}
......
...@@ -49,15 +49,13 @@ ...@@ -49,15 +49,13 @@
"default": "[Configuration 2] 5ms 2UL 6DL (default)" "default": "[Configuration 2] 5ms 2UL 6DL (default)"
}, },
{%- endif %} {%- endif %}
{%- if bbu != 'ors' %} {%- if trx == 'cpri' %}
"sdr_number": { "sdr_number": {
"title": "SDR Number", "title": "SDR Number",
"description": "SDR Number", "description": "SDR Number",
"type": "number", "type": "number",
"default": 0 "default": 0
}, },
{%- endif %}
{%- if trx == 'cpri' %}
"cpri_mult": { "cpri_mult": {
"title": "CPRI Mult", "title": "CPRI Mult",
"description": "Select the CPRI line bit rate in terms of multiple of option 1 (614.4 Mbps). E.g set 4 for option 3, 8 for option 5 and 16 for option 7.", "description": "Select the CPRI line bit rate in terms of multiple of option 1 (614.4 Mbps). E.g set 4 for option 3, 8 for option 5 and 16 for option 7.",
......
...@@ -209,8 +209,6 @@ context = ...@@ -209,8 +209,6 @@ context =
raw nr_band {{ RF.nr_band }} raw nr_band {{ RF.nr_band }}
raw software_name {{ software_name }} raw software_name {{ software_name }}
raw rf_mode {{ rf_mode }} raw rf_mode {{ rf_mode }}
raw trx {{ trx }}
raw bbu {{ bbu }}
raw ru_type {{ ru_type }} raw ru_type {{ ru_type }}
raw default_lte_bandwidth {{ default_lte_bandwidth }} raw default_lte_bandwidth {{ default_lte_bandwidth }}
raw default_lte_inactivity_timer {{ default_lte_inactivity_timer }} raw default_lte_inactivity_timer {{ default_lte_inactivity_timer }}
...@@ -248,6 +246,7 @@ url = {{ enb_template }} ...@@ -248,6 +246,7 @@ url = {{ enb_template }}
output = ${directory:etc}/enb.cfg output = ${directory:etc}/enb.cfg
extra-context = extra-context =
import json_module json import json_module json
json ru_dict {{ rulib.ru_dict | tojson }}
json cell_dict {{ rulib.cell_dict | tojson }} json cell_dict {{ rulib.cell_dict | tojson }}
key sib23_file sib-config:output key sib23_file sib-config:output
key drb_file drb-config:output key drb_file drb-config:output
......
...@@ -29,12 +29,6 @@ ...@@ -29,12 +29,6 @@
"type": "number", "type": "number",
"default": 2 "default": 2
}, },
"sdr_number": {
"title": "SDR Number",
"description": "SDR Number",
"type": "number",
"default": 0
},
"cell_list": { "cell_list": {
"title": "Cell List", "title": "Cell List",
"description": "Cell List", "description": "Cell List",
......
...@@ -49,6 +49,19 @@ ...@@ -49,6 +49,19 @@
"type": "string", "type": "string",
"default": "0x01" "default": "0x01"
}, },
"cell_list": {
"title": "Cell List",
"description": "Cell List",
"patternProperties": {
".*": {
"properties": {
},
"type": "object"
}
},
"type": "object",
"default": {}
},
"tx_gain": { "tx_gain": {
"title": "Tx gain", "title": "Tx gain",
"description": "Tx gain (in dB)", "description": "Tx gain (in dB)",
......
...@@ -21,6 +21,24 @@ ...@@ -21,6 +21,24 @@
"type": "number", "type": "number",
"default": 2 "default": 2
}, },
"sdr_number": {
"title": "SDR Number",
"description": "SDR Number",
"type": "number",
"default": 0
},
"cpri_mult": {
"title": "CPRI Mult",
"description": "Select the CPRI line bit rate in terms of multiple of option 1 (614.4 Mbps). E.g set 4 for option 3, 8 for option 5 and 16 for option 7.",
"type": "number",
"default": 16,
"enum": [
4,
5,
8,
16
]
},
"dl_nr_arfcn": { "dl_nr_arfcn": {
"title": "DL NR ARFCN", "title": "DL NR ARFCN",
"description": "Downlink NR Absolute Radio Frequency Channel Number of the cell", "description": "Downlink NR Absolute Radio Frequency Channel Number of the cell",
...@@ -49,15 +67,102 @@ ...@@ -49,15 +67,102 @@
"type": "string", "type": "string",
"default": "0x01" "default": "0x01"
}, },
"tx_gain": { "cell_list": {
"title": "Tx gain", "title": "Cell List",
"description": "Tx gain (in dB)", "description": "Cell List",
"type": "number" "patternProperties": {
".*": {
"properties": {
"cpri_rx_delay": {
"title": "CPRI RX Delay",
"description": "Delays between TX and RX position in CPRI frame. This should be set to the value of (T2a + T3a - Toffset) provided by the RRH specification.",
"type": "number",
"default": 25.11
},
"cpri_tx_delay": {
"title": "CPRI TX Delay",
"description": "Advances Start of Frame relative to PPS to compensate for delays in transmit line and RRH. This should be set to T12 + T2a.",
"type": "number",
"default": 14.71
},
"cpri_tx_dbm": {
"title": "CPRI TX dBm",
"description": "Optional floating points value in dBm (default 0). Needed by ENB/GNB to have a notion of actual output power. Computed from maximum power output of the RRH for a 0dBFS input signal (full scale). ",
"type": "number",
"default": 63
},
"cpri_port_number": {
"title": "CPRI Port Number",
"description": "CPRI Port Number",
"type": "number",
"default": 0
},
"ru_mac_addr": {
"title": "RU MAC address",
"description": "RU MAC address used for NETCONF",
"type": "string"
},
},
"type": "object"
}
},
"type": "object",
"default": {}
}, },
"rx_gain": { "txa0cc00_active": {
"title": "Rx gain", "title": "Lopcomm ORAN TX array carriers (TXA0CC00)",
"description": "Rx gain (in dB)", "description": "Activate or inactivate Lopcomm ORAN TX array carriers (TXA0CC00)",
"type": "number" "type": "string",
"default": "INACTIVE",
"enum": [
"ACTIVE",
"INACTIVE"
]
},
"rxa0cc00_active": {
"title": "Lopcomm ORAN RX array carriers (RXA0CC00)",
"description": "Activate or inactivate Lopcomm ORAN RX array carriers (RXA0CC00)",
"type": "string",
"default": "INACTIVE",
"enum": [
"ACTIVE",
"INACTIVE"
]
},
"txa0cc00_center_frequency": {
"title": "Lopcomm ORAN DL Center Frequency in MHz (TXA0CC00)",
"description": "Lopcomm ORAN Center Frequency in MHz (TXA0CC00)",
"type": "number",
"default": 2140
},
"rxa0cc00_center_frequency_earfcn": {
"title": "Lopcomm ORAN UL Center Frequency EARFCN (RXA0CC00)",
"description": "Lopcomm ORAN Center Frequency EARFCN (RXA0CC00)",
"type": "number",
"default": 18300
},
"rxa0cc00_center_frequency": {
"title": "Lopcomm ORAN UL Center Frequency in MHz (RXA0CC00)",
"description": "Lopcomm ORAN Center Frequency in MHz (RXA0CC00)",
"type": "number",
"default": 1950
},
"txa0cc00_gain": {
"title": "ORAN Gain",
"description": "Lopcomm ORAN Gain (TXA0CC00)",
"type": "number",
"default": -20
},
"user-authorized-key": {
"title": "User Authorized Key",
"description": "SSH public key in order to connect to the SSH server of this instance.",
"textarea": true,
"type": "string"
},
"cron_schedule": {
"title": "Cron schedule for RRH reset",
"description": "Refer https://crontab.guru/ to make a reset schedule for RRH, for example, '0 1 * * *' means the RRH will reset every day at 1 am",
"type": "string"
}, },
"gnb_id": { "gnb_id": {
"title": "gNB ID", "title": "gNB ID",
......
...@@ -41,6 +41,26 @@ ...@@ -41,6 +41,26 @@
], ],
"default": "5ms 2UL 7DL 4/6 (default)" "default": "5ms 2UL 7DL 4/6 (default)"
}, },
{%- endif %}
{%- if trx == 'cpri' %}
"sdr_number": {
"title": "SDR Number",
"description": "SDR Number",
"type": "number",
"default": 0
},
"cpri_mult": {
"title": "CPRI Mult",
"description": "Select the CPRI line bit rate in terms of multiple of option 1 (614.4 Mbps). E.g set 4 for option 3, 8 for option 5 and 16 for option 7.",
"type": "number",
"default": 16,
"enum": [
4,
5,
8,
16
]
},
{%- endif %} {%- endif %}
"dl_nr_arfcn": { "dl_nr_arfcn": {
"title": "DL NR ARFCN", "title": "DL NR ARFCN",
...@@ -70,6 +90,53 @@ ...@@ -70,6 +90,53 @@
"type": "string", "type": "string",
"default": "0x01" "default": "0x01"
}, },
{%- if bbu != 'ors' %}
"cell_list": {
"title": "Cell List",
"description": "Cell List",
"patternProperties": {
".*": {
"properties": {
{%- if trx == 'cpri' %}
"cpri_rx_delay": {
"title": "CPRI RX Delay",
"description": "Delays between TX and RX position in CPRI frame. This should be set to the value of (T2a + T3a - Toffset) provided by the RRH specification.",
"type": "number",
"default": 25.11
},
"cpri_tx_delay": {
"title": "CPRI TX Delay",
"description": "Advances Start of Frame relative to PPS to compensate for delays in transmit line and RRH. This should be set to T12 + T2a.",
"type": "number",
"default": 14.71
},
"cpri_tx_dbm": {
"title": "CPRI TX dBm",
"description": "Optional floating points value in dBm (default 0). Needed by ENB/GNB to have a notion of actual output power. Computed from maximum power output of the RRH for a 0dBFS input signal (full scale). ",
"type": "number",
"default": 63
},
"cpri_port_number": {
"title": "CPRI Port Number",
"description": "CPRI Port Number",
"type": "number",
"default": 0
},
"ru_mac_addr": {
"title": "RU MAC address",
"description": "RU MAC address used for NETCONF",
"type": "string"
},
{%- endif %}
},
"type": "object"
}
},
"type": "object",
"default": {}
},
{%- endif %}
{%- if trx == 'sdr' %}
"tx_gain": { "tx_gain": {
"title": "Tx gain", "title": "Tx gain",
"description": "Tx gain (in dB)", "description": "Tx gain (in dB)",
...@@ -80,6 +147,64 @@ ...@@ -80,6 +147,64 @@
"description": "Rx gain (in dB)", "description": "Rx gain (in dB)",
"type": "number" "type": "number"
}, },
{%- endif %}
{%- if ru == 'lopcomm' %}
"txa0cc00_active": {
"title": "Lopcomm ORAN TX array carriers (TXA0CC00)",
"description": "Activate or inactivate Lopcomm ORAN TX array carriers (TXA0CC00)",
"type": "string",
"default": "INACTIVE",
"enum": [
"ACTIVE",
"INACTIVE"
]
},
"rxa0cc00_active": {
"title": "Lopcomm ORAN RX array carriers (RXA0CC00)",
"description": "Activate or inactivate Lopcomm ORAN RX array carriers (RXA0CC00)",
"type": "string",
"default": "INACTIVE",
"enum": [
"ACTIVE",
"INACTIVE"
]
},
"txa0cc00_center_frequency": {
"title": "Lopcomm ORAN DL Center Frequency in MHz (TXA0CC00)",
"description": "Lopcomm ORAN Center Frequency in MHz (TXA0CC00)",
"type": "number",
"default": 2140
},
"rxa0cc00_center_frequency_earfcn": {
"title": "Lopcomm ORAN UL Center Frequency EARFCN (RXA0CC00)",
"description": "Lopcomm ORAN Center Frequency EARFCN (RXA0CC00)",
"type": "number",
"default": 18300
},
"rxa0cc00_center_frequency": {
"title": "Lopcomm ORAN UL Center Frequency in MHz (RXA0CC00)",
"description": "Lopcomm ORAN Center Frequency in MHz (RXA0CC00)",
"type": "number",
"default": 1950
},
"txa0cc00_gain": {
"title": "ORAN Gain",
"description": "Lopcomm ORAN Gain (TXA0CC00)",
"type": "number",
"default": -20
},
"user-authorized-key": {
"title": "User Authorized Key",
"description": "SSH public key in order to connect to the SSH server of this instance.",
"textarea": true,
"type": "string"
},
"cron_schedule": {
"title": "Cron schedule for RRH reset",
"description": "Refer https://crontab.guru/ to make a reset schedule for RRH, for example, '0 1 * * *' means the RRH will reset every day at 1 am",
"type": "string"
},
{%- endif %}
"gnb_id": { "gnb_id": {
"title": "gNB ID", "title": "gNB ID",
"description": "gNB ID", "description": "gNB ID",
......
...@@ -39,12 +39,6 @@ ...@@ -39,12 +39,6 @@
], ],
"default": "[Configuration 2] 5ms 2UL 6DL (default)" "default": "[Configuration 2] 5ms 2UL 6DL (default)"
}, },
"sdr_number": {
"title": "SDR Number",
"description": "SDR Number",
"type": "number",
"default": 0
},
"cell_list": { "cell_list": {
"title": "Cell List", "title": "Cell List",
"description": "Cell List", "description": "Cell List",
......
...@@ -60,6 +60,19 @@ ...@@ -60,6 +60,19 @@
"type": "string", "type": "string",
"default": "0x01" "default": "0x01"
}, },
"cell_list": {
"title": "Cell List",
"description": "Cell List",
"patternProperties": {
".*": {
"properties": {
},
"type": "object"
}
},
"type": "object",
"default": {}
},
"tx_gain": { "tx_gain": {
"title": "Tx gain", "title": "Tx gain",
"description": "Tx gain (in dB)", "description": "Tx gain (in dB)",
......
...@@ -32,6 +32,24 @@ ...@@ -32,6 +32,24 @@
], ],
"default": "5ms 2UL 7DL 4/6 (default)" "default": "5ms 2UL 7DL 4/6 (default)"
}, },
"sdr_number": {
"title": "SDR Number",
"description": "SDR Number",
"type": "number",
"default": 0
},
"cpri_mult": {
"title": "CPRI Mult",
"description": "Select the CPRI line bit rate in terms of multiple of option 1 (614.4 Mbps). E.g set 4 for option 3, 8 for option 5 and 16 for option 7.",
"type": "number",
"default": 16,
"enum": [
4,
5,
8,
16
]
},
"dl_nr_arfcn": { "dl_nr_arfcn": {
"title": "DL NR ARFCN", "title": "DL NR ARFCN",
"description": "Downlink NR Absolute Radio Frequency Channel Number of the cell", "description": "Downlink NR Absolute Radio Frequency Channel Number of the cell",
...@@ -60,15 +78,47 @@ ...@@ -60,15 +78,47 @@
"type": "string", "type": "string",
"default": "0x01" "default": "0x01"
}, },
"tx_gain": { "cell_list": {
"title": "Tx gain", "title": "Cell List",
"description": "Tx gain (in dB)", "description": "Cell List",
"type": "number" "patternProperties": {
}, ".*": {
"rx_gain": { "properties": {
"title": "Rx gain", "cpri_rx_delay": {
"description": "Rx gain (in dB)", "title": "CPRI RX Delay",
"type": "number" "description": "Delays between TX and RX position in CPRI frame. This should be set to the value of (T2a + T3a - Toffset) provided by the RRH specification.",
"type": "number",
"default": 25.11
},
"cpri_tx_delay": {
"title": "CPRI TX Delay",
"description": "Advances Start of Frame relative to PPS to compensate for delays in transmit line and RRH. This should be set to T12 + T2a.",
"type": "number",
"default": 14.71
},
"cpri_tx_dbm": {
"title": "CPRI TX dBm",
"description": "Optional floating points value in dBm (default 0). Needed by ENB/GNB to have a notion of actual output power. Computed from maximum power output of the RRH for a 0dBFS input signal (full scale). ",
"type": "number",
"default": 63
},
"cpri_port_number": {
"title": "CPRI Port Number",
"description": "CPRI Port Number",
"type": "number",
"default": 0
},
"ru_mac_addr": {
"title": "RU MAC address",
"description": "RU MAC address used for NETCONF",
"type": "string"
},
},
"type": "object"
}
},
"type": "object",
"default": {}
}, },
"gnb_id": { "gnb_id": {
"title": "gNB ID", "title": "gNB ID",
......
...@@ -37,8 +37,6 @@ context = ...@@ -37,8 +37,6 @@ context =
key my_ipv6 slap-configuration:ipv6-random key my_ipv6 slap-configuration:ipv6-random
raw rf_mode ${rf-mode:rf-mode} raw rf_mode ${rf-mode:rf-mode}
raw software_name ${rf-mode:software-name} raw software_name ${rf-mode:software-name}
raw trx ${rf-mode:trx}
raw bbu ${rf-mode:bbu}
raw ru_type ${rf-mode:ru} raw ru_type ${rf-mode:ru}
$${:extra-context} $${:extra-context}
import-list = import-list =
......
...@@ -18,13 +18,13 @@ software_list = [ ...@@ -18,13 +18,13 @@ software_list = [
'rf_mode' : 'tdd', 'rf_mode' : 'tdd',
'trx' : 'sdr', 'trx' : 'sdr',
'bbu' : 'ors', 'bbu' : 'ors',
'ru' : 'ors', 'ru' : 'sdr',
}, { }, {
'software_name' : 'fdd-ors', 'software_name' : 'fdd-ors',
'rf_mode' : 'fdd', 'rf_mode' : 'fdd',
'trx' : 'sdr', 'trx' : 'sdr',
'bbu' : 'ors', 'bbu' : 'ors',
'ru' : 'ors', 'ru' : 'sdr',
}, { }, {
'software_name' : 'tdd-m2ru', 'software_name' : 'tdd-m2ru',
'rf_mode' : 'tdd', 'rf_mode' : 'tdd',
...@@ -42,13 +42,13 @@ software_list = [ ...@@ -42,13 +42,13 @@ software_list = [
'rf_mode' : 'fdd', 'rf_mode' : 'fdd',
'trx' : 'sdr', 'trx' : 'sdr',
'bbu' : 'server', 'bbu' : 'server',
'ru' : 'any', 'ru' : 'sdr',
}, { }, {
'software_name' : 'tdd', 'software_name' : 'tdd',
'rf_mode' : 'tdd', 'rf_mode' : 'tdd',
'trx' : 'sdr', 'trx' : 'sdr',
'bbu' : 'server', 'bbu' : 'server',
'ru' : 'any', 'ru' : 'sdr',
} }
] ]
......
dhcp-leasefile={{ directory['etc'] }}/dnsmasq.leases dhcp-leasefile={{ directory['etc'] }}/dnsmasq.leases
port=5354 port=5354
{%- for (cell_ref, cell) in cell_dict|dictsort | selectattr('1._tap', 'defined') %} {%- for (ru_ref, ru) in ru_dict|dictsort | selectattr('1.cpri_link', 'defined') %}
{%- set ru_tap = cell._tap %} {%- set ru_tap = ru.cpri_link._tap %}
{%- set vtap = json_module.loads(vtap_jdict[ru_tap]) %} {%- set vtap = json_module.loads(vtap_jdict[ru_tap]) %}
{%- set plen = netaddr.IPNetwork(vtap.network).prefixlen %} {%- set plen = netaddr.IPNetwork(vtap.network).prefixlen %}
# {{ cell_ref }} @ {{ ru_tap }} # {{ ru_ref }} @ {{ ru_tap }}
{#- TODO consider using /128 as we give only 1 address to RU #} {#- TODO consider using /128 as we give only 1 address to RU #}
dhcp-range=tag:{{ ru_tap }},{{ vtap.gateway }},{{ vtap.gateway }},static,{{ max(plen,64) }},5m dhcp-range=tag:{{ ru_tap }},{{ vtap.gateway }},{{ vtap.gateway }},static,{{ max(plen,64) }},5m
dhcp-host={{ cell.ru_mac_addr }},tag:{{ ru_tap }},[{{ vtap.gateway }}] dhcp-host={{ ru.mac_addr }},tag:{{ ru_tap }},[{{ vtap.gateway }}]
# option 17 used for RU callhome # option 17 used for RU callhome
# dhcp-option=option6:17,[{{ vtap.addr }}] # dhcp-option=option6:17,[{{ vtap.addr }}]
{%- endfor %} {%- endfor %}
......
...@@ -10,9 +10,13 @@ ...@@ -10,9 +10,13 @@
NOTE: driver-specific logic is implemented in rudrv .buildout_ru() and .buildout() . NOTE: driver-specific logic is implemented in rudrv .buildout_ru() and .buildout() .
#} #}
{#- cell_dict keeps cell registry #} {#- ru_dict and cell_dict keep RU and cell registries
{%- set cell_dict = {} %} ru_dict: reference -> ru
{%- do slaplte.load_cell(cell_dict) %} cell_dict: reference -> cell
#}
{%- set ru_dict = {} %}
{%- set cell_dict = {} %}
{%- do slaplte.load_ru_and_cell(ru_dict, cell_dict) %}
{%- macro buildout() %} {%- macro buildout() %}
...@@ -43,14 +47,14 @@ config-stats-period = {{ slapparameter_dict.get("enb_stats_fetch_period", 60) }} ...@@ -43,14 +47,14 @@ config-stats-period = {{ slapparameter_dict.get("enb_stats_fetch_period", 60) }}
sunwave=rudrv_sunwave) %} sunwave=rudrv_sunwave) %}
{%- set rudrv_init = {} %} {%- set rudrv_init = {} %}
{#- split slapos tap interface for each RU {#- split slapos tap interface for each RU that needs its own tap.
fallback to non-split approach for ntap <= 1 to avoid hard-dependecy on setcap/tapsplit fallback to non-split approach for ntap <= 1 to avoid hard-dependecy on setcap/tapsplit
TODO Relying on setcap and tapsplit should be removed once SlapOS is improved to TODO Relying on setcap and tapsplit should be removed once SlapOS is improved to
provide several TAP interfaces to instances. See discussion at provide several TAP interfaces to instances. See discussion at
https://lab.nexedi.com/nexedi/slapos/merge_requests/1471#note_194356 https://lab.nexedi.com/nexedi/slapos/merge_requests/1471#note_194356
for details. #} for details. #}
{%- set ntap = len(list(cell_dict|dictsort)) %} {%- set ntap = len(list(ru_dict|dictsort | selectattr('1.cpri_link', 'defined'))) %}
{%- set vtap_list = [] %} {%- set vtap_list = [] %}
[vtap] [vtap]
recipe = plone.recipe.command recipe = plone.recipe.command
...@@ -132,7 +136,7 @@ init = ...@@ -132,7 +136,7 @@ init =
{#- provide CPRI-based RUs IP address via DHCP #} {#- provide CPRI-based RUs IP address via DHCP #}
{%- if trx == 'cpri' %} {%- if ntap > 0 %}
[dnsmasq-config] [dnsmasq-config]
recipe = slapos.recipe.template:jinja2 recipe = slapos.recipe.template:jinja2
url = {{ru_dnsmasq_template}} url = {{ru_dnsmasq_template}}
...@@ -144,7 +148,7 @@ context = ...@@ -144,7 +148,7 @@ context =
import netaddr netaddr import netaddr netaddr
section directory directory section directory directory
section vtap_jdict vtap_jdict section vtap_jdict vtap_jdict
json cell_dict {{ cell_dict | tojson }} json ru_dict {{ ru_dict | tojson }}
{{ part('dnsmasq-service') }} {{ part('dnsmasq-service') }}
recipe = slapos.cookbook:wrapper recipe = slapos.cookbook:wrapper
...@@ -165,31 +169,27 @@ hash-files = ...@@ -165,31 +169,27 @@ hash-files =
{#- go through all RUs and for each RU emit generic promises and invoke {#- go through all RUs and for each RU emit generic promises and invoke
RU-specific buildout handler #} RU-specific buildout handler #}
{%- set ru_type = {'lopcomm': 'lopcomm', 'm2ru': 'sunwave'}.get(ru_type, 'sdr') %} {%- for ru_ref, ru in ru_dict|dictsort %}
{%- set rudrv = rudrv_dict[ru_type] %}
{%- for i, (cell_ref, cell) in enumerate(cell_dict|dictsort) %} # {{ ru_ref }} {{ ru.n_antenna_dl }}T{{ ru.n_antenna_ul }}R ({{ ru.ru_type}})
{%- set ru_ref = cell_ref if cell_ref != 'default' else 'RU' %} {%- if ru.ru_link_type == 'sdr' %}
{%- set n_antenna_ul = int(slapparameter_dict.get('n_antenna_ul', default_n_antenna_ul)) %}
# {{ ru_ref }} ({{ ru_type}})
{%- if trx == 'sdr' %}
{{ promise('%s-sdr-busy' % ru_ref) }} {{ promise('%s-sdr-busy' % ru_ref) }}
promise = check_sdr_busy promise = check_sdr_busy
config-sdr = {{ sdr }} config-sdr = {{ sdr }}
config-sdr_dev = 0 config-sdr_dev = {{ ru.sdr_dev }}
config-dma_chan = 0 config-dma_chan = 0
{%- elif trx == 'cpri' %} {%- elif ru.ru_link_type == 'cpri' %}
{{ promise('%s-sdr-busy' % ru_ref) }} {{ promise('%s-sdr-busy' % ru_ref) }}
promise = check_sdr_busy promise = check_sdr_busy
config-sdr = {{ sdr }} config-sdr = {{ sdr }}
config-sdr_dev = {{ slapparameter_dict.get('sdr_number', 0) }} config-sdr_dev = {{ ru.cpri_link.sdr_dev }}
config-dma_chan = {{ cell.cpri_port_number }} config-dma_chan = {{ ru.cpri_link.sfp_port }}
{{ promise('%s-cpri-lock' % ru_ref) }} {{ promise('%s-cpri-lock' % ru_ref) }}
promise = check_cpri_lock promise = check_cpri_lock
config-sdr_dev = {{ slapparameter_dict.get('sdr_number', 0) }} config-sdr_dev = {{ ru.cpri_link.sdr_dev }}
config-sfp_port = {{ cell.cpri_port_number }} config-sfp_port = {{ ru.cpri_link.sfp_port }}
config-amarisoft-rf-info-log = ${ru_amarisoft-rf-info-template:log-output} config-amarisoft-rf-info-log = ${ru_amarisoft-rf-info-template:log-output}
{%- else %} {%- else %}
...@@ -198,16 +198,17 @@ config-amarisoft-rf-info-log = ${ru_amarisoft-rf-info-template:log-output} ...@@ -198,16 +198,17 @@ config-amarisoft-rf-info-log = ${ru_amarisoft-rf-info-template:log-output}
{{ promise('%s-rx-saturated' % ru_ref) }} {{ promise('%s-rx-saturated' % ru_ref) }}
promise = check_rx_saturated promise = check_rx_saturated
config-rf-rx-chan-list = {{ list(range(i*n_antenna_ul, (i+1)*n_antenna_ul)) }} config-rf-rx-chan-list = {{ list(range(ru._rf_chan_rx, ru._rf_chan_rx + ru.n_antenna_ul)) }}
config-amarisoft-stats-log = ${ru_amarisoft-stats-template:log-output} config-amarisoft-stats-log = ${ru_amarisoft-stats-template:log-output}
config-max-rx-sample-db = {{ slapparameter_dict.get("max_rx_sample_db", 0) }} config-max-rx-sample-db = {{ slapparameter_dict.get("max_rx_sample_db", 0) }}
{#- driver-specific part #} {#- driver-specific part #}
{%- if not rudrv_init.get(ru_type) %} {%- set rudrv = rudrv_dict[ru.ru_type] %}
{%- if not rudrv_init.get(ru.ru_type) %}
{{ rudrv.buildout() }} {{ rudrv.buildout() }}
{%- do rudrv_init.update({ru_type: 1}) %} {%- do rudrv_init.update({ru.ru_type: 1}) %}
{%- endif %} {%- endif %}
{{ rudrv.buildout_ru(ru_ref, cell) }} {{ rudrv.buildout_ru(ru_ref, ru) }}
{%- endfor %} {%- endfor %}
{#- retrieve rf and stats[rf,samples] data from amarisoft service for promises {#- retrieve rf and stats[rf,samples] data from amarisoft service for promises
......
<xc:config xmlns:xc="urn:ietf:params:xml:ns:netconf:base:1.0"> <xc:config xmlns:xc="urn:ietf:params:xml:ns:netconf:base:1.0">
{%- set n_antenna_dl = slapparameter_dict.get('n_antenna_dl', int(default_n_antenna_dl)) %}
{%- set n_antenna_ul = slapparameter_dict.get('n_antenna_ul', int(default_n_antenna_ul)) %}
<user-plane-configuration xc:operation="replace" xmlns="urn:o-ran:uplane-conf-option8:1.0"> <user-plane-configuration xc:operation="replace" xmlns="urn:o-ran:uplane-conf-option8:1.0">
<!-- TX path: eaxcid → TxEndpoint <!-- TX path: eaxcid → TxEndpoint
...@@ -11,7 +9,7 @@ ...@@ -11,7 +9,7 @@
(static TxEndpoint, TxArray and their association are defined by RU itself) (static TxEndpoint, TxArray and their association are defined by RU itself)
--> -->
{%- set TxCarrier = 'TXA0CC00' %} {%- set TxCarrier = 'TXA0CC00' %}
{%- for ant in range(n_antenna_dl) %} {%- for ant in range(ru.n_antenna_dl) %}
{%- set port = ant // 2 %} {%- set port = ant // 2 %}
{%- set chan = ant % 2 %} {%- set chan = ant % 2 %}
{%- set txep = 'TXA0P%02dC%02d' % (port, chan) %} {%- set txep = 'TXA0P%02dC%02d' % (port, chan) %}
...@@ -47,7 +45,7 @@ ...@@ -47,7 +45,7 @@
(static RxEndpoint, RxArray and their association are defined by RU itself) (static RxEndpoint, RxArray and their association are defined by RU itself)
--> -->
{%- set RxCarrier = 'RXA0CC00' %} {%- set RxCarrier = 'RXA0CC00' %}
{%- for ant in range(n_antenna_ul) %} {%- for ant in range(ru.n_antenna_ul) %}
{%- set port = ant // 2 %} {%- set port = ant // 2 %}
{%- set chan = ant % 2 %} {%- set chan = ant % 2 %}
{%- set rxep = 'RXA0P%02dC%02d' % (port, chan) %} {%- set rxep = 'RXA0P%02dC%02d' % (port, chan) %}
......
{#- Package ru/lopcomm/libinstance provides instance code for handling Lopcomm ORAN Radio Units. #} {#- Package ru/lopcomm/libinstance provides instance code for handling Lopcomm ORAN Radio Units. #}
{%- macro buildout_ru(ru_ref, cell) %} {%- macro buildout_ru(ru_ref, ru) %}
{#- indicate whether RU is listening for netconf #} {#- indicate whether RU is listening for netconf #}
{%- if not testing %} {%- if not testing %}
{{ promise('%s-netconf-socket' % ru_ref) }} {{ promise('%s-netconf-socket' % ru_ref) }}
promise = check_socket_listening promise = check_socket_listening
config-host = ${vtap.{{cell._tap}}:gateway} config-host = ${vtap.{{ru.cpri_link._tap}}:gateway}
config-port = 830 config-port = 830
{%- endif %} {%- endif %}
...@@ -24,7 +24,7 @@ remote-file-path = sftp://${user-info:pw-name}@[${sshd-service:ipv6}]:${sshd-ser ...@@ -24,7 +24,7 @@ remote-file-path = sftp://${user-info:pw-name}@[${sshd-service:ipv6}]:${sshd-ser
is_firmware_updated = ${directory:etc}/{{ru_ref}}.is_firmware_updated is_firmware_updated = ${directory:etc}/{{ru_ref}}.is_firmware_updated
context = context =
section directory directory section directory directory
section vtap vtap.{{ cell._tap }} section vtap vtap.{{ ru.cpri_link._tap }}
key slapparameter_dict myslap:parameter_dict key slapparameter_dict myslap:parameter_dict
key log_file :log-output key log_file :log-output
key software_reply_json_log_file :software-reply-json-log-output key software_reply_json_log_file :software-reply-json-log-output
...@@ -64,6 +64,8 @@ url = ${cu-config-dl:target} ...@@ -64,6 +64,8 @@ url = ${cu-config-dl:target}
url = {{ ru_lopcomm_cu_config_template }} url = {{ ru_lopcomm_cu_config_template }}
{% endif %} {% endif %}
output = ${directory:etc}/{{ru_ref}}-cu_config.xml output = ${directory:etc}/{{ru_ref}}-cu_config.xml
extra-context =
json ru {{ ru | tojson }}
[{{ru_ref}}-config-template] [{{ru_ref}}-config-template]
recipe = slapos.recipe.template:jinja2 recipe = slapos.recipe.template:jinja2
...@@ -71,7 +73,7 @@ extensions = jinja2.ext.do ...@@ -71,7 +73,7 @@ extensions = jinja2.ext.do
log-output = ${directory:var}/log/{{ru_ref}}-config.log log-output = ${directory:var}/log/{{ru_ref}}-config.log
context = context =
section directory directory section directory directory
section vtap vtap.{{ cell._tap }} section vtap vtap.{{ ru.cpri_link._tap }}
key log_file :log-output key log_file :log-output
raw testing {{ testing }} raw testing {{ testing }}
raw python_path {{ buildout_directory}}/bin/pythonwitheggs raw python_path {{ buildout_directory}}/bin/pythonwitheggs
...@@ -104,7 +106,7 @@ supervision-reply-json-log-output = ${:_logbase}-supervision-reply.json.log ...@@ -104,7 +106,7 @@ supervision-reply-json-log-output = ${:_logbase}-supervision-reply.json.log
is_netconf_connected = ${directory:etc}/{{ru_ref}}.is_netconf_connected is_netconf_connected = ${directory:etc}/{{ru_ref}}.is_netconf_connected
context = context =
section directory directory section directory directory
section vtap vtap.{{ cell._tap }} section vtap vtap.{{ ru.cpri_link._tap }}
key slapparameter_dict myslap:parameter_dict key slapparameter_dict myslap:parameter_dict
key log_file :log-output key log_file :log-output
key json_log_file :json-log-output key json_log_file :json-log-output
...@@ -176,7 +178,7 @@ _logbase = ${directory:var}/log/{{ru_ref}}-reset-info ...@@ -176,7 +178,7 @@ _logbase = ${directory:var}/log/{{ru_ref}}-reset-info
log-output = ${:_logbase}.log log-output = ${:_logbase}.log
json-log-output = ${:_logbase}.json.log json-log-output = ${:_logbase}.json.log
context = context =
section vtap vtap.{{ cell._tap }} section vtap vtap.{{ ru.cpri_link._tap }}
key log_file :log-output key log_file :log-output
key json_log_file :json-log-output key json_log_file :json-log-output
raw stats_period {{ slapparameter_dict.get("enb_stats_fetch_period", 60) }} raw stats_period {{ slapparameter_dict.get("enb_stats_fetch_period", 60) }}
...@@ -194,7 +196,7 @@ _logbase = ${directory:var}/log/{{ru_ref}}-reset ...@@ -194,7 +196,7 @@ _logbase = ${directory:var}/log/{{ru_ref}}-reset
log-output = ${:_logbase}.log log-output = ${:_logbase}.log
json-log-output = ${:_logbase}.json.log json-log-output = ${:_logbase}.json.log
context = context =
section vtap vtap.{{ cell._tap }} section vtap vtap.{{ ru.cpri_link._tap }}
key log_file :log-output key log_file :log-output
raw python_path {{ buildout_directory}}/bin/pythonwitheggs raw python_path {{ buildout_directory}}/bin/pythonwitheggs
raw buildout_directory_path {{ buildout_directory }} raw buildout_directory_path {{ buildout_directory }}
......
{#- Package ru/sdr/libinstance provides instance code for handling SDR Radio Units. #} {#- Package ru/sdr/libinstance provides instance code for handling SDR Radio Units. #}
{%- macro buildout_ru(ru_ref, cell) %} {%- macro buildout_ru(ru_ref, ru) %}
{#- nothing SDR-specific #} {#- nothing SDR-specific #}
{%- endmacro %} {%- endmacro %}
......
{#- Package ru/sunwave/libinstance provides instance code for handling SunWave Radio Units. #} {#- Package ru/sunwave/libinstance provides instance code for handling SunWave Radio Units. #}
{%- macro buildout_ru(ru_ref, cell) %} {%- macro buildout_ru(ru_ref, ru) %}
{#- nothing SunWave-specific #} {#- nothing SunWave-specific #}
{%- endmacro %} {%- endmacro %}
......
{#- Package slaplte provides helpers for configuring Amarisoft LTE services in SlapOS. {#- Package slaplte provides helpers for configuring Amarisoft LTE services in SlapOS.
- load_cell initializes cell registry. - load_ru_and_cell initializes RU and cell registries.
- ru_config emits RF driver configuration for specified Radio Units. - ru_config emits RF driver configuration for specified Radio Units.
The following utilities are also provided: The following utilities are also provided:
...@@ -9,6 +9,38 @@ ...@@ -9,6 +9,38 @@
- error reports instantiation error. - error reports instantiation error.
-#} -#}
{#- defaults provide default values for lte parameters. #}
{%- set defaults = {
'ru': {
'n_antenna_dl': int(default_n_antenna_dl),
'n_antenna_ul': int(default_n_antenna_ul),
},
'ru/cpri_link': {
'rx_delay': 0,
'tx_delay': 0,
'tx_dbm': 0,
},
'ru/lopcomm': {
},
'ru/lopcomm/cpri_link': {
'mapping': 'hw',
'rx_delay': 25.11,
'tx_delay': 14.71,
'tx_dbm': 63,
},
'ru/sunwave': {
'n_antenna_ul': 1,
},
'ru/sunwave/cpri_link': {
'mapping': 'bf1',
'rx_delay': 11.0,
'tx_dbm': 42.0,
},
}
%}
{#- J is used around macro calls to retrieve returned objects. {#- J is used around macro calls to retrieve returned objects.
...@@ -49,119 +81,184 @@ ...@@ -49,119 +81,184 @@
{#- ---- loading ---- #} {#- ---- loading ---- #}
{#- load_cell initializes cell registry. {#- load_ru_and_cell initializes RU and cell registries.
cell_dict keeps configured cells: {} cell reference -> cell parameters cell_dict keeps configured cells: {} cell reference -> cell parameters
ru_dict keeps configured RU: {} RU reference -> RU parameters
#} #}
{%- macro load_cell(cell_dict) %} {%- macro load_ru_and_cell(ru_dict, cell_dict) %}
{%- do cell_dict.update( slapparameter_dict.get('cell_list', {'default': {}}) ) %} {%- do cell_dict.update( slapparameter_dict.get('cell_list', {'default': {}}) ) %}
{%- for i, k in enumerate(cell_dict) %} {%- for i, (cell_ref, cell) in enumerate(cell_dict|dictsort) %}
{%- set cell = cell_dict[k] %} {%- set ru_ref = '%s-RU' % cell_ref %}
{%- do cell.setdefault('cpri_port_number', i) %} {%- set ru = {'ru_type': ru_type, 'cell_ref': cell_ref} %}
{%- if ru.ru_type == 'm2ru' %}
{%- do ru.update({'ru_type': 'sunwave'}) %}
{%- endif %}
{%- do cell.update({'ru_ref': ru_ref}) %}
{%- macro ru_set(name) %}
{%- if name in slapparameter_dict %}
{%- do ru.update({name: slapparameter_dict[name]}) %}
{%- endif %}
{%- endmacro %}
{%- do ru_set('n_antenna_dl') %}
{%- do ru_set('n_antenna_ul') %}
{%- do ru.update({'ru_link_type': 'cpri' if ru.ru_type in ('lopcomm', 'sunwave') else 'sdr'}) %}
{%- if ru.ru_link_type == 'sdr' %}
{%- do ru.update({'sdr_dev': i,
'tx_gain': RF.tx_gain,
'rx_gain': RF.rx_gain,
}) %}
{%- elif ru.ru_link_type == 'cpri' %}
{#- set 0 tx/rx gain to emit 0 in enb.cfg.
This will be changed later: .tx_gain and .rx_gain will be carrying real RU tx/rx gain #}
{%- do ru.update({'tx_gain': 0,
'rx_gain': 0,
}) %}
{%- set link = {
'sdr_dev': slapparameter_dict.get('sdr_number', 0),
'sfp_port': cell.get('cpri_port_number', i),
'mult': slapparameter_dict.get('cpri_mult', 16),
} %}
{%- macro link_set(name) %}
{%- set cname = 'cpri_'+name %}
{%- if cname in cell %}
{%- do link.update({name: cell[cname]}) %}
{%- endif %}
{%- endmacro %}
{%- do link_set('rx_delay') %}
{%- do link_set('tx_delay') %}
{%- do link_set('tx_dbm') %}
{%- do ru.update({'cpri_link': link}) %}
{%- do ru.update({'mac_addr': cell.ru_mac_addr}) %}
{%- else %}
{%- do bug('unreachable') %}
{%- endif %}
{%- do _ru_set_defaults(ru) %}
{%- do ru_dict.update({ru_ref: ru}) %}
{%- endfor %} {%- endfor %}
{#- assign RUs rf_port and tx/rx channel indices #}
{%- set rf_chan = namespace(tx=0, rx=0) %}
{%- for rf_port, (ru_ref, ru) in enumerate(ru_dict|dictsort) %}
{%- do ru.update({'_rf_port': rf_port,
'_rf_chan_tx': rf_chan.tx,
'_rf_chan_rx': rf_chan.rx}) %}
{%- set rf_chan.tx = rf_chan.tx + ru.n_antenna_dl %}
{%- set rf_chan.rx = rf_chan.rx + ru.n_antenna_ul %}
{%- endfor %}
{#- assign TAP interfaces to RUs #} {#- assign TAP interfaces to RUs #}
{%- for i, (cell_ref, cell) in enumerate(cell_dict|dictsort) %} {%- set ru_vcpri = list(ru_dict|dictsort | selectattr('1.ru_link_type', '==', 'cpri')) %}
{%- if len(cell_dict) > 1 %} {%- for i, (ru_ref, ru) in enumerate(ru_vcpri) %}
{%- if len(ru_vcpri) > 1 %}
{%- set ru_tap = "%s-%d" % (tap, i+1) %} {%- set ru_tap = "%s-%d" % (tap, i+1) %}
{%- else %} {%- else %}
{%- set ru_tap = tap %} {%- set ru_tap = tap %}
{%- endif %} {%- endif %}
{%- do cell.update({'_tap': ru_tap}) %} {%- do ru.cpri_link.update({'_tap': ru_tap}) %}
{%- endfor %} {%- endfor %}
{%- endmacro %} {%- endmacro %}
{%- macro _ru_set_defaults(ru) %}
{%- for k, v in defaults['ru'].items() %}
{%- do ru.setdefault(k, v) %}
{%- endfor %}
{%- for k, v in defaults.get('ru/'+ru.ru_type, {}).items() %}
{%- do ru.setdefault(k, v) %}
{%- endfor %}
{%- if ru.ru_link_type == 'cpri' %}
{%- set link = ru.cpri_link %}
{%- for k, v in defaults['ru/cpri_link'].items() %}
{%- do link.setdefault(k, v) %}
{%- endfor %}
{%- for k, v in defaults['ru/%s/cpri_link' % ru.ru_type].items() %}
{%- do link.setdefault(k, v) %}
{%- endfor %}
{%- endif %}
{%- endmacro %}
{#- ---- building configuration ---- #} {#- ---- building configuration ---- #}
{#- ru_config emits RF driver configuration for specified Radio Units. #} {#- ru_config emits RF driver configuration for specified Radio Units. #}
{%- macro ru_config(ru, cell_dict, slapparameter_dict) %} {%- macro ru_config(ru_dict, slapparameter_dict) %}
{% if ru.ru_type == "lopcomm" %} // Radio Units
rf_driver: { rf_driver: {
{%- if slapparameter_dict.get('disable_sdr', False) %} {%- set dev_argv = [] %}
name: "dummy", {%- set ru_sdr_dict = {} %} {#- dev -> ru for ru with ru_type = sdr #}
{%- else %} {%- set ru_cpri_dict = {} %} {#- dev -> ru for ru with link_type = cpri #}
name: "sdr", {%- set tx_gainv = [] %} {#- tx_gain by tx channel #}
{%- endif %} {%- set rx_gainv = [] %} {#- rx_gain by rx channel #}
args: "dev0= {%- for (ru_ref, ru) in ru_dict.items() | sort(attribute="1._rf_port") %}
{%- for i, k in enumerate(cell_dict) %} // {{ ru_ref }} {{ ru.n_antenna_dl }}T{{ ru.n_antenna_ul }}R ({{ ru.ru_type }})
{%- set cpri_port = cell_dict[k].cpri_port_number %} {%- if ru.ru_link_type == 'sdr' %}
{%- if i != 0 -%} {%- do ru_sdr_dict.update({len(dev_argv): ru}) %}
, {%- do dev_argv.append("dev%d=/dev/sdr%d" % (len(dev_argv), ru.sdr_dev)) %}
{%- endif -%} {%- elif ru.ru_link_type == 'cpri' %}
/dev/sdr{{ slapparameter_dict.get('sdr_number', 0) }}@{{ cpri_port }} {%- do ru_cpri_dict.update({len(dev_argv): ru}) %}
{%- endfor -%} {%- set link = ru.cpri_link %}
", {%- do dev_argv.append("dev%d=/dev/sdr%d@%d" % (len(dev_argv), link.sdr_dev, link.sfp_port)) %}
cpri_mapping: "hw", {%- else %}
{%- set cpri_mult = slapparameter_dict.get('cpri_mult', 16) %} {%- do bug('unreachable') %}
cpri_mult: " {%- endif %}
{%- for i, k in enumerate(cell_dict) %} {%- do tx_gainv.extend([ru.tx_gain]*ru.n_antenna_dl) %}
{%- if i != 0 -%} {%- do rx_gainv.extend([ru.rx_gain]*ru.n_antenna_ul) %}
, {%- endfor %}
{%- endif -%}
{{ cpri_mult }} {#- emit big error if both sdr and cpri are present
{%- endfor -%} to protect users from unclear eNB failures in such unsupported combination #}
", {%- set do_sdr = len(ru_sdr_dict) > 0 %}
cpri_rx_delay: " {%- set do_cpri = len(ru_cpri_dict) > 0 %}
{%- for i, k in enumerate(cell_dict) %} {%- if do_sdr and do_cpri %}
{%- if i != 0 -%} {%- do error('Mixing SDR + CPRI is not supported and breaks subtly.
,
{%- endif -%} SDR Radio Units: %r
{{ cell_dict[k].get('cpri_rx_delay', 0) }} CPRI Radio Units: %r
{%- endfor -%}
", See https://support.amarisoft.com/issues/26021 for details' % (
cpri_tx_delay: " ru_dict |dictsort |selectattr('1.ru_type', '==', 'sdr') |map(attribute='0') |list,
{%- for i, k in enumerate(cell_dict) %} ru_dict |dictsort |selectattr('1.ru_link_type', '==', 'cpri') |map(attribute='0') |list
{%- if i != 0 -%} )) %}
, {%- endif %}
{%- endif -%}
{{ cell_dict[k].get('cpri_tx_delay', 0) }} {%- if slapparameter_dict.get('disable_sdr', False) %}
{%- endfor -%}
",
cpri_tx_dbm: "
{%- for i, k in enumerate(cell_dict) %}
{%- if i != 0 -%}
,
{%- endif -%}
{{ cell_dict[k].get('cpri_tx_dbm', 0) }}
{%- endfor -%}
",
ifname: "{{ cell_dict.values() | map(attribute='_tap') | join(',') }}",
},
tx_gain: 0,
rx_gain: 0,
{% elif ru.ru_type == "sunwave" %}
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 ors %}
rf_driver: {
{%- if slapparameter_dict.get('disable_sdr', False) %}
name: "dummy", name: "dummy",
{%- else %} {%- else %}
name: "sdr", name: "sdr",
{%- endif %} {%- endif %}
args: "dev0=/dev/sdr0",
{% if slapparameter_dict.get('gps_sync', False) %} {%- if slapparameter_dict.get('gps_sync', False) %}
sync: "gps", sync: "gps",
{% endif %} {%- endif %}
{#- below we continue as if sdr and cpri are both supported by enb simultaneously #}
args: "{{dev_argv | join(',')}}",
{%- if ors %}
rx_antenna:"tx_rx", rx_antenna:"tx_rx",
tdd_tx_mod: 1, tdd_tx_mod: 1,
{%- endif %}
{#- emit cpri_* options if a cpri ru is present #}
{#- NOTE values for non-cpri links come as empty #}
{%- if do_cpri %}
{%- set vcpri = [None]*len(dev_argv) %}
{%- for dev, ru in ru_cpri_dict|dictsort %}
{%- do vcpri.__setitem__(dev, ru.cpri_link) %}
{%- endfor %}
cpri_mapping: "{{ vcpri | map(attribute='mapping') | map('default', '') | join(',') }}",
cpri_mult: "{{ vcpri | map(attribute='mult') | map('default', '') | join(',') }}",
cpri_rx_delay: "{{ vcpri | map(attribute='rx_delay') | map('default', '') | join(',') }}",
cpri_tx_delay: "{{ vcpri | map(attribute='tx_delay') | map('default', '') | join(',') }}",
cpri_tx_dbm: "{{ vcpri | map(attribute='tx_dbm') | map('default', '') | join(',') }}",
ifname: "{{ vcpri | map(attribute='_tap') | map('default', '') | join(',') }}",
{%- endif %}
}, },
tx_gain: {{ tx_gain }},
rx_gain: {{ rx_gain }}, {#- emit tx/rx gain for all channels #}
{% endif %} tx_gain: {{ tx_gainv }},
rx_gain: {{ rx_gainv }},
{%- endmacro %} {%- endmacro %}
...@@ -66,15 +66,15 @@ def do(src, out, rat, slapparameter_dict): ...@@ -66,15 +66,15 @@ def do(src, out, rat, slapparameter_dict):
"rf_mode": "tdd", "rf_mode": "tdd",
"do_lte": %(jdo_lte)s, "do_lte": %(jdo_lte)s,
"do_nr": %(jdo_nr)s, "do_nr": %(jdo_nr)s,
"trx": "sdr",
"bbu": "ors",
"ru_type": "ors", "ru_type": "ors",
"ors": {"one-watt": true}, "ors": {"one-watt": true},
"earfcn": 36100, "earfcn": 36100,
"nr_arfcn": 380000, "nr_arfcn": 380000,
"nr_band": 39, "nr_band": 39,
"tx_gain": 62, "RF": {
"rx_gain": 43, "tx_gain": 62,
"rx_gain": 43
},
"sib23_file": "sib", "sib23_file": "sib",
"drb_file": "drb", "drb_file": "drb",
"slap_configuration": { "slap_configuration": {
......
...@@ -20,6 +20,4 @@ default-n-antenna-ul = 2 ...@@ -20,6 +20,4 @@ default-n-antenna-ul = 2
[rf-mode] [rf-mode]
software-name = fdd-lopcomm software-name = fdd-lopcomm
rf-mode = fdd rf-mode = fdd
trx = cpri
bbu = server
ru = lopcomm ru = lopcomm
...@@ -20,6 +20,4 @@ default-n-antenna-ul = 2 ...@@ -20,6 +20,4 @@ default-n-antenna-ul = 2
[rf-mode] [rf-mode]
software-name = fdd-ors software-name = fdd-ors
rf-mode = fdd rf-mode = fdd
trx = sdr ru = sdr
bbu = ors
ru = ors
...@@ -20,6 +20,4 @@ default-n-antenna-ul = 2 ...@@ -20,6 +20,4 @@ default-n-antenna-ul = 2
[rf-mode] [rf-mode]
software-name = fdd software-name = fdd
rf-mode = fdd rf-mode = fdd
trx = sdr ru = sdr
bbu = server
ru = any
...@@ -20,6 +20,4 @@ default-n-antenna-ul = 2 ...@@ -20,6 +20,4 @@ default-n-antenna-ul = 2
[rf-mode] [rf-mode]
software-name = tdd-m2ru software-name = tdd-m2ru
rf-mode = tdd rf-mode = tdd
trx = cpri
bbu = server
ru = m2ru ru = m2ru
...@@ -20,6 +20,4 @@ default-n-antenna-ul = 2 ...@@ -20,6 +20,4 @@ default-n-antenna-ul = 2
[rf-mode] [rf-mode]
software-name = tdd-ors software-name = tdd-ors
rf-mode = tdd rf-mode = tdd
trx = sdr ru = sdr
bbu = ors
ru = ors
...@@ -20,6 +20,4 @@ default-n-antenna-ul = 2 ...@@ -20,6 +20,4 @@ default-n-antenna-ul = 2
[rf-mode] [rf-mode]
software-name = tdd software-name = tdd
rf-mode = tdd rf-mode = tdd
trx = sdr ru = sdr
bbu = server
ru = any
...@@ -24,6 +24,4 @@ default-n-antenna-ul = {{ default_n_antenna_ul }} ...@@ -24,6 +24,4 @@ default-n-antenna-ul = {{ default_n_antenna_ul }}
[rf-mode] [rf-mode]
software-name = {{ software_name }} software-name = {{ software_name }}
rf-mode = {{ rf_mode }} rf-mode = {{ rf_mode }}
trx = {{ trx }}
bbu = {{ bbu }}
ru = {{ ru }} ru = {{ ru }}
...@@ -142,9 +142,10 @@ def test_enb_conf(self): ...@@ -142,9 +142,10 @@ def test_enb_conf(self):
self.slap.instance_directory, '*', 'etc', 'enb.cfg'))[0] self.slap.instance_directory, '*', 'etc', 'enb.cfg'))[0]
conf = yamlpp_load(conf_file) conf = yamlpp_load(conf_file)
if 'tx_gain' in conf and 'rx_gain' in conf: {%- if ru == 'sdr' %}
self.assertEqual(conf['tx_gain'], enb_param_dict['tx_gain']) self.assertEqual(conf['tx_gain'], [enb_param_dict['tx_gain']] * enb_param_dict['n_antenna_dl'])
self.assertEqual(conf['rx_gain'], enb_param_dict['rx_gain']) self.assertEqual(conf['rx_gain'], [enb_param_dict['rx_gain']] * enb_param_dict['n_antenna_ul'])
{%- endif %}
self.assertEqual(conf['cell_list'][0]['inactivity_timer'], enb_param_dict['inactivity_timer']) self.assertEqual(conf['cell_list'][0]['inactivity_timer'], enb_param_dict['inactivity_timer'])
{%- if rf_mode == 'tdd' %} {%- if rf_mode == 'tdd' %}
self.assertEqual(conf['cell_list'][0]['uldl_config'], 6) self.assertEqual(conf['cell_list'][0]['uldl_config'], 6)
...@@ -180,9 +181,10 @@ def test_gnb_conf1(self): ...@@ -180,9 +181,10 @@ def test_gnb_conf1(self):
self.slap.instance_directory, '*', 'etc', 'enb.cfg'))[0] self.slap.instance_directory, '*', 'etc', 'enb.cfg'))[0]
conf = yamlpp_load(conf_file) conf = yamlpp_load(conf_file)
if 'tx_gain' in conf and 'rx_gain' in conf: {%- if ru == 'sdr' %}
self.assertEqual(conf['tx_gain'], gnb_param_dict1['tx_gain']) self.assertEqual(conf['tx_gain'], [gnb_param_dict1['tx_gain']] * gnb_param_dict1['n_antenna_dl'])
self.assertEqual(conf['rx_gain'], gnb_param_dict1['rx_gain']) self.assertEqual(conf['rx_gain'], [gnb_param_dict1['rx_gain']] * gnb_param_dict1['n_antenna_ul'])
{%- endif %}
self.assertEqual(conf['nr_cell_list'][0]['inactivity_timer'], gnb_param_dict1['inactivity_timer']) self.assertEqual(conf['nr_cell_list'][0]['inactivity_timer'], gnb_param_dict1['inactivity_timer'])
self.assertEqual(conf['nr_cell_list'][0]['dl_nr_arfcn'], gnb_param_dict1['dl_nr_arfcn']) self.assertEqual(conf['nr_cell_list'][0]['dl_nr_arfcn'], gnb_param_dict1['dl_nr_arfcn'])
self.assertEqual(conf['nr_cell_list'][0]['band'], gnb_param_dict1['nr_band']) self.assertEqual(conf['nr_cell_list'][0]['band'], gnb_param_dict1['nr_band'])
......
...@@ -142,9 +142,6 @@ def test_enb_conf(self): ...@@ -142,9 +142,6 @@ def test_enb_conf(self):
self.slap.instance_directory, '*', 'etc', 'enb.cfg'))[0] self.slap.instance_directory, '*', 'etc', 'enb.cfg'))[0]
conf = yamlpp_load(conf_file) conf = yamlpp_load(conf_file)
if 'tx_gain' in conf and 'rx_gain' in conf:
self.assertEqual(conf['tx_gain'], enb_param_dict['tx_gain'])
self.assertEqual(conf['rx_gain'], enb_param_dict['rx_gain'])
self.assertEqual(conf['cell_list'][0]['inactivity_timer'], enb_param_dict['inactivity_timer']) self.assertEqual(conf['cell_list'][0]['inactivity_timer'], enb_param_dict['inactivity_timer'])
self.assertNotIn('uldl_config', conf['cell_list'][0]) self.assertNotIn('uldl_config', conf['cell_list'][0])
self.assertEqual(conf['cell_list'][0]['dl_earfcn'], enb_param_dict['dl_earfcn']) self.assertEqual(conf['cell_list'][0]['dl_earfcn'], enb_param_dict['dl_earfcn'])
...@@ -176,9 +173,6 @@ def test_gnb_conf1(self): ...@@ -176,9 +173,6 @@ def test_gnb_conf1(self):
self.slap.instance_directory, '*', 'etc', 'enb.cfg'))[0] self.slap.instance_directory, '*', 'etc', 'enb.cfg'))[0]
conf = yamlpp_load(conf_file) conf = yamlpp_load(conf_file)
if 'tx_gain' in conf and 'rx_gain' in conf:
self.assertEqual(conf['tx_gain'], gnb_param_dict1['tx_gain'])
self.assertEqual(conf['rx_gain'], gnb_param_dict1['rx_gain'])
self.assertEqual(conf['nr_cell_list'][0]['inactivity_timer'], gnb_param_dict1['inactivity_timer']) self.assertEqual(conf['nr_cell_list'][0]['inactivity_timer'], gnb_param_dict1['inactivity_timer'])
self.assertEqual(conf['nr_cell_list'][0]['dl_nr_arfcn'], gnb_param_dict1['dl_nr_arfcn']) self.assertEqual(conf['nr_cell_list'][0]['dl_nr_arfcn'], gnb_param_dict1['dl_nr_arfcn'])
self.assertEqual(conf['nr_cell_list'][0]['band'], gnb_param_dict1['nr_band']) self.assertEqual(conf['nr_cell_list'][0]['band'], gnb_param_dict1['nr_band'])
......
...@@ -142,9 +142,8 @@ def test_enb_conf(self): ...@@ -142,9 +142,8 @@ def test_enb_conf(self):
self.slap.instance_directory, '*', 'etc', 'enb.cfg'))[0] self.slap.instance_directory, '*', 'etc', 'enb.cfg'))[0]
conf = yamlpp_load(conf_file) conf = yamlpp_load(conf_file)
if 'tx_gain' in conf and 'rx_gain' in conf: self.assertEqual(conf['tx_gain'], [enb_param_dict['tx_gain']] * enb_param_dict['n_antenna_dl'])
self.assertEqual(conf['tx_gain'], enb_param_dict['tx_gain']) self.assertEqual(conf['rx_gain'], [enb_param_dict['rx_gain']] * enb_param_dict['n_antenna_ul'])
self.assertEqual(conf['rx_gain'], enb_param_dict['rx_gain'])
self.assertEqual(conf['cell_list'][0]['inactivity_timer'], enb_param_dict['inactivity_timer']) self.assertEqual(conf['cell_list'][0]['inactivity_timer'], enb_param_dict['inactivity_timer'])
self.assertNotIn('uldl_config', conf['cell_list'][0]) self.assertNotIn('uldl_config', conf['cell_list'][0])
self.assertEqual(conf['cell_list'][0]['dl_earfcn'], enb_param_dict['dl_earfcn']) self.assertEqual(conf['cell_list'][0]['dl_earfcn'], enb_param_dict['dl_earfcn'])
...@@ -176,9 +175,8 @@ def test_gnb_conf1(self): ...@@ -176,9 +175,8 @@ def test_gnb_conf1(self):
self.slap.instance_directory, '*', 'etc', 'enb.cfg'))[0] self.slap.instance_directory, '*', 'etc', 'enb.cfg'))[0]
conf = yamlpp_load(conf_file) conf = yamlpp_load(conf_file)
if 'tx_gain' in conf and 'rx_gain' in conf: self.assertEqual(conf['tx_gain'], [gnb_param_dict1['tx_gain']] * gnb_param_dict1['n_antenna_dl'])
self.assertEqual(conf['tx_gain'], gnb_param_dict1['tx_gain']) self.assertEqual(conf['rx_gain'], [gnb_param_dict1['rx_gain']] * gnb_param_dict1['n_antenna_ul'])
self.assertEqual(conf['rx_gain'], gnb_param_dict1['rx_gain'])
self.assertEqual(conf['nr_cell_list'][0]['inactivity_timer'], gnb_param_dict1['inactivity_timer']) self.assertEqual(conf['nr_cell_list'][0]['inactivity_timer'], gnb_param_dict1['inactivity_timer'])
self.assertEqual(conf['nr_cell_list'][0]['dl_nr_arfcn'], gnb_param_dict1['dl_nr_arfcn']) self.assertEqual(conf['nr_cell_list'][0]['dl_nr_arfcn'], gnb_param_dict1['dl_nr_arfcn'])
self.assertEqual(conf['nr_cell_list'][0]['band'], gnb_param_dict1['nr_band']) self.assertEqual(conf['nr_cell_list'][0]['band'], gnb_param_dict1['nr_band'])
......
...@@ -142,9 +142,8 @@ def test_enb_conf(self): ...@@ -142,9 +142,8 @@ def test_enb_conf(self):
self.slap.instance_directory, '*', 'etc', 'enb.cfg'))[0] self.slap.instance_directory, '*', 'etc', 'enb.cfg'))[0]
conf = yamlpp_load(conf_file) conf = yamlpp_load(conf_file)
if 'tx_gain' in conf and 'rx_gain' in conf: self.assertEqual(conf['tx_gain'], [enb_param_dict['tx_gain']] * enb_param_dict['n_antenna_dl'])
self.assertEqual(conf['tx_gain'], enb_param_dict['tx_gain']) self.assertEqual(conf['rx_gain'], [enb_param_dict['rx_gain']] * enb_param_dict['n_antenna_ul'])
self.assertEqual(conf['rx_gain'], enb_param_dict['rx_gain'])
self.assertEqual(conf['cell_list'][0]['inactivity_timer'], enb_param_dict['inactivity_timer']) self.assertEqual(conf['cell_list'][0]['inactivity_timer'], enb_param_dict['inactivity_timer'])
self.assertNotIn('uldl_config', conf['cell_list'][0]) self.assertNotIn('uldl_config', conf['cell_list'][0])
self.assertEqual(conf['cell_list'][0]['dl_earfcn'], enb_param_dict['dl_earfcn']) self.assertEqual(conf['cell_list'][0]['dl_earfcn'], enb_param_dict['dl_earfcn'])
...@@ -176,9 +175,8 @@ def test_gnb_conf1(self): ...@@ -176,9 +175,8 @@ def test_gnb_conf1(self):
self.slap.instance_directory, '*', 'etc', 'enb.cfg'))[0] self.slap.instance_directory, '*', 'etc', 'enb.cfg'))[0]
conf = yamlpp_load(conf_file) conf = yamlpp_load(conf_file)
if 'tx_gain' in conf and 'rx_gain' in conf: self.assertEqual(conf['tx_gain'], [gnb_param_dict1['tx_gain']] * gnb_param_dict1['n_antenna_dl'])
self.assertEqual(conf['tx_gain'], gnb_param_dict1['tx_gain']) self.assertEqual(conf['rx_gain'], [gnb_param_dict1['rx_gain']] * gnb_param_dict1['n_antenna_ul'])
self.assertEqual(conf['rx_gain'], gnb_param_dict1['rx_gain'])
self.assertEqual(conf['nr_cell_list'][0]['inactivity_timer'], gnb_param_dict1['inactivity_timer']) self.assertEqual(conf['nr_cell_list'][0]['inactivity_timer'], gnb_param_dict1['inactivity_timer'])
self.assertEqual(conf['nr_cell_list'][0]['dl_nr_arfcn'], gnb_param_dict1['dl_nr_arfcn']) self.assertEqual(conf['nr_cell_list'][0]['dl_nr_arfcn'], gnb_param_dict1['dl_nr_arfcn'])
self.assertEqual(conf['nr_cell_list'][0]['band'], gnb_param_dict1['nr_band']) self.assertEqual(conf['nr_cell_list'][0]['band'], gnb_param_dict1['nr_band'])
......
...@@ -142,9 +142,6 @@ def test_enb_conf(self): ...@@ -142,9 +142,6 @@ def test_enb_conf(self):
self.slap.instance_directory, '*', 'etc', 'enb.cfg'))[0] self.slap.instance_directory, '*', 'etc', 'enb.cfg'))[0]
conf = yamlpp_load(conf_file) conf = yamlpp_load(conf_file)
if 'tx_gain' in conf and 'rx_gain' in conf:
self.assertEqual(conf['tx_gain'], enb_param_dict['tx_gain'])
self.assertEqual(conf['rx_gain'], enb_param_dict['rx_gain'])
self.assertEqual(conf['cell_list'][0]['inactivity_timer'], enb_param_dict['inactivity_timer']) self.assertEqual(conf['cell_list'][0]['inactivity_timer'], enb_param_dict['inactivity_timer'])
self.assertEqual(conf['cell_list'][0]['uldl_config'], 6) self.assertEqual(conf['cell_list'][0]['uldl_config'], 6)
self.assertEqual(conf['cell_list'][0]['dl_earfcn'], enb_param_dict['dl_earfcn']) self.assertEqual(conf['cell_list'][0]['dl_earfcn'], enb_param_dict['dl_earfcn'])
...@@ -176,9 +173,6 @@ def test_gnb_conf1(self): ...@@ -176,9 +173,6 @@ def test_gnb_conf1(self):
self.slap.instance_directory, '*', 'etc', 'enb.cfg'))[0] self.slap.instance_directory, '*', 'etc', 'enb.cfg'))[0]
conf = yamlpp_load(conf_file) conf = yamlpp_load(conf_file)
if 'tx_gain' in conf and 'rx_gain' in conf:
self.assertEqual(conf['tx_gain'], gnb_param_dict1['tx_gain'])
self.assertEqual(conf['rx_gain'], gnb_param_dict1['rx_gain'])
self.assertEqual(conf['nr_cell_list'][0]['inactivity_timer'], gnb_param_dict1['inactivity_timer']) self.assertEqual(conf['nr_cell_list'][0]['inactivity_timer'], gnb_param_dict1['inactivity_timer'])
self.assertEqual(conf['nr_cell_list'][0]['dl_nr_arfcn'], gnb_param_dict1['dl_nr_arfcn']) self.assertEqual(conf['nr_cell_list'][0]['dl_nr_arfcn'], gnb_param_dict1['dl_nr_arfcn'])
self.assertEqual(conf['nr_cell_list'][0]['band'], gnb_param_dict1['nr_band']) self.assertEqual(conf['nr_cell_list'][0]['band'], gnb_param_dict1['nr_band'])
......
...@@ -142,9 +142,8 @@ def test_enb_conf(self): ...@@ -142,9 +142,8 @@ def test_enb_conf(self):
self.slap.instance_directory, '*', 'etc', 'enb.cfg'))[0] self.slap.instance_directory, '*', 'etc', 'enb.cfg'))[0]
conf = yamlpp_load(conf_file) conf = yamlpp_load(conf_file)
if 'tx_gain' in conf and 'rx_gain' in conf: self.assertEqual(conf['tx_gain'], [enb_param_dict['tx_gain']] * enb_param_dict['n_antenna_dl'])
self.assertEqual(conf['tx_gain'], enb_param_dict['tx_gain']) self.assertEqual(conf['rx_gain'], [enb_param_dict['rx_gain']] * enb_param_dict['n_antenna_ul'])
self.assertEqual(conf['rx_gain'], enb_param_dict['rx_gain'])
self.assertEqual(conf['cell_list'][0]['inactivity_timer'], enb_param_dict['inactivity_timer']) self.assertEqual(conf['cell_list'][0]['inactivity_timer'], enb_param_dict['inactivity_timer'])
self.assertEqual(conf['cell_list'][0]['uldl_config'], 6) self.assertEqual(conf['cell_list'][0]['uldl_config'], 6)
self.assertEqual(conf['cell_list'][0]['dl_earfcn'], enb_param_dict['dl_earfcn']) self.assertEqual(conf['cell_list'][0]['dl_earfcn'], enb_param_dict['dl_earfcn'])
...@@ -176,9 +175,8 @@ def test_gnb_conf1(self): ...@@ -176,9 +175,8 @@ def test_gnb_conf1(self):
self.slap.instance_directory, '*', 'etc', 'enb.cfg'))[0] self.slap.instance_directory, '*', 'etc', 'enb.cfg'))[0]
conf = yamlpp_load(conf_file) conf = yamlpp_load(conf_file)
if 'tx_gain' in conf and 'rx_gain' in conf: self.assertEqual(conf['tx_gain'], [gnb_param_dict1['tx_gain']] * gnb_param_dict1['n_antenna_dl'])
self.assertEqual(conf['tx_gain'], gnb_param_dict1['tx_gain']) self.assertEqual(conf['rx_gain'], [gnb_param_dict1['rx_gain']] * gnb_param_dict1['n_antenna_ul'])
self.assertEqual(conf['rx_gain'], gnb_param_dict1['rx_gain'])
self.assertEqual(conf['nr_cell_list'][0]['inactivity_timer'], gnb_param_dict1['inactivity_timer']) self.assertEqual(conf['nr_cell_list'][0]['inactivity_timer'], gnb_param_dict1['inactivity_timer'])
self.assertEqual(conf['nr_cell_list'][0]['dl_nr_arfcn'], gnb_param_dict1['dl_nr_arfcn']) self.assertEqual(conf['nr_cell_list'][0]['dl_nr_arfcn'], gnb_param_dict1['dl_nr_arfcn'])
self.assertEqual(conf['nr_cell_list'][0]['band'], gnb_param_dict1['nr_band']) self.assertEqual(conf['nr_cell_list'][0]['band'], gnb_param_dict1['nr_band'])
......
...@@ -142,9 +142,8 @@ def test_enb_conf(self): ...@@ -142,9 +142,8 @@ def test_enb_conf(self):
self.slap.instance_directory, '*', 'etc', 'enb.cfg'))[0] self.slap.instance_directory, '*', 'etc', 'enb.cfg'))[0]
conf = yamlpp_load(conf_file) conf = yamlpp_load(conf_file)
if 'tx_gain' in conf and 'rx_gain' in conf: self.assertEqual(conf['tx_gain'], [enb_param_dict['tx_gain']] * enb_param_dict['n_antenna_dl'])
self.assertEqual(conf['tx_gain'], enb_param_dict['tx_gain']) self.assertEqual(conf['rx_gain'], [enb_param_dict['rx_gain']] * enb_param_dict['n_antenna_ul'])
self.assertEqual(conf['rx_gain'], enb_param_dict['rx_gain'])
self.assertEqual(conf['cell_list'][0]['inactivity_timer'], enb_param_dict['inactivity_timer']) self.assertEqual(conf['cell_list'][0]['inactivity_timer'], enb_param_dict['inactivity_timer'])
self.assertEqual(conf['cell_list'][0]['uldl_config'], 6) self.assertEqual(conf['cell_list'][0]['uldl_config'], 6)
self.assertEqual(conf['cell_list'][0]['dl_earfcn'], enb_param_dict['dl_earfcn']) self.assertEqual(conf['cell_list'][0]['dl_earfcn'], enb_param_dict['dl_earfcn'])
...@@ -176,9 +175,8 @@ def test_gnb_conf1(self): ...@@ -176,9 +175,8 @@ def test_gnb_conf1(self):
self.slap.instance_directory, '*', 'etc', 'enb.cfg'))[0] self.slap.instance_directory, '*', 'etc', 'enb.cfg'))[0]
conf = yamlpp_load(conf_file) conf = yamlpp_load(conf_file)
if 'tx_gain' in conf and 'rx_gain' in conf: self.assertEqual(conf['tx_gain'], [gnb_param_dict1['tx_gain']] * gnb_param_dict1['n_antenna_dl'])
self.assertEqual(conf['tx_gain'], gnb_param_dict1['tx_gain']) self.assertEqual(conf['rx_gain'], [gnb_param_dict1['rx_gain']] * gnb_param_dict1['n_antenna_ul'])
self.assertEqual(conf['rx_gain'], gnb_param_dict1['rx_gain'])
self.assertEqual(conf['nr_cell_list'][0]['inactivity_timer'], gnb_param_dict1['inactivity_timer']) self.assertEqual(conf['nr_cell_list'][0]['inactivity_timer'], gnb_param_dict1['inactivity_timer'])
self.assertEqual(conf['nr_cell_list'][0]['dl_nr_arfcn'], gnb_param_dict1['dl_nr_arfcn']) self.assertEqual(conf['nr_cell_list'][0]['dl_nr_arfcn'], gnb_param_dict1['dl_nr_arfcn'])
self.assertEqual(conf['nr_cell_list'][0]['band'], gnb_param_dict1['nr_band']) self.assertEqual(conf['nr_cell_list'][0]['band'], gnb_param_dict1['nr_band'])
......
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