Merge remote-tracking branch 'origin/nr_ue_multiple_rf' into integration_2026_w05 (!3593)

NR UE: add support for multiple RF frontends

This MR adds basic support for multiple RF-frontends at the UE.
There are multiple reasons why we might want this:
1. There might be different antennas needed for different bands (e.g. NTN or
   TN antennas). These antennas might be connected to different RF-frontends.
   In case of Handover, the UE needs to dynamically switch between these
   RF-frontends.
2. Each rf-simulator connection carries baseband I/Q samples. To be able to
   perform a handover between two cells at different frequencies, there must
   be two rf-simulator connections, as the baseband channels should not
   interfere and thus cannot simply be added.
3. When we want to support multiple UE simulation within one instance of
   nr-uesoftmodem, and allow multiple cells and probably even handover between
   these cells, we need either:
   1. dedicated RF-frontends for each simulated UE, or
   2. dedicated RF-frontends for each connected cell and dynamically assign
      simulated UEs accordingly.

This MR implements what is needed for 1., 2. and 3.1.
This commit is contained in:
Jaroslava Fiedlerova
2026-01-28 20:19:48 +01:00
153 changed files with 1993 additions and 1082 deletions
+1
View File
@@ -1905,6 +1905,7 @@ add_executable(nr-uesoftmodem
${OPENAIR_DIR}/executables/nr-uesoftmodem.c
${OPENAIR_DIR}/executables/position_interface.c
${OPENAIR_DIR}/executables/nr-ue.c
${OPENAIR_DIR}/executables/nr-ue-ru.c
${OPENAIR_DIR}/executables/softmodem-common.c
${OPENAIR_DIR}/radio/COMMON/common_lib.c
${OPENAIR_DIR}/radio/COMMON/record_player.c
@@ -200,9 +200,11 @@ RUs = (
}
);
rfsimulator: {
rfsimulator = (
{
serveraddr = "server";
};
}
);
THREAD_STRUCT = (
{
@@ -233,9 +233,11 @@ RUs =
}
);
rfsimulator: {
rfsimulator = (
{
serveraddr = "server";
};
}
);
THREAD_STRUCT =
(
@@ -233,9 +233,11 @@ RUs =
}
);
rfsimulator: {
rfsimulator = (
{
serveraddr = "server";
};
}
);
THREAD_STRUCT =
(
@@ -233,9 +233,11 @@ RUs =
}
);
rfsimulator: {
rfsimulator = (
{
serveraddr = "server";
};
}
);
THREAD_STRUCT =
(
@@ -233,9 +233,11 @@ RUs =
}
);
rfsimulator: {
rfsimulator = (
{
serveraddr = "server";
};
}
);
THREAD_STRUCT =
(
@@ -362,9 +362,11 @@ RUs = (
}
);
rfsimulator: {
rfsimulator = (
{
serveraddr = "server";
};
}
);
THREAD_STRUCT = (
{
@@ -197,13 +197,15 @@ RUs = (
}
);
rfsimulator: {
serveraddr = "server";
rfsimulator = (
{
serveraddr = "server";
serverport = 4043;
options = (); #("saviq"); or/and "chanmod"
modelname = "AWGN";
IQfile = "/tmp/rfsimulator.iqs"
}
IQfile = "/tmp/rfsimulator.iqs";
}
);
log_config: {
global_log_level = "info";
@@ -27,14 +27,15 @@ RUs = ({
eNB_instances = [0];
});
rfsimulator :
rfsimulator = (
{
serveraddr = "server";
serverport = 4043;
options = (); #("saviq"); or/and "chanmod"
modelname = "AWGN";
IQfile = "/tmp/rfsimulator.iqs";
};
}
);
log_config: {
global_log_level = "info";
@@ -191,10 +191,11 @@ RUs = (
}
);
rfsimulator: {
rfsimulator = (
{
serveraddr = "server";
};
}
);
security = {
# preferred ciphering algorithms
@@ -200,10 +200,11 @@ RUs = (
}
);
rfsimulator: {
rfsimulator = (
{
serveraddr = "server";
};
}
);
security = {
# preferred ciphering algorithms
@@ -234,14 +234,15 @@ RUs = (
}
);
rfsimulator :
rfsimulator = (
{
serveraddr = "server";
serverport = 4043;
options = ("chanmod"); #("saviq"); or/and "chanmod"
prop_delay = 20;
IQfile = "/tmp/rfsimulator.iqs";
};
}
);
channelmod = {
max_chan=10;
@@ -242,14 +242,15 @@ RUs = (
}
);
rfsimulator :
rfsimulator = (
{
serveraddr = "server";
serverport = 4043;
options = (); #("saviq"); or/and "chanmod"
prop_delay = 238.74;
IQfile = "/tmp/rfsimulator.iqs";
};
}
);
security = {
# preferred ciphering algorithms
@@ -202,9 +202,11 @@ RUs = ({
eNB_instances = [0];
});
rfsimulator: {
rfsimulator = (
{
serveraddr = "server";
};
}
);
security = {
# preferred ciphering algorithms
@@ -205,14 +205,15 @@ RUs = (
);
rfsimulator :
{
rfsimulator = (
{
serveraddr = "server";
serverport = 4043;
options = (); #("saviq"); or/and "chanmod"
modelname = "AWGN";
IQfile = "/tmp/rfsimulator.iqs";
};
}
);
security = {
# preferred ciphering algorithms
@@ -208,9 +208,11 @@ RUs = (
);
rfsimulator: {
rfsimulator = (
{
serveraddr = "server";
};
}
);
security = {
# preferred ciphering algorithms
@@ -197,9 +197,11 @@ RUs = (
}
);
rfsimulator: {
rfsimulator = (
{
serveraddr = "server";
};
}
);
security = {
# preferred ciphering algorithms
@@ -204,13 +204,15 @@ RUs = ({
});
rfsimulator: {
rfsimulator = (
{
serveraddr = "server";
serverport = 4043;
options = (); #("saviq"); or/and "chanmod"
modelname = "AWGN";
IQfile = "/tmp/rfsimulator.iqs"
}
);
security = {
# preferred ciphering algorithms
@@ -155,8 +155,8 @@ gNBs =
NETWORK_INTERFACES :
{
GNB_IPV4_ADDRESS_FOR_NG_AMF = "CI_GNB_IP_ADDR";
GNB_IPV4_ADDRESS_FOR_NGU = "CI_GNB_IP_ADDR";
GNB_IPV4_ADDRESS_FOR_NG_AMF = "192.168.71.140";
GNB_IPV4_ADDRESS_FOR_NGU = "192.168.71.140";
GNB_PORT_FOR_S1U = 2152; # Spec 2152
};
@@ -217,14 +217,15 @@ RUs = (
);
rfsimulator :
rfsimulator = (
{
serveraddr = "server";
serverport = 4043;
options = (); #("saviq"); or/and "chanmod"
modelname = "AWGN";
IQfile = "/tmp/rfsimulator.iqs";
};
}
);
security = {
# preferred ciphering algorithms
@@ -168,7 +168,7 @@ RUs:
sdr_addrs: serial=XXXXXXX
rfsimulator:
serveraddr: server
- serveraddr: server
security:
# preferred ciphering algorithms
@@ -203,10 +203,11 @@ RUs = (
}
);
rfsimulator: {
rfsimulator = (
{
serveraddr = "server";
};
}
);
security = {
# preferred ciphering algorithms
@@ -203,14 +203,15 @@ RUs = (
);
rfsimulator :
rfsimulator = (
{
serveraddr = "server";
serverport = 4043;
options = (); #("saviq"); or/and "chanmod"
modelname = "AWGN";
IQfile = "/tmp/rfsimulator.iqs";
};
}
);
security = {
# preferred ciphering algorithms
@@ -87,3 +87,9 @@ PRSs =
);
}
);
rfsimulator = (
{
serveraddr = "127.0.0.1";
}
);
+7 -1
View File
@@ -14,6 +14,12 @@ position0 = {
thread-pool = "-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1"
rfsimulator = (
{
serveraddr = "127.0.0.1";
}
);
#/* configuration for channel modelisation */
#/* To be included in main config file when */
#/* channel modelisation is used (rfsimulator with chanmod options enabled) */
@@ -40,4 +46,4 @@ channelmod = {
ds_tdl = 0;
}
);
};
};
@@ -14,6 +14,40 @@ position0 = {
thread-pool = "-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1"
rfsimulator = (
{
prop_delay = 20;
options = ("chanmod");
}
);
RUs = (
{
nb_tx = 1;
nb_rx = 1;
att_tx = 0;
att_rx = 0;
max_rxgain = 114;
sdr_addrs = "type=x300";
clock_src = "internal";
time_src = "internal";
# if_freq = 3700000000L;
# if_offset = 1000000;
}
);
cells = (
{
ru_id = 0;
band = 254;
rf_freq = 2488400000L;
rf_offset = -873500000L;
numerology = 0;
N_RB_DL = 25;
ssb_start = 60;
}
);
#/* configuration for channel modelisation */
#/* To be included in main config file when */
#/* channel modelisation is used (rfsimulator with chanmod options enabled) */
+3
View File
@@ -7,6 +7,9 @@ uicc0:
thread-pool: "-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1"
rfsimulator:
- serveraddr: "127.0.0.1"
#/* configuration for channel modelisation */
#/* To be included in main config file when */
#/* channel modelisation is used (rfsimulator with chanmod options enabled) */
@@ -205,14 +205,15 @@ RUs = (
);
rfsimulator :
{
rfsimulator = (
{
serveraddr = "server";
serverport = 4043;
options = (); #("saviq"); or/and "chanmod"
modelname = "AWGN";
IQfile = "/tmp/rfsimulator.iqs";
};
}
);
security = {
# preferred ciphering algorithms
@@ -200,14 +200,15 @@ RUs = (
);
rfsimulator :
rfsimulator = (
{
serveraddr = "server";
serverport = 4043;
options = (); #("saviq"); or/and "chanmod"
modelname = "AWGN";
IQfile = "/tmp/rfsimulator.iqs";
};
}
);
security = {
# preferred ciphering algorithms
@@ -208,7 +208,7 @@ services:
environment:
TZ: Europe/Paris
ASAN_OPTIONS: detect_leaks=0
USE_ADDITIONAL_OPTIONS: --rfsim -C 2680000000 -r 25 --ue-rxgain 140 --ue-txgain 120 --rfsimulator.serveraddr 192.168.61.20 --log_config.global_log_options level,nocolor,time
USE_ADDITIONAL_OPTIONS: --rfsim -C 2680000000 -r 25 --ue-rxgain 140 --ue-txgain 120 --rfsimulator.[0].serveraddr 192.168.61.20 --log_config.global_log_options level,nocolor,time
volumes:
- ../../conf_files/lteue.usim-ci.conf:/opt/oai-lte-ue/etc/ue_usim.conf
healthcheck:
@@ -30,7 +30,7 @@ services:
environment:
TZ: Europe/Paris
ASAN_OPTIONS: detect_leaks=0
USE_ADDITIONAL_OPTIONS: --rfsim -C 2680000000 -r 25 --ue-rxgain 140 --ue-txgain 120 --rfsimulator.serveraddr 192.168.61.20 --log_config.global_log_options level,nocolor,time --noS1
USE_ADDITIONAL_OPTIONS: --rfsim -C 2680000000 -r 25 --ue-rxgain 140 --ue-txgain 120 --rfsimulator.[0].serveraddr 192.168.61.20 --log_config.global_log_options level,nocolor,time --noS1
volumes:
- ../../conf_files/lteue.usim-ci.conf:/opt/oai-lte-ue/etc/ue_usim.conf
healthcheck:
@@ -208,7 +208,7 @@ services:
environment:
TZ: Europe/Paris
ASAN_OPTIONS: detect_leaks=0
USE_ADDITIONAL_OPTIONS: --rfsim -C 2680000000 -r 50 --ue-rxgain 140 --ue-txgain 120 --rfsimulator.serveraddr 192.168.61.20 --log_config.global_log_options level,nocolor,time
USE_ADDITIONAL_OPTIONS: --rfsim -C 2680000000 -r 50 --ue-rxgain 140 --ue-txgain 120 --rfsimulator.[0].serveraddr 192.168.61.20 --log_config.global_log_options level,nocolor,time
volumes:
- ../../conf_files/lteue.usim-ci.conf:/opt/oai-lte-ue/etc/ue_usim.conf
healthcheck:
@@ -208,7 +208,7 @@ services:
environment:
TZ: Europe/Paris
ASAN_OPTIONS: detect_leaks=0
USE_ADDITIONAL_OPTIONS: --rfsim -C 2680000000 -r 100 --ue-rxgain 140 --ue-txgain 120 --rfsimulator.serveraddr 192.168.61.20 --log_config.global_log_options level,nocolor,time
USE_ADDITIONAL_OPTIONS: --rfsim -C 2680000000 -r 100 --ue-rxgain 140 --ue-txgain 120 --rfsimulator.[0].serveraddr 192.168.61.20 --log_config.global_log_options level,nocolor,time
volumes:
- ../../conf_files/lteue.usim-ci.conf:/opt/oai-lte-ue/etc/ue_usim.conf
healthcheck:
@@ -28,7 +28,7 @@ services:
environment:
TZ: Europe/Paris
ASAN_OPTIONS: detect_leaks=0
USE_ADDITIONAL_OPTIONS: -C 2680000000 -r 25 --ue-rxgain 140 --ue-txgain 120 --rfsim --noS1 --rfsimulator.serveraddr 192.168.61.20 --log_config.global_log_options level,nocolor,time --noS1
USE_ADDITIONAL_OPTIONS: -C 2680000000 -r 25 --ue-rxgain 140 --ue-txgain 120 --rfsim --noS1 --rfsimulator.[0].serveraddr 192.168.61.20 --log_config.global_log_options level,nocolor,time --noS1
volumes:
- ../../conf_files/lteue.usim-mbs.conf:/opt/oai-lte-ue/etc/ue_usim.conf
healthcheck:
@@ -33,7 +33,7 @@ services:
TZ: Europe/Paris
HOSTNAME: oai_ue0
ASAN_OPTIONS: detect_leaks=0
USE_ADDITIONAL_OPTIONS: -C 2680000000 -r 25 --ue-rxgain 140 --ue-txgain 120 --rfsim --noS1 --rfsimulator.serveraddr 192.168.61.20 --log_config.global_log_options level,nocolor,time --noS1
USE_ADDITIONAL_OPTIONS: -C 2680000000 -r 25 --ue-rxgain 140 --ue-txgain 120 --rfsim --noS1 --rfsimulator.[0].serveraddr 192.168.61.20 --log_config.global_log_options level,nocolor,time --noS1
volumes:
- ../../conf_files/lteue.usim-mbs.conf:/opt/oai-lte-ue/etc/ue_usim.conf
healthcheck:
@@ -208,7 +208,7 @@ services:
environment:
TZ: Europe/Paris
ASAN_OPTIONS: detect_leaks=0
USE_ADDITIONAL_OPTIONS: --rfsim -T -C 2605000000 -r 25 --ue-rxgain 140 --ue-txgain 120 --rfsimulator.serveraddr 192.168.61.20 --log_config.global_log_options level,nocolor,time
USE_ADDITIONAL_OPTIONS: --rfsim -T -C 2605000000 -r 25 --ue-rxgain 140 --ue-txgain 120 --rfsimulator.[0].serveraddr 192.168.61.20 --log_config.global_log_options level,nocolor,time
volumes:
- ../../conf_files/lteue.usim-ci.conf:/opt/oai-lte-ue/etc/ue_usim.conf
healthcheck:
@@ -130,10 +130,10 @@ services:
environment:
USE_ADDITIONAL_OPTIONS: --rfsim
--log_config.global_log_options level,nocolor,time
--rfsimulator.options chanmod
--rfsimulator.[0].options chanmod
--telnetsrv --telnetsrv.listenaddr 192.168.71.171
--telnetsrv.shrmod ci
--rfsimulator.serveraddr 192.168.71.181
--rfsimulator.[0].serveraddr 192.168.71.181
ASAN_OPTIONS: detect_leaks=0:detect_odr_violation=0
depends_on:
- oai-cu
@@ -168,7 +168,7 @@ services:
--gNBs.[0].servingCellConfigCommon.[0].dl_absoluteFrequencyPointA 642024
--gNBs.[0].servingCellConfigCommon.[0].ssb_PositionsInBurst_Bitmap 3
--MACRLCs.[0].local_n_address 192.168.71.172
--rfsimulator.serveraddr 192.168.71.181
--rfsimulator.[0].serveraddr 192.168.71.181
ASAN_OPTIONS: detect_leaks=0:detect_odr_violation=0
depends_on:
- oai-cu
@@ -199,8 +199,8 @@ services:
USE_ADDITIONAL_OPTIONS: --rfsim --log_config.global_log_options level,nocolor,time
-r 106 --numerology 1 -C 3619200000
--uicc0.imsi 208990100001100
--rfsimulator.options chanmod
--rfsimulator.serveraddr server
--rfsimulator.[0].options chanmod
--rfsimulator.[0].serveraddr server
--telnetsrv --telnetsrv.shrmod ciUE --telnetsrv.listenaddr 192.168.71.181 --telnetsrv.listenport 8091
--channelmod.modellist_rfsimu_1.[0].model_name rfsimu_channel_ue0
--channelmod.modellist_rfsimu_1.[1].model_name rfsimu_channel_ue1
@@ -256,7 +256,7 @@ Create the entry for the second UE in `docker-compose.yaml` file as follows:
- NET_ADMIN # for interface bringup
- NET_RAW # for ping
environment:
USE_ADDITIONAL_OPTIONS: -E --rfsim -r 106 --numerology 1 -C 3619200000 --rfsimulator.serveraddr 192.168.71.140 --log_config.global_log_options level,nocolor,time
USE_ADDITIONAL_OPTIONS: -E --rfsim -r 106 --numerology 1 -C 3619200000 --rfsimulator.[0].serveraddr 192.168.71.140 --log_config.global_log_options level,nocolor,time
depends_on:
- oai-gnb
devices:
@@ -123,7 +123,7 @@ services:
- NET_RAW # for ping
- SYS_NICE
environment:
USE_ADDITIONAL_OPTIONS: -E --rfsim -r 106 --numerology 1 --uicc0.imsi 208990100001100 -C 3319680000 --rfsimulator.serveraddr 192.168.71.140 --log_config.global_log_options level,nocolor,time
USE_ADDITIONAL_OPTIONS: -E --rfsim -r 106 --numerology 1 --uicc0.imsi 208990100001100 -C 3319680000 --rfsimulator.[0].serveraddr 192.168.71.140 --log_config.global_log_options level,nocolor,time
depends_on:
- oai-gnb
networks:
@@ -150,7 +150,7 @@ services:
- NET_RAW # for ping
- SYS_NICE
environment:
USE_ADDITIONAL_OPTIONS: -E --rfsim -r 106 --numerology 1 --uicc0.imsi 208990100001101 -C 3319680000 --rfsimulator.serveraddr 192.168.71.140 --log_config.global_log_options level,nocolor,time
USE_ADDITIONAL_OPTIONS: -E --rfsim -r 106 --numerology 1 --uicc0.imsi 208990100001101 -C 3319680000 --rfsimulator.[0].serveraddr 192.168.71.140 --log_config.global_log_options level,nocolor,time
depends_on:
- oai-gnb
networks:
@@ -177,7 +177,7 @@ services:
- NET_RAW # for ping
- SYS_NICE
environment:
USE_ADDITIONAL_OPTIONS: -E --rfsim -r 106 --numerology 1 --uicc0.imsi 208990100001102 -C 3319680000 --rfsimulator.serveraddr 192.168.71.140 --log_config.global_log_options level,nocolor,time
USE_ADDITIONAL_OPTIONS: -E --rfsim -r 106 --numerology 1 --uicc0.imsi 208990100001102 -C 3319680000 --rfsimulator.[0].serveraddr 192.168.71.140 --log_config.global_log_options level,nocolor,time
depends_on:
- oai-gnb
networks:
@@ -204,7 +204,7 @@ services:
- NET_RAW # for ping
- SYS_NICE
environment:
USE_ADDITIONAL_OPTIONS: -E --rfsim -r 106 --numerology 1 --uicc0.imsi 208990100001103 -C 3319680000 --rfsimulator.serveraddr 192.168.71.140 --log_config.global_log_options level,nocolor,time
USE_ADDITIONAL_OPTIONS: -E --rfsim -r 106 --numerology 1 --uicc0.imsi 208990100001103 -C 3319680000 --rfsimulator.[0].serveraddr 192.168.71.140 --log_config.global_log_options level,nocolor,time
depends_on:
- oai-gnb
networks:
@@ -231,7 +231,7 @@ services:
- NET_RAW # for ping
- SYS_NICE
environment:
USE_ADDITIONAL_OPTIONS: -E --rfsim -r 106 --numerology 1 --uicc0.imsi 208990100001104 -C 3319680000 --rfsimulator.serveraddr 192.168.71.140 --log_config.global_log_options level,nocolor,time
USE_ADDITIONAL_OPTIONS: -E --rfsim -r 106 --numerology 1 --uicc0.imsi 208990100001104 -C 3319680000 --rfsimulator.[0].serveraddr 192.168.71.140 --log_config.global_log_options level,nocolor,time
depends_on:
- oai-gnb
networks:
@@ -258,7 +258,7 @@ services:
- NET_RAW # for ping
- SYS_NICE
environment:
USE_ADDITIONAL_OPTIONS: -E --rfsim -r 106 --numerology 1 --uicc0.imsi 208990100001105 -C 3319680000 --rfsimulator.serveraddr 192.168.71.140 --log_config.global_log_options level,nocolor,time
USE_ADDITIONAL_OPTIONS: -E --rfsim -r 106 --numerology 1 --uicc0.imsi 208990100001105 -C 3319680000 --rfsimulator.[0].serveraddr 192.168.71.140 --log_config.global_log_options level,nocolor,time
depends_on:
- oai-gnb
networks:
@@ -285,7 +285,7 @@ services:
- NET_RAW # for ping
- SYS_NICE
environment:
USE_ADDITIONAL_OPTIONS: -E --rfsim -r 106 --numerology 1 --uicc0.imsi 208990100001106 -C 3319680000 --rfsimulator.serveraddr 192.168.71.140 --log_config.global_log_options level,nocolor,time
USE_ADDITIONAL_OPTIONS: -E --rfsim -r 106 --numerology 1 --uicc0.imsi 208990100001106 -C 3319680000 --rfsimulator.[0].serveraddr 192.168.71.140 --log_config.global_log_options level,nocolor,time
depends_on:
- oai-gnb
networks:
@@ -312,7 +312,7 @@ services:
- NET_RAW # for ping
- SYS_NICE
environment:
USE_ADDITIONAL_OPTIONS: -E --rfsim -r 106 --numerology 1 --uicc0.imsi 208990100001107 -C 3319680000 --rfsimulator.serveraddr 192.168.71.140 --log_config.global_log_options level,nocolor,time
USE_ADDITIONAL_OPTIONS: -E --rfsim -r 106 --numerology 1 --uicc0.imsi 208990100001107 -C 3319680000 --rfsimulator.[0].serveraddr 192.168.71.140 --log_config.global_log_options level,nocolor,time
depends_on:
- oai-gnb
networks:
@@ -339,7 +339,7 @@ services:
- NET_RAW # for ping
- SYS_NICE
environment:
USE_ADDITIONAL_OPTIONS: -E --rfsim -r 106 --numerology 1 --uicc0.imsi 208990100001108 -C 3319680000 --rfsimulator.serveraddr 192.168.71.140 --log_config.global_log_options level,nocolor,time
USE_ADDITIONAL_OPTIONS: -E --rfsim -r 106 --numerology 1 --uicc0.imsi 208990100001108 -C 3319680000 --rfsimulator.[0].serveraddr 192.168.71.140 --log_config.global_log_options level,nocolor,time
depends_on:
- oai-gnb
networks:
@@ -366,7 +366,7 @@ services:
- NET_RAW # for ping
- SYS_NICE
environment:
USE_ADDITIONAL_OPTIONS: -E --rfsim -r 106 --numerology 1 --uicc0.imsi 208990100001109 -C 3319680000 --rfsimulator.serveraddr 192.168.71.140 --log_config.global_log_options level,nocolor,time
USE_ADDITIONAL_OPTIONS: -E --rfsim -r 106 --numerology 1 --uicc0.imsi 208990100001109 -C 3319680000 --rfsimulator.[0].serveraddr 192.168.71.140 --log_config.global_log_options level,nocolor,time
depends_on:
- oai-gnb
networks:
@@ -3,4 +3,4 @@ services:
privileged: true
stdin_open: true
tty: true
command: gdb --args /opt/oai-nr-ue/bin/nr-uesoftmodem -O /opt/oai-nr-ue/etc/nr-ue.conf -E --rfsim -r 106 --numerology 1 --uicc0.imsi 208990100001100 -C 3619200000 --rfsimulator.serveraddr 192.168.71.140 --log_config.global_log_options level,nocolor,time
command: gdb --args /opt/oai-nr-ue/bin/nr-uesoftmodem -O /opt/oai-nr-ue/etc/nr-ue.conf -E --rfsim -r 106 --numerology 1 --uicc0.imsi 208990100001100 -C 3619200000 --rfsimulator.[0].serveraddr 192.168.71.140 --log_config.global_log_options level,nocolor,time
@@ -121,7 +121,7 @@ services:
- NET_RAW # for ping
environment:
USE_ADDITIONAL_OPTIONS: --rfsim -r 24 --ssb 24 --numerology 1 -C 3604800000 --uicc0.imsi 208990100001100
--rfsimulator.serveraddr 192.168.71.140 --log_config.global_log_options level,nocolor,time
--rfsimulator.[0].serveraddr 192.168.71.140 --log_config.global_log_options level,nocolor,time
--telnetsrv --telnetsrv.shrmod ciUE --telnetsrv.listenaddr 192.168.71.150 --telnetsrv.listenport 8091
ASAN_OPTIONS: detect_leaks=0:detect_odr_violation=0
depends_on:
@@ -124,7 +124,7 @@ services:
- NET_RAW # for ping
- SYS_NICE
environment:
USE_ADDITIONAL_OPTIONS: --rfsim -r 273 --numerology 1 --band 78 -C 3450720000 --ssb 1518 --ue-nb-ant-tx 2 --uicc0.imsi 208990100001100 --ue-nb-ant-rx 2 --uecap_file /opt/oai-nr-ue/etc/uecap.xml --rfsimulator.serveraddr 192.168.71.140 --log_config.global_log_options level,nocolor,time
USE_ADDITIONAL_OPTIONS: --rfsim -r 273 --numerology 1 --band 78 -C 3450720000 --ssb 1518 --ue-nb-ant-tx 2 --uicc0.imsi 208990100001100 --ue-nb-ant-rx 2 --uecap_file /opt/oai-nr-ue/etc/uecap.xml --rfsimulator.[0].serveraddr 192.168.71.140 --log_config.global_log_options level,nocolor,time
depends_on:
- oai-gnb
networks:
@@ -309,7 +309,7 @@ services:
USE_ADDITIONAL_OPTIONS: --rfsim --log_config.global_log_options level,nocolor,time
-r 106 --numerology 1 -C 3619200000
--uicc0.imsi 208990100001100
--rfsimulator.serveraddr oai-du
--rfsimulator.[0].serveraddr oai-du
depends_on:
- oai-du
networks:
@@ -339,7 +339,7 @@ services:
USE_ADDITIONAL_OPTIONS: --rfsim --log_config.global_log_options level,nocolor,time
-r 106 --numerology 1 -C 3619200000
--uicc0.imsi 208990100001101 --uicc0.nssai_sst 2
--rfsimulator.serveraddr 192.168.78.3
--rfsimulator.[0].serveraddr 192.168.78.3
depends_on:
- oai-du2
networks:
@@ -369,7 +369,7 @@ services:
USE_ADDITIONAL_OPTIONS: --rfsim --log_config.global_log_options level,nocolor,time
-r 106 --numerology 1 -C 3619200000
--uicc0.imsi 208990100001102 --uicc0.nssai_sst 3
--rfsimulator.serveraddr 192.168.78.4
--rfsimulator.[0].serveraddr 192.168.78.4
ASAN_OPTIONS: detect_leaks=0
depends_on:
- oai-du3
@@ -8,7 +8,7 @@ services:
- NET_ADMIN # for interface bringup
- NET_RAW # for ping
environment:
USE_ADDITIONAL_OPTIONS: --phy-test --rfsim --rfsimulator.wait_timeout 20 --noS1 --log_config.global_log_options level,nocolor,time
USE_ADDITIONAL_OPTIONS: --phy-test --rfsim --rfsimulator.[0].wait_timeout 20 --noS1 --log_config.global_log_options level,nocolor,time
ASAN_OPTIONS: detect_leaks=0
networks:
public_net:
@@ -33,7 +33,7 @@ services:
- NET_ADMIN # for interface bringup
- NET_RAW # for ping
environment:
USE_ADDITIONAL_OPTIONS: --phy-test --rfsim --noS1 --reconfig-file etc/rrc/reconfig.raw --rbconfig-file etc/rrc/rbconfig.raw --rfsimulator.serveraddr 192.168.71.140 --log_config.global_log_options level,nocolor,time
USE_ADDITIONAL_OPTIONS: --phy-test --rfsim --noS1 --reconfig-file etc/rrc/reconfig.raw --rbconfig-file etc/rrc/rbconfig.raw --rfsimulator.[0].serveraddr 192.168.71.140 --log_config.global_log_options level,nocolor,time
ASAN_OPTIONS: detect_leaks=0
devices:
- /dev/net/tun:/dev/net/tun
@@ -105,7 +105,7 @@ services:
privileged: true
container_name: rfsim5g-oai-nr-ue
environment:
USE_ADDITIONAL_OPTIONS: -E --rfsim -r 106 --numerology 1 -C 3619200000 --uicc0.imsi 001010000000003 --rfsimulator.serveraddr 192.168.70.151 --log_config.global_log_options level,nocolor,time
USE_ADDITIONAL_OPTIONS: -E --rfsim -r 106 --numerology 1 -C 3619200000 --uicc0.imsi 001010000000003 --rfsimulator.[0].serveraddr 192.168.70.151 --log_config.global_log_options level,nocolor,time
depends_on:
- oai-gnb
networks:
@@ -124,7 +124,7 @@ services:
privileged: true
container_name: rfsim5g-oai-nr-ue2
environment:
USE_ADDITIONAL_OPTIONS: -E --rfsim -r 106 --numerology 1 -C 3619200000 --uicc0.imsi 001010000000004 --rfsimulator.serveraddr 192.168.70.151 --log_config.global_log_options level,nocolor,time
USE_ADDITIONAL_OPTIONS: -E --rfsim -r 106 --numerology 1 -C 3619200000 --uicc0.imsi 001010000000004 --rfsimulator.[0].serveraddr 192.168.70.151 --log_config.global_log_options level,nocolor,time
depends_on:
- oai-gnb
networks:
@@ -121,7 +121,7 @@ services:
- NET_RAW # for ping
environment:
USE_ADDITIONAL_OPTIONS: --rfsim
--rfsimulator.serveraddr 192.168.71.140 --log_config.global_log_options level,nocolor,time
--rfsimulator.[0].serveraddr 192.168.71.140 --log_config.global_log_options level,nocolor,time
-C 27975360000 -r 66 --numerology 3 --ssb 48 --band 257
ASAN_OPTIONS: detect_leaks=0
devices:
@@ -111,7 +111,7 @@ services:
- NET_ADMIN # for interface bringup
- NET_RAW # for ping
environment:
USE_ADDITIONAL_OPTIONS: -E --rfsim -r 106 --numerology 1 --uicc0.imsi 208990100001100 -C 3319680000 --rfsimulator.serveraddr 192.168.71.140 --log_config.global_log_options level,nocolor,time --num-ues 10
USE_ADDITIONAL_OPTIONS: -E --rfsim --log_config.global_log_options level,nocolor,time --num-ues 10
depends_on:
- oai-gnb
networks:
@@ -69,7 +69,136 @@ uicc9 = {
nssai_sst=1;
}
thread-pool: "-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1"
rfsimulator = (
{
serveraddr = "192.168.71.140";
}, {
serveraddr = "192.168.71.140";
}, {
serveraddr = "192.168.71.140";
}, {
serveraddr = "192.168.71.140";
}, {
serveraddr = "192.168.71.140";
}, {
serveraddr = "192.168.71.140";
}, {
serveraddr = "192.168.71.140";
}, {
serveraddr = "192.168.71.140";
}, {
serveraddr = "192.168.71.140";
}, {
serveraddr = "192.168.71.140";
}
);
RUs = (
{
nb_tx = 1;
nb_rx = 1;
}, {
nb_tx = 1;
nb_rx = 1;
}, {
nb_tx = 1;
nb_rx = 1;
}, {
nb_tx = 1;
nb_rx = 1;
}, {
nb_tx = 1;
nb_rx = 1;
}, {
nb_tx = 1;
nb_rx = 1;
}, {
nb_tx = 1;
nb_rx = 1;
}, {
nb_tx = 1;
nb_rx = 1;
}, {
nb_tx = 1;
nb_rx = 1;
}, {
nb_tx = 1;
nb_rx = 1;
}
);
cells = (
{
ru_id = 0;
band = 78;
rf_freq = 3319680000L;
numerology = 1;
N_RB_DL = 106;
ssb_start = 516;
}, {
ru_id = 1;
band = 78;
rf_freq = 3319680000L;
numerology = 1;
N_RB_DL = 106;
ssb_start = 516;
}, {
ru_id = 2;
band = 78;
rf_freq = 3319680000L;
numerology = 1;
N_RB_DL = 106;
ssb_start = 516;
}, {
ru_id = 3;
band = 78;
rf_freq = 3319680000L;
numerology = 1;
N_RB_DL = 106;
ssb_start = 516;
}, {
ru_id = 4;
band = 78;
rf_freq = 3319680000L;
numerology = 1;
N_RB_DL = 106;
ssb_start = 516;
}, {
ru_id = 5;
band = 78;
rf_freq = 3319680000L;
numerology = 1;
N_RB_DL = 106;
ssb_start = 516;
}, {
ru_id = 6;
band = 78;
rf_freq = 3319680000L;
numerology = 1;
N_RB_DL = 106;
ssb_start = 516;
}, {
ru_id = 7;
band = 78;
rf_freq = 3319680000L;
numerology = 1;
N_RB_DL = 106;
ssb_start = 516;
}, {
ru_id = 8;
band = 78;
rf_freq = 3319680000L;
numerology = 1;
N_RB_DL = 106;
ssb_start = 516;
}, {
ru_id = 9;
band = 78;
rf_freq = 3319680000L;
numerology = 1;
N_RB_DL = 106;
ssb_start = 516;
}
);
@@ -149,7 +149,7 @@ services:
--gNBs.[0].nr_cellid 0
--telnetsrv --telnetsrv.listenaddr 192.168.71.171
--telnetsrv.shrmod ci
--rfsimulator.serveraddr 192.168.71.190
--rfsimulator.[0].serveraddr 192.168.71.190
ASAN_OPTIONS: detect_leaks=0:detect_odr_violation=0
depends_on:
- oai-cucp-0
@@ -176,7 +176,7 @@ services:
- NET_ADMIN # for interface bringup
- NET_RAW # for ping
environment:
USE_ADDITIONAL_OPTIONS: --rfsim --rfsimulator.serveraddr server
USE_ADDITIONAL_OPTIONS: --rfsim --rfsimulator.[0].serveraddr server
--band 78 -C 3619200000 -r 106 --numerology 1 --ssb 516
--uicc0.imsi 208990100001100
--log_config.global_log_options level,nocolor,time
@@ -259,7 +259,7 @@ services:
- ALL
environment:
USE_ADDITIONAL_OPTIONS: --rfsim
--rfsimulator.serveraddr 192.168.71.190
--rfsimulator.[0].serveraddr 192.168.71.190
--log_config.global_log_options level,nocolor,time
--gNBs.[0].gNB_DU_ID 1234
--gNBs.[0].gNB_ID 0xb00
@@ -123,7 +123,7 @@ services:
- NET_ADMIN # for interface bringup
- NET_RAW # for ping
environment:
USE_ADDITIONAL_OPTIONS: --band 254 -C 2488400000 --CO -873500000 -r 25 --numerology 0 --ssb 60 --rfsim --rfsimulator.prop_delay 238.74 --rfsimulator.serveraddr 192.168.71.140 --num-ul-actors 1 --log_config.global_log_options level,nocolor,time
USE_ADDITIONAL_OPTIONS: --band 254 -C 2488400000 --CO -873500000 -r 25 --numerology 0 --ssb 60 --rfsim --rfsimulator.[0].prop_delay 238.74 --rfsimulator.[0].serveraddr 192.168.71.140 --num-ul-actors 1 --log_config.global_log_options level,nocolor,time
depends_on:
- oai-gnb
networks:
@@ -121,13 +121,10 @@ services:
- NET_RAW # for ping
environment:
USE_ADDITIONAL_OPTIONS:
--band 254 -C 2488400000 --CO -873500000 -r 25 --numerology 0 --ssb 60
--rfsim --rfsimulator.prop_delay 20 --rfsimulator.options chanmod
--rfsimulator.serveraddr 192.168.71.140
--rfsim --rfsimulator.[0].serveraddr 192.168.71.140
--time-sync-I 0.1 --ntn-initial-time-drift -46
--initial-fo 57340 --cont-fo-comp 2
--initial-fo 57340 --cont-fo-comp 3
--log_config.global_log_options level,nocolor,time
--num-ul-actors 1
depends_on:
- oai-gnb
networks:
@@ -36,7 +36,7 @@ services:
environment:
USE_ADDITIONAL_OPTIONS: --phy-test --rfsim -E
--reconfig-file etc/rrc/reconfig.raw --rbconfig-file etc/rrc/rbconfig.raw
--rfsimulator.serveraddr 192.168.71.140
--rfsimulator.[0].serveraddr 192.168.71.140
--log_config.global_log_options level,nocolor,time
--telnetsrv --telnetsrv.listenaddr 192.168.71.150 --telnetsrv.listenport 8091
--telnetsrv.shrmod ciUE
@@ -8,7 +8,7 @@ services:
- NET_ADMIN
- NET_RAW
environment:
USE_ADDITIONAL_OPTIONS: --sl-mode 2 --sync-ref 4 --rfsim --rfsimulator.serveraddr server --log_config.global_log_options level,nocolor,time
USE_ADDITIONAL_OPTIONS: --sl-mode 2 --sync-ref 4 --rfsim --rfsimulator.[0].serveraddr server --log_config.global_log_options level,nocolor,time
networks:
public_net:
ipv4_address: 192.168.71.140
@@ -33,7 +33,7 @@ services:
- NET_ADMIN # for interface bringup
- NET_RAW # for ping
environment:
USE_ADDITIONAL_OPTIONS: --sl-mode 2 --rfsim --rfsimulator.serveraddr 192.168.71.140 --log_config.global_log_options level,nocolor,time
USE_ADDITIONAL_OPTIONS: --sl-mode 2 --rfsim --rfsimulator.[0].serveraddr 192.168.71.140 --log_config.global_log_options level,nocolor,time
depends_on:
- oai-nr-ue-1
networks:
@@ -8,7 +8,7 @@ services:
- NET_ADMIN # for interface bringup
- NET_RAW # for ping
environment:
USE_ADDITIONAL_OPTIONS: --do-ra --rfsim --rfsimulator.wait_timeout 20 --noS1 --log_config.global_log_options level,nocolor,time
USE_ADDITIONAL_OPTIONS: --do-ra --rfsim --rfsimulator.[0].wait_timeout 20 --noS1 --log_config.global_log_options level,nocolor,time
ASAN_OPTIONS: detect_leaks=0
networks:
public_net:
@@ -33,7 +33,7 @@ services:
- NET_ADMIN # for interface bringup
- NET_RAW # for ping
environment:
USE_ADDITIONAL_OPTIONS: --do-ra --rfsim --noS1 --reconfig-file etc/rrc/reconfig.raw --rbconfig-file etc/rrc/rbconfig.raw --rfsimulator.serveraddr 192.168.71.140 --log_config.global_log_options level,nocolor,time
USE_ADDITIONAL_OPTIONS: --do-ra --rfsim --noS1 --reconfig-file etc/rrc/reconfig.raw --rbconfig-file etc/rrc/rbconfig.raw --rfsimulator.[0].serveraddr 192.168.71.140 --log_config.global_log_options level,nocolor,time
ASAN_OPTIONS: detect_leaks=0
devices:
- /dev/net/tun:/dev/net/tun
@@ -149,7 +149,7 @@ services:
- NET_RAW # for ping
environment:
USE_ADDITIONAL_OPTIONS: --rfsim -r 25 --numerology 0 --uicc0.imsi 208990100001100 --band 66 -C 2152680000 --CO -400000000 --ssb 48
--rfsimulator.serveraddr 192.168.71.141 --extra-pdu-id 2 --log_config.global_log_options level,nocolor,time
--rfsimulator.[0].serveraddr 192.168.71.141 --extra-pdu-id 2 --log_config.global_log_options level,nocolor,time
--telnetsrv --telnetsrv.shrmod ciUE --telnetsrv.listenaddr 192.168.71.150 --telnetsrv.listenport 8091
ASAN_OPTIONS: detect_leaks=0:detect_odr_violation=0
depends_on:
+1 -1
View File
@@ -65,7 +65,7 @@ Note: only LTTng 2.3.8 is supported.
1. **Run gNB:**
```bash
./$binary_path -O $configuration_file PARALLEL_SINGLE_THREAD --rfsimulator.serveraddr server --rfsim -E
./$binary_path -O $configuration_file PARALLEL_SINGLE_THREAD --rfsimulator.[0].serveraddr server --rfsim -E
```
## Verifying Tracepoints
+2 -2
View File
@@ -275,9 +275,9 @@ The web server back-end is using the [oai configuration module](Config/Rtusage).
## running the back-end
To trigger the back-end use the `--websrv` option, possibly modifying the parameters as explained in the [previous section](./websrvuse.md#web-server-parameters). The two following commands allow starting the oai gNB and the oai 5G UE on the same computer, starting the telnet server and the web interface on both executables.
`./nr-softmodem -O /usr/local/oai/conf/gnb.band78.sa.fr1.106PRB.usrpb210.conf --rfsim --rfsimulator.serveraddr server --telnetsrv --telnetsrv.listenstdin --websrv --rfsimulator.options chanmod`
`./nr-softmodem -O /usr/local/oai/conf/gnb.band78.sa.fr1.106PRB.usrpb210.conf --rfsim --rfsimulator.[0].serveraddr server --telnetsrv --telnetsrv.listenstdin --websrv --rfsimulator.[0].options chanmod`
`./nr-uesoftmodem -O /usr/local/oai/conf/nrue_sim.conf --numerology 1 -r 106 -C 3649440000 --rfsim --rfsimulator.serveraddr 127.0.0.1 --websrv --telnetsrv --websrv.listenport 8092 --telnetsrv.listenport 8091`
`./nr-uesoftmodem -O /usr/local/oai/conf/nrue_sim.conf --numerology 1 -r 106 -C 3649440000 --rfsim --rfsimulator.[0].serveraddr 127.0.0.1 --websrv --telnetsrv --websrv.listenport 8092 --telnetsrv.listenport 8091`
+1 -1
View File
@@ -162,7 +162,7 @@ You need to use `--rfsim` if you are running the test with rfsimulator.
OAI UE:
```
sudo ./nr-uesoftmodem -r 106 --numerology 1 --band 78 -C 3619200000 --rfsim --rfsimulator.serveraddr 127.0.0.1
sudo ./nr-uesoftmodem -r 106 --numerology 1 --band 78 -C 3619200000 --rfsim --rfsimulator.[0].serveraddr 127.0.0.1
```
## 3. Configuration file IP addresses of network functions
+2 -2
View File
@@ -149,13 +149,13 @@ Example command using rfsim:
```bash
cd ~/openairinterface5g/cmake_targets/ran_build/build
sudo ./nr-uesoftmodem --rfsim -r 106 --numerology 1 --band 78 -C 3319680000 --ue-nb-ant-tx 1 --ue-nb-ant-rx 1 -O ../../../ci-scripts/conf_files/nrue1.uicc.cluCN.conf --rfsimulator.serveraddr 10.201.1.100 --loader.ldpc.shlibversion _xdma --nrLDPC_coding_xdma.num_threads_prepare 2
sudo ./nr-uesoftmodem --rfsim -r 106 --numerology 1 --band 78 -C 3319680000 --ue-nb-ant-tx 1 --ue-nb-ant-rx 1 -O ../../../ci-scripts/conf_files/nrue1.uicc.cluCN.conf --rfsimulator.[0].serveraddr 10.201.1.100 --loader.ldpc.shlibversion _xdma --nrLDPC_coding_xdma.num_threads_prepare 2
```
or
```bash
sudo ./nr-uesoftmodem --rfsim -r 106 --numerology 1 --band 78 -C 3319680000 --ue-nb-ant-tx 1 --ue-nb-ant-rx 1 -O ../../../ci-scripts/conf_files/nrue1.uicc.cluCN.conf --rfsimulator.serveraddr 10.201.1.100
sudo ./nr-uesoftmodem --rfsim -r 106 --numerology 1 --band 78 -C 3319680000 --ue-nb-ant-tx 1 --ue-nb-ant-rx 1 -O ../../../ci-scripts/conf_files/nrue1.uicc.cluCN.conf --rfsimulator.[0].serveraddr 10.201.1.100
```
if you have added the configuration to the `.conf` file.
+2 -2
View File
@@ -39,7 +39,7 @@ Important notes:
2. After entering the bash environment, run the following command to deploy your first UE
```bash
sudo ./nr-uesoftmodem -O ../../../targets/PROJECTS/GENERIC-NR-5GC/CONF/ue.conf -r 106 --numerology 1 --band 78 -C 3619200000 --rfsim --uicc0.imsi 001010000000001 --rfsimulator.options chanmod --rfsimulator.serveraddr 10.201.1.100 --telnetsrv --telnetsrv.listenport 9095
sudo ./nr-uesoftmodem -O ../../../targets/PROJECTS/GENERIC-NR-5GC/CONF/ue.conf -r 106 --numerology 1 --band 78 -C 3619200000 --rfsim --uicc0.imsi 001010000000001 --rfsimulator.[0].options chanmod --rfsimulator.[0].serveraddr 10.201.1.100 --telnetsrv --telnetsrv.listenport 9095
```
3. For the second UE, create the namespace ue2 (`-c2`), then execute shell inside (`-o2`, "open"):
@@ -52,7 +52,7 @@ Important notes:
4. After entering the bash environment, run the following command to deploy your second UE:
```bash
sudo ./nr-uesoftmodem -O ../../../targets/PROJECTS/GENERIC-NR-5GC/CONF/ue.conf -r 106 --numerology 1 --band 78 -C 3619200000 --rfsim --uicc0.imsi 001010000000002 --rfsimulator.options chanmod --rfsimulator.serveraddr 10.202.1.100 --telnetsrv --telnetsrv.listenport 9096
sudo ./nr-uesoftmodem -O ../../../targets/PROJECTS/GENERIC-NR-5GC/CONF/ue.conf -r 106 --numerology 1 --band 78 -C 3619200000 --rfsim --uicc0.imsi 001010000000002 --rfsimulator.[0].options chanmod --rfsimulator.[0].serveraddr 10.202.1.100 --telnetsrv --telnetsrv.listenport 9096
```
in the command above, please note that the IMSI and the telnet port changed.
+1 -1
View File
@@ -191,7 +191,7 @@ The UE configuration must match the one of the network's AMF. The nrUE can conne
When running the `nr-uesoftmodem`, one can specify the nrUE configuration file using the `-O` option. E.g.:
```bash
sudo ./nr-uesoftmodem --rfsim --rfsimulator.serveraddr 127.0.0.1 -r 106 --numerology 1 --band 78 -C 3619200000 -O ~/nrue.uicc.conf
sudo ./nr-uesoftmodem --rfsim --rfsimulator.[0].serveraddr 127.0.0.1 -r 106 --numerology 1 --band 78 -C 3619200000 -O ~/nrue.uicc.conf
```
The CL option `--uicc0.imsi` can override the IMSI value in the configuration file if necessary (e.g. when running multiple UEs): `--uicc0.imsi 001010000000001`.
+104 -6
View File
@@ -140,6 +140,104 @@ You can view all available options by typing:
```shell
./nr-uesoftmodem --help
```
### NR UE: Configure multiple RF-frontends (RUs)
Multiple RF-frontends (also called RUs) can be defined for the nr-uesoftmodem.
Therefore, two sections in the NR UE configuration file are used:
- `RUs`
- `cells`
The `RUs` section in the NR UE configuration file contains an array of elements, where each element has these properies:
| Property name | Type | Default value | Description |
| ---------------- | -------------- | ------------- | ------------------------------------ |
| nb_tx | integer | 1 | Number of TX Antennas |
| nb_rx | integer | 1 | Number of RX Antennas |
| att_tx | integer | 0 | TX Attenuation in dB |
| att_rx | integer | 0 | RX Attenuation in dB |
| max_rxgain | integer | 120 | Maximum RX Gain at 0 dB Attenuation |
| sdr_addrs | string | type=b200 | SDR Parameter String |
| tx_subdev | string | | SDR TX Subdevice |
| rx_subdev | string | | SDR RX Subdevice |
| clock_src | string | internal | SDR Clock Source |
| time_src | string | internal | SDR Time Source |
| tune_offset | floating point | 0.0 | SDR Tune Offset in Hz |
| if_freq | integer | 0 | DL Intermediate Frequency in Hz |
| if_offset | integer | 0 | UL Intermediate Frequency Offset in Hz |
The `cells` section in the NR UE configuration file contains an array of elements, where each element has these properies:
| Property name | Type | Default value | Description |
| ---------------- | ------- | ------------- | ---------------------------------------- |
| ru_id | integer | 0 | ID of the associated RU from the `RUs` section |
| band | integer | 78 | 5G NR Band |
| rf_freq | integer | 0 | DL Carrier Centre Frequency in Hz |
| rf_offset | integer | 0 | DL Carrier Centre Frequency Offset in Hz |
| numerology | integer | 1 | 5G NR Numerology (µ) |
| N_RB_DL | integer | 106 | Number of DL Carrier Ressource Blocks |
| ssb_start | integer | 516 | Ressource Element where the SSB Starts |
There are different scenarios where multiple RF-frontends (also called RUs) are beneficial for the NR UE:
1. RF-Simulator Inter-Frequency Handover between multiple cells
2. Multiple UEs in one instance, each using their own RF-frontend (RF-Simulator connection)
3. Different Antennas connected to different RF-ports
4. Concurrent connection to multiple carriers (carrier aggregation CA)
This would be and example configuration for the 1. scenario:
```
rfsimulator = (
{
serveraddr = "127.0.0.2";
serverport = 4043;
}, {
serveraddr = "127.0.0.3";
serverport = 4044;
}
);
RUs = (
{
nb_tx = 1;
nb_rx = 1;
}, {
nb_tx = 1;
nb_rx = 1;
}
);
cells = (
{
ru_id = 0;
band = 78;
rf_freq = 3619200000L;
numerology = 1;
N_RB_DL = 106;
ssb_start = 516;
}, {
ru_id = 1;
band = 78;
rf_freq = 3649440000L;
numerology = 1;
N_RB_DL = 106;
ssb_start = 516;
}
);
```
An example for the 2. scenario can be found in the file [ci-scripts/yaml_files/5g_rfsimulator_multiue/nrue.uicc.conf](../ci-scripts/yaml_files/5g_rfsimulator_multiue/nrue.uicc.conf).
The 3. scenario is similar to 1., but instead of providing RF-Simulator parameters, actual SDR parameters have to be provided.
The 4. scenario is not supported, as the NR UE does not implement CA, yet.
Current Limitations:
- Each RU can be used by only one cell.
- Each RU and cell can be used by only one UE (no RU sharing implemented, yet).
- The sampling rates of all RUs must be the same.
### Common gNB and NR UE command line options
#### Three-quarter sampling
@@ -174,7 +272,7 @@ Therefore either SDR boards and a dedicated NTN channel emulator are required, o
As shown on the [rfsimulator page](../radio/rfsimulator/README.md), RFsimulator provides different possibilities.
E.g. to perform a simple simulation of a satellite in geostationary orbit (GEO), these parameters should be added to both gNB and UE command lines:
```
--rfsimulator.prop_delay 238.74
--rfsimulator.[0].prop_delay 238.74
```
For simulation of a satellite in low earth orbit (LEO), two channel models have been added to rfsimulator:
@@ -210,7 +308,7 @@ This can be done by either providing this line in the conf file in section `rfsi
```
Or by providing this the the command line parameters:
```
--rfsimulator.options chanmod
--rfsimulator.[0].options chanmod
```
#### gNB
@@ -338,7 +436,7 @@ position0 = {
So an example NR UE command for FDD, 5MHz BW, 15 kHz SCS, transparent GEO satellite 5G NR NTN is this:
```
cd cmake_targets
sudo ./ran_build/build/nr-uesoftmodem -O ../targets/PROJECTS/GENERIC-NR-5GC/CONF/ue.conf --band 254 -C 2488400000 --CO -873500000 -r 25 --numerology 0 --ssb 60 --rfsim --rfsimulator.prop_delay 238.74
sudo ./ran_build/build/nr-uesoftmodem -O ../targets/PROJECTS/GENERIC-NR-5GC/CONF/ue.conf --band 254 -C 2488400000 --CO -873500000 -r 25 --numerology 0 --ssb 60 --rfsim --rfsimulator.[0].prop_delay 238.74
```
For LEO satellite scenarios, the parameter `--ntn-initial-time-drift` must be provided via command line, as the UE needs this value to compensate for the time drift during initial sync, before SIB19 was received.
@@ -356,7 +454,7 @@ For other information on optional NR UE command line options, please refer [here
So an example NR UE command for FDD, 5MHz BW, 15 kHz SCS, transparent LEO satellite 5G NR NTN is this:
```
cd cmake_targets
sudo ./ran_build/build/nr-uesoftmodem -O ../targets/PROJECTS/GENERIC-NR-5GC/CONF/ue.conf --band 254 -C 2488400000 --CO -873500000 -r 25 --numerology 0 --ssb 60 --rfsim --rfsimulator.prop_delay 20 --rfsimulator.options chanmod --time-sync-I 0.1 --ntn-initial-time-drift -46 --initial-fo 57340 --cont-fo-comp 2
sudo ./ran_build/build/nr-uesoftmodem -O ../targets/PROJECTS/GENERIC-NR-5GC/CONF/ue.conf --band 254 -C 2488400000 --CO -873500000 -r 25 --numerology 0 --ssb 60 --rfsim --rfsimulator.[0].prop_delay 20 --rfsimulator.[0].options chanmod --time-sync-I 0.1 --ntn-initial-time-drift -46 --initial-fo 57340 --cont-fo-comp 2
```
## Specific OAI modes
@@ -381,7 +479,7 @@ sudo ./nr-uesoftmodem --phy-test [--reconfig-file ../../../ci-scripts/rrc-files/
In summary:
- If you are running on the same machine and launched the 2 executables (`nr-softmodem` and `nr-uesoftmodem`) from the same directory, nothing has to be done.
- If you launched the 2 executables from 2 different folders, just point to the location where you launched the `nr-softmodem`:
* `sudo ./nr-uesoftmodem --rfsim --phy-test --reconfig-file /the/path/where/you/launched/nr-softmodem/reconfig-file --rbconfig-file /the/path/where/you/launched/nr-softmodem/rbconfig-file --rfsimulator.serveraddr <TARGET_GNB_INTERFACE_ADDRESS>`
* `sudo ./nr-uesoftmodem --rfsim --phy-test --reconfig-file /the/path/where/you/launched/nr-softmodem/reconfig-file --rbconfig-file /the/path/where/you/launched/nr-softmodem/rbconfig-file --rfsimulator.[0].serveraddr <TARGET_GNB_INTERFACE_ADDRESS>`
- If you are not running on the same machine, you need to **COPY** the two raw files
* `scp usera@machineA:/the/path/where/you/launched/nr-softmodem/r*config.raw userb@machineB:/the/path/where/you/will/launch/nr-uesoftmodem/`
* Obviously this operation should be done before launching the `nr-uesoftmodem` executable.
@@ -428,7 +526,7 @@ To run using the RFsimulator:
```bash
sudo ./nr-softmodem -O ../../../targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.106PRB.usrpn300.conf --do-ra --rfsim
sudo ./nr-uesoftmodem --do-ra --rfsim --rfsimulator.serveraddr 127.0.0.1
sudo ./nr-uesoftmodem --do-ra --rfsim --rfsimulator.[0].serveraddr 127.0.0.1
```
Using USRPs:
+2 -2
View File
@@ -101,7 +101,7 @@ If **N310 USRPs** are used, then run above command `without -E option` i.e witho
To run using **rfsimulator** with local ETH IF `127.0.0.1`, execute following command:
```
sudo ./nr-uesoftmodem --rfsim --phy-test --noS1 -O ../../../targets/PROJECTS/GENERIC-NR-5GC/CONF/ue.nr.prs.fr1.106prb.conf --rfsimulator.serveraddr 127.0.0.1
sudo ./nr-uesoftmodem --rfsim --phy-test --noS1 -O ../../../targets/PROJECTS/GENERIC-NR-5GC/CONF/ue.nr.prs.fr1.106prb.conf --rfsimulator.[0].serveraddr 127.0.0.1
```
### FR2 test
@@ -115,7 +115,7 @@ If RF beamforming module is NOT present, nrUE can still be launched with USRP al
To run using **rfsimulator** with local ETH IF `127.0.0.1`, execute following command:
```
sudo ./nr-uesoftmodem --rfsim --phy-test --noS1 -O ../../../targets/PROJECTS/GENERIC-NR-5GC/CONF/ue.nr.prs.fr2.64prb.conf --rfsimulator.serveraddr 127.0.0.1
sudo ./nr-uesoftmodem --rfsim --phy-test --noS1 -O ../../../targets/PROJECTS/GENERIC-NR-5GC/CONF/ue.nr.prs.fr2.64prb.conf --rfsimulator.[0].serveraddr 127.0.0.1
```
### Multiple gNB scenario
+2 -2
View File
@@ -239,7 +239,7 @@ sudo ./cmake_targets/ran_build/build/nr-softmodem -O ./targets/PROJECTS/GENERIC-
```
Run NR gNB Softmodem in RF Simulation:
```
sudo ./cmake_targets/ran_build/build/nr-softmodem -O ./targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.band78.sa.fr1.106PRB.1x1.usrpx410_3300MHz.conf --gNBs.[0].min_rxtxtime 6 --rfsim --rfsimulator.serveraddr server --phy-test -d --T_stdout 2 --T_nowait
sudo ./cmake_targets/ran_build/build/nr-softmodem -O ./targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.band78.sa.fr1.106PRB.1x1.usrpx410_3300MHz.conf --gNBs.[0].min_rxtxtime 6 --rfsim --rfsimulator.[0].serveraddr server --phy-test -d --T_stdout 2 --T_nowait
```
> **Note:** User needs to change the name of gNB config file to your gNB config file.
@@ -265,7 +265,7 @@ sudo ./cmake_targets/ran_build/build/nr-uesoftmodem --usrp-args "type=x4xx,addr=
Run OAI Soft UE in RF Simulation, assume the IP address of gNB server is `192.168.100.2`:
```
sudo ./cmake_targets/ran_build/build/nr-uesoftmodem --rfsim --rfsimulator.serveraddr 192.168.100.2 --phy-test -O ./targets/PROJECTS/GENERIC-NR-5GC/CONF/ue.conf --reconfig-file /home/user/workarea/rrc_files/reconfig.raw --rbconfig-file /home/user/workarea/rrc_files/rbconfig.raw --T_stdout 2 --T_nowait --T_port 2023
sudo ./cmake_targets/ran_build/build/nr-uesoftmodem --rfsim --rfsimulator.[0].serveraddr 192.168.100.2 --phy-test -O ./targets/PROJECTS/GENERIC-NR-5GC/CONF/ue.conf --reconfig-file /home/user/workarea/rrc_files/reconfig.raw --rbconfig-file /home/user/workarea/rrc_files/rbconfig.raw --T_stdout 2 --T_nowait --T_port 2023
```
### Step3: Run Data Recording Application Services
+6 -6
View File
@@ -76,7 +76,7 @@ Start the CU including telnet support:
Start DU0:
sudo ./nr-softmodem --rfsim -O ../../../targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb-du.sa.band78.106prb.rfsim.pci0.conf --rfsimulator.serveraddr 127.0.0.1
sudo ./nr-softmodem --rfsim -O ../../../targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb-du.sa.band78.106prb.rfsim.pci0.conf --rfsimulator.[0].serveraddr 127.0.0.1
This will show an error `[HW] connect() to 127.0.0.1:4043 failed,
errno(111)`. _This is expected_, because the RFsim server is at the UE (to be
@@ -84,7 +84,7 @@ able to serve two RFsim clients, one DU each; see below for more info). Proceed
by starting the UE, and let it connect completely (this should make the error
go away):
sudo ./nr-uesoftmodem -C 3450720000 -r 106 --numerology 1 --ssb 516 -O <config> --rfsim --rfsimulator.serveraddr server
sudo ./nr-uesoftmodem -C 3450720000 -r 106 --numerology 1 --ssb 516 -O <config> --rfsim --rfsimulator.[0].serveraddr server
Note how the RFsimulator roles have been switched, and RFsim server is at the
UE side; _this is important_. Replace `<config>` with the UE configuration
@@ -93,7 +93,7 @@ matching your core. If you followed the CN and oaiUE tutorials, you can remove
Once the UE is connected, start DU1:
sudo ./nr-softmodem --rfsim -O ../../../targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb-du.sa.band78.106prb.rfsim.pci1.conf --rfsimulator.serveraddr 127.0.0.1
sudo ./nr-softmodem --rfsim -O ../../../targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb-du.sa.band78.106prb.rfsim.pci1.conf --rfsimulator.[0].serveraddr 127.0.0.1
Once DU1 is online, you can trigger a handover by issuing this command
@@ -461,13 +461,13 @@ Run the 5G Core Network if not already running.
2. Start the source gNB (gNB-PCI0) e.g.
```sh
sudo ./nr-softmodem -O ../../../targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.pci0.rfsim.conf --telnetsrv --telnetsrv.shrmod ci --gNBs.[0].min_rxtxtime 6 --rfsim --rfsimulator.serveraddr 127.0.0.1
sudo ./nr-softmodem -O ../../../targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.pci0.rfsim.conf --telnetsrv --telnetsrv.shrmod ci --gNBs.[0].min_rxtxtime 6 --rfsim --rfsimulator.[0].serveraddr 127.0.0.1
```
3. Start the UE e.g.
```sh
sudo ./nr-uesoftmodem -r 106 --numerology 1 --band 78 -C 3619200000 --rfsim --uicc0.imsi 001010000000001 -O ../../../ci-scripts/conf_files/nrue.uicc.conf --rfsimulator.serveraddr server
sudo ./nr-uesoftmodem -r 106 --numerology 1 --band 78 -C 3619200000 --rfsim --uicc0.imsi 001010000000001 -O ../../../ci-scripts/conf_files/nrue.uicc.conf --rfsimulator.[0].serveraddr server
```
Ensure the UE successfully registers with the network.
@@ -475,7 +475,7 @@ Ensure the UE successfully registers with the network.
4. Start the target gNB (gNB-PCI1) e.g.
```sh
sudo ./nr-softmodem -O ../../../targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.pci1.rfsim.conf --rfsim --telnetsrv --telnetsrv.shrmod ci --gNBs.[0].min_rxtxtime 6 --rfsimulator.serveraddr 127.0.0.1
sudo ./nr-softmodem -O ../../../targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.pci1.rfsim.conf --rfsim --telnetsrv --telnetsrv.shrmod ci --gNBs.[0].min_rxtxtime 6 --rfsimulator.[0].serveraddr 127.0.0.1
```
**Note for same-machine setup:** When running both gNBs on the same machine,
+1 -1
View File
@@ -238,7 +238,7 @@ Run cu_stu and ric_stub in separate terminals
Run the OAI PNF first, as it is the WLS memory master
sudo NFAPI_TRACE_LEVEL=info ./nr-softmodem -O ../../../targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb-pnf.band78.rfsim.2x2.conf --nfapi PNF --rfsim --rfsimulator.serveraddr server
sudo NFAPI_TRACE_LEVEL=info ./nr-softmodem -O ../../../targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb-pnf.band78.rfsim.2x2.conf --nfapi PNF --rfsim --rfsimulator.[0].serveraddr server
Run the O-DU over GDB
+2 -2
View File
@@ -390,7 +390,7 @@ void fh_if5_north_asynch_in(RU_t *ru,
LTE_DL_FRAME_PARMS *fp = ru->frame_parms;
RU_proc_t *proc = &ru->proc;
int tti_tx,frame_tx;
openair0_timestamp timestamp_tx=0;
openair0_timestamp_t timestamp_tx = 0;
//recv_IF5(ru, &timestamp_tx, *subframe, IF5_RRH_GW_DL);
// LOG_I(PHY,"Received subframe %d (TS %llu) from RCC\n",tti_tx,timestamp_tx);
tti_tx = (timestamp_tx/fp->samples_per_tti)%10;
@@ -540,7 +540,7 @@ void rx_rf(RU_t *ru,
unsigned int rxs;
int i;
int resynch=0;
openair0_timestamp ts=0,old_ts=0;
openair0_timestamp_t ts = 0, old_ts = 0;
for (i=0; i<ru->nb_rx; i++)
rxp[i] = (void *)&ru->common.rxdata[i][*subframe*fp->samples_per_tti];
+3 -2
View File
@@ -1686,7 +1686,8 @@ static void *UE_phy_stub_thread_rxn_txnp4(void *arg)
* \param arg unused
* \returns a pointer to an int. The storage is not on the heap and must not be freed.
*/
void write_dummy(PHY_VARS_UE *UE, openair0_timestamp timestamp) {
void write_dummy(PHY_VARS_UE *UE, openair0_timestamp_t timestamp)
{
// we have to write to tell explicitly to the eNB, else it will wait for us forever
// we write the next subframe (always write in future of what we received)
//
@@ -1709,7 +1710,7 @@ void *UE_thread(void *arg) {
PHY_VARS_UE *UE = (PHY_VARS_UE *) arg;
// int tx_enabled = 0;
int dummy_rx[UE->frame_parms.nb_antennas_rx][UE->frame_parms.samples_per_tti] __attribute__((aligned(32)));
openair0_timestamp timestamp,timestamp1;
openair0_timestamp_t timestamp, timestamp1;
void *rxp[NB_ANTENNAS_RX], *txp[NB_ANTENNAS_TX];
int start_rx_stream = 0;
int i;
+2 -2
View File
@@ -570,10 +570,10 @@ static void rx_rf(RU_t *ru, int *frame, int *slot)
rxp[i] = (void *)&ru->common.rxdata[i][get_samples_slot_timestamp(fp, *slot)];
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_TRX_READ, 1);
openair0_timestamp old_ts = proc->timestamp_rx;
openair0_timestamp_t old_ts = proc->timestamp_rx;
LOG_D(PHY,"Reading %d samples for slot %d (%p)\n", samples_per_slot, *slot, rxp[0]);
openair0_timestamp ts;
openair0_timestamp_t ts;
unsigned int rxs;
rxs = ru->rfdevice.trx_read_func(&ru->rfdevice, &ts, rxp, samples_per_slot, nb);
-1
View File
@@ -38,7 +38,6 @@
#define CONFIG_HLP_CALPRACH "UE run normal prach with maximum power, but don't continue random-access\n"
#define CONFIG_HLP_NOL2CN "bypass L2 and upper layers\n"
#define CONFIG_HLP_UERXG "set UE RX gain\n"
#define CONFIG_HLP_UERXGOFF "external UE amplifier offset\n"
#define CONFIG_HLP_UETXG "set UE TX gain\n"
#define CONFIG_HLP_UENANTR "set UE number of rx antennas\n"
#define CONFIG_HLP_UENANTT "set UE number of tx antennas\n"
-4
View File
@@ -114,9 +114,6 @@ double tx_gain[MAX_NUM_CCs][4] = {{20,0,0,0},{20,0,0,0}};
double rx_gain[MAX_NUM_CCs][4] = {{110,0,0,0},{20,0,0,0}};
#endif
double rx_gain_off = 0.0;
static int tx_max_power[MAX_NUM_CCs]; /* = {0,0}*/;
int chain_offset = 0;
int numerology = 0;
double cpuf;
@@ -527,7 +524,6 @@ int main( int argc, char **argv ) {
setvbuf(stderr, NULL, _IONBF, 0);
#endif
mode = normal_txrx;
memset(tx_max_power,0,sizeof(int)*MAX_NUM_CCs);
logInit();
lock_memory_to_ram();
get_options(uniqCfg);
+2 -2
View File
@@ -23,8 +23,8 @@
{"t" , CONFIG_HLP_ULMCS_PHYTEST, 0, .uptr=&target_ul_mcs, .defintval=0, TYPE_UINT, 0}, \
{"M" , CONFIG_HLP_DLBW_PHYTEST, 0, .uptr=&target_dl_bw, .defintval=0, TYPE_UINT, 0}, \
{"T" , CONFIG_HLP_ULBW_PHYTEST, 0, .uptr=&target_ul_bw, .defintval=0, TYPE_UINT, 0}, \
{"D" , CONFIG_HLP_DLBM_PHYTEST, 0, .u64ptr=&dlsch_slot_bitmap, .defintval=0, TYPE_UINT64, 0}, \
{"U" , CONFIG_HLP_ULBM_PHYTEST, 0, .u64ptr=&ulsch_slot_bitmap, .defintval=0, TYPE_UINT64, 0}, \
{"D" , CONFIG_HLP_DLBM_PHYTEST, 0, .u64ptr=&dlsch_slot_bitmap, .defint64val=0, TYPE_UINT64, 0}, \
{"U" , CONFIG_HLP_ULBM_PHYTEST, 0, .u64ptr=&ulsch_slot_bitmap, .defint64val=0, TYPE_UINT64, 0}, \
{"usrp-tx-thread-config", CONFIG_HLP_USRP_THREAD, 0, .iptr=&usrp_tx_thread, .defstrval=0, TYPE_INT, 0}, \
{"uecap_file", CONFIG_HLP_UECAP_FILE, 0, .strptr=&uecap_file, .defstrval="./uecap_ports1.xml", TYPE_STRING, 0}, \
}
+528
View File
@@ -0,0 +1,528 @@
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.0 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
#include "nr-ue-ru.h"
#include "nr-uesoftmodem.h"
#include "PHY/NR_UE_TRANSPORT/nr_transport_proto_ue.h"
/* NR UE RU configuration section name */
#define CONFIG_STRING_NRUE_RU_LIST "RUs"
#define NRUE_RU_NB_TX "nb_tx"
#define NRUE_RU_NB_RX "nb_rx"
#define NRUE_RU_ATT_TX "att_tx"
#define NRUE_RU_ATT_RX "att_rx"
#define NRUE_RU_MAX_RXGAIN "max_rxgain"
#define NRUE_RU_SDR_ADDRS "sdr_addrs"
#define NRUE_RU_TX_SUBDEV "tx_subdev"
#define NRUE_RU_RX_SUBDEV "rx_subdev"
#define NRUE_RU_CLOCK_SRC "clock_src"
#define NRUE_RU_TIME_SRC "time_src"
#define NRUE_RU_TUNE_OFFSET "tune_offset"
#define NRUE_RU_IF_FREQUENCY "if_freq"
#define NRUE_RU_IF_FREQ_OFFSET "if_offset"
#define NRUE_RU_SRC_CHECK \
&(checkedparam_t) \
{ \
.s3a = { config_checkstr_assign_integer, {"internal", "external", "gpsdo"}, {internal, external, gpsdo}, 3 } \
}
/*------------------------------------------------------------------------------------------------------------------------------------------------*/
/* NR UE RU configuration parameters */
/* optname helpstr paramflags XXXptr defXXXval type numelt chkPptr */
/*------------------------------------------------------------------------------------------------------------------------------------------------*/
// clang-format off
#define NRUE_RU_PARAMS_DESC { \
{NRUE_RU_NB_TX, CONFIG_HLP_UENANTT, 0, .uptr=NULL, .defuintval=1, TYPE_UINT, 0, NULL }, \
{NRUE_RU_NB_RX, CONFIG_HLP_UENANTR, 0, .uptr=NULL, .defuintval=1, TYPE_UINT, 0, NULL }, \
{NRUE_RU_ATT_TX, NULL, 0, .uptr=NULL, .defuintval=0, TYPE_UINT, 0, NULL }, \
{NRUE_RU_ATT_RX, NULL, 0, .uptr=NULL, .defuintval=0, TYPE_UINT, 0, NULL }, \
{NRUE_RU_MAX_RXGAIN, NULL, 0, .iptr=NULL, .defintval=120, TYPE_INT, 0, NULL }, \
{NRUE_RU_SDR_ADDRS, CONFIG_HLP_USRP_ARGS, 0, .strptr=NULL, .defstrval="type=b200", TYPE_STRING, 0, NULL }, \
{NRUE_RU_TX_SUBDEV, CONFIG_HLP_TX_SUBDEV, 0, .strptr=NULL, .defstrval="", TYPE_STRING, 0, NULL }, \
{NRUE_RU_RX_SUBDEV, CONFIG_HLP_RX_SUBDEV, 0, .strptr=NULL, .defstrval="", TYPE_STRING, 0, NULL }, \
{NRUE_RU_CLOCK_SRC, NULL, 0, .strptr=NULL, .defstrval="internal", TYPE_STRING, 0, NRUE_RU_SRC_CHECK }, \
{NRUE_RU_TIME_SRC, NULL, 0, .strptr=NULL, .defstrval="internal", TYPE_STRING, 0, NRUE_RU_SRC_CHECK }, \
{NRUE_RU_TUNE_OFFSET, CONFIG_HLP_TUNE_OFFSET, 0, .dblptr=NULL, .defdblval=0.0, TYPE_DOUBLE, 0, NULL }, \
{NRUE_RU_IF_FREQUENCY, CONFIG_HLP_IF_FREQ, 0, .u64ptr=NULL, .defint64val=0, TYPE_UINT64, 0, NULL }, \
{NRUE_RU_IF_FREQ_OFFSET, CONFIG_HLP_IF_FREQ_OFF, 0, .iptr=NULL, .defintval=0, TYPE_INT, 0, NULL }, \
}
// clang-format on
/* NR UE cell configuration section name */
#define CONFIG_STRING_NRUE_CELL_LIST "cells"
#define NRUE_CELL_RU_ID "ru_id"
#define NRUE_CELL_BAND "band"
#define NRUE_CELL_RF_FREQUENCY "rf_freq"
#define NRUE_CELL_RF_FREQ_OFFSET "rf_offset"
#define NRUE_CELL_NUMEROLOGY "numerology"
#define NRUE_CELL_N_RB_DL "N_RB_DL"
#define NRUE_CELL_SSB_START "ssb_start"
/*------------------------------------------------------------------------------------------------------------------------------------------------*/
/* NR UE cell configuration parameters */
/* optname helpstr paramflags XXXptr defXXXval type numelt chkPptr */
/*------------------------------------------------------------------------------------------------------------------------------------------------*/
// clang-format off
#define NRUE_CELL_PARAMS_DESC { \
{NRUE_CELL_RU_ID, NULL, 0, .iptr=NULL, .defintval=0, TYPE_INT, 0, NULL }, \
{NRUE_CELL_BAND, CONFIG_HLP_BAND, 0, .iptr=NULL, .defintval=78, TYPE_INT, 0, NULL }, \
{NRUE_CELL_RF_FREQUENCY, CONFIG_HLP_DLF, 0, .u64ptr=NULL, .defint64val=0, TYPE_UINT64, 0, NULL }, \
{NRUE_CELL_RF_FREQ_OFFSET, CONFIG_HLP_ULF, 0, .i64ptr=NULL, .defint64val=0, TYPE_INT64, 0, NULL }, \
{NRUE_CELL_NUMEROLOGY, CONFIG_HLP_NUMEROLOGY, 0, .iptr=NULL, .defintval=1, TYPE_INT, 0, NULL }, \
{NRUE_CELL_N_RB_DL, CONFIG_HLP_PRB_SA, 0, .iptr=NULL, .defintval=106, TYPE_INT, 0, NULL }, \
{NRUE_CELL_SSB_START, CONFIG_HLP_SSC, 0, .iptr=NULL, .defintval=516, TYPE_INT, 0, NULL }, \
}
// clang-format on
static int nrue_cell_count;
static nrUE_cell_params_t *nrue_cells;
static NR_DL_FRAME_PARMS *nrue_cell_fp;
static int nrue_ru_count;
static nrUE_RU_params_t *nrue_rus;
openair0_config_t openair0_cfg[MAX_CARDS];
openair0_device_t openair0_dev[MAX_CARDS];
int nrue_get_cell_count(void)
{
return nrue_cell_count;
}
const nrUE_cell_params_t *nrue_get_cell(int cell_id)
{
AssertFatal(cell_id >= 0 && cell_id < nrue_cell_count, "Invalid cell ID %d! Cell count = %d\n", cell_id, nrue_cell_count);
return &nrue_cells[cell_id];
}
NR_DL_FRAME_PARMS *nrue_get_cell_fp(int cell_id)
{
AssertFatal(cell_id >= 0 && cell_id < nrue_cell_count, "Invalid cell ID %d! Cell count = %d\n", cell_id, nrue_cell_count);
return &nrue_cell_fp[cell_id];
}
void nrue_set_cell(int cell_id, const nrUE_cell_params_t *cell)
{
AssertFatal(cell_id >= 0 && cell_id < nrue_cell_count, "Invalid cell ID %d! Cell count = %d\n", cell_id, nrue_cell_count);
nrue_cells[cell_id] = *cell;
}
void nrue_set_cell_params(configmodule_interface_t *cfg)
{
paramdef_t cellParams[] = NRUE_CELL_PARAMS_DESC;
paramlist_def_t cellParamList = {CONFIG_STRING_NRUE_CELL_LIST, NULL, 0};
config_getlist(cfg, &cellParamList, cellParams, sizeofArray(cellParams), NULL);
if (cellParamList.numelt <= 0) {
nrue_cell_count = 1;
nrue_cell_fp = calloc_or_fail(nrue_cell_count, sizeof(NR_DL_FRAME_PARMS));
nrue_cells = calloc_or_fail(nrue_cell_count, sizeof(nrUE_cell_params_t));
nrue_cells[0] = (nrUE_cell_params_t){.ru_id = 0,
.band = get_softmodem_params()->band,
.rf_frequency = downlink_frequency[0][0],
.rf_freq_offset = uplink_frequency_offset[0][0],
.numerology = get_softmodem_params()->numerology,
.N_RB_DL = get_nrUE_params()->N_RB_DL,
.ssb_start = get_nrUE_params()->ssb_start_subcarrier,
.used_by_ue = -1};
return;
}
nrue_cell_count = cellParamList.numelt;
nrue_cell_fp = calloc_or_fail(nrue_cell_count, sizeof(NR_DL_FRAME_PARMS));
nrue_cells = calloc_or_fail(nrue_cell_count, sizeof(nrUE_cell_params_t));
LOG_W(NR_PHY, "Ignoring command line cell parameters, using the following instead:\n");
for (int cell_id = 0; cell_id < nrue_cell_count; cell_id++) {
nrue_cells[cell_id].ru_id = *(gpd(cellParamList.paramarray[cell_id], sizeofArray(cellParams), NRUE_CELL_RU_ID)->iptr);
nrue_cells[cell_id].band = *(gpd(cellParamList.paramarray[cell_id], sizeofArray(cellParams), NRUE_CELL_BAND)->iptr);
nrue_cells[cell_id].rf_frequency = *(gpd(cellParamList.paramarray[cell_id], sizeofArray(cellParams), NRUE_CELL_RF_FREQUENCY)->u64ptr);
nrue_cells[cell_id].rf_freq_offset = *(gpd(cellParamList.paramarray[cell_id], sizeofArray(cellParams), NRUE_CELL_RF_FREQ_OFFSET)->i64ptr);
nrue_cells[cell_id].numerology = *(gpd(cellParamList.paramarray[cell_id], sizeofArray(cellParams), NRUE_CELL_NUMEROLOGY)->iptr);
nrue_cells[cell_id].N_RB_DL = *(gpd(cellParamList.paramarray[cell_id], sizeofArray(cellParams), NRUE_CELL_N_RB_DL)->iptr);
nrue_cells[cell_id].ssb_start = *(gpd(cellParamList.paramarray[cell_id], sizeofArray(cellParams), NRUE_CELL_SSB_START)->iptr);
nrue_cells[cell_id].used_by_ue = -1;
LOG_I(NR_PHY,
"cell %d: ru_id %d, band %d, DL freq %lu, UL freq_offset %ld, numerology %d, N_RB_DL %d, ssb_start %d\n",
cell_id,
nrue_cells[cell_id].ru_id,
nrue_cells[cell_id].band,
nrue_cells[cell_id].rf_frequency,
nrue_cells[cell_id].rf_freq_offset,
nrue_cells[cell_id].numerology,
nrue_cells[cell_id].N_RB_DL,
nrue_cells[cell_id].ssb_start);
}
}
int nrue_get_ru_count(void)
{
return nrue_ru_count;
}
const nrUE_RU_params_t *nrue_get_ru(int ru_id)
{
AssertFatal(ru_id >= 0 && ru_id < nrue_ru_count, "Invalid RU ID %d! RU count = %d\n", ru_id, nrue_ru_count);
return &nrue_rus[ru_id];
}
void nrue_set_ru_cell_id(int ru_id, int cell_id)
{
AssertFatal(ru_id >= 0 && ru_id < nrue_ru_count, "Invalid RU ID %d! RU count = %d\n", ru_id, nrue_ru_count);
AssertFatal(cell_id >= 0 && cell_id < nrue_cell_count, "Invalid cell ID %d! Cell count = %d\n", cell_id, nrue_cell_count);
nrue_rus[ru_id].used_by_cell = cell_id;
}
void nrue_set_ru_params(configmodule_interface_t *cfg)
{
paramdef_t RUParams[] = NRUE_RU_PARAMS_DESC;
paramlist_def_t RUParamList = {CONFIG_STRING_NRUE_RU_LIST, NULL, 0};
config_getlist(cfg, &RUParamList, RUParams, sizeofArray(RUParams), NULL);
if (RUParamList.numelt <= 0) {
nrue_ru_count = 1;
nrue_rus = calloc_or_fail(nrue_ru_count, sizeof(nrUE_RU_params_t));
nrue_rus[0] = (nrUE_RU_params_t){.nb_tx = get_nrUE_params()->nb_antennas_tx,
.nb_rx = get_nrUE_params()->nb_antennas_rx,
.att_tx = get_nrUE_params()->tx_gain,
.att_rx = 0,
.max_rxgain = get_nrUE_params()->rx_gain,
.sdr_addrs = get_nrUE_params()->usrp_args,
.tx_subdev = get_nrUE_params()->tx_subdev,
.rx_subdev = get_nrUE_params()->rx_subdev,
.clock_source = get_softmodem_params()->clock_source,
.time_source = get_softmodem_params()->timing_source,
.tune_offset = get_softmodem_params()->tune_offset,
.if_frequency = get_nrUE_params()->if_freq,
.if_freq_offset = get_nrUE_params()->if_freq_off,
.used_by_cell = -1};
return;
}
nrue_ru_count = RUParamList.numelt;
nrue_rus = calloc_or_fail(nrue_ru_count, sizeof(nrUE_RU_params_t));
LOG_W(NR_PHY, "Ignoring command line RU parameters, using the following instead:\n");
for (int ru_id = 0; ru_id < nrue_ru_count; ru_id++) {
nrue_rus[ru_id].nb_tx = *(gpd(RUParamList.paramarray[ru_id], sizeofArray(RUParams), NRUE_RU_NB_TX)->uptr);
nrue_rus[ru_id].nb_rx = *(gpd(RUParamList.paramarray[ru_id], sizeofArray(RUParams), NRUE_RU_NB_RX)->uptr);
nrue_rus[ru_id].att_tx = *(gpd(RUParamList.paramarray[ru_id], sizeofArray(RUParams), NRUE_RU_ATT_TX)->uptr);
nrue_rus[ru_id].att_rx = *(gpd(RUParamList.paramarray[ru_id], sizeofArray(RUParams), NRUE_RU_ATT_RX)->uptr);
nrue_rus[ru_id].max_rxgain = *(gpd(RUParamList.paramarray[ru_id], sizeofArray(RUParams), NRUE_RU_MAX_RXGAIN)->iptr);
nrue_rus[ru_id].tune_offset = *(gpd(RUParamList.paramarray[ru_id], sizeofArray(RUParams), NRUE_RU_TUNE_OFFSET)->dblptr);
nrue_rus[ru_id].if_frequency = *(gpd(RUParamList.paramarray[ru_id], sizeofArray(RUParams), NRUE_RU_IF_FREQUENCY)->u64ptr);
nrue_rus[ru_id].if_freq_offset = *(gpd(RUParamList.paramarray[ru_id], sizeofArray(RUParams), NRUE_RU_IF_FREQ_OFFSET)->iptr);
nrue_rus[ru_id].used_by_cell = -1;
nrue_rus[ru_id].sdr_addrs = strdup(*(gpd(RUParamList.paramarray[ru_id], sizeofArray(RUParams), NRUE_RU_SDR_ADDRS)->strptr));
nrue_rus[ru_id].tx_subdev = strdup(*(gpd(RUParamList.paramarray[ru_id], sizeofArray(RUParams), NRUE_RU_TX_SUBDEV)->strptr));
nrue_rus[ru_id].rx_subdev = strdup(*(gpd(RUParamList.paramarray[ru_id], sizeofArray(RUParams), NRUE_RU_RX_SUBDEV)->strptr));
int clock_src_idx = config_paramidx_fromname(RUParams, sizeofArray(RUParams), NRUE_RU_CLOCK_SRC);
AssertFatal(clock_src_idx >= 0, "Index for clock_src config option not found!\n");
nrue_rus[ru_id].clock_source = config_get_processedint(cfg, &RUParamList.paramarray[ru_id][clock_src_idx]);
int time_src_idx = config_paramidx_fromname(RUParams, sizeofArray(RUParams), NRUE_RU_TIME_SRC);
AssertFatal(time_src_idx >= 0, "Index for time_src config option not found!\n");
nrue_rus[ru_id].time_source = config_get_processedint(cfg, &RUParamList.paramarray[ru_id][time_src_idx]);
LOG_I(NR_PHY,
"RU %d: nb_tx %d, nb_rx %d, att_tx %d, att_rx %d, max_rxgain %d, tune_offset %f, if_frequency %lu, if_freq_offset %d, "
"sdr_addrs \"%s\", tx_subdev \"%s\", rx_subdev \"%s\", clock_source %d, time_source %d\n",
ru_id,
nrue_rus[ru_id].nb_tx,
nrue_rus[ru_id].nb_rx,
nrue_rus[ru_id].att_tx,
nrue_rus[ru_id].att_rx,
nrue_rus[ru_id].max_rxgain,
nrue_rus[ru_id].tune_offset,
nrue_rus[ru_id].if_frequency,
nrue_rus[ru_id].if_freq_offset,
nrue_rus[ru_id].sdr_addrs,
nrue_rus[ru_id].tx_subdev,
nrue_rus[ru_id].rx_subdev,
nrue_rus[ru_id].clock_source,
nrue_rus[ru_id].time_source);
}
}
void nrue_init_openair0(void)
{
int freq_off = 0;
bool is_sidelink = (get_softmodem_params()->sl_mode) ? true : false;
memset(openair0_cfg, 0, sizeof(openair0_config_t) * MAX_CARDS);
memset(openair0_dev, 0, sizeof(openair0_device_t) * MAX_CARDS);
AssertFatal(MAX_CARDS >= nrue_ru_count,
"Too many RUs allocated (%d)! Maybe increase MAX_CARDS (%d).\n",
nrue_ru_count,
MAX_CARDS);
for (int ru_id = 0; ru_id < nrue_ru_count; ru_id++) {
int cell_id = nrue_rus[ru_id].used_by_cell;
if (cell_id < 0) {
LOG_W(PHY, "Skipping initialization of RU %d because it is not used by any cell!\n", ru_id);
continue;
}
NR_DL_FRAME_PARMS *frame_parms = &nrue_cell_fp[cell_id];
if (is_sidelink) {
int UE_id = nrue_cells[cell_id].used_by_ue;
if (UE_id < 0) {
LOG_W(PHY, "Skipping initialization of RU %d because it is not used by any UE!\n", ru_id);
continue;
}
extern PHY_VARS_NR_UE ***PHY_vars_UE_g;
frame_parms = &PHY_vars_UE_g[UE_id][0]->SL_UE_PHY_PARAMS.sl_frame_params;
}
openair0_config_t *cfg = &openair0_cfg[ru_id];
cfg->configFilename = NULL;
cfg->sample_rate = frame_parms->samples_per_subframe * 1e3;
cfg->samples_per_frame = frame_parms->samples_per_frame;
if (frame_parms->frame_type == TDD)
cfg->duplex_mode = duplex_mode_TDD;
else
cfg->duplex_mode = duplex_mode_FDD;
cfg->Mod_id = 0;
cfg->ru_id = ru_id;
cfg->num_rb_dl = frame_parms->N_RB_DL;
cfg->tx_num_channels = min(4, frame_parms->nb_antennas_tx);
cfg->rx_num_channels = min(4, frame_parms->nb_antennas_rx);
LOG_I(PHY,
"HW: Configuring ru_id %d, sample_rate %f, tx/rx num_channels %d/%d, duplex_mode %s\n",
ru_id,
cfg->sample_rate,
cfg->tx_num_channels,
cfg->rx_num_channels,
duplex_mode_txt[cfg->duplex_mode]);
uint64_t dl_carrier, ul_carrier;
if (is_sidelink || nrue_rus[ru_id].if_frequency == 0) {
dl_carrier = frame_parms->dl_CarrierFreq;
ul_carrier = frame_parms->ul_CarrierFreq;
} else {
dl_carrier = nrue_rus[ru_id].if_frequency;
ul_carrier = nrue_rus[ru_id].if_frequency + nrue_rus[ru_id].if_freq_offset;
}
nr_rf_card_config_freq(cfg, ul_carrier, dl_carrier, freq_off);
nr_rf_card_config_gain(cfg);
cfg->configFilename = get_softmodem_params()->rf_config_file;
cfg->sdr_addrs = nrue_rus[ru_id].sdr_addrs;
cfg->tx_subdev = nrue_rus[ru_id].tx_subdev;
cfg->rx_subdev = nrue_rus[ru_id].rx_subdev;
cfg->clock_source = nrue_rus[ru_id].clock_source;
cfg->time_source = nrue_rus[ru_id].time_source;
cfg->tune_offset = nrue_rus[ru_id].tune_offset;
}
}
void nrue_ru_start(void)
{
for (int ru_id = 0; ru_id < nrue_ru_count; ru_id++) {
openair0_config_t *cfg0 = &openair0_cfg[ru_id];
openair0_device_t *dev0 = &openair0_dev[ru_id];
dev0->host_type = RAU_HOST;
int tmp = openair0_device_load(dev0, cfg0);
AssertFatal(tmp == 0, "Could not load the device %d\n", ru_id);
int tmp2 = dev0->trx_start_func(dev0);
AssertFatal(tmp2 == 0, "Could not start the device %d\n", ru_id);
if (usrp_tx_thread == 1)
dev0->trx_write_init(dev0);
}
}
void nrue_ru_end(void)
{
for (int ru_id = 0; ru_id < nrue_ru_count; ru_id++) {
if (openair0_dev[ru_id].trx_get_stats_func)
openair0_dev[ru_id].trx_get_stats_func(&openair0_dev[ru_id]);
if (openair0_dev[ru_id].trx_end_func)
openair0_dev[ru_id].trx_end_func(&openair0_dev[ru_id]);
}
}
void nrue_ru_set_freq(PHY_VARS_NR_UE *UE, uint64_t ul_carrier, uint64_t dl_carrier, int freq_offset)
{
int current_cell_id = nrue_rus[UE->rf_map.card].used_by_cell;
NR_DL_FRAME_PARMS *fp0 = &nrue_cell_fp[current_cell_id];
uint64_t dl_carrier_distance =
fp0->dl_CarrierFreq > dl_carrier ? fp0->dl_CarrierFreq - dl_carrier : dl_carrier - fp0->dl_CarrierFreq;
uint64_t ul_carrier_distance =
fp0->ul_CarrierFreq > ul_carrier ? fp0->ul_CarrierFreq - ul_carrier : ul_carrier - fp0->ul_CarrierFreq;
uint64_t carrier_distance = dl_carrier_distance + ul_carrier_distance;
for (int ru_id = 0; carrier_distance != 0 && ru_id < nrue_ru_count; ru_id++) {
int cell_id = nrue_rus[ru_id].used_by_cell;
if (cell_id < 0) // skip RUs that have no cell definition
continue;
if (nrue_cells[cell_id].used_by_ue >= 0) // skip cells that are already used by an UE
continue;
fp0 = &nrue_cell_fp[cell_id];
uint64_t this_dl_carrier_distance =
fp0->dl_CarrierFreq > dl_carrier ? fp0->dl_CarrierFreq - dl_carrier : dl_carrier - fp0->dl_CarrierFreq;
uint64_t this_ul_carrier_distance =
fp0->ul_CarrierFreq > ul_carrier ? fp0->ul_CarrierFreq - ul_carrier : ul_carrier - fp0->ul_CarrierFreq;
uint64_t this_carrier_distance = this_dl_carrier_distance + this_ul_carrier_distance;
if (this_carrier_distance < carrier_distance) {
UE->rf_map.card = ru_id;
carrier_distance = this_carrier_distance;
}
}
nrue_cells[current_cell_id].used_by_ue = -1;
current_cell_id = nrue_rus[UE->rf_map.card].used_by_cell;
nrue_cells[current_cell_id].used_by_ue = UE->Mod_id;
openair0_config_t *cfg0 = &openair0_cfg[UE->rf_map.card];
openair0_device_t *dev0 = &openair0_dev[UE->rf_map.card];
nr_rf_card_config_freq(cfg0, ul_carrier, dl_carrier, freq_offset);
dev0->trx_set_freq_func(dev0, cfg0);
}
int nrue_ru_adjust_rx_gain(PHY_VARS_NR_UE *UE, int gain_change)
{
openair0_config_t *cfg0 = &openair0_cfg[UE->rf_map.card];
openair0_device_t *dev0 = &openair0_dev[UE->rf_map.card];
// Increase the RX gain by the value determined by adjust_rxgain
cfg0->rx_gain[0] += gain_change;
// Set new RX gain.
int ret_gain = dev0->trx_set_gains_func(dev0, cfg0);
// APPLY RX gain again if crossed the MAX RX gain threshold
if (ret_gain < 0) {
gain_change += ret_gain;
cfg0->rx_gain[0] += ret_gain;
ret_gain = dev0->trx_set_gains_func(dev0, cfg0);
}
int applied_rxgain = cfg0->rx_gain[0] - cfg0->rx_gain_offset[0];
LOG_I(HW, "Rxgain adjusted by %d dB, RX gain: %d dB \n", gain_change, applied_rxgain);
return gain_change;
}
int nrue_ru_read(PHY_VARS_NR_UE *UE, openair0_timestamp_t *ptimestamp, void **buff, int nsamps, int num_antennas)
{
openair0_device_t *dev0 = &openair0_dev[UE->rf_map.card];
openair0_timestamp_t tmp_timestamp;
int ret = dev0->trx_read_func(dev0, &tmp_timestamp, buff, nsamps, num_antennas);
if (!dev0->firstTS_initialized) {
dev0->firstTS = tmp_timestamp;
dev0->firstTS_initialized = true;
}
*ptimestamp = tmp_timestamp - dev0->firstTS;
if (UE->Mod_id != 0)
return ret;
// UE 0 needs to read from all RUs that are not used by any other UE
void *tmp_buf[num_antennas];
uint32_t tmp_samples[nsamps];
for (int ant = 0; ant < num_antennas; ant++)
tmp_buf[ant] = tmp_samples;
for (int ru_id = 0; ru_id < nrue_ru_count; ru_id++) {
int cell_id = nrue_rus[ru_id].used_by_cell;
if (cell_id < 0) // skip RUs that have no cell definition
continue;
int ue_id = nrue_cells[cell_id].used_by_ue;
if (ue_id >= 0) // skip cells that are already used by an UE
continue;
dev0 = &openair0_dev[ru_id];
dev0->trx_read_func(dev0, &tmp_timestamp, tmp_buf, nsamps, num_antennas);
if (!dev0->firstTS_initialized) {
dev0->firstTS = tmp_timestamp;
dev0->firstTS_initialized = true;
}
}
return ret;
}
int nrue_ru_write(PHY_VARS_NR_UE *UE, openair0_timestamp_t timestamp, void **buff, int nsamps, int num_antennas, int flags)
{
openair0_device_t *dev0 = &openair0_dev[UE->rf_map.card];
int ret = dev0->trx_write_func(dev0, timestamp + dev0->firstTS, buff, nsamps, num_antennas, flags);
if (UE->Mod_id != 0)
return ret;
// UE 0 needs to write to all RUs that are not used by any other UE
void *tmp_buf[num_antennas];
uint32_t tmp_samples[nsamps];
memset(tmp_samples, 0, sizeof(tmp_samples));
for (int ant = 0; ant < num_antennas; ant++)
tmp_buf[ant] = tmp_samples;
for (int ru_id = 0; ru_id < nrue_ru_count; ru_id++) {
int cell_id = nrue_rus[ru_id].used_by_cell;
if (cell_id < 0) // skip RUs that have no cell definition
continue;
int ue_id = nrue_cells[cell_id].used_by_ue;
if (ue_id >= 0) // skip cells that are already used by an UE
continue;
dev0 = &openair0_dev[ru_id];
dev0->trx_write_func(dev0, timestamp + dev0->firstTS, tmp_buf, nsamps, num_antennas, flags);
}
return ret;
}
typedef int (*nrue_ru_write_t)(PHY_VARS_NR_UE *UE, openair0_timestamp_t timestamp, void **txp, int nsamps, int nbAnt, int flags);
int openair0_write_reorder_common(nrue_ru_write_t nrue_ru_write,
PHY_VARS_NR_UE *UE,
openair0_device_t *device,
openair0_timestamp_t timestamp,
void **txp,
int nsamps,
int nbAnt,
int flags);
int nrue_ru_write_reorder(PHY_VARS_NR_UE *UE, openair0_timestamp_t timestamp, void **txp, int nsamps, int nbAnt, int flags)
{
openair0_device_t *device = &openair0_dev[UE->rf_map.card];
return openair0_write_reorder_common(nrue_ru_write, UE, device, timestamp, txp, nsamps, nbAnt, flags);
}
void nrue_ru_write_reorder_clear_context(PHY_VARS_NR_UE *UE)
{
openair0_device_t *device = &openair0_dev[UE->rf_map.card];
openair0_write_reorder_clear_context(device);
}
+50
View File
@@ -0,0 +1,50 @@
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.0 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
#ifndef NR_UE_RU_H
#define NR_UE_RU_H
#include "PHY/defs_nr_UE.h"
#include "radio/COMMON/common_lib.h"
int nrue_get_cell_count(void);
const nrUE_cell_params_t *nrue_get_cell(int cell_id);
NR_DL_FRAME_PARMS *nrue_get_cell_fp(int cell_id);
void nrue_set_cell(int cell_id, const nrUE_cell_params_t *cell);
void nrue_set_cell_params(configmodule_interface_t *cfg);
int nrue_get_ru_count(void);
const nrUE_RU_params_t *nrue_get_ru(int ru_id);
void nrue_set_ru_cell_id(int ru_id, int cell_id);
void nrue_set_ru_params(configmodule_interface_t *cfg);
void nrue_init_openair0(void);
void nrue_ru_start(void);
void nrue_ru_end(void);
void nrue_ru_set_freq(PHY_VARS_NR_UE *UE, uint64_t ul_carrier, uint64_t dl_carrier, int freq_offset);
int nrue_ru_adjust_rx_gain(PHY_VARS_NR_UE *UE, int gain_change);
int nrue_ru_read(PHY_VARS_NR_UE *UE, openair0_timestamp_t *ptimestamp, void **buff, int nsamps, int num_antennas);
int nrue_ru_write(PHY_VARS_NR_UE *UE, openair0_timestamp_t timestamp, void **buff, int nsamps, int num_antennas, int flags);
int nrue_ru_write_reorder(PHY_VARS_NR_UE *UE, openair0_timestamp_t timestamp, void **txp, int nsamps, int nbAnt, int flags);
void nrue_ru_write_reorder_clear_context(PHY_VARS_NR_UE *UE);
#endif
+48 -84
View File
@@ -23,6 +23,7 @@
#define _GNU_SOURCE // For pthread_setname_np
#include <pthread.h>
#include <openair1/PHY/impl_defs_top.h>
#include "executables/nr-ue-ru.h"
#include "executables/nr-uesoftmodem.h"
#include "PHY/INIT/nr_phy_init.h"
#include "NR_MAC_UE/mac_proto.h"
@@ -201,31 +202,10 @@ typedef struct {
int rx_offset;
} syncData_t;
static int nr_ue_adjust_rx_gain(PHY_VARS_NR_UE *UE, openair0_config_t *cfg0, int gain_change)
{
// Increase the RX gain by the value determined by adjust_rxgain
cfg0->rx_gain[0] += gain_change;
// Set new RX gain.
int ret_gain = UE->rfdevice.trx_set_gains_func(&UE->rfdevice, cfg0);
// APPLY RX gain again if crossed the MAX RX gain threshold
if (ret_gain < 0) {
gain_change += ret_gain;
cfg0->rx_gain[0] += ret_gain;
ret_gain = UE->rfdevice.trx_set_gains_func(&UE->rfdevice, cfg0);
}
int applied_rxgain = cfg0->rx_gain[0] - cfg0->rx_gain_offset[0];
LOG_I(PHY, "Rxgain adjusted by %d dB, RX gain: %d dB \n", gain_change, applied_rxgain);
return gain_change;
}
static void UE_synch(void *arg) {
syncData_t *syncD = (syncData_t *)arg;
PHY_VARS_NR_UE *UE = syncD->UE;
UE->is_synchronized = 0;
openair0_config_t *cfg0 = &UE->openair0_cfg[UE->rf_map.card];
if (UE->target_Nid_cell != -1) {
LOG_W(NR_PHY, "Starting re-sync detection for target Nid_cell %i\n", UE->target_Nid_cell);
@@ -259,27 +239,20 @@ static void UE_synch(void *arg) {
UE->freq_offset = freq_offset - UE->dl_Doppler_shift;
} else {
// rerun with new cell parameters and frequency-offset
nr_rf_card_config_freq(cfg0, ul_carrier, dl_carrier, freq_offset);
UE->rfdevice.trx_set_freq_func(&UE->rfdevice, cfg0);
nrue_ru_set_freq(UE, ul_carrier, dl_carrier, freq_offset);
}
if (get_nrUE_params()->agc) {
nr_ue_adjust_rx_gain(UE, cfg0, UE->adjust_rxgain);
nrue_ru_adjust_rx_gain(UE, UE->adjust_rxgain);
}
LOG_I(PHY,
"Got synch: hw_slot_offset %d, carrier off %d Hz, rxgain %f (DL %f Hz, UL %f Hz)\n",
hw_slot_offset,
freq_offset,
cfg0->rx_gain[0] - cfg0->rx_gain_offset[0],
cfg0->rx_freq[0],
cfg0->tx_freq[0]);
LOG_I(PHY, "Got synch: hw_slot_offset %d, carrier off %d Hz\n", hw_slot_offset, freq_offset);
UE->is_synchronized = 1;
} else {
int gain_change = 0;
if (get_nrUE_params()->agc)
gain_change = nr_ue_adjust_rx_gain(UE, cfg0, INCREASE_IN_RXGAIN);
gain_change = nrue_ru_adjust_rx_gain(UE, INCREASE_IN_RXGAIN);
if (gain_change)
LOG_I(PHY, "synch retry: Rx gain increased \n");
else
@@ -334,7 +307,7 @@ static void RU_write(nr_rxtx_thread_data_t *rxtxD, bool sl_tx_action, c16_t **tx
radio_tx_burst_flag_t flags = TX_BURST_INVALID;
if (UE->received_config_request) {
if (UE->openair0_cfg[0].duplex_mode == duplex_mode_FDD || get_softmodem_params()->continuous_tx) {
if (fp->frame_type == FDD || get_softmodem_params()->continuous_tx) {
flags = TX_BURST_MIDDLE;
// In case of Sidelink, USRP write needed only in case transmission
// needs to be done in this slot and not based on tdd ULDL configuration.
@@ -379,13 +352,13 @@ static void RU_write(nr_rxtx_thread_data_t *rxtxD, bool sl_tx_action, c16_t **tx
}
}
openair0_timestamp writeTimestamp = proc->timestamp_tx;
openair0_timestamp_t writeTimestamp = proc->timestamp_tx;
int writeBlockSize = rxtxD->writeBlockSize;
// if writeBlockSize gets longer that slot size, fill with dummy
const int maxWriteBlockSize = get_samples_per_slot(proc->nr_slot_tx, fp);
while (writeBlockSize > maxWriteBlockSize) {
const int dummyBlockSize = min(writeBlockSize - maxWriteBlockSize, maxWriteBlockSize);
int tmp = openair0_write_reorder(&UE->rfdevice, writeTimestamp, (void **)txp, dummyBlockSize, fp->nb_antennas_tx, flags);
int tmp = nrue_ru_write_reorder(UE, writeTimestamp, (void **)txp, dummyBlockSize, fp->nb_antennas_tx, flags);
AssertFatal(tmp == dummyBlockSize, "");
writeTimestamp += dummyBlockSize;
@@ -408,7 +381,7 @@ static void RU_write(nr_rxtx_thread_data_t *rxtxD, bool sl_tx_action, c16_t **tx
writeBlockSize);
}
int tmp = openair0_write_reorder(&UE->rfdevice, writeTimestamp, (void **)txp, writeBlockSize, fp->nb_antennas_tx, flags);
int tmp = nrue_ru_write_reorder(UE, writeTimestamp, (void **)txp, writeBlockSize, fp->nb_antennas_tx, flags);
AssertFatal(tmp == writeBlockSize, "");
}
@@ -523,10 +496,9 @@ static int handle_sync_req_from_mac(PHY_VARS_NR_UE *UE)
ul_CarrierFreq,
cfg->dl_frequency,
UE->target_Nid_cell);
nrue_ru_set_freq(UE, ul_CarrierFreq, dl_CarrierFreq, 0);
fp->dl_CarrierFreq = dl_CarrierFreq;
fp->ul_CarrierFreq = ul_CarrierFreq;
nr_rf_card_config_freq(&UE->openair0_cfg[UE->rf_map.card], ul_CarrierFreq, dl_CarrierFreq, 0);
UE->rfdevice.trx_set_freq_func(&UE->rfdevice, &UE->openair0_cfg[UE->rf_map.card]);
init_symbol_rotation(fp);
}
@@ -647,23 +619,24 @@ void UE_dl_processing(void *arg) {
TracyCZoneEnd(ctx);
}
void dummyWrite(PHY_VARS_NR_UE *UE,openair0_timestamp timestamp, int writeBlockSize) {
void dummyWrite(PHY_VARS_NR_UE *UE, openair0_timestamp_t timestamp, int writeBlockSize)
{
NR_DL_FRAME_PARMS *fp = &UE->frame_parms;
if (UE->sl_mode == 2)
fp = &UE->SL_UE_PHY_PARAMS.sl_frame_params;
void *dummy_tx[fp->nb_antennas_tx];
// 2 because the function we call use pairs of int16_t implicitly as complex numbers
int16_t dummy_tx_data[fp->nb_antennas_tx][2 * writeBlockSize];
int16_t dummy_tx_data[2 * writeBlockSize];
memset(dummy_tx_data, 0, sizeof(dummy_tx_data));
for (int i = 0; i < fp->nb_antennas_tx; i++)
dummy_tx[i]=dummy_tx_data[i];
dummy_tx[i] = dummy_tx_data;
int tmp = UE->rfdevice.trx_write_func(&UE->rfdevice, timestamp, dummy_tx, writeBlockSize, fp->nb_antennas_tx, 4);
int tmp = nrue_ru_write(UE, timestamp, dummy_tx, writeBlockSize, fp->nb_antennas_tx, 4);
AssertFatal(writeBlockSize == tmp, "");
}
void readFrame(PHY_VARS_NR_UE *UE, openair0_timestamp *timestamp, int duration_rx_to_tx, bool toTrash)
void readFrame(PHY_VARS_NR_UE *UE, openair0_timestamp_t *timestamp, int duration_rx_to_tx, bool toTrash)
{
NR_DL_FRAME_PARMS *fp = &UE->frame_parms;
// two frames for initial sync
@@ -675,9 +648,11 @@ void readFrame(PHY_VARS_NR_UE *UE, openair0_timestamp *timestamp, int duration_r
}
void *rxp[NB_ANTENNAS_RX];
if (toTrash)
for (int i = 0; i < fp->nb_antennas_rx; i++)
rxp[i] = malloc16(get_samples_per_slot(0, fp) * 4);
if (toTrash) {
rxp[0] = malloc16(get_samples_per_slot(0, fp) * 4);
for (int i = 1; i < fp->nb_antennas_rx; i++)
rxp[i] = rxp[0];
}
for (int x = 0; x < num_frames * NR_NUMBER_OF_SUBFRAMES_PER_FRAME; x++) { // two frames for initial sync
for (int slot = 0; slot < fp->slots_per_subframe; slot++) {
@@ -687,13 +662,13 @@ void readFrame(PHY_VARS_NR_UE *UE, openair0_timestamp *timestamp, int duration_r
((void *)&UE->common_vars.rxdata[i][0]) + 4 * ((x * fp->samples_per_subframe) + get_samples_slot_timestamp(fp, slot));
int read_block_size = get_samples_per_slot(slot, fp);
int tmp = UE->rfdevice.trx_read_func(&UE->rfdevice, timestamp, rxp, read_block_size, fp->nb_antennas_rx);
int tmp = nrue_ru_read(UE, timestamp, rxp, read_block_size, fp->nb_antennas_rx);
UEscopeCopy(UE, ueTimeDomainSamplesBeforeSync, rxp[0], sizeof(c16_t), 1, read_block_size, 0);
AssertFatal(read_block_size == tmp, "");
if (IS_SOFTMODEM_RFSIM) {
int ta = UE->timing_advance + UE->timing_advance_ntn;
const openair0_timestamp writeTimestamp =
const openair0_timestamp_t writeTimestamp =
*timestamp + get_samples_slot_duration(fp, slot, duration_rx_to_tx) - UE->N_TA_offset - ta;
dummyWrite(UE, writeTimestamp, get_samples_per_slot(slot, fp));
}
@@ -701,11 +676,10 @@ void readFrame(PHY_VARS_NR_UE *UE, openair0_timestamp *timestamp, int duration_r
}
if (toTrash)
for (int i = 0; i < fp->nb_antennas_rx; i++)
free(rxp[i]);
free(rxp[0]);
}
static void syncInFrame(PHY_VARS_NR_UE *UE, openair0_timestamp *timestamp, int duration_rx_to_tx, openair0_timestamp rx_offset)
static void syncInFrame(PHY_VARS_NR_UE *UE, openair0_timestamp_t *timestamp, int duration_rx_to_tx, openair0_timestamp_t rx_offset)
{
NR_DL_FRAME_PARMS *fp = &UE->frame_parms;
if (UE->sl_mode == 2)
@@ -717,11 +691,11 @@ static void syncInFrame(PHY_VARS_NR_UE *UE, openair0_timestamp *timestamp, int d
int size = rx_offset;
while (size > 0) {
const int unitTransfer = min(get_samples_per_slot(slot, fp), size);
const int res = UE->rfdevice.trx_read_func(&UE->rfdevice, timestamp, (void **)UE->common_vars.rxdata, unitTransfer, fp->nb_antennas_rx);
const int res = nrue_ru_read(UE, timestamp, (void **)UE->common_vars.rxdata, unitTransfer, fp->nb_antennas_rx);
DevAssert(unitTransfer == res);
if (IS_SOFTMODEM_RFSIM) {
int ta = UE->timing_advance + UE->timing_advance_ntn;
const openair0_timestamp writeTimestamp =
const openair0_timestamp_t writeTimestamp =
*timestamp + get_samples_slot_duration(fp, slot, duration_rx_to_tx) - UE->N_TA_offset - ta;
dummyWrite(UE, writeTimestamp, unitTransfer);
}
@@ -745,13 +719,11 @@ static inline int get_readBlockSize(uint16_t slot, NR_DL_FRAME_PARMS *fp) {
void *UE_thread(void *arg)
{
//this thread should be over the processing thread to keep in real time
PHY_VARS_NR_UE *UE = (PHY_VARS_NR_UE *) arg;
PHY_VARS_NR_UE *UE = (PHY_VARS_NR_UE *)arg;
// int tx_enabled = 0;
void *rxp[NB_ANTENNAS_RX];
enum stream_status_e stream_status = STREAM_STATUS_UNSYNC;
fapi_nr_config_request_t *cfg = &UE->nrUE_config;
int tmp = openair0_device_load(&(UE->rfdevice), &UE->openair0_cfg[0]);
AssertFatal(tmp == 0, "Could not load the device\n");
NR_DL_FRAME_PARMS *fp = &UE->frame_parms;
sl_nr_phy_config_request_t *sl_cfg = NULL;
if (UE->sl_mode == 2) {
@@ -759,13 +731,7 @@ void *UE_thread(void *arg)
sl_cfg = &UE->SL_UE_PHY_PARAMS.sl_config;
}
UE->rfdevice.host_type = RAU_HOST;
UE->is_synchronized = 0;
int tmp2 = UE->rfdevice.trx_start_func(&UE->rfdevice);
AssertFatal(tmp2 == 0, "Could not start the device\n");
if (usrp_tx_thread == 1)
UE->rfdevice.trx_write_init(&UE->rfdevice);
InitSinLUT();
notifiedFIFO_t nf;
@@ -798,14 +764,14 @@ void *UE_thread(void *arg)
}
int shiftForNextFrame = 0;
int intialSyncOffset = 0;
openair0_timestamp sync_timestamp;
openair0_timestamp_t sync_timestamp;
bool stats_printed = false;
if (get_softmodem_params()->sync_ref && UE->sl_mode == 2) {
UE->is_synchronized = 1;
} else {
//warm up the RF board
int64_t tmp;
openair0_timestamp_t tmp;
for (int i = 0; i < 50; i++)
readFrame(UE, &tmp, duration_rx_to_tx, true);
}
@@ -845,7 +811,9 @@ void *UE_thread(void *arg)
/* For IQ recorder-player we force synchronization to happen in a fixed duration so that
the replay runs in sync with recorded samples.
*/
const unsigned int sync_in_frames = UE->rfdevice.openair0_cfg->recplay_conf->u_f_sync;
extern openair0_config_t openair0_cfg[MAX_CARDS];
openair0_config_t *cfg0 = &openair0_cfg[UE->rf_map.card];
const unsigned int sync_in_frames = cfg0->recplay_conf->u_f_sync;
while (trashed_frames != sync_in_frames) {
readFrame(UE, &sync_timestamp, duration_rx_to_tx, true);
trashed_frames += 2;
@@ -886,16 +854,16 @@ void *UE_thread(void *arg)
if (stream_status == STREAM_STATUS_UNSYNC) {
stream_status = STREAM_STATUS_SYNCING;
syncInFrame(UE, &sync_timestamp, duration_rx_to_tx, intialSyncOffset);
openair0_write_reorder_clear_context(&UE->rfdevice);
nrue_ru_write_reorder_clear_context(UE);
shiftForNextFrame = -(UE->init_sync_frame + trashed_frames + 2) * UE->max_pos_acc * get_nrUE_params()->time_sync_I; // compensate for the time drift that happened during initial sync
LOG_I(PHY, "max_pos_acc = %d, shiftForNextFrame = %d\n", UE->max_pos_acc, shiftForNextFrame);
// read in first symbol
AssertFatal(fp->ofdm_symbol_size + fp->nb_prefix_samples0
== UE->rfdevice.trx_read_func(&UE->rfdevice,
&sync_timestamp,
(void **)UE->common_vars.rxdata,
fp->ofdm_symbol_size + fp->nb_prefix_samples0,
fp->nb_antennas_rx),
== nrue_ru_read(UE,
&sync_timestamp,
(void **)UE->common_vars.rxdata,
fp->ofdm_symbol_size + fp->nb_prefix_samples0,
fp->nb_antennas_rx),
"");
// we have the decoded frame index in the return of the synch process
// and we shifted above to the first slot of next frame
@@ -995,8 +963,8 @@ void *UE_thread(void *arg)
}
const int readBlockSize = get_readBlockSize(slot_nr, fp) - iq_shift_to_apply;
openair0_timestamp rx_timestamp;
int tmp = UE->rfdevice.trx_read_func(&UE->rfdevice, &rx_timestamp, rxp, readBlockSize, fp->nb_antennas_rx);
openair0_timestamp_t rx_timestamp;
int tmp = nrue_ru_read(UE, &rx_timestamp, rxp, readBlockSize, fp->nb_antennas_rx);
metadata meta = {.slot = curMsg.proc.nr_slot_rx, .frame = curMsg.proc.frame_rx};
UEscopeCopyWithMetadata(UE, ueTimeDomainSamples, rxp[0] - firstSymSamp * sizeof(c16_t), sizeof(c16_t), 1, readBlockSize, 0, &meta);
AssertFatal(readBlockSize == tmp, "");
@@ -1010,12 +978,8 @@ void *UE_thread(void *arg)
int first_symbols = fp->ofdm_symbol_size + fp->nb_prefix_samples0; // first symbol of every frames
if (first_symbols > 0) {
openair0_timestamp ignore_timestamp;
int tmp = UE->rfdevice.trx_read_func(&UE->rfdevice,
&ignore_timestamp,
(void **)UE->common_vars.rxdata,
first_symbols,
fp->nb_antennas_rx);
openair0_timestamp_t ignore_timestamp;
int tmp = nrue_ru_read(UE, &ignore_timestamp, (void **)UE->common_vars.rxdata, first_symbols, fp->nb_antennas_rx);
AssertFatal(first_symbols == tmp, "");
} else
@@ -1023,13 +987,13 @@ void *UE_thread(void *arg)
}
// use previous timing_advance value to compute writeTimestamp
const openair0_timestamp writeTimestamp =
const openair0_timestamp_t writeTimestamp =
rx_timestamp + get_samples_slot_duration(fp, slot_nr, duration_rx_to_tx) - firstSymSamp - UE->N_TA_offset - timing_advance;
// Calculate TX deadline, approximately 1 symbol before the first sample should be written
const uint64_t samples_diff = writeTimestamp - rx_timestamp - fp->ofdm_symbol_size;
const float deadline_us = samples_diff / UE->rfdevice.openair0_cfg->sample_rate * 1e6;
const uint64_t absolute_deadline_us = current_time.tv_sec * 1e6 + current_time.tv_nsec / 1e3 + deadline_us;
const float deadline_us = samples_diff * 1e3 / fp->samples_per_subframe;
const uint64_t absolute_deadline_us = current_time.tv_sec * 1e6 + current_time.tv_nsec * 1e-3 + deadline_us;
// but use current UE->timing_advance value to compute writeBlockSize
int writeBlockSize = get_samples_per_slot((slot_nr + duration_rx_to_tx) % nb_slot_frame, fp) - iq_shift_to_apply;
@@ -1106,11 +1070,11 @@ void *UE_thread(void *arg)
return NULL;
}
void init_NR_UE(int nb_inst, char *uecap_file, char *reconfig_file, char *rbconfig_file)
void init_NR_UE(int nb_inst, char *uecap_file, char *reconfig_file, char *rbconfig_file, int numerology)
{
for (int instance_id = 0; instance_id < nb_inst; instance_id++) {
NR_UE_RRC_INST_t* rrc = nr_rrc_init_ue(uecap_file, instance_id, get_nrUE_params()->nb_antennas_tx);
NR_UE_MAC_INST_t *mac = nr_l2_init_ue(instance_id);
NR_UE_MAC_INST_t *mac = nr_l2_init_ue(instance_id, numerology);
nr_rrc_set_mac_queue(instance_id, &mac->input_nf);
mac->if_module = nr_ue_if_module_init(instance_id);
+108 -124
View File
@@ -81,6 +81,7 @@ unsigned short config_frames[4] = {2,9,11,13};
// current status is that every UE has a DL scope for a SINGLE eNB (eNB_id=0)
#include "PHY/TOOLS/phy_scope_interface.h"
#include "PHY/TOOLS/nr_phy_scope.h"
#include "executables/nr-ue-ru.h"
#include <executables/nr-uesoftmodem.h>
#include "executables/softmodem-common.h"
#include "executables/thread-common.h"
@@ -102,10 +103,6 @@ int get_node_type() {return -1;}
RAN_CONTEXT_t RC;
int oai_exit = 0;
static int tx_max_power[MAX_NUM_CCs] = {0};
double rx_gain_off = 0.0;
uint64_t downlink_frequency[MAX_NUM_CCs][4];
int32_t uplink_frequency_offset[MAX_NUM_CCs][4];
uint64_t sidelink_frequency[MAX_NUM_CCs][4];
@@ -138,21 +135,11 @@ int create_tasks_nrue(uint32_t ue_nb) {
void exit_function(const char *file, const char *function, const int line, const char *s, const int assert)
{
int CC_id;
LOG_W(NR_PHY, "called by: %s:%d %s() Exiting OAI softmodem: %s\n", file, line, function, s ? s : "no msg");
oai_exit = 1;
if (PHY_vars_UE_g && PHY_vars_UE_g[0]) {
for(CC_id=0; CC_id<MAX_NUM_CCs; CC_id++) {
if (PHY_vars_UE_g[0][CC_id] && PHY_vars_UE_g[0][CC_id]->rfdevice.trx_end_func) {
if (PHY_vars_UE_g[0][CC_id]->rfdevice.trx_get_stats_func) {
PHY_vars_UE_g[0][CC_id]->rfdevice.trx_get_stats_func(&PHY_vars_UE_g[0][CC_id]->rfdevice);
}
PHY_vars_UE_g[0][CC_id]->rfdevice.trx_end_func(&PHY_vars_UE_g[0][CC_id]->rfdevice);
}
}
}
nrue_ru_end();
if (assert) {
abort();
@@ -188,20 +175,22 @@ static void get_options(configmodule_interface_t *cfg)
}
// set PHY vars from command line
void set_options(int CC_id, PHY_VARS_NR_UE *UE){
NR_DL_FRAME_PARMS *fp = &UE->frame_parms;
static void set_UE_options(int CC_id, PHY_VARS_NR_UE *UE, int ru_id)
{
const nrUE_RU_params_t *RU = nrue_get_ru(ru_id);
// Set UE variables
UE->rx_total_gain_dB = (int)nrUE_params.rx_gain + rx_gain_off;
UE->tx_total_gain_dB = (int)nrUE_params.tx_gain;
UE->rx_total_gain_dB = RU->max_rxgain - RU->att_rx;
UE->tx_total_gain_dB = RU->att_tx;
UE->if_freq = RU->if_frequency;
UE->if_freq_off = RU->if_freq_offset;
UE->rf_map.card = ru_id;
UE->rf_map.chain = CC_id;
UE->tx_power_max_dBm = nrUE_params.tx_max_power;
UE->rf_map.card = 0;
UE->rf_map.chain = CC_id + 0;
UE->max_ldpc_iterations = nrUE_params.max_ldpc_iterations;
UE->UE_scan_carrier = nrUE_params.UE_scan_carrier;
UE->UE_fo_compensation = nrUE_params.UE_fo_compensation;
UE->if_freq = nrUE_params.if_freq;
UE->if_freq_off = nrUE_params.if_freq_off;
UE->chest_freq = nrUE_params.chest_freq;
UE->chest_time = nrUE_params.chest_time;
UE->no_timing_correction = nrUE_params.no_timing_correction;
@@ -210,76 +199,21 @@ void set_options(int CC_id, PHY_VARS_NR_UE *UE){
LOG_I(PHY,"Set UE_fo_compensation %d, UE_scan_carrier %d, UE_no_timing_correction %d \n, chest-freq %d, chest-time %d\n",
UE->UE_fo_compensation, UE->UE_scan_carrier, UE->no_timing_correction, UE->chest_freq, UE->chest_time);
// Set FP variables
fp->nb_antennas_rx = nrUE_params.nb_antennas_rx;
fp->nb_antennas_tx = nrUE_params.nb_antennas_tx;
fp->threequarter_fs = get_softmodem_params()->threequarter_fs;
fp->N_RB_DL = nrUE_params.N_RB_DL;
fp->ssb_start_subcarrier = nrUE_params.ssb_start_subcarrier;
fp->ofdm_offset_divisor = nrUE_params.ofdm_offset_divisor;
LOG_I(PHY, "Set UE nb_rx_antenna %d, nb_tx_antenna %d, threequarter_fs %d, ssb_start_subcarrier %d\n", fp->nb_antennas_rx, fp->nb_antennas_tx, fp->threequarter_fs, fp->ssb_start_subcarrier);
}
void init_openair0(PHY_VARS_NR_UE *ue)
static void set_fp_options(int cell_id, int ru_id)
{
int card;
int freq_off = 0;
NR_DL_FRAME_PARMS *frame_parms = &ue->frame_parms;
bool is_sidelink = (get_softmodem_params()->sl_mode) ? true : false;
if (is_sidelink)
frame_parms = &ue->SL_UE_PHY_PARAMS.sl_frame_params;
NR_DL_FRAME_PARMS *fp = nrue_get_cell_fp(cell_id);
const nrUE_RU_params_t *RU = nrue_get_ru(ru_id);
for (card=0; card<MAX_CARDS; card++) {
openair0_config_t *cfg = &ue->openair0_cfg[card];
uint64_t dl_carrier, ul_carrier;
cfg->configFilename = NULL;
cfg->sample_rate = frame_parms->samples_per_subframe * 1e3;
cfg->samples_per_frame = frame_parms->samples_per_frame;
// Set FP variables
fp->nb_antennas_rx = RU->nb_rx;
fp->nb_antennas_tx = RU->nb_tx;
if (frame_parms->frame_type==TDD)
cfg->duplex_mode = duplex_mode_TDD;
else
cfg->duplex_mode = duplex_mode_FDD;
fp->threequarter_fs = get_softmodem_params()->threequarter_fs;
fp->ofdm_offset_divisor = nrUE_params.ofdm_offset_divisor;
cfg->Mod_id = 0;
cfg->num_rb_dl = frame_parms->N_RB_DL;
cfg->clock_source = get_softmodem_params()->clock_source;
cfg->time_source = get_softmodem_params()->timing_source;
cfg->tune_offset = get_softmodem_params()->tune_offset;
cfg->tx_num_channels = min(4, frame_parms->nb_antennas_tx);
cfg->rx_num_channels = min(4, frame_parms->nb_antennas_rx);
LOG_I(PHY,
"HW: Configuring card %d, sample_rate %f, tx/rx num_channels %d/%d, duplex_mode %s\n",
card,
cfg->sample_rate,
cfg->tx_num_channels,
cfg->rx_num_channels,
duplex_mode_txt[cfg->duplex_mode]);
if (is_sidelink) {
dl_carrier = frame_parms->dl_CarrierFreq;
ul_carrier = frame_parms->ul_CarrierFreq;
} else
nr_get_carrier_frequencies(PHY_vars_UE_g[0][0], &dl_carrier, &ul_carrier);
nr_rf_card_config_freq(cfg, ul_carrier, dl_carrier, freq_off);
nr_rf_card_config_gain(cfg, rx_gain_off);
cfg->configFilename = get_softmodem_params()->rf_config_file;
if (get_nrUE_params()->usrp_args)
cfg->sdr_addrs = get_nrUE_params()->usrp_args;
if (get_nrUE_params()->tx_subdev)
cfg->tx_subdev = get_nrUE_params()->tx_subdev;
if (get_nrUE_params()->rx_subdev)
cfg->rx_subdev = get_nrUE_params()->rx_subdev;
}
LOG_I(PHY, "Set UE nb_rx_antenna %d, nb_tx_antenna %d, threequarter_fs %d, ofdm_offset_divisor %d\n", fp->nb_antennas_rx, fp->nb_antennas_tx, fp->threequarter_fs, fp->ofdm_offset_divisor);
}
// Stupid function addition because UE itti messages queues definition is common with eNB
@@ -324,7 +258,6 @@ int main(int argc, char **argv)
}
//set_softmodem_sighandler();
CONFIG_SETRTFLAG(CONFIG_NOEXITONHELP);
memset(tx_max_power,0,sizeof(int)*MAX_NUM_CCs);
// initialize logging
logInit();
// get options and fill parameters from configuration file
@@ -379,7 +312,14 @@ int main(int argc, char **argv)
nr_pdcp_layer_init();
nas_init_nrue(NB_UE_INST);
init_NR_UE(NB_UE_INST, get_nrUE_params()->uecap_file, get_nrUE_params()->reconfig_file, get_nrUE_params()->rbconfig_file);
nrue_set_ru_params(uniqCfg);
nrue_set_cell_params(uniqCfg);
init_NR_UE(NB_UE_INST,
get_nrUE_params()->uecap_file,
get_nrUE_params()->reconfig_file,
get_nrUE_params()->rbconfig_file,
nrue_get_cell(0)->numerology);
// start time manager with some reasonable default for the running mode
// (may be overwritten in configuration file or command line)
@@ -396,24 +336,52 @@ int main(int argc, char **argv)
IS_SOFTMODEM_RFSIM ? TIME_SOURCE_IQ_SAMPLES
: TIME_SOURCE_REALTIME);
// initialize per-cell frame parameters
for (int cell_id = 0; cell_id < nrue_get_cell_count(); cell_id++) {
int ru_id = nrue_get_cell(cell_id)->ru_id;
AssertFatal(ru_id >= 0 && ru_id < nrue_get_ru_count(),
"Invalid ru_id (%d) for cell %d. Should be >= 0 and < %d\n",
ru_id,
cell_id,
nrue_get_ru_count());
AssertFatal(nrue_get_ru(ru_id)->used_by_cell == -1,
"RU %d is already used by cell %d and therefore cannot also be used by cell %d\n",
ru_id,
nrue_get_ru(ru_id)->used_by_cell,
cell_id);
nrue_set_ru_cell_id(ru_id, cell_id);
set_fp_options(cell_id, ru_id);
if (IS_SA_MODE(get_softmodem_params()) || get_softmodem_params()->sl_mode)
nr_init_frame_parms_ue_sa(nrue_get_cell_fp(cell_id), nrue_get_cell(cell_id));
}
int cell_id = 0;
for (int inst = 0; inst < NB_UE_INST; inst++) {
PHY_VARS_NR_UE *UE[MAX_NUM_CCs];
NR_UE_MAC_INST_t *mac = get_mac_inst(inst);
for (int CC_id = 0; CC_id < MAX_NUM_CCs; CC_id++) {
UE[CC_id] = PHY_vars_UE_g[inst][CC_id];
set_options(CC_id, UE[CC_id]);
NR_UE_MAC_INST_t *mac = get_mac_inst(inst);
init_nr_ue_phy_cpu_stats(&UE[CC_id]->phy_cpu_stats);
// set frame config to initial values from command line and assume that the SSB is centered on the grid
if (IS_SA_MODE(get_softmodem_params()) || get_softmodem_params()->sl_mode) {
uint16_t nr_band = get_softmodem_params()->band;
mac->nr_band = nr_band;
mac->ssb_start_subcarrier = UE[CC_id]->frame_parms.ssb_start_subcarrier;
nr_init_frame_parms_ue_sa(&UE[CC_id]->frame_parms,
downlink_frequency[CC_id][0],
uplink_frequency_offset[CC_id][0],
get_softmodem_params()->numerology,
nr_band);
} else {
PHY_VARS_NR_UE *UE_CC = PHY_vars_UE_g[inst][CC_id];
AssertFatal(cell_id >= 0 && cell_id < nrue_get_cell_count(),
"There are not enough cell definitions for all UEs! NB_UE_INST = %d, MAX_NUM_CCs = %d, nrue_cell_count = %d\n",
NB_UE_INST,
MAX_NUM_CCs,
nrue_get_cell_count());
nrUE_cell_params_t cell = *nrue_get_cell(cell_id);
AssertFatal(cell.used_by_ue == -1,
"Cell %d is already used by UE %d and cannot also be used by UE %d as cells map 1:1 to RUs and RU sharing is not implemented\n",
cell_id,
cell.used_by_ue,
inst);
cell.used_by_ue = inst;
set_UE_options(CC_id, UE_CC, cell.ru_id);
init_nr_ue_phy_cpu_stats(&UE_CC->phy_cpu_stats);
NR_DL_FRAME_PARMS *fp = nrue_get_cell_fp(cell_id);
if (!IS_SA_MODE(get_softmodem_params()) && !get_softmodem_params()->sl_mode) {
do {
notifiedFIFO_elt_t *elt = pollNotifiedFIFO(&mac->input_nf);
if (!elt) {
@@ -422,44 +390,60 @@ int main(int argc, char **argv)
process_msg_rcc_to_mac(NotifiedFifoData(elt), inst);
delNotifiedFIFO_elt(elt);
} while (true);
fapi_nr_config_request_t *nrUE_config = &UE[CC_id]->nrUE_config;
nr_init_frame_parms_ue(&UE[CC_id]->frame_parms, nrUE_config, mac->nr_band);
}
fapi_nr_config_request_t *nrUE_config = &UE_CC->nrUE_config;
nr_init_frame_parms_ue(fp, nrUE_config, mac->nr_band);
UE[CC_id]->sl_mode = get_softmodem_params()->sl_mode;
init_actor(&UE[CC_id]->sync_actor, "SYNC_", -1);
cell.band = fp->nr_band;
cell.rf_frequency = fp->dl_CarrierFreq;
cell.rf_freq_offset = fp->ul_CarrierFreq - fp->dl_CarrierFreq;
cell.numerology = fp->numerology_index;
cell.N_RB_DL = fp->N_RB_DL;
cell.ssb_start = fp->ssb_start_subcarrier;
}
nrue_set_cell(cell_id, &cell);
UE_CC->frame_parms = *fp;
mac->nr_band = cell.band;
mac->ssb_start_subcarrier = cell.ssb_start;
mac->dl_frequency = cell.rf_frequency;
UE_CC->sl_mode = get_softmodem_params()->sl_mode;
init_actor(&UE_CC->sync_actor, "SYNC_", -1);
if (get_nrUE_params()->num_dl_actors > 0) {
UE[CC_id]->dl_actors = calloc_or_fail(get_nrUE_params()->num_dl_actors, sizeof(*UE[CC_id]->dl_actors));
UE_CC->dl_actors = calloc_or_fail(get_nrUE_params()->num_dl_actors, sizeof(*UE_CC->dl_actors));
for (int i = 0; i < get_nrUE_params()->num_dl_actors; i++) {
init_actor(&UE[CC_id]->dl_actors[i], "DL_", -1);
init_actor(&UE_CC->dl_actors[i], "DL_", -1);
}
}
if (get_nrUE_params()->num_ul_actors > 0) {
UE[CC_id]->ul_actors = calloc_or_fail(get_nrUE_params()->num_ul_actors, sizeof(*UE[CC_id]->ul_actors));
UE_CC->ul_actors = calloc_or_fail(get_nrUE_params()->num_ul_actors, sizeof(*UE_CC->ul_actors));
for (int i = 0; i < get_nrUE_params()->num_ul_actors; i++) {
init_actor(&UE[CC_id]->ul_actors[i], "UL_", -1);
init_actor(&UE_CC->ul_actors[i], "UL_", -1);
}
}
init_nr_ue_vars(UE[CC_id], inst);
init_nr_ue_vars(UE_CC, inst);
if (UE[CC_id]->sl_mode) {
AssertFatal(UE[CC_id]->sl_mode == 2, "Only Sidelink mode 2 supported. Mode 1 not yet supported\n");
if (UE_CC->sl_mode) {
AssertFatal(UE_CC->sl_mode == 2, "Only Sidelink mode 2 supported. Mode 1 not yet supported\n");
DevAssert(mac->if_module != NULL && mac->if_module->sl_phy_config_request != NULL);
nr_sl_phy_config_t *phycfg = &mac->SL_MAC_PARAMS->sl_phy_config;
phycfg->sl_config_req.sl_carrier_config.sl_num_rx_ant = get_nrUE_params()->nb_antennas_rx;
phycfg->sl_config_req.sl_carrier_config.sl_num_tx_ant = get_nrUE_params()->nb_antennas_tx;
mac->if_module->sl_phy_config_request(phycfg);
sl_nr_ue_phy_params_t *sl_phy = &UE[CC_id]->SL_UE_PHY_PARAMS;
sl_nr_ue_phy_params_t *sl_phy = &UE_CC->SL_UE_PHY_PARAMS;
nr_init_frame_parms_ue_sl(&sl_phy->sl_frame_params,
&sl_phy->sl_config,
get_softmodem_params()->threequarter_fs,
get_nrUE_params()->ofdm_offset_divisor);
sl_ue_phy_init(UE[CC_id]);
sl_ue_phy_init(UE_CC);
}
init_openair0(UE[CC_id]);
cell_id++; // initially connect each UE and carrier to its own cell
}
}
nrue_init_openair0();
lock_memory_to_ram();
if (IS_SOFTMODEM_DOSCOPE) {
@@ -474,6 +458,8 @@ int main(int argc, char **argv)
load_module_shlib("imscope_record", NULL, 0, PHY_vars_UE_g[0][0]);
}
nrue_ru_start();
for (int inst = 0; inst < NB_UE_INST; inst++) {
LOG_I(PHY,"Intializing UE Threads for instance %d ...\n", inst);
init_NR_UE_threads(PHY_vars_UE_g[inst][0]);
@@ -514,14 +500,12 @@ int main(int argc, char **argv)
ret = pthread_join(phy_vars->stat_thread, NULL);
AssertFatal(ret == 0, "pthread_join error %d, errno %d (%s)\n", ret, errno, strerror(errno));
}
if (phy_vars->rfdevice.trx_get_stats_func)
phy_vars->rfdevice.trx_get_stats_func(&phy_vars->rfdevice);
if (phy_vars->rfdevice.trx_end_func)
phy_vars->rfdevice.trx_end_func(&phy_vars->rfdevice);
}
}
}
nrue_ru_end();
free_nrLDPC_coding_interface(&nrLDPC_coding_interface);
time_manager_finish();
+3 -7
View File
@@ -56,7 +56,6 @@ extern uint16_t ue_id_g;
{"reconfig-file", CONFIG_HLP_RE_CFG_FILE, 0, .strptr=&nrUE_params.reconfig_file, .defstrval="./reconfig.raw", TYPE_STRING, 0}, \
{"rbconfig-file", CONFIG_HLP_RB_CFG_FILE, 0, .strptr=&nrUE_params.rbconfig_file, .defstrval="./rbconfig.raw", TYPE_STRING, 0}, \
{"ue-rxgain", CONFIG_HLP_UERXG, 0, .dblptr=&nrUE_params.rx_gain, .defdblval=110, TYPE_DOUBLE, 0}, \
{"ue-rxgain-off", CONFIG_HLP_UERXGOFF, 0, .dblptr=&nrUE_params.rx_gain_off, .defdblval=0, TYPE_DOUBLE, 0}, \
{"ue-txgain", CONFIG_HLP_UETXG, 0, .dblptr=&nrUE_params.tx_gain, .defdblval=0, TYPE_DOUBLE, 0}, \
{"ue-nb-ant-rx", CONFIG_HLP_UENANTR, 0, .iptr=&(nrUE_params.nb_antennas_rx), .defuintval=1, TYPE_UINT8, 0}, \
{"ue-nb-ant-tx", CONFIG_HLP_UENANTT, 0, .iptr=&(nrUE_params.nb_antennas_tx), .defuintval=1, TYPE_UINT8, 0}, \
@@ -65,12 +64,12 @@ extern uint16_t ue_id_g;
{"ue-max-power", NULL, 0, .iptr=&(nrUE_params.tx_max_power), .defintval=90, TYPE_INT, 0}, \
{"r" , CONFIG_HLP_PRB_SA, 0, .iptr=&(nrUE_params.N_RB_DL), .defintval=106, TYPE_UINT, 0}, \
{"ssb", CONFIG_HLP_SSC, 0, .iptr=&(nrUE_params.ssb_start_subcarrier), .defintval=516, TYPE_UINT16, 0}, \
{"if_freq" , CONFIG_HLP_IF_FREQ, 0, .u64ptr=&(nrUE_params.if_freq), .defuintval=0, TYPE_UINT64, 0}, \
{"if_freq" , CONFIG_HLP_IF_FREQ, 0, .u64ptr=&(nrUE_params.if_freq), .defint64val=0, TYPE_UINT64, 0}, \
{"if_freq_off" , CONFIG_HLP_IF_FREQ_OFF, 0, .iptr=&(nrUE_params.if_freq_off), .defuintval=0, TYPE_INT, 0}, \
{"chest-freq", CONFIG_HLP_CHESTFREQ, 0, .iptr=&(nrUE_params.chest_freq), .defintval=0, TYPE_INT, 0}, \
{"chest-time", CONFIG_HLP_CHESTTIME, 0, .iptr=&(nrUE_params.chest_time), .defintval=0, TYPE_INT, 0}, \
{"ue-timing-correction-disable", CONFIG_HLP_DISABLETIMECORR, PARAMFLAG_BOOL, .iptr=&(nrUE_params.no_timing_correction), .defintval=0, TYPE_INT, 0}, \
{"SLC", CONFIG_HLP_SLF, 0, .u64ptr=&(sidelink_frequency[0][0]), .defuintval=2600000000,TYPE_UINT64,0}, \
{"SLC", CONFIG_HLP_SLF, 0, .u64ptr=&(sidelink_frequency[0][0]), .defint64val=2600000000,TYPE_UINT64,0}, \
{"num-ues", NULL, 0, .iptr=&(NB_UE_INST), .defuintval=1, TYPE_INT, 0}, \
{"time-sync-P", CONFIG_HLP_TIME_SYNC_P, 0, .dblptr=&(nrUE_params.time_sync_P), .defdblval=0.5, TYPE_DOUBLE, 0}, \
{"time-sync-I", CONFIG_HLP_TIME_SYNC_I, 0, .dblptr=&(nrUE_params.time_sync_I), .defdblval=0.0, TYPE_DOUBLE, 0}, \
@@ -120,7 +119,6 @@ typedef struct {
char *uecap_file;
double tx_gain;
double rx_gain;
double rx_gain_off;
int vcdflag;
int tx_max_power;
int num_ul_actors;
@@ -131,11 +129,9 @@ extern uint64_t get_nrUE_optmask(void);
extern uint64_t set_nrUE_optmask(uint64_t bitmask);
extern nrUE_params_t *get_nrUE_params(void);
// In nr-ue.c
extern int setup_nr_ue_buffers(PHY_VARS_NR_UE **phy_vars_ue, openair0_config_t *openair0_cfg);
extern void fill_ue_band_info(void);
extern void init_NR_UE(int, char *, char *, char *);
extern void init_NR_UE(int, char *, char *, char *, int);
extern void init_NR_UE_threads(PHY_VARS_NR_UE *ue);
void *UE_thread(void *arg);
void init_nr_ue_vars(PHY_VARS_NR_UE *ue, uint8_t UE_id);
+1 -1
View File
@@ -153,7 +153,7 @@ extern int usrp_tx_thread;
{"clock-source", CONFIG_HLP_CLK, 0, .uptr=&CLOCK_SOURCE, .defintval=0, TYPE_UINT, 0}, \
{"time-source", CONFIG_HLP_TME, 0, .uptr=&TIMING_SOURCE, .defintval=0, TYPE_UINT, 0}, \
{"tune-offset", CONFIG_HLP_TUNE_OFFSET, 0, .dblptr=&TUNE_OFFSET, .defintval=0, TYPE_DOUBLE, 0}, \
{"C" , CONFIG_HLP_DLF, 0, .u64ptr=&(downlink_frequency[0][0]), .defuintval=0, TYPE_UINT64, 0}, \
{"C" , CONFIG_HLP_DLF, 0, .u64ptr=&(downlink_frequency[0][0]), .defint64val=0, TYPE_UINT64, 0}, \
{"CO" , CONFIG_HLP_ULF, 0, .iptr=&(uplink_frequency_offset[0][0]), .defintval=0, TYPE_INT, 0}, \
{"a" , CONFIG_HLP_CHOFF, 0, .iptr=&CHAIN_OFFSET, .defintval=0, TYPE_INT, 0}, \
{"d" , CONFIG_HLP_SOFTS, PARAMFLAG_BOOL, .uptr=&do_forms, .defintval=0, TYPE_UINT, 0}, \
@@ -41,7 +41,7 @@ At runtime, to successfully use LDPC accelerators (e.g., Xilinx T2/Intel ACCs),
Please refer to the dedicated documentation at [LDPC_OFFLOAD_SETUP.md](file://../../../../doc/LDPC_OFFLOAD_SETUP.md).
```
./nr-softmodem -O libconfig:gnb.band78.sa.fr1.106PRB.usrpb210.conf:dbgl5 --rfsim --rfsimulator.serveraddr server --log_config.gtpu_log_level info --loader.ldpc.shlibversion _aal --nrLDPC_coding_aal.dpdk_dev 01:00.0 --nrLDPC_coding_aal.dpdk_core_list 0-1
./nr-softmodem -O libconfig:gnb.band78.sa.fr1.106PRB.usrpb210.conf:dbgl5 --rfsim --rfsimulator.[0].serveraddr server --log_config.gtpu_log_level info --loader.ldpc.shlibversion _aal --nrLDPC_coding_aal.dpdk_dev 01:00.0 --nrLDPC_coding_aal.dpdk_core_list 0-1
```
`libldpc_aal.so` has its decoder and its encoder implemented in [nrLDPC_coding_aal.c](file://../nrLDPC_coding/nrLDPC_coding_aal/nrLDPC_coding_aal.c).
@@ -61,7 +61,7 @@ At runtime, to successfully use the xdma, you need to install vendor specific dr
Please refer to the dedicated documentation at [LDPC_XDMA_OFFLOAD_SETUP.md](file://../../../../doc/LDPC_XDMA_OFFLOAD_SETUP.md).
```
./nr-softmodem -O libconfig:gnb.band78.sa.fr1.106PRB.usrpb210.conf:dbgl5 --rfsim --rfsimulator.serveraddr server --log_config.gtpu_log_level info --loader.ldpc.shlibversion _xdma --nrLDPC_coding_xdma.num_threads_prepare 2
./nr-softmodem -O libconfig:gnb.band78.sa.fr1.106PRB.usrpb210.conf:dbgl5 --rfsim --rfsimulator.[0].serveraddr server --log_config.gtpu_log_level info --loader.ldpc.shlibversion _xdma --nrLDPC_coding_xdma.num_threads_prepare 2
```
`libldpc_xdma.so` has its decoder implemented in [nrLDPC_coding_xdma.c](file://../nrLDPC_coding/nrLDPC_coding_xdma/nrLDPC_coding_xdma.c).\
+14 -5
View File
@@ -320,7 +320,7 @@ uint32_t get_samples_symbol_timestamp(const NR_DL_FRAME_PARMS *fp, int slot, int
return get_samples_symbol_duration(fp, slot, 0, symbol);
}
uint32_t get_slot_from_timestamp(openair0_timestamp timestamp_rx, const NR_DL_FRAME_PARMS *fp)
uint32_t get_slot_from_timestamp(openair0_timestamp_t timestamp_rx, const NR_DL_FRAME_PARMS *fp)
{
timestamp_rx = timestamp_rx % fp->samples_per_frame;
if (timestamp_rx < fp->samples_per_slot0)
@@ -525,13 +525,20 @@ int nr_init_frame_parms_ue(NR_DL_FRAME_PARMS *fp,
return 0;
}
void nr_init_frame_parms_ue_sa(NR_DL_FRAME_PARMS *frame_parms, uint64_t downlink_frequency, int32_t delta_duplex, uint8_t mu, uint16_t nr_band) {
void nr_init_frame_parms_ue_sa(NR_DL_FRAME_PARMS *frame_parms, const nrUE_cell_params_t *cell)
{
const uint64_t downlink_frequency = cell->rf_frequency;
const int64_t delta_duplex = cell->rf_freq_offset;
const uint8_t mu = cell->numerology;
const int N_RB_DL = cell->N_RB_DL;
const int ssb_start_subcarrier = cell->ssb_start;
const uint16_t nr_band = cell->band;
LOG_I(PHY,"SA init parameters. DL freq %lu UL offset %d SSB numerology %d N_RB_DL %d\n",
LOG_I(PHY,"SA init parameters. DL freq %lu UL offset %ld SSB numerology %d N_RB_DL %d\n",
downlink_frequency,
delta_duplex,
mu,
frame_parms->N_RB_DL);
N_RB_DL);
frame_parms->numerology_index = mu;
frame_parms->dl_CarrierFreq = downlink_frequency;
@@ -539,6 +546,7 @@ void nr_init_frame_parms_ue_sa(NR_DL_FRAME_PARMS *frame_parms, uint64_t downlink
if (get_softmodem_params()->sl_mode == 0) {
frame_parms->freq_range = get_freq_range_from_freq(frame_parms->dl_CarrierFreq);
}
frame_parms->N_RB_DL = N_RB_DL;
frame_parms->N_RB_UL = frame_parms->N_RB_DL;
frame_parms->nr_band = nr_band;
@@ -564,8 +572,9 @@ void nr_init_frame_parms_ue_sa(NR_DL_FRAME_PARMS *frame_parms, uint64_t downlink
+ (frame_parms->symbols_per_slot * frame_parms->ofdm_symbol_size);
frame_parms->samples_per_frame = 10 * frame_parms->samples_per_subframe;
LOG_W(PHY, "samples_per_subframe %d/per second %d, wCP %d\n", frame_parms->samples_per_subframe, 1000*frame_parms->samples_per_subframe, frame_parms->samples_per_subframe_wCP);
frame_parms->ssb_start_subcarrier = ssb_start_subcarrier;
LOG_W(PHY, "samples_per_subframe %d/per second %d, wCP %d\n", frame_parms->samples_per_subframe, 1000*frame_parms->samples_per_subframe, frame_parms->samples_per_subframe_wCP);
}
void nr_dump_frame_parms(NR_DL_FRAME_PARMS *fp)
+1 -1
View File
@@ -28,7 +28,7 @@
int nr_get_ssb_start_symbol(const NR_DL_FRAME_PARMS *fp, uint8_t i_ssb);
void nr_init_frame_parms(nfapi_nr_config_request_scf_t *config, NR_DL_FRAME_PARMS *frame_parms);
int nr_init_frame_parms_ue(NR_DL_FRAME_PARMS *frame_parms, fapi_nr_config_request_t *config, uint16_t nr_band);
void nr_init_frame_parms_ue_sa(NR_DL_FRAME_PARMS *frame_parms, uint64_t downlink_frequency, int32_t uplink_frequency_offset, uint8_t mu, uint16_t nr_band);
void nr_init_frame_parms_ue_sa(NR_DL_FRAME_PARMS *frame_parms, const nrUE_cell_params_t *cell);
int nr_init_frame_parms_ue_sl(NR_DL_FRAME_PARMS *fp,
sl_nr_phy_config_request_t *config,
int threequarter_fs,
@@ -41,7 +41,7 @@ uint32_t ref_get_samples_slot_timestamp(NR_DL_FRAME_PARMS *fp, unsigned int slot
return samp_count;
}
uint32_t ref_get_slot_from_timestamp(openair0_timestamp ts, NR_DL_FRAME_PARMS *fp)
uint32_t ref_get_slot_from_timestamp(openair0_timestamp_t ts, NR_DL_FRAME_PARMS *fp)
{
uint32_t slot_idx = 0;
int samples_till_the_slot = get_samples_per_slot(slot_idx, fp) - 1;
@@ -75,7 +75,7 @@ void test_coherence_slot_api(NR_DL_FRAME_PARMS *fp)
EXPECT_EQ(get_samples_slot_timestamp(fp, slot), ref_get_samples_slot_timestamp(fp, slot));
}
openair0_timestamp ts = get_samples_per_slot(0, fp);
openair0_timestamp_t ts = get_samples_per_slot(0, fp);
// When timestamp is the last sample of the slot
EXPECT_EQ(get_slot_from_timestamp(ts - 1, fp), 0);
for (unsigned int slot = 0; slot < fp->slots_per_frame; slot++) {
@@ -174,4 +174,4 @@ int main(int argc, char **argv)
logInit();
testing::InitGoogleTest(&argc, argv);
return RUN_ALL_TESTS();
}
}
@@ -46,6 +46,8 @@
#define CH_INTERP 0
#define NO_INTERP 1
extern openair0_config_t openair0_cfg[MAX_CARDS];
/* Generic function to find the peak of channel estimation buffer */
void peak_estimator(c16_t *buffer, int32_t buf_len, int32_t *peak_idx, int32_t *peak_val, int32_t mean_val)
{
@@ -461,12 +463,13 @@ int nr_prs_channel_estimation(uint8_t gNB_id,
// adjusting the rx_gains for channel peak power
ch_pwr_dbm = 10 * log10(ch_pwr) + 30 - SQ15_SQUARED_NORM_FACTOR_DB
- ((int)ue->openair0_cfg[0].rx_gain[0] - (int)ue->openair0_cfg[0].rx_gain_offset[0])
- ((int)openair0_cfg[ue->rf_map.card].rx_gain[0] - (int)openair0_cfg[ue->rf_map.card].rx_gain_offset[0])
- dB_fixed(frame_params->ofdm_symbol_size);
prs_meas[rxAnt]->rsrp_dBm = 10 * log10(prs_meas[rxAnt]->rsrp) + 30 - SQ15_SQUARED_NORM_FACTOR_DB
- ((int)ue->openair0_cfg[0].rx_gain[0] - (int)ue->openair0_cfg[0].rx_gain_offset[0])
- dB_fixed(ue->frame_parms.ofdm_symbol_size);
prs_meas[rxAnt]->rsrp_dBm =
10 * log10(prs_meas[rxAnt]->rsrp) + 30 - SQ15_SQUARED_NORM_FACTOR_DB
- ((int)openair0_cfg[ue->rf_map.card].rx_gain[0] - (int)openair0_cfg[ue->rf_map.card].rx_gain_offset[0])
- dB_fixed(ue->frame_parms.ofdm_symbol_size);
// prs measurements
prs_meas[rxAnt]->gNB_id = gNB_id;
@@ -154,10 +154,10 @@ void nr_pdsch_ptrs_processing(PHY_VARS_NR_UE *ue,
uint16_t rnti,
NR_UE_DLSCH_t dlsch[2]);
int nr_sl_psbch_rsrp_measurements(sl_nr_ue_phy_params_t *sl_phy_params,
int nr_sl_psbch_rsrp_measurements(PHY_VARS_NR_UE *ue,
sl_nr_ue_phy_params_t *sl_phy_params,
NR_DL_FRAME_PARMS *fp,
c16_t rxdataF[][fp->samples_per_slot_wCP],
bool use_SSS,
openair0_config_t *openair0_cfg);
bool use_SSS);
/** @}*/
#endif
@@ -51,6 +51,8 @@
//#define DEBUG_MEAS_UE
//#define DEBUG_RANK_EST
extern openair0_config_t openair0_cfg[MAX_CARDS];
void nr_ue_measurements(PHY_VARS_NR_UE *ue,
const UE_nr_rxtx_proc_t *proc,
int number_rbs,
@@ -133,9 +135,10 @@ void nr_ue_measurements(PHY_VARS_NR_UE *ue,
ue->measurements.n0_power_avg_dB = dB_fixed(ue->measurements.n0_power_avg);
ue->measurements.wideband_cqi_tot[gNB_id] = ue->measurements.rx_power_tot_dB[gNB_id] - ue->measurements.n0_power_tot_dB;
ue->measurements.wideband_cqi_avg[gNB_id] = ue->measurements.rx_power_avg_dB[gNB_id] - ue->measurements.n0_power_avg_dB;
ue->measurements.rx_rssi_dBm[gNB_id] = ue->measurements.rx_power_avg_dB[gNB_id] + 30 - SQ15_SQUARED_NORM_FACTOR_DB
- ((int)ue->openair0_cfg[0].rx_gain[0] - (int)ue->openair0_cfg[0].rx_gain_offset[0])
- dB_fixed(ue->frame_parms.ofdm_symbol_size);
ue->measurements.rx_rssi_dBm[gNB_id] =
ue->measurements.rx_power_avg_dB[gNB_id] + 30 - SQ15_SQUARED_NORM_FACTOR_DB
- ((int)openair0_cfg[ue->rf_map.card].rx_gain[0] - (int)openair0_cfg[ue->rf_map.card].rx_gain_offset[0])
- dB_fixed(ue->frame_parms.ofdm_symbol_size);
LOG_D(PHY, "[gNB %d] Slot %d, RSSI %d dB (%d dBm/RE), WBandCQI %d dB, rxPwrAvg %d, n0PwrAvg %d\n",
gNB_id,
@@ -242,7 +245,7 @@ void nr_ue_ssb_rsrp_measurements(PHY_VARS_NR_UE *ue,
uint32_t rsrp_avg = nr_ue_calculate_ssb_rsrp(fp, proc, rxdataF, symbol_offset, fp->ssb_start_subcarrier);
float rsrp_db_per_re = 10 * log10(rsrp_avg);
openair0_config_t *cfg0 = &ue->openair0_cfg[0];
openair0_config_t *cfg0 = &openair0_cfg[ue->rf_map.card];
if (rsrp_avg == 0)
ue->measurements.ssb_rsrp_dBm[ssb_index] = -200; // lower than any value to be reported per Table 10.1.6.1-1 of 38.133
@@ -488,9 +491,10 @@ void do_neighboring_cell_measurements(UE_nr_rxtx_proc_t *proc, PHY_VARS_NR_UE *u
// RSRP measurements
neighboring_cell_info->ssb_rsrp = nr_ue_calculate_ssb_rsrp(frame_parms, proc, rxdataF, 0, frame_parms->ssb_start_subcarrier);
neighboring_cell_info->ssb_rsrp_dBm = 10 * log10(neighboring_cell_info->ssb_rsrp) + 30 - SQ15_SQUARED_NORM_FACTOR_DB
- ((int)ue->openair0_cfg[0].rx_gain[0] - (int)ue->openair0_cfg[0].rx_gain_offset[0])
- dB_fixed(ue->frame_parms.ofdm_symbol_size);
neighboring_cell_info->ssb_rsrp_dBm =
10 * log10(neighboring_cell_info->ssb_rsrp) + 30 - SQ15_SQUARED_NORM_FACTOR_DB
- ((int)openair0_cfg[ue->rf_map.card].rx_gain[0] - (int)openair0_cfg[ue->rf_map.card].rx_gain_offset[0])
- dB_fixed(ue->frame_parms.ofdm_symbol_size);
// Send SS measurements to MAC
send_ssb_rsrp_meas(ue, proc, neighbor_cell->Nid_cell, neighboring_cell_info->ssb_rsrp_dBm, true, -1, 0.0);
@@ -522,8 +526,8 @@ void nr_ue_rrc_measurements(PHY_VARS_NR_UE *ue,
const uint8_t k_length = 8;
uint8_t l_sss = (ue->symbol_offset + 2) % ue->frame_parms.symbols_per_slot;
unsigned int ssb_offset = ue->frame_parms.first_carrier_offset + ue->frame_parms.ssb_start_subcarrier;
double rx_gain = ue->openair0_cfg[0].rx_gain[0];
double rx_gain_offset = ue->openair0_cfg[0].rx_gain_offset[0];
double rx_gain = openair0_cfg[ue->rf_map.card].rx_gain[0];
double rx_gain_offset = openair0_cfg[ue->rf_map.card].rx_gain_offset[0];
ue->measurements.n0_power_tot = 0;
@@ -592,11 +596,11 @@ void nr_ue_rrc_measurements(PHY_VARS_NR_UE *ue,
// Measurement units:
// - RSRP: W (dBW)
// returns RXgain to be adjusted based on target rx power (50db) - received digital power in db/RE
int nr_sl_psbch_rsrp_measurements(sl_nr_ue_phy_params_t *sl_phy_params,
int nr_sl_psbch_rsrp_measurements(PHY_VARS_NR_UE *ue,
sl_nr_ue_phy_params_t *sl_phy_params,
NR_DL_FRAME_PARMS *fp,
c16_t rxdataF[][fp->samples_per_slot_wCP],
bool use_SSS,
openair0_config_t *openair0_cfg)
bool use_SSS)
{
SL_NR_UE_PSBCH_t *psbch_rx = &sl_phy_params->psbch;
uint8_t numsym = (fp->Ncp) ? SL_NR_NUM_SYMBOLS_SSB_EXT_CP : SL_NR_NUM_SYMBOLS_SSB_NORMAL_CP;
@@ -629,9 +633,10 @@ int nr_sl_psbch_rsrp_measurements(sl_nr_ue_phy_params_t *sl_phy_params,
}
psbch_rx->rsrp_dB_per_RE = 10 * log10(rsrp / num_re);
psbch_rx->rsrp_dBm_per_RE = psbch_rx->rsrp_dB_per_RE + 30 - SQ15_SQUARED_NORM_FACTOR_DB
- ((int)openair0_cfg[0].rx_gain[0] - (int)openair0_cfg[0].rx_gain_offset[0])
- dB_fixed(fp->ofdm_symbol_size);
psbch_rx->rsrp_dBm_per_RE =
psbch_rx->rsrp_dB_per_RE + 30 - SQ15_SQUARED_NORM_FACTOR_DB
- ((int)openair0_cfg[ue->rf_map.card].rx_gain[0] - (int)openair0_cfg[ue->rf_map.card].rx_gain_offset[0])
- dB_fixed(fp->ofdm_symbol_size);
int adjust_rxgain = TARGET_RX_POWER - psbch_rx->rsrp_dB_per_RE;
+4 -1
View File
@@ -45,6 +45,8 @@
//#define NR_CSIRS_DEBUG
//#define NR_CSIIM_DEBUG
extern openair0_config_t openair0_cfg[MAX_CARDS];
void nr_det_A_MF_2x2(int32_t *a_mf_00,
int32_t *a_mf_01,
int32_t *a_mf_10,
@@ -237,7 +239,8 @@ static int nr_get_csi_rs_signal(const PHY_VARS_NR_UE *ue,
*rsrp = rsrp_sum/meas_count;
*rsrp_dBm = dB_fixed(*rsrp) + 30 - SQ15_SQUARED_NORM_FACTOR_DB
- ((int)ue->openair0_cfg[0].rx_gain[0] - (int)ue->openair0_cfg[0].rx_gain_offset[0]) - dB_fixed(ue->frame_parms.ofdm_symbol_size);
- ((int)openair0_cfg[ue->rf_map.card].rx_gain[0] - (int)openair0_cfg[ue->rf_map.card].rx_gain_offset[0])
- dB_fixed(ue->frame_parms.ofdm_symbol_size);
#ifdef NR_CSIRS_DEBUG
LOG_I(NR_PHY, "RSRP = %i (%i dBm)\n", *rsrp, *rsrp_dBm);
@@ -501,7 +501,7 @@ nr_initial_sync_t sl_nr_slss_search(PHY_VARS_NR_UE *UE, UE_nr_rxtx_proc_t *proc,
sync_params->DFN,
sync_params->slot_offset);
UE->adjust_rxgain = nr_sl_psbch_rsrp_measurements(sl_ue, frame_parms, rxdataF, false, UE->openair0_cfg);
UE->adjust_rxgain = nr_sl_psbch_rsrp_measurements(UE, sl_ue, frame_parms, rxdataF, false);
UE->init_sync_frame = sync_params->remaining_frames;
result.rx_offset = sync_params->rx_offset;
@@ -260,25 +260,13 @@ bool nr_search_ssb_common(nr_ssb_search_params_t *params);
@param dl_Carrier Pointer to DL carrier to be set
@param ul_Carrier Pointer to UL carrier to be set
*/
void nr_get_carrier_frequencies(PHY_VARS_NR_UE *ue,
uint64_t *dl_Carrier,
uint64_t *ul_Carrier);
/*!
\brief This function gets the carrier frequencies either from FP or command-line-set global variables, depending on the availability of the latter
@param ue Pointer to PHY UE
@param sl_Carrier Pointer to SL carrier to be set
*/
void nr_get_carrier_frequencies_sl(PHY_VARS_NR_UE *ue,
uint64_t *sl_Carrier);
void nr_get_carrier_frequencies(const PHY_VARS_NR_UE *ue, uint64_t *dl_Carrier, uint64_t *ul_Carrier);
/*!
\brief This function sets the OAI RF card rx/tx params
@param openair0_cfg Pointer OAI config for a specific card
@param rx_gain_off Rx gain offset
*/
void nr_rf_card_config_gain(openair0_config_t *openair0_cfg,
double rx_gain_off);
void nr_rf_card_config_gain(openair0_config_t *openair0_cfg);
void nr_rf_card_config_freq(openair0_config_t *openair0_cfg,
uint64_t ul_Carrier,
@@ -34,9 +34,9 @@
extern PHY_VARS_NR_UE ***PHY_vars_UE_g;
void nr_get_carrier_frequencies(PHY_VARS_NR_UE *ue, uint64_t *dl_carrier, uint64_t *ul_carrier){
NR_DL_FRAME_PARMS *fp = &ue->frame_parms;
void nr_get_carrier_frequencies(const PHY_VARS_NR_UE *ue, uint64_t *dl_carrier, uint64_t *ul_carrier)
{
const NR_DL_FRAME_PARMS *fp = &ue->frame_parms;
if (ue->if_freq!=0) {
*dl_carrier = ue->if_freq;
*ul_carrier = *dl_carrier + ue->if_freq_off;
@@ -47,12 +47,8 @@ void nr_get_carrier_frequencies(PHY_VARS_NR_UE *ue, uint64_t *dl_carrier, uint64
}
}
void nr_rf_card_config_gain(openair0_config_t *openair0_cfg,
double rx_gain_off){
void nr_rf_card_config_gain(openair0_config_t *openair0_cfg)
{
uint8_t mod_id = 0;
uint8_t cc_id = 0;
PHY_VARS_NR_UE *ue = PHY_vars_UE_g[mod_id][cc_id];
@@ -65,7 +61,7 @@ void nr_rf_card_config_gain(openair0_config_t *openair0_cfg,
if (tx_gain)
openair0_cfg->tx_gain[i] = tx_gain;
if (rx_gain)
openair0_cfg->rx_gain[i] = rx_gain - rx_gain_off;
openair0_cfg->rx_gain[i] = rx_gain;
openair0_cfg->autocal[i] = 1;
+3 -2
View File
@@ -18,7 +18,7 @@ typedef struct {
#define SquaredNorm(VaR) ((VaR).r*(VaR).r+(VaR).i*(VaR).i)
typedef struct {
void ** samplesRx;
openair0_device *rfdevice;
openair0_device_t *rfdevice;
} calibData_t;
typedef struct OAIgraph {
@@ -384,7 +384,8 @@ static void *scopeThread(void *arg) {
return NULL;
}
void CalibrationInitScope(void ** samplesRx,openair0_device *rfdevice) {
void CalibrationInitScope(void **samplesRx, openair0_device_t *rfdevice)
{
pthread_t forms_thread;
calibData_t *tmp = (calibData_t *)malloc_or_fail(sizeof(*tmp));
tmp->samplesRx=samplesRx;
+1 -1
View File
@@ -1,5 +1,5 @@
#ifndef CALIB_SCOPE_H
#define CALIB_SCOPE_H
void CalibrationInitScope(void ** samplesRx,openair0_device *rfdevice);
void CalibrationInitScope(void **samplesRx, openair0_device_t *rfdevice);
#endif
+2 -10
View File
@@ -110,14 +110,6 @@ int main(int argc, char **argv) {
.autocal={0},
//! Configuration file for LMS7002M
.configFilename="",
//! remote IP/MAC addr for Ethernet interface
.remote_addr="",
//! remote port number for Ethernet interface
.remote_port=0,
//! local IP/MAC addr for Ethernet interface (eNB/BBU, UE)
.my_addr=0,
//! local port number for Ethernet interface (eNB/BBU, UE)
.my_port=0,
//! record player configuration, definition in record_player.h
.recplay_mode=0,
.recplay_conf=NULL,
@@ -125,7 +117,7 @@ int main(int argc, char **argv) {
.samples_per_tti=0,
};
//-----------------------
openair0_device rfdevice= {
openair0_device_t rfdevice= {
/*!tx write thread*/
//.write_thread={0},
/*!brief Module ID of this device */
@@ -306,7 +298,7 @@ int main(int argc, char **argv) {
}
CalibrationInitScope(samplesRx, &rfdevice);
openair0_timestamp timestamp=0;
openair0_timestamp_t timestamp=0;
rfdevice.trx_start_func(&rfdevice);
while(!oai_exit) {
+11 -11
View File
@@ -222,7 +222,7 @@ typedef struct {
/// Context data structure for RX/TX portion of subframe processing
typedef struct {
/// timestamp transmitted to HW
openair0_timestamp timestamp_tx;
openair0_timestamp_t timestamp_tx;
/// subframe to act upon for transmission
int subframe_tx;
/// subframe to act upon for reception
@@ -273,9 +273,9 @@ typedef struct eNB_proc_NB_IoT_t_s {
/// thread index
int thread_index;
/// timestamp received from HW
openair0_timestamp timestamp_rx;
openair0_timestamp_t timestamp_rx;
/// timestamp to send to "slave rru"
openair0_timestamp timestamp_tx;
openair0_timestamp_t timestamp_tx;
/// subframe to act upon for reception
int subframe_rx;
/// symbol mask for IF4p5 reception per subframe
@@ -414,7 +414,7 @@ typedef struct {
/// index of the current UE RX/TX proc
int proc_id;
/// timestamp transmitted to HW
openair0_timestamp timestamp_tx;
openair0_timestamp_t timestamp_tx;
/// subframe to act upon for transmission
int subframe_tx;
/// subframe to act upon for reception
@@ -445,7 +445,7 @@ typedef struct {
/// Context data structure for eNB subframe processing
typedef struct {
/// Last RX timestamp
openair0_timestamp timestamp_rx;
openair0_timestamp_t timestamp_rx;
/// pthread attributes for main UE thread
pthread_attr_t attr_ue;
/// scheduling parameters for main UE thread
@@ -484,9 +484,9 @@ typedef struct PHY_VARS_eNB_NB_IoT_s {
eth_params_t eth_params_n;
/// Ethernet parameters for fronthaul interface (upper L1 to Radio head)
eth_params_t eth_params;
openair0_rf_map rf_map;
openair0_rf_map_t rf_map;
int abstraction_flag;
openair0_timestamp ts_offset;
openair0_timestamp_t ts_offset;
// indicator for synchronization state of eNB
int in_synch;
// indicator for master/slave (RRU)
@@ -672,8 +672,8 @@ typedef struct PHY_VARS_eNB_NB_IoT_s {
int32_t pusch_stats_BO[NUMBER_OF_UE_MAX][10240];
/// RF and Interface devices per CC
openair0_device rfdevice;
openair0_device ifdevice;
openair0_device_t rfdevice;
openair0_device_t ifdevice;
/// Pointer for ifdevice buffer struct
if_buffer_t ifbuffer;
@@ -731,7 +731,7 @@ typedef struct {
/// \brief Module ID indicator for this instance
uint8_t Mod_id;
/// \brief Mapping of CC_id antennas to cards
openair0_rf_map rf_map;
openair0_rf_map_t rf_map;
//uint8_t local_flag;
/// \brief Indicator of current run mode of UE (normal_txrx, rx_calib_ue, no_L2_connect, debug_prach)
runmode_NB_IoT_t mode;
@@ -956,7 +956,7 @@ typedef struct {
time_stats_t tx_prach;
/// RF and Interface devices per CC
openair0_device rfdevice;
openair0_device_t rfdevice;
time_stats_t dlsch_encoding_SIC_stats;
time_stats_t dlsch_scrambling_SIC_stats;
time_stats_t dlsch_modulation_SIC_stats;
+8 -8
View File
@@ -196,9 +196,9 @@ typedef struct RU_proc_t_s {
/// Pointer to associated RU descriptor
struct RU_t_s *ru;
/// timestamp received from HW
openair0_timestamp timestamp_rx;
openair0_timestamp_t timestamp_rx;
/// timestamp to send to "slave rru"
openair0_timestamp timestamp_tx;
openair0_timestamp_t timestamp_tx;
/// subframe (LTE) / slot (NR) to act upon for reception
int tti_rx;
/// subframe (LTE) / slot (NR) to act upon for transmission
@@ -354,7 +354,7 @@ typedef struct RU_proc_t_s {
/// subframe to act upon for transmission
int subframe_phy_tx;
/// timestamp to send to "slave rru"
openair0_timestamp timestamp_phy_tx;
openair0_timestamp_t timestamp_phy_tx;
/// pthread structure for RF TX thread
pthread_t pthread_rf_tx;
pthread_mutex_t mutex_rf_tx;
@@ -500,7 +500,7 @@ typedef struct RU_t_s {
/// "end of burst delay" used in TDD (unit: number of samples at 30.72MHz) (this is an expert option)
int end_of_burst_delay;
/// RF device descriptor
openair0_device rfdevice;
openair0_device_t rfdevice;
/// HW configuration
openair0_config_t openair0_cfg;
/// Number of NBs using this RU
@@ -510,9 +510,9 @@ typedef struct RU_t_s {
struct PHY_VARS_eNB_s *eNB_list[NUMBER_OF_eNB_MAX];
struct PHY_VARS_gNB_s *gNB_list[NUMBER_OF_gNB_MAX];
/// Mapping of antenna ports to RF chain index
openair0_rf_map rf_map;
openair0_rf_map_t rf_map;
/// IF device descriptor
openair0_device ifdevice;
openair0_device_t ifdevice;
/// Pointer for ifdevice buffer struct
if_buffer_t ifbuffer;
/// if prach processing is to be performed in RU
@@ -599,7 +599,7 @@ typedef struct RU_t_s {
/// sequence number for IF5
uint8_t seqno;
/// initial timestamp used as an offset make first real timestamp 0
openair0_timestamp ts_offset;
openair0_timestamp_t ts_offset;
/// Current state of the RU
rru_state_t state;
/// Command to do
@@ -758,7 +758,7 @@ typedef struct processingData_RU {
int frame_tx;
int slot_tx;
int next_slot;
openair0_timestamp timestamp_tx;
openair0_timestamp_t timestamp_tx;
RU_t *ru;
} processingData_RU_t;
#endif //__PHY_DEFS_RU__H__
+4 -4
View File
@@ -91,7 +91,7 @@ typedef struct {
/// Component Carrier index
uint8_t CC_id;
/// timestamp transmitted to HW
openair0_timestamp timestamp_tx;
openair0_timestamp_t timestamp_tx;
/// subframe to act upon for transmission
int subframe_tx;
/// subframe to act upon for reception
@@ -148,7 +148,7 @@ typedef struct {
/// Component Carrier index
uint8_t CC_id;
/// Last RX timestamp
openair0_timestamp timestamp_rx;
openair0_timestamp_t timestamp_rx;
/// pthread attributes for main UE thread
pthread_attr_t attr_ue;
/// scheduling parameters for main UE thread
@@ -550,7 +550,7 @@ typedef struct {
/// \brief Component carrier ID for this PHY instance
uint8_t CC_id;
/// \brief Mapping of CC_id antennas to cards
openair0_rf_map rf_map;
openair0_rf_map_t rf_map;
//uint8_t local_flag;
/// \brief Indicator of current run mode of UE (normal_txrx, rx_calib_ue, no_L2_connect, debug_prach)
runmode_t mode;
@@ -817,7 +817,7 @@ typedef struct {
int instance_cnt_timer;
/// RF and Interface devices per CC
openair0_device rfdevice;
openair0_device_t rfdevice;
void *scopeData;
} PHY_VARS_UE;
+4 -4
View File
@@ -218,8 +218,8 @@ typedef struct {
/// Component Carrier index
uint8_t CC_id;
/// timestamp transmitted to HW
openair0_timestamp timestamp_tx;
openair0_timestamp timestamp_rx;
openair0_timestamp_t timestamp_tx;
openair0_timestamp_t timestamp_rx;
/// subframe to act upon for transmission
int subframe_tx;
/// subframe to act upon for reception
@@ -285,9 +285,9 @@ typedef struct L1_proc_t_s {
/// thread index
int thread_index;
/// timestamp received from HW
openair0_timestamp timestamp_rx;
openair0_timestamp_t timestamp_rx;
/// timestamp to send to "slave rru"
openair0_timestamp timestamp_tx;
openair0_timestamp_t timestamp_tx;
/// subframe to act upon for reception
int subframe_rx;
/// subframe to act upon for PRACH
+5 -5
View File
@@ -288,7 +288,7 @@ typedef struct {
/// Component Carrier index
uint8_t CC_id;
/// timestamp transmitted to HW
openair0_timestamp timestamp_tx;
openair0_timestamp_t timestamp_tx;
/// slot to act upon for transmission
int slot_tx;
/// slot to act upon for reception
@@ -312,9 +312,9 @@ typedef struct gNB_L1_proc_t_s {
/// Component Carrier index
uint8_t CC_id;
/// timestamp received from HW
openair0_timestamp timestamp_rx;
openair0_timestamp_t timestamp_rx;
/// timestamp to send to "slave rru"
openair0_timestamp timestamp_tx;
openair0_timestamp_t timestamp_tx;
/// slot to act upon for reception
int slot_rx;
/// frame to act upon for reception
@@ -566,7 +566,7 @@ union ldpcReqUnion {
typedef struct processingData_L1 {
int frame_rx;
int slot_rx;
openair0_timestamp timestamp_tx;
openair0_timestamp_t timestamp_tx;
PHY_VARS_gNB *gNB;
notifiedFIFO_elt_t *elt;
} processingData_L1_t;
@@ -576,7 +576,7 @@ typedef struct processingData_L1tx {
int slot;
int frame_rx;
int slot_rx;
openair0_timestamp timestamp_tx;
openair0_timestamp_t timestamp_tx;
PHY_VARS_gNB *gNB;
} processingData_L1tx_t;
+31 -7
View File
@@ -113,7 +113,7 @@ typedef struct {
/// Component Carrier index
uint8_t CC_id;
/// Last RX timestamp
openair0_timestamp timestamp_rx;
openair0_timestamp_t timestamp_rx;
} UE_nr_proc_t;
typedef enum {
@@ -342,15 +342,42 @@ typedef struct UE_NR_SCAN_INFO_s {
int32_t freq_offset_Hz[3][10];
} UE_NR_SCAN_INFO_t;
typedef struct {
unsigned int nb_tx;
unsigned int nb_rx;
unsigned int att_tx;
unsigned int att_rx;
int max_rxgain;
char *sdr_addrs;
char *tx_subdev;
char *rx_subdev;
clock_source_t clock_source;
clock_source_t time_source;
double tune_offset;
uint64_t if_frequency;
int if_freq_offset;
int used_by_cell;
} nrUE_RU_params_t;
typedef struct {
int ru_id;
int band;
uint64_t rf_frequency;
int64_t rf_freq_offset;
int numerology;
int N_RB_DL;
int ssb_start;
int used_by_ue;
} nrUE_cell_params_t;
/// Top-level PHY Data Structure for UE
typedef struct PHY_VARS_NR_UE_s {
openair0_config_t openair0_cfg[MAX_CARDS];
/// \brief Module ID indicator for this instance
uint8_t Mod_id;
/// \brief Component carrier ID for this PHY instance
uint8_t CC_id;
/// \brief Mapping of CC_id antennas to cards
openair0_rf_map rf_map;
openair0_rf_map_t rf_map;
/// \brief Indicator that UE should perform band scanning
int UE_scan;
/// \brief Indicator that UE should perform coarse scanning around carrier
@@ -507,9 +534,6 @@ typedef struct PHY_VARS_NR_UE_s {
time_stats_t ue_ul_indication_stats;
nr_ue_phy_cpu_stat_t phy_cpu_stats;
/// RF and Interface devices per CC
openair0_device rfdevice;
/// Phase precompensation flag
bool no_phase_pre_comp;
@@ -540,7 +564,7 @@ typedef struct PHY_VARS_NR_UE_s {
} PHY_VARS_NR_UE;
typedef struct {
openair0_timestamp timestamp_tx;
openair0_timestamp_t timestamp_tx;
int gNB_id;
/// NR slot index within frame_tx [0 .. slots_per_frame - 1] to act upon for transmission
int nr_slot_tx;
+1 -1
View File
@@ -334,7 +334,7 @@ uint32_t get_samples_slot_duration(const NR_DL_FRAME_PARMS *fp, unsigned int sta
// Get timestamp of slot from start of frame
uint32_t get_samples_slot_timestamp(const NR_DL_FRAME_PARMS *fp, unsigned int slot);
// Get slot from timestamp
uint32_t get_slot_from_timestamp(openair0_timestamp timestamp_rx, const NR_DL_FRAME_PARMS *fp);
uint32_t get_slot_from_timestamp(openair0_timestamp_t timestamp_rx, const NR_DL_FRAME_PARMS *fp);
// Get number of samples in the slot
uint32_t get_samples_per_slot(int slot, const NR_DL_FRAME_PARMS *fp);
@@ -229,7 +229,7 @@ int psbch_pscch_processing(PHY_VARS_NR_UE *ue, const UE_nr_rxtx_proc_t *proc, nr
sym = (sym == 0) ? 5 : sym + 1;
}
ue->adjust_rxgain = nr_sl_psbch_rsrp_measurements(sl_phy_params, fp, rxdataF, false, ue->openair0_cfg);
ue->adjust_rxgain = nr_sl_psbch_rsrp_measurements(ue, sl_phy_params, fp, rxdataF, false);
LOG_D(NR_PHY, " ------ Decode SL-MIB: frame.slot %d.%d ------ \n", frame_rx % 1024, nr_slot_rx);
+1 -1
View File
@@ -19,7 +19,7 @@
* contact@openairinterface.org
*/
openair0_device openair0;
openair0_device_t openair0;
int oai_exit=0;
void exit_function(const char* file, const char* function, const int line,const char* s, const int assert) {

Some files were not shown because too many files have changed in this diff Show More