diff --git a/ci-scripts/conf_files/gnb-cu.sa.f1.conf b/ci-scripts/conf_files/gnb-cu.sa.f1.conf
index 1cd2d76318..2126aac17f 100644
--- a/ci-scripts/conf_files/gnb-cu.sa.f1.conf
+++ b/ci-scripts/conf_files/gnb-cu.sa.f1.conf
@@ -22,8 +22,8 @@ gNBs =
tr_s_preference = "f1";
- local_s_address = "192.168.68.194";
- remote_s_address = "192.168.68.195";
+ local_s_address = "127.0.0.4";
+ remote_s_address = "127.0.0.5";
local_s_portc = 501;
local_s_portd = 2153;
remote_s_portc = 500;
@@ -44,8 +44,8 @@ gNBs =
NETWORK_INTERFACES :
{
- GNB_IPV4_ADDRESS_FOR_NG_AMF = "192.168.68.194";
- GNB_IPV4_ADDRESS_FOR_NGU = "192.168.68.194";
+ GNB_IPV4_ADDRESS_FOR_NG_AMF = "172.21.16.109";
+ GNB_IPV4_ADDRESS_FOR_NGU = "172.21.16.109";
GNB_PORT_FOR_S1U = 2152; # Spec 2152
};
}
diff --git a/ci-scripts/conf_files/gnb-cucp.sa.f1.quectel.conf b/ci-scripts/conf_files/gnb-cucp.sa.f1.quectel.conf
index 7f7daa1370..153e7f77a3 100644
--- a/ci-scripts/conf_files/gnb-cucp.sa.f1.quectel.conf
+++ b/ci-scripts/conf_files/gnb-cucp.sa.f1.quectel.conf
@@ -23,8 +23,8 @@ gNBs =
tr_s_preference = "f1";
- local_s_address = "192.168.68.194";
- remote_s_address = "192.168.68.195";
+ local_s_address = "127.0.0.4";
+ remote_s_address = "127.0.0.5";
local_s_portc = 501;
local_s_portd = 2153;
remote_s_portc = 500;
@@ -46,16 +46,16 @@ gNBs =
(
{
type = "cp";
- ipv4_cucp = "192.168.68.194";
+ ipv4_cucp = "127.0.0.4";
port_cucp = 38462;
- ipv4_cuup = "192.168.68.196";
+ ipv4_cuup = "127.0.0.6";
port_cuup = 38462;
}
)
NETWORK_INTERFACES :
{
- GNB_IPV4_ADDRESS_FOR_NG_AMF = "192.168.68.194";
+ GNB_IPV4_ADDRESS_FOR_NG_AMF = "172.21.16.109";
};
}
);
diff --git a/ci-scripts/conf_files/gnb-cuup.sa.f1.quectel.conf b/ci-scripts/conf_files/gnb-cuup.sa.f1.quectel.conf
index 2b231e950d..fa6532be7b 100644
--- a/ci-scripts/conf_files/gnb-cuup.sa.f1.quectel.conf
+++ b/ci-scripts/conf_files/gnb-cuup.sa.f1.quectel.conf
@@ -21,8 +21,8 @@ gNBs =
tr_s_preference = "f1";
- local_s_address = "192.168.68.196";
- remote_s_address = "192.168.68.195";
+ local_s_address = "127.0.0.6";
+ remote_s_address = "127.0.0.5";
local_s_portc = 501;
local_s_portd = 2153;
remote_s_portc = 500;
@@ -40,15 +40,15 @@ gNBs =
(
{
type = "up";
- ipv4_cucp = "192.168.68.194";
- ipv4_cuup = "192.168.68.196";
+ ipv4_cucp = "127.0.0.4";
+ ipv4_cuup = "127.0.0.6";
}
)
NETWORK_INTERFACES :
{
- GNB_IPV4_ADDRESS_FOR_NG_AMF = "192.168.68.196";
- GNB_IPV4_ADDRESS_FOR_NGU = "192.168.68.196";
+ GNB_IPV4_ADDRESS_FOR_NG_AMF = "172.21.16.109";
+ GNB_IPV4_ADDRESS_FOR_NGU = "172.21.16.109";
GNB_PORT_FOR_S1U = 2152; # Spec 2152
};
}
diff --git a/ci-scripts/conf_files/gnb-du.sa.band1.52prb.usrpb210.conf b/ci-scripts/conf_files/gnb-du.sa.band1.52prb.usrpb210.conf
index 5afadb781a..7c4550b346 100644
--- a/ci-scripts/conf_files/gnb-du.sa.band1.52prb.usrpb210.conf
+++ b/ci-scripts/conf_files/gnb-du.sa.band1.52prb.usrpb210.conf
@@ -162,8 +162,8 @@ MACRLCs = (
num_cc = 1;
tr_s_preference = "local_L1";
tr_n_preference = "f1";
- local_n_address = "192.168.68.195";
- remote_n_address = "192.168.68.194";
+ local_n_address = "127.0.0.5";
+ remote_n_address = "127.0.0.4";
local_n_portc = 500;
local_n_portd = 2153;
remote_n_portc = 501;
diff --git a/ci-scripts/conf_files/gnb-du.sa.band78.106prb.usrpb200.conf b/ci-scripts/conf_files/gnb-du.sa.band78.106prb.usrpb200.conf
index 07be610807..24a81ae0ae 100644
--- a/ci-scripts/conf_files/gnb-du.sa.band78.106prb.usrpb200.conf
+++ b/ci-scripts/conf_files/gnb-du.sa.band78.106prb.usrpb200.conf
@@ -169,8 +169,8 @@ MACRLCs = (
num_cc = 1;
tr_s_preference = "local_L1";
tr_n_preference = "f1";
- local_n_address = "192.168.68.195";
- remote_n_address = "192.168.68.194";
+ local_n_address = "127.0.0.5";
+ remote_n_address = "127.0.0.4";
local_n_portc = 500;
local_n_portd = 2153;
remote_n_portc = 501;
diff --git a/ci-scripts/conf_files/gnb.sa.band78.106prb.usrpb200.sc-fdma.conf b/ci-scripts/conf_files/gnb.sa.band78.106prb.usrpb200.sc-fdma.conf
index 82fb9f90e1..6a82a57dcd 100644
--- a/ci-scripts/conf_files/gnb.sa.band78.106prb.usrpb200.sc-fdma.conf
+++ b/ci-scripts/conf_files/gnb.sa.band78.106prb.usrpb200.sc-fdma.conf
@@ -161,8 +161,8 @@ gNBs =
NETWORK_INTERFACES :
{
- GNB_IPV4_ADDRESS_FOR_NG_AMF = "192.168.68.194";
- GNB_IPV4_ADDRESS_FOR_NGU = "192.168.68.194";
+ GNB_IPV4_ADDRESS_FOR_NG_AMF = "172.21.16.109";
+ GNB_IPV4_ADDRESS_FOR_NGU = "172.21.16.109";
GNB_PORT_FOR_S1U = 2152; # Spec 2152
};
diff --git a/ci-scripts/conf_files/gnb.sa.band78.51prb.usrpb200.conf b/ci-scripts/conf_files/gnb.sa.band78.51prb.usrpb200.conf
index c39f38d55e..a53fefea34 100644
--- a/ci-scripts/conf_files/gnb.sa.band78.51prb.usrpb200.conf
+++ b/ci-scripts/conf_files/gnb.sa.band78.51prb.usrpb200.conf
@@ -161,8 +161,8 @@ gNBs =
NETWORK_INTERFACES :
{
- GNB_IPV4_ADDRESS_FOR_NG_AMF = "192.168.68.194";
- GNB_IPV4_ADDRESS_FOR_NGU = "192.168.68.194";
+ GNB_IPV4_ADDRESS_FOR_NG_AMF = "172.21.16.109";
+ GNB_IPV4_ADDRESS_FOR_NGU = "172.21.16.109";
GNB_PORT_FOR_S1U = 2152; # Spec 2152
};
diff --git a/ci-scripts/xml_files/container_sa_b200_quectel.xml b/ci-scripts/xml_files/container_sa_b200_quectel.xml
index 3eff9cddfd..db4c9d1d67 100644
--- a/ci-scripts/xml_files/container_sa_b200_quectel.xml
+++ b/ci-scripts/xml_files/container_sa_b200_quectel.xml
@@ -185,14 +185,14 @@
Custom_Command
Trigger Reestablishment
ofqot
- echo ci force_reestab | nc -N 192.168.68.194 9090 | grep -E 'Reset RLC counters of UE RNTI [0-9a-f]{4} to trigger reestablishment'
+ echo ci force_reestab | nc -N 127.0.0.1 9090 | grep -E 'Reset RLC counters of UE RNTI [0-9a-f]{4} to trigger reestablishment'
yes
Custom_Command
Verify Reestablishment
ofqot
- echo ci get_reestab_count | nc -N 192.168.68.194 9090 | grep -E 'UE RNTI [0-9a-f]{4} reestab 1'
+ echo ci get_reestab_count | nc -N 127.0.0.1 9090 | grep -E 'UE RNTI [0-9a-f]{4} reestab 1'
yes
diff --git a/ci-scripts/xml_files/container_sa_e1_b200_quectel.xml b/ci-scripts/xml_files/container_sa_e1_b200_quectel.xml
index b888cdb855..92577c3abc 100644
--- a/ci-scripts/xml_files/container_sa_e1_b200_quectel.xml
+++ b/ci-scripts/xml_files/container_sa_e1_b200_quectel.xml
@@ -177,14 +177,14 @@
Custom_Command
Trigger Reestablishment (on DU)
ofqot
- echo ci force_reestab | nc -N 192.168.68.195 9090 | grep -E 'Reset RLC counters of UE RNTI [0-9a-f]{4} to trigger reestablishment'
+ echo ci force_reestab | nc -N 127.0.0.1 9091 | grep -E 'Reset RLC counters of UE RNTI [0-9a-f]{4} to trigger reestablishment'
yes
Custom_Command
Verify Reestablishment (on CU)
ofqot
- echo ci get_reestab_count | nc -N 192.168.68.194 9090 | grep -E 'UE RNTI [0-9a-f]{4} reestab 1'
+ echo ci get_reestab_count | nc -N 127.0.0.1 9090 | grep -E 'UE RNTI [0-9a-f]{4} reestab 1'
yes
diff --git a/ci-scripts/xml_files/container_sa_f1_b200_quectel.xml b/ci-scripts/xml_files/container_sa_f1_b200_quectel.xml
index df69f4c32c..6989c8fc26 100644
--- a/ci-scripts/xml_files/container_sa_f1_b200_quectel.xml
+++ b/ci-scripts/xml_files/container_sa_f1_b200_quectel.xml
@@ -209,14 +209,14 @@
Custom_Command
Trigger Reestablishment (on DU)
ofqot
- echo ci force_reestab | nc -N 192.168.68.195 9090 | grep -E 'Reset RLC counters of UE RNTI [0-9a-f]{4} to trigger reestablishment'
+ echo ci force_reestab | nc -N 127.0.0.1 9091 | grep -E 'Reset RLC counters of UE RNTI [0-9a-f]{4} to trigger reestablishment'
yes
Custom_Command
Verify Reestablishment (on CU)
ofqot
- echo ci get_reestab_count | nc -N 192.168.68.194 9090 | grep -E 'UE RNTI [0-9a-f]{4} reestab 1'
+ echo ci get_reestab_count | nc -N 127.0.0.1 9090 | grep -E 'UE RNTI [0-9a-f]{4} reestab 1'
yes
diff --git a/ci-scripts/xml_files/container_sa_sc_b200_quectel.xml b/ci-scripts/xml_files/container_sa_sc_b200_quectel.xml
index 4c1e2ab506..09720f422a 100644
--- a/ci-scripts/xml_files/container_sa_sc_b200_quectel.xml
+++ b/ci-scripts/xml_files/container_sa_sc_b200_quectel.xml
@@ -179,14 +179,14 @@
Custom_Command
Trigger Reestablishment
ofqot
- echo ci force_reestab | nc -N 192.168.68.194 9090 | grep -E 'Reset RLC counters of UE RNTI [0-9a-f]{4} to trigger reestablishment'
+ echo ci force_reestab | nc -N 127.0.0.1 9090 | grep -E 'Reset RLC counters of UE RNTI [0-9a-f]{4} to trigger reestablishment'
yes
Custom_Command
Verify Reestablishment
ofqot
- echo ci get_reestab_count | nc -N 192.168.68.194 9090 | grep -E 'UE RNTI [0-9a-f]{4} reestab 1'
+ echo ci get_reestab_count | nc -N 127.0.0.1 9090 | grep -E 'UE RNTI [0-9a-f]{4} reestab 1'
yes
diff --git a/ci-scripts/yaml_files/sa_b200_gnb/docker-compose.yml b/ci-scripts/yaml_files/sa_b200_gnb/docker-compose.yml
index a859159e59..e440cec52d 100644
--- a/ci-scripts/yaml_files/sa_b200_gnb/docker-compose.yml
+++ b/ci-scripts/yaml_files/sa_b200_gnb/docker-compose.yml
@@ -11,9 +11,11 @@ services:
volumes:
- ../../conf_files/gnb.sa.band78.51prb.usrpb200.conf:/opt/oai-gnb/etc/gnb.conf
- /dev:/dev
- networks:
- public_net:
- ipv4_address: 192.168.68.194
+ # for performance reasons, we use host mode: in bridge mode, we have
+ # unacceptable DL TCP performance. However, the whole point of
+ # containerization is to not be in host mode, so update this to macvlan
+ # later.
+ network_mode: "host"
#entrypoint: /bin/bash -c "sleep infinity"
healthcheck:
# pgrep does NOT work
@@ -21,12 +23,3 @@ services:
interval: 10s
timeout: 5s
retries: 5
-
-networks:
- public_net:
- name: sa-b200-gnb-net
- ipam:
- config:
- - subnet: 192.168.68.192/26
- driver_opts:
- com.docker.network.bridge.name: "sa-gnb-net"
diff --git a/ci-scripts/yaml_files/sa_e1_b200_gnb/docker-compose.yml b/ci-scripts/yaml_files/sa_e1_b200_gnb/docker-compose.yml
index 5cb9d350c2..7798d41c88 100644
--- a/ci-scripts/yaml_files/sa_e1_b200_gnb/docker-compose.yml
+++ b/ci-scripts/yaml_files/sa_e1_b200_gnb/docker-compose.yml
@@ -6,12 +6,16 @@ services:
ulimits:
core: -1 # for core dumps
environment:
- USE_ADDITIONAL_OPTIONS: --sa --telnetsrv --telnetsrv.shrmod ci --log_config.global_log_options level,nocolor,time,line_num,function
+ USE_ADDITIONAL_OPTIONS: --sa
+ --telnetsrv --telnetsrv.listenport 9090 --telnetsrv.shrmod ci
+ --log_config.global_log_options level,nocolor,time,line_num,function
volumes:
- ../../conf_files/gnb-cucp.sa.f1.quectel.conf:/opt/oai-gnb/etc/gnb.conf
- networks:
- public_net:
- ipv4_address: 192.168.68.194
+ # for performance reasons, we use host mode: in bridge mode, we have
+ # unacceptable DL TCP performance. However, the whole point of
+ # containerization is to not be in host mode, so update this to macvlan
+ # later.
+ network_mode: "host"
healthcheck:
# pgrep does NOT work
test: /bin/bash -c "ps aux | grep -v grep | grep -c softmodem"
@@ -26,12 +30,15 @@ services:
ulimits:
core: -1 # for core dumps
environment:
- USE_ADDITIONAL_OPTIONS: --sa --log_config.global_log_options level,nocolor,time,line_num,function
+ USE_ADDITIONAL_OPTIONS: --sa
+ --log_config.global_log_options level,nocolor,time,line_num,function
volumes:
- ../../conf_files/gnb-cuup.sa.f1.quectel.conf:/opt/oai-gnb/etc/gnb.conf
- networks:
- public_net:
- ipv4_address: 192.168.68.196
+ # for performance reasons, we use host mode: in bridge mode, we have
+ # unacceptable DL TCP performance. However, the whole point of
+ # containerization is to not be in host mode, so update this to macvlan
+ # later.
+ network_mode: "host"
healthcheck:
# pgrep does NOT work
test: /bin/bash -c "ps aux | grep -v grep | grep -c nr-cuup"
@@ -50,16 +57,18 @@ services:
USE_ADDITIONAL_OPTIONS: --sa
--RUs.[0].sdr_addrs serial=30C51D4
--continuous-tx -E
- --telnetsrv --telnetsrv.shrmod ci
+ --telnetsrv --telnetsrv.listenport 9091 --telnetsrv.shrmod ci
--gNBs.[0].min_rxtxtime 2 --gNBs.[0].do_CSIRS 1 --gNBs.[0].do_SRS 1
--RUs.[0].att_rx 14 --RUs.[0].att_tx 14
--log_config.global_log_options level,nocolor,time,line_num,function
volumes:
- ../../conf_files/gnb-du.sa.band78.106prb.usrpb200.conf:/opt/oai-gnb/etc/gnb.conf
- /dev:/dev
- networks:
- public_net:
- ipv4_address: 192.168.68.195
+ # for performance reasons, we use host mode: in bridge mode, we have
+ # unacceptable DL TCP performance. However, the whole point of
+ # containerization is to not be in host mode, so update this to macvlan
+ # later.
+ network_mode: "host"
#entrypoint: /bin/bash -c "sleep infinity"
healthcheck:
# pgrep does NOT work
@@ -67,12 +76,3 @@ services:
interval: 10s
timeout: 5s
retries: 5
-
-networks:
- public_net:
- name: sa-b200-gnb-net
- ipam:
- config:
- - subnet: 192.168.68.192/26
- driver_opts:
- com.docker.network.bridge.name: "sa-gnb-net"
diff --git a/ci-scripts/yaml_files/sa_f1_b200_gnb/docker-compose.yml b/ci-scripts/yaml_files/sa_f1_b200_gnb/docker-compose.yml
index 97438eb67e..b2f682aada 100644
--- a/ci-scripts/yaml_files/sa_f1_b200_gnb/docker-compose.yml
+++ b/ci-scripts/yaml_files/sa_f1_b200_gnb/docker-compose.yml
@@ -6,12 +6,16 @@ services:
ulimits:
core: -1 # for core dumps
environment:
- USE_ADDITIONAL_OPTIONS: --sa --telnetsrv --telnetsrv.shrmod ci --log_config.global_log_options level,nocolor,time,line_num,function
+ USE_ADDITIONAL_OPTIONS: --sa
+ --telnetsrv --telnetsrv.listenport 9090 --telnetsrv.shrmod ci
+ --log_config.global_log_options level,nocolor,time,line_num,function
volumes:
- ../../conf_files/gnb-cu.sa.f1.conf:/opt/oai-gnb/etc/gnb.conf
- networks:
- public_net:
- ipv4_address: 192.168.68.194
+ # for performance reasons, we use host mode: in bridge mode, we have
+ # unacceptable DL TCP performance. However, the whole point of
+ # containerization is to not be in host mode, so update this to macvlan
+ # later.
+ network_mode: "host"
#entrypoint: /bin/bash -c "sleep infinity"
healthcheck:
# pgrep does NOT work
@@ -28,13 +32,18 @@ services:
core: -1 # for core dumps
environment:
USE_B2XX: 'yes'
- USE_ADDITIONAL_OPTIONS: --sa --RUs.[0].sdr_addrs serial=30C51D4 --continuous-tx --telnetsrv --telnetsrv.shrmod ci --log_config.global_log_options level,nocolor,time,line_num,function --gNBs.[0].min_rxtxtime 2 --gNBs.[0].do_CSIRS 1 --gNBs.[0].do_SRS 0 --L1s.[0].max_ldpc_iterations 20
+ USE_ADDITIONAL_OPTIONS: --sa --RUs.[0].sdr_addrs serial=30C51D4 --continuous-tx
+ --telnetsrv --telnetsrv.listenport 9091 --telnetsrv.shrmod ci
+ --gNBs.[0].min_rxtxtime 2 --gNBs.[0].do_CSIRS 1 --gNBs.[0].do_SRS 0 --L1s.[0].max_ldpc_iterations 20
+ --log_config.global_log_options level,nocolor,time,line_num,function
volumes:
- ../../conf_files/gnb-du.sa.band1.52prb.usrpb210.conf:/opt/oai-gnb/etc/gnb.conf
- /dev:/dev
- networks:
- public_net:
- ipv4_address: 192.168.68.195
+ # for performance reasons, we use host mode: in bridge mode, we have
+ # unacceptable DL TCP performance. However, the whole point of
+ # containerization is to not be in host mode, so update this to macvlan
+ # later.
+ network_mode: "host"
#entrypoint: /bin/bash -c "sleep infinity"
healthcheck:
# pgrep does NOT work
@@ -42,12 +51,3 @@ services:
interval: 10s
timeout: 5s
retries: 5
-
-networks:
- public_net:
- name: sa-b200-gnb-net
- ipam:
- config:
- - subnet: 192.168.68.192/26
- driver_opts:
- com.docker.network.bridge.name: "sa-gnb-net"
diff --git a/ci-scripts/yaml_files/sa_sc_b200_gnb/docker-compose.yml b/ci-scripts/yaml_files/sa_sc_b200_gnb/docker-compose.yml
index c82b5f428a..7bd0f03b10 100644
--- a/ci-scripts/yaml_files/sa_sc_b200_gnb/docker-compose.yml
+++ b/ci-scripts/yaml_files/sa_sc_b200_gnb/docker-compose.yml
@@ -11,9 +11,11 @@ services:
volumes:
- ../../conf_files/gnb.sa.band78.106prb.usrpb200.sc-fdma.conf:/opt/oai-gnb/etc/gnb.conf
- /dev:/dev
- networks:
- public_net:
- ipv4_address: 192.168.68.194
+ # for performance reasons, we use host mode: in bridge mode, we have
+ # unacceptable DL TCP performance. However, the whole point of
+ # containerization is to not be in host mode, so update this to macvlan
+ # later.
+ network_mode: "host"
#entrypoint: /bin/bash -c "sleep infinity"
healthcheck:
# pgrep does NOT work
@@ -21,12 +23,3 @@ services:
interval: 10s
timeout: 5s
retries: 5
-
-networks:
- public_net:
- name: sa-b200-gnb-net
- ipam:
- config:
- - subnet: 192.168.68.192/26
- driver_opts:
- com.docker.network.bridge.name: "sa-gnb-net"
diff --git a/common/utils/nr/nr_common.h b/common/utils/nr/nr_common.h
index 9efd8bd84f..6882028182 100644
--- a/common/utils/nr/nr_common.h
+++ b/common/utils/nr/nr_common.h
@@ -79,6 +79,12 @@ static inline const char *rnti_types(nr_rnti_type_t rr)
#define NR_MAX_NB_LAYERS 4 // 8
+// Since the IQ samples are represented by SQ15 R+I (see https://en.wikipedia.org/wiki/Q_(number_format)) we need to compensate when
+// calcualting signal energy. Instead of shifting each sample right by 15, we can normalize the result in dB scale once its
+// calcualted. Signal energy is calculated using RMS^2, where each sample is squared before taking the average of the sum, therefore
+// the total shift is 2 * 15, in dB scale thats 10log10(2^(15*2))
+#define SQ15_SQUARED_NORM_FACTOR_DB 90.3089986992
+
typedef struct nr_bandentry_s {
int16_t band;
uint64_t ul_min;
diff --git a/doc/RUNMODEM.md b/doc/RUNMODEM.md
index a85f0d9b0c..2544dce845 100644
--- a/doc/RUNMODEM.md
+++ b/doc/RUNMODEM.md
@@ -280,4 +280,6 @@ The DL logical antenna port configuration can be selected through configuration
Finally the number of TX physical antenna in the RU part of the configuration file, `nb_tx`, should be equal or larger than the total number of PDSCH logical antenna ports.
+It is possible to limit the number supported DL MIMO layers via RRC configuration, e.g. to a value lower than the number of logical antenna ports configured, by using the configuration file parameter `maxMIMO_layers`.
+
[Example of configuration file with parameters for 2-layer MIMO](https://gitlab.eurecom.fr/oai/openairinterface5g/-/blob/develop/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band77.fr1.273PRB.2x2.usrpn300.conf)
diff --git a/openair1/PHY/NR_ESTIMATION/nr_measurements_gNB.c b/openair1/PHY/NR_ESTIMATION/nr_measurements_gNB.c
index 0f68620048..ded4ece652 100644
--- a/openair1/PHY/NR_ESTIMATION/nr_measurements_gNB.c
+++ b/openair1/PHY/NR_ESTIMATION/nr_measurements_gNB.c
@@ -251,7 +251,7 @@ void nr_gnb_measurements(PHY_VARS_gNB *gNB,
ulsch_measurements->wideband_cqi_tot = dB_fixed2(rx_power_tot, meas->n0_power_tot);
ulsch_measurements->rx_rssi_dBm =
- rx_power_avg_dB + 30 - 10 * log10(pow(2, 30)) - (rx_gain - rx_gain_offset) - dB_fixed(fp->ofdm_symbol_size);
+ rx_power_avg_dB + 30 - SQ15_SQUARED_NORM_FACTOR_DB - (rx_gain - rx_gain_offset) - dB_fixed(fp->ofdm_symbol_size);
LOG_D(PHY,
"[RNTI %04x] RSSI %d dBm/RE, RSSI (digital) %d dB (N_RB_UL %d), WBand CQI tot %d dB, N0 Power tot %d, RX Power tot %d\n",
diff --git a/openair1/PHY/NR_UE_ESTIMATION/nr_dl_channel_estimation.c b/openair1/PHY/NR_UE_ESTIMATION/nr_dl_channel_estimation.c
index 012d5c2121..b4733f69cc 100644
--- a/openair1/PHY/NR_UE_ESTIMATION/nr_dl_channel_estimation.c
+++ b/openair1/PHY/NR_UE_ESTIMATION/nr_dl_channel_estimation.c
@@ -489,10 +489,10 @@ int nr_prs_channel_estimation(uint8_t gNB_id,
peak_estimator(&chT_interpol[rxAnt][0], NR_PRS_IDFT_OVERSAMP_FACTOR * frame_params->ofdm_symbol_size, &prs_toa, &ch_pwr, mean_val);
// adjusting the rx_gains for channel peak power
- ch_pwr_dbm = 10 * log10(ch_pwr) + 30 - 10 * log10(pow(2, 30)) - ((int)openair0_cfg[0].rx_gain[0] - (int)openair0_cfg[0].rx_gain_offset[0]) - dB_fixed(frame_params->ofdm_symbol_size);
+ ch_pwr_dbm = 10 * log10(ch_pwr) + 30 - SQ15_SQUARED_NORM_FACTOR_DB - ((int)openair0_cfg[0].rx_gain[0] - (int)openair0_cfg[0].rx_gain_offset[0]) - dB_fixed(frame_params->ofdm_symbol_size);
prs_meas[rxAnt]->rsrp_dBm =
- 10 * log10(prs_meas[rxAnt]->rsrp) + 30 - 10 * log10(pow(2, 30)) - ((int)openair0_cfg[0].rx_gain[0] - (int)openair0_cfg[0].rx_gain_offset[0]) - dB_fixed(ue->frame_parms.ofdm_symbol_size);
+ 10 * log10(prs_meas[rxAnt]->rsrp) + 30 - SQ15_SQUARED_NORM_FACTOR_DB - ((int)openair0_cfg[0].rx_gain[0] - (int)openair0_cfg[0].rx_gain_offset[0]) - dB_fixed(ue->frame_parms.ofdm_symbol_size);
//prs measurements
prs_meas[rxAnt]->gNB_id = gNB_id;
diff --git a/openair1/PHY/NR_UE_ESTIMATION/nr_ue_measurements.c b/openair1/PHY/NR_UE_ESTIMATION/nr_ue_measurements.c
index 8cd33743dd..8aa00b4683 100644
--- a/openair1/PHY/NR_UE_ESTIMATION/nr_ue_measurements.c
+++ b/openair1/PHY/NR_UE_ESTIMATION/nr_ue_measurements.c
@@ -157,7 +157,7 @@ void nr_ue_measurements(PHY_VARS_NR_UE *ue,
ue->measurements.rx_power_avg_dB[gNB_id] = dB_fixed( ue->measurements.rx_power_avg[gNB_id]);
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] - dB_fixed(ue->measurements.n0_power_avg);
- ue->measurements.rx_rssi_dBm[gNB_id] = ue->measurements.rx_power_avg_dB[gNB_id] + 30 - 10*log10(pow(2, 30)) - ((int)openair0_cfg[0].rx_gain[0] - (int)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[0].rx_gain[0] - (int)openair0_cfg[0].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,
@@ -219,7 +219,7 @@ void nr_ue_ssb_rsrp_measurements(PHY_VARS_NR_UE *ue,
rsrp /= nb_re;
ue->measurements.ssb_rsrp_dBm[ssb_index] = 10*log10(rsrp) +
- 30 - 10*log10(pow(2,30)) -
+ 30 - SQ15_SQUARED_NORM_FACTOR_DB -
((int)openair0_cfg[0].rx_gain[0] - (int)openair0_cfg[0].rx_gain_offset[0]) -
dB_fixed(ue->frame_parms.ofdm_symbol_size);
@@ -296,7 +296,7 @@ void nr_ue_rrc_measurements(PHY_VARS_NR_UE *ue,
#ifdef DEBUG_MEAS_RRC
const int psd_awgn = -174;
const int scs = 15000 * (1 << ue->frame_parms.numerology_index);
- const int nf_usrp = ue->measurements.n0_power_tot_dB + 3 + 30 - ((int)rx_gain - (int)rx_gain_offset) - 10 * log10(pow(2, 30)) - (psd_awgn + dB_fixed(scs) + dB_fixed(ue->frame_parms.ofdm_symbol_size));
+ const int nf_usrp = ue->measurements.n0_power_tot_dB + 3 + 30 - ((int)rx_gain - (int)rx_gain_offset) - SQ15_SQUARED_NORM_FACTOR_DB - (psd_awgn + dB_fixed(scs) + dB_fixed(ue->frame_parms.ofdm_symbol_size));
LOG_D(PHY, "In [%s][slot:%d] NF USRP %d dB\n", __FUNCTION__, slot, nf_usrp);
#endif
@@ -306,7 +306,7 @@ void nr_ue_rrc_measurements(PHY_VARS_NR_UE *ue,
slot,
ue->measurements.n0_power_tot,
ue->measurements.n0_power_tot_dB,
- ue->measurements.n0_power_tot_dB + 30 - 10 * log10(pow(2, 30)) - dB_fixed(ue->frame_parms.ofdm_symbol_size)
+ ue->measurements.n0_power_tot_dB + 30 - SQ15_SQUARED_NORM_FACTOR_DB - dB_fixed(ue->frame_parms.ofdm_symbol_size)
- ((int)rx_gain - (int)rx_gain_offset));
}
@@ -347,7 +347,7 @@ void 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 - 10 * log10(pow(2, 30))
+ 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);
diff --git a/openair1/PHY/NR_UE_TRANSPORT/csi_rx.c b/openair1/PHY/NR_UE_TRANSPORT/csi_rx.c
index f68b594246..fbb6113405 100644
--- a/openair1/PHY/NR_UE_TRANSPORT/csi_rx.c
+++ b/openair1/PHY/NR_UE_TRANSPORT/csi_rx.c
@@ -40,9 +40,6 @@
#include "PHY/NR_TRANSPORT/nr_transport_proto.h"
#include "PHY/NR_UE_ESTIMATION/filt16a_32.h"
-// 10*log10(pow(2,30))
-#define pow_2_30_dB 90
-
// Additional memory allocation, because of applying the filter and the memory offset to ensure memory alignment
#define FILTER_MARGIN 32
@@ -254,7 +251,7 @@ int nr_get_csi_rs_signal(const PHY_VARS_NR_UE *ue,
*rsrp = rsrp_sum/meas_count;
- *rsrp_dBm = dB_fixed(*rsrp) + 30 - pow_2_30_dB
+ *rsrp_dBm = dB_fixed(*rsrp) + 30 - SQ15_SQUARED_NORM_FACTOR_DB
- ((int)openair0_cfg[0].rx_gain[0] - (int)openair0_cfg[0].rx_gain_offset[0]) - dB_fixed(ue->frame_parms.ofdm_symbol_size);
#ifdef NR_CSIRS_DEBUG
diff --git a/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_demodulation.c b/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_demodulation.c
index 67527b295f..671764db17 100644
--- a/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_demodulation.c
+++ b/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_demodulation.c
@@ -213,12 +213,10 @@ static void nr_dlsch_channel_compensation(uint32_t rx_size_symbol,
*/
static void nr_dlsch_channel_level(uint32_t rx_size_symbol,
int32_t dl_ch_estimates_ext[][rx_size_symbol],
- NR_DL_FRAME_PARMS *frame_parms,
+ uint8_t n_rx,
uint8_t n_tx,
int32_t avg[MAX_ANT][MAX_ANT],
- uint8_t symbol,
- uint32_t len,
- unsigned short nb_rb);
+ uint32_t len);
void nr_dlsch_scale_channel(uint32_t rx_size_symbol,
int32_t dl_ch_estimates_ext[][rx_size_symbol],
@@ -441,8 +439,11 @@ int nr_rx_pdsch(PHY_VARS_NR_UE *ue,
if (meas_enabled)
start_meas(&meas);
if (first_symbol_flag) {
- int32_t avg[MAX_ANT][MAX_ANT];
- nr_dlsch_channel_level(rx_size_symbol, dl_ch_estimates_ext, frame_parms, nl, avg, symbol, nb_re_pdsch, nb_rb_pdsch);
+ int32_t avg[MAX_ANT][MAX_ANT] = {};
+ if (nb_re_pdsch)
+ nr_dlsch_channel_level(rx_size_symbol, dl_ch_estimates_ext, frame_parms->nb_antennas_rx, nl, avg, nb_re_pdsch);
+ else
+ LOG_E(NR_PHY, "Average channel level is 0: nb_rb_pdsch = %d, nb_re_pdsch = %d\n", nb_rb_pdsch, nb_re_pdsch);
int avgs = 0;
int32_t median[MAX_ANT][MAX_ANT];
for (int aatx = 0; aatx < nl; aatx++)
@@ -1001,33 +1002,35 @@ void nr_dlsch_scale_channel(uint32_t rx_size_symbol,
}
-//compute average channel_level on each (TX,RX) antenna pair
+/** @brief This function computes the average channel level over all allocated RBs
+ * and antennas (TX/RX) in order to compute output shift for compensated signal
+ @param rx_size_symbol
+ @param dl_ch_estimates_ext Channel estimates in allocated RBs
+ @param n_rx number of antennas in RX
+ @param n_tx number of antennas in TX
+ @param avg Pointer to average signal strength
+ @param len Number of allocated PDSCH REs
+*/
void nr_dlsch_channel_level(uint32_t rx_size_symbol,
int32_t dl_ch_estimates_ext[][rx_size_symbol],
- NR_DL_FRAME_PARMS *frame_parms,
+ uint8_t n_rx,
uint8_t n_tx,
int32_t avg[MAX_ANT][MAX_ANT],
- uint8_t symbol,
- uint32_t len,
- unsigned short nb_rb)
+ uint32_t len)
{
simde__m128i *dl_ch128, avg128D;
-
//nb_rb*nre = y * 2^x
int16_t x = factor2(len);
- //x = (x>4) ? 4 : x;
int16_t y = (len)>>x;
- //printf("len = %d = %d * 2^(%d)\n",len,y,x);
- uint32_t nb_rb_0 = len/12 + ((len%12)?1:0);
-
- AssertFatal(y!=0,"Cannot divide by zero: in function %s of file %s\n", __func__, __FILE__);
+ LOG_D(NR_PHY, "%s: %d = %d * 2^(%d)\n", __func__, len, y, x);
+ uint32_t nb_rb_0 = len / NR_NB_SC_PER_RB + ((len % NR_NB_SC_PER_RB) ? 1 : 0);
for (int aatx = 0; aatx < n_tx; aatx++) {
- for (int aarx = 0; aarx < frame_parms->nb_antennas_rx; aarx++) {
+ for (int aarx = 0; aarx < n_rx; aarx++) {
//clear average level
avg128D = simde_mm_setzero_si128();
- dl_ch128 = (simde__m128i *)dl_ch_estimates_ext[(aatx * frame_parms->nb_antennas_rx) + aarx];
+ dl_ch128 = (simde__m128i *)dl_ch_estimates_ext[(aatx * n_rx) + aarx];
for (int rb = 0; rb < nb_rb_0; rb++) {
avg128D = simde_mm_add_epi32(avg128D,simde_mm_srai_epi32(simde_mm_madd_epi16(dl_ch128[0],dl_ch128[0]),x));
diff --git a/openair2/GNB_APP/gnb_config.c b/openair2/GNB_APP/gnb_config.c
index e4e93c36a2..c1d15d810b 100644
--- a/openair2/GNB_APP/gnb_config.c
+++ b/openair2/GNB_APP/gnb_config.c
@@ -718,6 +718,7 @@ void RCconfig_verify(configmodule_interface_t *cfg, ngran_node_t node_type)
verify_gnb_param_notset(gnbp, GNB_DO_CSIRS_IDX, GNB_CONFIG_STRING_DOCSIRS);
verify_gnb_param_notset(gnbp, GNB_DO_SRS_IDX, GNB_CONFIG_STRING_DOSRS);
verify_gnb_param_notset(gnbp, GNB_FORCE256QAMOFF_IDX, GNB_CONFIG_STRING_FORCE256QAMOFF);
+ verify_gnb_param_notset(gnbp, GNB_MAXMIMOLAYERS_IDX, GNB_CONFIG_STRING_MAXMIMOLAYERS);
// check for some general sections
verify_section_notset(cfg, NULL, CONFIG_STRING_L1_LIST);
@@ -1304,12 +1305,16 @@ void RCconfig_nr_macrlc(configmodule_interface_t *cfg)
config.force_256qam_off = *GNBParamList.paramarray[0][GNB_FORCE256QAMOFF_IDX].iptr;
config.force_UL256qam_off = *GNBParamList.paramarray[0][GNB_FORCEUL256QAMOFF_IDX].iptr;
config.use_deltaMCS = *GNBParamList.paramarray[0][GNB_USE_DELTA_MCS_IDX].iptr != 0;
+ config.maxMIMO_layers = *GNBParamList.paramarray[0][GNB_MAXMIMOLAYERS_IDX].iptr;
LOG_I(GNB_APP,
- "CSI-RS %d, SRS %d, 256 QAM %s, delta_MCS %s\n",
+ "CSI-RS %d, SRS %d, 256 QAM %s, delta_MCS %s, maxMIMO_Layers %d\n",
config.do_CSIRS,
config.do_SRS,
config.force_256qam_off ? "force off" : "may be on",
- config.use_deltaMCS ? "on" : "off");
+ config.use_deltaMCS ? "on" : "off",
+ config.maxMIMO_layers);
+ int tot_ant = config.pdsch_AntennaPorts.N1 * config.pdsch_AntennaPorts.N2 * config.pdsch_AntennaPorts.XP;
+ AssertFatal(config.maxMIMO_layers != 0 && config.maxMIMO_layers <= tot_ant, "Invalid maxMIMO_layers %d\n", config.maxMIMO_layers);
NR_ServingCellConfigCommon_t *scc = get_scc_config(cfg, config.minRXTXTIME);
//xer_fprint(stdout, &asn_DEF_NR_ServingCellConfigCommon, scc);
diff --git a/openair2/GNB_APP/gnb_paramdef.h b/openair2/GNB_APP/gnb_paramdef.h
index 46dae3622e..6491ddb755 100644
--- a/openair2/GNB_APP/gnb_paramdef.h
+++ b/openair2/GNB_APP/gnb_paramdef.h
@@ -125,6 +125,7 @@ typedef enum {
#define GNB_CONFIG_STRING_ULPRBBLACKLIST "ul_prbblacklist"
#define GNB_CONFIG_STRING_UMONDEFAULTDRB "um_on_default_drb"
#define GNB_CONFIG_STRING_FORCE256QAMOFF "force_256qam_off"
+#define GNB_CONFIG_STRING_MAXMIMOLAYERS "maxMIMO_layers"
#define GNB_CONFIG_STRING_ENABLE_SDAP "enable_sdap"
#define GNB_CONFIG_STRING_DRBS "drbs"
#define GNB_CONFIG_STRING_USE_DELTA_MCS "use_deltaMCS"
@@ -136,6 +137,7 @@ typedef enum {
#define GNB_CONFIG_HLP_STRING_ENABLE_SDAP "enable the SDAP layer\n"
#define GNB_CONFIG_HLP_FORCE256QAMOFF "suppress activation of 256 QAM despite UE support"
+#define GNB_CONFIG_HLP_MAXMIMOLAYERS "limit on maxMIMO-layers for DL"
#define GNB_CONFIG_HLP_STRING_DRBS "Number of total DRBs to establish, including the mandatory for PDU SEssion (default=1)\n"
#define GNB_CONFIG_HLP_GNB_DU_ID "defines the gNB-DU ID (only applicable for DU)"
#define GNB_CONFIG_HLP_GNB_CU_UP_ID "defines the gNB-CU-UP ID (only applicable for CU-UP)"
@@ -177,6 +179,7 @@ typedef enum {
{GNB_CONFIG_STRING_GNB_CU_UP_ID, GNB_CONFIG_HLP_GNB_CU_UP_ID, 0, .u64ptr=NULL, .defint64val=1, TYPE_UINT64, 0}, \
{GNB_CONFIG_STRING_USE_DELTA_MCS, GNB_CONFIG_HLP_USE_DELTA_MCS, 0, .iptr=NULL, .defintval=0, TYPE_INT, 0}, \
{GNB_CONFIG_STRING_FORCEUL256QAMOFF, GNB_CONFIG_HLP_FORCEUL256QAMOFF, 0, .iptr=NULL, .defintval=0, TYPE_INT, 0}, \
+{GNB_CONFIG_STRING_MAXMIMOLAYERS, GNB_CONFIG_HLP_MAXMIMOLAYERS, 0, .iptr=NULL, .defintval=-1, TYPE_INT, 0}, \
}
// clang-format on
@@ -212,6 +215,7 @@ typedef enum {
#define GNB_GNB_CU_UP_ID_IDX 28
#define GNB_USE_DELTA_MCS_IDX 29
#define GNB_FORCEUL256QAMOFF_IDX 30
+#define GNB_MAXMIMOLAYERS_IDX 31
#define TRACKING_AREA_CODE_OKRANGE {0x0001,0xFFFD}
#define GNBPARAMS_CHECK { \
diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c
index fec34b753f..6d76a66877 100644
--- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c
+++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c
@@ -111,6 +111,65 @@ static int compute_ph_factor(int mu, int tbs_bits, int rb, int n_layers, int n_s
return ((int)roundf(delta_tf + bw_factor));
}
+/* \brief over-estimate the BSR index, given real_index.
+ *
+ * BSR does not account for headers, so we need to estimate. See 38.321
+ * 6.1.3.1: "The size of the RLC headers and MAC subheaders are not considered
+ * in the buffer size computation." */
+static int overestim_bsr_index(int real_index)
+{
+ /* if UE reports BSR 0, it means "no data"; otherwise, overestimate to
+ * account for headers */
+ const int add_overestim = 1;
+ return real_index > 0 ? real_index + add_overestim : real_index;
+}
+
+static int estimate_ul_buffer_short_bsr(const NR_BSR_SHORT *bsr)
+{
+ /* NOTE: the short BSR might be for different LCGID than 0, but we do not
+ * differentiate them */
+ int rep_idx = bsr->Buffer_size;
+ int estim_idx = overestim_bsr_index(rep_idx);
+ int max = sizeofArray(NR_SHORT_BSR_TABLE);
+ int idx = min(estim_idx, max);
+ int estim_size = NR_SHORT_BSR_TABLE[idx];
+ LOG_D(NR_MAC, "short BSR LCGID %d index %d estim index %d size %d\n", bsr->LcgID, rep_idx, estim_idx, estim_size);
+ return estim_size;
+}
+
+static int estimate_ul_buffer_long_bsr(const NR_BSR_LONG *bsr)
+{
+ LOG_D(NR_MAC,
+ "LONG BSR, LCG ID(7-0) %d/%d/%d/%d/%d/%d/%d/%d\n",
+ bsr->LcgID7,
+ bsr->LcgID6,
+ bsr->LcgID5,
+ bsr->LcgID4,
+ bsr->LcgID3,
+ bsr->LcgID2,
+ bsr->LcgID1,
+ bsr->LcgID0);
+ bool bsr_active[8] = {bsr->LcgID0 != 0, bsr->LcgID1 != 0, bsr->LcgID2 != 0, bsr->LcgID3 != 0, bsr->LcgID4 != 0, bsr->LcgID5 != 0, bsr->LcgID6 != 0, bsr->LcgID7 != 0};
+
+ int estim_size = 0;
+ int max = sizeofArray(NR_LONG_BSR_TABLE);
+ uint8_t *payload = ((uint8_t*) bsr) + 1;
+ int m = 0;
+ const int total_lcgids = 8; /* see 38.321 6.1.3.1 */
+ for (int n = 0; n < total_lcgids; n++) {
+ if (!bsr_active[n])
+ continue;
+ int rep_idx = payload[m];
+ int estim_idx = overestim_bsr_index(rep_idx);
+ int idx = min(estim_idx, max);
+ estim_size += NR_LONG_BSR_TABLE[idx];
+
+ LOG_D(NR_MAC, "LONG BSR LCGID/m %d/%d Index %d estim index %d size %d", n, m, rep_idx, estim_idx, estim_size);
+ m++;
+ }
+ return estim_size;
+}
+
// For both UL-SCH except:
// - UL-SCH: fixed-size MAC CE(known by LCID)
// - UL-SCH: padding
@@ -166,7 +225,6 @@ static int nr_process_mac_pdu(instance_t module_idP,
LOG_D(NR_MAC, "In %s: received UL-SCH sub-PDU with LCID 0x%x in %d.%d (remaining PDU length %d)\n", __func__, rx_lcid, frameP, slot, pdu_len);
unsigned char *ce_ptr;
- int n_Lcg = 0;
switch(rx_lcid){
// MAC CE
@@ -192,17 +250,8 @@ static int nr_process_mac_pdu(instance_t module_idP,
}
/* Extract short BSR value */
ce_ptr = &pduP[mac_subheader_len];
- NR_BSR_SHORT *bsr_s = (NR_BSR_SHORT *) ce_ptr;
- sched_ctrl->estimated_ul_buffer = 0;
- sched_ctrl->estimated_ul_buffer = NR_SHORT_BSR_TABLE[bsr_s->Buffer_size];
- LOG_D(NR_MAC,
- "SHORT BSR at %4d.%2d, LCG ID %d, BS Index %d, BS value < %d, est buf %d\n",
- frameP,
- slot,
- bsr_s->LcgID,
- bsr_s->Buffer_size,
- NR_SHORT_BSR_TABLE[bsr_s->Buffer_size],
- sched_ctrl->estimated_ul_buffer);
+ sched_ctrl->estimated_ul_buffer = estimate_ul_buffer_short_bsr((NR_BSR_SHORT *)ce_ptr);
+ LOG_D(NR_MAC, "SHORT BSR at %4d.%2d, est buf %d\n", frameP, slot, sched_ctrl->estimated_ul_buffer);
break;
case UL_SCH_LCID_L_BSR:
case UL_SCH_LCID_L_TRUNCATED_BSR:
@@ -219,32 +268,8 @@ static int nr_process_mac_pdu(instance_t module_idP,
}
/* Extract long BSR value */
ce_ptr = &pduP[mac_subheader_len];
- NR_BSR_LONG *bsr_l = (NR_BSR_LONG *) ce_ptr;
- sched_ctrl->estimated_ul_buffer = 0;
-
- n_Lcg = bsr_l->LcgID7 + bsr_l->LcgID6 + bsr_l->LcgID5 + bsr_l->LcgID4 +
- bsr_l->LcgID3 + bsr_l->LcgID2 + bsr_l->LcgID1 + bsr_l->LcgID0;
-
- LOG_D(NR_MAC, "LONG BSR, LCG ID(7-0) %d/%d/%d/%d/%d/%d/%d/%d\n",
- bsr_l->LcgID7, bsr_l->LcgID6, bsr_l->LcgID5, bsr_l->LcgID4,
- bsr_l->LcgID3, bsr_l->LcgID2, bsr_l->LcgID1, bsr_l->LcgID0);
-
- for (int n = 0; n < n_Lcg; n++){
- LOG_D(NR_MAC, "LONG BSR, %d/%d (n/n_Lcg), BS Index %d, BS value < %d",
- n, n_Lcg, pduP[mac_subheader_len + 1 + n],
- NR_LONG_BSR_TABLE[pduP[mac_subheader_len + 1 + n]]);
- sched_ctrl->estimated_ul_buffer += NR_LONG_BSR_TABLE[pduP[mac_subheader_len + 1 + n]];
- LOG_D(NR_MAC,
- "LONG BSR at %4d.%2d, %d/%d (n/n_Lcg), BS Index %d, BS value < %d, total %d\n",
- frameP,
- slot,
- n,
- n_Lcg,
- pduP[mac_subheader_len + 1 + n],
- NR_LONG_BSR_TABLE[pduP[mac_subheader_len + 1 + n]],
- sched_ctrl->estimated_ul_buffer);
- }
-
+ sched_ctrl->estimated_ul_buffer = estimate_ul_buffer_long_bsr((NR_BSR_LONG *)ce_ptr);
+ LOG_D(NR_MAC, "LONG BSR at %4d.%2d, estim buf %d\n", frameP, slot, sched_ctrl->estimated_ul_buffer);
break;
case UL_SCH_LCID_C_RNTI:
diff --git a/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h b/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h
index eeeff6543c..59a3355691 100644
--- a/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h
+++ b/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h
@@ -138,6 +138,7 @@ typedef struct nr_mac_config_t {
bool force_256qam_off;
bool force_UL256qam_off;
bool use_deltaMCS;
+ int maxMIMO_layers;
//int pusch_TargetSNRx10;
//int pucch_TargetSNRx10;
} nr_mac_config_t;
diff --git a/openair2/RRC/NR/nr_rrc_config.c b/openair2/RRC/NR/nr_rrc_config.c
index 941f81d81c..3b1791ad55 100644
--- a/openair2/RRC/NR/nr_rrc_config.c
+++ b/openair2/RRC/NR/nr_rrc_config.c
@@ -512,7 +512,8 @@ static void config_csiim(int do_csirs,
void set_dl_maxmimolayers(NR_PDSCH_ServingCellConfig_t *pdsch_servingcellconfig,
const NR_ServingCellConfigCommon_t *scc,
- const NR_UE_NR_Capability_t *uecap)
+ const NR_UE_NR_Capability_t *uecap,
+ int maxMIMO_layers)
{
if(!pdsch_servingcellconfig->ext1)
@@ -536,7 +537,10 @@ void set_dl_maxmimolayers(NR_PDSCH_ServingCellConfig_t *pdsch_servingcellconfig,
supported_bw_comparison(bw_mhz, &dl_fs->supportedBandwidthDL, dl_fs->channelBW_90mhz) &&
dl_fs->maxNumberMIMO_LayersPDSCH) {
long ue_supported_layers = (2 << *dl_fs->maxNumberMIMO_LayersPDSCH);
- *pdsch_servingcellconfig->ext1->maxMIMO_Layers = NR_MAX_SUPPORTED_DL_LAYERS < ue_supported_layers ? NR_MAX_SUPPORTED_DL_LAYERS : ue_supported_layers;
+ if (maxMIMO_layers == -1)
+ *pdsch_servingcellconfig->ext1->maxMIMO_Layers = NR_MAX_SUPPORTED_DL_LAYERS < ue_supported_layers ? NR_MAX_SUPPORTED_DL_LAYERS : ue_supported_layers;
+ else
+ *pdsch_servingcellconfig->ext1->maxMIMO_Layers = maxMIMO_layers < ue_supported_layers ? maxMIMO_layers : ue_supported_layers;
return;
}
}
@@ -2397,7 +2401,7 @@ static NR_SpCellConfig_t *get_initial_SpCellConfig(int uid,
pdsch_servingcellconfig->nrofHARQ_ProcessesForPDSCH = calloc(1, sizeof(*pdsch_servingcellconfig->nrofHARQ_ProcessesForPDSCH));
*pdsch_servingcellconfig->nrofHARQ_ProcessesForPDSCH = NR_PDSCH_ServingCellConfig__nrofHARQ_ProcessesForPDSCH_n16;
pdsch_servingcellconfig->pucch_Cell = NULL;
- set_dl_maxmimolayers(pdsch_servingcellconfig, scc, NULL);
+ set_dl_maxmimolayers(pdsch_servingcellconfig, scc, NULL, configuration->maxMIMO_layers);
// Downlink BWPs
int n_dl_bwp = 0;
@@ -2600,7 +2604,7 @@ void update_cellGroupConfig(NR_CellGroupConfig_t *cellGroupConfig,
NR_SpCellConfig_t *SpCellConfig = cellGroupConfig->spCellConfig;
NR_PDSCH_ServingCellConfig_t *pdsch_servingcellconfig = SpCellConfig->spCellConfigDedicated->pdsch_ServingCellConfig->choice.setup;
- set_dl_maxmimolayers(pdsch_servingcellconfig, scc, uecap);
+ set_dl_maxmimolayers(pdsch_servingcellconfig, scc, uecap, configuration->maxMIMO_layers);
NR_CSI_MeasConfig_t *csi_MeasConfig = SpCellConfig->spCellConfigDedicated->csi_MeasConfig->choice.setup;
for (int report = 0; report < csi_MeasConfig->csi_ReportConfigToAddModList->list.count; report++) {
@@ -2979,7 +2983,7 @@ NR_CellGroupConfig_t *get_default_secondaryCellGroup(const NR_ServingCellConfigC
pdsch_servingcellconfig->nrofHARQ_ProcessesForPDSCH = calloc(1, sizeof(*pdsch_servingcellconfig->nrofHARQ_ProcessesForPDSCH));
*pdsch_servingcellconfig->nrofHARQ_ProcessesForPDSCH = NR_PDSCH_ServingCellConfig__nrofHARQ_ProcessesForPDSCH_n16;
pdsch_servingcellconfig->pucch_Cell = NULL;
- set_dl_maxmimolayers(pdsch_servingcellconfig, servingcellconfigcommon, uecap);
+ set_dl_maxmimolayers(pdsch_servingcellconfig, servingcellconfigcommon, uecap, configuration->maxMIMO_layers);
pdsch_servingcellconfig->ext1->processingType2Enabled = NULL;
secondaryCellGroup->spCellConfig->spCellConfigDedicated->csi_MeasConfig = NULL;
diff --git a/openair3/NAS/NR_UE/nr_nas_msg_sim.c b/openair3/NAS/NR_UE/nr_nas_msg_sim.c
index 97f9ca1aef..f9d551ef3d 100644
--- a/openair3/NAS/NR_UE/nr_nas_msg_sim.c
+++ b/openair3/NAS/NR_UE/nr_nas_msg_sim.c
@@ -149,7 +149,7 @@ static int fill_imeisv(FGSMobileIdentity *mi, const uicc_t *uicc)
mi->imeisv.digitsv1 = getImeisvDigit(uicc, i++);
mi->imeisv.digitsv2 = getImeisvDigit(uicc, i++);
mi->imeisv.spare = 0x0f;
- mi->imeisv.oddeven = 1;
+ mi->imeisv.oddeven = 0;
return 19;
}
diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band77.273prb.fhi72.4x4-vvdn.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band77.273prb.fhi72.4x4-vvdn.conf
index ba442af9d7..5984d32b17 100644
--- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band77.273prb.fhi72.4x4-vvdn.conf
+++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band77.273prb.fhi72.4x4-vvdn.conf
@@ -19,6 +19,8 @@ gNBs =
////////// Physical parameters:
pdsch_AntennaPorts_XP = 2;
+ pdsch_AntennaPorts_N1 = 2;
+ maxMIMO_layers = 2;
pusch_AntennaPorts = 4;
do_CSIRS = 1;
do_SRS = 0 ;
diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.273prb.fhi72.4x4-benetel550.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.273prb.fhi72.4x4-benetel550.conf
index 7ad71606fa..d5c22b7e5e 100644
--- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.273prb.fhi72.4x4-benetel550.conf
+++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.273prb.fhi72.4x4-benetel550.conf
@@ -18,6 +18,8 @@ gNBs =
////////// Physical parameters:
pdsch_AntennaPorts_XP = 2;
+ pdsch_AntennaPorts_N1 = 2;
+ maxMIMO_layers = 2;
pusch_AntennaPorts = 4;
do_CSIRS = 1;
do_SRS = 0 ;
diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.273prb.fhi72.4x4-benetel650.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.273prb.fhi72.4x4-benetel650.conf
index 919bb45b4c..ddcb28a331 100644
--- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.273prb.fhi72.4x4-benetel650.conf
+++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.273prb.fhi72.4x4-benetel650.conf
@@ -18,6 +18,8 @@ gNBs =
////////// Physical parameters:
pdsch_AntennaPorts_XP = 2;
+ pdsch_AntennaPorts_N1 = 2;
+ maxMIMO_layers = 2;
pusch_AntennaPorts = 4;
do_CSIRS = 1;
do_SRS = 0 ;
diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.273prb.fhi72.4x4-liteon.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.273prb.fhi72.4x4-liteon.conf
index 0df4af5faa..1ddba82cdf 100644
--- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.273prb.fhi72.4x4-liteon.conf
+++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.273prb.fhi72.4x4-liteon.conf
@@ -18,6 +18,8 @@ gNBs =
////////// Physical parameters:
pdsch_AntennaPorts_XP = 2;
+ pdsch_AntennaPorts_N1 = 2;
+ maxMIMO_layers = 2;
pusch_AntennaPorts = 4;
do_CSIRS = 1;
do_SRS = 0 ;