Commit a6772923 authored by Kirill Smelkov's avatar Kirill Smelkov

software/ors-amarisoft: enb/generic: Make tx_gain/rx_gain to be generic RU parameters

I.e. apply not only to SDR but to all Radio Units and expecting that they apply
to them with the same uniform semantic of controlling Tx/Rx amplifiers on on
the RU.

- For SDR nothing is changed.
- For Lopcomm txa0cc00_gain goes away and is replaced by tx_gain. For rx_gain
  there is a question as I could not find offhand how to control aplifier on RX
  circuit there.
- For Sunwave tx_gain/rx_gain, as with lots of more(*) is TODO.
parent 4eb6a873
......@@ -60,10 +60,10 @@
"default": 204
},
"tx_gain": {
"$ref": "ru/sdr/input-schema.json#/properties/tx_gain"
"$ref": "ru/common.json#/properties/tx_gain"
},
"rx_gain": {
"$ref": "ru/sdr/input-schema.json#/properties/rx_gain"
"$ref": "ru/common.json#/properties/rx_gain"
},
"enb_id": {
"$ref": "instance-enb-input-schema.json#/properties/enb_id",
......
......@@ -8,7 +8,9 @@
"ru_type",
"ru_link_type",
"n_antenna_dl",
"n_antenna_ul"
"n_antenna_ul",
"tx_gain",
"rx_gain"
],
"properties": {
......@@ -31,6 +33,18 @@
"type": "integer"
},
"tx_gain": {
"title": "Tx gain",
"description": "Tx gain (in dB)",
"type": "number"
},
"rx_gain": {
"title": "Rx gain",
"description": "Rx gain (in dB)",
"type": "number"
},
"cpri_link": {
"title": "CPRI link settings",
......
......@@ -246,6 +246,8 @@ cell-list = {{ dumps(iru_icell_ref_list) }}
{%- if ru.ru_link_type == 'cpri' %}
ipv6 = ${vtap.{{ ru.cpri_link._tap }}:gateway}
{%- endif %}
tx_gain = {{ dumps(ru.tx_gain) }}
rx_gain = {{ dumps(ru.rx_gain) }}
{%- endif %}
{%- endfor %}
......
......@@ -105,7 +105,7 @@
<active>{{ ru.get('txa0cc00_active', 'INACTIVE') }}</active>
<rw-type>{{ cell.cell_type | upper }}</rw-type>
<rw-duplex-scheme>{{ cell.rf_mode | upper }}</rw-duplex-scheme>
<gain>{{ ru.get('txa0cc00_gain', '-20') }}</gain>
<gain>{{ ru.tx_gain }}</gain>
<downlink-radio-frame-offset>0</downlink-radio-frame-offset>
<downlink-sfn-offset>0</downlink-sfn-offset>
</tx-array-carriers>
......@@ -117,6 +117,8 @@
<active>{{ ru.get('rxa0cc00_active', 'INACTIVE') }}</active>
<downlink-radio-frame-offset>0</downlink-radio-frame-offset>
<downlink-sfn-offset>0</downlink-sfn-offset>
<!-- <gain>{{ ru.rx_gain }}</gain> -->
<!-- TODO(lu.xu): clarify with Lopcomm regaring rx gain -->
<gain-correction>0.0</gain-correction>
<n-ta-offset>0</n-ta-offset>
</rx-array-carriers>
......
......@@ -9,6 +9,8 @@
"ru_link_type",
"n_antenna_dl",
"n_antenna_ul",
"tx_gain",
"rx_gain",
"cpri_link",
"mac_addr"
......@@ -99,12 +101,6 @@
"type": "number",
"default": 1950
},
"txa0cc00_gain": {
"title": "ORAN Gain",
"description": "Lopcomm ORAN Gain (TXA0CC00)",
"type": "number",
"default": -20
},
"reset_schedule": {
"title": "Cron schedule for RRH reset",
......
......@@ -10,10 +10,10 @@
"ru_link_type",
"n_antenna_dl",
"n_antenna_ul",
"sdr_dev_list",
"tx_gain",
"rx_gain"
"rx_gain",
"sdr_dev_list"
],
"properties": {
......
......@@ -9,6 +9,8 @@
"ru_link_type",
"n_antenna_dl",
"n_antenna_ul",
"tx_gain",
"rx_gain",
"cpri_link",
"mac_addr"
......
......@@ -271,11 +271,6 @@
{%- for k, v in defaults['ru/%s/cpri_link' % ru.ru_type].items() %}
{%- do link.setdefault(k, v) %}
{%- endfor %}
{#- 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,
}) %}
{%- endif %}
{%- endmacro %}
......
......@@ -212,11 +212,15 @@ def iRU2_LOPCOMM_fLTE_fNR(ienb):
},
'n_antenna_dl': 2,
'n_antenna_ul': 1,
'tx_gain': -21,
'rx_gain': -22,
}
RU2 = copy.deepcopy(RU1)
RU2['mac_addr'] = '00:00:00:00:00:02'
RU2['cpri_link']['sfp_port'] = 1
RU2['tx_gain'] += 10
RU2['rx_gain'] += 10
ienb.ishared('RU1', RU1)
ienb.ishared('RU2', RU2)
......@@ -311,6 +315,8 @@ def iRU2_LOPCOMM_fLTE2(ienb):
},
'n_antenna_dl': 1,
'n_antenna_ul': 1,
'tx_gain': 0,
'rx_gain': 0,
}
# supports: 2110 - 2170 MHz
......
......@@ -218,6 +218,8 @@ class AmariTestCase(_AmariTestCase):
# 0+ cell_id
# 0x10+ pci
# 0x100+ tac
# 10+ tx_gain
# 20+ rx_gain
# xxx+i·100 dl_arfcn
# 5,10,15,20 bandwidth
# 100+ root_sequence_index
......@@ -238,6 +240,7 @@ class RFTestCase4(AmariTestCase):
def RU(i):
ru = cls.RUcfg(i)
ru |= {'n_antenna_dl': 4, 'n_antenna_ul': 2}
ru |= {'tx_gain': 10+i, 'rx_gain': 20+i}
return cls.requestShared(imain, 'RU%d' % i, ru)
def CELL(i, ctx):
......@@ -256,8 +259,20 @@ class RFTestCase4(AmariTestCase):
RU(3); CELL(3, FDD | NR (300300,74) | BW(15))
RU(4); CELL(4, TDD | NR (470400,40) | BW(20))
def test_published_cell(t):
def test_rf_cfg_txrx_gain(t):
# NOTE even though setting tx_gain/rx_gain in enb.cfg does not make any
# difference for CPRI case, we still do set it there for consistency.
# For the reference: for CPRI case the real tx/rx gain is set in
# RU configuration and is verified by RU tests.
t.assertEqual(t.rf_cfg['tx_gain'], [11]*4 + [12]*4 + [13]*4 + [14]*4)
t.assertEqual(t.rf_cfg['rx_gain'], [21]*2 + [22]*2 + [23]*2 + [24]*2)
def test_published_ru_and_cell(t):
q = t.querySharedPublished
assertMatch(t, q('RU1'), {'tx_gain': 11, 'rx_gain': 21})
assertMatch(t, q('RU2'), {'tx_gain': 12, 'rx_gain': 22})
assertMatch(t, q('RU3'), {'tx_gain': 13, 'rx_gain': 23})
assertMatch(t, q('RU4'), {'tx_gain': 14, 'rx_gain': 24})
assertMatch(t, q('RU1.CELL'), dict(
dl_earfcn= 100,
......@@ -450,26 +465,28 @@ class Lopcomm4:
# RU configuration in cu_config.xml
def test_ru_cu_config_xml(t):
def uctx(rf_mode, cell_type, dl_arfcn, bw):
def uctx(rf_mode, cell_type, dl_arfcn, bw, tx_gain, rx_gain):
return {
'tx-array-carriers': {
'rw-duplex-scheme': rf_mode,
'rw-type': cell_type,
'absolute-frequency-center': '%d' % dl_arfcn,
'channel-bandwidth': '%d' % bw,
'gain': '%d' % tx_gain,
},
'rx-array-carriers': {
'channel-bandwidth': '%d' % bw,
# XXX no rx_gain
},
}
_ = t._test_ru_cu_config_xml
# rf_mode ctype dl_arfcn bw
_(1, uctx('FDD', 'LTE', 100, 5000000))
_(2, uctx('TDD', 'LTE', 40200, 10000000))
_(3, uctx('FDD', 'NR', 300300, 15000000))
_(4, uctx('TDD', 'NR', 470400, 20000000))
# rf_mode ctype dl_arfcn bw txg rxg
_(1, uctx('FDD', 'LTE', 100, 5000000, 11, 21))
_(2, uctx('TDD', 'LTE', 40200, 10000000, 12, 22))
_(3, uctx('FDD', 'NR', 300300, 15000000, 13, 23))
_(4, uctx('TDD', 'NR', 470400, 20000000, 14, 24))
def _test_ru_cu_config_xml(t, i, uctx):
cu_xml = t.ipath('etc/%s' % xbuildout.encode('%s-cu_config.xml' % t.ref('RU%d' % i)))
......
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