Commit 5445b6d0 authored by Florian Kaltenberger's avatar Florian Kaltenberger

Merge remote-tracking branch 'origin/develop-nr' into pdsch-ch-est

parents 5f10dfa3 615f2787
...@@ -365,7 +365,7 @@ pipeline { ...@@ -365,7 +365,7 @@ pipeline {
stage ("Test physical simulators") { stage ("Test physical simulators") {
steps { steps {
script { script {
timeout (time: 45, unit: 'MINUTES') { timeout (time: 90, unit: 'MINUTES') {
try { try {
gitlabCommitStatus(name: "Test phy-sim") { gitlabCommitStatus(name: "Test phy-sim") {
sh "./ci-scripts/oai-ci-vm-tool test --workspace $WORKSPACE --variant phy-sim --job-name ${JOB_NAME} --build-id ${BUILD_ID}" sh "./ci-scripts/oai-ci-vm-tool test --workspace $WORKSPACE --variant phy-sim --job-name ${JOB_NAME} --build-id ${BUILD_ID}"
......
...@@ -185,7 +185,7 @@ function variant__v3__phy_sim { ...@@ -185,7 +185,7 @@ function variant__v3__phy_sim {
NB_PATTERN_FILES=12 NB_PATTERN_FILES=12
BUILD_OPTIONS="--phy_simulators" BUILD_OPTIONS="--phy_simulators"
VM_MEMORY=8192 VM_MEMORY=8192
RUN_OPTIONS="./run_exec_autotests.bash -g \"01510*\" -q -np -b" RUN_OPTIONS="./run_exec_autotests.bash -g \"01510* 015111\" -q -np -b"
} }
function variant__v4__cppcheck { function variant__v4__cppcheck {
......
...@@ -96,11 +96,41 @@ Obj.# Case# Test# Description ...@@ -96,11 +96,41 @@ Obj.# Case# Test# Description
(Test 4, 10 MHz, R3-1.FDD (MCS 16), AWGN, 12dB (70%)), (Test 4, 10 MHz, R3-1.FDD (MCS 16), AWGN, 12dB (70%)),
(Test 5, 20 MHz, FDD (MCS 5), AWGN, 6dB (70%)), (Test 5, 20 MHz, FDD (MCS 5), AWGN, 6dB (70%)),
(Test 6, 20 MHz, FDD (MCS 16), AWGN, 12 dB (70%)) (Test 6, 20 MHz, FDD (MCS 16), AWGN, 12 dB (70%))
01 51 02 pucchsim (TBD) 01 51 02 ldpc Test cases. (Test1: block length = 3872),
01 51 03 prachsim (TBD) (Test2: block length = 4224),
01 51 04 pdcchsim (TBD) (Test3: block length = 4576),
01 51 05 pbchsim (TBD) (Test4: block length = 4928),
01 51 06 mbmssim (TBD) (Test5: block length = 5280),
(Test6: block length = 5632),
(Test7: block length = 6336),
(Test8: block length = 7040),
(Test9: block length = 7744),
(Test10: block length = 8448)
01 51 03 polartest Test cases. (Test1: PBCH polar test),
(Test2: DCI polar test)
01 51 04 nr_pbchsim Test cases. (Test1: PBCH-only, 106 PRB),
(Test2: PBCH and synchronization, 106PBR),
(Test3: PBCH-only, 217 PRB),
(Test4: PBCH and synchronization, 217 RPB),
(Test5: PBCH-only, 273 PRB),
(Test6: PBCH and synchronization, 273 PRB)
01 51 05 nr_dlsim Test cases. (Test1: 106 PRB),
(Test2: 217 PRB),
(Test3: 273 PRB)
01 51 06 nr_dlschsim Test cases. (Test1: 106 PRB),
(Test2: 217 PRB),
(Test3: 273 PRB)
01 51 07 shortblocktest Test cases. (Test1: 3 bits),
(Test2: 6 bits),
(Test3: 7 bits),
(Test4: 11 bits)
01 51 08 nr_ulschsim Test cases. (Test1: 106 PRB),
(Test2: 217 PRB),
(Test3: 273 PRB)
01 51 09 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)
01 51 10 dlsim_tm4 test cases (Test 1: 10 MHz, R2.FDD (MCS 5), EVA5, -1dB), 01 51 10 dlsim_tm4 test cases (Test 1: 10 MHz, R2.FDD (MCS 5), EVA5, -1dB),
(Test 5: 1.4 MHz, R4.FDD (MCS 4), EVA5, 0dB (70%)), (Test 5: 1.4 MHz, R4.FDD (MCS 4), EVA5, 0dB (70%)),
(Test 6: 10 MHz, R3.FDD (MCS 15), EVA5, 6.7dB (70%)), (Test 6: 10 MHz, R3.FDD (MCS 15), EVA5, 6.7dB (70%)),
...@@ -110,8 +140,11 @@ Obj.# Case# Test# Description ...@@ -110,8 +140,11 @@ Obj.# Case# Test# Description
(Test 10: 5 MHz, R6.FDD (MCS 25), EVA5, 17.4 dB (70%)), (Test 10: 5 MHz, R6.FDD (MCS 25), EVA5, 17.4 dB (70%)),
(Test 10b: 5 MHz, R6-1.FDD (MCS 24,18 PRB), EVA5, 17.5dB (70%)), (Test 10b: 5 MHz, R6-1.FDD (MCS 24,18 PRB), EVA5, 17.5dB (70%)),
(Test 11: 10 MHz, R7.FDD (MCS 25), EVA5, 17.7dB (70%)) (Test 11: 10 MHz, R7.FDD (MCS 25), EVA5, 17.7dB (70%))
(TM2 Test 1 10 MHz, R.11 FDD (MCS 14), EVA5, 6.8 dB (70%)), (TM2 Test 1 10 MHz, R.11 FDD (MCS 14), EVA5, 6.8 dB (70%)),
(TM2 Test 1b 20 MHz, R.11-2 FDD (MCS 13), EVA5, 5.9 dB (70%)), (TM2 Test 1b 20 MHz, R.11-2 FDD (MCS 13), EVA5, 5.9 dB (70%)),
01 51 11 nr_ulsim Test cases. (Test1: MCS 9),
(Test2: MCS 16),
(Test3: MCS 28)
......
...@@ -1088,8 +1088,8 @@ ...@@ -1088,8 +1088,8 @@
(Test7: 106 PRB 51 PDSCH-Offset), (Test7: 106 PRB 51 PDSCH-Offset),
(Test8: 217 PRB 100 PDSCH-PRBs), (Test8: 217 PRB 100 PDSCH-PRBs),
(Test9: 217 PRB 80 PDSCH-Offset), (Test9: 217 PRB 80 PDSCH-Offset),
(Test10: 217 PRB 100 PDSCH-PRBs 80 PDSCH-Offset),--> (Test10: 217 PRB 100 PDSCH-PRBs 80 PDSCH-Offset),
(Test6: 106 PRB 0 MCS), (Test6: 106 PRB 0 MCS),-->
(Test7: 273 PRB 28 MCS)</desc> (Test7: 273 PRB 28 MCS)</desc>
<pre_compile_prog></pre_compile_prog> <pre_compile_prog></pre_compile_prog>
<compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</compile_prog> <compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</compile_prog>
...@@ -1106,8 +1106,8 @@ ...@@ -1106,8 +1106,8 @@
-n100 -R106 -a51 -n100 -R106 -a51
-n100 -R217 -b100 -n100 -R217 -b100
-n100 -R217 -a80 -n100 -R217 -a80
-n100 -R217 -a80 -b100--> -n100 -R217 -a80 -b100
-n100 -R106 -e0 -n100 -R106 -e0-->
-n100 -R273 -e28</main_exec_args> -n100 -R273 -e28</main_exec_args>
<tags>nr_dlsim.test1 nr_dlsim.test2 nr_dlsim.test3 nr_dlsim.test4 nr_dlsim.test5 <!--nr_dlsim.test6 nr_dlsim.test7 nr_dlsim.test8 nr_dlsim.test9 nr_dlsim.test10-->nr_dlsim.test6 nr_dlsim.test7</tags> <tags>nr_dlsim.test1 nr_dlsim.test2 nr_dlsim.test3 nr_dlsim.test4 nr_dlsim.test5 <!--nr_dlsim.test6 nr_dlsim.test7 nr_dlsim.test8 nr_dlsim.test9 nr_dlsim.test10-->nr_dlsim.test6 nr_dlsim.test7</tags>
<search_expr_true>"PDCCH test OK" "PDSCH test OK"</search_expr_true> <search_expr_true>"PDCCH test OK" "PDSCH test OK"</search_expr_true>
...@@ -1238,6 +1238,26 @@ ...@@ -1238,6 +1238,26 @@
<nruns>3</nruns> <nruns>3</nruns>
</testCase> </testCase>
<testCase id="015111">
<class>execution</class>
<desc>nr_ulsim Test cases. (Test1: MCS 9),
(Test2: MCS 16),
(Test3: MCS 28)</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_ulsim.Rel15</main_exec>
<main_exec_args>-f100 -m9 -s10
-f100 -m16 -s20
-f100 -m28 -s30</main_exec_args>
<tags>nr_ulsim.test1 nr_ulsim.test2 nr_ulsim.test3</tags>
<search_expr_true>PUSCH test OK</search_expr_true>
<search_expr_false>segmentation fault|assertion|exiting|fatal</search_expr_false>
<nruns>3</nruns>
</testCase>
<testCase id="015500" > <testCase id="015500" >
<class>lte-softmodem</class> <class>lte-softmodem</class>
<desc></desc> <desc></desc>
......
...@@ -720,14 +720,14 @@ void rx_rf(RU_t *ru,int *frame,int *slot) { ...@@ -720,14 +720,14 @@ void rx_rf(RU_t *ru,int *frame,int *slot) {
void tx_rf(RU_t *ru,int frame,int slot, uint64_t timestamp) { void tx_rf(RU_t *ru,int frame,int slot, uint64_t timestamp) {
RU_proc_t *proc = &ru->proc; RU_proc_t *proc = &ru->proc;
NR_DL_FRAME_PARMS *fp = ru->nr_frame_parms; NR_DL_FRAME_PARMS *fp = ru->nr_frame_parms;
nfapi_nr_config_request_t *cfg = &ru->gNB_list[0]->gNB_config; //nfapi_nr_config_request_t *cfg = &ru->gNB_list[0]->gNB_config;
void *txp[ru->nb_tx]; void *txp[ru->nb_tx];
unsigned int txs; unsigned int txs;
int i; int i;
T(T_ENB_PHY_OUTPUT_SIGNAL, T_INT(0), T_INT(0), T_INT(frame), T_INT(slot), T(T_ENB_PHY_OUTPUT_SIGNAL, T_INT(0), T_INT(0), T_INT(frame), T_INT(slot),
T_INT(0), T_BUFFER(&ru->common.txdata[0][slot * fp->samples_per_slot], fp->samples_per_slot * 4)); T_INT(0), T_BUFFER(&ru->common.txdata[0][slot * fp->samples_per_slot], fp->samples_per_slot * 4));
int sf_extension = 0; int sf_extension = 0;
nr_subframe_t SF_type = nr_slot_select(cfg,slot%fp->slots_per_frame); //nr_subframe_t SF_type = nr_slot_select(cfg,slot%fp->slots_per_frame);
if ((slot == 0) || if ((slot == 0) ||
(slot == 1)) { (slot == 1)) {
......
...@@ -695,12 +695,12 @@ void *UE_thread(void *arg) { ...@@ -695,12 +695,12 @@ void *UE_thread(void *arg) {
//LOG_I(PHY,"Process slot %d thread Idx %d total gain %d\n", slot_nr, thread_idx, UE->rx_total_gain_dB); //LOG_I(PHY,"Process slot %d thread Idx %d total gain %d\n", slot_nr, thread_idx, UE->rx_total_gain_dB);
#ifdef OAI_ADRV9371_ZC706 #ifdef OAI_ADRV9371_ZC706
uint32_t total_gain_dB_prev = 0; /*uint32_t total_gain_dB_prev = 0;
if (total_gain_dB_prev != UE->rx_total_gain_dB) { if (total_gain_dB_prev != UE->rx_total_gain_dB) {
total_gain_dB_prev = UE->rx_total_gain_dB; total_gain_dB_prev = UE->rx_total_gain_dB;
openair0_cfg[0].rx_gain[0] = UE->rx_total_gain_dB-20; openair0_cfg[0].rx_gain[0] = UE->rx_total_gain_dB;
UE->rfdevice.trx_set_gains_func(&UE->rfdevice,&openair0_cfg[0]); UE->rfdevice.trx_set_gains_func(&UE->rfdevice,&openair0_cfg[0]);
} }*/
#endif #endif
for (int i=0; i<UE->frame_parms.nb_antennas_rx; i++) for (int i=0; i<UE->frame_parms.nb_antennas_rx; i++)
...@@ -732,6 +732,8 @@ void *UE_thread(void *arg) { ...@@ -732,6 +732,8 @@ void *UE_thread(void *arg) {
rxp, rxp,
readBlockSize, readBlockSize,
UE->frame_parms.nb_antennas_rx),""); UE->frame_parms.nb_antennas_rx),"");
if (slot_nr==18)
AssertFatal( writeBlockSize == AssertFatal( writeBlockSize ==
UE->rfdevice.trx_write_func(&UE->rfdevice, UE->rfdevice.trx_write_func(&UE->rfdevice,
timestamp+ timestamp+
...@@ -741,7 +743,7 @@ void *UE_thread(void *arg) { ...@@ -741,7 +743,7 @@ void *UE_thread(void *arg) {
txp, txp,
writeBlockSize, writeBlockSize,
UE->frame_parms.nb_antennas_tx, UE->frame_parms.nb_antennas_tx,
1),""); 4),"");
if( slot_nr==(nb_slot_frame-1)) { if( slot_nr==(nb_slot_frame-1)) {
// read in first symbol of next frame and adjust for timing drift // read in first symbol of next frame and adjust for timing drift
......
...@@ -877,6 +877,7 @@ int init_nr_ue_signal(PHY_VARS_NR_UE *ue, ...@@ -877,6 +877,7 @@ int init_nr_ue_signal(PHY_VARS_NR_UE *ue,
pbch_vars[eNB_id]->rxdataF_comp = (int32_t **)malloc16_clear( 8*sizeof(int32_t *) ); pbch_vars[eNB_id]->rxdataF_comp = (int32_t **)malloc16_clear( 8*sizeof(int32_t *) );
pbch_vars[eNB_id]->dl_ch_estimates = (int32_t **)malloc16_clear( 8*sizeof(int32_t *) ); pbch_vars[eNB_id]->dl_ch_estimates = (int32_t **)malloc16_clear( 8*sizeof(int32_t *) );
pbch_vars[eNB_id]->dl_ch_estimates_ext = (int32_t **)malloc16_clear( 8*sizeof(int32_t *) ); pbch_vars[eNB_id]->dl_ch_estimates_ext = (int32_t **)malloc16_clear( 8*sizeof(int32_t *) );
pbch_vars[eNB_id]->dl_ch_estimates_time = (int32_t **)malloc16_clear( 8*sizeof(int32_t *) );
pbch_vars[eNB_id]->llr = (int16_t *)malloc16_clear( 1920 ); // pbch_vars[eNB_id]->llr = (int16_t *)malloc16_clear( 1920 ); //
prach_vars[eNB_id]->prachF = (int16_t *)malloc16_clear( sizeof(int)*(7*2*sizeof(int)*(fp->ofdm_symbol_size*12)) ); prach_vars[eNB_id]->prachF = (int16_t *)malloc16_clear( sizeof(int)*(7*2*sizeof(int)*(fp->ofdm_symbol_size*12)) );
prach_vars[eNB_id]->prach = (int16_t *)malloc16_clear( sizeof(int)*(7*2*sizeof(int)*(fp->ofdm_symbol_size*12)) ); prach_vars[eNB_id]->prach = (int16_t *)malloc16_clear( sizeof(int)*(7*2*sizeof(int)*(fp->ofdm_symbol_size*12)) );
...@@ -888,6 +889,7 @@ int init_nr_ue_signal(PHY_VARS_NR_UE *ue, ...@@ -888,6 +889,7 @@ int init_nr_ue_signal(PHY_VARS_NR_UE *ue,
int idx = (j<<1)+i; int idx = (j<<1)+i;
pbch_vars[eNB_id]->rxdataF_comp[idx] = (int32_t *)malloc16_clear( sizeof(int32_t)*20*12*4 ); pbch_vars[eNB_id]->rxdataF_comp[idx] = (int32_t *)malloc16_clear( sizeof(int32_t)*20*12*4 );
pbch_vars[eNB_id]->dl_ch_estimates[idx] = (int32_t *)malloc16_clear( sizeof(int32_t)*7*2*sizeof(int)*(fp->ofdm_symbol_size) ); pbch_vars[eNB_id]->dl_ch_estimates[idx] = (int32_t *)malloc16_clear( sizeof(int32_t)*7*2*sizeof(int)*(fp->ofdm_symbol_size) );
pbch_vars[eNB_id]->dl_ch_estimates_time[idx]= (int32_t *)malloc16_clear( sizeof(int32_t)*7*2*sizeof(int)*(fp->ofdm_symbol_size) );
pbch_vars[eNB_id]->dl_ch_estimates_ext[idx] = (int32_t *)malloc16_clear( sizeof(int32_t)*20*12*4 ); pbch_vars[eNB_id]->dl_ch_estimates_ext[idx] = (int32_t *)malloc16_clear( sizeof(int32_t)*20*12*4 );
} }
} }
......
...@@ -286,7 +286,8 @@ int nr_dlsch_encoding(unsigned char *a, ...@@ -286,7 +286,8 @@ int nr_dlsch_encoding(unsigned char *a,
uint32_t A, Z, Kb, F=0; uint32_t A, Z, Kb, F=0;
uint32_t *Zc = &Z; uint32_t *Zc = &Z;
uint8_t mod_order = rel15.modulation_order; uint8_t mod_order = rel15.modulation_order;
uint16_t Kr=0,r,r_offset=0; uint16_t Kr=0,r;
uint32_t r_offset=0;
//uint8_t *d_tmp[MAX_NUM_DLSCH_SEGMENTS]; //uint8_t *d_tmp[MAX_NUM_DLSCH_SEGMENTS];
uint8_t BG=1; uint8_t BG=1;
uint32_t E; uint32_t E;
...@@ -384,7 +385,7 @@ int nr_dlsch_encoding(unsigned char *a, ...@@ -384,7 +385,7 @@ int nr_dlsch_encoding(unsigned char *a,
Kr_bytes = Kr>>3; Kr_bytes = Kr>>3;
#endif #endif
//printf("segment Z %d k %d Kr %d BG %d\n", *Zc,dlsch->harq_processes[harq_pid]->K,Kr,BG); //printf("segment Z %d k %d Kr %d BG %d C %d\n", *Zc,dlsch->harq_processes[harq_pid]->K,Kr,BG,dlsch->harq_processes[harq_pid]->C);
for (r=0; r<dlsch->harq_processes[harq_pid]->C; r++) { for (r=0; r<dlsch->harq_processes[harq_pid]->C; r++) {
//d_tmp[r] = &dlsch->harq_processes[harq_pid]->d[r][0]; //d_tmp[r] = &dlsch->harq_processes[harq_pid]->d[r][0];
...@@ -455,7 +456,6 @@ int nr_dlsch_encoding(unsigned char *a, ...@@ -455,7 +456,6 @@ int nr_dlsch_encoding(unsigned char *a,
rel15.redundancy_version, rel15.redundancy_version,
E); E);
#ifdef DEBUG_DLSCH_CODING #ifdef DEBUG_DLSCH_CODING
for (int i =0; i<16; i++) for (int i =0; i<16; i++)
printf("output ratematching e[%d]= %d r_offset %d\n", i,dlsch->harq_processes[harq_pid]->e[i+r_offset], r_offset); printf("output ratematching e[%d]= %d r_offset %d\n", i,dlsch->harq_processes[harq_pid]->e[i+r_offset], r_offset);
......
...@@ -60,8 +60,8 @@ void nr_adjust_synch_ue(NR_DL_FRAME_PARMS *frame_parms, ...@@ -60,8 +60,8 @@ void nr_adjust_synch_ue(NR_DL_FRAME_PARMS *frame_parms,
temp = 0; temp = 0;
for (aa=0; aa<frame_parms->nb_antennas_rx; aa++) { for (aa=0; aa<frame_parms->nb_antennas_rx; aa++) {
Re = ((int16_t*)ue->pdcch_vars[ue->current_thread_id[subframe]][eNB_id]->dl_ch_estimates_time[aa])[(i<<1)]; Re = ((int16_t*)ue->pbch_vars[eNB_id]->dl_ch_estimates_time[aa])[(i<<1)];
Im = ((int16_t*)ue->pdcch_vars[ue->current_thread_id[subframe]][eNB_id]->dl_ch_estimates_time[aa])[1+(i<<1)]; Im = ((int16_t*)ue->pbch_vars[eNB_id]->dl_ch_estimates_time[aa])[1+(i<<1)];
temp += (Re*Re/2) + (Im*Im/2); temp += (Re*Re/2) + (Im*Im/2);
} }
...@@ -80,7 +80,7 @@ void nr_adjust_synch_ue(NR_DL_FRAME_PARMS *frame_parms, ...@@ -80,7 +80,7 @@ void nr_adjust_synch_ue(NR_DL_FRAME_PARMS *frame_parms,
// do not filter to have proactive timing adjustment // do not filter to have proactive timing adjustment
//max_pos_fil = max_pos; //max_pos_fil = max_pos;
if(subframe == 1) if(subframe == 0)
{ {
diff = max_pos_fil - (frame_parms->nb_prefix_samples>>3); diff = max_pos_fil - (frame_parms->nb_prefix_samples>>3);
......
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
#include <string.h> #include <string.h>
#include "SCHED_NR_UE/defs.h"
#include "nr_estimation.h" #include "nr_estimation.h"
#include "PHY/NR_REFSIG/refsig_defs_ue.h" #include "PHY/NR_REFSIG/refsig_defs_ue.h"
#include "filt16a_32.h" #include "filt16a_32.h"
...@@ -199,19 +199,23 @@ int nr_pbch_dmrs_correlation(PHY_VARS_NR_UE *ue, ...@@ -199,19 +199,23 @@ int nr_pbch_dmrs_correlation(PHY_VARS_NR_UE *ue,
int nr_pbch_channel_estimation(PHY_VARS_NR_UE *ue, int nr_pbch_channel_estimation(PHY_VARS_NR_UE *ue,
uint8_t eNB_offset, uint8_t eNB_offset,
unsigned char Ns, unsigned char Ns,
unsigned char symbol, unsigned char symbol,
int dmrss, int dmrss,
uint8_t ssb_index, uint8_t ssb_index,
uint8_t n_hf) uint8_t n_hf)
{ {
int pilot[200] __attribute__((aligned(16))); int pilot[200] __attribute__((aligned(16)));
unsigned char aarx; unsigned char aarx,p;
unsigned short k; unsigned short k;
unsigned int pilot_cnt; unsigned int pilot_cnt;
int16_t ch[2],*pil,*rxF,*dl_ch,*fl,*fm,*fr; int16_t ch[2],*pil,*rxF,*dl_ch,*fl,*fm,*fr;
int ch_offset,symbol_offset; int ch_offset,symbol_offset;
int slot_pbch;
fapi_nr_pbch_config_t *pbch_config = &ue->nrUE_config.pbch_config;
// initialized to 5ms in nr_init_ue for scenarios where UE is not configured (otherwise acquired by cell configuration from gNB or LTE)
uint8_t ssb_periodicity = 10;// ue->ssb_periodicity;
//uint16_t Nid_cell = (eNB_offset == 0) ? ue->frame_parms.Nid_cell : ue->measurements.adj_cell_id[eNB_offset-1]; //uint16_t Nid_cell = (eNB_offset == 0) ? ue->frame_parms.Nid_cell : ue->measurements.adj_cell_id[eNB_offset-1];
...@@ -418,6 +422,59 @@ int nr_pbch_channel_estimation(PHY_VARS_NR_UE *ue, ...@@ -418,6 +422,59 @@ int nr_pbch_channel_estimation(PHY_VARS_NR_UE *ue,
} }
void (*idft)(int16_t *,int16_t *, int);
switch (ue->frame_parms.ofdm_symbol_size) {
case 128:
idft = idft128;
break;
case 256:
idft = idft256;
break;
case 512:
idft = idft512;
break;
case 1024:
idft = idft1024;
break;
case 1536:
idft = idft1536;
break;
case 2048:
idft = idft2048;
break;
case 3072:
idft = idft3072;
break;
case 4096:
idft = idft4096;
break;
default:
printf("unsupported ofdm symbol size \n");
assert(0);
}
if( symbol == 3)
{
// do ifft of channel estimate
for (aarx=0; aarx<ue->frame_parms.nb_antennas_rx; aarx++)
for (p=0; p<ue->frame_parms.nb_antenna_ports_eNB; p++) {
if (ue->pbch_vars[eNB_offset]->dl_ch_estimates[(p<<1)+aarx])
{
LOG_D(PHY,"Channel Impulse Computation Slot %d ThreadId %d Symbol %d ch_offset %d\n", Ns, ue->current_thread_id[Ns], symbol, ch_offset);
idft((int16_t*) &ue->pbch_vars[eNB_offset]->dl_ch_estimates[(p<<1)+aarx][ch_offset],
(int16_t*) ue->pbch_vars[eNB_offset]->dl_ch_estimates_time[(p<<1)+aarx],1);
}
}
}
//} //}
...@@ -433,7 +490,7 @@ int nr_pdcch_channel_estimation(PHY_VARS_NR_UE *ue, ...@@ -433,7 +490,7 @@ int nr_pdcch_channel_estimation(PHY_VARS_NR_UE *ue,
unsigned short nb_rb_coreset) unsigned short nb_rb_coreset)
{ {
int pilot[200] __attribute__((aligned(16))); int pilot[200] __attribute__((aligned(16)));
unsigned char aarx,p; unsigned char aarx;
unsigned short k; unsigned short k;
unsigned int pilot_cnt; unsigned int pilot_cnt;
int16_t ch[2],*pil,*rxF,*dl_ch,*fl,*fm,*fr; int16_t ch[2],*pil,*rxF,*dl_ch,*fl,*fm,*fr;
...@@ -597,60 +654,6 @@ int nr_pdcch_channel_estimation(PHY_VARS_NR_UE *ue, ...@@ -597,60 +654,6 @@ int nr_pdcch_channel_estimation(PHY_VARS_NR_UE *ue,
//} //}
} }
void (*idft)(int16_t *,int16_t *, int);
switch (ue->frame_parms.ofdm_symbol_size) {
case 128:
idft = idft128;
break;
case 256:
idft = idft256;
break;
case 512:
idft = idft512;
break;
case 1024:
idft = idft1024;
break;
case 1536:
idft = idft1536;
break;
case 2048:
idft = idft2048;
break;
case 3072:
idft = idft3072;
break;
case 4096:
idft = idft4096;
break;
default:
printf("unsupported ofdm symbol size \n");
assert(0);
}
if( (Ns== 1) && (symbol == 0))
{
// do ifft of channel estimate
for (aarx=0; aarx<ue->frame_parms.nb_antennas_rx; aarx++)
for (p=0; p<ue->frame_parms.nb_antenna_ports_eNB; p++) {
if (ue->pdcch_vars[ue->current_thread_id[Ns]][eNB_offset]->dl_ch_estimates[(p<<1)+aarx])
{
LOG_D(PHY,"Channel Impulse Computation Slot %d ThreadId %d Symbol %d \n", Ns, ue->current_thread_id[Ns], symbol);
idft((int16_t*) &ue->pdcch_vars[ue->current_thread_id[Ns]][eNB_offset]->dl_ch_estimates[(p<<1)+aarx][0],
(int16_t*) ue->pdcch_vars[ue->current_thread_id[Ns]][eNB_offset]->dl_ch_estimates_time[(p<<1)+aarx],1);
}
}
}
return(0); return(0);
} }
......
...@@ -726,7 +726,7 @@ void nr_ue_measurements(PHY_VARS_NR_UE *ue, ...@@ -726,7 +726,7 @@ void nr_ue_measurements(PHY_VARS_NR_UE *ue,
ch_offset = ue->frame_parms.ofdm_symbol_size*2; ch_offset = ue->frame_parms.ofdm_symbol_size*2;
printf("testing measurements\n"); //printf("testing measurements\n");
// signal measurements // signal measurements
for (eNB_id=0; eNB_id<ue->n_connected_eNB; eNB_id++) { for (eNB_id=0; eNB_id<ue->n_connected_eNB; eNB_id++) {
......
...@@ -589,8 +589,8 @@ void phy_scope_nrUE(FD_phy_scope_nrue *form, ...@@ -589,8 +589,8 @@ void phy_scope_nrUE(FD_phy_scope_nrue *form,
time = calloc(samples_per_frame,sizeof(float)); time = calloc(samples_per_frame,sizeof(float));
corr = calloc(samples_per_frame,sizeof(float)); corr = calloc(samples_per_frame,sizeof(float));
chest_t = (int16_t**) phy_vars_ue->pdcch_vars[phy_vars_ue->current_thread_id[subframe]][eNB_id]->dl_ch_estimates_time; chest_t = (int16_t**) phy_vars_ue->pbch_vars[eNB_id]->dl_ch_estimates_time;
chest_f = (int16_t**) phy_vars_ue->pdcch_vars[phy_vars_ue->current_thread_id[subframe]][eNB_id]->dl_ch_estimates; chest_f = (int16_t**) phy_vars_ue->pbch_vars[eNB_id]->dl_ch_estimates;
pbch_llr = (int16_t*) phy_vars_ue->pbch_vars[eNB_id]->llr; pbch_llr = (int16_t*) phy_vars_ue->pbch_vars[eNB_id]->llr;
pbch_comp = (int16_t*) phy_vars_ue->pbch_vars[eNB_id]->rxdataF_comp[0]; pbch_comp = (int16_t*) phy_vars_ue->pbch_vars[eNB_id]->rxdataF_comp[0];
...@@ -697,8 +697,8 @@ void phy_scope_nrUE(FD_phy_scope_nrue *form, ...@@ -697,8 +697,8 @@ void phy_scope_nrUE(FD_phy_scope_nrue *form,
if (chest_f[(atx<<1)+arx] != NULL) { if (chest_f[(atx<<1)+arx] != NULL) {
for (k=0; k<frame_parms->ofdm_symbol_size; k++) { for (k=0; k<frame_parms->ofdm_symbol_size; k++) {
freq[ind] = (float)ind; freq[ind] = (float)ind;
Re = (float)(chest_f[(atx<<1)+arx][(2*k)]); Re = (float)(chest_f[(atx<<1)+arx][6144+(2*k)]);
Im = (float)(chest_f[(atx<<1)+arx][(2*k)+1]); Im = (float)(chest_f[(atx<<1)+arx][6144+(2*k)+1]);
chest_f_abs[ind] = (short)10*log10(1.0+((double)Re*Re + (double)Im*Im)); chest_f_abs[ind] = (short)10*log10(1.0+((double)Re*Re + (double)Im*Im));
ind++; ind++;
......
...@@ -810,6 +810,10 @@ typedef struct { ...@@ -810,6 +810,10 @@ typedef struct {
/// - first index: ? [0..7] (hard coded) FIXME! accessed via \c nb_antennas_rx /// - first index: ? [0..7] (hard coded) FIXME! accessed via \c nb_antennas_rx
/// - second index: ? [0..287] (hard coded) /// - second index: ? [0..287] (hard coded)
int32_t **dl_ch_estimates_ext; int32_t **dl_ch_estimates_ext;
/// \brief Hold the channel estimates in time domain (used for tracking).
/// - first index: ? [0..7] (hard coded) FIXME! accessed via \c nb_antennas_rx
/// - second index: samples? [0..2*ofdm_symbol_size[
int32_t **dl_ch_estimates_time;
int log2_maxh; int log2_maxh;
uint8_t pbch_a[NR_POLAR_PBCH_PAYLOAD_BITS>>3]; uint8_t pbch_a[NR_POLAR_PBCH_PAYLOAD_BITS>>3];
uint32_t pbch_a_interleaved; uint32_t pbch_a_interleaved;
......
...@@ -228,7 +228,7 @@ typedef struct NR_DL_FRAME_PARMS { ...@@ -228,7 +228,7 @@ typedef struct NR_DL_FRAME_PARMS {
/// Total Number of Resource Block Groups SubSets: this is P /// Total Number of Resource Block Groups SubSets: this is P
uint8_t N_RBGS; uint8_t N_RBGS;
/// EUTRA Band /// EUTRA Band
uint8_t eutra_band; uint16_t eutra_band;
/// DL carrier frequency /// DL carrier frequency
uint32_t dl_CarrierFreq; uint32_t dl_CarrierFreq;
/// UL carrier frequency /// UL carrier frequency
......
...@@ -370,7 +370,7 @@ void nr_compute_srs_pos(lte_frame_type_t frameType,uint16_t isrs,uint16_t *psrsP ...@@ -370,7 +370,7 @@ void nr_compute_srs_pos(lte_frame_type_t frameType,uint16_t isrs,uint16_t *psrsP
void set_tx_harq_id(NR_UE_ULSCH_t *ulsch, int harq_pid, int slot_tx); void set_tx_harq_id(NR_UE_ULSCH_t *ulsch, int harq_pid, int slot_tx);
int get_tx_harq_id(NR_UE_ULSCH_t *ulsch, int slot_tx); int get_tx_harq_id(NR_UE_ULSCH_t *ulsch, int slot_tx);
int is_pbch_in_slot(fapi_nr_pbch_config_t *pbch_config, int frame, int slot, int periodicity, uint16_t slots_per_frame);
/*@}*/ /*@}*/
......
...@@ -4167,6 +4167,43 @@ int phy_procedures_nrUE_RX(PHY_VARS_NR_UE *ue, ...@@ -4167,6 +4167,43 @@ int phy_procedures_nrUE_RX(PHY_VARS_NR_UE *ue,
} }
uint16_t coreset_nb_rb = 6 * coreset_count; uint16_t coreset_nb_rb = 6 * coreset_count;
uint16_t coreset_start_rb = 6 * coreset_start; uint16_t coreset_start_rb = 6 * coreset_start;
slot_pbch = is_pbch_in_slot(pbch_config, frame_rx, nr_tti_rx, ssb_periodicity, ue->frame_parms.slots_per_frame);
// looking for pbch only in slot where it is supposed to be
if ((ue->decode_MIB == 1) && slot_pbch)
{
LOG_I(PHY," ------ PBCH ChannelComp/LLR: frame.slot %d.%d ------ \n", frame_rx%1024, nr_tti_rx);
for (int i=1; i<4; i++) {
nr_slot_fep(ue,
(ue->symbol_offset+i)%(ue->frame_parms.symbols_per_slot),
nr_tti_rx,
0,
0);
#if UE_TIMING_TRACE
start_meas(&ue->dlsch_channel_estimation_stats);
#endif
nr_pbch_channel_estimation(ue,0,nr_tti_rx,(ue->symbol_offset+i)%(ue->frame_parms.symbols_per_slot),i-1,(pbch_config->ssb_index)&7,pbch_config->half_frame_bit);
#if UE_TIMING_TRACE
stop_meas(&ue->dlsch_channel_estimation_stats);
#endif
}
nr_ue_pbch_procedures(eNB_id,ue,proc,0);
if (ue->no_timing_correction==0) {
LOG_I(PHY,"start adjust sync slot = %d no timing %d\n", nr_tti_rx, ue->no_timing_correction);
nr_adjust_synch_ue(&ue->frame_parms,
ue,
eNB_id,
nr_tti_rx,
0,
16384);
}
}
#ifdef NR_PDCCH_SCHED #ifdef NR_PDCCH_SCHED
nr_gold_pdcch(ue, 0, 2); nr_gold_pdcch(ue, 0, 2);
...@@ -4206,16 +4243,7 @@ int phy_procedures_nrUE_RX(PHY_VARS_NR_UE *ue, ...@@ -4206,16 +4243,7 @@ int phy_procedures_nrUE_RX(PHY_VARS_NR_UE *ue,
if (dci_cnt > 0) { if (dci_cnt > 0) {
LOG_I(PHY,"[UE %d] Frame %d, nr_tti_rx %d: found %d DCIs\n",ue->Mod_id,frame_rx,nr_tti_rx,dci_cnt); LOG_I(PHY,"[UE %d] Frame %d, nr_tti_rx %d: found %d DCIs\n",ue->Mod_id,frame_rx,nr_tti_rx,dci_cnt);
if (ue->no_timing_correction==0) {
LOG_D(PHY,"start adjust sync slot = %d no timing %d\n", nr_tti_rx, ue->no_timing_correction);
nr_adjust_synch_ue(&ue->frame_parms,
ue,
eNB_id,
nr_tti_rx,
0,
16384);
}
} else { } else {
LOG_D(PHY,"[UE %d] Frame %d, nr_tti_rx %d: No DCIs found\n",ue->Mod_id,frame_rx,nr_tti_rx); LOG_D(PHY,"[UE %d] Frame %d, nr_tti_rx %d: No DCIs found\n",ue->Mod_id,frame_rx,nr_tti_rx);
} }
...@@ -4311,34 +4339,7 @@ int phy_procedures_nrUE_RX(PHY_VARS_NR_UE *ue, ...@@ -4311,34 +4339,7 @@ int phy_procedures_nrUE_RX(PHY_VARS_NR_UE *ue,
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PDSCH_PROC_RA, VCD_FUNCTION_OUT); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PDSCH_PROC_RA, VCD_FUNCTION_OUT);
} }
slot_pbch = is_pbch_in_slot(pbch_config, frame_rx, nr_tti_rx, ssb_periodicity, ue->frame_parms.slots_per_frame);
// looking for pbch only in slot where it is supposed to be
if ((ue->decode_MIB == 1) && slot_pbch)
{
LOG_I(PHY," ------ PBCH ChannelComp/LLR: frame.slot %d.%d ------ \n", frame_rx%1024, nr_tti_rx);
for (int i=1; i<4; i++) {
nr_slot_fep(ue,
(ue->symbol_offset+i)%(ue->frame_parms.symbols_per_slot),
nr_tti_rx,
0,
0);
#if UE_TIMING_TRACE
start_meas(&ue->dlsch_channel_estimation_stats);
#endif
nr_pbch_channel_estimation(ue,0,nr_tti_rx,(ue->symbol_offset+i)%(ue->frame_parms.symbols_per_slot),i-1,(pbch_config->ssb_index)&7,pbch_config->half_frame_bit);
#if UE_TIMING_TRACE
stop_meas(&ue->dlsch_channel_estimation_stats);
#endif
}
nr_ue_pbch_procedures(eNB_id,ue,proc,0);
}
// do procedures for C-RNTI // do procedures for C-RNTI
if (ue->dlsch[ue->current_thread_id[nr_tti_rx]][eNB_id][0]->active == 1) { if (ue->dlsch[ue->current_thread_id[nr_tti_rx]][eNB_id][0]->active == 1) {
......
...@@ -740,8 +740,10 @@ int main(int argc, char **argv) ...@@ -740,8 +740,10 @@ int main(int argc, char **argv)
//n_errors2 = 0; //n_errors2 = 0;
//n_alamouti = 0; //n_alamouti = 0;
n_false_positive = 0;
for (trial = 0; trial < n_trials; trial++) { for (trial = 0; trial < n_trials; trial++) {
errors_bit = 0;
//multipath channel //multipath channel
//multipath_channel(gNB2UE,s_re,s_im,r_re,r_im,frame_length_complex_samples,0); //multipath_channel(gNB2UE,s_re,s_im,r_re,r_im,frame_length_complex_samples,0);
......
...@@ -461,6 +461,7 @@ int main(int argc, char **argv) ...@@ -461,6 +461,7 @@ int main(int argc, char **argv)
rel15_ul->ulsch_pdu_rel15.rv = 0; rel15_ul->ulsch_pdu_rel15.rv = 0;
rel15_ul->ulsch_pdu_rel15.ndi = 0; rel15_ul->ulsch_pdu_rel15.ndi = 0;
rel15_ul->ulsch_pdu_rel15.n_layers = precod_nbr_layers; rel15_ul->ulsch_pdu_rel15.n_layers = precod_nbr_layers;
rel15_ul->ulsch_pdu_rel15.R = code_rate;
/////////////////////////////////////////////////// ///////////////////////////////////////////////////
//fapi_nr_tx_request_t tx_request; //fapi_nr_tx_request_t tx_request;
......
...@@ -121,7 +121,7 @@ int to_absslot(nfapi_nr_config_request_t *cfg,int frame,int slot); ...@@ -121,7 +121,7 @@ int to_absslot(nfapi_nr_config_request_t *cfg,int frame,int slot);
int get_symbolsperslot(nfapi_nr_config_request_t *cfg); int get_symbolsperslot(nfapi_nr_config_request_t *cfg);
void get_band(uint32_t downlink_frequency, uint8_t *current_band, int32_t *current_offset, lte_frame_type_t *current_type); void get_band(uint32_t downlink_frequency, uint16_t *current_band, int32_t *current_offset, lte_frame_type_t *current_type);
uint64_t from_nrarfcn(int nr_bandP, uint32_t dl_nrarfcn); uint64_t from_nrarfcn(int nr_bandP, uint32_t dl_nrarfcn);
......
...@@ -70,7 +70,7 @@ nr_bandentry_t nr_bandtable[] = { ...@@ -70,7 +70,7 @@ nr_bandentry_t nr_bandtable[] = {
#define NR_BANDTABLE_SIZE (sizeof(nr_bandtable)/sizeof(nr_bandentry_t)) #define NR_BANDTABLE_SIZE (sizeof(nr_bandtable)/sizeof(nr_bandentry_t))
void get_band(uint32_t downlink_frequency, void get_band(uint32_t downlink_frequency,
uint8_t *current_band, uint16_t *current_band,
int32_t *current_offset, int32_t *current_offset,
lte_frame_type_t *current_type) lte_frame_type_t *current_type)
{ {
......
...@@ -386,10 +386,8 @@ void nas_COMMON_QOS_send(struct sk_buff *skb, struct cx_entity *cx, struct class ...@@ -386,10 +386,8 @@ void nas_COMMON_QOS_send(struct sk_buff *skb, struct cx_entity *cx, struct class
pdcph.data_size = skb->len; pdcph.data_size = skb->len;
pdcph.rb_id = (gc->rb)->rab_id; pdcph.rb_id = (gc->rb)->rab_id;
pdcph.inst = inst; pdcph.inst = inst;
#if (RRC_VERSION >= MAKE_VERSION(14, 0, 0))
pdcph.sourceL2Id = 0; pdcph.sourceL2Id = 0;
pdcph.destinationL2Id = 0; pdcph.destinationL2Id = 0;
#endif
......
...@@ -512,6 +512,7 @@ static int trx_usrp_write(openair0_device *device, openair0_timestamp timestamp, ...@@ -512,6 +512,7 @@ static int trx_usrp_write(openair0_device *device, openair0_timestamp timestamp,
first_packet_state = false; first_packet_state = false;
last_packet_state = true; last_packet_state = true;
} }
s->tx_md.has_time_spec = true; s->tx_md.has_time_spec = true;
s->tx_md.start_of_burst = (s->tx_count==0) ? true : first_packet_state; s->tx_md.start_of_burst = (s->tx_count==0) ? true : first_packet_state;
s->tx_md.end_of_burst = last_packet_state; s->tx_md.end_of_burst = last_packet_state;
...@@ -613,7 +614,7 @@ static int trx_usrp_read(openair0_device *device, openair0_timestamp *ptimestamp ...@@ -613,7 +614,7 @@ static int trx_usrp_read(openair0_device *device, openair0_timestamp *ptimestamp
((__m256i *)buff[i])[j] = _mm256_srai_epi16(buff_tmp[i][j],4); ((__m256i *)buff[i])[j] = _mm256_srai_epi16(buff_tmp[i][j],4);
} }
else { else {
((__m128i *)buff[i])[2*j] = _mm_srai_epi16(((__m128i*)buff_tmp[i])[j],4); ((__m128i *)buff[i])[2*j] = _mm_srai_epi16(((__m128i*)buff_tmp[i])[2*j],4);
((__m128i *)buff[i])[2*j+1] = _mm_srai_epi16(((__m128i*)buff_tmp[i])[2*j+1],4); ((__m128i *)buff[i])[2*j+1] = _mm_srai_epi16(((__m128i*)buff_tmp[i])[2*j+1],4);
} }
#else #else
......
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