Commit 7ca76b9b authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent 9f8e2506
......@@ -2,6 +2,25 @@
{%- import 'lte.jinja2' as lte %}
{# return value is json-encoded to workaround jinja2 macro-ret limitation. #}
{# XXX macro return json -> start from j #}
{%- set J = json_module.loads %}
{# jref_of_shared returns original reference used to request shared instance.
it is extracted from slave_reference who is composed as `partition_id`+'_'+`reference` #}
{%- macro jref_of_shared(slave) %}
{%- set ref = slave['slave_reference'] %}
{%- set partition_id %}{{partition_id}}{%- endset %}
{%- if ref.startswith(partition_id) %}
{%- set ref = ref[len(partition_id):] %}
{%- endif %}
{%- if ref.startswith('_') %}
{%- set ref = ref[1:] %}
{%- endif %}
{{ ref | tojson }}
{%- endmacro %}
{# XXX error(slave, msg) #}
{# cell_dict keeps cell slave instances: reference -> cell #}
......@@ -9,18 +28,8 @@
{% set cell_dict = {} %}
{% set ru_dict = {} %}
{%- for slave in slave_instance_list %}
{# ref is original reference used to request shared instance.
it is extracted from slave_reference who is composed as `partition_id`+'_'+`reference` #}
{%- set ref = slave['slave_reference'] %}
{%- set partition_id %}{{partition_id}}{%- endset %}
{%- if ref.startswith(partition_id) %}
{%- set ref = ref[len(partition_id):] %}
{%- endif %}
{%- if ref.startswith('_') %}
{%- set ref = ref[1:] %}
{%- endif %}
{# #}
{%- set _ = json_module.loads(slave['_']) %}
{%- set ref = J(jref_of_shared(slave)) %}
{%- set _ = J(slave['_']) %}
{%- if 'cell_type' in _ %}
{%- do cell_dict[ref] = slave %}
{%- elif 'ru_type' in _ %}
......@@ -32,6 +41,22 @@
{# verify that there is no dangling ru_ref and ruincell_ref #} XXX + resolve those ru*_ref
{# jcell_ru_ref returns RU reference for a cell.
if the cell embeds RU definition, its reference comes as `_<cell_ref>_ru`.
return value is json-encoded to workaround jinja2 macro-ret limitation. #}
# XXX cycle protection
{%- macro jcell_ru_ref(cell) %}
{%- set ru = cell['ru'] %}
{%- if ru['ru_type'] == 'ru_ref' %}
{{ ru['ru_ref'] | tojson }}
{%- elif ru['ru_type'] == 'ruincell_ref' %}
{{ jcell_ru_ref(ru['ruincell_ref']) }}
{%- else %}
{# ru definition is embedded into cell #}
{{ J(jref_of_shared(cell))
{%- endmacro %}
......@@ -154,11 +179,11 @@
cell_list: [
{%- for cell_ref, cell in cell_dict|dictsort %}
{%- if cell['cell_type'] == 'lte' %}
XXX set rrh = cell.rrh + dereference if needed
XXX set ru = cell.ru + dereference if needed
{
rf_port: XXX get from rrh,
n_antenna_dl: {{ rrh['n_antenna_dl' }},
n_antenna_ul: {{ rrh['n_antenna_ul' }},
rf_port: XXX get from ru,
n_antenna_dl: {{ ru['n_antenna_dl' }},
n_antenna_ul: {{ ru['n_antenna_ul' }},
cell_id: {{ cell['cell_id'] }},
tac: {{ cell['tac'] }},
......
......@@ -7,11 +7,11 @@ n_antenna_ul int
if ru_link_type = "cpri":
cpri_link: string # e.g. sdrX@Y
cpri_mult: []int per port
cpri_mapping: [](standard|hw|spread|bf1) per port <- selected by rrh model
fast_cm_pointer: []int per port
ifname: []ifname per port
vss_data []...
cpri_rx_delay: []int <- selected by rrh model
cpri_tx_delay: []int <- ? selected by rrh or not ?
cpri_tx_dbm: []float
cpri_mult: int per port
cpri_mapping: standard|hw|spread|bf1) per port <- selected by ru model
fast_cm_pointer: int per port
ifname: ifname per port
vss_data ...
cpri_rx_delay: int <- selected by ru model
cpri_tx_delay: int <- ? selected by ru or not ?
cpri_tx_dbm: float
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