Commit 6cedf114 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent 049235aa
......@@ -42,6 +42,12 @@
{%- do assert(False, msg) %}
{%- endmacro %}
{#- bug indicates an error in template logic.
it should not happen. #}
{%- macro bug(msg) %}
{%- do assert(False, msg) %}
{%- endmacro %}
{#- jcell_ru_ref returns RU reference linked from a cell.
if the cell embeds RU definition, its reference comes as `_<cell_ref>_ru`. #}
......@@ -156,25 +162,25 @@
{% endif %}
{%- set dev_argv = [] %}
{%- set ru_cpri_dict = {} %} {# dev -> ru for ru with link_kind = cpri #}
{%- for rf_port, (ru_ref, iru) in enumerate(iru_dict|dictsort) %}
{%- set ru = iru['_'] %}
{%- set ru_sdr_dict = {} %} {# dev -> ru for ru with ru_type = sdr #}
{%- set ru_cpri_dict = {} %} {# dev -> ru for ru with link_kind = cpri #}
{%- for rf_port, (ru_ref, iru) in enumerate(iru_dict|dictsort) %}
{%- set ru = iru['_'] %}
{%- do ru.update({'.rf_port': rf_port}) %}
{%- if ru['ru_type'] == 'sdr' %}
{%- do ru_sdr_dict.update({len(dev_argv): ru}) %}
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)) %}
{%- endfor %}
rx_antenna:"tx_rx", XXX -> ru/sdr ? FIXME don't repeat multiple times
tdd_tx_mod: 1,
{%- elif ru['ru_link_type'] == 'cpri' %}
{%- do ru_cpri_dict.update({len(dev_argv): ru}) %}
{%- set link = ru['cpri_link'] %}
{%- do dev_argv.append("dev%d=/dev/sdr%d@%d" % (len(dev_argv), link['sdr_dev'], link['sfp_port'])) %}
{#- set cpri parameters to default #}
{#- set cpri_link parameters to default #}
{%- for k, v in defaults['cpri_link'].items() %}
{%- do link.setdefault(k, v) %}
{%- endfor %}
{%- do dev_argv.append("dev%d=/dev/sdr%d@%d" % (len(dev_argv), link['sdr_dev'], link['sfp_port'])) %}
{%- else %}
{%- do bug('unreachable') %}
{%- endif %}
......@@ -182,6 +188,12 @@
args: "{{dev_argv | join(',')}}",
{#- emit sdr-related options if an sdr ru is present #}
{%- if len(ru_sdr_dict) > 0 %}
rx_antenna:"tx_rx", XXX -> ru/sdr ?
tdd_tx_mod: 1,
{%- endif %}
{#- emit cpri_* optins if a cpri ru is present #}
{#- NOTE values for non-cpri links come as empty XXX recheck this is ok #}
{%- if len(ru_cpri_dict) > 0 %}
......
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