Merge branch 'integration_2022_wk17' into 'develop'

integration_2022_wk17

See merge request oai/openairinterface5g!1539
This commit is contained in:
Robert Schmidt
2022-04-28 07:51:04 +00:00
136 changed files with 1738 additions and 2076 deletions
+8 -5
View File
@@ -26,6 +26,9 @@ def nodeExecutor = params.nodeExecutor
// Name of the phone resource
def ciServerResource = params.serverResource
// Docker Hub account to push to
def DH_Account = "oaisoftwarealliance"
pipeline {
agent {
label nodeExecutor
@@ -66,11 +69,11 @@ pipeline {
def listOfImages = ["oai-enb", "oai-gnb", "oai-lte-ue", "oai-nr-ue"]
sh "docker login -u ${DH_Username} -p ${DH_Password} > /dev/null 2>&1"
listOfImages.eachWithIndex { item, iindex ->
sh "docker image tag ${item}:develop ${DH_Username}/${item}:develop"
sh "docker image tag ${item}:develop ${DH_Username}/${item}:${WEEK_TAG}"
sh "docker push --quiet ${DH_Username}/${item}:${WEEK_TAG}"
sh "docker push --quiet ${DH_Username}/${item}:develop"
sh "docker rmi ${DH_Username}/${item}:${WEEK_TAG} ${DH_Username}/${item}:develop"
sh "docker image tag ${item}:develop ${DH_Account}/${item}:develop"
sh "docker image tag ${item}:develop ${DH_Account}/${item}:${WEEK_TAG}"
sh "docker push --quiet ${DH_Account}/${item}:${WEEK_TAG}"
sh "docker push --quiet ${DH_Account}/${item}:develop"
sh "docker rmi ${DH_Account}/${item}:${WEEK_TAG} ${DH_Account}/${item}:develop"
}
sh "docker logout > /dev/null 2>&1"
}
+2 -2
View File
@@ -81,11 +81,11 @@ class Log_Mgt:
def LogRotation(self):
doLoop = True
nbDays = 14
while doLoop and nbDays > 2:
while doLoop and nbDays > 1:
used_space = self.__CheckUsedSpace() #avail space in target folder
if used_space > 80 :
logging.debug('\u001B[1;37;41m Used Disk (' + str(used_space) + '%) > 80%, on ' + self.Username+'@'+self.IPAddress + '\u001B[0m')
logging.debug('\u001B[1;37;41m Removing Artifacts older than ' + nbDays + ' days \u001B[0m')
logging.debug('\u001B[1;37;41m Removing Artifacts older than ' + str(nbDays) + ' days \u001B[0m')
self.__RemoveOldest(nbDays)
nbDays -= 1
else:
@@ -199,12 +199,12 @@ gNBs =
);
MACRLCs = (
{
num_cc = 1;
tr_s_preference = "local_L1";
tr_n_preference = "local_RRC";
ulsch_max_frame_inactivity = 1;
}
{
num_cc = 1;
tr_s_preference = "local_L1";
tr_n_preference = "local_RRC";
ulsch_max_frame_inactivity = 0;
}
);
L1s = (
@@ -213,6 +213,7 @@ L1s = (
tr_n_preference = "local_mac";
thread_pool_size = 8;
prach_dtx_threshold = 120;
pucch0_dtx_threshold = 80;
}
);
@@ -203,7 +203,7 @@ MACRLCs = (
tr_n_preference = "local_RRC";
pusch_TargetSNRx10 = 200;
pucch_TargetSNRx10 = 200;
ulsch_max_frame_inactivity = 1;
ulsch_max_frame_inactivity = 0;
}
);
@@ -221,11 +221,11 @@ RUs = (
local_rf = "yes"
nb_tx = 1
nb_rx = 1
att_tx = 3
att_rx = 0;
att_tx = 12
att_rx = 12;
bands = [7];
max_pdschReferenceSignalPower = -27;
max_rxgain = 111;
max_rxgain = 114;
eNB_instances = [0];
# sdr_addrs = "serial=30C51D4";
# clock_src = "external";
+3 -3
View File
@@ -5,15 +5,15 @@ import subprocess
import sys
AUTH_SERVICE = 'registry.docker.io'
AUTH_SCOPE = 'repository:rdefosseoai/oai-enb:pull'
AUTH_SCOPE = 'repository:oaisoftwarealliance/oai-enb:pull'
def main() -> None:
args = _parse_args()
cmd = 'curl -fsSL "https://auth.docker.io/token?service=' + AUTH_SERVICE + '&scope=' + AUTH_SCOPE + '" | jq --raw-output ".token"'
cmd = 'curl -fsSL "https://auth.docker.io/token?service=' + AUTH_SERVICE + '&scope=' + AUTH_SCOPE + '" 2>/dev/null | jq --raw-output ".token"'
token = subprocess.check_output(cmd, shell=True, universal_newlines=True)
token = str(token).strip()
cmd = 'curl -fsSL -H "Authorization: Bearer ' + token + '" "https://index.docker.io/v2/rdefosseoai/oai-enb/tags/list" | jq .'
cmd = 'curl -fsSL -H "Authorization: Bearer ' + token + '" "https://index.docker.io/v2/oaisoftwarealliance/oai-enb/tags/list" 2>/dev/null | jq .'
listOfTags = subprocess.check_output(cmd, shell=True, universal_newlines=True)
foundTag = False
@@ -138,19 +138,19 @@
<testCase id="070000">
<class>Iperf</class>
<desc>iperf (DL/40Mbps/UDP)(60 sec)(single-ue profile)</desc>
<iperf_args>-u -b 40M -t 60 -i 1 -fm</iperf_args>
<desc>iperf (DL/125Mbps/UDP)(60 sec)(single-ue profile)</desc>
<iperf_args>-u -b 125M -t 60 -i 1 -fm</iperf_args>
<direction>DL</direction>
<id>idefix</id>
<iperf_packetloss_threshold>20</iperf_packetloss_threshold>
<iperf_bitrate_threshold>85</iperf_bitrate_threshold>
<iperf_packetloss_threshold>1</iperf_packetloss_threshold>
<iperf_bitrate_threshold>95</iperf_bitrate_threshold>
<iperf_profile>single-ue</iperf_profile>
</testCase>
<testCase id="070001">
<class>Iperf</class>
<desc>iperf (UL/3Mbps/UDP)(60 sec)(single-ue profile)</desc>
<iperf_args>-u -b 3M -t 60 -i 1 -fm</iperf_args>
<desc>iperf (UL/8Mbps/UDP)(60 sec)(single-ue profile)</desc>
<iperf_args>-u -b 8M -t 60 -i 1 -fm</iperf_args>
<direction>UL</direction>
<id>idefix</id>
<iperf_packetloss_threshold>1</iperf_packetloss_threshold>
+4 -3
View File
@@ -115,11 +115,12 @@
<testCase id="070000">
<class>Iperf</class>
<desc>iperf (DL/60Mbps/UDP)(60 sec)(single-ue profile)</desc>
<iperf_args>-u -b 60M -t 60</iperf_args>
<desc>iperf (DL/125Mbps/UDP)(60 sec)(single-ue profile)</desc>
<iperf_args>-u -b 125M -t 60</iperf_args>
<direction>DL</direction>
<id>nrmodule2_quectel</id>
<iperf_packetloss_threshold>5</iperf_packetloss_threshold>
<iperf_packetloss_threshold>15</iperf_packetloss_threshold>
<iperf_bitrate_threshold>85</iperf_bitrate_threshold>
<iperf_profile>single-ue</iperf_profile>
</testCase>
+10 -10
View File
@@ -74,7 +74,7 @@
<testCase id="040000">
<class>Initialize_eNB</class>
<desc>Initialize gNB</desc>
<Initialize_eNB_args>-O ci-scripts/conf_files/gnb.band78.tm1.fr1.106PRB.usrpb210.conf -E -q --RUs.[0].sdr_addrs "serial=30C51D4" --log_config.global_log_options level,nocolor,time,line_num,function</Initialize_eNB_args>
<Initialize_eNB_args>-O ci-scripts/conf_files/gnb.band78.tm1.fr1.106PRB.usrpb210.conf -E -q --RUs.[0].sdr_addrs "serial=30C51D4" --continuous-tx --log_config.global_log_options level,nocolor,time,line_num,function</Initialize_eNB_args>
<eNB_instance>1</eNB_instance>
<eNB_serverId>1</eNB_serverId>
<air_interface>nr</air_interface>
@@ -117,37 +117,37 @@
<iperf_args>-u -b 30M -t 30</iperf_args>
<direction>DL</direction>
<id>idefix</id>
<iperf_packetloss_threshold>5</iperf_packetloss_threshold>
<iperf_packetloss_threshold>1</iperf_packetloss_threshold>
<iperf_bitrate_threshold>95</iperf_bitrate_threshold>
<iperf_profile>single-ue</iperf_profile>
</testCase>
<testCase id="070001">
<class>Iperf</class>
<desc>iperf (DL/40Mbps/UDP)(30 sec)(single-ue profile)</desc>
<iperf_args>-u -b 40M -t 30</iperf_args>
<desc>iperf (DL/90Mbps/UDP)(30 sec)(single-ue profile)</desc>
<iperf_args>-u -b 90M -t 30</iperf_args>
<direction>DL</direction>
<id>idefix</id>
<iperf_packetloss_threshold>5</iperf_packetloss_threshold>
<iperf_packetloss_threshold>1</iperf_packetloss_threshold>
<iperf_bitrate_threshold>95</iperf_bitrate_threshold>
<iperf_profile>single-ue</iperf_profile>
</testCase>
<testCase id="070002">
<class>Iperf</class>
<desc>iperf (DL/60Mbps/UDP)(60 sec)(single-ue profile)</desc>
<iperf_args>-u -b 60M -t 60</iperf_args>
<desc>iperf (DL/125Mbps/UDP)(60 sec)(single-ue profile)</desc>
<iperf_args>-u -b 125M -t 60</iperf_args>
<direction>DL</direction>
<id>idefix</id>
<iperf_packetloss_threshold>5</iperf_packetloss_threshold>
<iperf_packetloss_threshold>1</iperf_packetloss_threshold>
<iperf_bitrate_threshold>95</iperf_bitrate_threshold>
<iperf_profile>single-ue</iperf_profile>
</testCase>
<testCase id="070003">
<class>Iperf</class>
<desc>iperf (UL/3Mbps/UDP)(60 sec)(single-ue profile)</desc>
<iperf_args>-u -b 3M -t 60</iperf_args>
<desc>iperf (UL/8Mbps/UDP)(60 sec)(single-ue profile)</desc>
<iperf_args>-u -b 8M -t 60</iperf_args>
<direction>UL</direction>
<id>idefix</id>
<iperf_packetloss_threshold>1</iperf_packetloss_threshold>
@@ -31,9 +31,7 @@ This page is only valid for an `Ubuntu18` host.
# 1. Retrieving the images on Docker-Hub #
Currently the images are hosted under the user account `rdefosseoai`.
This may change in the future.
Currently the images are hosted under the team account `oaisoftwarealliance`. They were previously hosted under the user account `rdefosseoai`.
Once again you may need to log on [docker-hub](https://hub.docker.com/) if your organization has reached pulling limit as `anonymous`.
@@ -49,13 +47,13 @@ Now pull images.
```bash
$ docker pull cassandra:2.1
$ docker pull redis:6.0.5
$ docker pull rdefosseoai/oai-hss:latest
$ docker pull rdefosseoai/magma-mme:latest
$ docker pull rdefosseoai/oai-spgwc:latest
$ docker pull rdefosseoai/oai-spgwu-tiny:latest
$ docker pull oaisoftwarealliance/oai-hss:latest
$ docker pull oaisoftwarealliance/magma-mme:latest
$ docker pull oaisoftwarealliance/oai-spgwc:latest
$ docker pull oaisoftwarealliance/oai-spgwu-tiny:latest
$ docker pull rdefosseoai/oai-enb:develop
$ docker pull rdefosseoai/oai-lte-ue:develop
$ docker pull oaisoftwarealliance/oai-enb:develop
$ docker pull oaisoftwarealliance/oai-lte-ue:develop
```
If the `redis` tag is not available, pick the newest available `6.0.x` tag at [Docker Hub Redis Tags](https://hub.docker.com/_/redis?tab=tags).
@@ -63,13 +61,13 @@ If the `redis` tag is not available, pick the newest available `6.0.x` tag at [D
And **re-tag** them for tutorials' docker-compose file to work.
```bash
$ docker image tag rdefosseoai/oai-spgwc:latest oai-spgwc:latest
$ docker image tag rdefosseoai/oai-hss:latest oai-hss:latest
$ docker image tag rdefosseoai/oai-spgwu-tiny:latest oai-spgwu-tiny:latest
$ docker image tag rdefosseoai/magma-mme:latest magma-mme:latest
$ docker image tag oaisoftwarealliance/oai-spgwc:latest oai-spgwc:latest
$ docker image tag oaisoftwarealliance/oai-hss:latest oai-hss:latest
$ docker image tag oaisoftwarealliance/oai-spgwu-tiny:latest oai-spgwu-tiny:latest
$ docker image tag oaisoftwarealliance/magma-mme:latest magma-mme:latest
$ docker image tag rdefosseoai/oai-enb:develop oai-enb:develop
$ docker image tag rdefosseoai/oai-lte-ue:develop oai-lte-ue:develop
$ docker image tag oaisoftwarealliance/oai-enb:develop oai-enb:develop
$ docker image tag oaisoftwarealliance/oai-lte-ue:develop oai-lte-ue:develop
```
```bash
+15 -17
View File
@@ -18,9 +18,7 @@ This tutorial is only valid once this file is merged into the `develop` branch.
# 1. Retrieving the images on Docker-Hub #
Currently the images are hosted under the user account `rdefosseoai`.
This may change in the future.
Currently the images are hosted under the team account `oaisoftwarealliance`. They were previously hosted under the user account `rdefosseoai`.
Once again you may need to log on [docker-hub](https://hub.docker.com/) if your organization has reached pulling limit as `anonymous`.
@@ -35,27 +33,27 @@ Now pull images.
```bash
$ docker pull mysql:5.7
$ docker pull rdefosseoai/oai-amf:latest
$ docker pull rdefosseoai/oai-nrf:latest
$ docker pull rdefosseoai/oai-smf:latest
$ docker pull rdefosseoai/oai-spgwu-tiny:latest
$ docker pull oaisoftwarealliance/oai-amf:latest
$ docker pull oaisoftwarealliance/oai-nrf:latest
$ docker pull oaisoftwarealliance/oai-smf:latest
$ docker pull oaisoftwarealliance/oai-spgwu-tiny:latest
$ docker pull rdefosseoai/oai-gnb:develop
$ docker pull rdefosseoai/oai-nr-ue:develop
$ docker pull rdefosseoai/proxy:latest
$ docker pull oaisoftwarealliance/oai-gnb:develop
$ docker pull oaisoftwarealliance/oai-nr-ue:develop
$ docker pull oaisoftwarealliance/proxy:latest
```
And **re-tag** them for tutorials' docker-compose file to work.
```bash
$ docker image tag rdefosseoai/oai-amf:latest oai-amf:latest
$ docker image tag rdefosseoai/oai-nrf:latest oai-nrf:latest
$ docker image tag rdefosseoai/oai-smf:latest oai-smf:latest
$ docker image tag rdefosseoai/oai-spgwu-tiny:latest oai-spgwu-tiny:latest
$ docker image tag oaisoftwarealliance/oai-amf:latest oai-amf:latest
$ docker image tag oaisoftwarealliance/oai-nrf:latest oai-nrf:latest
$ docker image tag oaisoftwarealliance/oai-smf:latest oai-smf:latest
$ docker image tag oaisoftwarealliance/oai-spgwu-tiny:latest oai-spgwu-tiny:latest
$ docker image tag rdefosseoai/oai-gnb:develop oai-gnb:develop
$ docker image tag rdefosseoai/oai-nr-ue:develop oai-nr-ue:develop
$ docker image tag rdefosseoai/proxy:latest oai-lte-multi-ue-proxy:latest
$ docker image tag oaisoftwarealliance/oai-gnb:develop oai-gnb:develop
$ docker image tag oaisoftwarealliance/oai-nr-ue:develop oai-nr-ue:develop
$ docker image tag oaisoftwarealliance/proxy:latest oai-lte-multi-ue-proxy:latest
```
```bash
+13 -15
View File
@@ -35,9 +35,7 @@ This page is only valid for an `Ubuntu18` host.
# 1. Retrieving the images on Docker-Hub #
Currently the images are hosted under the user account `rdefosseoai`.
This may change in the future.
Currently the images are hosted under the team account `oaisoftwarealliance`. They were previously hosted under the user account `rdefosseoai`.
Once again you may need to log on [docker-hub](https://hub.docker.com/) if your organization has reached pulling limit as `anonymous`.
@@ -52,25 +50,25 @@ Now pull images.
```bash
$ docker pull mysql:5.7
$ docker pull rdefosseoai/oai-amf:latest
$ docker pull rdefosseoai/oai-nrf:latest
$ docker pull rdefosseoai/oai-smf:latest
$ docker pull rdefosseoai/oai-spgwu-tiny:latest
$ docker pull oaisoftwarealliance/oai-amf:latest
$ docker pull oaisoftwarealliance/oai-nrf:latest
$ docker pull oaisoftwarealliance/oai-smf:latest
$ docker pull oaisoftwarealliance/oai-spgwu-tiny:latest
$ docker pull rdefosseoai/oai-gnb:develop
$ docker pull rdefosseoai/oai-nr-ue:develop
$ docker pull oaisoftwarealliance/oai-gnb:develop
$ docker pull oaisoftwarealliance/oai-nr-ue:develop
```
And **re-tag** them for tutorials' docker-compose file to work.
```bash
$ docker image tag rdefosseoai/oai-amf:latest oai-amf:latest
$ docker image tag rdefosseoai/oai-nrf:latest oai-nrf:latest
$ docker image tag rdefosseoai/oai-smf:latest oai-smf:latest
$ docker image tag rdefosseoai/oai-spgwu-tiny:latest oai-spgwu-tiny:latest
$ docker image tag oaisoftwarealliance/oai-amf:latest oai-amf:latest
$ docker image tag oaisoftwarealliance/oai-nrf:latest oai-nrf:latest
$ docker image tag oaisoftwarealliance/oai-smf:latest oai-smf:latest
$ docker image tag oaisoftwarealliance/oai-spgwu-tiny:latest oai-spgwu-tiny:latest
$ docker image tag rdefosseoai/oai-gnb:develop oai-gnb:develop
$ docker image tag rdefosseoai/oai-nr-ue:develop oai-nr-ue:develop
$ docker image tag oaisoftwarealliance/oai-gnb:develop oai-gnb:develop
$ docker image tag oaisoftwarealliance/oai-nr-ue:develop oai-nr-ue:develop
```
```bash
@@ -26,7 +26,7 @@ services:
FLEXRAN_INTERFACE_NAME: eth0
FLEXRAN_IPV4_ADDRESS: 172.21.16.136
THREAD_PARALLEL_CONFIG: PARALLEL_RU_L1_TRX_SPLIT
USE_ADDITIONAL_OPTIONS: -E -q --RUs.[0].sdr_addrs serial=30C51D4 --log_config.global_log_options level,nocolor,time,line_num,function
USE_ADDITIONAL_OPTIONS: -E -q --RUs.[0].sdr_addrs serial=30C51D4 --continuous-tx --log_config.global_log_options level,nocolor,time,line_num,function
volumes:
- /dev:/dev
networks:
+2 -2
View File
@@ -1093,7 +1093,7 @@
(Test8: 217 PRB 100 PDSCH-PRBs 110 PDSCH-Offset),
(Test9: 106 PRBs 50 PDSCH-PRBs MCS Index 27),
(Test10: 106 PRBs 50 PDSCH-PRBs MCS Index 16),
(Test11: 106 MCS-TABLE 256 QAM MCS Index 27),
(Test11: 106 MCS-TABLE 256 QAM MCS Index 26),
(Test12: HARQ test 25% TP 4 rounds),
(Test13: HARQ test 33% TP 3 rounds),
(Test14: HARQ test 50% TP 2 rounds),
@@ -1121,7 +1121,7 @@
-n100 -R217 -a110 -s5 -b100
-n100 -e27 -s30
-n100 -e16 -s10
-n100 -q1 -e27 -s30
-n100 -q1 -e26 -s30
-n100 -s1 -t25
-n100 -s1 -t33
-n100 -s1 -t50
-1
View File
@@ -1 +0,0 @@
ran_build/
+2 -2
View File
@@ -44,9 +44,9 @@
#define _Assert_(cOND, aCTION, fORMAT, aRGS...) \
do { \
if (!(cOND)) { \
fprintf(stderr, "\nAssertion ("#cOND") failed!\n" \
fprintf(stderr, "\nAssertion (%s) failed!\n" \
"In %s() %s:%d\n" fORMAT, \
__FUNCTION__, __FILE__, __LINE__, ##aRGS); \
#cOND, __FUNCTION__, __FILE__, __LINE__, ##aRGS); \
aCTION; \
} \
} while(0)
+2 -4
View File
@@ -33,10 +33,8 @@
#include <stdint.h>
#include <stdio.h>
#include "PHY/defs_eNB.h"
#include "PHY/TOOLS/dB_routines.h"
extern int16_t hundred_times_delta_TF[100];
extern uint16_t hundred_times_log10_NPRB[100];
#include <openair1/PHY/TOOLS/tools_defs.h>
#include <openair1/SCHED/sched_common_extern.h>
int16_t estimate_ue_tx_power(int norm,uint32_t tbs, uint32_t nb_rb, uint8_t control_only, int ncp, uint8_t use_srs)
{
+2 -2
View File
@@ -336,9 +336,9 @@ int get_dmrs_port(int nl, uint16_t dmrs_ports) {
return p;
}
lte_frame_type_t get_frame_type(uint16_t current_band, uint8_t scs_index)
frame_type_t get_frame_type(uint16_t current_band, uint8_t scs_index)
{
lte_frame_type_t current_type;
frame_type_t current_type;
int32_t delta_duplex = get_delta_duplex(current_band, scs_index);
if (delta_duplex == 0)
+1 -1
View File
@@ -63,7 +63,7 @@ void get_coreset_rballoc(uint8_t *FreqDomainResource,int *n_rb,int *rb_offset);
uint16_t config_bandwidth(int mu, int nb_rb, int nr_band);
int get_nr_table_idx(int nr_bandP, uint8_t scs_index);
int32_t get_delta_duplex(int nr_bandP, uint8_t scs_index);
lte_frame_type_t get_frame_type(uint16_t nr_bandP, uint8_t scs_index);
frame_type_t get_frame_type(uint16_t nr_bandP, uint8_t scs_index);
uint16_t get_band(uint64_t downlink_frequency, int32_t delta_duplex);
int NRRIV2BW(int locationAndBandwidth,int N_RB);
int NRRIV2PRBOFFSET(int locationAndBandwidth,int N_RB);
+1
View File
@@ -457,6 +457,7 @@ void init_gNB_Tpool(int inst) {
for (int i=0; i < 2; i++) {
notifiedFIFO_elt_t *msgL1Tx = newNotifiedFIFO_elt(sizeof(processingData_L1tx_t),0,gNB->L1_tx_out,tx_func);
processingData_L1tx_t *msgDataTx = (processingData_L1tx_t *)NotifiedFifoData(msgL1Tx);
memset(msgDataTx,0, sizeof(processingData_L1tx_t));
init_DLSCH_struct(gNB, msgDataTx);
memset(msgDataTx->ssb, 0, 64*sizeof(NR_gNB_SSB_t));
pushNotifiedFIFO(gNB->L1_tx_free,msgL1Tx); // to unblock the process in the beginning
-1
View File
@@ -51,7 +51,6 @@
#define CONFIG_HLP_UEFO "set UE to enable estimation and compensation of frequency offset\n"
#define CONFIG_HLP_DUMPFRAME "dump UE received frame to rxsig_frame0.dat and exit\n"
#define CONFIG_HLP_DLSHIFT "dynamic shift for LLR compuation for TM3/4 (default 0)\n"
#define CONFIG_HLP_UELOOP "get softmodem (UE) to loop through memory instead of acquiring from HW\n"
#define CONFIG_HLP_PHYTST "test UE phy layer, mac disabled\n"
#define CONFIG_HLP_DORA "test gNB and UE with RA procedures\n"
#define CONFIG_HLP_DMAMAP "sets flag for improved EXMIMO UE performance\n"
+7 -19
View File
@@ -573,17 +573,7 @@ static void UE_synch(void *arg) {
openair0_cfg[UE->rf_map.card].rx_freq[0],
openair0_cfg[UE->rf_map.card].tx_freq[0]);
if (UE->mode != loop_through_memory) {
UE->rfdevice.trx_set_freq_func(&UE->rfdevice,&openair0_cfg[0],0);
//UE->rfdevice.trx_set_gains_func(&openair0,&openair0_cfg[0]);
//UE->rfdevice.trx_stop_func(&UE->rfdevice);
// sleep(1);
/*if (UE->rfdevice.trx_start_func(&UE->rfdevice) != 0 ) {
LOG_E(HW,"Could not start the device\n");
oai_exit=1;
}*/
}
UE->rfdevice.trx_set_freq_func(&UE->rfdevice,&openair0_cfg[0],0);
if (UE->UE_scan_carrier == 1) {
UE->UE_scan_carrier = 0;
} else {
@@ -602,8 +592,7 @@ static void UE_synch(void *arg) {
LOG_I(PHY, "Initial sync failed: trying carrier off %d Hz\n", freq_offset);
if (UE->mode != loop_through_memory)
UE->rfdevice.trx_set_freq_func(&UE->rfdevice,&openair0_cfg[0],0);
UE->rfdevice.trx_set_freq_func(&UE->rfdevice,&openair0_cfg[0],0);
}
break;
@@ -648,7 +637,7 @@ void processSlotTX(void *arg) {
stop_meas(&UE->ue_ul_indication_stats);
}
if ((UE->mode != loop_through_memory) && (rxtxD->ue_sched_mode != NOT_PUSCH)) {
if (rxtxD->ue_sched_mode != NOT_PUSCH) {
phy_procedures_nrUE_TX(UE,proc,0);
}
}
@@ -738,9 +727,10 @@ void processSlotRX(void *arg) {
void dummyWrite(PHY_VARS_NR_UE *UE,openair0_timestamp timestamp, int writeBlockSize) {
void *dummy_tx[UE->frame_parms.nb_antennas_tx];
int16_t dummy_tx_data[UE->frame_parms.nb_antennas_tx][2*writeBlockSize]; // 2 because the function we call use pairs of int16_t implicitly as complex numbers
memset(dummy_tx_data, 0, sizeof(dummy_tx_data));
for (int i=0; i<UE->frame_parms.nb_antennas_tx; i++)
dummy_tx[i]=malloc16_clear(writeBlockSize*4);
dummy_tx[i]=dummy_tx_data[i];
AssertFatal( writeBlockSize ==
UE->rfdevice.trx_write_func(&UE->rfdevice,
@@ -750,8 +740,6 @@ void dummyWrite(PHY_VARS_NR_UE *UE,openair0_timestamp timestamp, int writeBlockS
UE->frame_parms.nb_antennas_tx,
4),"");
for (int i=0; i<UE->frame_parms.nb_antennas_tx; i++)
free(dummy_tx[i]);
}
void readFrame(PHY_VARS_NR_UE *UE, openair0_timestamp *timestamp, bool toTrash) {
@@ -793,7 +781,7 @@ void syncInFrame(PHY_VARS_NR_UE *UE, openair0_timestamp *timestamp) {
*timestamp += UE->frame_parms.get_samples_per_slot(1,&UE->frame_parms);
for ( int size=UE->rx_offset ; size > 0 ; size -= UE->frame_parms.samples_per_subframe ) {
int unitTransfer=size>UE->frame_parms.samples_per_subframe ? UE->frame_parms.samples_per_subframe : size ;
// we write before read becasue gNB waits for UE to write and both executions halt
// we write before read because gNB waits for UE to write and both executions halt
// this happens here as the read size is samples_per_subframe which is very much larger than samp_per_slot
if (IS_SOFTMODEM_RFSIM) dummyWrite(UE,*timestamp, unitTransfer);
AssertFatal(unitTransfer ==
+8 -5
View File
@@ -245,14 +245,17 @@ nrUE_params_t *get_nrUE_params(void) {
}
/* initialie thread pools used for NRUE processing paralleliation */
void init_tpools(uint8_t nun_dlsch_threads) {
char *params = NULL;
params = calloc(1,(NR_RX_NB_TH*NR_NB_TH_SLOT*3)+1);
char params[NR_RX_NB_TH*NR_NB_TH_SLOT*3+1]={0};
for (int i=0; i<NR_RX_NB_TH*NR_NB_TH_SLOT; i++) {
memcpy(params+(i*3),"-1,",3);
}
initTpool(params, &(nrUE_params.Tpool), false);
free(params);
init_dlsch_tpool( nun_dlsch_threads);
if (getenv("noThreads")) {
initTpool("n", &(nrUE_params.Tpool), false);
init_dlsch_tpool(0);
} else {
initTpool(params, &(nrUE_params.Tpool), false);
init_dlsch_tpool( nun_dlsch_threads);
}
}
static void get_options(void) {
-1
View File
@@ -53,7 +53,6 @@ extern "C"
#define CONFIG_HLP_DUMPFRAME "dump UE received frame to rxsig_frame0.dat and exit\n"
#define CONFIG_HLP_UELOOP "get softmodem (UE) to loop through memory instead of acquiring from HW\n"
#define CONFIG_HLP_PHYTST "test UE phy layer, mac disabled\n"
#define CONFIG_HLP_DORA "test gNB and UE with RA procedures\n"
#define CONFIG_HLP_SA "run gNB in standalone mode\n"
+58 -44
View File
@@ -307,62 +307,76 @@ void nr_interleaving_ldpc(uint32_t E, uint8_t Qm, uint8_t *e,uint8_t *f)
void nr_deinterleaving_ldpc(uint32_t E, uint8_t Qm, int16_t *e,int16_t *f)
{
{
int16_t *e1,*e2,*e3,*e4,*e5,*e6,*e7;
switch(Qm) {
case 2:
e1=e+(E/2);
for (int j = 0,j2=0; j< E/2; j+=2,j2+=4){
e[j] = f[j2];
e1[j] = f[j2+1];
e[j+1] = f[j2+2];
e1[j+1] = f[j2+3];
{
AssertFatal(E%2==0,"");
int16_t *e1=e+(E/2);
int16_t *end=f+E-1;
while( f<end ){
*e++ = *f++;
*e1++ = *f++;
}
}
break;
case 4:
e1=e+(E/4);
e2=e1+(E/4);
e3=e2+(E/4);
for (int j = 0,j2=0; j< E/4; j++,j2+=4){
e[j] = f[j2];
e1[j] = f[j2+1];
e2[j] = f[j2+2];
e3[j] = f[j2+3];
{
AssertFatal(E%4==0,"");
int16_t *e1=e+(E/4);
int16_t *e2=e1+(E/4);
int16_t *e3=e2+(E/4);
int16_t *end=f+E-3;
while( f<end ){
*e++ = *f++;
*e1++ = *f++;
*e2++ = *f++;
*e3++ = *f++;
}
}
break;
case 6:
e1=e+(E/6);
e2=e1+(E/6);
e3=e2+(E/6);
e4=e3+(E/6);
e5=e4+(E/6);
for (int j = 0,j2=0; j< E/6; j++,j2+=6){
e[j] = f[j2];
e1[j] = f[j2+1];
e2[j] = f[j2+2];
e3[j] = f[j2+3];
e4[j] = f[j2+4];
e5[j] = f[j2+5];
{
AssertFatal(E%6==0,"");
int16_t *e1=e+(E/6);
int16_t *e2=e1+(E/6);
int16_t *e3=e2+(E/6);
int16_t *e4=e3+(E/6);
int16_t *e5=e4+(E/6);
int16_t *end=f+E-5;
while( f<end ){
*e++ = *f++;
*e1++ = *f++;
*e2++ = *f++;
*e3++ = *f++;
*e4++ = *f++;
*e5++ = *f++;
}
}
break;
case 8:
e1=e+(E/8);
e2=e1+(E/8);
e3=e2+(E/8);
e4=e3+(E/8);
e5=e4+(E/8);
e6=e5+(E/8);
e7=e6+(E/8);
for (int j = 0,j2=0; j< E/8; j++,j2+=8){
e[j] = f[j2];
e1[j] = f[j2+1];
e2[j] = f[j2+2];
e3[j] = f[j2+3];
e4[j] = f[j2+4];
e5[j] = f[j2+5];
e6[j] = f[j2+6];
e7[j] = f[j2+7];
{
AssertFatal(E%8==0,"");
int16_t *e1=e+(E/8);
int16_t *e2=e1+(E/8);
int16_t *e3=e2+(E/8);
int16_t *e4=e3+(E/8);
int16_t *e5=e4+(E/8);
int16_t *e6=e5+(E/8);
int16_t *e7=e6+(E/8);
int16_t *end=f+E-7;
while( f<end ){
*e++ = *f++;
*e1++ = *f++;
*e2++ = *f++;
*e3++ = *f++;
*e4++ = *f++;
*e5++ = *f++;
*e6++ = *f++;
*e7++ = *f++;
}
}
break;
default:
+1 -1
View File
@@ -87,7 +87,7 @@ if ((Kprime%Kb) > 0)
else
Z = (Kprime/Kb);
LOG_D(PHY,"nr segmetation B %u Bprime %u Kprime %u z %u \n", B, Bprime, Kprime, Z);
LOG_D(PHY,"nr segmentation B %u Bprime %u Kprime %u z %u \n", B, Bprime, Kprime, Z);
if (Z <= 2) {
*K = 2;
+2
View File
@@ -359,6 +359,7 @@ int init_nr_ue_signal(PHY_VARS_NR_UE *ue, int nb_connected_gNB)
ue->nr_srs_info->srs_estimated_channel_time_shifted[i] = (int32_t *) malloc16_clear(fp->ofdm_symbol_size*MAX_NUM_NR_SRS_SYMBOLS*sizeof(int32_t));
}
// RACH
prach_vars[gNB_id]->prachF = (int16_t *)malloc16_clear( sizeof(int)*(7*2*sizeof(int)*(fp->ofdm_symbol_size*12)) );
prach_vars[gNB_id]->prach = (int16_t *)malloc16_clear( sizeof(int)*(7*2*sizeof(int)*(fp->ofdm_symbol_size*12)) );
@@ -455,6 +456,7 @@ void term_nr_ue_signal(PHY_VARS_NR_UE *ue, int nb_connected_gNB)
for (int gNB_id = 0; gNB_id < ue->n_connected_gNB; gNB_id++) {
for (int th_id = 0; th_id < RX_NB_TH_MAX; th_id++) {
free_and_zero(ue->pdcch_vars[th_id][gNB_id]);
}
@@ -102,7 +102,7 @@ int lte_est_freq_offset(int **dl_ch_estimates,
{
int ch_offset, omega, dl_ch_shift;
struct complex16 omega_cpx;
c16_t omega_cpx;
double phase_offset;
int freq_offset_est;
unsigned char aa;
@@ -142,8 +142,8 @@ int lte_est_freq_offset(int **dl_ch_estimates,
// printf("Computing freq_offset\n");
omega = dot_product(dl_ch,dl_ch_prev,(frame_parms->N_RB_DL/2 - 1)*12,dl_ch_shift);
//omega = dot_product(dl_ch,dl_ch_prev,frame_parms->ofdm_symbol_size,15);
omega_cpx.r = ((struct complex16*) &omega)->r;
omega_cpx.i = ((struct complex16*) &omega)->i;
omega_cpx.r = ((c16_t*) &omega)->r;
omega_cpx.i = ((c16_t*) &omega)->i;
dl_ch = (int16_t *)&dl_ch_estimates[aa][(((frame_parms->N_RB_DL/2) + 1)*12) + ch_offset];
@@ -155,8 +155,8 @@ int lte_est_freq_offset(int **dl_ch_estimates,
// calculate omega = angle(conj(dl_ch)*dl_ch_prev))
omega = dot_product(dl_ch,dl_ch_prev,((frame_parms->N_RB_DL/2) - 1)*12,dl_ch_shift);
omega_cpx.r += ((struct complex16*) &omega)->r;
omega_cpx.i += ((struct complex16*) &omega)->i;
omega_cpx.r += ((c16_t*) &omega)->r;
omega_cpx.i += ((c16_t*) &omega)->i;
// phase_offset += atan2((double)omega_cpx->i,(double)omega_cpx->r);
phase_offset += atan2((double)omega_cpx.i,(double)omega_cpx.r);
@@ -195,7 +195,7 @@ int lte_mbsfn_est_freq_offset(int **dl_ch_estimates,
{
int ch_offset, omega, dl_ch_shift;
struct complex16 *omega_cpx;
c16_t *omega_cpx;
double phase_offset;
int freq_offset_est;
unsigned char aa;
@@ -234,7 +234,7 @@ int lte_mbsfn_est_freq_offset(int **dl_ch_estimates,
// printf("Computing freq_offset\n");
omega = dot_product(dl_ch,dl_ch_prev,(frame_parms->N_RB_DL/2 - 1)*12,dl_ch_shift);
//omega = dot_product(dl_ch,dl_ch_prev,frame_parms->ofdm_symbol_size,15);
omega_cpx = (struct complex16*) &omega;
omega_cpx = (c16_t*) &omega;
// printf("omega (%d,%d)\n",omega_cpx->r,omega_cpx->i);
@@ -247,8 +247,8 @@ int lte_mbsfn_est_freq_offset(int **dl_ch_estimates,
// calculate omega = angle(conj(dl_ch)*dl_ch_prev))
omega = dot_product(dl_ch,dl_ch_prev,((frame_parms->N_RB_DL/2) - 1)*12,dl_ch_shift);
omega_cpx->r += ((struct complex16*) &omega)->r;
omega_cpx->i += ((struct complex16*) &omega)->i;
omega_cpx->r += ((c16_t*) &omega)->r;
omega_cpx->i += ((c16_t*) &omega)->i;
// phase_offset += atan2((double)omega_cpx->i,(double)omega_cpx->r);
phase_offset += atan2((double)omega_cpx->i,(double)omega_cpx->r);
// printf("omega (%d,%d) -> %f\n",omega_cpx->r,omega_cpx->i,phase_offset);
+11 -11
View File
@@ -34,9 +34,9 @@
// Note: this is for prototype of generate_drs_pusch (OTA synchronization of RRUs)
#include "PHY/LTE_UE_TRANSPORT/transport_proto_ue.h"
static struct complex16 *primary_synch0_time __attribute__((aligned(32)));
static struct complex16 *primary_synch1_time __attribute__((aligned(32)));
static struct complex16 *primary_synch2_time __attribute__((aligned(32)));
static c16_t *primary_synch0_time __attribute__((aligned(32)));
static c16_t *primary_synch1_time __attribute__((aligned(32)));
static c16_t *primary_synch2_time __attribute__((aligned(32)));
static void doIdft(int size, short *in, short *out) {
switch (size) {
@@ -67,7 +67,7 @@ static void doIdft(int size, short *in, short *out) {
}
}
static void copyPrimary( struct complex16 *out, struct complex16 *in, int ofdmSize) {
static void copyPrimary( c16_t *out, struct complex16 *in, int ofdmSize) {
int k=ofdmSize-36;
for (int i=0; i<72; i++) {
@@ -83,20 +83,20 @@ static void copyPrimary( struct complex16 *out, struct complex16 *in, int ofdmSi
}
int lte_sync_time_init(LTE_DL_FRAME_PARMS *frame_parms ) { // LTE_UE_COMMON *common_vars
struct complex16 syncF_tmp[2048]__attribute__((aligned(32)))= {{0}};
c16_t syncF_tmp[2048]__attribute__((aligned(32)))= {{0}};
int sz=frame_parms->ofdm_symbol_size*sizeof(*primary_synch0_time);
AssertFatal( NULL != (primary_synch0_time = (struct complex16 *)malloc16(sz)),"");
AssertFatal( NULL != (primary_synch0_time = (c16_t *)malloc16(sz)),"");
bzero(primary_synch0_time,sz);
AssertFatal( NULL != (primary_synch1_time = (struct complex16 *)malloc16(sz)),"");
AssertFatal( NULL != (primary_synch1_time = (c16_t *)malloc16(sz)),"");
bzero(primary_synch1_time,sz);
AssertFatal( NULL != (primary_synch2_time = (struct complex16 *)malloc16(sz)),"");
AssertFatal( NULL != (primary_synch2_time = (c16_t *)malloc16(sz)),"");
bzero(primary_synch2_time,sz);
// generate oversampled sync_time sequences
copyPrimary( syncF_tmp, (struct complex16 *) primary_synch0, frame_parms->ofdm_symbol_size);
copyPrimary( syncF_tmp, (c16_t *) primary_synch0, frame_parms->ofdm_symbol_size);
doIdft(frame_parms->N_RB_DL, (short *)syncF_tmp,(short *)primary_synch0_time);
copyPrimary( syncF_tmp, (struct complex16 *) primary_synch1, frame_parms->ofdm_symbol_size);
copyPrimary( syncF_tmp, (c16_t *) primary_synch1, frame_parms->ofdm_symbol_size);
doIdft(frame_parms->N_RB_DL, (short *)syncF_tmp,(short *)primary_synch1_time);
copyPrimary( syncF_tmp, (struct complex16 *) primary_synch2, frame_parms->ofdm_symbol_size);
copyPrimary( syncF_tmp, (c16_t *) primary_synch2, frame_parms->ofdm_symbol_size);
doIdft(frame_parms->N_RB_DL, (short *)syncF_tmp,(short *)primary_synch2_time);
if ( LOG_DUMPFLAG(DEBUG_LTEESTIM)){
@@ -2237,7 +2237,7 @@ int dlsch_modulation(PHY_VARS_eNB* phy_vars_eNB,
int P1_SHIFT[13],P2_SHIFT[13];
int offset,nushiftmod3;
uint8_t get_pmi_temp;
int get_pmi_temp;
MIMO_mode_t mimo_mode = -1;
uint8_t mprime=0,Ns;
+1 -1
View File
@@ -56,7 +56,7 @@ void rx_prach0(PHY_VARS_eNB *eNB,
uint8_t ce_level
) {
int i;
lte_frame_type_t frame_type;
frame_type_t frame_type;
uint16_t rootSequenceIndex;
uint8_t prach_ConfigIndex;
uint8_t Ncs_config;
+1 -1
View File
@@ -399,7 +399,7 @@ void compute_prach_seq(uint16_t rootSequenceIndex,
uint8_t prach_ConfigIndex,
uint8_t zeroCorrelationZoneConfig,
uint8_t highSpeedFlag,
lte_frame_type_t frame_type,
frame_type_t frame_type,
uint32_t X_u[64][839]) {
// Compute DFT of x_u => X_u[k] = x_u(inv(u)*k)^* X_u[k] = exp(j\pi u*inv(u)*k*(inv(u)*k+1)/N_ZC)
unsigned int k,inv_u,i,NCS=0,num_preambles;
+1 -1
View File
@@ -81,7 +81,7 @@ void compute_prach_seq(uint16_t rootSequenceIndex,
uint8_t prach_ConfigIndex,
uint8_t zeroCorrelationZoneConfig,
uint8_t highSpeedFlag,
lte_frame_type_t frame_type,
frame_type_t frame_type,
uint32_t X_u[64][839]);
#endif
@@ -224,7 +224,7 @@ uint8_t get_num_prach_tdd(module_id_t Mod_id);
@returns 0-1 accordingly
*/
/*
uint8_t get_prach_fmt(uint8_t prach_ConfigIndex,lte_frame_type_t frame_type);
uint8_t get_prach_fmt(uint8_t prach_ConfigIndex,frame_type_t frame_type);
*/
/*!
@@ -247,7 +247,7 @@ void compute_prach_seq(uint16_t rootSequenceIndex,
uint8_t prach_ConfigIndex,
uint8_t zeroCorrelationZoneConfig,
uint8_t highSpeedFlag,
lte_frame_type_t frame_type,
frame_type_t frame_type,
uint32_t X_u[64][839]);
@@ -299,7 +299,7 @@ uint64_t pmi2hex_2Ar1(uint32_t pmi);
uint64_t pmi2hex_2Ar2(uint32_t pmi);
uint8_t get_pmi(uint8_t N_RB_DL,MIMO_mode_t mode, uint32_t pmi_alloc,uint16_t rb);
uint8_t get_pmi(int N_RB_DL,MIMO_mode_t mode, uint32_t pmi_alloc,uint16_t rb);
// DL power control functions
double get_pa_dB(uint8_t pa);
+5 -5
View File
@@ -64,7 +64,7 @@ extern uint16_t beta_cqi[16];
extern uint16_t beta_ri[16];
extern uint16_t beta_ack[16];
void extract_dci1A_info(uint8_t N_RB_DL, lte_frame_type_t frame_type, void *dci_pdu, DCI_INFO_EXTRACTED_t *pdci_info_extarcted)
void extract_dci1A_info(uint8_t N_RB_DL, frame_type_t frame_type, void *dci_pdu, DCI_INFO_EXTRACTED_t *pdci_info_extarcted)
{
uint8_t harq_pid=0;
uint32_t rballoc=0;
@@ -182,7 +182,7 @@ void extract_dci1A_info(uint8_t N_RB_DL, lte_frame_type_t frame_type, void *dci_
pdci_info_extarcted->dai = dai;
}
void extract_dci1C_info(uint8_t N_RB_DL, lte_frame_type_t frame_type, void *dci_pdu, DCI_INFO_EXTRACTED_t *pdci_info_extarcted)
void extract_dci1C_info(uint8_t N_RB_DL, frame_type_t frame_type, void *dci_pdu, DCI_INFO_EXTRACTED_t *pdci_info_extarcted)
{
uint32_t rballoc=0;
@@ -222,7 +222,7 @@ void extract_dci1C_info(uint8_t N_RB_DL, lte_frame_type_t frame_type, void *dci_
pdci_info_extarcted->Ngap = Ngap;
}
void extract_dci1_info(uint8_t N_RB_DL, lte_frame_type_t frame_type, void *dci_pdu, DCI_INFO_EXTRACTED_t *pdci_info_extarcted)
void extract_dci1_info(uint8_t N_RB_DL, frame_type_t frame_type, void *dci_pdu, DCI_INFO_EXTRACTED_t *pdci_info_extarcted)
{
uint32_t rballoc=0;
@@ -329,7 +329,7 @@ void extract_dci1_info(uint8_t N_RB_DL, lte_frame_type_t frame_type, void *dci_p
}
void extract_dci2_info(uint8_t N_RB_DL, lte_frame_type_t frame_type, uint8_t nb_antenna_ports_eNB, void *dci_pdu, DCI_INFO_EXTRACTED_t *pdci_info_extarcted)
void extract_dci2_info(uint8_t N_RB_DL, frame_type_t frame_type, uint8_t nb_antenna_ports_eNB, void *dci_pdu, DCI_INFO_EXTRACTED_t *pdci_info_extarcted)
{
uint32_t rballoc=0;
@@ -615,7 +615,7 @@ void extract_dci2_info(uint8_t N_RB_DL, lte_frame_type_t frame_type, uint8_t nb_
}
void extract_dci2A_info(uint8_t N_RB_DL, lte_frame_type_t frame_type, uint8_t nb_antenna_ports_eNB, void *dci_pdu, DCI_INFO_EXTRACTED_t *pdci_info_extarcted)
void extract_dci2A_info(uint8_t N_RB_DL, frame_type_t frame_type, uint8_t nb_antenna_ports_eNB, void *dci_pdu, DCI_INFO_EXTRACTED_t *pdci_info_extarcted)
{
uint32_t rballoc=0;
+1 -1
View File
@@ -21,7 +21,7 @@
#include "PHY/LTE_UE_TRANSPORT/transport_proto_ue.h"
uint8_t get_pmi(uint8_t N_RB_DL, MIMO_mode_t mode, uint32_t pmi_alloc,uint16_t rb)
uint8_t get_pmi(int N_RB_DL, MIMO_mode_t mode, uint32_t pmi_alloc,uint16_t rb)
{
/*
MIMO_mode_t mode = dlsch_harq->mimo_mode;
+1 -1
View File
@@ -46,7 +46,7 @@
//#define PRACH_DEBUG 1
int32_t generate_prach( PHY_VARS_UE *ue, uint8_t eNB_id, uint8_t subframe, uint16_t Nf ) {
lte_frame_type_t frame_type = ue->frame_parms.frame_type;
frame_type_t frame_type = ue->frame_parms.frame_type;
//uint8_t tdd_config = ue->frame_parms.tdd_config;
uint16_t rootSequenceIndex = ue->frame_parms.prach_config_common.rootSequenceIndex;
uint8_t prach_ConfigIndex = ue->frame_parms.prach_config_common.prach_ConfigInfo.prach_ConfigIndex;
@@ -1550,16 +1550,6 @@ uint64_t cqi2hex(uint32_t cqi);
uint16_t computeRIV(uint16_t N_RB_DL,uint16_t RBstart,uint16_t Lcrbs);
/** \brief This routine extracts a single subband PMI from a bitmap coming from UCI or the pmi_extend function
@param N_RB_DL number of resource blocks
@param mimo_mode
@param pmi_alloc subband PMI bitmap
@param rb resource block for which to extract PMI
@returns subband PMI
*/
uint8_t get_pmi(uint8_t N_RB_DL,MIMO_mode_t mode, uint32_t pmi_alloc,uint16_t rb);
int get_nCCE_offset_l1(int *CCE_table,
const unsigned char L,
const int nCCE,
@@ -1669,7 +1659,7 @@ uint8_t get_num_prach_tdd(module_id_t Mod_id);
@param frame_type 0-FDD, 1-TDD
@returns 0-1 accordingly
*/
uint8_t get_prach_fmt(uint8_t prach_ConfigIndex,lte_frame_type_t frame_type);
uint8_t get_prach_fmt(uint8_t prach_ConfigIndex,frame_type_t frame_type);
/*!
\brief Helper for MAC, returns frequency index of PRACH resource in TDD for a particular configuration index
@@ -1691,7 +1681,7 @@ void compute_prach_seq(uint16_t rootSequenceIndex,
uint8_t prach_ConfigIndex,
uint8_t zeroCorrelationZoneConfig,
uint8_t highSpeedFlag,
lte_frame_type_t frame_type,
frame_type_t frame_type,
uint32_t X_u[64][839]);
@@ -107,25 +107,20 @@ void gNB_I0_measurements(PHY_VARS_gNB *gNB,int slot, int first_symb,int num_symb
NR_DL_FRAME_PARMS *frame_parms = &gNB->frame_parms;
NR_gNB_COMMON *common_vars = &gNB->common_vars;
PHY_MEASUREMENTS_gNB *measurements = &gNB->measurements;
int rb, offset, offset0, nb_symb[275], len;
int32_t *ul_ch;
LOG_D(PHY,"slot %d Doing I0 for first_symb %d, num_symb %d\n",slot,first_symb,num_symb);
int rb, nb_symb[275]={0};
memset(measurements->n0_subband_power, 0, sizeof(measurements->n0_subband_power));
for (int s=first_symb;s<(first_symb+num_symb);s++) {
for (rb=0; rb<frame_parms->N_RB_UL; rb++) {
if (s==first_symb) {
nb_symb[rb]=0;
for (int aarx=0; aarx<frame_parms->nb_antennas_rx;aarx++)
measurements->n0_subband_power[aarx][rb]=0;
}
offset0 = (slot&3)*(frame_parms->symbols_per_slot * frame_parms->ofdm_symbol_size) + (frame_parms->first_carrier_offset + (rb*12))%frame_parms->ofdm_symbol_size;
int offset0 = (slot&3)*(frame_parms->symbols_per_slot * frame_parms->ofdm_symbol_size) +
(frame_parms->first_carrier_offset + (rb*12))%frame_parms->ofdm_symbol_size;
if ((gNB->rb_mask_ul[s][rb>>5]&(1<<(rb&31))) == 0) { // check that rb was not used in this subframe
nb_symb[rb]++;
for (int aarx=0; aarx<frame_parms->nb_antennas_rx; aarx++) {
offset = offset0 + (s*frame_parms->ofdm_symbol_size);
ul_ch = &common_vars->rxdataF[aarx][offset];
len = 12;
int offset = offset0 + (s*frame_parms->ofdm_symbol_size);
int32_t *ul_ch = &common_vars->rxdataF[aarx][offset];
int len = 12;
if (((frame_parms->N_RB_UL&1) == 1) &&
(rb==(frame_parms->N_RB_UL>>1))) {
len=6;
-6
View File
@@ -113,12 +113,6 @@ EXTERN int16_t *primary_synchro_time_nr[NUMBER_PSS_SEQUENCE]
#endif
;
EXTERN int64_t *pss_corr_ue[NUMBER_PSS_SEQUENCE]
#ifdef INIT_VARIABLES_PSS_NR_H
= { NULL, NULL, NULL}
#endif
;
/* profiling structure */
EXTERN time_stats_t generic_time[TIME_LAST];
+3 -3
View File
@@ -268,8 +268,8 @@ void nr_ptrs_cpe_estimation(uint8_t K_ptrs,
return;
}
uint16_t sc_per_symbol = (nb_rb + K_ptrs - 1)/K_ptrs;
struct complex16 ptrs_p[(1 + sc_per_symbol/4)*4];
struct complex16 dmrs_comp_p[(1 + sc_per_symbol/4)*4];
c16_t ptrs_p[(1 + sc_per_symbol/4)*4];
c16_t dmrs_comp_p[(1 + sc_per_symbol/4)*4];
double abs = 0.0;
double real = 0.0;
double imag = 0.0;
@@ -422,7 +422,7 @@ void get_slope_from_estimates(uint8_t start, uint8_t end, int16_t *est_p, double
/* estimate from slope */
void ptrs_estimate_from_slope(int16_t *error_est, double *slope_p, uint8_t start, uint8_t end)
{
struct complex16 *error=(struct complex16 *) error_est;
c16_t *error=(struct complex16 *) error_est;
for(uint8_t i = 1; i< (end -start);i++) {
error[start+i].r = error[start].r + (int16_t)(i * slope_p[0]);// real
error[start+i].i = error[start].i + (int16_t)(i * slope_p[1]); //imag
+1
View File
@@ -141,6 +141,7 @@ void nr_generate_dci(PHY_VARS_gNB *gNB,
polar_encoder_fast((uint64_t*)dci_pdu->Payload, (void*)encoder_output, n_RNTI, 1,
NR_POLAR_DCI_MESSAGE_TYPE, dci_pdu->PayloadSizeBits, dci_pdu->AggregationLevel);
#ifdef DEBUG_CHANNEL_CODING
//debug dump dci
printf("polar rnti %x,length %d, L %d\n",n_RNTI, dci_pdu->PayloadSizeBits,pdcch_pdu_rel15->dci_pdu->AggregationLevel);
printf("DCI PDU: [0]->0x%lx \t [1]->0x%lx\n",
((uint64_t*)dci_pdu->Payload)[0], ((uint64_t*)dci_pdu->Payload)[1]);
+3 -1
View File
@@ -129,7 +129,7 @@ void nr_generate_pdsch(processingData_L1tx_t *msgTx,
start_meas(dlsch_encoding_stats);
if (nr_dlsch_encoding(gNB,
harq->pdu, frame, slot, dlsch, frame_parms,output,tinput,tprep,tparity,toutput,
frame, slot, harq, frame_parms,output,tinput,tprep,tparity,toutput,
dlsch_rate_matching_stats,
dlsch_interleaving_stats,
dlsch_segmentation_stats) == -1)
@@ -163,6 +163,7 @@ void nr_generate_pdsch(processingData_L1tx_t *msgTx,
rel15->dataScramblingId,
rel15->rnti,
scrambled_output);
#ifdef DEBUG_DLSCH
printf("PDSCH scrambling:\n");
for (int i=0; i<encoded_length>>8; i++) {
@@ -171,6 +172,7 @@ void nr_generate_pdsch(processingData_L1tx_t *msgTx,
printf("\n");
}
#endif
stop_meas(dlsch_scrambling_stats);
/// Modulation
start_meas(dlsch_modulation_stats);
+2 -2
View File
@@ -78,9 +78,9 @@ int16_t find_nr_dlsch(uint16_t rnti, PHY_VARS_gNB *gNB,find_type_t type);
NR_gNB_SCH_STATS_t *find_nr_dlsch_stats(uint16_t rnti, PHY_VARS_gNB *gNB,find_type_t type);
int nr_dlsch_encoding(PHY_VARS_gNB *gNB,
unsigned char *a,int frame,
int frame,
uint8_t slot,
NR_gNB_DLSCH_t *dlsch,
NR_DL_gNB_HARQ_t *harq,
NR_DL_FRAME_PARMS* frame_parms,
unsigned char * output,
time_stats_t *tinput,
+5 -7
View File
@@ -286,10 +286,9 @@ void ldpc8blocks( void *p) {
}
int nr_dlsch_encoding(PHY_VARS_gNB *gNB,
unsigned char *a,
int frame,
uint8_t slot,
NR_gNB_DLSCH_t *dlsch,
NR_DL_gNB_HARQ_t *harq,
NR_DL_FRAME_PARMS *frame_parms,
unsigned char * output,
time_stats_t *tinput,time_stats_t *tprep,time_stats_t *tparity,time_stats_t *toutput,
@@ -298,13 +297,12 @@ int nr_dlsch_encoding(PHY_VARS_gNB *gNB,
encoder_implemparams_t impp;
impp.output=output;
unsigned int crc=1;
NR_DL_gNB_HARQ_t *harq = &dlsch->harq_process;
nfapi_nr_dl_tti_pdsch_pdu_rel15_t *rel15 = &harq->pdsch_pdu.pdsch_pdu_rel15;
impp.Zc = &dlsch->harq_process.Z;
impp.Zc = &harq->Z;
float Coderate = 0.0;
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_gNB_DLSCH_ENCODING, VCD_FUNCTION_IN);
uint32_t A = rel15->TBSize[0]<<3;
unsigned char *a=harq->pdu;
if ( rel15->rnti != SI_RNTI)
trace_NRpdu(DIRECTION_DOWNLINK, a, rel15->TBSize[0], 0, WS_C_RNTI, rel15->rnti, frame, slot,0, 0);
@@ -317,14 +315,14 @@ int nr_dlsch_encoding(PHY_VARS_gNB *gNB,
stats=&gNB->dlsch_stats[i];
}
if (gNB->dlsch_stats[i].rnti == dlsch->rnti) {
if (gNB->dlsch_stats[i].rnti == rel15->rnti) {
stats=&gNB->dlsch_stats[i];
break;
}
}
if (stats) {
stats->rnti = dlsch->rnti;
stats->rnti = rel15->rnti;
stats->total_bytes_tx += rel15->TBSize[0];
stats->current_RI = rel15->nrOfLayers;
stats->current_Qm = rel15->qamModOrder[0];
+78 -66
View File
@@ -243,7 +243,7 @@ void nr_decode_pucch0(PHY_VARS_gNB *gNB,
* x(l*12+n) = r_u_v_alpha_delta(n)
*/
// the value of u,v (delta always 0 for PUCCH) has to be calculated according to TS 38.211 Subclause 6.3.2.2.1
uint8_t u[2]={0,0},v[2]={0,0};
uint8_t u[2]={0},v[2]={0};
// x_n contains the sequence r_u_v_alpha_delta(n)
@@ -262,7 +262,7 @@ void nr_decode_pucch0(PHY_VARS_gNB *gNB,
AssertFatal(pucch_pdu->nr_of_symbols < 3,"nr_of_symbols %d not allowed\n",pucch_pdu->nr_of_symbols);
uint32_t re_offset[2]={0,0};
uint32_t re_offset[2]={0};
uint8_t l2;
const int16_t *x_re[2],*x_im[2];
@@ -271,16 +271,10 @@ void nr_decode_pucch0(PHY_VARS_gNB *gNB,
x_re[1] = table_5_2_2_2_2_Re[u[1]];
x_im[1] = table_5_2_2_2_2_Im[u[1]];
int16_t xr[1+frame_parms->nb_antennas_rx][1+pucch_pdu->nr_of_symbols][24] __attribute__((aligned(32)));
c64_t xr[frame_parms->nb_antennas_rx][pucch_pdu->nr_of_symbols][12] __attribute__((aligned(32)));
int64_t xrtmag=0,xrtmag_next=0;
uint8_t maxpos=0;
uint8_t index=0;
for (int l=0; l<pucch_pdu->nr_of_symbols; l++) {
for (int aarx=0;aarx<frame_parms->nb_antennas_rx;aarx++) {
memset((void*)xr[aarx][l],0,24*sizeof(int16_t));
}
}
int n2;
for (int l=0; l<pucch_pdu->nr_of_symbols; l++) {
l2 = l+pucch_pdu->start_symbol_index;
@@ -289,75 +283,68 @@ void nr_decode_pucch0(PHY_VARS_gNB *gNB,
re_offset[l]-=frame_parms->ofdm_symbol_size;
AssertFatal(re_offset[l]+12 < frame_parms->ofdm_symbol_size,"pucch straddles DC carrier, handle this!\n");
int16_t *r;
for (int aa=0;aa<frame_parms->nb_antennas_rx;aa++) {
r=(int16_t*)&rxdataF[aa][soffset+(l2*frame_parms->ofdm_symbol_size)+re_offset[l]];
n2=0;
for (n=0;n<12;n++,n2+=2) {
xr[aa][l][n2] +=(int16_t)(((int32_t)x_re[l][n]*r[n2]+(int32_t)x_im[l][n]*r[n2+1])>>15);
xr[aa][l][n2+1]+=(int16_t)(((int32_t)x_re[l][n]*r[n2+1]-(int32_t)x_im[l][n]*r[n2])>>15);
c16_t *r=(c16_t*)&rxdataF[aa][soffset+(l2*frame_parms->ofdm_symbol_size)+re_offset[l]];
for (n=0;n<12;n++) {
xr[aa][l][n].r = (int32_t)x_re[l][n] * r[n].r + (int32_t)x_im[l][n] * r[n].i;
xr[aa][l][n].i = (int32_t)x_re[l][n] * r[n].i - (int32_t)x_im[l][n] * r[n].r;
#ifdef DEBUG_NR_PUCCH_RX
printf("x (%d,%d), r%d.%d (%d,%d), xr (%d,%d)\n",
x_re[l][n],x_im[l][n],l2,re_offset[l],r[n2],r[n2+1],xr[aa][l][n2],xr[aa][l][n2+1]);
printf("x (%d,%d), r%d.%d (%d,%d), xr (%lld,%lld)\n",
x_re[l][n],x_im[l][n],l2,re_offset[l],r[n].r,r[n].i,xr[aa][l][n].r,xr[aa][l][n].i);
#endif
}
}
}
int32_t corr_re[1+frame_parms->nb_antennas_rx][2];
int32_t corr_im[1+frame_parms->nb_antennas_rx][2];
//int32_t no_corr = 0;
int seq_index = 0;
int64_t temp;
for(i=0;i<nr_sequences;i++){
for (int l=0;l<pucch_pdu->nr_of_symbols;l++) {
seq_index = (pucch_pdu->initial_cyclic_shift+
mcs[i]+
gNB->pucch0_lut.lut[cs_ind][slot][l+pucch_pdu->start_symbol_index])%12;
c64_t corr[frame_parms->nb_antennas_rx][2];
for (int aa=0;aa<frame_parms->nb_antennas_rx;aa++) {
for (int l=0;l<pucch_pdu->nr_of_symbols;l++) {
seq_index = (pucch_pdu->initial_cyclic_shift+
mcs[i]+
gNB->pucch0_lut.lut[cs_ind][slot][l+pucch_pdu->start_symbol_index])%12;
#ifdef DEBUG_NR_PUCCH_RX
printf("PUCCH symbol %d seq %d, seq_index %d, mcs %d\n",l,i,seq_index,mcs[i]);
printf("PUCCH symbol %d seq %d, seq_index %d, mcs %d\n",l,i,seq_index,mcs[i]);
#endif
for (int aa=0;aa<frame_parms->nb_antennas_rx;aa++) {
corr_re[aa][l]=0;
corr_im[aa][l]=0;
n2=0;
for (n=0;n<12;n++,n2+=2) {
corr_re[aa][l]+=(xr[aa][l][n2]*idft12_re[seq_index][n]+xr[aa][l][n2+1]*idft12_im[seq_index][n])>>15;
corr_im[aa][l]+=(xr[aa][l][n2]*idft12_im[seq_index][n]-xr[aa][l][n2+1]*idft12_re[seq_index][n])>>15;
corr[aa][l]=(c64_t){0};
for (n = 0; n < 12; n++) {
corr[aa][l].r += xr[aa][l][n].r * idft12_re[seq_index][n] + xr[aa][l][n].i * idft12_im[seq_index][n];
corr[aa][l].i += xr[aa][l][n].r * idft12_im[seq_index][n] - xr[aa][l][n].i * idft12_re[seq_index][n];
}
corr[aa][l].r >>= 31;
corr[aa][l].i >>= 31;
}
}
LOG_D(PHY,"PUCCH IDFT[%d/%d] = (%d,%d)=>%f\n",
mcs[i],seq_index,corr_re[0][0],corr_im[0][0],
10*log10((double)corr_re[0][0]*corr_re[0][0] + (double)corr_im[0][0]*corr_im[0][0]));
LOG_D(PHY,"PUCCH IDFT[%d/%d] = (%ld,%ld)=>%f\n",
mcs[i],seq_index,corr[0][0].r,corr[0][0].i,
10*log10((double)squaredMod(corr[0][0])));
if (pucch_pdu->nr_of_symbols==2)
LOG_D(PHY,"PUCCH 2nd symbol IDFT[%d/%d] = (%d,%d)=>%f\n",
mcs[i],seq_index,corr_re[0][1],corr_im[0][1],
10*log10((double)corr_re[0][1]*corr_re[0][1] + (double)corr_im[0][1]*corr_im[0][1]));
LOG_D(PHY,"PUCCH 2nd symbol IDFT[%d/%d] = (%ld,%ld)=>%f\n",
mcs[i],seq_index,corr[0][1].r,corr[0][1].i,
10*log10((double)squaredMod(corr[0][1])));
if (pucch_pdu->freq_hop_flag == 0) {
if (pucch_pdu->nr_of_symbols==1) {// non-coherent correlation
temp=0;
for (int aa=0;aa<frame_parms->nb_antennas_rx;aa++)
temp+=(int64_t)corr_re[aa][0]*corr_re[aa][0] + (int64_t)corr_im[aa][0]*corr_im[aa][0];
temp+=squaredMod(corr[aa][0]);
} else {
int64_t corr_re2=0;
int64_t corr_im2=0;
temp=0;
for (int aa=0;aa<frame_parms->nb_antennas_rx;aa++) {
corr_re2 = (int64_t)corr_re[aa][0]+corr_re[aa][1];
corr_im2 = (int64_t)corr_im[aa][0]+corr_im[aa][1];
// coherent combining of 2 symbols and then complex modulus for single-frequency case
temp+=corr_re2*corr_re2 + corr_im2*corr_im2;
c64_t corr2;
csum(corr2, corr[aa][0], corr[aa][1]);
// coherent combining of 2 symbols and then complex modulus for single-frequency case
temp+=corr2.r*corr2.r + corr2.i*corr2.i;
}
}
} else if (pucch_pdu->freq_hop_flag == 1) {
// full non-coherent combining of 2 symbols for frequency-hopping case
temp=0;
for (int aa=0;aa<frame_parms->nb_antennas_rx;aa++)
temp += (int64_t)corr_re[aa][0]*corr_re[aa][0] + (int64_t)corr_im[aa][0]*corr_im[aa][0] + (int64_t)corr_re[aa][1]*corr_re[aa][1] + (int64_t)corr_im[aa][1]*corr_im[aa][1];
temp += squaredMod(corr[aa][0]) + squaredMod(corr[aa][1]);
}
else AssertFatal(1==0,"shouldn't happen\n");
@@ -369,9 +356,9 @@ void nr_decode_pucch0(PHY_VARS_gNB *gNB,
uci_stats->current_pucch0_stat0 = 0;
int64_t temp2=0,temp3=0;;
for (int aa=0;aa<frame_parms->nb_antennas_rx;aa++) {
temp2 += ((int64_t)corr_re[aa][0]*corr_re[aa][0] + (int64_t)corr_im[aa][0]*corr_im[aa][0]);
temp2 += squaredMod(corr[aa][0]);
if (pucch_pdu->nr_of_symbols==2)
temp3 += ((int64_t)corr_re[aa][1]*corr_re[aa][1] + (int64_t)corr_im[aa][1]*corr_im[aa][1]);
temp3 += squaredMod(corr[aa][1]);
}
uci_stats->current_pucch0_stat0= dB_fixed64(temp2);
if ( pucch_pdu->nr_of_symbols==2)
@@ -392,7 +379,8 @@ void nr_decode_pucch0(PHY_VARS_gNB *gNB,
uci_stats->pucch0_n01 = gNB->measurements.n0_subband_power_tot_dB[prb_offset[1]];
LOG_D(PHY,"n00[%d] = %d, n01[%d] = %d\n",prb_offset[0],uci_stats->pucch0_n00,prb_offset[1],uci_stats->pucch0_n01);
// estimate CQI for MAC (from antenna port 0 only)
int max_n0 = uci_stats->pucch0_n00>uci_stats->pucch0_n01 ? uci_stats->pucch0_n00:uci_stats->pucch0_n01;
int max_n0 = max(gNB->measurements.n0_subband_power_tot_dB[prb_offset[0]],
gNB->measurements.n0_subband_power_tot_dB[prb_offset[1]]);
int SNRtimes10,sigenergy=0;
for (int aa=0;aa<frame_parms->nb_antennas_rx;aa++)
sigenergy += signal_energy_nodc(&rxdataF[aa][soffset+
@@ -407,8 +395,15 @@ void nr_decode_pucch0(PHY_VARS_gNB *gNB,
uci_stats->pucch0_thres = gNB->pucch0_thres; /* + (10*max_n0);*/
bool no_conf=false;
if (nr_sequences>1) {
if (xrtmag_dBtimes10 < (50+xrtmag_next_dBtimes10) || SNRtimes10 < uci_stats->pucch0_thres)
if (xrtmag_dBtimes10 < (50+xrtmag_next_dBtimes10) || SNRtimes10 < gNB->pucch0_thres) {
no_conf=true;
LOG_D(PHY,"%d.%d PUCCH bad confidence: %d threshold, %d, %d, %d\n",
frame, slot,
uci_stats->pucch0_thres,
SNRtimes10,
xrtmag_dBtimes10,
xrtmag_next_dBtimes10);
}
}
gNB->bad_pucch += no_conf;
// first bit of bitmap for sr presence and second bit for acknack presence
@@ -422,11 +417,12 @@ void nr_decode_pucch0(PHY_VARS_gNB *gNB,
if (pucch_pdu->bit_len_harq==0) {
uci_pdu->harq = NULL;
uci_pdu->sr = calloc(1,sizeof(*uci_pdu->sr));
uci_pdu->sr->sr_confidence_level = no_conf ? 1 : 0;
uci_pdu->sr->sr_confidence_level = SNRtimes10 < uci_stats->pucch0_thres;
uci_stats->pucch0_sr_trials++;
if (xrtmag_dBtimes10>(10*gNB->measurements.n0_power_tot_dB)) {
if (xrtmag_dBtimes10>(10*max_n0+100)) {
uci_pdu->sr->sr_indication = 1;
uci_stats->pucch0_positive_SR++;
LOG_D(PHY,"PUCCH0 got positive SR. Cumulative number of positive SR %d\n", uci_stats->pucch0_positive_SR);
} else {
uci_pdu->sr->sr_indication = 0;
}
@@ -434,35 +430,50 @@ void nr_decode_pucch0(PHY_VARS_gNB *gNB,
else if (pucch_pdu->bit_len_harq==1) {
uci_pdu->harq = calloc(1,sizeof(*uci_pdu->harq));
uci_pdu->harq->num_harq = 1;
uci_pdu->harq->harq_confidence_level = no_conf ? 1 : 0;
uci_pdu->harq->harq_list = (nfapi_nr_harq_t*)malloc(1);
uci_pdu->harq->harq_confidence_level = no_conf;
uci_pdu->harq->harq_list = (nfapi_nr_harq_t*)malloc(sizeof *uci_pdu->harq->harq_list);
uci_pdu->harq->harq_list[0].harq_value = !(index&0x01);
LOG_D(PHY, "[DLSCH/PDSCH/PUCCH] %d.%d HARQ value %d (0 pass, 1 fail) with confidence level %d (0 is good, 1 is bad) xrt_mag %d xrt_mag_next %d n0 %d (%d,%d) pucch0_thres %d, cqi %d, SNRtimes10 %d, energy %f, sync_pos %d\n",
frame,slot,uci_pdu->harq->harq_list[0].harq_value,uci_pdu->harq->harq_confidence_level,xrtmag_dBtimes10,xrtmag_next_dBtimes10,max_n0,uci_stats->pucch0_n00,uci_stats->pucch0_n01,uci_stats->pucch0_thres,cqi,SNRtimes10,10*log10((double)sigenergy),gNB->ulsch_stats[0].sync_pos);
LOG_D(PHY, "[DLSCH/PDSCH/PUCCH] %d.%d HARQ %s with confidence level %s xrt_mag %d xrt_mag_next %d n0 %d (%d,%d) pucch0_thres %d, cqi %d, SNRtimes10 %d, energy %f, sync_pos %d\n",
frame,slot,uci_pdu->harq->harq_list[0].harq_value==0?"ACK":"NACK",
uci_pdu->harq->harq_confidence_level==0?"good":"bad",
xrtmag_dBtimes10,xrtmag_next_dBtimes10,max_n0,uci_stats->pucch0_n00,uci_stats->pucch0_n01,uci_stats->pucch0_thres,cqi,SNRtimes10,10*log10((double)sigenergy),gNB->ulsch_stats[0].sync_pos);
if (pucch_pdu->sr_flag == 1) {
uci_pdu->sr = calloc(1,sizeof(*uci_pdu->sr));
uci_pdu->sr->sr_indication = (index>1) ? 1 : 0;
uci_pdu->sr->sr_confidence_level = no_conf ? 1 : 0;
uci_stats->pucch0_positive_SR++;
uci_pdu->sr->sr_indication = (index>1);
uci_pdu->sr->sr_confidence_level = no_conf;
if(uci_pdu->sr->sr_indication == 1 && uci_pdu->sr->sr_confidence_level == 0) {
uci_stats->pucch0_positive_SR++;
LOG_D(PHY,"PUCCH0 got positive SR. Cumulative number of positive SR %d\n", uci_stats->pucch0_positive_SR);
}
}
uci_stats->pucch01_trials++;
}
else {
uci_pdu->harq = calloc(1,sizeof(*uci_pdu->harq));
uci_pdu->harq->num_harq = 2;
uci_pdu->harq->harq_confidence_level = (no_conf) ? 1 : 0;
uci_pdu->harq->harq_list = (nfapi_nr_harq_t*)malloc(2);
uci_pdu->harq->harq_confidence_level = no_conf;
uci_pdu->harq->harq_list = (nfapi_nr_harq_t*)malloc(2 * sizeof( *uci_pdu->harq->harq_list));
uci_pdu->harq->harq_list[1].harq_value = !(index&0x01);
uci_pdu->harq->harq_list[0].harq_value = !((index>>1)&0x01);
LOG_D(PHY, "[DLSCH/PDSCH/PUCCH] %d.%d HARQ values %d and %d (0 pass, 1 fail) with confidence level %d (0 is good, 1 is bad), xrt_mag %d xrt_mag_next %d n0 %d (%d,%d) pucch0_thres %d, cqi %d, SNRtimes10 %d,sync_pos %d\n",
frame,slot,uci_pdu->harq->harq_list[1].harq_value,uci_pdu->harq->harq_list[0].harq_value,uci_pdu->harq->harq_confidence_level,xrtmag_dBtimes10,xrtmag_next_dBtimes10,max_n0,uci_stats->pucch0_n00,uci_stats->pucch0_n01,uci_stats->pucch0_thres,cqi,SNRtimes10,gNB->ulsch_stats[0].sync_pos);
LOG_D(PHY, "[DLSCH/PDSCH/PUCCH] %d.%d HARQ values (%s, %s) with confidence level %s, xrt_mag %d xrt_mag_next %d n0 %d (%d,%d) pucch0_thres %d, cqi %d, SNRtimes10 %d,sync_pos %d\n",
frame,slot,
uci_pdu->harq->harq_list[1].harq_value == 0 ? "ACK" : "NACK",
uci_pdu->harq->harq_list[0].harq_value == 0 ? "ACK" : "NACK",
uci_pdu->harq->harq_confidence_level == 0 ? "good" : "bad",
xrtmag_dBtimes10,xrtmag_next_dBtimes10,max_n0,
uci_stats->pucch0_n00,uci_stats->pucch0_n01,uci_stats->pucch0_thres,cqi,
SNRtimes10,gNB->ulsch_stats[0].sync_pos);
if (pucch_pdu->sr_flag == 1) {
uci_pdu->sr = calloc(1,sizeof(*uci_pdu->sr));
uci_pdu->sr->sr_indication = (index>3) ? 1 : 0;
uci_pdu->sr->sr_confidence_level = (no_conf) ? 1 : 0;
uci_pdu->sr->sr_confidence_level = no_conf;
if(uci_pdu->sr->sr_indication == 1 && uci_pdu->sr->sr_confidence_level == 0) {
uci_stats->pucch0_positive_SR++;
LOG_D(PHY,"PUCCH0 got positive SR. Cumulative number of positive SR %d\n", uci_stats->pucch0_positive_SR);
}
}
}
}
@@ -1671,7 +1682,8 @@ void nr_decode_pucch2(PHY_VARS_gNB *gNB,
LOG_D(PHY,"metric %d dB\n",corr_dB);
}
// estimate CQI for MAC (from antenna port 0 only)
// estimate CQI for MAC (from antenna port 0 only)
// TODO this computation is wrong -> to be ignored at MAC for now
int SNRtimes10 = dB_fixed_times10(signal_energy_nodc(&rxdataF[0][soffset+(l2*frame_parms->ofdm_symbol_size)+re_offset[0]],
12*pucch_pdu->prb_size)) -
(10*gNB->measurements.n0_power_tot_dB);
+14 -10
View File
@@ -80,8 +80,8 @@ char nr_dci_format_string[8][30] = {
//static const int16_t conjugate[8]__attribute__((aligned(32))) = {-1,1,-1,1,-1,1,-1,1};
void nr_pdcch_demapping_deinterleaving(uint32_t *llr,
uint32_t *z,
static void nr_pdcch_demapping_deinterleaving(uint32_t *llr,
uint32_t *e_rx,
uint8_t coreset_time_dur,
uint8_t start_symbol,
uint32_t coreset_nbr_rb,
@@ -187,10 +187,10 @@ void nr_pdcch_demapping_deinterleaving(uint32_t *llr,
index_z = data_sc * rb_count;
index_llr = (uint16_t) (f*B_rb + rb + symbol_idx * coreset_nbr_rb) * data_sc;
for (int i = 0; i < data_sc; i++) {
z[index_z + i] = llr[index_llr + i];
e_rx[index_z + i] = llr[index_llr + i];
#ifdef NR_PDCCH_DCI_DEBUG
LOG_I(PHY,"[candidate=%d,symbol_idx=%d,cce=%d,REG bundle=%d,PRB=%d] z[%d]=(%d,%d) <-> \t llr[%d]=(%d,%d) \n",
c_id,symbol_idx,cce_count,k,f*B_rb + rb,(index_z + i),*(int16_t *) &z[index_z + i],*(1 + (int16_t *) &z[index_z + i]),
c_id,symbol_idx,cce_count,k,f*B_rb + rb,(index_z + i),*(int16_t *) &e_rx[index_z + i],*(1 + (int16_t *) &e_rx[index_z + i]),
(index_llr + i),*(int16_t *) &llr[index_llr + i], *(1 + (int16_t *) &llr[index_llr + i]));
#endif
}
@@ -798,7 +798,7 @@ int32_t nr_rx_pdcch(PHY_VARS_NR_UE *ue,
void nr_pdcch_unscrambling(int16_t *z,
void nr_pdcch_unscrambling(int16_t *e_rx,
uint16_t scrambling_RNTI,
uint32_t length,
uint16_t pdcch_DMRS_scrambling_id,
@@ -821,8 +821,10 @@ void nr_pdcch_unscrambling(int16_t *z,
reset = 0;
}
if (((s >> (i % 32)) & 1) == 1) z2[i] = -z[i];
else z2[i]=z[i];
if (((s >> (i % 32)) & 1) == 1)
z2[i] = -e_rx[i];
else
z2[i]=e_rx[i];
}
}
@@ -875,6 +877,7 @@ uint8_t nr_dci_decoding_procedure(PHY_VARS_NR_UE *ue,
int L = rel15->L[j];
// Loop over possible DCI lengths
for (int k = 0; k < rel15->num_dci_options; k++) {
// skip this candidate if we've already found one with the
// same rnti and format at a different aggregation level
@@ -893,10 +896,11 @@ uint8_t nr_dci_decoding_procedure(PHY_VARS_NR_UE *ue,
LOG_D(PHY, "(%i.%i) Trying DCI candidate %d of %d number of candidates, CCE %d (%d), L %d, length %d, format %s\n",
proc->frame_rx, proc->nr_slot_rx, j, rel15->number_of_candidates, CCEind, e_rx_cand_idx, L, dci_length, nr_dci_format_string[rel15->dci_format_options[k]]);
nr_pdcch_unscrambling(&pdcch_e_rx[e_rx_cand_idx], rel15->coreset.scrambling_rnti, L*108, rel15->coreset.pdcch_dmrs_scrambling_id, tmp_e);
#ifdef DEBUG_DCI_DECODING
uint32_t *z = (uint32_t *) &pdcch_vars->e_rx[e_rx_cand_idx];
uint32_t *z = (uint32_t *) &e_rx[e_rx_cand_idx];
for (int index_z = 0; index_z < L*6; index_z++){
for (int i=0; i<9; i++) {
LOG_I(PHY,"z[%d]=(%d,%d) \n", (9*index_z + i), *(int16_t *) &z[9*index_z + i],*(1 + (int16_t *) &z[9*index_z + i]));
@@ -909,8 +913,8 @@ uint8_t nr_dci_decoding_procedure(PHY_VARS_NR_UE *ue,
NR_POLAR_DCI_MESSAGE_TYPE, dci_length, L);
n_rnti = rel15->rnti;
LOG_D(PHY, "(%i.%i) dci indication (rnti %x,dci format %s,n_CCE %d,payloadSize %d)\n",
proc->frame_rx, proc->nr_slot_rx,n_rnti,nr_dci_format_string[rel15->dci_format_options[k]],CCEind,dci_length);
LOG_D(PHY, "(%i.%i) dci indication (rnti %x,dci format %s,n_CCE %d,payloadSize %d,payload %llx )\n",
proc->frame_rx, proc->nr_slot_rx,n_rnti,nr_dci_format_string[rel15->dci_format_options[k]],CCEind,dci_length, *(unsigned long long*)dci_estimation);
if (crc == n_rnti) {
LOG_D(PHY, "(%i.%i) Received dci indication (rnti %x,dci format %s,n_CCE %d,payloadSize %d,payload %llx)\n",
proc->frame_rx, proc->nr_slot_rx,n_rnti,nr_dci_format_string[rel15->dci_format_options[k]],CCEind,dci_length,*(unsigned long long*)dci_estimation);
@@ -168,6 +168,7 @@ NR_UE_DLSCH_t *new_nr_ue_dlsch(uint8_t Kmimo,uint8_t Mdlharq,uint32_t Nsoft,uint
memset(dlsch->harq_processes[i]->d[r],0,5*8448);
else
exit_flag=2;
}
} else {
exit_flag=1;
@@ -221,7 +222,7 @@ bool nr_ue_postDecode(PHY_VARS_NR_UE *phy_vars_ue, notifiedFIFO_elt_t *req, bool
//LOG_D(PHY,"[UE %d] DLSCH: Setting ACK for nr_slot_rx %d TBS %d mcs %d nb_rb %d harq_process->round %d\n",
// phy_vars_ue->Mod_id,nr_slot_rx,harq_process->TBS,harq_process->mcs,harq_process->nb_rb, harq_process->round);
harq_process->status = SCH_IDLE;
harq_process->round = 0;
harq_process->DLround = 0;
harq_process->ack = 1;
//LOG_D(PHY,"[UE %d] DLSCH: Setting ACK for SFN/SF %d/%d (pid %d, status %d, round %d, TBS %d, mcs %d)\n",
@@ -236,9 +237,9 @@ bool nr_ue_postDecode(PHY_VARS_NR_UE *phy_vars_ue, notifiedFIFO_elt_t *req, bool
//LOG_D(PHY,"[UE %d] DLSCH: Setting NAK for SFN/SF %d/%d (pid %d, status %d, round %d, TBS %d, mcs %d) Kr %d r %d harq_process->round %d\n",
// phy_vars_ue->Mod_id, frame, nr_slot_rx, harq_pid,harq_process->status, harq_process->round,harq_process->TBS,harq_process->mcs,Kr,r,harq_process->round);
harq_process->ack = 0;
if (harq_process->round >= dlsch->Mlimit) {
if (harq_process->DLround >= dlsch->Mlimit) {
harq_process->status = SCH_IDLE;
harq_process->round = 0;
harq_process->DLround = 0;
phy_vars_ue->dl_stats[4]++;
}
@@ -295,14 +296,14 @@ void nr_processDLSegment(void* arg) {
K_bits_F = Kr-harq_process->F;
t_nrLDPC_time_stats procTime = {0};
t_nrLDPC_time_stats* p_procTime = &procTime ;
int16_t w[5*8448];
memset(w,0,(5*8448)*sizeof(short));
start_meas(&rdata->ts_deinterleave);
//VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_DLSCH_DEINTERLEAVING, VCD_FUNCTION_IN);
int16_t w[E];
memset(w, 0, sizeof(w));
nr_deinterleaving_ldpc(E,
Qm,
w, // [hna] w is e
@@ -389,12 +390,12 @@ void nr_processDLSegment(void* arg) {
no_iteration_ldpc = nrLDPC_decoder(p_decoderParms,
(int8_t *)&pl[0],
llrProcBuf,
p_procTime);
&procTime);
//VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_DLSCH_LDPC, VCD_FUNCTION_OUT);
// Fixme: correct type is unsigned, but nrLDPC_decoder and all called behind use signed int
if (check_crc((uint8_t *)llrProcBuf,length_dec,harq_process->F,crc_type)) {
LOG_D(PHY,"Segment %u CRC OK\n\033[0m",r);
LOG_D(PHY,"Segment %u CRC OK\n",r);
if (r==0) {
for (int i=0; i<10; i++) LOG_D(PHY,"byte %d : %x\n",i,((uint8_t *)llrProcBuf)[i]);
@@ -404,7 +405,7 @@ void nr_processDLSegment(void* arg) {
no_iteration_ldpc = dlsch->max_ldpc_iterations;
rdata->decodeIterations = no_iteration_ldpc;
} else {
LOG_D(PHY,"CRC NOT OK\n\033[0m");
LOG_D(PHY,"CRC NOT OK\n");
}
nb_total_decod++;
@@ -447,8 +448,8 @@ uint32_t nr_dlsch_decoding(PHY_VARS_NR_UE *phy_vars_ue,
}
// HARQ stats
phy_vars_ue->dl_stats[harq_process->round]++;
LOG_D(PHY,"Round %d RV idx %d\n",harq_process->round,harq_process->rvidx);
phy_vars_ue->dl_stats[harq_process->DLround]++;
LOG_D(PHY,"Round %d RV idx %d\n",harq_process->DLround,harq_process->rvidx);
uint8_t kc;
uint32_t Tbslbrm;// = 950984;
uint16_t nb_rb;// = 30;
@@ -501,7 +502,7 @@ uint32_t nr_dlsch_decoding(PHY_VARS_NR_UE *phy_vars_ue,
}
*/
nb_rb = harq_process->nb_rb;
harq_process->trials[harq_process->round]++;
harq_process->trials[harq_process->DLround]++;
uint16_t nb_rb_oh = 0; // it was not computed at UE side even before and set to 0 in nr_compute_tbs
harq_process->TBS = nr_compute_tbs(harq_process->Qm,harq_process->R,nb_rb,nb_symb_sch,nb_re_dmrs*dmrs_length, nb_rb_oh, 0, harq_process->Nl);
A = harq_process->TBS;
@@ -117,7 +117,6 @@ static int nr_dlsch_llr(NR_UE_PDSCH **pdsch_vars,
unsigned char first_symbol_flag,
unsigned char symbol,
unsigned short nb_rb,
unsigned short round,
int32_t codeword_TB0,
int32_t codeword_TB1,
uint32_t len,
@@ -154,7 +153,6 @@ int nr_rx_pdsch(PHY_VARS_NR_UE *ue,
unsigned char aatx=0,aarx=0;
unsigned short round;
int avgs = 0;// rb;
NR_DL_UE_HARQ_t *dlsch0_harq, *dlsch1_harq = NULL;
@@ -278,8 +276,7 @@ int nr_rx_pdsch(PHY_VARS_NR_UE *ue,
nb_rb_pdsch = dlsch0_harq->nb_rb;
DevAssert(dlsch0_harq);
round = dlsch0_harq->round;
//printf("round = %d\n", round);
if (gNB_id > 2) {
LOG_W(PHY, "In %s: Illegal gNB_id %d\n", __FUNCTION__, gNB_id);
@@ -522,7 +519,7 @@ int nr_rx_pdsch(PHY_VARS_NR_UE *ue,
rx_type, harq_pid,
gNB_id, gNB_id_i,
first_symbol_flag,
i, nb_rb_pdsch, round,
i, nb_rb_pdsch,
codeword_TB0, codeword_TB1,
pdsch_vars[gNB_id]->dl_valid_re[i-1],
nr_slot_rx, beamforming_mode);
@@ -2479,7 +2476,6 @@ static int nr_dlsch_llr(NR_UE_PDSCH **pdsch_vars,
unsigned char first_symbol_flag,
unsigned char symbol,
unsigned short nb_rb,
unsigned short round,
int32_t codeword_TB0,
int32_t codeword_TB1,
uint32_t len,
@@ -308,7 +308,7 @@ int nr_initial_sync(UE_nr_rxtx_proc_t *proc,
#endif
int freq_offset_sss = 0;
rx_sss_nr(ue, proc, &metric_tdd_ncp, &phase_tdd_ncp, &freq_offset_sss);
ret = rx_sss_nr(ue, proc, &metric_tdd_ncp, &phase_tdd_ncp, &freq_offset_sss);
accumulated_freq_offset += freq_offset_sss;
@@ -336,8 +336,10 @@ int nr_initial_sync(UE_nr_rxtx_proc_t *proc,
}
}
nr_gold_pbch(ue);
ret = nr_pbch_detection(proc, ue, 1, &phy_pdcch_config); // start pbch detection at first symbol after pss
if (ret==0) { //we got sss channel
nr_gold_pbch(ue);
ret = nr_pbch_detection(proc, ue, 1, &phy_pdcch_config); // start pbch detection at first symbol after pss
}
if (ret == 0) {
// sync at symbol ue->symbol_offset
@@ -1456,16 +1456,6 @@ uint64_t cqi2hex(uint32_t cqi);
uint16_t computeRIV(uint16_t N_RB_DL,uint16_t RBstart,uint16_t Lcrbs);
/** \brief This routine extracts a single subband PMI from a bitmap coming from UCI or the pmi_extend function
@param N_RB_DL number of resource blocks
@param mimo_mode
@param pmi_alloc subband PMI bitmap
@param rb resource block for which to extract PMI
@returns subband PMI
*/
uint8_t get_pmi(uint8_t N_RB_DL,MIMO_mode_t mode, uint32_t pmi_alloc,uint16_t rb);
int get_nCCE_offset_l1(int *CCE_table,
const unsigned char L,
const int nCCE,
@@ -1567,7 +1557,7 @@ uint8_t get_num_prach_tdd(module_id_t Mod_id);
@param frame_type 0-FDD, 1-TDD
@returns 0-1 accordingly
*/
uint8_t get_prach_fmt(uint8_t prach_ConfigIndex,lte_frame_type_t frame_type);
uint8_t get_prach_fmt(uint8_t prach_ConfigIndex,frame_type_t frame_type);
/*!
\brief Helper for MAC, returns frequency index of PRACH resource in TDD for a particular configuration index
@@ -1589,7 +1579,7 @@ void compute_prach_seq(uint16_t rootSequenceIndex,
uint8_t prach_ConfigIndex,
uint8_t zeroCorrelationZoneConfig,
uint8_t highSpeedFlag,
lte_frame_type_t frame_type,
frame_type_t frame_type,
uint32_t X_u[64][839]);
@@ -181,9 +181,10 @@ typedef struct {
/// Pointers to transport block segments
uint8_t **c;
/// soft bits for each received segment ("d"-sequence)(for definition see 36-212 V8.6 2009-03, p.15)
/// Accumulates the soft bits for each round to increase decoding success (HARQ)
int16_t **d;
/// Index of current HARQ round for this DLSCH
uint8_t round;
uint8_t DLround;
/// MCS table for this DLSCH
uint8_t mcs_table;
/// MCS format for this DLSCH
+26 -49
View File
@@ -381,7 +381,6 @@ void init_context_pss_nr(NR_DL_FRAME_PARMS *frame_parms_ue)
int sizePss = LENGTH_PSS_NR * IQ_SIZE; /* complex value i & q signed 16 bits */
int size = ofdm_symbol_size * IQ_SIZE; /* i and q samples signed 16 bits */
int16_t *p = NULL;
int64_t *q = NULL;
AssertFatal(ofdm_symbol_size > 127, "illegal ofdm_symbol_size %d\n",ofdm_symbol_size);
for (int i = 0; i < NUMBER_PSS_SEQUENCE; i++) {
@@ -410,17 +409,6 @@ void init_context_pss_nr(NR_DL_FRAME_PARMS *frame_parms_ue)
assert(0);
}
size = sizeof(int64_t)*(frame_parms_ue->samples_per_frame + (2*ofdm_symbol_size));
q = (int64_t*)malloc16(size);
if (q != NULL) {
pss_corr_ue[i] = q;
bzero( pss_corr_ue[i], size);
}
else {
LOG_E(PHY,"Fatal memory allocation problem \n");
assert(0);
}
generate_pss_nr(frame_parms_ue,i);
}
}
@@ -443,7 +431,6 @@ void free_context_pss_nr(void)
free_and_zero(primary_synchro_nr[i]);
free_and_zero(primary_synchro_nr2[i]);
free_and_zero(primary_synchro_time_nr[i]);
free_and_zero(pss_corr_ue[i]);
}
}
@@ -801,7 +788,6 @@ static inline double angle64(int64_t x)
*********************************************************************/
#define DOT_PRODUCT_SCALING_SHIFT (17)
int pss_search_time_nr(int **rxdata, ///rx data in time domain
NR_DL_FRAME_PARMS *frame_parms,
int fo_flag,
@@ -812,7 +798,7 @@ int pss_search_time_nr(int **rxdata, ///rx data in time domain
unsigned int n, ar, peak_position, pss_source;
int64_t peak_value;
int64_t result;
int64_t avg[NUMBER_PSS_SEQUENCE];
int64_t avg[NUMBER_PSS_SEQUENCE]={0};
double ffo_est=0;
// performing the correlation on a frame length plus one symbol for the first of the two frame
@@ -823,9 +809,8 @@ int pss_search_time_nr(int **rxdata, ///rx data in time domain
else
length = frame_parms->samples_per_frame;
AssertFatal(length>0,"illegal length %d\n",length);
for (int i = 0; i < NUMBER_PSS_SEQUENCE; i++) AssertFatal(pss_corr_ue[i] != NULL,"pss_corr_ue[%d] not yet allocated! Exiting.\n", i);
AssertFatal(length>0,"illegal length %d\n",length);
peak_value = 0;
peak_position = 0;
pss_source = 0;
@@ -846,47 +831,41 @@ int pss_search_time_nr(int **rxdata, ///rx data in time domain
/* Correlation computation is based on a a dot product which is realized thank to SIMS extensions */
for (int pss_index = 0; pss_index < NUMBER_PSS_SEQUENCE; pss_index++) {
avg[pss_index]=0;
memset(pss_corr_ue[pss_index],0,length*sizeof(int64_t));
}
for (n=0; n < length; n+=4) { //
for (n=0; n < length; n+=4) { //
for (int pss_index = 0; pss_index < NUMBER_PSS_SEQUENCE; pss_index++) {
int64_t pss_corr_ue=0;
/* calculate dot product of primary_synchro_time_nr and rxdata[ar][n]
* (ar=0..nb_ant_rx) and store the sum in temp[n]; */
for (ar=0; ar<frame_parms->nb_antennas_rx; ar++) {
if ( n < (length - frame_parms->ofdm_symbol_size)) {
/* perform correlation of rx data and pss sequence ie it is a dot product */
result = dot_product64((short*)primary_synchro_time_nr[pss_index],
(short*)&(rxdata[ar][n+is*frame_parms->samples_per_frame]),
frame_parms->ofdm_symbol_size,
shift);
pss_corr_ue += abs64(result);
//((short*)pss_corr_ue[pss_index])[2*n] += ((short*) &result)[0]; /* real part */
//((short*)pss_corr_ue[pss_index])[2*n+1] += ((short*) &result)[1]; /* imaginary part */
//((short*)&synchro_out)[0] += ((int*) &result)[0]; /* real part */
//((short*)&synchro_out)[1] += ((int*) &result)[1]; /* imaginary part */
/* calculate dot product of primary_synchro_time_nr and rxdata[ar][n] (ar=0..nb_ant_rx) and store the sum in temp[n]; */
for (ar=0; ar<frame_parms->nb_antennas_rx; ar++) {
/* perform correlation of rx data and pss sequence ie it is a dot product */
result = dot_product64((short*)primary_synchro_time_nr[pss_index],
(short*)&(rxdata[ar][n+is*frame_parms->samples_per_frame]),
frame_parms->ofdm_symbol_size,
shift);
pss_corr_ue[pss_index][n] += abs64(result);
//((short*)pss_corr_ue[pss_index])[2*n] += ((short*) &result)[0]; /* real part */
//((short*)pss_corr_ue[pss_index])[2*n+1] += ((short*) &result)[1]; /* imaginary part */
//((short*)&synchro_out)[0] += ((int*) &result)[0]; /* real part */
//((short*)&synchro_out)[1] += ((int*) &result)[1]; /* imaginary part */
}
}
/* calculate the absolute value of sync_corr[n] */
avg[pss_index]+=pss_corr_ue[pss_index][n];
if (pss_corr_ue[pss_index][n] > peak_value) {
peak_value = pss_corr_ue[pss_index][n];
avg[pss_index]+=pss_corr_ue;
if (pss_corr_ue > peak_value) {
peak_value = pss_corr_ue;
peak_position = n;
pss_source = pss_index;
#ifdef DEBUG_PSS_NR
printf("pss_index %d: n %6u peak_value %15llu\n", pss_index, n, (unsigned long long)pss_corr_ue[pss_index][n]);
printf("pss_index %d: n %6u peak_value %15llu\n", pss_index, n, (unsigned long long)pss_corr_ue[n]);
#endif
}
}
}
if (fo_flag){
// fractional frequency offset computation according to Cross-correlation Synchronization Algorithm Using PSS
@@ -922,7 +901,8 @@ int pss_search_time_nr(int **rxdata, ///rx data in time domain
// computing absolute value of frequency offset
*f_off = ffo_est*frame_parms->subcarrier_spacing;
for (int pss_index = 0; pss_index < NUMBER_PSS_SEQUENCE; pss_index++) avg[pss_index]/=(length/4);
for (int pss_index = 0; pss_index < NUMBER_PSS_SEQUENCE; pss_index++)
avg[pss_index]/=(length/4);
*eNB_id = pss_source;
@@ -937,9 +917,6 @@ int pss_search_time_nr(int **rxdata, ///rx data in time domain
static int debug_cnt = 0;
if (debug_cnt == 0) {
LOG_M("pss_corr_ue0.m","pss_corr_ue0",pss_corr_ue[0],length,1,6);
LOG_M("pss_corr_ue1.m","pss_corr_ue1",pss_corr_ue[1],length,1,6);
LOG_M("pss_corr_ue2.m","pss_corr_ue2",pss_corr_ue[2],length,1,6);
if (is)
LOG_M("rxdata1.m","rxd0",rxdata[frame_parms->samples_per_frame],length,1,1);
else
+4
View File
@@ -563,6 +563,10 @@ int rx_sss_nr(PHY_VARS_NR_UE *ue, UE_nr_rxtx_proc_t *proc, int32_t *tot_metric,
int re = 0;
int im = 0;
if (Nid1 == N_ID_1_NUMBER) {
LOG_I(PHY,"Failled to detect SSS after PSS\n");
return -1;
}
d = (int16_t *)&d_sss[Nid2][Nid1];
for(i = 0; i<LENGTH_SSS_NR; i++) {
re += d[i]*sss[2*i];
+1 -1
View File
@@ -29,7 +29,7 @@
#include "costable.h"
#include "defs.h"
unsigned int angle(struct complex16 perror)
unsigned int angle(c16_t perror)
{
int a;
+1 -1
View File
@@ -129,7 +129,7 @@ main ()
short output[256] __attribute__((aligned(16)));
int i;
struct complex16 alpha;
c16_t alpha;
Zero_Buffer(output,256*2);
+1 -1
View File
@@ -278,7 +278,7 @@ main ()
short output[256] __attribute__((aligned(16)));
int i;
struct complex16 alpha;
c16_t alpha;
Zero_Buffer(output,256*2);
+5 -5
View File
@@ -305,15 +305,15 @@ int main(int argc, char **argv) {
openair0_device_load(&rfdevice,&openair0_cfg);
void ** samplesRx = (void **)malloc16(antennas* sizeof(struct complex16 *) );
void ** samplesTx = (void **)malloc16(antennas* sizeof(struct complex16 *) );
void ** samplesRx = (void **)malloc16(antennas* sizeof(c16_t *) );
void ** samplesTx = (void **)malloc16(antennas* sizeof(c16_t *) );
int fd=open(getenv("rftestInputFile"),O_RDONLY);
AssertFatal(fd>=0,"%s",strerror(errno));
for (int i=0; i<antennas; i++) {
samplesRx[i] = (int32_t *)malloc16_clear( DFT*sizeof(struct complex16) );
samplesTx[i] = (int32_t *)malloc16_clear( DFT*sizeof(struct complex16) );
samplesRx[i] = (int32_t *)malloc16_clear( DFT*sizeof(c16_t) );
samplesTx[i] = (int32_t *)malloc16_clear( DFT*sizeof(c16_t) );
}
CalibrationInitScope(samplesRx, &rfdevice);
@@ -322,7 +322,7 @@ int main(int argc, char **argv) {
while(!oai_exit) {
for (int i=0; i<antennas; i++)
read(fd, samplesTx[i], DFT*sizeof(struct complex16));
read(fd, samplesTx[i], DFT*sizeof(c16_t));
int readBlockSize = rfdevice.trx_read_func(&rfdevice,
&timestamp,
samplesRx,
-35
View File
@@ -1,35 +0,0 @@
/*
* 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.1 (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
*/
/*
* dB_routines.h
*
* Created on: Nov 12, 2013
* Author: winckel
*/
#ifndef DB_ROUTINES_H_
#define DB_ROUTINES_H_
int16_t dB_fixed_times10(uint32_t x);
int16_t dB_fixed_x10(uint32_t x);
#endif /* DB_ROUTINES_H_ */
+1 -1
View File
@@ -37,7 +37,7 @@
const FL_COLOR rx_antenna_colors[4] = {FL_RED,FL_BLUE,FL_GREEN,FL_YELLOW};
const FL_COLOR water_colors[4] = {FL_BLUE,FL_GREEN,FL_YELLOW,FL_RED};
typedef struct complex16 scopeSample_t;
typedef c16_t scopeSample_t;
#define SquaredNorm(VaR) ((VaR).r*(VaR).r+(VaR).i*(VaR).i)
typedef struct {
+15 -8
View File
@@ -39,26 +39,33 @@ extern "C" {
#define CEILIDIV(a,b) ((a+b-1)/b)
#define ROUNDIDIV(a,b) (((a<<1)+b)/(b<<1))
struct complexd {
typedef struct complexd {
double r;
double i;
};
} cd_t;
struct complexf {
typedef struct complexf {
float r;
float i;
};
} cf_t;
struct complex16 {
typedef struct complex16 {
int16_t r;
int16_t i;
};
} c16_t;
struct complex32 {
typedef struct complex32 {
int32_t r;
int32_t i;
};
} c32_t;
typedef struct complex64 {
int64_t r;
int64_t i;
} c64_t;
#define squaredMod(a) ((a).r*(a).r+(a).i*(a).i)
#define csum(res, i1, i2) (res).r=(i1).r+(i2).r ; (res).i=(i1).i+(i2).i
//cmult_sv.h
/*!\fn void multadd_real_vector_complex_scalar(int16_t *x,int16_t *alpha,int16_t *y,uint32_t N)
-1
View File
@@ -54,7 +54,6 @@ typedef enum {
no_L2_connect=5,
calib_prach_tx=6,
rx_dump_frame=7,
loop_through_memory=8
} runmode_t;
/*! \brief Extension Type */
-1
View File
@@ -833,7 +833,6 @@ typedef struct {
pthread_mutex_t timer_mutex;
pthread_cond_t timer_cond;
int instance_cnt_timer;
/// RF and Interface devices per CC
openair0_device rfdevice;
+2 -2
View File
@@ -99,7 +99,7 @@
#define NB_RX_ANTENNAS_MAX 64
typedef enum {TDD=1,FDD=0} lte_frame_type_t;
typedef enum {TDD=1,FDD=0} frame_type_t;
typedef enum {EXTENDED=1,NORMAL=0} lte_prefix_type_t;
@@ -597,7 +597,7 @@ typedef struct LTE_DL_FRAME_PARMS {
/// shift of pilot position in one RB
uint8_t nushift;
/// Frame type (0 FDD, 1 TDD)
lte_frame_type_t frame_type;
frame_type_t frame_type;
/// TDD subframe assignment (0-7) (default = 3) (254=RX only, 255=TX only)
uint8_t tdd_config;
/// TDD S-subframe configuration (0-9)
-5
View File
@@ -587,9 +587,6 @@ typedef struct gNB_L1_proc_t_s {
int instance_cnt_te;
/// \internal This variable is protected by \ref mutex_prach.
int instance_cnt_prach;
// instance count for over-the-air gNB synchronization
int instance_cnt_synch;
/// \internal This variable is protected by \ref mutex_asynch_rxtx.
int instance_cnt_asynch_rxtx;
/// pthread structure for eNB single processing thread
@@ -661,8 +658,6 @@ typedef struct {
unsigned int n0_power_tot;
//! estimated avg noise power (dB)
unsigned int n0_power_tot_dB;
//! estimated avg noise power (dB)
int n0_power_tot_dBm;
//! estimated avg noise power per RB per RX ant (lin)
unsigned int n0_subband_power[MAX_NUM_RU_PER_gNB][275];
//! estimated avg noise power per RB per RX ant (dB)
+2 -1
View File
@@ -67,6 +67,7 @@
/*used for the resource mapping*/
#define NR_MAX_PDCCH_DMRS_LENGTH 576 // 16(L)*2(QPSK)*3(3 DMRS symbs per REG)*6(REG per CCE)
#define NR_MAX_PDCCH_SIZE 8192 // It seems it is the max polar coded block size
#define NR_MAX_DCI_PAYLOAD_SIZE 64
#define NR_MAX_DCI_SIZE 1728 //16(L)*2(QPSK)*9(12 RE per REG - 3(DMRS))*6(REG per CCE)
@@ -280,7 +281,7 @@ struct NR_DL_FRAME_PARMS {
uint32_t att_rx;
/// total Number of Resource Block Groups: this is ceil(N_PRB/P)
/// Frame type (0 FDD, 1 TDD)
lte_frame_type_t frame_type;
frame_type_t frame_type;
uint8_t tdd_config;
/// Cell ID
uint16_t Nid_cell;
+1 -1
View File
@@ -994,7 +994,7 @@ int is_srs_occasion_common(LTE_DL_FRAME_PARMS *frame_parms,int frame_tx,int subf
return(isSubframeSRS);
}
void compute_srs_pos(lte_frame_type_t frameType,uint16_t isrs,uint16_t *psrsPeriodicity,uint16_t *psrsOffset)
void compute_srs_pos(frame_type_t frameType,uint16_t isrs,uint16_t *psrsPeriodicity,uint16_t *psrsOffset)
{
if(TDD == frameType)
{
+1 -1
View File
@@ -339,7 +339,7 @@ void dump_dlsch2(PHY_VARS_UE *phy_vars_ue,uint8_t eNB_id,uint8_t subframe, unsig
int is_srs_occasion_common(LTE_DL_FRAME_PARMS *frame_parms,int frame_tx,int subframe_tx);
void compute_srs_pos(lte_frame_type_t frameType,uint16_t isrs,uint16_t *psrsPeriodicity,uint16_t *psrsOffset);
void compute_srs_pos(frame_type_t frameType,uint16_t isrs,uint16_t *psrsPeriodicity,uint16_t *psrsOffset);
/* from here: prototype added to remove compilation warnings, doc to be written by the author of the function */
+1
View File
@@ -20,6 +20,7 @@
*/
#include <stdint.h>
#include <openair1/SCHED/sched_common_extern.h>
// This is the formula from Section 5.1.1.1 in 36.213 100*10*log10((2^(MPR*Ks)-1)), where MPR is in the range [0,6] and Ks=1.25
+1 -1
View File
@@ -215,7 +215,7 @@ int16_t get_target_pucch_rx_power(module_id_t module_idP, uint8_t CC_id);
int is_srs_occasion_common(LTE_DL_FRAME_PARMS *frame_parms,int frame_tx,int subframe_tx);
void compute_srs_pos(lte_frame_type_t frameType,uint16_t isrs,uint16_t *psrsPeriodicity,uint16_t *psrsOffset);
void compute_srs_pos(frame_type_t frameType,uint16_t isrs,uint16_t *psrsPeriodicity,uint16_t *psrsOffset);
void release_rnti_of_phy(module_id_t mod_id);
/*@}*/
+30 -52
View File
@@ -307,7 +307,7 @@ void init_downlink_harq_status(NR_DL_UE_HARQ_t *dl_harq)
{
dl_harq->status = SCH_IDLE;
dl_harq->first_rx = 1;
dl_harq->round = 0;
dl_harq->DLround = 0;
dl_harq->DCINdi = 1;
dl_harq->ack = DL_ACKNACK_NO_SET;
}
@@ -334,60 +334,38 @@ void downlink_harq_process(NR_DL_UE_HARQ_t *dl_harq, int harq_pid, int ndi, int
if (rnti_type == _SI_RNTI_ ||
rnti_type == _P_RNTI_ ||
rnti_type == _RA_RNTI_) {
dl_harq->round = 0;
dl_harq->DLround = 0;
dl_harq->status = ACTIVE;
dl_harq->first_rx = 1;
}
else{
switch(rv){
case 0:
dl_harq->round = 0;
dl_harq->status = ACTIVE;
dl_harq->first_rx = 1;
if (dl_harq->DCINdi == ndi)
LOG_E(PHY,"Warning! rv %d indicates new transmission but new ndi %d is the same as old ndi %d\n",rv,ndi,dl_harq->DCINdi);
dl_harq->DCINdi = ndi;
break;
case 1:
dl_harq->round = 3;
dl_harq->status = ACTIVE;
dl_harq->first_rx = 0;
if (dl_harq->DCINdi != ndi) {
LOG_E(PHY,"Missed previous DCI detections. NDI toggled but rv %d does not correspond to first reception\n",rv);
dl_harq->first_rx = 1;
dl_harq->DCINdi = ndi;
}
else if (dl_harq->ack == 1)
dl_harq->status = SCH_IDLE;
break;
case 2:
dl_harq->round = 1;
dl_harq->status = ACTIVE;
dl_harq->first_rx = 0;
if (dl_harq->DCINdi != ndi) {
LOG_E(PHY,"Missed previous DCI detections. NDI toggled but rv %d does not correspond to first reception\n",rv);
dl_harq->first_rx = 1;
dl_harq->DCINdi = ndi;
}
else if (dl_harq->ack == 1)
dl_harq->status = SCH_IDLE;
break;
case 3:
dl_harq->round = 2;
dl_harq->status = ACTIVE;
dl_harq->first_rx = 0;
if (dl_harq->DCINdi != ndi) {
LOG_E(PHY,"Missed previous DCI detections. NDI toggled but rv %d does not correspond to first reception\n",rv);
dl_harq->first_rx = 1;
dl_harq->DCINdi = ndi;
}
else if (dl_harq->ack == 1)
dl_harq->status = SCH_IDLE;
break;
default:
AssertFatal(1==0,"Invalid value for rv %d\n",rv);
} else {
LOG_D(PHY,"receive harq process: %p harqPid=%d, rv=%d, ndi=%d, rntiType=%d new transmission= %s\n",
dl_harq, harq_pid, rv, ndi, rnti_type, dl_harq->DCINdi != ndi ? "yes":"no");
AssertFatal(rv<4 && rv>=0, "invalid redondancy version %d\n", rv);
if (ndi!=dl_harq->DCINdi) {
if (dl_harq->ack == DL_NACK)
LOG_D(PHY,"New transmission on a harq pid (%d) never acknowledged\n", harq_pid);
else
LOG_D(PHY,"Starting new transmission on a harq pid (%d)\n", harq_pid);
} else {
if (dl_harq->ack != DL_NACK)
LOG_D(PHY,"gNB asked for retransmission even if we sent ACK\n");
else
LOG_D(PHY,"Starting retransmission on a harq pid (%d), rv (%d)\n", harq_pid, rv);
}
}
if (ndi!=dl_harq->DCINdi) {
dl_harq->first_rx = true;
dl_harq->DLround = 0;
} else {
dl_harq->first_rx = false;
dl_harq->DLround++;
}
dl_harq->status = ACTIVE;
dl_harq->DCINdi = ndi;
//dl_harq->status = SCH_IDLE;
}
}
+1 -1
View File
@@ -505,7 +505,7 @@ int nr_ue_pdcch_procedures(uint8_t gNB_id,
start_meas(&ue->dlsch_rx_pdcch_stats);
/// PDCCH/DCI e-sequence (input to rate matching).
int32_t pdcch_e_rx_size = 2*4*100*12;
int32_t pdcch_e_rx_size = NR_MAX_PDCCH_SIZE;
int16_t pdcch_e_rx[pdcch_e_rx_size];
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_RX_PDCCH, VCD_FUNCTION_IN);
+1 -107
View File
@@ -574,7 +574,7 @@ void get_cqipmiri_params(PHY_VARS_UE *ue,
}
}
PUCCH_FMT_t get_pucch_format(lte_frame_type_t frame_type,
PUCCH_FMT_t get_pucch_format(frame_type_t frame_type,
lte_prefix_type_t cyclic_prefix_type,
uint8_t SR_payload,
uint8_t nb_cw,
@@ -4870,109 +4870,3 @@ int phy_procedures_UE_RX(PHY_VARS_UE *ue,
LOG_D(PHY," ****** end RX-Chain for AbsSubframe %d.%d ****** \n", frame_rx%1024, subframe_rx);
return (0);
}
void phy_procedures_UE_lte(PHY_VARS_UE *ue,
UE_rxtx_proc_t *proc,
uint8_t eNB_id,
uint8_t abstraction_flag,
uint8_t do_pdcch_flag,
runmode_t mode) {
MessageDef *msg_p;
int result;
int frame_rx = proc->frame_rx;
int frame_tx = proc->frame_tx;
int subframe_rx = proc->subframe_rx;
int subframe_tx = proc->subframe_tx;
UE_L2_STATE_t ret;
int slot;
if (ue->mac_enabled == 0) {
ue->UE_mode[eNB_id]=PUSCH;
}
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_UE_LTE,1);
if ( LOG_DEBUGFLAG(UE_TIMING)) {
start_meas(&ue->phy_proc[ue->current_thread_id[subframe_rx]]);
}
do {
// Checks if a message has been sent to PHY sub-task
itti_poll_msg (TASK_PHY_UE, &msg_p);
if (msg_p != NULL) {
switch (ITTI_MSG_ID(msg_p)) {
case PHY_FIND_CELL_REQ:
LOG_I(PHY, "[UE ] Received %s\n", ITTI_MSG_NAME (msg_p));
/* TODO process the message */
break;
default:
LOG_E(PHY, "[UE %ld] Received unexpected message %s\n", ITTI_MSG_DESTINATION_INSTANCE (msg_p), ITTI_MSG_NAME (msg_p));
break;
}
result = itti_free (ITTI_MSG_ORIGIN_ID(msg_p), msg_p);
AssertFatal (result == EXIT_SUCCESS, "Failed to free memory (%d)!\n", result);
}
} while(msg_p != NULL);
for (slot=0; slot<2; slot++) {
if ((subframe_select(&ue->frame_parms,subframe_tx)==SF_UL)||
(ue->frame_parms.frame_type == FDD)) {
phy_procedures_UE_TX(ue,proc,eNB_id,abstraction_flag,mode);
}
if ((subframe_select(&ue->frame_parms,subframe_rx)==SF_DL) ||
(ue->frame_parms.frame_type == FDD)) {
phy_procedures_UE_RX(ue,proc,eNB_id,abstraction_flag,do_pdcch_flag,mode);
}
if ((subframe_select(&ue->frame_parms,subframe_tx)==SF_S) &&
(slot==1)) {
phy_procedures_UE_S_TX(ue,eNB_id,abstraction_flag);
}
if ((subframe_select(&ue->frame_parms,subframe_rx)==SF_S) &&
(slot==0)) {
phy_procedures_UE_RX(ue,proc,eNB_id,abstraction_flag,do_pdcch_flag,mode);
}
if (ue->mac_enabled==1) {
if (slot==0) {
//LOG_I(PHY,"[UE %d] Frame %d, subframe %d, star ue_scheduler\n", ue->Mod_id,frame_rx,subframe_tx);
ret = ue_scheduler(ue->Mod_id,
frame_rx,
subframe_rx,
frame_tx,
subframe_tx,
subframe_select(&ue->frame_parms,subframe_tx),
eNB_id,
0/*FIXME CC_id*/);
if (ret == CONNECTION_LOST) {
LOG_E(PHY,"[UE %d] Frame %d, subframe %d RRC Connection lost, returning to PRACH\n",ue->Mod_id,
frame_rx,subframe_tx);
ue->UE_mode[eNB_id] = PRACH;
// mac_xface->macphy_exit("Connection lost");
} else if (ret == PHY_RESYNCH) {
LOG_E(PHY,"[UE %d] Frame %d, subframe %d RRC Connection lost, trying to resynch\n",
ue->Mod_id,
frame_rx,subframe_tx);
ue->UE_mode[eNB_id] = RESYNCH;
// mac_xface->macphy_exit("Connection lost");
} else if (ret == PHY_HO_PRACH) {
LOG_I(PHY,"[UE %d] Frame %d, subframe %d, return to PRACH and perform a contention-free access\n",
ue->Mod_id,frame_rx,subframe_tx);
ue->UE_mode[eNB_id] = PRACH;
}
}
}
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_UE_LTE,0);
if (LOG_DEBUGFLAG(UE_TIMING)) {
stop_meas(&ue->phy_proc[ue->current_thread_id[subframe_rx]]);
}
} // slot
}
+1 -1
View File
@@ -278,7 +278,7 @@ void dump_dlsch2(PHY_VARS_UE *phy_vars_ue,uint8_t eNB_id,uint8_t subframe, unsig
int is_srs_occasion_common(LTE_DL_FRAME_PARMS *frame_parms,int frame_tx,int subframe_tx);
void compute_srs_pos(lte_frame_type_t frameType,uint16_t isrs,uint16_t *psrsPeriodicity,uint16_t *psrsOffset);
void compute_srs_pos(frame_type_t frameType,uint16_t isrs,uint16_t *psrsPeriodicity,uint16_t *psrsOffset);
/*@}*/
+1 -1
View File
@@ -415,7 +415,7 @@ int main(int argc, char **argv) {
uint8_t harq_pid;
uint8_t phich_ACK;
uint8_t num_phich_interf = 0;
lte_frame_type_t frame_type=TDD;
frame_type_t frame_type=TDD;
// int re_offset;
// uint32_t *txptr;
int aarx;
+2 -7
View File
@@ -478,14 +478,11 @@ int main(int argc, char **argv)
harq_process->n_dmrs_cdm_groups = 1;
printf("harq process ue mcs = %d Qm = %d, symb %d\n", harq_process->mcs, harq_process->Qm, nb_symb_sch);
unsigned char *test_input;
test_input = (unsigned char *) malloc16(sizeof(unsigned char) * TBS / 8);
unsigned char *test_input=dlsch->harq_process.pdu;
//unsigned char test_input[TBS / 8] __attribute__ ((aligned(16)));
for (i = 0; i < TBS / 8; i++)
test_input[i] = (unsigned char) rand();
//estimated_output = harq_process->b;
#ifdef DEBUG_NR_DLSCHSIM
for (i = 0; i < TBS / 8; i++) printf("test_input[i]=%hhu \n",test_input[i]);
#endif
@@ -498,7 +495,7 @@ int main(int argc, char **argv)
unsigned char output[rel15->rbSize * NR_SYMBOLS_PER_SLOT * NR_NB_SC_PER_RB * 8 * NR_MAX_NB_LAYERS] __attribute__((aligned(32)));
bzero(output,rel15->rbSize * NR_SYMBOLS_PER_SLOT * NR_NB_SC_PER_RB * 8 * NR_MAX_NB_LAYERS);
if (input_fd == NULL) {
nr_dlsch_encoding(gNB, test_input, frame, slot, dlsch, frame_parms,output,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
nr_dlsch_encoding(gNB, frame, slot, &dlsch->harq_process, frame_parms,output,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
}
for (SNR = snr0; SNR < snr1; SNR += snr_step) {
@@ -618,8 +615,6 @@ int main(int argc, char **argv)
}
}*/
free(test_input);
free_channel_desc_scm(gNB2UE);
reset_DLSCH_struct(gNB, &msgDataTx);
+1 -1
View File
@@ -1089,7 +1089,7 @@ int main(int argc, char **argv)
UE_harq_process->ack = 0;
round = 0;
UE_harq_process->round = round;
UE_harq_process->DLround = round;
UE_harq_process->first_rx = 1;
while ((round<num_rounds) && (UE_harq_process->ack==0)) {
+1 -1
View File
@@ -551,7 +551,7 @@ int main(int argc, char **argv)
if (n_trials==1) printf("txlev %d (%f dB), offset %d, sigma2 %f ( %f dB)\n",txlev,10*log10(txlev),startingSymbolIndex*frame_parms->ofdm_symbol_size,sigma2,sigma2_dB);
struct complex16 **rxdataF = (struct complex16 **)gNB->common_vars.rxdataF;
c16_t **rxdataF = (struct complex16 **)gNB->common_vars.rxdataF;
for (int symb=0; symb<gNB->frame_parms.symbols_per_slot;symb++) {
if (symb<startingSymbolIndex || symb >= startingSymbolIndex+nrofSymbols) {
int i0 = symb*gNB->frame_parms.ofdm_symbol_size;
@@ -285,7 +285,7 @@ int main(int argc, char *argv[])
uint8_t nb_antennas_tx = 1;
uint8_t nb_antennas_rx = 1;
uint8_t frame_type = FDD;
uint8_t N_RB_DL=100;
int N_RB_DL=100;
lte_prefix_type_t extended_prefix_flag = NORMAL;
int Nid_cell[] = {(3*0+0)};
VOID_PARAMETER argc;
@@ -200,7 +200,7 @@ int main(int argc, char *argv[])
uint8_t nb_antennas_tx = 1;
uint8_t nb_antennas_rx = 1;
uint8_t frame_type = FDD;
uint8_t N_RB_DL=100;
int N_RB_DL=100;
lte_prefix_type_t extended_prefix_flag = NORMAL;
int Nid_cell[] = {(3*0+0)};
VOID_PARAMETER argc;
@@ -379,7 +379,7 @@ int main(int argc, char *argv[])
uint8_t nb_antennas_tx = 1;
uint8_t nb_antennas_rx = 1;
uint8_t frame_type = FDD;
uint8_t N_RB_DL=100;
int N_RB_DL=100;
lte_prefix_type_t extended_prefix_flag = NORMAL;
int decoded_pbch = -1;
int Nid1, Nid2;
@@ -184,7 +184,7 @@ int main(int argc, char *argv[])
uint8_t nb_antennas_rx = 1;
uint16_t Nid_cell=123;
uint8_t frame_type=FDD;
uint8_t N_RB_DL=100;
int N_RB_DL=100;
lte_prefix_type_t extended_prefix_flag=NORMAL;
const char *name_test = "PSS NR";
test_t test = { name_test, 0, 0, 0, 0};
@@ -206,7 +206,7 @@ void undefined_function(const char *function) {
*********************************************************************/
int init_test(unsigned char N_tx, unsigned char N_rx, unsigned char transmission_mode,
unsigned char extended_prefix_flag, uint8_t frame_type, uint16_t Nid_cell, uint8_t N_RB_DL) {
unsigned char extended_prefix_flag, uint8_t frame_type, uint16_t Nid_cell, int N_RB_DL) {
(void) transmission_mode;
NR_DL_FRAME_PARMS *frame_parms;
int log_level = OAILOG_TRACE;
@@ -90,7 +90,7 @@ int set_pss_in_rx_buffer(PHY_VARS_NR_UE *PHY_vars_UE, int position_symbol, int p
int init_test(unsigned char N_tx, unsigned char N_rx, unsigned char transmission_mode,
unsigned char extended_prefix_flag, uint8_t frame_type, uint16_t Nid_cell,
uint8_t N_RB_DL);
int N_RB_DL);
void display_test_configuration_pss(int position, int pss_sequence_number);
@@ -142,7 +142,7 @@ int main(int argc, char *argv[]) {
uint8_t nb_antennas_tx = 1;
uint8_t nb_antennas_rx = 1;
uint8_t frame_type = FDD;
uint8_t N_RB_DL=106;
int N_RB_DL=106;
lte_prefix_type_t extended_prefix_flag = NORMAL;
int Nid_cell[] = {(3*1+3)};
VOID_PARAMETER argc;
@@ -1239,7 +1239,7 @@ int main(int argc, char *argv[])
uint8_t nb_antennas_tx = 1;
uint8_t nb_antennas_rx = 1;
uint8_t frame_type = FDD;
uint8_t N_RB_DL=100;
int N_RB_DL=100;
lte_prefix_type_t extended_prefix_flag = NORMAL;
int Nid_cell[] = {(3*1+3)};
VOID_PARAMETER argc;
@@ -442,7 +442,7 @@ int main(int argc, char *argv[])
uint8_t nb_antennas_tx = 1;
uint8_t nb_antennas_rx = 1;
uint8_t frame_type = FDD;
uint8_t N_RB_DL=100;
int N_RB_DL=100;
lte_prefix_type_t extended_prefix_flag = NORMAL;
int Nid_cell[] = {(3*0+0)};
VOID_PARAMETER argc;
@@ -181,7 +181,7 @@ int main(int argc, char *argv[])
uint8_t nb_antennas_tx = 1;
uint8_t nb_antennas_rx = 1;
uint8_t frame_type = FDD;
uint8_t N_RB_DL=100;
int N_RB_DL=100;
lte_prefix_type_t extended_prefix_flag = NORMAL;
int phase;
int Nid1, Nid2;
+2 -2
View File
@@ -354,7 +354,7 @@ typedef struct m2ap_register_mce_req_s {
int32_t uplink_frequency_offset[MAX_NUM_CCs];
uint32_t Nid_cell[MAX_NUM_CCs];
int16_t N_RB_DL[MAX_NUM_CCs];
lte_frame_type_t frame_type[MAX_NUM_CCs];
frame_type_t frame_type[MAX_NUM_CCs];
uint32_t fdd_earfcn_DL[MAX_NUM_CCs];
uint32_t fdd_earfcn_UL[MAX_NUM_CCs];
int num_cc;
@@ -427,7 +427,7 @@ typedef struct m2ap_register_enb_req_s {
int32_t uplink_frequency_offset[MAX_NUM_CCs];
uint32_t Nid_cell[MAX_NUM_CCs];
int16_t N_RB_DL[MAX_NUM_CCs];
lte_frame_type_t frame_type[MAX_NUM_CCs];
frame_type_t frame_type[MAX_NUM_CCs];
uint32_t fdd_earfcn_DL[MAX_NUM_CCs];
uint32_t fdd_earfcn_UL[MAX_NUM_CCs];
int num_cc;
+1 -1
View File
@@ -123,7 +123,7 @@ typedef struct m3ap_register_mce_req_s {
int32_t uplink_frequency_offset[MAX_NUM_CCs];
uint32_t Nid_cell[MAX_NUM_CCs];
int16_t N_RB_DL[MAX_NUM_CCs];
lte_frame_type_t frame_type[MAX_NUM_CCs];
frame_type_t frame_type[MAX_NUM_CCs];
uint32_t fdd_earfcn_DL[MAX_NUM_CCs];
uint32_t fdd_earfcn_UL[MAX_NUM_CCs];
int num_cc;
+1 -1
View File
@@ -70,7 +70,7 @@ typedef struct CellInfo_s {
//-------------------------------------------------------------------------------------------//
// eNB: ENB_APP -> PHY messages
typedef struct PhyConfigurationReq_s {
lte_frame_type_t frame_type[MAX_NUM_CCs];
frame_type_t frame_type[MAX_NUM_CCs];
lte_prefix_type_t prefix_type[MAX_NUM_CCs];
uint32_t downlink_frequency[MAX_NUM_CCs];
int32_t uplink_frequency_offset[MAX_NUM_CCs];
+2 -2
View File
@@ -188,7 +188,7 @@ typedef struct RrcConfigurationReq_s {
uint32_t rrc_inactivity_timer_thres; // for testing, maybe change later
paging_drx_t default_drx;
int16_t nb_cc;
lte_frame_type_t frame_type[MAX_NUM_CCs];
frame_type_t frame_type[MAX_NUM_CCs];
uint8_t tdd_config[MAX_NUM_CCs];
uint8_t tdd_config_s[MAX_NUM_CCs];
lte_prefix_type_t prefix_type[MAX_NUM_CCs];
@@ -339,7 +339,7 @@ typedef struct NbIoTRrcConfigurationReq_s {
uint16_t mcc;
uint16_t mnc;
uint8_t mnc_digit_length;
lte_frame_type_t frame_type;
frame_type_t frame_type;
uint8_t tdd_config;
uint8_t tdd_config_s;
lte_prefix_type_t prefix_type;
+1 -1
View File
@@ -138,7 +138,7 @@ typedef struct x2ap_register_enb_req_s {
int32_t uplink_frequency_offset[MAX_NUM_CCs];
uint32_t Nid_cell[MAX_NUM_CCs];
int16_t N_RB_DL[MAX_NUM_CCs];
lte_frame_type_t frame_type[MAX_NUM_CCs];
frame_type_t frame_type[MAX_NUM_CCs];
uint32_t fdd_earfcn_DL[MAX_NUM_CCs];
uint32_t fdd_earfcn_UL[MAX_NUM_CCs];
uint32_t subframeAssignment[MAX_NUM_CCs];
+1 -1
View File
@@ -38,7 +38,7 @@ typedef struct eutra_band_s {
uint32_t ul_max;
uint32_t dl_min;
uint32_t dl_max;
lte_frame_type_t frame_type;
frame_type_t frame_type;
} eutra_band_t;
+1 -1
View File
@@ -1352,7 +1352,7 @@ void flexran_agent_set_operating_bandwidth(mid_t mod_id, uint8_t cc_id, uint8_t
}
}
void flexran_agent_set_operating_frame_type(mid_t mod_id, uint8_t cc_id, lte_frame_type_t frame_type) {
void flexran_agent_set_operating_frame_type(mid_t mod_id, uint8_t cc_id, frame_type_t frame_type) {
if (phy_is_present(mod_id, cc_id)) {
RC.eNB[mod_id][cc_id]->frame_parms.frame_type = frame_type;
} else {
+1 -1
View File
@@ -433,7 +433,7 @@ void flexran_agent_set_operating_eutra_band(mid_t mod_id, uint8_t cc_id, uint8_t
void flexran_agent_set_operating_bandwidth(mid_t mod_id, uint8_t cc_id, uint8_t N_RB);
/*set frame type*/
void flexran_agent_set_operating_frame_type(mid_t mod_id, uint8_t cc_id, lte_frame_type_t frame_type);
void flexran_agent_set_operating_frame_type(mid_t mod_id, uint8_t cc_id, frame_type_t frame_type);
/*RRC status flexRAN*/
uint8_t flexran_get_rrc_status(mid_t mod_id, rnti_t rnti);
+1 -1
View File
@@ -346,7 +346,7 @@ void fix_scc(NR_ServingCellConfigCommon_t *scc,uint64_t ssbmap) {
// prepare DL Allocation lists
nr_rrc_config_dl_tda(scc);
lte_frame_type_t frame_type = get_frame_type((int)*scc->downlinkConfigCommon->frequencyInfoDL->frequencyBandList.list.array[0], *scc->ssbSubcarrierSpacing);
frame_type_t frame_type = get_frame_type((int)*scc->downlinkConfigCommon->frequencyInfoDL->frequencyBandList.list.array[0], *scc->ssbSubcarrierSpacing);
if (frame_type == FDD) {
ASN_STRUCT_FREE(asn_DEF_NR_TDD_UL_DL_ConfigCommon, scc->tdd_UL_DL_ConfigurationCommon);
scc->tdd_UL_DL_ConfigurationCommon = NULL;
-5
View File
@@ -58,11 +58,6 @@ extern int l2_init_eNB(void);
extern void mac_top_init_eNB(void);
extern void mac_init_cell_params(int Mod_idP,int CC_idP);
int32_t **rxdata;
int32_t **txdata;
typedef struct eutra_bandentry_s {
int16_t band;
uint32_t ul_min;
+21 -5
View File
@@ -107,11 +107,10 @@ typedef struct {
} __attribute__ ((__packed__)) NR_MAC_SUBHEADER_SHORT;
typedef struct {
uint8_t LCID: 6; // octet 1 [5:0]
uint8_t F: 1; // octet 1 [6]
uint8_t R: 1; // octet 1 [7]
uint8_t L1: 8; // octet 2 [7:0]
uint8_t L2: 8; // octet 3 [7:0]
uint8_t LCID: 6;
uint8_t F: 1;
uint8_t R: 1;
uint16_t L: 16;
} __attribute__ ((__packed__)) NR_MAC_SUBHEADER_LONG;
typedef struct {
@@ -119,6 +118,23 @@ typedef struct {
uint8_t R: 2; // octet 1 [7:6]
} __attribute__ ((__packed__)) NR_MAC_SUBHEADER_FIXED;
static inline int get_mac_len(uint8_t* pdu, int pdu_len, uint16_t *mac_ce_len, uint16_t *mac_subheader_len) {
if ( pdu_len < sizeof(NR_MAC_SUBHEADER_SHORT))
return false;
NR_MAC_SUBHEADER_SHORT *s = (NR_MAC_SUBHEADER_SHORT*) pdu;
NR_MAC_SUBHEADER_LONG *l = (NR_MAC_SUBHEADER_LONG*) pdu;
if (s->F && pdu_len < sizeof(NR_MAC_SUBHEADER_LONG))
return false;
if (s->F) {
*mac_subheader_len = sizeof(*l);
*mac_ce_len = ntohs(l->L);
} else {
*mac_subheader_len = sizeof(*s);
*mac_ce_len = s->L;
}
return true;
}
// BSR MAC CEs
// TS 38.321 ch. 6.1.3.1
// Short BSR for a specific logical channel group ID
@@ -3092,7 +3092,7 @@ int is_nr_DL_slot(NR_TDD_UL_DL_ConfigCommon_t *tdd_UL_DL_ConfigurationCommon,slo
else return(slot_in_period <= slots1+tdd_UL_DL_ConfigurationCommon->pattern2->nrofDownlinkSlots ? 1 : 0);
}
int is_nr_UL_slot(NR_TDD_UL_DL_ConfigCommon_t *tdd_UL_DL_ConfigurationCommon, slot_t slot, lte_frame_type_t frame_type) {
int is_nr_UL_slot(NR_TDD_UL_DL_ConfigCommon_t *tdd_UL_DL_ConfigurationCommon, slot_t slot, frame_type_t frame_type) {
int period,period1,period2=0;
@@ -45,7 +45,7 @@ int16_t fill_dmrs_mask(NR_PDSCH_Config_t *pdsch_Config,int dmrs_TypeA_Position,i
int is_nr_DL_slot(NR_TDD_UL_DL_ConfigCommon_t *tdd_UL_DL_ConfigurationCommon,slot_t slotP);
int is_nr_UL_slot(NR_TDD_UL_DL_ConfigCommon_t *tdd_UL_DL_ConfigurationCommon, slot_t slotP, lte_frame_type_t frame_type);
int is_nr_UL_slot(NR_TDD_UL_DL_ConfigCommon_t *tdd_UL_DL_ConfigurationCommon, slot_t slotP, frame_type_t frame_type);
uint16_t nr_dci_size(const NR_BWP_DownlinkCommon_t *initialDLBWP,
const NR_BWP_UplinkCommon_t *initialULBWP,

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