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

.

parent 09f73362
{%- import 'slaplte.jinja2' as slaplte with context %}
{%- set B = slaplte.B %}
{%- set J = slaplte.J %}
{%- set jcell_ru_ref = slaplte.jcell_ru_ref %}
{%- set B = xbuildout.encode %}
{#- for standalone testing via slapos-render-config.py
NOTE: keep in sync with instance-enb.jinja2.cfg and ru/libinstance.jinja2.cfg #}
......
......@@ -48,7 +48,7 @@
// LTE cells
cell_list: [
// CELL_a (RU1)
// CELL__a (RU1)
{
rf_port: 0,
n_antenna_dl: 2,
......@@ -68,7 +68,7 @@
// Intra-ENB HO
{
rat: "nr",
cell_id: 0x02, // -> CELL_b
cell_id: 0x02, // -> CELL__b
},
// Inter-ENB HO
......@@ -102,7 +102,7 @@
// Dual Connectivity: LTE + NR
en_dc_scg_cell_list: [
{
cell_id: 0x02, // + CELL_b
cell_id: 0x02, // + CELL__b
},
],
......@@ -140,11 +140,11 @@
srs_hopping_bandwidth: 0,
},
drb_config: "CELL_a-drb.cfg",
drb_config: "CELL__a-drb.cfg",
sib_sched_list: [
{
filename: "CELL_a-sib23.asn",
filename: "CELL__a-sib23.asn",
si_periodicity: 16,
},
],
......@@ -242,7 +242,7 @@
// NR cells
nr_cell_list: [
// CELL_b (RU2)
// CELL__b (RU2)
{
rf_port: 1,
n_antenna_dl: 2,
......@@ -267,7 +267,7 @@
// Intra-ENB HO
{
rat: "eutra",
cell_id: 0x1001201, // -> CELL_a
cell_id: 0x1001201, // -> CELL__a
n_id_cell: 1,
dl_earfcn: 38050,
tac: 0x1234,
......@@ -438,7 +438,7 @@
},
drb_config: "CELL_b-drb.cfg",
drb_config: "CELL__b-drb.cfg",
},
],
......
......@@ -12,8 +12,8 @@
// XXX vvv <- ru.txrx_active ? XXX how to handle txrx_active for SDR ?
// (tx_gain=-1000 does not work - it still sets tx_gain to min.possible value 14)
name: "sdr",
// _UCELL1_ru 2T1R (sdr)
// _UCELL2_ru 2T2R (sdr)
// __UCELL1__ru 2T1R (sdr)
// __UCELL2__ru 2T2R (sdr)
args: "dev0=/dev/sdr0,dev1=/dev/sdr2",
rx_antenna:"tx_rx",
tdd_tx_mod: 1,
......
......@@ -79,6 +79,10 @@
}
%}
{#- XXX explain #}
{%- set B = xbuildout.encode %}
{#- J is used around macro calls to retrieve returned objects.
It is needed to workaround jinja2 limitation that macro can return only
......@@ -419,7 +423,7 @@
{%- set rx_gainv = [] %} {#- rx_gain by rx channel #}
{%- for (ru_ref, iru) in iru_dict.items() | sort(attribute="1._._rf_port") %}
{%- set ru = iru['_'] %}
// {{ dumps(ru_ref) }} {{ ru.n_antenna_dl }}T{{ ru.n_antenna_ul }}R ({{ ru.ru_type }})
// {{ B(ru_ref) }} {{ ru.n_antenna_dl }}T{{ ru.n_antenna_ul }}R ({{ ru.ru_type }})
{%- if ru.ru_type == 'sdr' %}
{%- do ru_sdr_dict.update({len(dev_argv): ru}) %}
{%- for n in ru.sdr_dev_list %}
......
......@@ -6,7 +6,19 @@
import zc.buildout.buildout # XXX workaround for https://lab.nexedi.com/nexedi/slapos.recipe.template/merge_requests/9
from slapos.recipe.template import jinja2_template
import json, copy, sys, os, pprint, glob
import json, copy, sys, os, pprint, glob, types
# ~ import xbuildout (see instance.cfg:activate-eggs)
def readfile(path):
with open(path) as f:
return f.read()
xbuildout = types.ModuleType('xbuildout')
exec(readfile('ru/xbuildout.py'), xbuildout.__dict__)
assert 'xbuildout' not in sys.modules
sys.modules['xbuildout'] = xbuildout
B = xbuildout.encode
# j2render renders config/<src> into config/out/<out> with provided json parameters.
......@@ -19,6 +31,7 @@ def j2render(src, out, jcfg):
textctx = ''
for k, v in ctx.items():
textctx += 'json %s %s\n' % (k, json.dumps(v))
textctx += 'import xbuildout xbuildout\n'
textctx += 'import json_module json\n'
textctx += 'import nrarfcn_module nrarfcn\n'
textctx += 'import xearfcn_module xlte.earfcn\n'
......@@ -466,11 +479,11 @@ def do_enb():
'ru': ru,
})
j2render('drb_%s.jinja2.cfg' % cell['cell_type'],
'%s-drb.cfg' % cell_ref,
B('%s-drb.cfg' % cell_ref),
jctx)
j2render('sib23.jinja2.asn',
'%s-sib23.asn' % cell_ref,
B('%s-sib23.asn' % cell_ref),
jctx)
......
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