diff --git a/software/ors-amarisoft/amari/slap.jinja2 b/software/ors-amarisoft/amari/slap.jinja2 index a0ffd22e00fa8f5b3f554b98a0b8cceb2889f3c2..bf09cc758eb9a68f746f436794df511c347c1dd6 100644 --- a/software/ors-amarisoft/amari/slap.jinja2 +++ b/software/ors-amarisoft/amari/slap.jinja2 @@ -24,7 +24,7 @@ 'cell/lte': { 'pci': 1, - 'tac': "0x0001", + 'tac': '0x0001', 'tdd_ul_dl_config': '[Configuration 2] 5ms 2UL 6DL (default)', }, 'cell/nr': { @@ -32,6 +32,16 @@ 'ssb_pos_bitmap': '10000000', 'tdd_ul_dl_config': '5ms 2UL 7DL 4/6 (default)', }, + + 'peercell/lte': { + 'pci': 1, + 'tac': '0x0001', + }, + 'peercell/nr': { + 'pci': 500, + 'tac': '0x0001', + }, + 'cpri_link': { 'mapping': 'hw', 'mult': 16, @@ -302,7 +312,30 @@ ipeercell_dict keeps peer cell shared instances: reference -> ipeercell #} {%- macro load_ipeercell(ipeercell_dict) %} -// XXX TODO +{%- set qother = [] %} +{%- for ishared in qshared_instance_list %} +{%- set ref = J(jref_of_shared(ishared)) %} +{%- set _ = ishared['_'] %} +{%- if 'peer_cell_type' in _ %} +{%- set ipeercell = ishared %} +{%- for k, v in defaults['peercell/' + _.peer_cell_type].items() %} +{%- do _.setdefault(k, v) %} +{%- endfor %} +{%- if _.peer_cell_type == 'lte' %} +{%- do _.setdefault('ul_earfcn', J(jdefault_ul_earfcn(_.dl_earfcn))) %} +{%- elif _.peer_cell_type == 'nr' %} +{%- do _.setdefault('ul_nr_arfcn', J(jdefault_ul_nr_arfcn(_.dl_nr_arfcn, _.nr_band))) %} +{%- do _.setdefault('ssb_nr_arfcn', J(jdefault_ssb_nr_arfcn(_.dl_nr_arfcn))) %} +{%- else %} +{%- do bug('unreachable') %} +{%- endif %} +{%- do ipeercell_dict.update({ref: ipeercell}) %} +{%- else %} +{%- do qother.append(ishared) %} +{%- endif %} +{%- endfor %} +{%- do qshared_instance_list.clear() %} +{%- do qshared_instance_list.extend(qother) %} {%- endmacro %} diff --git a/software/ors-amarisoft/cell/peer/nr/input-schema.json b/software/ors-amarisoft/cell/peer/nr/input-schema.json index 7338eb34f04deef71dda2fe9e8f05983eb69c601..dabf2abd309dc75a39231853980dd4c4e46e57e5 100644 --- a/software/ors-amarisoft/cell/peer/nr/input-schema.json +++ b/software/ors-amarisoft/cell/peer/nr/input-schema.json @@ -40,6 +40,6 @@ "type": "integer" }, "pci": { "$ref": "../../../cell/nr/input-schema.json#/properties/pci" }, - "tac": { "$ref": "../../../cell/nr/input-schema.json#/properties/tac" } + "tac": { "$ref": "../../../cell/lte/input-schema.json#/properties/tac" } } } diff --git a/software/ors-amarisoft/config/enb.jinja2.cfg b/software/ors-amarisoft/config/enb.jinja2.cfg index c6e6f575f1fd17c15de5a00c0d93074f4aec804a..c0035fa1625c62feeaaf6ed295f5f64fa477e1f6 100644 --- a/software/ors-amarisoft/config/enb.jinja2.cfg +++ b/software/ors-amarisoft/config/enb.jinja2.cfg @@ -140,24 +140,10 @@ cell_id: {{ cfg('enb_id') }}{{ cell2.cell_id.removeprefix('0x') }}, // -> {{ cell2_ref }} n_id_cell: {{ cell2.pci }}, dl_earfcn: {{ cell2.dl_earfcn }}, - //ul_earfcn: {{ cell2.ul_earfcn }}, tac: {{ cell2.tac }}, {%- elif cell2.cell_type == 'nr' %} rat: "nr", cell_id: {{ cell2.cell_id }}, // -> {{ cell2_ref }} - - nr_cell_id: {{ cfg('gnb_id') }}{{ cell2.cell_id.removeprefix('0x') }}, // -> {{ cell2_ref }} - n_id_cell: {{ cell2.pci }}, - gnb_id_bits: {{ cfg('gnb_id_bits') }}, - dl_nr_arfcn: {{ cell2.dl_nr_arfcn }}, - ssb_nr_arfcn: {{ cell2.ssb_nr_arfcn }}, - ul_nr_arfcn: {{ cell2.ul_nr_arfcn }}, - tac: XXX cell2.tac, - band: {{ cell2.nr_band }}, - ssb_subcarrier_spacing: 30, - ssb_period: 20, - ssb_offset: 0, - ssb_duration: 1, {%- else %} {%- do bug('unreachable') %} {%- endif %} @@ -169,6 +155,34 @@ {#- TODO: add info about peers as shared instances - one instance per peer *ENB*. then query SlapOS Master about cells configured on that peer ENB and put them as peers here #} +{%- for peercell_ref, ipeercell in ipeercell_dict|dictsort %} +{%- set ncell = ipeercell['_'] %} + { +{%- if ncell.peer_cell_type == 'lte' %} + rat: "eutra", + cell_id: {{ ncell.e_cell_id }}, // -> {{ peercell_ref }} + n_id_cell: {{ ncell.pci }}, + dl_earfcn: {{ ncell.dl_earfcn }}, + tac: {{ ncell.tac }}, +{%- elif ncell.peer_cell_type == 'nr' %} + rat: "nr", + nr_cell_id: {{ ncell.nr_cell_id }}, // -> {{ peercell_ref }} + gnb_id_bits: {{ ncell.gnb_id_bits }}, + n_id_cell: {{ ncell.pci }}, + dl_nr_arfcn: {{ ncell.dl_nr_arfcn }}, + ssb_nr_arfcn: {{ ncell.ssb_nr_arfcn }}, + ul_nr_arfcn: {{ ncell.ul_nr_arfcn }}, + tac: {{ ncell.tac }}, + band: {{ ncell.nr_band }}, + ssb_subcarrier_spacing: 30, + ssb_period: 20, + ssb_offset: 0, + ssb_duration: 1, +{%- else %} +{%- do bug('unreachable') %} +{%- endif %} + }, +{%- endfor %} ], diff --git a/software/ors-amarisoft/config/out/enb.cfg b/software/ors-amarisoft/config/out/enb.cfg index b5ccb060c226e6fb12e9cb41ca08e367f5bdbd50..9aea3d4670a5079b0e1bbf397574be96cc6469c1 100644 --- a/software/ors-amarisoft/config/out/enb.cfg +++ b/software/ors-amarisoft/config/out/enb.cfg @@ -71,23 +71,32 @@ { rat: "nr", cell_id: 0x22, // -> CELL2_b + }, - nr_cell_id: 0x1234522, // -> CELL2_b - n_id_cell: 22, - gnb_id_bits: 28, - dl_nr_arfcn: 537200, - ssb_nr_arfcn: 537170, - ul_nr_arfcn: 513200, - tac: XXX cell2.tac, - band: 7, + // Inter-ENB HO + { + rat: "eutra", + cell_id: 0x12345, // -> PEER1 + n_id_cell: 35, + dl_earfcn: 700, + tac: 123, + }, + { + rat: "nr", + nr_cell_id: 0x77712, // -> PEER2 + gnb_id_bits: 22, + n_id_cell: 75, + dl_nr_arfcn: 520000, + ssb_nr_arfcn: 519890, + ul_nr_arfcn: 520000, + tac: 321, + band: 38, ssb_subcarrier_spacing: 30, ssb_period: 20, ssb_offset: 0, ssb_duration: 1, }, - // Inter-ENB HO - ], // Carrier Aggregation // XXX + CA LTE-NR diff --git a/software/ors-amarisoft/slapos-render-config.py b/software/ors-amarisoft/slapos-render-config.py index c97d615ae2976129a14ad3646ff85c07b23ebb83..b36689c3467a547e433ad491922282611acbe183 100644 --- a/software/ors-amarisoft/slapos-render-config.py +++ b/software/ors-amarisoft/slapos-render-config.py @@ -285,6 +285,25 @@ def do_enb(): #iRU3_SDR1_fLTE2(ienb) #iRU2_LOPCOMM_fLTE2(ienb) + # add 2 peer cells + if 1: + ienb.ishared('PEER1', { + 'peer_cell_type': 'lte', + 'e_cell_id': '0x12345', + 'pci': 35, + 'dl_earfcn': 700, + 'tac': 123, + }) + ienb.ishared('PEER2', { + 'peer_cell_type': 'nr', + 'nr_cell_id': '0x77712', + 'gnb_id_bits': 22, + 'dl_nr_arfcn': 520000, + 'nr_band': 38, + 'pci': 75, + 'tac': 321, + }) + jshared_instance_list = json.dumps(ienb.shared_instance_list) json_params = """{ "sib23_file": "sib2_3.asn", @@ -312,8 +331,9 @@ def do_enb(): j2render('enb.jinja2.cfg', 'enb.cfg', json_params) # drb.cfg + sib.asn for all cells - iru_dict = {} - icell_dict = {} + iru_dict = {} + icell_dict = {} + ipeercell_dict = {} for ishared in ienb.shared_instance_list: ref = ref_of_shared(ishared) _ = json.loads(ishared['_']) @@ -322,6 +342,8 @@ def do_enb(): iru_dict[ref] = ishared elif 'cell_type' in _: icell_dict[ref] = ishared + elif 'peer_cell_type' in _: + ipeercell_dict[ref] = ishared else: raise AssertionError('enb: unknown shared instance %r' % (ishared,))