From 67bf363d6063488ed521b5f99e9dce82899b334f Mon Sep 17 00:00:00 2001 From: Florian Kaltenberger Date: Mon, 12 Nov 2018 21:56:51 +0100 Subject: [PATCH] making nr_pbchsim compile again --- openair1/PHY/INIT/nr_init.c | 67 ++++++++++++++++++++++- openair1/PHY/INIT/phy_init.h | 1 + openair1/SIMULATION/NR_PHY/pbchsim.c | 1 + targets/RT/USER/nr-gnb.c | 81 ---------------------------- 4 files changed, 68 insertions(+), 82 deletions(-) diff --git a/openair1/PHY/INIT/nr_init.c b/openair1/PHY/INIT/nr_init.c index 17029ff2a8..d41289f7dc 100644 --- a/openair1/PHY/INIT/nr_init.c +++ b/openair1/PHY/INIT/nr_init.c @@ -38,7 +38,6 @@ extern uint32_t from_earfcn(int eutra_bandP,uint32_t dl_earfcn); extern int32_t get_uldl_offset(int eutra_bandP); -extern void init_nr_transport(PHY_VARS_gNB *gNB); int l1_north_init_gNB() { @@ -480,3 +479,69 @@ void nr_phy_config_request(NR_PHY_Config_t *phy_config) } + +void init_nr_transport(PHY_VARS_gNB *gNB) { + + int i; + int j; + NR_DL_FRAME_PARMS *fp = &gNB->frame_parms; + nfapi_nr_config_request_t *cfg = &gNB->gNB_config; + + LOG_I(PHY, "Initialise nr transport\n"); + + for (i=0; idlsch[i][j] = new_gNB_dlsch(1,16,NSOFT,0,fp,cfg); + if (!gNB->dlsch[i][j]) { + LOG_E(PHY,"Can't get gNB dlsch structures for UE %d \n", i); + exit(-1); + } else { + gNB->dlsch[i][j]->rnti=0; + LOG_D(PHY,"dlsch[%d][%d] => %p rnti:%d\n",i,j,gNB->dlsch[i][j], gNB->dlsch[i][j]->rnti); + } + } + + //LOG_I(PHY,"Allocating Transport Channel Buffer for ULSCH, UE %d\n",i); + //gNB->ulsch[1+i] = new_gNB_ulsch(MAX_TURBO_ITERATIONS,fp->N_RB_UL, 0); + + /*if (!gNB->ulsch[1+i]) { + LOG_E(PHY,"Can't get gNB ulsch structures\n"); + exit(-1); + }*/ + + // this is the transmission mode for the signalling channels + // this will be overwritten with the real transmission mode by the RRC once the UE is connected + //gNB->transmission_mode[i] = fp->nb_antenna_ports_gNB==1 ? 1 : 2; + } + // ULSCH for RA + //gNB->ulsch[0] = new_gNB_ulsch(MAX_TURBO_ITERATIONS, fp->N_RB_UL, 0); + + /*if (!gNB->ulsch[0]) { + LOG_E(PHY,"Can't get gNB ulsch structures\n"); + exit(-1); + }*/ + gNB->dlsch_SI = new_gNB_dlsch(1,8,NSOFT, 0, fp, cfg); + LOG_D(PHY,"gNB %d.%d : SI %p\n",gNB->Mod_id,gNB->CC_id,gNB->dlsch_SI); + gNB->dlsch_ra = new_gNB_dlsch(1,8,NSOFT, 0, fp, cfg); + LOG_D(PHY,"gNB %d.%d : RA %p\n",gNB->Mod_id,gNB->CC_id,gNB->dlsch_ra); + gNB->dlsch_MCH = new_gNB_dlsch(1,8,NSOFT, 0, fp, cfg); + LOG_D(PHY,"gNB %d.%d : MCH %p\n",gNB->Mod_id,gNB->CC_id,gNB->dlsch_MCH); + + + gNB->rx_total_gain_dB=130; + + for(i=0; imu_mimo_mode[i].dl_pow_off = 2; + + gNB->check_for_total_transmissions = 0; + + gNB->check_for_MUMIMO_transmissions = 0; + + gNB->FULL_MUMIMO_transmissions = 0; + + gNB->check_for_SUMIMO_transmissions = 0; + + //fp->pucch_config_common.deltaPUCCH_Shift = 1; + +} diff --git a/openair1/PHY/INIT/phy_init.h b/openair1/PHY/INIT/phy_init.h index 8e579c69be..fdb7fab1b7 100644 --- a/openair1/PHY/INIT/phy_init.h +++ b/openair1/PHY/INIT/phy_init.h @@ -385,6 +385,7 @@ void nr_phy_config_request(NR_PHY_Config_t *gNB); void nr_phy_config_request_sim(PHY_VARS_gNB *gNB,int N_RB_DL,int N_RB_UL,int mu); void phy_free_nr_gNB(PHY_VARS_gNB *gNB); int l1_north_init_gNB(void); +void init_nr_transport(PHY_VARS_gNB *gNB); void init_dfts(void); diff --git a/openair1/SIMULATION/NR_PHY/pbchsim.c b/openair1/SIMULATION/NR_PHY/pbchsim.c index 7bd56ef8e5..73315b8a09 100644 --- a/openair1/SIMULATION/NR_PHY/pbchsim.c +++ b/openair1/SIMULATION/NR_PHY/pbchsim.c @@ -37,6 +37,7 @@ #include "PHY/defs_nr_UE.h" #include "PHY/defs_gNB.h" #include "PHY/NR_REFSIG/refsig_defs_ue.h" +#include "PHY/NR_REFSIG/nr_mod_table.h" #include "PHY/MODULATION/modulation_eNB.h" #include "PHY/MODULATION/modulation_UE.h" #include "PHY/INIT/phy_init.h" diff --git a/targets/RT/USER/nr-gnb.c b/targets/RT/USER/nr-gnb.c index 77fe5c8c33..2ec01d521f 100644 --- a/targets/RT/USER/nr-gnb.c +++ b/targets/RT/USER/nr-gnb.c @@ -725,87 +725,6 @@ void print_opp_meas(void) { } } -void free_transport(PHY_VARS_gNB *gNB) -{ - int i; - int j; - - for (i=0; idlsch[i][j]); - - //LOG_I(PHY, "Freeing Transport Channel Buffer for ULSCH, UE %d\n",i); - //free_gNB_ulsch(gNB->ulsch[1+i]); - } - //free_gNB_ulsch(gNB->ulsch[0]); -} - - -void init_nr_transport(PHY_VARS_gNB *gNB) { - - int i; - int j; - NR_DL_FRAME_PARMS *fp = &gNB->frame_parms; - nfapi_nr_config_request_t *cfg = &gNB->gNB_config; - - LOG_I(PHY, "Initialise nr transport\n"); - - for (i=0; idlsch[i][j] = new_gNB_dlsch(1,16,NSOFT,0,fp,cfg); - if (!gNB->dlsch[i][j]) { - LOG_E(PHY,"Can't get gNB dlsch structures for UE %d \n", i); - exit(-1); - } else { - gNB->dlsch[i][j]->rnti=0; - LOG_D(PHY,"dlsch[%d][%d] => %p rnti:%d\n",i,j,gNB->dlsch[i][j], gNB->dlsch[i][j]->rnti); - } - } - - //LOG_I(PHY,"Allocating Transport Channel Buffer for ULSCH, UE %d\n",i); - //gNB->ulsch[1+i] = new_gNB_ulsch(MAX_TURBO_ITERATIONS,fp->N_RB_UL, 0); - - /*if (!gNB->ulsch[1+i]) { - LOG_E(PHY,"Can't get gNB ulsch structures\n"); - exit(-1); - }*/ - - // this is the transmission mode for the signalling channels - // this will be overwritten with the real transmission mode by the RRC once the UE is connected - //gNB->transmission_mode[i] = fp->nb_antenna_ports_gNB==1 ? 1 : 2; - } - // ULSCH for RA - //gNB->ulsch[0] = new_gNB_ulsch(MAX_TURBO_ITERATIONS, fp->N_RB_UL, 0); - - /*if (!gNB->ulsch[0]) { - LOG_E(PHY,"Can't get gNB ulsch structures\n"); - exit(-1); - }*/ - gNB->dlsch_SI = new_gNB_dlsch(1,8,NSOFT, 0, fp, cfg); - LOG_D(PHY,"gNB %d.%d : SI %p\n",gNB->Mod_id,gNB->CC_id,gNB->dlsch_SI); - gNB->dlsch_ra = new_gNB_dlsch(1,8,NSOFT, 0, fp, cfg); - LOG_D(PHY,"gNB %d.%d : RA %p\n",gNB->Mod_id,gNB->CC_id,gNB->dlsch_ra); - gNB->dlsch_MCH = new_gNB_dlsch(1,8,NSOFT, 0, fp, cfg); - LOG_D(PHY,"gNB %d.%d : MCH %p\n",gNB->Mod_id,gNB->CC_id,gNB->dlsch_MCH); - - - gNB->rx_total_gain_dB=130; - - for(i=0; imu_mimo_mode[i].dl_pow_off = 2; - - gNB->check_for_total_transmissions = 0; - - gNB->check_for_MUMIMO_transmissions = 0; - - gNB->FULL_MUMIMO_transmissions = 0; - - gNB->check_for_SUMIMO_transmissions = 0; - - //fp->pucch_config_common.deltaPUCCH_Shift = 1; - -} /// eNB kept in function name for nffapi calls, TO FIX void init_eNB_afterRU(void) {