Commit 22af390d authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent 0851eb81
{#- XXX ORS -> provide defaults for: slave_instance_list -#} {#- XXX ORS -> provide defaults for: slave_instance_list -#}
{#- XXX icell vs cell / iru vs ru everyhere #}
{%- import 'lte.jinja2' as lte -%} {%- import 'lte.jinja2' as lte -%}
...@@ -16,11 +17,11 @@ ...@@ -16,11 +17,11 @@
{#- jcell_ru_ref returns RU reference linked from a cell. {#- jcell_ru_ref returns RU reference linked from a cell.
if the cell embeds RU definition, its reference comes as `_<cell_ref>_ru`. #} if the cell embeds RU definition, its reference comes as `_<cell_ref>_ru`. #}
{%- macro jcell_ru_ref(cell) %} {%- macro jcell_ru_ref(icell) %}
{{- _jcell_ru_ref(cell, []) }} {{- _jcell_ru_ref(icell, []) }}
{%- endmacro %} {%- endmacro %}
{%- macro _jcell_ru_ref(cell, seen) %} {%- macro _jcell_ru_ref(icell, seen) %}
{%- set cell_ref = J(jref_of_shared(cell)) %} {%- set cell_ref = J(jref_of_shared(icell)) %}
{%- if cell_ref in seen %} {%- if cell_ref in seen %}
{%- for x in seen %} {%- for x in seen %}
{%- do error(x, "%s form a cycle via RU references" % seen) %} {%- do error(x, "%s form a cycle via RU references" % seen) %}
...@@ -28,7 +29,7 @@ ...@@ -28,7 +29,7 @@
{#- XXX what to return ? #} {#- XXX what to return ? #}
{%- else %} {%- else %}
{%- do seen.append(cell_ref) %} {%- do seen.append(cell_ref) %}
{%- set ru = cell['_']['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' %}
...@@ -36,7 +37,7 @@ ...@@ -36,7 +37,7 @@
{{- _jcell_ru_ref(cell_dict[ru['ruincell_ref']], seen) }} {{- _jcell_ru_ref(cell_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(cell))) | tojson }} {{- ('_%s_ru' % J(jref_of_shared(icell))) | tojson }}
{%- endif %} {%- endif %}
{%- endif %} {%- endif %}
{%- endmacro %} {%- endmacro %}
...@@ -89,10 +90,10 @@ ...@@ -89,10 +90,10 @@
{#- verify that there is no dangling cell->ru references #} {#- verify that there is no dangling cell->ru references #}
{#- XXX also verify that there is no dangling cell -> cell refs in ruincell_ref #} {#- XXX also verify that there is no dangling cell -> cell refs in ruincell_ref #}
{%- for _, cell in cell_dict|dictsort %} {%- for _, icell in cell_dict|dictsort %}
{%- set ru_ref = J(jcell_ru_ref(cell)) %} {%- set ru_ref = J(jcell_ru_ref(icell)) %}
{%- if ru_ref not in ru_dict %} {%- if ru_ref not in ru_dict %}
{%- do error(cell, "referred RU %s does not exist" % ru_ref) %} {%- do error(icell, "referred RU %s does not exist" % ru_ref) %}
{%- endif %} {%- endif %}
{%- endfor %} {%- endfor %}
...@@ -122,8 +123,8 @@ ...@@ -122,8 +123,8 @@
{%- set dev_argv = [] %} {%- set dev_argv = [] %}
{%- set ru_cpri_dict = {} %} {# dev -> ru for ru with link_kind = cpri #} {%- set ru_cpri_dict = {} %} {# dev -> ru for ru with link_kind = cpri #}
{%- for rf_port, (ru_ref, ru) in enumerate(ru_dict|dictsort) %} {%- for rf_port, (ru_ref, iru) in enumerate(ru_dict|dictsort) %}
{%- set ru = ru['_'] %} {%- 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' %}
XXX move to ru/sdr ? XXX move to ru/sdr ?
...@@ -212,12 +213,16 @@ ...@@ -212,12 +213,16 @@
enb_id: {{ slapparameter_dict.get('enb_id', '0x1A2D0') }}, enb_id: {{ slapparameter_dict.get('enb_id', '0x1A2D0') }},
{{ print('\n3333\n') }}
# LTE cells # LTE cells
cell_list: [ cell_list: [
{%- for cell_ref, cell in cell_dict|dictsort %} {%- for cell_ref, icell in cell_dict|dictsort %}
{% set cell = icell['_'] %}
{%- if cell['cell_type'] == 'lte' %} {%- if cell['cell_type'] == 'lte' %}
{%- set ru_ref = J(jcell_ru_ref(cell)) %} {%- set ru_ref = J(jcell_ru_ref(icell)) %}
{%- set ru = ru_dict[ru_ref] %} {%- set iru = ru_dict[ru_ref] %}
{%- set ru = iru['_'] %}
{ {
rf_port: {{ ru['.rf_port'] }}, rf_port: {{ ru['.rf_port'] }},
n_antenna_dl: {{ ru['n_antenna_dl'] }}, n_antenna_dl: {{ ru['n_antenna_dl'] }},
......
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