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

.

parent 049235aa
...@@ -42,6 +42,12 @@ ...@@ -42,6 +42,12 @@
{%- do assert(False, msg) %} {%- do assert(False, msg) %}
{%- endmacro %} {%- 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. {#- 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`. #}
...@@ -156,25 +162,25 @@ ...@@ -156,25 +162,25 @@
{% endif %} {% endif %}
{%- set dev_argv = [] %} {%- set dev_argv = [] %}
{%- set ru_cpri_dict = {} %} {# dev -> ru for ru with link_kind = cpri #} {%- set ru_sdr_dict = {} %} {# dev -> ru for ru with ru_type = sdr #}
{%- for rf_port, (ru_ref, iru) in enumerate(iru_dict|dictsort) %} {%- set ru_cpri_dict = {} %} {# dev -> ru for ru with link_kind = cpri #}
{%- set ru = iru['_'] %} {%- for rf_port, (ru_ref, iru) in enumerate(iru_dict|dictsort) %}
{%- 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}) %}
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 %}
rx_antenna:"tx_rx", XXX -> ru/sdr ? FIXME don't repeat multiple times
tdd_tx_mod: 1,
{%- 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'] %}
{%- do dev_argv.append("dev%d=/dev/sdr%d@%d" % (len(dev_argv), link['sdr_dev'], link['sfp_port'])) %} {#- set cpri_link parameters to default #}
{#- set cpri 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'])) %}
{%- else %} {%- else %}
{%- do bug('unreachable') %} {%- do bug('unreachable') %}
{%- endif %} {%- endif %}
...@@ -182,6 +188,12 @@ ...@@ -182,6 +188,12 @@
args: "{{dev_argv | join(',')}}", 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 #} {#- emit cpri_* optins if a cpri ru is present #}
{#- NOTE values for non-cpri links come as empty XXX recheck this is ok #} {#- NOTE values for non-cpri links come as empty XXX recheck this is ok #}
{%- if len(ru_cpri_dict) > 0 %} {%- 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