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

.

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