Commit 11b66832 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent 29189ef2
......@@ -85,7 +85,7 @@
gnb_id_bits: 22,
n_id_cell: 75,
dl_nr_arfcn: 520000,
ssb_nr_arfcn: 519890,
ssb_nr_arfcn: 519870,
ul_nr_arfcn: 520000,
tac: 321,
band: 38,
......@@ -260,7 +260,7 @@
bandwidth: 10,
subcarrier_spacing: 30,
ssb_nr_arfcn: 523010,
ssb_nr_arfcn: 522750,
ssb_pos_bitmap: "10000000",
root_sequence_index: 2,
......@@ -294,7 +294,7 @@
gnb_id_bits: 22,
n_id_cell: 75,
dl_nr_arfcn: 520000,
ssb_nr_arfcn: 519890,
ssb_nr_arfcn: 519870,
ul_nr_arfcn: 520000,
tac: 321,
band: 38,
......
......@@ -60,7 +60,7 @@
band: 7,
dl_nr_arfcn: 537200,
ul_nr_arfcn: 513200,
ssb_nr_arfcn: 537170,
ssb_nr_arfcn: 537150,
bandwidth: 5,
subcarrier_spacing: 15,
......
......@@ -10,8 +10,8 @@ def default_ssb_nr_arfcn(dl_nr_arfcn, scs_khz):
gscn = nr.get_gscn_by_frequency(f)
if nr.get_frequency_by_gscn(gscn) > f:
gscn -= 1
# align fg to be multiple of scs
scs = scs_khz * khz
# align fb to be multiple of scs
while 1:
fg = nr.get_frequency_by_gscn(gscn)
if fg % scs < 1e-5*scs: # == 0 with tolerating fp
......
......@@ -106,17 +106,27 @@
{{- (ul_lo + (dl_nr_arfcn - dl_lo)) | tojson }}
{%- endmacro %}
{#- jdefault_ssb_nr_arfcn returns default SSB NR ARFCN corresponding to DL NR ARFCN #}
{%- macro jdefault_ssb_nr_arfcn(dl_nr_arfcn) %}
{#- jdefault_ssb_nr_arfcn returns default SSB NR ARFCN corresponding to DL NR ARFCN
and subcarrier spacing #}
{%- macro jdefault_ssb_nr_arfcn(dl_nr_arfcn, scs_khz) %}
{#- NOTE: computations rechecked wrt https://tech-academy.amarisoft.com/OutOfBox_UEsim_SA.html#Tips_SSB_Frequency #}
{%- set nr = nrarfcn_module %}
{%- set f = nr.get_frequency(nrarfcn=dl_nr_arfcn) %}
{%- set gscn = nr.get_gscn_by_frequency(f) %}
{%- if nr.get_frequency_by_gscn(gscn) > f %}{# nrarfcn rounds up, amari down #}
{%- set gscn = gscn - 1 %}
{%- endif %}
{%- set fg = nr.get_frequency_by_gscn(gscn) %}
{%- set fg_arfcn = nr.get_nrarfcn(fg) %}
{%- set nr = nrarfcn_module %}
{%- set _ = namespace() %}
{%- set _.f = nr.get_frequency(nrarfcn=dl_nr_arfcn) %}
{%- set _.gscn = nr.get_gscn_by_frequency(_.f) %}
{%- if nr.get_frequency_by_gscn(_.gscn) > _.f %}{# nrarfcn rounds up, amari down #}
{%- set _.gscn = _.gscn - 1 %}
{%- endif %}
{#- align fg to be multiple of scs #}
{%- set scs = scs_khz * 1e-3 %}
{%- for i in range(10000) %}{# = `while 1` #}
{%- set _.fg = nr.get_frequency_by_gscn(_.gscn) %}
{%- if _.fg % scs < 1e-5*scs %}{# == 0 with tolerating fp #}
{%- break %}
{%- endif %}
{%- set _.gscn = _.gscn - 1 %}
{%- endfor %}
{%- set fg_arfcn = nr.get_nrarfcn(_.fg) %}
{{- fg_arfcn | tojson }}
{%- endmacro %}
......@@ -222,7 +232,8 @@
{%- elif xcell_type == 'nr' %}
{%- do _.setdefault('ul_nr_arfcn', J(jdefault_ul_nr_arfcn(_.dl_nr_arfcn, _.nr_band))) %}
{%- do _.setdefault('subcarrier_spacing', 30 if _.rf_mode == 'tdd' else 15) %}
{%- do _.setdefault('ssb_nr_arfcn', J(jdefault_ssb_nr_arfcn(_.dl_nr_arfcn))) %}
{%- do _.setdefault('ssb_nr_arfcn', J(jdefault_ssb_nr_arfcn(_.dl_nr_arfcn,
_.subcarrier_spacing))) %}
{%- else %}
{%- do bug('unreachable') %}
{%- endif %}
......@@ -347,7 +358,8 @@
{%- do _.setdefault('subcarrier_spacing',
30 if nrarfcn_module.get_duplex_mode(_.nr_band).lower() == 'tdd' else
15) %}
{%- do _.setdefault('ssb_nr_arfcn', J(jdefault_ssb_nr_arfcn(_.dl_nr_arfcn))) %}
{%- do _.setdefault('ssb_nr_arfcn', J(jdefault_ssb_nr_arfcn(_.dl_nr_arfcn,
_.subcarrier_spacing))) %}
{%- else %}
{%- do bug('unreachable') %}
{%- endif %}
......
......@@ -22,7 +22,7 @@ def j2render(src, out, jcfg):
textctx += 'import nrarfcn_module nrarfcn\n'
buildout = None # stub
r = jinja2_template.Recipe(buildout, "recipe", {
'extensions': 'jinja2.ext.do',
'extensions': 'jinja2.ext.do jinja2.ext.loopcontrols',
'url': 'config/{}'.format(src),
'output': 'config/out/{}'.format(out),
'context': textctx,
......
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