Commit c0e77a0f authored by Florian Kaltenberger's avatar Florian Kaltenberger

Merge branch 'integration_develop-nr_2019w28' into 'develop-nr'

Integration develop nr 2019w28

See merge request oai/openairinterface5g!633
parents 1ce0700e 60d53688
......@@ -1302,7 +1302,7 @@ set(PHY_SRC_UE
${PHY_POLARSRC}
${PHY_SMALLBLOCKSRC}
${PHY_LDPCSRC}
${OPENAIR1_DIR}/PHY/NR_TRANSPORT/pucch_rx.c # added by prasanth
${OPENAIR1_DIR}/PHY/NR_TRANSPORT/pucch_rx.c
)
set(PHY_NR_UE_SRC
......
......@@ -1160,6 +1160,29 @@
<nruns>3</nruns>
</testCase>
<testCase id="015109">
<class>execution</class>
<desc>nr_nr_pucchsim Test cases. (Test1: Format 0 ACK miss 106 PRB),
(Test2: Format 1 ACK miss 106 PRB),
(Test3: Format 1 ACK miss 273 PRB),
(Test4: Format 1 NACKtoACK 106 PRB)</desc>
<pre_compile_prog></pre_compile_prog>
<compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</compile_prog>
<compile_prog_args> --phy_simulators -c </compile_prog_args>
<pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</pre_exec>
<pre_exec_args></pre_exec_args>
<main_exec> $OPENAIR_DIR/targets/bin/nr_pucchsim.Rel15</main_exec>
<main_exec_args>-R 106 -i 1 -P 0 -b 1 -s3 -n100
-R 106 -i 14 -P 1 -b 1 -s-6 -n 100
-R 273 -i 14 -P 1 -b 1 -s-6 -n100
-R 106 -i 14 -P 1 -b 1 -s-6 -T 0.001 -n1000</main_exec_args>
<tags>nr_pucchsim.test1 nr_pucchsim.test2 nr_pucchsim.test3 nr_pucchsim.test4</tags>
<search_expr_true>PUCCH test OK</search_expr_true>
<search_expr_false>segmentation fault|assertion|exiting|fatal</search_expr_false>
<nruns>3</nruns>
</testCase>
<testCase id="015110">
<class>execution</class>
<desc>dlsim_tm4 test cases (Test 1: 10 MHz, R2.FDD (MCS 5), EVA5, -1dB),
......
......@@ -1076,10 +1076,18 @@ void fill_rf_config(RU_t *ru, char *rf_config_file) {
cfg->rx_bw = 40e6;
}
} else if(N_RB == 106) {
cfg->sample_rate=61.44e6;
cfg->samples_per_frame = 614400;
cfg->tx_bw = 20e6;
cfg->rx_bw = 20e6;
if (fp->threequarter_fs) {
cfg->sample_rate=46.08e6;
cfg->samples_per_frame = 460800;
cfg->tx_bw = 20e6;
cfg->rx_bw = 20e6;
}
else {
cfg->sample_rate=61.44e6;
cfg->samples_per_frame = 614400;
cfg->tx_bw = 20e6;
cfg->rx_bw = 20e6;
}
} else {
AssertFatal(0==1,"N_RB %d not yet supported for numerology %d\n",N_RB,mu);
}
......@@ -1208,16 +1216,17 @@ static void *ru_thread_tx( void *param ) {
int i = 0;
int ret;
if(ru->if_south == LOCAL_RF)
{
//uhd_set_thread_prio();
LOG_I(PHY,"set ru_thread_tx uhd priority");
}
wait_on_condition(&proc->mutex_FH1,&proc->cond_FH1,&proc->instance_cnt_FH1,"ru_thread_tx");
printf( "ru_thread_tx ready\n");
if(ru->rfdevice.uhd_set_thread_priority != NULL)
{
LOG_I(PHY,"set ru_thread_tx uhd priority \n");
ru->rfdevice.uhd_set_thread_priority();
}
while (!oai_exit) {
if (oai_exit) break;
......
......@@ -631,8 +631,9 @@ void *UE_thread(void *arg) {
processingData_t *curMsg=(processingData_t *)NotifiedFifoData(msgToPush);
curMsg->UE=UE;
// update thread index for received subframe
curMsg->proc.nr_tti_rx= slot_nr;
curMsg->UE->current_thread_id[slot_nr] = thread_idx;
curMsg->proc.CC_id = 0;
curMsg->proc.nr_tti_rx= slot_nr;
curMsg->proc.subframe_rx=table_sf_slot[slot_nr];
curMsg->proc.nr_tti_tx = (absolute_slot + DURATION_RX_TO_TX) % nb_slot_frame;
curMsg->proc.subframe_tx=curMsg->proc.nr_tti_rx;
......
......@@ -542,8 +542,27 @@ void init_openair0(void) {
for (card=0; card<MAX_CARDS; card++) {
openair0_cfg[card].configFilename = NULL;
openair0_cfg[card].threequarter_fs = frame_parms[0]->threequarter_fs;
if(frame_parms[0]->N_RB_DL == 106) {
if(frame_parms[0]->N_RB_DL == 217) {
if (numerology==1) {
if (frame_parms[0]->threequarter_fs) {
openair0_cfg[card].sample_rate=92.16e6;
openair0_cfg[card].samples_per_frame = 921600;
openair0_cfg[card].tx_bw = 40e6;
openair0_cfg[card].rx_bw = 40e6;
}
else {
openair0_cfg[card].sample_rate=122.88e6;
openair0_cfg[card].samples_per_frame = 1228800;
openair0_cfg[card].tx_bw = 40e6;
openair0_cfg[card].rx_bw = 40e6;
}
} else {
LOG_E(PHY,"Unsupported numerology!\n");
exit(-1);
}
}else if(frame_parms[0]->N_RB_DL == 106) {
if (numerology==0) {
if (frame_parms[0]->threequarter_fs) {
openair0_cfg[card].sample_rate=23.04e6;
......@@ -556,14 +575,22 @@ void init_openair0(void) {
openair0_cfg[card].tx_bw = 10e6;
openair0_cfg[card].rx_bw = 10e6;
}
} else if (numerology==1) {
openair0_cfg[card].sample_rate=61.44e6;
openair0_cfg[card].samples_per_frame = 307200;
openair0_cfg[card].tx_bw = 20e6;
openair0_cfg[card].rx_bw = 20e6;
} else if (numerology==1) {
if (frame_parms[0]->threequarter_fs) {
openair0_cfg[card].sample_rate=46.08e6;
openair0_cfg[card].samples_per_frame = 480800;
openair0_cfg[card].tx_bw = 20e6;
openair0_cfg[card].rx_bw = 20e6;
}
else {
openair0_cfg[card].sample_rate=61.44e6;
openair0_cfg[card].samples_per_frame = 614400;
openair0_cfg[card].tx_bw = 20e6;
openair0_cfg[card].rx_bw = 20e6;
}
} else if (numerology==2) {
openair0_cfg[card].sample_rate=122.88e6;
openair0_cfg[card].samples_per_frame = 307200;
openair0_cfg[card].samples_per_frame = 1228800;
openair0_cfg[card].tx_bw = 40e6;
openair0_cfg[card].rx_bw = 40e6;
} else {
......@@ -586,6 +613,10 @@ void init_openair0(void) {
openair0_cfg[card].tx_bw = 1.5e6;
openair0_cfg[card].rx_bw = 1.5e6;
}
else {
LOG_E(PHY,"Unknown NB_RB %d!\n",frame_parms[0]->N_RB_DL);
exit(-1);
}
if (frame_parms[0]->frame_type==TDD)
openair0_cfg[card].duplex_mode = duplex_mode_TDD;
......@@ -698,6 +729,7 @@ int main( int argc, char **argv ) {
frame_parms[CC_id]->nb_antennas_tx = nb_antenna_tx;
frame_parms[CC_id]->nb_antennas_rx = nb_antenna_rx;
frame_parms[CC_id]->nb_antenna_ports_eNB = 1; //initial value overwritten by initial sync later
frame_parms[CC_id]->threequarter_fs = threequarter_fs;
LOG_I(PHY,"Set nb_rx_antenna %d , nb_tx_antenna %d \n",frame_parms[CC_id]->nb_antennas_rx, frame_parms[CC_id]->nb_antennas_tx);
get_band(downlink_frequency[CC_id][0], &frame_parms[CC_id]->eutra_band, &uplink_frequency_offset[CC_id][0], &frame_parms[CC_id]->frame_type);
}
......
......@@ -89,6 +89,10 @@ int nr_slot_fep(PHY_VARS_NR_UE *ue,
dft = dft2048;
break;
case 3072:
dft = dft3072;
break;
case 4096:
dft = dft4096;
break;
......@@ -98,8 +102,8 @@ int nr_slot_fep(PHY_VARS_NR_UE *ue,
break;
default:
dft = dft512;
break;
printf("unsupported ofdm symbol size \n");
assert(0);
}
if (no_prefix) {
......
......@@ -239,7 +239,7 @@ int nr_generate_pbch(NR_gNB_PBCH *pbch,
uint8_t nushift;
uint32_t unscrambling_mask;
uint64_t a_reversed=0;
LOG_I(PHY, "PBCH generation started\n");
LOG_D(PHY, "PBCH generation started\n");
///Payload generation
memset((void *)pbch, 0, sizeof(NR_gNB_PBCH));
pbch->pbch_a=0;
......@@ -267,7 +267,7 @@ int nr_generate_pbch(NR_gNB_PBCH *pbch,
else
pbch->pbch_a |= ((config->sch_config.ssb_subcarrier_offset.value>>4)&1)<<29; //MSB of k_SSB (bit index 4)
LOG_I(PHY,"After extra byte: pbch_a = 0x%08x\n",pbch->pbch_a);
LOG_D(PHY,"After extra byte: pbch_a = 0x%08x\n",pbch->pbch_a);
// Payload interleaving
......
This diff is collapsed.
......@@ -103,8 +103,9 @@ uint16_t nr_pbch_extract(int **rxdataF,
j++;
}
rx_offset=(rx_offset+1)&(frame_parms->ofdm_symbol_size-1);
}
//rx_offset=(rx_offset+1)&(frame_parms->ofdm_symbol_size-1);
rx_offset = (rx_offset >= frame_parms->ofdm_symbol_size) ? (rx_offset - frame_parms->ofdm_symbol_size + 1) : (rx_offset+1);
}
rxF_ext+=9;
} else { //symbol 2
......@@ -125,11 +126,12 @@ uint16_t nr_pbch_extract(int **rxdataF,
j++;
}
rx_offset=(rx_offset+1)&(frame_parms->ofdm_symbol_size-1);
//rx_offset=(rx_offset+1)&(frame_parms->ofdm_symbol_size-1);
rx_offset = (rx_offset >= frame_parms->ofdm_symbol_size) ? (rx_offset - frame_parms->ofdm_symbol_size + 1) : (rx_offset+1);
}
rxF_ext+=9;
} else rx_offset = (rx_offset+12)&(frame_parms->ofdm_symbol_size-1);
} else rx_offset = (rx_offset >= frame_parms->ofdm_symbol_size) ? (rx_offset - frame_parms->ofdm_symbol_size + 12) : (rx_offset+12);//rx_offset = (rx_offset+12)&(frame_parms->ofdm_symbol_size-1);
}
}
......
......@@ -89,6 +89,10 @@ void *get_idft(int ofdm_symbol_size)
idft = idft2048;
break;
case 3072:
idft = idft3072;
break;
case 4096:
idft = idft4096;
break;
......
This diff is collapsed.
......@@ -42,10 +42,25 @@
#include "T.h"
#define ONE_OVER_SQRT2 23170 // 32767/sqrt(2) = 23170 (ONE_OVER_SQRT2)
void nr_decode_pucch1( int32_t **rxdataF,
pucch_GroupHopping_t pucch_GroupHopping,
uint32_t n_id, // hoppingID higher layer parameter
uint64_t *payload,
NR_DL_FRAME_PARMS *frame_parms,
int16_t amp,
int nr_tti_tx,
uint8_t m0,
uint8_t nrofSymbols,
uint8_t startingSymbolIndex,
uint16_t startingPRB,
uint16_t startingPRB_intraSlotHopping,
uint8_t timeDomainOCC,
uint8_t nr_bit);
void nr_decode_pucch0( int32_t **rxdataF,
pucch_GroupHopping_t PUCCH_GroupHopping,
uint32_t n_id, //PHY_VARS_gNB *gNB, generally rxdataf is in gNB->common_vars
uint8_t *payload,
uint64_t *payload,
NR_DL_FRAME_PARMS *frame_parms,
int16_t amp,
int nr_tti_tx,
......@@ -74,7 +89,7 @@ void nr_generate_pucch0(PHY_VARS_NR_UE *ue,
int16_t amp,
int nr_tti_tx,
uint8_t m0,
uint8_t mcs,
uint8_t mcs,
uint8_t nrofSymbols,
uint8_t startingSymbolIndex,
uint16_t startingPRB);
......
This diff is collapsed.
......@@ -583,6 +583,9 @@ int8_t nr_ue_decode_mib(
mac->type0_pdcch_ss_n_c = n_c;
// fill in the elements in config request inside P5 message
mac->phy_config.Mod_id = module_id;
mac->phy_config.CC_id = cc_id;
mac->phy_config.config_req.pbch_config.system_frame_number = frame; // after calculation
mac->phy_config.config_req.pbch_config.subcarrier_spacing_common = mac->mib->subCarrierSpacingCommon;
mac->phy_config.config_req.pbch_config.ssb_subcarrier_offset = ssb_subcarrier_offset; // after calculation
......
......@@ -1124,6 +1124,7 @@ int device_init(openair0_device *device, openair0_config_t *openair0_cfg) {
device->trx_set_gains_func = trx_brf_set_gains;
device->openair0_cfg = openair0_cfg;
device->priv = (void *)brf;
device->uhd_set_thread_priority = NULL;
calibrate_rf(device);
......
......@@ -109,7 +109,6 @@ int load_lib(openair0_device *device, openair0_config_t *openair0_cfg, eth_param
else
libname=OAI_RF_LIBNAME;
shlib_fdesc[0].fname="device_init";
//shlib_fdesc[1].fname="uhd_set_thread_priority";
} else {
libname=OAI_TP_LIBNAME;
shlib_fdesc[0].fname="transport_init";
......@@ -119,33 +118,12 @@ int load_lib(openair0_device *device, openair0_config_t *openair0_cfg, eth_param
LOG_E(HW,"Library %s couldn't be loaded\n",libname);
} else {
ret=((devfunc_t)shlib_fdesc[0].fptr)(device,openair0_cfg,cfg);
//uhd_set_thread_priority_fun = (set_prio_func_t)shlib_fdesc[1].fptr;
}
return ret;
}
/*
void uhd_set_thread_prio(void) {
loader_shlibfunc_t shlib_fdesc[1];
int ret = 0;
char *libname;
if (getenv("RFSIMULATOR") != NULL)
libname="rfsimulator";
else
libname=OAI_RF_LIBNAME;
//shlib_fdesc[0].fname="uhd_set_thread_priority";
ret=load_module_shlib(libname,shlib_fdesc,1,NULL);
if (ret < 0) {
LOG_E(HW,"Library %s couldn't be loaded\n",libname);
} else {
//(set_prio_func_t)shlib_fdesc[0].fptr();
}
return ret;
}
*/
int openair0_device_load(openair0_device *device, openair0_config_t *openair0_cfg) {
......
......@@ -387,6 +387,10 @@ struct openair0_device_t {
* \param arg pointer to capabilities or configuration
*/
void (*configure_rru)(int idx, void *arg);
/*! \brief set UHD thread priority
*/
void (*uhd_set_thread_priority)(void);
};
/* type of device init function, implemented in shared lib */
......@@ -445,9 +449,7 @@ int openair0_set_rx_frequencies(openair0_device *device, openair0_config_t *open
#define gettid() syscall(__NR_gettid)
/*@}*/
void uhd_set_thread_prio(void);
typedef void(*set_prio_func_t)(void);
//set_prio_func_t uhd_set_thread_priority_fun;
#ifdef __cplusplus
}
......
......@@ -401,6 +401,7 @@ int transport_init(openair0_device *device, openair0_config_t *openair0_cfg, eth
device->trx_stop_func = trx_eth_stop;
device->trx_set_freq_func = trx_eth_set_freq;
device->trx_set_gains_func = trx_eth_set_gains;
device->uhd_set_thread_priority = NULL;
if (eth->flags == ETH_RAW_MODE) {
device->trx_write_func = trx_eth_write_raw;
......
......@@ -772,6 +772,7 @@ int device_init(openair0_device *device, openair0_config_t *openair0_cfg) {
device->trx_set_gains_func = trx_exmimo_set_gains;
device->openair0_cfg = openair0_cfg;
device->priv = (void *)exm;
device->uhd_set_thread_priority = NULL;
printf("EXMIMO2: Getting addresses for memory-mapped DMA\n");
......
......@@ -405,6 +405,7 @@ int device_init(openair0_device *device, openair0_config_t *openair0_cfg){
device->trx_stop_func = trx_lms_stop;
device->trx_set_freq_func = trx_lms_set_freq;
device->trx_set_gains_func = trx_lms_set_gains;
device->uhd_set_thread_priority = NULL;
device->openair0_cfg = openair0_cfg;
......
......@@ -706,6 +706,7 @@ int openair0_dev_init_sodera(openair0_device* device, openair0_config_t *openair
device->trx_stop_func = trx_sodera_stop;
device->trx_set_freq_func = trx_sodera_set_freq;
device->trx_set_gains_func = trx_sodera_set_gains;
device->uhd_set_thread_priority = NULL;
s->sample_rate = openair0_cfg[0].sample_rate;
s->channelscount = openair0_cfg[0].rx_num_channels;
......
......@@ -591,7 +591,15 @@ static int trx_usrp_read(openair0_device *device, openair0_timestamp *ptimestamp
for (int j=0; j<nsamps2; j++) {
#if defined(__x86_64__) || defined(__i386__)
#ifdef __AVX2__
((__m256i *)buff[i])[j] = _mm256_srai_epi16(buff_tmp[i][j],4);
// FK: in some cases the buffer might not be 32 byte aligned, so we cannot use avx2
if ((((uintptr_t) buff[i])&0x1F)==0) {
((__m256i *)buff[i])[j] = _mm256_srai_epi16(buff_tmp[i][j],4);
}
else {
((__m128i *)buff[i])[2*j] = _mm_srai_epi16(((__m128i*)buff_tmp[i])[j],4);
((__m128i *)buff[i])[2*j+1] = _mm_srai_epi16(((__m128i*)buff_tmp[i])[2*j+1],4);
}
#else
((__m128i *)buff[i])[j] = _mm_srai_epi16(buff_tmp[i][j],4);
#endif
......@@ -845,6 +853,10 @@ void set_rx_gain_offset(openair0_config_t *openair0_cfg, int chain_index,int bw_
if (bw_gain_adjust==1) {
switch ((int)openair0_cfg[0].sample_rate) {
case 46080000:
break;
case 30720000:
break;
......@@ -870,7 +882,7 @@ void set_rx_gain_offset(openair0_config_t *openair0_cfg, int chain_index,int bw_
default:
LOG_E(PHY,"unknown sampling rate %d\n",(int)openair0_cfg[0].sample_rate);
exit(-1);
//exit(-1);
break;
}
}
......@@ -907,6 +919,12 @@ int trx_usrp_reset_stats(openair0_device *device) {
return(0);
}
/*! \brief Set uhd priority
*/
static void uhd_set_thread_priority(void) {
uhd::set_thread_priority_safe(1.0);
}
#if defined(USRP_REC_PLAY)
extern "C" {
/*! \brief Initializer for USRP record/playback config
......@@ -1044,6 +1062,7 @@ extern "C" {
device->trx_set_freq_func = trx_usrp_set_freq;
device->trx_set_gains_func = trx_usrp_set_gains;
device->openair0_cfg = openair0_cfg;
device->uhd_set_thread_priority = uhd_set_thread_priority;
std::cerr << "USRP device initialized in subframes replay mode for " << u_sf_loops << " loops. Use mmap="
<< use_mmap << std::endl;
} else {
......@@ -1158,6 +1177,13 @@ extern "C" {
openair0_cfg[0].rx_bw = 40e6;
break;
case 46080000:
//openair0_cfg[0].samples_per_packet = 1024;
openair0_cfg[0].tx_sample_advance = 115;
openair0_cfg[0].tx_bw = 40e6;
openair0_cfg[0].rx_bw = 40e6;
break;
case 30720000:
// from usrp_time_offset
//openair0_cfg[0].samples_per_packet = 2048;
......@@ -1210,7 +1236,15 @@ extern "C" {
}
switch ((int)openair0_cfg[0].sample_rate) {
case 30720000:
case 46080000:
s->usrp->set_master_clock_rate(46.08e6);
//openair0_cfg[0].samples_per_packet = 1024;
openair0_cfg[0].tx_sample_advance = 115;
openair0_cfg[0].tx_bw = 40e6;
openair0_cfg[0].rx_bw = 40e6;
break;
case 30720000:
s->usrp->set_master_clock_rate(30.72e6);
//openair0_cfg[0].samples_per_packet = 1024;
openair0_cfg[0].tx_sample_advance = 115;
......@@ -1361,6 +1395,7 @@ extern "C" {
device->trx_set_freq_func = trx_usrp_set_freq;
device->trx_set_gains_func = trx_usrp_set_gains;
device->openair0_cfg = openair0_cfg;
device->uhd_set_thread_priority = uhd_set_thread_priority;
s->sample_rate = openair0_cfg[0].sample_rate;
// TODO:
......@@ -1463,9 +1498,6 @@ extern "C" {
return 0;
}
void uhd_set_thread_priority(void) {
uhd::set_thread_priority_safe(1.0);
}
}
/*@}*/
......@@ -132,6 +132,7 @@ int transport_init(openair0_device *device, openair0_config_t *openair0_cfg,
device->trx_set_gains_func = mobipass_set_gains;
device->trx_write_func = mobipass_write;
device->trx_read_func = mobipass_read;
device->uhd_set_thread_priority = NULL;
device->priv = mobi;
......
......@@ -642,6 +642,7 @@ int device_init(openair0_device *device, openair0_config_t *openair0_cfg) {
device->trx_set_gains_func = rfsimulator_set_gains;
device->trx_write_func = rfsimulator_write;
device->trx_read_func = rfsimulator_read;
device->uhd_set_thread_priority = NULL;
/* let's pretend to be a b2x0 */
device->type = USRP_B200_DEV;
device->openair0_cfg=&openair0_cfg[0];
......
......@@ -267,6 +267,7 @@ int device_init(openair0_device* device, openair0_config_t *openair0_cfg)
device->trx_set_gains_func = tcp_bridge_set_gains;
device->trx_write_func = tcp_bridge_write;
device->trx_read_func = tcp_bridge_read;
device->uhd_set_thread_priority = NULL;
device->priv = tcp_bridge;
......
......@@ -313,6 +313,7 @@ int device_init(openair0_device* device, openair0_config_t *openair0_cfg)
device->trx_set_freq_func = tcp_bridge_set_freq;
device->trx_set_gains_func = tcp_bridge_set_gains;
device->trx_write_func = tcp_bridge_write;
device->uhd_set_thread_priority = NULL;
if (tcp_bridge->is_enb) {
device->trx_read_func = tcp_bridge_read;
......
......@@ -262,7 +262,7 @@ RUs = (
THREAD_STRUCT = (
{
#three config for level of parallelism "PARALLEL_SINGLE_THREAD", "PARALLEL_RU_L1_SPLIT", or "PARALLEL_RU_L1_TRX_SPLIT"
parallel_config = "PARALLEL_SINGLE_THREAD";
parallel_config = "PARALLEL_RU_L1_TRX_SPLIT";
#two option for worker "WORKER_DISABLE" or "WORKER_ENABLE"
worker_config = "WORKER_DISABLE";
}
......
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