Commit 4e70fe17 authored by francescomani's avatar francescomani

Merge remote-tracking branch 'origin/develop' into NR_BWP_fixes

parents c6d668b0 81e4a783
...@@ -503,6 +503,29 @@ pipeline { ...@@ -503,6 +503,29 @@ pipeline {
} }
} }
} }
stage ("Test F1 - FDD - Band 7 - B210") {
when {
expression {doFullTestsuite}
}
steps {
script {
sh "sleep 60"
triggerSlaveJob ('eNB-CI-F1-FDD-Band7-B210', 'Test-F1-FDD-Band7')
}
}
post {
always {
script {
finalizeSlaveJob('eNB-CI-F1-FDD-Band7-B210')
}
}
failure {
script {
currentBuild.result = 'FAILURE'
}
}
}
}
stage ("Test IF4p5 - TDD - Band 40 - B210") { stage ("Test IF4p5 - TDD - Band 40 - B210") {
when { when {
expression {doFullTestsuite} expression {doFullTestsuite}
......
...@@ -24,6 +24,7 @@ ...@@ -24,6 +24,7 @@
// Location of the python executor node shall be in the same subnet as the others servers // Location of the python executor node shall be in the same subnet as the others servers
def pythonExecutor = params.pythonExecutor def pythonExecutor = params.pythonExecutor
def DataBaseHost = params.DataBaseHost
// Location of the test XML file to be run // Location of the test XML file to be run
def testXMLFile = params.pythonTestXmlFile def testXMLFile = params.pythonTestXmlFile
...@@ -45,10 +46,12 @@ def eNB_CommitID ...@@ -45,10 +46,12 @@ def eNB_CommitID
def eNB_AllowMergeRequestProcess def eNB_AllowMergeRequestProcess
def eNB_TargetBranch def eNB_TargetBranch
//Status fed to the database
def StatusForDb = ""
pipeline { pipeline {
agent { agent {label pythonExecutor}
label pythonExecutor
}
options { options {
disableConcurrentBuilds() disableConcurrentBuilds()
ansiColor('xterm') ansiColor('xterm')
...@@ -270,6 +273,15 @@ pipeline { ...@@ -270,6 +273,15 @@ pipeline {
} }
} }
} }
stage ("SQL Collect"){
agent {label DataBaseHost}
steps {
script {
if (currentBuild.result=='FAILURE') {StatusForDb = 'FAIL'} else {StatusForDb = 'PASS'}
sh "python3 /home/oaicicd/mysql/sql_connect.py ${JOB_NAME} ${params.eNB_MR} ${params.eNB_Branch} ${env.BUILD_ID} ${env.BUILD_URL} ${StatusForDb} ''"
}
}
}
} }
} }
} }
......
...@@ -286,7 +286,7 @@ class gDashboard: ...@@ -286,7 +286,7 @@ class gDashboard:
def main(): def main():
my_gDashboard=gDashboard("/home/oaicicd/remi/creds.json", 'OAI RAN Dashboard', 'MR Status') my_gDashboard=gDashboard("/opt/dashboard/g_creds.json", 'OAI RAN Dashboard', 'MR Status')
cmd="""curl --silent "https://gitlab.eurecom.fr/api/v4/projects/oai%2Fopenairinterface5g/merge_requests?state=opened&per_page=100" """ cmd="""curl --silent "https://gitlab.eurecom.fr/api/v4/projects/oai%2Fopenairinterface5g/merge_requests?state=opened&per_page=100" """
my_gDashboard.fetchData(cmd) my_gDashboard.fetchData(cmd)
my_gDashboard.gBuild("MR Status") my_gDashboard.gBuild("MR Status")
......
...@@ -14,6 +14,8 @@ ...@@ -14,6 +14,8 @@
This page is only valid for an `Ubuntu18` host. This page is only valid for an `Ubuntu18` host.
**NOTE: this version (2021-10-05) is valid for the `v1.1.0` and `v1.2.0` versions of the `OAI 5G CN`.**
**TABLE OF CONTENTS** **TABLE OF CONTENTS**
1. [Retrieving the images on Docker-Hub](#1-retrieving-the-images-on-docker-hub) 1. [Retrieving the images on Docker-Hub](#1-retrieving-the-images-on-docker-hub)
...@@ -26,6 +28,9 @@ This page is only valid for an `Ubuntu18` host. ...@@ -26,6 +28,9 @@ This page is only valid for an `Ubuntu18` host.
2. [Start the iperf server inside the NR-UE container](#32-start-the-iperf-server-inside-the-nr-ue-container) 2. [Start the iperf server inside the NR-UE container](#32-start-the-iperf-server-inside-the-nr-ue-container)
3. [Start the iperf client inside the ext-dn container](#33-start-the-iperf-client-inside-the-ext-dn-container) 3. [Start the iperf client inside the ext-dn container](#33-start-the-iperf-client-inside-the-ext-dn-container)
4. [Un-deployment](#4-un-deployment) 4. [Un-deployment](#4-un-deployment)
5. [Explanations on the configuration in the docker-compose.yaml](##5-explanations-on-the-configuration-in-the-docker-composeyaml)
1. [Making the NR-UE connect to the core network](#51-making-the-nr-ue-connect-to-the-core-network)
2. [Making the gNB connect to the core network](#52-making-the-gnb-connect-to-the-core-network)
# 1. Retrieving the images on Docker-Hub # # 1. Retrieving the images on Docker-Hub #
...@@ -71,6 +76,10 @@ $ docker image tag rdefosseoai/oai-nr-ue:develop oai-nr-ue:develop ...@@ -71,6 +76,10 @@ $ docker image tag rdefosseoai/oai-nr-ue:develop oai-nr-ue:develop
$ docker logout $ docker logout
``` ```
**CAUTION: 2021/10/05 with the release `v1.2.0` of the `CN5G`, the previous version was not compatible any-more.**
**This new version is working for both the `v1.1.0` and `v1.2.0` of the `CN5G`.**
# 2. Deploy containers # # 2. Deploy containers #
![Deployment](./oai-end-to-end.jpg) ![Deployment](./oai-end-to-end.jpg)
...@@ -137,6 +146,8 @@ rfsim5g-traffic: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500 ...@@ -137,6 +146,8 @@ rfsim5g-traffic: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
## 2.2. Deploy OAI gNB in RF simulator mode and in Standalone Mode ## ## 2.2. Deploy OAI gNB in RF simulator mode and in Standalone Mode ##
**CAUTION: To execute this 2nd step, the whole `CN5G` SHALL be in `healthy` state (especially the `mysql` container).**
```bash ```bash
$ docker-compose up -d oai-gnb $ docker-compose up -d oai-gnb
rfsim5g-oai-nrf is up-to-date rfsim5g-oai-nrf is up-to-date
...@@ -160,6 +171,18 @@ rfsim5g-oai-smf /bin/bash -c /openair-smf/ ... Up (healthy) 80/tcp, 880 ...@@ -160,6 +171,18 @@ rfsim5g-oai-smf /bin/bash -c /openair-smf/ ... Up (healthy) 80/tcp, 880
rfsim5g-oai-spgwu /openair-spgwu-tiny/bin/en ... Up (healthy) 2152/udp, 8805/udp rfsim5g-oai-spgwu /openair-spgwu-tiny/bin/en ... Up (healthy) 2152/udp, 8805/udp
``` ```
You can verify that the `gNB` is connected with the `AMF`:
```bagh
$ docker logs rfsim5g-oai-amf
...
[AMF] [amf_app] [info ] |----------------------------------------------------gNBs' information-------------------------------------------|
[AMF] [amf_app] [info ] | Index | Status | Global ID | gNB Name | PLMN |
[AMF] [amf_app] [info ] | 1 | Connected | 0x0 | gnb-rfsim | 208, 99 |
[AMF] [amf_app] [info ] |----------------------------------------------------------------------------------------------------------------|
...
```
## 2.3. Deploy OAI NR-UE in RF simulator mode and in Standalone Mode ## ## 2.3. Deploy OAI NR-UE in RF simulator mode and in Standalone Mode ##
```bash ```bash
...@@ -366,3 +389,47 @@ Removing rfsim5g-mysql ... done ...@@ -366,3 +389,47 @@ Removing rfsim5g-mysql ... done
Removing network rfsim5g-oai-public-net Removing network rfsim5g-oai-public-net
Removing network rfsim5g-oai-traffic_net-net Removing network rfsim5g-oai-traffic_net-net
``` ```
# 5. Explanations on the configuration in the `docker-compose.yaml` #
## 5.1. Making the NR-UE connect to the core network ##
The NR-UE **SHALL** be provisioned in the core network, especially in the `SQL` database and in the `AMF`.
* in AMF section of `docker-compose.yaml` --> `OPERATOR_KEY=c42449363bbad02b66d16bc975d77cc1`
* in NR-UE section --> `OPC: 'C42449363BBAD02B66D16BC975D77CC1'
Both values shall match!
This value is also present in the `oai_db.sql` file:
```bash
INSERT INTO `users` VALUES ('208990100001100','1','55000000000000',NULL,'PURGED',50,40000000,100000000,47,0000000000,1,0xfec86ba6eb707ed08905757b1bb44b8f,0,0,0x40,'ebd07771ace8677a',0xc42449363bbad02b66d16bc975d77cc1);
```
As you can see, 2 other values shall match in the NR-UE section of `docker-compose.yaml`:
* `FULL_IMSI: '208990100001100'`
* `FULL_KEY: 'fec86ba6eb707ed08905757b1bb44b8f'`
We are also using a dedicated `oai-smf.conf` for the `SMF` container: the `oai` DNN shall match the one in the NR-UE section of `docker-compose.yaml` (`DNN: oai`).
## 5.2. Making the gNB connect to the core network ##
Mainly you need to match the PLMN in `gNB`, `AMF` and `SPGWU` parameters:
* `AMF`
- `MCC=208`
- `MNC=99`
- `PLMN_SUPPORT_TAC=0x0001`
- ...
* `SPGWU`
- `MCC=208`
- `MNC=99`
- `TAC=1`
* `gNB`
- `MCC: '208'`
- `MNC: '99'`
- `TAC: 1`
The `ST` and `SD` values shall also match.
...@@ -90,11 +90,14 @@ services: ...@@ -90,11 +90,14 @@ services:
- USE_FQDN_DNS=yes - USE_FQDN_DNS=yes
- NRF_API_VERSION=v1 - NRF_API_VERSION=v1
- NRF_FQDN=oai-nrf - NRF_FQDN=oai-nrf
- AUSF_IPV4_ADDRESS=127.0.0.1 - EXTERNAL_AUSF=no
- AUSF_IPV4_ADDRESS=0.0.0.0
- AUSF_PORT=80 - AUSF_PORT=80
- AUSF_API_VERSION=v1 - AUSF_API_VERSION=v1
- AUSF_FQDN=localhost
depends_on: depends_on:
- oai-nrf - oai-nrf
- mysql
volumes: volumes:
- ./amf-healthcheck.sh:/openair-amf/bin/amf-healthcheck.sh - ./amf-healthcheck.sh:/openair-amf/bin/amf-healthcheck.sh
healthcheck: healthcheck:
...@@ -139,6 +142,7 @@ services: ...@@ -139,6 +142,7 @@ services:
- USE_FQDN_DNS=yes - USE_FQDN_DNS=yes
depends_on: depends_on:
- oai-nrf - oai-nrf
- oai-amf
volumes: volumes:
- ./smf-healthcheck.sh:/openair-smf/bin/smf-healthcheck.sh - ./smf-healthcheck.sh:/openair-smf/bin/smf-healthcheck.sh
- ./oai-smf.conf:/openair-smf/bin/oai-smf.conf - ./oai-smf.conf:/openair-smf/bin/oai-smf.conf
...@@ -183,6 +187,7 @@ services: ...@@ -183,6 +187,7 @@ services:
- DNN_0=oai - DNN_0=oai
depends_on: depends_on:
- oai-nrf - oai-nrf
- oai-smf
cap_add: cap_add:
- NET_ADMIN - NET_ADMIN
- SYS_ADMIN - SYS_ADMIN
...@@ -285,7 +290,7 @@ networks: ...@@ -285,7 +290,7 @@ networks:
com.docker.network.bridge.name: "rfsim5g-public" com.docker.network.bridge.name: "rfsim5g-public"
traffic_net: traffic_net:
driver: bridge driver: bridge
name: rfsim5g-oai-traffic_net-net name: rfsim5g-oai-traffic-net
ipam: ipam:
config: config:
- subnet: 192.168.72.128/26 - subnet: 192.168.72.128/26
......
...@@ -16,7 +16,7 @@ ID = ENB_PHY_DL_TICK ...@@ -16,7 +16,7 @@ ID = ENB_PHY_DL_TICK
ID = ENB_PHY_DLSCH_UE_DCI ID = ENB_PHY_DLSCH_UE_DCI
DESC = eNodeB downlink UE specific DCI as sent by the PHY layer DESC = eNodeB downlink UE specific DCI as sent by the PHY layer
GROUP = ALL:PHY:GRAPHIC:ENB GROUP = ALL:PHY:GRAPHIC:ENB
FORMAT = int,eNB_ID : int,frame : int,subframe : int,rnti : int,dci_format : int,harq_pid : int,mcs : int,TBS FORMAT = int,eNB_ID : int,frame : int,subframe : int,rnti : int,dci_format : int,harq_pid : int,mcs : int,TBS : int,ndi : int,rv : int,rbc : int,nb_rb : int,rb_alloc
ID = ENB_PHY_DLSCH_UE_ACK ID = ENB_PHY_DLSCH_UE_ACK
DESC = eNodeB downlink UE ACK as seen by the PHY layer in process_HARQ_feedback DESC = eNodeB downlink UE ACK as seen by the PHY layer in process_HARQ_feedback
GROUP = ALL:PHY:GRAPHIC:ENB GROUP = ALL:PHY:GRAPHIC:ENB
......
...@@ -77,7 +77,7 @@ cd cmake_targets/ ...@@ -77,7 +77,7 @@ cd cmake_targets/
./build_oai -I -w USRP --eNB --UE --nrUE --gNB ./build_oai -I -w USRP --eNB --UE --nrUE --gNB
``` ```
- The `-I` option is to install pre-requisites, you only need it the first time you build the softmodem or when some oai dependencies have changed. - The `-I` option is to install pre-requisites, you only need it the first time you build the softmodem or when some oai dependencies have changed. Note: for Ubuntu 20 use cmake_targets/install_external_packages.ubuntu20 instead!
- The `-w` option is to select the radio head support you want to include in your build. Radio head support is provided via a shared library, which is called the "oai device" The build script creates a soft link from `liboai_device.so` to the true device which will be used at run-time (here the USRP one,`liboai_usrpdevif.so` . USRP is the only hardware tested today in the Continuous Integration process. The RF simulator[RF simulator](../targets/ARCH/rfsimulator/README.md) is implemented as a specific device replacing RF hardware, it can be specifically built using `-w SIMU` option, but is also built during any softmodem build. - The `-w` option is to select the radio head support you want to include in your build. Radio head support is provided via a shared library, which is called the "oai device" The build script creates a soft link from `liboai_device.so` to the true device which will be used at run-time (here the USRP one,`liboai_usrpdevif.so` . USRP is the only hardware tested today in the Continuous Integration process. The RF simulator[RF simulator](../targets/ARCH/rfsimulator/README.md) is implemented as a specific device replacing RF hardware, it can be specifically built using `-w SIMU` option, but is also built during any softmodem build.
- `--eNB` is to build the `lte-softmodem` executable and all required shared libraries - `--eNB` is to build the `lte-softmodem` executable and all required shared libraries
- `--gNB` is to build the `nr-softmodem` executable and all required shared libraries - `--gNB` is to build the `nr-softmodem` executable and all required shared libraries
......
This diff is collapsed.
This diff is collapsed.
...@@ -49,6 +49,7 @@ RUN yum update -y && \ ...@@ -49,6 +49,7 @@ RUN yum update -y && \
nettle \ nettle \
net-tools \ net-tools \
iputils \ iputils \
iproute \
atlas \ atlas \
libXpm \ libXpm \
libX11 \ libX11 \
......
...@@ -147,14 +147,6 @@ static void UE_synch(void *arg) { ...@@ -147,14 +147,6 @@ static void UE_synch(void *arg) {
if (UE->UE_scan == 0) { if (UE->UE_scan == 0) {
#ifdef FR2_TEST
// Overwrite DL frequency (for FR2 testing)
if (downlink_frequency[0][0]!=0){
UE->frame_parms.dl_CarrierFreq = downlink_frequency[0][0];
UE->frame_parms.ul_CarrierFreq = downlink_frequency[0][0];
}
#endif
for (i=0; i<openair0_cfg[UE->rf_map.card].rx_num_channels; i++) { for (i=0; i<openair0_cfg[UE->rf_map.card].rx_num_channels; i++) {
LOG_I( PHY, "[SCHED][UE] Check absolute frequency DL %f, UL %f (RF card %d, oai_exit %d, channel %d, rx_num_channels %d)\n", LOG_I( PHY, "[SCHED][UE] Check absolute frequency DL %f, UL %f (RF card %d, oai_exit %d, channel %d, rx_num_channels %d)\n",
...@@ -220,7 +212,7 @@ static void UE_synch(void *arg) { ...@@ -220,7 +212,7 @@ static void UE_synch(void *arg) {
LOG_I(PHY, "[UE thread Synch] Running Initial Synch (mode %d)\n",UE->mode); LOG_I(PHY, "[UE thread Synch] Running Initial Synch (mode %d)\n",UE->mode);
uint64_t dl_carrier, ul_carrier; uint64_t dl_carrier, ul_carrier;
nr_get_carrier_frequencies(&UE->frame_parms, &dl_carrier, &ul_carrier); nr_get_carrier_frequencies(UE, &dl_carrier, &ul_carrier);
if (nr_initial_sync(&syncD->proc, UE, 2, get_softmodem_params()->sa, get_nrUE_params()->nr_dlsch_parallel) == 0) { if (nr_initial_sync(&syncD->proc, UE, 2, get_softmodem_params()->sa, get_nrUE_params()->nr_dlsch_parallel) == 0) {
freq_offset = UE->common_vars.freq_offset; // frequency offset computed with pss in initial sync freq_offset = UE->common_vars.freq_offset; // frequency offset computed with pss in initial sync
......
...@@ -366,7 +366,7 @@ void init_openair0(void) { ...@@ -366,7 +366,7 @@ void init_openair0(void) {
openair0_cfg[card].rx_num_channels, openair0_cfg[card].rx_num_channels,
duplex_mode[openair0_cfg[card].duplex_mode]); duplex_mode[openair0_cfg[card].duplex_mode]);
nr_get_carrier_frequencies(frame_parms, &dl_carrier, &ul_carrier); nr_get_carrier_frequencies(PHY_vars_UE_g[0][0], &dl_carrier, &ul_carrier);
nr_rf_card_config_freq(&openair0_cfg[card], ul_carrier, dl_carrier, freq_off); nr_rf_card_config_freq(&openair0_cfg[card], ul_carrier, dl_carrier, freq_off);
nr_rf_card_config_gain(&openair0_cfg[card], rx_gain_off); nr_rf_card_config_gain(&openair0_cfg[card], rx_gain_off);
...@@ -423,7 +423,7 @@ int main( int argc, char **argv ) { ...@@ -423,7 +423,7 @@ int main( int argc, char **argv ) {
get_options (); //Command-line options specific for NRUE get_options (); //Command-line options specific for NRUE
get_common_options(SOFTMODEM_5GUE_BIT ); get_common_options(SOFTMODEM_5GUE_BIT);
init_tpools(nrUE_params.nr_dlsch_parallel); init_tpools(nrUE_params.nr_dlsch_parallel);
CONFIG_CLEARRTFLAG(CONFIG_NOEXITONHELP); CONFIG_CLEARRTFLAG(CONFIG_NOEXITONHELP);
#if T_TRACER #if T_TRACER
...@@ -493,14 +493,6 @@ int main( int argc, char **argv ) { ...@@ -493,14 +493,6 @@ int main( int argc, char **argv ) {
init_timeshift_rotation(&UE[CC_id]->frame_parms); init_timeshift_rotation(&UE[CC_id]->frame_parms);
init_nr_ue_vars(UE[CC_id], 0, abstraction_flag); init_nr_ue_vars(UE[CC_id], 0, abstraction_flag);
#ifdef FR2_TEST
// Overwrite DL frequency (for FR2 testing)
if (downlink_frequency[0][0]!=0){
frame_parms[CC_id]->dl_CarrierFreq = downlink_frequency[0][0];
if (frame_parms[CC_id]->frame_type == TDD)
frame_parms[CC_id]->ul_CarrierFreq = downlink_frequency[0][0];
}
#endif
} }
init_openair0(); init_openair0();
......
...@@ -7,7 +7,8 @@ ...@@ -7,7 +7,8 @@
#define CONFIG_HLP_IF_FREQ "IF frequency for RF, if needed"
#define CONFIG_HLP_IF_FREQ_OFF "UL IF frequency offset for RF, if needed"
#define CONFIG_HLP_DLSCH_PARA "number of threads for dlsch processing 0 for no parallelization\n" #define CONFIG_HLP_DLSCH_PARA "number of threads for dlsch processing 0 for no parallelization\n"
#define CONFIG_HLP_OFFSET_DIV "Divisor for computing OFDM symbol offset in Rx chain (num samples in CP/<the value>). Default value is 8. To set the sample offset to 0, set this value ~ 10e6\n" #define CONFIG_HLP_OFFSET_DIV "Divisor for computing OFDM symbol offset in Rx chain (num samples in CP/<the value>). Default value is 8. To set the sample offset to 0, set this value ~ 10e6\n"
/***************************************************************************************************************************************/ /***************************************************************************************************************************************/
...@@ -62,6 +63,8 @@ ...@@ -62,6 +63,8 @@
{"r" , CONFIG_HLP_PRB_SA, 0, iptr:&(fp->N_RB_DL), defintval:106, TYPE_UINT, 0}, \ {"r" , CONFIG_HLP_PRB_SA, 0, iptr:&(fp->N_RB_DL), defintval:106, TYPE_UINT, 0}, \
{"s" , CONFIG_HLP_SSC, 0, u16ptr:&(fp->ssb_start_subcarrier), defintval:516, TYPE_UINT16,0}, \ {"s" , CONFIG_HLP_SSC, 0, u16ptr:&(fp->ssb_start_subcarrier), defintval:516, TYPE_UINT16,0}, \
{"T" , CONFIG_HLP_TDD, PARAMFLAG_BOOL, iptr:&tddflag, defintval:0, TYPE_INT, 0}, \ {"T" , CONFIG_HLP_TDD, PARAMFLAG_BOOL, iptr:&tddflag, defintval:0, TYPE_INT, 0}, \
{"if_freq" , CONFIG_HLP_IF_FREQ, 0, u64ptr:&(UE->if_freq), defuintval:0, TYPE_UINT64,0}, \
{"if_freq_off" , CONFIG_HLP_IF_FREQ_OFF, 0, iptr:&(UE->if_freq_off), defuintval:0, TYPE_INT, 0}, \
{"do-prb-interpolation", CONFIG_HLP_PRBINTER, PARAMFLAG_BOOL, iptr:&(UE->prb_interpolation), defintval:0, TYPE_INT, 0}, \ {"do-prb-interpolation", CONFIG_HLP_PRBINTER, PARAMFLAG_BOOL, iptr:&(UE->prb_interpolation), defintval:0, TYPE_INT, 0}, \
{"ue-timing-correction-disable", CONFIG_HLP_DISABLETIMECORR, PARAMFLAG_BOOL, iptr:&(UE->no_timing_correction), defintval:0, TYPE_INT, 0}, \ {"ue-timing-correction-disable", CONFIG_HLP_DISABLETIMECORR, PARAMFLAG_BOOL, iptr:&(UE->no_timing_correction), defintval:0, TYPE_INT, 0}, \
} }
......
...@@ -1527,7 +1527,9 @@ void fill_dci_and_dlsch(PHY_VARS_eNB *eNB, ...@@ -1527,7 +1527,9 @@ void fill_dci_and_dlsch(PHY_VARS_eNB *eNB,
if (dlsch0->active) if (dlsch0->active)
T(T_ENB_PHY_DLSCH_UE_DCI, T_INT(0), T_INT(frame), T_INT(subframe), T(T_ENB_PHY_DLSCH_UE_DCI, T_INT(0), T_INT(frame), T_INT(subframe),
T_INT(rel8->rnti), T_INT(rel8->dci_format), T_INT(rel8->harq_process), T_INT(rel8->rnti), T_INT(rel8->dci_format), T_INT(rel8->harq_process),
T_INT(rel8->mcs_1), T_INT(dlsch0_harq->TBS)); T_INT(rel8->mcs_1), T_INT(dlsch0_harq->TBS), T_INT(rel8->new_data_indicator_1),
T_INT(rel8->redundancy_version_1), T_INT(rel8->resource_block_coding),
T_INT(dlsch0_harq->nb_rb), T_INT(dlsch0_harq->rb_alloc[0]));
#endif #endif
} }
......
...@@ -1466,7 +1466,7 @@ int nr_initial_sync(UE_nr_rxtx_proc_t *proc, ...@@ -1466,7 +1466,7 @@ int nr_initial_sync(UE_nr_rxtx_proc_t *proc,
@param dl_Carrier Pointer to DL carrier to be set @param dl_Carrier Pointer to DL carrier to be set
@param ul_Carrier Pointer to UL carrier to be set @param ul_Carrier Pointer to UL carrier to be set
*/ */
void nr_get_carrier_frequencies(NR_DL_FRAME_PARMS *fp, void nr_get_carrier_frequencies(PHY_VARS_NR_UE *ue,
uint64_t *dl_Carrier, uint64_t *dl_Carrier,
uint64_t *ul_Carrier); uint64_t *ul_Carrier);
......
...@@ -33,19 +33,17 @@ ...@@ -33,19 +33,17 @@
#include "nr_transport_proto_ue.h" #include "nr_transport_proto_ue.h"
#include "executables/softmodem-common.h" #include "executables/softmodem-common.h"
void nr_get_carrier_frequencies(NR_DL_FRAME_PARMS *fp, uint64_t *dl_carrier, uint64_t *ul_carrier){ void nr_get_carrier_frequencies(PHY_VARS_NR_UE *ue, uint64_t *dl_carrier, uint64_t *ul_carrier){
if (get_softmodem_params()->phy_test==1 || get_softmodem_params()->do_ra==1 || !downlink_frequency[0][0]) { NR_DL_FRAME_PARMS *fp = &ue->frame_parms;
if (ue->if_freq!=0) {
*dl_carrier = ue->if_freq;
*ul_carrier = *dl_carrier + ue->if_freq_off;
}
else{
*dl_carrier = fp->dl_CarrierFreq; *dl_carrier = fp->dl_CarrierFreq;
} else { *ul_carrier = fp->ul_CarrierFreq;
*dl_carrier = downlink_frequency[0][0];
} }
if (uplink_frequency_offset[0][0])
*ul_carrier = *dl_carrier + uplink_frequency_offset[0][0];
else
*ul_carrier = *dl_carrier + fp->ul_CarrierFreq - fp->dl_CarrierFreq;
} }
......
...@@ -767,6 +767,10 @@ typedef struct { ...@@ -767,6 +767,10 @@ typedef struct {
int UE_scan_carrier; int UE_scan_carrier;
/// \brief Indicator that UE should enable estimation and compensation of frequency offset /// \brief Indicator that UE should enable estimation and compensation of frequency offset
int UE_fo_compensation; int UE_fo_compensation;
/// IF frequency for RF
uint64_t if_freq;
/// UL IF frequency offset for RF
int if_freq_off;
/// \brief Indicator that UE is synchronized to a gNB /// \brief Indicator that UE is synchronized to a gNB
int is_synchronized; int is_synchronized;
/// \brief Indicator that UE lost frame synchronization /// \brief Indicator that UE lost frame synchronization
......
...@@ -267,6 +267,8 @@ void nr_dlsim_preprocessor(module_id_t module_id, ...@@ -267,6 +267,8 @@ void nr_dlsim_preprocessor(module_id_t module_id,
NR_pdsch_semi_static_t *ps = &sched_ctrl->pdsch_semi_static; NR_pdsch_semi_static_t *ps = &sched_ctrl->pdsch_semi_static;
ps->nrOfLayers = g_nrOfLayers;
nr_set_pdsch_semi_static(scc, nr_set_pdsch_semi_static(scc,
UE_info->CellGroup[0], UE_info->CellGroup[0],
sched_ctrl->active_bwp, sched_ctrl->active_bwp,
...@@ -282,7 +284,6 @@ void nr_dlsim_preprocessor(module_id_t module_id, ...@@ -282,7 +284,6 @@ void nr_dlsim_preprocessor(module_id_t module_id,
* configuration */ * configuration */
ps->mcsTableIdx = g_mcsTableIdx; ps->mcsTableIdx = g_mcsTableIdx;
sched_pdsch->nrOfLayers = g_nrOfLayers;
sched_pdsch->Qm = nr_get_Qm_dl(sched_pdsch->mcs, ps->mcsTableIdx); sched_pdsch->Qm = nr_get_Qm_dl(sched_pdsch->mcs, ps->mcsTableIdx);
sched_pdsch->R = nr_get_code_rate_dl(sched_pdsch->mcs, ps->mcsTableIdx); sched_pdsch->R = nr_get_code_rate_dl(sched_pdsch->mcs, ps->mcsTableIdx);
sched_pdsch->tb_size = nr_compute_tbs(sched_pdsch->Qm, sched_pdsch->tb_size = nr_compute_tbs(sched_pdsch->Qm,
...@@ -292,7 +293,7 @@ void nr_dlsim_preprocessor(module_id_t module_id, ...@@ -292,7 +293,7 @@ void nr_dlsim_preprocessor(module_id_t module_id,
ps->N_PRB_DMRS * ps->N_DMRS_SLOT, ps->N_PRB_DMRS * ps->N_DMRS_SLOT,
0 /* N_PRB_oh, 0 for initialBWP */, 0 /* N_PRB_oh, 0 for initialBWP */,
0 /* tb_scaling */, 0 /* tb_scaling */,
sched_pdsch->nrOfLayers) ps->nrOfLayers)
>> 3; >> 3;
/* the simulator assumes the HARQ PID is equal to the slot number */ /* the simulator assumes the HARQ PID is equal to the slot number */
......
...@@ -455,9 +455,7 @@ bool allocate_dl_retransmission(module_id_t module_id, ...@@ -455,9 +455,7 @@ bool allocate_dl_retransmission(module_id_t module_id,
int rbStart = 0; // start wrt BWPstart int rbStart = 0; // start wrt BWPstart
NR_pdsch_semi_static_t *ps = &sched_ctrl->pdsch_semi_static; NR_pdsch_semi_static_t *ps = &sched_ctrl->pdsch_semi_static;
const long f = sched_ctrl->search_space->searchSpaceType->choice.ue_Specific->dci_Formats; const long f = sched_ctrl->active_bwp ? sched_ctrl->search_space->searchSpaceType->choice.ue_Specific->dci_Formats : 0;
const uint8_t num_dmrs_cdm_grps_no_data = sched_ctrl->active_bwp ? (f ? 1 : (ps->nrOfSymbols == 2 ? 1 : 2)) : (ps->nrOfSymbols == 2 ? 1 : 2);
int rbSize = 0; int rbSize = 0;
const int tda = sched_ctrl->active_bwp ? RC.nrmac[module_id]->preferred_dl_tda[sched_ctrl->active_bwp->bwp_Id][slot] : 1; const int tda = sched_ctrl->active_bwp ? RC.nrmac[module_id]->preferred_dl_tda[sched_ctrl->active_bwp->bwp_Id][slot] : 1;
if (tda == retInfo->time_domain_allocation) { if (tda == retInfo->time_domain_allocation) {
...@@ -476,9 +474,8 @@ bool allocate_dl_retransmission(module_id_t module_id, ...@@ -476,9 +474,8 @@ bool allocate_dl_retransmission(module_id_t module_id,
} }
/* check whether we need to switch the TDA allocation since the last /* check whether we need to switch the TDA allocation since the last
* (re-)transmission */ * (re-)transmission */
if (ps->time_domain_allocation != tda || ps->numDmrsCdmGrpsNoData != num_dmrs_cdm_grps_no_data) if (ps->time_domain_allocation != tda)
nr_set_pdsch_semi_static( nr_set_pdsch_semi_static(scc, UE_info->CellGroup[UE_id], sched_ctrl->active_bwp, tda, f, ps);
scc, UE_info->CellGroup[UE_id], sched_ctrl->active_bwp, tda, num_dmrs_cdm_grps_no_data, ps);
} else { } else {
/* the retransmission will use a different time domain allocation, check /* the retransmission will use a different time domain allocation, check
* that we have enough resources */ * that we have enough resources */
...@@ -487,8 +484,8 @@ bool allocate_dl_retransmission(module_id_t module_id, ...@@ -487,8 +484,8 @@ bool allocate_dl_retransmission(module_id_t module_id,
while (rbStart + rbSize < bwpSize && rballoc_mask[rbStart + rbSize]) while (rbStart + rbSize < bwpSize && rballoc_mask[rbStart + rbSize])
rbSize++; rbSize++;
NR_pdsch_semi_static_t temp_ps; NR_pdsch_semi_static_t temp_ps;
nr_set_pdsch_semi_static( temp_ps.nrOfLayers = 1;
scc, UE_info->CellGroup[UE_id], sched_ctrl->active_bwp, tda, num_dmrs_cdm_grps_no_data, &temp_ps); nr_set_pdsch_semi_static(scc, UE_info->CellGroup[UE_id], sched_ctrl->active_bwp, tda, f, &temp_ps);
uint32_t new_tbs; uint32_t new_tbs;
uint16_t new_rbSize; uint16_t new_rbSize;
bool success = nr_find_nb_rb(retInfo->Qm, bool success = nr_find_nb_rb(retInfo->Qm,
...@@ -604,7 +601,7 @@ void pf_dl(module_id_t module_id, ...@@ -604,7 +601,7 @@ void pf_dl(module_id_t module_id,
/* Calculate coeff */ /* Calculate coeff */
sched_pdsch->mcs = 9; sched_pdsch->mcs = 9;
sched_pdsch->nrOfLayers = 1; ps->nrOfLayers = 1;
uint32_t tbs = pf_tbs[ps->mcsTableIdx][sched_pdsch->mcs]; uint32_t tbs = pf_tbs[ps->mcsTableIdx][sched_pdsch->mcs];
coeff_ue[UE_id] = (float) tbs / thr_ue[UE_id]; coeff_ue[UE_id] = (float) tbs / thr_ue[UE_id];
LOG_D(NR_MAC,"b %d, thr_ue[%d] %f, tbs %d, coeff_ue[%d] %f\n", LOG_D(NR_MAC,"b %d, thr_ue[%d] %f, tbs %d, coeff_ue[%d] %f\n",
...@@ -684,11 +681,9 @@ void pf_dl(module_id_t module_id, ...@@ -684,11 +681,9 @@ void pf_dl(module_id_t module_id,
const int tda = sched_ctrl->active_bwp ? RC.nrmac[module_id]->preferred_dl_tda[sched_ctrl->active_bwp->bwp_Id][slot] : 1; const int tda = sched_ctrl->active_bwp ? RC.nrmac[module_id]->preferred_dl_tda[sched_ctrl->active_bwp->bwp_Id][slot] : 1;
NR_sched_pdsch_t *sched_pdsch = &sched_ctrl->sched_pdsch; NR_sched_pdsch_t *sched_pdsch = &sched_ctrl->sched_pdsch;
NR_pdsch_semi_static_t *ps = &sched_ctrl->pdsch_semi_static; NR_pdsch_semi_static_t *ps = &sched_ctrl->pdsch_semi_static;
const long f = sched_ctrl->search_space->searchSpaceType->choice.ue_Specific->dci_Formats; const long f = sched_ctrl->active_bwp ? sched_ctrl->search_space->searchSpaceType->choice.ue_Specific->dci_Formats : 0;
const uint8_t num_dmrs_cdm_grps_no_data = sched_ctrl->active_bwp ? (f ? 1 : (ps->nrOfSymbols == 2 ? 1 : 2)) : (ps->nrOfSymbols == 2 ? 1 : 2); if (ps->time_domain_allocation != tda)
if (ps->time_domain_allocation != tda || ps->numDmrsCdmGrpsNoData != num_dmrs_cdm_grps_no_data) nr_set_pdsch_semi_static(scc, UE_info->CellGroup[UE_id], sched_ctrl->active_bwp, tda, f, ps);
nr_set_pdsch_semi_static(
scc, UE_info->CellGroup[UE_id], sched_ctrl->active_bwp, tda, num_dmrs_cdm_grps_no_data, ps);
sched_pdsch->Qm = nr_get_Qm_dl(sched_pdsch->mcs, ps->mcsTableIdx); sched_pdsch->Qm = nr_get_Qm_dl(sched_pdsch->mcs, ps->mcsTableIdx);
sched_pdsch->R = nr_get_code_rate_dl(sched_pdsch->mcs, ps->mcsTableIdx); sched_pdsch->R = nr_get_code_rate_dl(sched_pdsch->mcs, ps->mcsTableIdx);
sched_pdsch->pucch_allocation = alloc; sched_pdsch->pucch_allocation = alloc;
...@@ -826,17 +821,17 @@ void nr_schedule_ue_spec(module_id_t module_id, ...@@ -826,17 +821,17 @@ void nr_schedule_ue_spec(module_id_t module_id,
const rnti_t rnti = UE_info->rnti[UE_id]; const rnti_t rnti = UE_info->rnti[UE_id];
/* POST processing */
const uint8_t nrOfLayers = sched_pdsch->nrOfLayers;
const uint16_t R = sched_pdsch->R;
const uint8_t Qm = sched_pdsch->Qm;
const uint32_t TBS = sched_pdsch->tb_size;
/* pre-computed PDSCH values that only change if time domain /* pre-computed PDSCH values that only change if time domain
* allocation/DMRS parameters change. Updated in the preprocessor through * allocation/DMRS parameters change. Updated in the preprocessor through
* nr_set_pdsch_semi_static() */ * nr_set_pdsch_semi_static() */
NR_pdsch_semi_static_t *ps = &sched_ctrl->pdsch_semi_static; NR_pdsch_semi_static_t *ps = &sched_ctrl->pdsch_semi_static;
/* POST processing */
const uint8_t nrOfLayers = ps->nrOfLayers;
const uint16_t R = sched_pdsch->R;
const uint8_t Qm = sched_pdsch->Qm;
const uint32_t TBS = sched_pdsch->tb_size;
int8_t current_harq_pid = sched_pdsch->dl_harq_pid; int8_t current_harq_pid = sched_pdsch->dl_harq_pid;
if (current_harq_pid < 0) { if (current_harq_pid < 0) {
/* PP has not selected a specific HARQ Process, get a new one */ /* PP has not selected a specific HARQ Process, get a new one */
...@@ -947,7 +942,7 @@ void nr_schedule_ue_spec(module_id_t module_id, ...@@ -947,7 +942,7 @@ void nr_schedule_ue_spec(module_id_t module_id,
pdsch_pdu->dlDmrsScramblingId = *scc->physCellId; pdsch_pdu->dlDmrsScramblingId = *scc->physCellId;
pdsch_pdu->SCID = 0; pdsch_pdu->SCID = 0;
pdsch_pdu->numDmrsCdmGrpsNoData = ps->numDmrsCdmGrpsNoData; pdsch_pdu->numDmrsCdmGrpsNoData = ps->numDmrsCdmGrpsNoData;
pdsch_pdu->dmrsPorts = 1; pdsch_pdu->dmrsPorts = (1<<nrOfLayers)-1; // FIXME with a better implementation
// Pdsch Allocation in frequency domain // Pdsch Allocation in frequency domain
pdsch_pdu->resourceAlloc = 1; pdsch_pdu->resourceAlloc = 1;
...@@ -1029,7 +1024,7 @@ void nr_schedule_ue_spec(module_id_t module_id, ...@@ -1029,7 +1024,7 @@ void nr_schedule_ue_spec(module_id_t module_id,
dci_payload.tpc = sched_ctrl->tpc1; // TPC for PUCCH: table 7.2.1-1 in 38.213 dci_payload.tpc = sched_ctrl->tpc1; // TPC for PUCCH: table 7.2.1-1 in 38.213
dci_payload.pucch_resource_indicator = pucch->resource_indicator; dci_payload.pucch_resource_indicator = pucch->resource_indicator;
dci_payload.pdsch_to_harq_feedback_timing_indicator.val = pucch->timing_indicator; // PDSCH to HARQ TI dci_payload.pdsch_to_harq_feedback_timing_indicator.val = pucch->timing_indicator; // PDSCH to HARQ TI
dci_payload.antenna_ports.val = 0; // nb of cdm groups w/o data 1 and dmrs port 0 dci_payload.antenna_ports.val = ps->dmrs_ports_id;
dci_payload.dmrs_sequence_initialization.val = pdsch_pdu->SCID; dci_payload.dmrs_sequence_initialization.val = pdsch_pdu->SCID;
LOG_D(NR_MAC, LOG_D(NR_MAC,
"%4d.%2d DCI type 1 payload: freq_alloc %d (%d,%d,%d), " "%4d.%2d DCI type 1 payload: freq_alloc %d (%d,%d,%d), "
......
...@@ -370,11 +370,12 @@ void nr_preprocessor_phytest(module_id_t module_id, ...@@ -370,11 +370,12 @@ void nr_preprocessor_phytest(module_id_t module_id,
sched_pdsch->rbSize = rbSize; sched_pdsch->rbSize = rbSize;
const int tda = sched_ctrl->active_bwp ? RC.nrmac[module_id]->preferred_dl_tda[sched_ctrl->active_bwp->bwp_Id][slot] : 1; const int tda = sched_ctrl->active_bwp ? RC.nrmac[module_id]->preferred_dl_tda[sched_ctrl->active_bwp->bwp_Id][slot] : 1;
const uint8_t num_dmrs_cdm_grps_no_data = 1; const uint8_t num_dmrs_cdm_grps_no_data = 1;
ps->nrOfLayers = target_dl_Nl;
if (ps->time_domain_allocation != tda || ps->numDmrsCdmGrpsNoData != num_dmrs_cdm_grps_no_data) if (ps->time_domain_allocation != tda || ps->numDmrsCdmGrpsNoData != num_dmrs_cdm_grps_no_data)
nr_set_pdsch_semi_static( nr_set_pdsch_semi_static(
scc, UE_info->CellGroup[UE_id], sched_ctrl->active_bwp, tda, num_dmrs_cdm_grps_no_data, ps); scc, UE_info->CellGroup[UE_id], sched_ctrl->active_bwp, tda, num_dmrs_cdm_grps_no_data, ps);
sched_pdsch->nrOfLayers = target_dl_Nl;
sched_pdsch->mcs = target_dl_mcs; sched_pdsch->mcs = target_dl_mcs;
sched_pdsch->Qm = nr_get_Qm_dl(sched_pdsch->mcs, ps->mcsTableIdx); sched_pdsch->Qm = nr_get_Qm_dl(sched_pdsch->mcs, ps->mcsTableIdx);
sched_pdsch->R = nr_get_code_rate_dl(sched_pdsch->mcs, ps->mcsTableIdx); sched_pdsch->R = nr_get_code_rate_dl(sched_pdsch->mcs, ps->mcsTableIdx);
...@@ -385,7 +386,7 @@ void nr_preprocessor_phytest(module_id_t module_id, ...@@ -385,7 +386,7 @@ void nr_preprocessor_phytest(module_id_t module_id,
ps->N_PRB_DMRS * ps->N_DMRS_SLOT, ps->N_PRB_DMRS * ps->N_DMRS_SLOT,
0 /* N_PRB_oh, 0 for initialBWP */, 0 /* N_PRB_oh, 0 for initialBWP */,
0 /* tb_scaling */, 0 /* tb_scaling */,
sched_pdsch->nrOfLayers) ps->nrOfLayers)
>> 3; >> 3;
/* get the PID of a HARQ process awaiting retransmission, or -1 otherwise */ /* get the PID of a HARQ process awaiting retransmission, or -1 otherwise */
......
...@@ -122,6 +122,36 @@ static inline uint8_t get_max_cces(uint8_t scs) { ...@@ -122,6 +122,36 @@ static inline uint8_t get_max_cces(uint8_t scs) {
return (nr_max_number_of_cces_per_slot[scs]); return (nr_max_number_of_cces_per_slot[scs]);
} }
void set_dl_dmrs_ports(NR_pdsch_semi_static_t *ps) {
//TODO first basic implementation of dmrs port selection
// only vaild for a single codeword
// for now it assumes a selection of Nl consecutive dmrs ports
// and a single front loaded symbol
// dmrs_ports_id is the index of Tables 7.3.1.2.2-1/2/3/4
switch (ps->nrOfLayers) {
case 1:
ps->dmrs_ports_id = 0;
ps->numDmrsCdmGrpsNoData = 1;
break;
case 2:
ps->dmrs_ports_id = 2;
ps->numDmrsCdmGrpsNoData = 1;
break;
case 3:
ps->dmrs_ports_id = 9;
ps->numDmrsCdmGrpsNoData = 2;
break;
case 4:
ps->dmrs_ports_id = 10;
ps->numDmrsCdmGrpsNoData = 2;
break;
default:
AssertFatal(1==0,"Number of layers %d\n not supported or not valid\n",ps->nrOfLayers);
}
}
NR_ControlResourceSet_t *get_coreset(NR_ServingCellConfigCommon_t *scc, NR_ControlResourceSet_t *get_coreset(NR_ServingCellConfigCommon_t *scc,
NR_BWP_Downlink_t *bwp, NR_BWP_Downlink_t *bwp,
NR_SearchSpace_t *ss, NR_SearchSpace_t *ss,
...@@ -266,7 +296,7 @@ void nr_set_pdsch_semi_static(const NR_ServingCellConfigCommon_t *scc, ...@@ -266,7 +296,7 @@ void nr_set_pdsch_semi_static(const NR_ServingCellConfigCommon_t *scc,
const NR_CellGroupConfig_t *secondaryCellGroup, const NR_CellGroupConfig_t *secondaryCellGroup,
const NR_BWP_Downlink_t *bwp, const NR_BWP_Downlink_t *bwp,
int tda, int tda,
uint8_t num_dmrs_cdm_grps_no_data, const long dci_format,
NR_pdsch_semi_static_t *ps) NR_pdsch_semi_static_t *ps)
{ {
ps->time_domain_allocation = tda; ps->time_domain_allocation = tda;
...@@ -292,12 +322,13 @@ void nr_set_pdsch_semi_static(const NR_ServingCellConfigCommon_t *scc, ...@@ -292,12 +322,13 @@ void nr_set_pdsch_semi_static(const NR_ServingCellConfigCommon_t *scc,
} }
else ps->mcsTableIdx = 0; else ps->mcsTableIdx = 0;
ps->numDmrsCdmGrpsNoData = num_dmrs_cdm_grps_no_data; if(dci_format == 0) // format 1_0
ps->numDmrsCdmGrpsNoData = (ps->nrOfSymbols == 2 ? 1 : 2);
else
set_dl_dmrs_ports(ps);
ps->dmrsConfigType = bwp!=NULL ? (bwp->bwp_Dedicated->pdsch_Config->choice.setup->dmrs_DownlinkForPDSCH_MappingTypeA->choice.setup->dmrs_Type == NULL ? 0 : 1) : 0; ps->dmrsConfigType = bwp!=NULL ? (bwp->bwp_Dedicated->pdsch_Config->choice.setup->dmrs_DownlinkForPDSCH_MappingTypeA->choice.setup->dmrs_Type == NULL ? 0 : 1) : 0;
// if no data in dmrs cdm group is 1 only even REs have no data ps->N_PRB_DMRS = ps->numDmrsCdmGrpsNoData * (ps->dmrsConfigType == NFAPI_NR_DMRS_TYPE1 ? 6 : 4);
// if no data in dmrs cdm group is 2 both odd and even REs have no data
ps->N_PRB_DMRS = num_dmrs_cdm_grps_no_data * (ps->dmrsConfigType == NFAPI_NR_DMRS_TYPE1 ? 6 : 4);
ps->dl_dmrs_symb_pos = fill_dmrs_mask(bwp ? bwp->bwp_Dedicated->pdsch_Config->choice.setup : NULL, scc->dmrs_TypeA_Position, ps->nrOfSymbols, ps->startSymbolIndex, mapping_type); ps->dl_dmrs_symb_pos = fill_dmrs_mask(bwp ? bwp->bwp_Dedicated->pdsch_Config->choice.setup : NULL, scc->dmrs_TypeA_Position, ps->nrOfSymbols, ps->startSymbolIndex, mapping_type);
ps->N_DMRS_SLOT = get_num_dmrs(ps->dl_dmrs_symb_pos); ps->N_DMRS_SLOT = get_num_dmrs(ps->dl_dmrs_symb_pos);
} }
......
...@@ -810,6 +810,14 @@ void nr_rx_sdu(const module_id_t gnb_mod_idP, ...@@ -810,6 +810,14 @@ void nr_rx_sdu(const module_id_t gnb_mod_idP,
if( (frameP!=ra->Msg3_frame) || (slotP!=ra->Msg3_slot)) if( (frameP!=ra->Msg3_frame) || (slotP!=ra->Msg3_slot))
continue; continue;
// for CFRA (NSA) do not schedule retransmission of msg3
if (ra->cfra) {
LOG_W(NR_MAC, "Random Access %i failed at state %i (NSA msg3 reception failed)\n", i, ra->state);
nr_mac_remove_ra_rnti(gnb_mod_idP, ra->rnti);
nr_clear_ra_proc(gnb_mod_idP, CC_idP, frameP, ra);
return;
}
if (ra->msg3_round >= MAX_HARQ_ROUNDS - 1) { if (ra->msg3_round >= MAX_HARQ_ROUNDS - 1) {
LOG_W(NR_MAC, "Random Access %i failed at state %i (Reached msg3 max harq rounds)\n", i, ra->state); LOG_W(NR_MAC, "Random Access %i failed at state %i (Reached msg3 max harq rounds)\n", i, ra->state);
nr_mac_remove_ra_rnti(gnb_mod_idP, ra->rnti); nr_mac_remove_ra_rnti(gnb_mod_idP, ra->rnti);
......
...@@ -283,7 +283,7 @@ void nr_set_pdsch_semi_static(const NR_ServingCellConfigCommon_t *scc, ...@@ -283,7 +283,7 @@ void nr_set_pdsch_semi_static(const NR_ServingCellConfigCommon_t *scc,
const NR_CellGroupConfig_t *secondaryCellGroup, const NR_CellGroupConfig_t *secondaryCellGroup,
const NR_BWP_Downlink_t *bwp, const NR_BWP_Downlink_t *bwp,
int tda, int tda,
uint8_t num_dmrs_cdm_grps_no_data, const long dci_format,
NR_pdsch_semi_static_t *ps); NR_pdsch_semi_static_t *ps);
void nr_set_pusch_semi_static(const NR_ServingCellConfigCommon_t *scc, void nr_set_pusch_semi_static(const NR_ServingCellConfigCommon_t *scc,
...@@ -417,6 +417,8 @@ int16_t ssb_index_from_prach(module_id_t module_idP, ...@@ -417,6 +417,8 @@ int16_t ssb_index_from_prach(module_id_t module_idP,
void find_SSB_and_RO_available(module_id_t module_idP); void find_SSB_and_RO_available(module_id_t module_idP);
void set_dl_dmrs_ports(NR_pdsch_semi_static_t *ps);
void calculate_preferred_dl_tda(module_id_t module_id, const NR_BWP_Downlink_t *bwp); void calculate_preferred_dl_tda(module_id_t module_id, const NR_BWP_Downlink_t *bwp);
void calculate_preferred_ul_tda(module_id_t module_id, const NR_BWP_Uplink_t *ubwp); void calculate_preferred_ul_tda(module_id_t module_id, const NR_BWP_Uplink_t *ubwp);
......
...@@ -370,9 +370,9 @@ typedef struct NR_pdsch_semi_static { ...@@ -370,9 +370,9 @@ typedef struct NR_pdsch_semi_static {
int startSymbolIndex; int startSymbolIndex;
int nrOfSymbols; int nrOfSymbols;
uint8_t nrOfLayers;
uint8_t mcsTableIdx; uint8_t mcsTableIdx;
uint8_t dmrs_ports_id;
uint8_t N_PRB_DMRS; uint8_t N_PRB_DMRS;
uint8_t N_DMRS_SLOT; uint8_t N_DMRS_SLOT;
uint16_t dl_dmrs_symb_pos; uint16_t dl_dmrs_symb_pos;
...@@ -388,7 +388,6 @@ typedef struct NR_sched_pdsch { ...@@ -388,7 +388,6 @@ typedef struct NR_sched_pdsch {
uint8_t mcs; uint8_t mcs;
/// TBS-related info /// TBS-related info
uint8_t nrOfLayers;
uint16_t R; uint16_t R;
uint8_t Qm; uint8_t Qm;
uint32_t tb_size; uint32_t tb_size;
......
...@@ -218,7 +218,7 @@ static void reassemble_and_deliver(nr_rlc_entity_am_t *entity, int sn) ...@@ -218,7 +218,7 @@ static void reassemble_and_deliver(nr_rlc_entity_am_t *entity, int sn)
bad_sdu = 1; bad_sdu = 1;
} }
if (!bad_sdu && len > 0) { if (!bad_sdu && len > 0) {
memcpy(sdu + so, pdu->data, len); memcpy(sdu + so, pdu->data + so - pdu->so, len);
so += len; so += len;
} }
free(pdu->data); free(pdu->data);
......
...@@ -148,7 +148,7 @@ static void reassemble_and_deliver(nr_rlc_entity_um_t *entity, int sn) ...@@ -148,7 +148,7 @@ static void reassemble_and_deliver(nr_rlc_entity_um_t *entity, int sn)
bad_sdu = 1; bad_sdu = 1;
} }
if (!bad_sdu && len > 0) { if (!bad_sdu && len > 0) {
memcpy(sdu + so, pdu->data, len); memcpy(sdu + so, pdu->data + so - pdu->so, len);
so += len; so += len;
} }
free(pdu->data); free(pdu->data);
......
#!/bin/sh #!/bin/sh
test_count=15 test_count=17
for i in `seq $test_count` for i in `seq $test_count`
do do
......
...@@ -22,13 +22,13 @@ ...@@ -22,13 +22,13 @@
* create the UE RLC AM entity with given parameters * create the UE RLC AM entity with given parameters
* *
* GNB_UM <rx_maxsize> <tx_maxsize> <t_reassembly> <sn_field_length> * GNB_UM <rx_maxsize> <tx_maxsize> <t_reassembly> <sn_field_length>
* create the eNB RLC UM entity with given parameters * create the gNB RLC UM entity with given parameters
* *
* UE_UM <rx_maxsize> <tx_maxsize> <t_reassembly> <sn_field_length> * UE_UM <rx_maxsize> <tx_maxsize> <t_reassembly> <sn_field_length>
* create the UE RLC UM entity with given parameters * create the UE RLC UM entity with given parameters
* *
* GNB_TM <tx_maxsize> * GNB_TM <tx_maxsize>
* create the eNB RLC TM entity with given parameters * create the gNB RLC TM entity with given parameters
* *
* UE_UM <tx_maxsize> * UE_UM <tx_maxsize>
* create the UE RLC TM entity with given parameters * create the UE RLC TM entity with given parameters
...@@ -39,7 +39,7 @@ ...@@ -39,7 +39,7 @@
* You must end your test definition with a line 'TIME, -1'. * You must end your test definition with a line 'TIME, -1'.
* *
* GNB_SDU <id> <size> * GNB_SDU <id> <size>
* send an SDU to eNB with id <i> and size <size> * send an SDU to gNB with id <i> and size <size>
* the SDU is [00 01 ... ff 01 ...] * the SDU is [00 01 ... ff 01 ...]
* (ie. start byte is 00 then we increment for each byte, loop if needed) * (ie. start byte is 00 then we increment for each byte, loop if needed)
* *
...@@ -47,10 +47,10 @@ ...@@ -47,10 +47,10 @@
* same as GNB_SDU but the SDU is sent to the UE * same as GNB_SDU but the SDU is sent to the UE
* *
* GNB_PDU <size> <'size' bytes> * GNB_PDU <size> <'size' bytes>
* send a custom PDU from eNB to UE (eNB does not see this PDU at all) * send a custom PDU from gNB to UE (gNB does not see this PDU at all)
* *
* UE_PDU <size> <'size' bytes> * UE_PDU <size> <'size' bytes>
* send a custom PDU from UE to eNB (UE does not see this PDU at all) * send a custom PDU from UE to gNB (UE does not see this PDU at all)
* *
* GNB_PDU_SIZE <size> * GNB_PDU_SIZE <size>
* set 'gnb_pdu_size' * set 'gnb_pdu_size'
...@@ -70,7 +70,7 @@ ...@@ -70,7 +70,7 @@
* that the test must fail (ie. exit with non zero, crash not allowed) * that the test must fail (ie. exit with non zero, crash not allowed)
* *
* GNB_BUFFER_STATUS * GNB_BUFFER_STATUS
* call buffer_status for eNB and print result * call buffer_status for gNB and print result
* *
* UE_BUFFER_STATUS * UE_BUFFER_STATUS
* call buffer_status for UE and print result * call buffer_status for UE and print result
...@@ -82,7 +82,7 @@ ...@@ -82,7 +82,7 @@
* discards given SDU * discards given SDU
* *
* RE_ESTABLISH * RE_ESTABLISH
* re-establish both eNB and UE * re-establish both gNB and UE
*/ */
enum action { enum action {
...@@ -368,7 +368,7 @@ int test_main(void) ...@@ -368,7 +368,7 @@ int test_main(void)
pos += 2; pos += 2;
break; break;
case RE_ESTABLISH: case RE_ESTABLISH:
printf("TEST: %d: re-establish eNB and UE\n", i); printf("TEST: %d: re-establish gNB and UE\n", i);
gnb->reestablishment(gnb); gnb->reestablishment(gnb);
ue->reestablishment(ue); ue->reestablishment(ue);
pos++; pos++;
......
/*
* am test (SN field size 18):
* there was a bug when we receive a full PDU after receiving only the
* beginning of it; the data was copied at the end but from the start of the
* full PDU instead of the correct offset. This test captures this case.
* Gnb sends the start of a PDU then the full PDU. That is the SDU is
* [00 .. 09]. First gnb sends [00 .. 08] then it sends [00 .. 09].
*/
TIME, 1,
GNB_AM, 100000, 100000, 45, 35, 0, -1, -1, 8, 18,
UE_AM, 100000, 100000, 45, 35, 0, -1, -1, 8, 18,
GNB_PDU_SIZE, 12,
UE_PDU_SIZE, 20,
GNB_PDU, 12, 0x90, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08,
TIME, 2,
GNB_PDU_SIZE, 20,
GNB_PDU, 13, 0xc0, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09,
TIME, -1
/*
* um test (SN field size 12):
* same problem as for test16, but we test by sending [00 .. 08] then
* [02 .. 09] (they overlap, the full SDU is [00 .. 09]), which probably
* never occurs in practice but triggers the bug. Doing as for test16 does
* not trigger the bug.
*/
TIME, 1,
GNB_UM, 100000, 100000, 35, 12,
UE_UM, 100000, 100000, 35, 12,
GNB_PDU_SIZE, 8,
UE_PDU_SIZE, 20,
GNB_PDU, 11, 0x40, 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08,
TIME, 2,
GNB_PDU_SIZE, 20,
GNB_PDU, 12, 0x80, 0x00, 0x00, 0x02, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09,
TIME, -1
...@@ -419,14 +419,28 @@ uint8_t do_SIB1_NR(rrc_gNB_carrier_data_t *carrier, ...@@ -419,14 +419,28 @@ uint8_t do_SIB1_NR(rrc_gNB_carrier_data_t *carrier,
nrMultiBandInfo->freqBandIndicatorNR = configuration->scc->downlinkConfigCommon->frequencyInfoDL->frequencyBandList.list.array[i]; nrMultiBandInfo->freqBandIndicatorNR = configuration->scc->downlinkConfigCommon->frequencyInfoDL->frequencyBandList.list.array[i];
ASN_SEQUENCE_ADD(&sib1->servingCellConfigCommon->downlinkConfigCommon.frequencyInfoDL.frequencyBandList.list,nrMultiBandInfo); ASN_SEQUENCE_ADD(&sib1->servingCellConfigCommon->downlinkConfigCommon.frequencyInfoDL.frequencyBandList.list,nrMultiBandInfo);
} }
int ref_scs;
if (configuration->scc->downlinkConfigCommon->frequencyInfoDL->absoluteFrequencyPointA < 600000) int scs_scaling0 = 1<<(configuration->scc->downlinkConfigCommon->initialDownlinkBWP->genericParameters.subcarrierSpacing);
ref_scs = 0; // 15 khz int scs_scaling = scs_scaling0;
if (configuration->scc->downlinkConfigCommon->frequencyInfoDL->absoluteFrequencyPointA > 2016666) int scs_scaling2 = scs_scaling0;
ref_scs = 3; // 60 khz if (configuration->scc->downlinkConfigCommon->frequencyInfoDL->absoluteFrequencyPointA < 600000) {
uint32_t absolute_diff = (*configuration->scc->downlinkConfigCommon->frequencyInfoDL->absoluteFrequencySSB - configuration->scc->downlinkConfigCommon->frequencyInfoDL->absoluteFrequencyPointA); scs_scaling = scs_scaling0*3;
sib1->servingCellConfigCommon->downlinkConfigCommon.frequencyInfoDL.offsetToPointA = }
(absolute_diff/12) - (10<<(configuration->scc->downlinkConfigCommon->initialDownlinkBWP->genericParameters.subcarrierSpacing - ref_scs)); if (configuration->scc->downlinkConfigCommon->frequencyInfoDL->absoluteFrequencyPointA > 2016666) {
scs_scaling = scs_scaling0>>2;
scs_scaling2 = scs_scaling0>>2;
}
uint32_t absolute_diff = (*configuration->scc->downlinkConfigCommon->frequencyInfoDL->absoluteFrequencySSB -
configuration->scc->downlinkConfigCommon->frequencyInfoDL->absoluteFrequencyPointA);
sib1->servingCellConfigCommon->downlinkConfigCommon.frequencyInfoDL.offsetToPointA = scs_scaling2 * (absolute_diff/(12*scs_scaling) - 10);
LOG_I(NR_RRC,"SIB1 freq: absoluteFrequencySSB %ld, absoluteFrequencyPointA %ld\n",
*configuration->scc->downlinkConfigCommon->frequencyInfoDL->absoluteFrequencySSB,
configuration->scc->downlinkConfigCommon->frequencyInfoDL->absoluteFrequencyPointA);
LOG_I(NR_RRC,"SIB1 freq: absolute_diff %d, %d*(absolute_diff/(12*%d) - 10) %d\n",
absolute_diff,scs_scaling2,scs_scaling,(int)sib1->servingCellConfigCommon->downlinkConfigCommon.frequencyInfoDL.offsetToPointA);
for(int i = 0; i< configuration->scc->downlinkConfigCommon->frequencyInfoDL->scs_SpecificCarrierList.list.count; i++) { for(int i = 0; i< configuration->scc->downlinkConfigCommon->frequencyInfoDL->scs_SpecificCarrierList.list.count; i++) {
ASN_SEQUENCE_ADD(&sib1->servingCellConfigCommon->downlinkConfigCommon.frequencyInfoDL.scs_SpecificCarrierList.list,configuration->scc->downlinkConfigCommon->frequencyInfoDL->scs_SpecificCarrierList.list.array[i]); ASN_SEQUENCE_ADD(&sib1->servingCellConfigCommon->downlinkConfigCommon.frequencyInfoDL.scs_SpecificCarrierList.list,configuration->scc->downlinkConfigCommon->frequencyInfoDL->scs_SpecificCarrierList.list.array[i]);
} }
......
Active_gNBs = ( "gNB-Eurecom-DU"); Active_gNBs = ( "gNB-Eurecom-DU");
# Asn1_verbosity, choice in: none, info, annoying # Asn1_verbosity, choice in: none, info, annoying
Asn1_verbosity = "none"; Asn1_verbosity = "none";
Num_Threads_PUSCH = 8;
gNBs = gNBs =
( (
...@@ -13,10 +12,26 @@ gNBs = ...@@ -13,10 +12,26 @@ gNBs =
gNB_name = "gNB-Eurecom-DU"; gNB_name = "gNB-Eurecom-DU";
// Tracking area code, 0x0000 and 0xfffe are reserved values
// Tracking area code, 0x0000 and 0xfffe are reserved values // Tracking area code, 0x0000 and 0xfffe are reserved values
tracking_area_code = 1; tracking_area_code = 1;
plmn_list = ({
mcc = 208;
mnc = 99;
mnc_length = 2;
snssaiList = (
{
sst = 1;
sd = 0x010203; // 0 false, else true
},
{
sst = 1;
sd = 0x1; #112233; // 0 false, else true
}
);
});
plmn_list = ({mcc = 208; mnc = 93; mnc_length = 2;});
nr_cellid = 12345678L nr_cellid = 12345678L
...@@ -29,6 +44,14 @@ gNBs = ...@@ -29,6 +44,14 @@ gNBs =
pusch_AntennaPorts = 1; pusch_AntennaPorts = 1;
sib1_tda = 0; sib1_tda = 0;
pdcch_ConfigSIB1 = (
{
controlResourceSetZero = 12;
searchSpaceZero = 0;
}
);
servingCellConfigCommon = ( servingCellConfigCommon = (
{ {
#spCellConfigCommon #spCellConfigCommon
...@@ -38,10 +61,10 @@ gNBs = ...@@ -38,10 +61,10 @@ gNBs =
# downlinkConfigCommon # downlinkConfigCommon
#frequencyInfoDL #frequencyInfoDL
# this is 3600 MHz + 43 PRBs@30kHz SCS (same as initial BWP) # this is 3600 MHz + 43 PRBs@30kHz SCS (same as initial BWP)
absoluteFrequencySSB = 641032; absoluteFrequencySSB = 641280;
dl_frequencyBand = 78; dl_frequencyBand = 78;
# this is 3600 MHz # this is 3600 MHz
dl_absoluteFrequencyPointA = 640000; dl_absoluteFrequencyPointA = 640008;
#scs-SpecificCarrierList #scs-SpecificCarrierList
dl_offstToCarrier = 0; dl_offstToCarrier = 0;
# subcarrierSpacing # subcarrierSpacing
...@@ -50,8 +73,8 @@ gNBs = ...@@ -50,8 +73,8 @@ gNBs =
dl_carrierBandwidth = 106; dl_carrierBandwidth = 106;
#initialDownlinkBWP #initialDownlinkBWP
#genericParameters #genericParameters
# this is RBstart=41,L=24 (275*(L-1))+RBstart # this is RBstart=27,L=48 (275*(L-1))+RBstart
initialDLBWPlocationAndBandwidth = 6366; initialDLBWPlocationAndBandwidth = 12952;
# subcarrierSpacing # subcarrierSpacing
# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 # 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120
initialDLBWPsubcarrierSpacing = 1; initialDLBWPsubcarrierSpacing = 1;
...@@ -65,12 +88,12 @@ gNBs = ...@@ -65,12 +88,12 @@ gNBs =
#0=typeA,1=typeB #0=typeA,1=typeB
initialDLBWPmappingType_0 = 0; initialDLBWPmappingType_0 = 0;
#this is SS=1,L=13 #this is SS=1,L=13
initialDLBWPstartSymbolAndLength_0 = 40; initialDLBWPstartSymbolAndLength_0 = 53;
initialDLBWPk0_1 = 0; initialDLBWPk0_1 = 0;
initialDLBWPmappingType_1 = 0; initialDLBWPmappingType_1 = 0;
#this is SS=2,L=12 #this is SS=2,L=12
initialDLBWPstartSymbolAndLength_1 = 53; initialDLBWPstartSymbolAndLength_1 = 81;
initialDLBWPk0_2 = 0; initialDLBWPk0_2 = 0;
initialDLBWPmappingType_2 = 0; initialDLBWPmappingType_2 = 0;
...@@ -94,7 +117,7 @@ gNBs = ...@@ -94,7 +117,7 @@ gNBs =
pMax = 20; pMax = 20;
#initialUplinkBWP #initialUplinkBWP
#genericParameters #genericParameters
initialULBWPlocationAndBandwidth = 6366; initialULBWPlocationAndBandwidth = 12952;
# subcarrierSpacing # subcarrierSpacing
# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 # 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120
initialULBWPsubcarrierSpacing = 1; initialULBWPsubcarrierSpacing = 1;
...@@ -117,7 +140,7 @@ gNBs = ...@@ -117,7 +140,7 @@ gNBs =
ra_ResponseWindow = 4; ra_ResponseWindow = 4;
#ssb_perRACH_OccasionAndCB_PreamblesPerSSB_PR #ssb_perRACH_OccasionAndCB_PreamblesPerSSB_PR
#1=oneeighth,2=onefourth,3=half,4=one,5=two,6=four,7=eight,8=sixteen #1=oneeighth,2=onefourth,3=half,4=one,5=two,6=four,7=eight,8=sixteen
ssb_perRACH_OccasionAndCB_PreamblesPerSSB_PR = 4; ssb_perRACH_OccasionAndCB_PreamblesPerSSB_PR = 3;
#oneHalf (0..15) 4,8,12,16,...60,64 #oneHalf (0..15) 4,8,12,16,...60,64
ssb_perRACH_OccasionAndCB_PreamblesPerSSB = 15; ssb_perRACH_OccasionAndCB_PreamblesPerSSB = 15;
#ra_ContentionResolutionTimer #ra_ContentionResolutionTimer
...@@ -138,8 +161,8 @@ gNBs = ...@@ -138,8 +161,8 @@ gNBs =
# pusch-ConfigCommon (up to 16 elements) # pusch-ConfigCommon (up to 16 elements)
initialULBWPk2_0 = 6; initialULBWPk2_0 = 6;
initialULBWPmappingType_0 = 1 initialULBWPmappingType_0 = 1
# this is SS=0 L=11 # this is SS=2 L=12
initialULBWPstartSymbolAndLength_0 = 55; initialULBWPstartSymbolAndLength_0 = 53;
initialULBWPk2_1 = 6; initialULBWPk2_1 = 6;
initialULBWPmappingType_1 = 1; initialULBWPmappingType_1 = 1;
...@@ -204,25 +227,6 @@ gNBs = ...@@ -204,25 +227,6 @@ gNBs =
SCTP_INSTREAMS = 2; SCTP_INSTREAMS = 2;
SCTP_OUTSTREAMS = 2; SCTP_OUTSTREAMS = 2;
}; };
////////// MME parameters:
mme_ip_address = ( { ipv4 = "192.168.12.26";
ipv6 = "192:168:30::17";
active = "yes";
preference = "ipv4";
}
);
NETWORK_INTERFACES :
{
GNB_INTERFACE_NAME_FOR_S1_MME = "eth0";
GNB_IPV4_ADDRESS_FOR_S1_MME = "192.168.12.111/24";
GNB_INTERFACE_NAME_FOR_S1U = "eth0";
GNB_IPV4_ADDRESS_FOR_S1U = "192.168.12.111/24";
GNB_PORT_FOR_S1U = 2152; # Spec 2152
};
} }
); );
...@@ -232,12 +236,13 @@ MACRLCs = ( ...@@ -232,12 +236,13 @@ MACRLCs = (
tr_s_preference = "local_L1"; tr_s_preference = "local_L1";
tr_n_preference = "f1"; tr_n_preference = "f1";
local_n_if_name = "lo"; local_n_if_name = "lo";
remote_n_address = "127.0.0.4";
local_n_address = "127.0.0.3"; local_n_address = "127.0.0.3";
local_n_portc = 500; remote_n_address = "127.0.0.4";
remote_n_portc = 501; local_n_portc = 601;
local_n_portd = 600; local_n_portd = 2152;
remote_n_portd = 601; remote_n_portc = 600;
remote_n_portd = 2152;
} }
); );
...@@ -245,6 +250,7 @@ L1s = ( ...@@ -245,6 +250,7 @@ L1s = (
{ {
num_cc = 1; num_cc = 1;
tr_n_preference = "local_mac"; tr_n_preference = "local_mac";
pusch_proc_threads = 2;
} }
); );
...@@ -300,5 +306,7 @@ THREAD_STRUCT = ( ...@@ -300,5 +306,7 @@ THREAD_STRUCT = (
rrc_log_verbosity ="medium"; rrc_log_verbosity ="medium";
f1ap_log_level ="debug"; f1ap_log_level ="debug";
f1ap_log_verbosity ="medium"; f1ap_log_verbosity ="medium";
ngap_log_level ="debug";
ngap_log_verbosity ="medium";
}; };
uicc0 = {
imsi = "2089900007487";
key = "fec86ba6eb707ed08905757b1bb44b8f";
opc= "C42449363BBAD02B66D16BC975D77CC1";
dnn= "oai";
nssai_sst=1;
nssai_sd=1;
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment