Commit 1909a9e6 authored by Kirill Smelkov's avatar Kirill Smelkov

X x['attr'] -> x.attr for ru and cell

parent 2f084dc9
...@@ -40,7 +40,7 @@ ...@@ -40,7 +40,7 @@
gnb_id_bits: 28, gnb_id_bits: 28,
en_dc_support: true, en_dc_support: true,
// LTE cells XXX ru['xxx'] -> ru.xxx // LTE cells
cell_list: [ cell_list: [
// CELL1_a // CELL1_a
......
...@@ -80,11 +80,11 @@ ...@@ -80,11 +80,11 @@
{%- else %} {%- else %}
{%- do seen.append(cell_ref) %} {%- do seen.append(cell_ref) %}
{%- set ru = icell['_']['ru'] %} {%- set ru = icell['_']['ru'] %}
{%- if ru['ru_type'] == 'ru_ref' %} {%- if ru.ru_type == 'ru_ref' %}
{{- ru['ru_ref'] | tojson }} {{- ru.ru_ref | tojson }}
{%- elif ru['ru_type'] == 'ruincell_ref' %} {%- elif ru.ru_type == 'ruincell_ref' %}
{#- XXX first check referred cell exist ? #} {#- XXX first check referred cell exist ? #}
{{- _jcell_ru_ref(icell_dict[ru['ruincell_ref']], seen) }} {{- _jcell_ru_ref(icell_dict[ru.ruincell_ref], seen) }}
{%- else %} {%- else %}
{#- ru definition is embedded into cell #} {#- ru definition is embedded into cell #}
{{- ('_%s_ru' % J(jref_of_shared(icell))) | tojson }} {{- ('_%s_ru' % J(jref_of_shared(icell))) | tojson }}
...@@ -123,17 +123,17 @@ ...@@ -123,17 +123,17 @@
{%- do iru_dict.update({ref: iru}) %} {%- do iru_dict.update({ref: iru}) %}
{%- elif 'cell_type' in _ %} {%- elif 'cell_type' in _ %}
{%- set icell = slave %} {%- set icell = slave %}
{%- for k, v in defaults['cell/' + _['cell_type']].items() %} {%- for k, v in defaults['cell/' + _.cell_type].items() %}
{%- do _.setdefault(k, v) %} {%- do _.setdefault(k, v) %}
{%- endfor %} {%- endfor %}
{%- do icell_dict.update({ref: icell}) %} {%- do icell_dict.update({ref: icell}) %}
{%- set ru = _['ru'] %} {%- set ru = _['ru'] %}
{%- if ru['ru_type'] not in ('ru_ref', 'ruincell_ref') %} {%- if ru.ru_type not in ('ru_ref', 'ruincell_ref') %}
{#- embedded ru definition -> expose it as `_<cell_ref>_ru` #} {#- embedded ru definition -> expose it as `_<cell_ref>_ru` #}
{%- do iru_dict.update({'_%s_ru' % ref: { {%- do iru_dict.update({'_%s_ru' % ref: {
'_': ru, '_': ru,
'slave_title': '%s. RU' % icell['slave_title'], 'slave_title': '%s. RU' % icell.slave_title,
'slave_reference': icell['slave_reference'], 'slave_reference': icell.slave_reference,
}}) %} }}) %}
{%- endif %} {%- endif %}
{%- else %} {%- else %}
...@@ -191,20 +191,20 @@ ...@@ -191,20 +191,20 @@
{%- for rf_port, (ru_ref, iru) in enumerate(iru_dict|dictsort) %} {%- for rf_port, (ru_ref, iru) in enumerate(iru_dict|dictsort) %}
{%- set ru = iru['_'] %} {%- set ru = iru['_'] %}
{%- do ru.update({'_rf_port': rf_port}) %} {%- do ru.update({'_rf_port': rf_port}) %}
{%- if ru['ru_type'] == 'sdr' %} {%- if ru.ru_type == 'sdr' %}
{%- do ru_sdr_dict.update({len(dev_argv): ru}) %} {%- do ru_sdr_dict.update({len(dev_argv): ru}) %}
{#- XXX move to ru/sdr ? #} {#- XXX move to ru/sdr ? #}
{%- for n in ru['sdr_dev_list'] %} {%- for n in ru.sdr_dev_list %}
{%- do dev_argv.append("dev%d=/dev/sdr%d" % (len(dev_argv), n)) %} {%- do dev_argv.append("dev%d=/dev/sdr%d" % (len(dev_argv), n)) %}
{%- endfor %} {%- endfor %}
{%- elif ru['ru_link_type'] == 'cpri' %} {%- elif ru.ru_link_type == 'cpri' %}
{%- do ru_cpri_dict.update({len(dev_argv): ru}) %} {%- do ru_cpri_dict.update({len(dev_argv): ru}) %}
{%- set link = ru['cpri_link'] %} {%- set link = ru.cpri_link %}
{#- set cpri_link parameters to default #} {#- set cpri_link parameters to default #}
{%- for k, v in defaults['cpri_link'].items() %} {%- for k, v in defaults['cpri_link'].items() %}
{%- do link.setdefault(k, v) %} {%- do link.setdefault(k, v) %}
{%- endfor %} {%- endfor %}
{%- do dev_argv.append("dev%d=/dev/sdr%d@%d" % (len(dev_argv), link['sdr_dev'], link['sfp_port'])) %} {%- do dev_argv.append("dev%d=/dev/sdr%d@%d" % (len(dev_argv), link.sdr_dev, link.sfp_port)) %}
{%- else %} {%- else %}
{%- do bug('unreachable') %} {%- do bug('unreachable') %}
{%- endif %} {%- endif %}
...@@ -223,7 +223,7 @@ ...@@ -223,7 +223,7 @@
{%- if len(ru_cpri_dict) > 0 %} {%- if len(ru_cpri_dict) > 0 %}
{%- set vcpri = [None]*len(dev_argv) %} {%- set vcpri = [None]*len(dev_argv) %}
{%- for dev, ru in ru_cpri_dict|dictsort %} {%- for dev, ru in ru_cpri_dict|dictsort %}
{%- do vcpri.__setitem__(dev, ru['cpri_link']) %} {%- do vcpri.__setitem__(dev, ru.cpri_link) %}
{%- endfor %} {%- endfor %}
cpri_mapping: "{{ vcpri | map(attribute='mapping') | map('default', '') | join(',') }}", cpri_mapping: "{{ vcpri | map(attribute='mapping') | map('default', '') | join(',') }}",
cpri_mult: "{{ vcpri | map(attribute='mult') | map('default', '') | join(',') }}", cpri_mult: "{{ vcpri | map(attribute='mult') | map('default', '') | join(',') }}",
...@@ -305,25 +305,25 @@ ...@@ -305,25 +305,25 @@
gnb_id_bits: {{ cfg('gnb_id_bits') }}, gnb_id_bits: {{ cfg('gnb_id_bits') }},
en_dc_support: true, en_dc_support: true,
// LTE cells XXX ru['xxx'] -> ru.xxx // LTE cells
cell_list: [ cell_list: [
{%- for i, (cell_ref, icell) in enumerate(icell_dict|dictsort) %} {%- for i, (cell_ref, icell) in enumerate(icell_dict|dictsort) %}
{%- set cell = icell['_'] %} {%- set cell = icell['_'] %}
{%- if cell['cell_type'] == 'lte' %} {%- if cell.cell_type == 'lte' %}
{%- set ru_ref = J(jcell_ru_ref(icell)) %} {%- set ru_ref = J(jcell_ru_ref(icell)) %}
{%- set iru = iru_dict[ru_ref] %} {%- set iru = iru_dict[ru_ref] %}
{%- set ru = iru['_'] %} {%- set ru = iru['_'] %}
// {{ J(jref_of_shared(icell)) }} // {{ J(jref_of_shared(icell)) }}
{ {
rf_port: {{ ru['_rf_port'] }}, 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['cell_id'] }}, cell_id: {{ cell.cell_id }},
tac: {{ cell['tac'] }}, tac: {{ cell.tac }},
n_id_cell: {{ cell['pci'] }}, n_id_cell: {{ cell.pci }},
dl_earfcn: {{ cell['dl_earfcn'] }}, dl_earfcn: {{ cell.dl_earfcn }},
root_sequence_index: {{ cell.get('root_sequence_index', root_sequence_index: {{ cell.get('root_sequence_index',
slapparameter_dict.get('root_sequence_index', slapparameter_dict.get('root_sequence_index',
204 + i)) }}, 204 + i)) }},
...@@ -335,16 +335,16 @@ ...@@ -335,16 +335,16 @@
{%- set cell2 = icell2['_'] %} {%- set cell2 = icell2['_'] %}
{%- if cell2_ref != cell_ref %} {#- NOTE: HO to both LTE and NR #} {%- if cell2_ref != cell_ref %} {#- NOTE: HO to both LTE and NR #}
{ {
{%- if cell2['cell_type'] == 'lte' %} {%- if cell2.cell_type == 'lte' %}
rat: "eutra", rat: "eutra",
cell_id: {{ cfg('enb_id')}}{{ cell2['cell_id'] }}, // -> {{ J(jref_of_shared(icell2)) }} cell_id: {{ cfg('enb_id')}}{{ cell2.cell_id }}, // -> {{ J(jref_of_shared(icell2)) }}
n_id_cell: {{ cell2['pci'] }}, n_id_cell: {{ cell2.pci }},
dl_earfcn: {{ cell2['dl_earfcn'] }}, dl_earfcn: {{ cell2.dl_earfcn }},
tac: {{ cell2['tac'] }}, tac: {{ cell2.tac }},
{%- elif cell2['cell_type'] == 'nr' %} {%- elif cell2.cell_type == 'nr' %}
rat: "nr", rat: "nr",
nr_cell_id: {{ cfg('gnb_id')}}{{ cell2['cell_id'] }}, // -> {{ J(jref_of_shared(icell2)) }} nr_cell_id: {{ cfg('gnb_id')}}{{ cell2.cell_id }}, // -> {{ J(jref_of_shared(icell2)) }}
n_id_cell: {{ cell2['pci'] }}, n_id_cell: {{ cell2.pci }},
gnb_id_bits gnb_id_bits
dl_nr_arfcn dl_nr_arfcn
ssb_nr_arfcn ssb_nr_arfcn
...@@ -374,9 +374,9 @@ ...@@ -374,9 +374,9 @@
scell_list: [ scell_list: [
{%- for cell2_ref, icell2 in icell_dict|dictsort %} {%- for cell2_ref, icell2 in icell_dict|dictsort %}
{%- set cell2 = icell2['_'] %} {%- set cell2 = icell2['_'] %}
{%- if cell2_ref != cell_ref and cell2['cell_type'] == 'lte' %} {%- if cell2_ref != cell_ref and cell2.cell_type == 'lte' %}
{ {
cell_id: {{ cell2['cell_id'] }}, // + {{ J(jref_of_shared(icell2)) }} cell_id: {{ cell2.cell_id }}, // + {{ J(jref_of_shared(icell2)) }}
cross_carrier_scheduling: false, cross_carrier_scheduling: false,
}, },
{%- endif %} {%- endif %}
...@@ -385,7 +385,7 @@ ...@@ -385,7 +385,7 @@
// tune LTE parameters for the cell // tune LTE parameters for the cell
{%- set tdd = (cell['rf_mode'] == 'tdd') %} {%- set tdd = (cell.rf_mode == 'tdd') %}
{%- if tdd %} {%- if tdd %}
uldl_config: {{ lte.cell_tdd_config(cell) }}, uldl_config: {{ lte.cell_tdd_config(cell) }},
sp_config: 7, sp_config: 7,
...@@ -396,7 +396,7 @@ ...@@ -396,7 +396,7 @@
si_coderate: {{ 0.30 if n_rb_dl == 6 else 0.20 }}, si_coderate: {{ 0.30 if n_rb_dl == 6 else 0.20 }},
pdsch_dedicated: { pdsch_dedicated: {
p_a: {{ {4: -6, 2: -3}.get(ru['n_antenna_dl'], 0) }}, p_a: {{ {4: -6, 2: -3}.get(ru.n_antenna_dl, 0) }},
p_b: -1, p_b: -1,
}, },
...@@ -414,7 +414,7 @@ ...@@ -414,7 +414,7 @@
{%- endif %} {%- endif %}
}, },
{%- if ru['n_antenna_dl'] >= 2 %} {%- if ru.n_antenna_dl >= 2 %}
m_ri: 8, m_ri: 8,
transmission_mode: 3, transmission_mode: 3,
{%- endif %} {%- endif %}
...@@ -445,7 +445,7 @@ ...@@ -445,7 +445,7 @@
}, },
{#- XXX do we want to differentiate whether it is ORS or Amarisoft SDR board ? #} {#- XXX do we want to differentiate whether it is ORS or Amarisoft SDR board ? #}
{%- if ru['ru_type'] == 'sdr' %} {%- if ru.ru_type == 'sdr' %}
manual_ref_signal_power: true, manual_ref_signal_power: true,
{%- endif %} {%- endif %}
...@@ -570,25 +570,25 @@ ...@@ -570,25 +570,25 @@
nr_cell_list: [ nr_cell_list: [
{%- for i, (cell_ref, icell) in enumerate(icell_dict|dictsort) %} {%- for i, (cell_ref, icell) in enumerate(icell_dict|dictsort) %}
{%- set cell = icell['_'] %} {%- set cell = icell['_'] %}
{%- if cell['cell_type'] == 'nr' %} {%- if cell.cell_type == 'nr' %}
{%- set ru_ref = J(jcell_ru_ref(icell)) %} {%- set ru_ref = J(jcell_ru_ref(icell)) %}
{%- set iru = iru_dict[ru_ref] %} {%- set iru = iru_dict[ru_ref] %}
{%- set ru = iru['_'] %} {%- set ru = iru['_'] %}
// {{ J(jref_of_shared(icell)) }} // {{ J(jref_of_shared(icell)) }}
{ {
rf_port: {{ ru['_rf_port'] }}, 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['cell_id'] }}, cell_id: {{ cell.cell_id }},
n_id_cell: {{ cell['pci'] }}, n_id_cell: {{ cell.pci }},
band: {{ cell['nr_band'] }}, band: {{ cell.nr_band }},
dl_nr_arfcn: {{ cell['dl_nr_arfcn'] }}, dl_nr_arfcn: {{ cell.dl_nr_arfcn }},
bandwidth: {{ cell['bandwidth'] }}, bandwidth: {{ cell.bandwidth }},
subcarrier_spacing: 30, // XXX FDD -> 15 subcarrier_spacing: 30, // XXX FDD -> 15
ssb_pos_bitmap: {{ cell['ssb_pos_bitmap'] }}, ssb_pos_bitmap: {{ cell.ssb_pos_bitmap }},
root_sequence_index: 1, // XXX adjust from cfg('root_sequence_index') XXX place root_sequence_index: 1, // XXX adjust from cfg('root_sequence_index') XXX place
...@@ -607,7 +607,7 @@ ...@@ -607,7 +607,7 @@
{%- endif -%} {%- endif -%}
{%- endif %} {%- endif %}
{%- set tdd = (cell['rf_mode'] == 'tdd') %} {%- set tdd = (cell.rf_mode == 'tdd') %}
{%- set tdd_config = lte.nr_cell_tdd_config(cell) if tdd else None %}, {%- set tdd_config = lte.nr_cell_tdd_config(cell) if tdd else None %},
{% if tdd_config == 1 %} {% if tdd_config == 1 %}
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
{%- macro cell_tdd_config(cell) %} {%- macro cell_tdd_config(cell) %}
{%- set _ = {'[Configuration 2] 5ms 2UL 6DL (default)': 2, {%- set _ = {'[Configuration 2] 5ms 2UL 6DL (default)': 2,
'[Configuration 6] 5ms 5UL 3DL (maximum uplink)': 6} %} '[Configuration 6] 5ms 5UL 3DL (maximum uplink)': 6} %}
{{- _[cell['tdd_ul_dl_config']] }} {{- _[cell.tdd_ul_dl_config] }}
{%- endmacro -%} {%- endmacro -%}
{#- XXX doc, naming ok ? #} {#- XXX doc, naming ok ? #}
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
{%- set _ = {'5ms 2UL 7DL 4/6 (default)': 1, {%- set _ = {'5ms 2UL 7DL 4/6 (default)': 1,
'2.5ms 1UL 3DL 2/10': 2, '2.5ms 1UL 3DL 2/10': 2,
'5ms 8UL 3DL 2/10 (maximum uplink)': 3} %} '5ms 8UL 3DL 2/10 (maximum uplink)': 3} %}
{{- _[cell['tdd_ul_dl_config']] }} {{- _[cell.tdd_ul_dl_config] }}
{%- endmacro -%} {%- endmacro -%}
{#- cell_n_rb_dl returns n_rb_dl for an LTE cell. #} {#- cell_n_rb_dl returns n_rb_dl for an LTE cell. #}
...@@ -23,14 +23,14 @@ ...@@ -23,14 +23,14 @@
'10 MHz': 50, '10 MHz': 50,
'15 MHz': 75, '15 MHz': 75,
'20 MHz': 100} %} '20 MHz': 100} %}
{{- _[cell['bandwidth']] }} {{- _[cell.bandwidth] }}
{%- endmacro -%} {%- endmacro -%}
{#- cell_drb_config returns drb_config section for an LTE cell. {#- cell_drb_config returns drb_config section for an LTE cell.
DRB configuration varies in beteen FDD and TDD modes. #} DRB configuration varies in beteen FDD and TDD modes. #}
{%- macro cell_drb_config(cell) %} {%- macro cell_drb_config(cell) %}
{%- if cell['rf_mode'] == 'tdd' %} {%- if cell.rf_mode == 'tdd' %}
{%- set T_REORDERING = 65 %} {%- set T_REORDERING = 65 %}
{%- else %} {%- else %}
{%- set T_REORDERING = 35 %} {%- set T_REORDERING = 35 %}
......
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