Skip to content
Snippets Groups Projects
Commit d3478a9f authored by Raphael Defosseux's avatar Raphael Defosseux
Browse files

Merge remote-tracking branch 'origin/472-add-pusch-dmrs-modes' into integration-develop-nr-2020w03

parents c82fd2e4 7de6a7f2
No related branches found
No related tags found
No related merge requests found
Showing
with 581 additions and 233 deletions
...@@ -1478,6 +1478,7 @@ set(PHY_SRC_UE ...@@ -1478,6 +1478,7 @@ set(PHY_SRC_UE
${OPENAIR1_DIR}/PHY/NR_TRANSPORT/nr_ulsch_demodulation.c ${OPENAIR1_DIR}/PHY/NR_TRANSPORT/nr_ulsch_demodulation.c
${OPENAIR1_DIR}/PHY/NR_REFSIG/nr_dmrs_rx.c ${OPENAIR1_DIR}/PHY/NR_REFSIG/nr_dmrs_rx.c
${OPENAIR1_DIR}/PHY/NR_REFSIG/nr_gold.c ${OPENAIR1_DIR}/PHY/NR_REFSIG/nr_gold.c
${OPENAIR1_DIR}/PHY/NR_REFSIG/dmrs_nr.c
${OPENAIR1_DIR}/PHY/NR_UE_ESTIMATION/filt16a_32.c ${OPENAIR1_DIR}/PHY/NR_UE_ESTIMATION/filt16a_32.c
${OPENAIR1_DIR}/PHY/NR_ESTIMATION/nr_ul_channel_estimation.c ${OPENAIR1_DIR}/PHY/NR_ESTIMATION/nr_ul_channel_estimation.c
${OPENAIR1_DIR}/PHY/NR_ESTIMATION/nr_adjust_sync_gNB.c ${OPENAIR1_DIR}/PHY/NR_ESTIMATION/nr_adjust_sync_gNB.c
...@@ -1506,7 +1507,6 @@ set(PHY_SRC_UE ...@@ -1506,7 +1507,6 @@ set(PHY_SRC_UE
${OPENAIR1_DIR}/PHY/NR_UE_TRANSPORT/pss_nr.c ${OPENAIR1_DIR}/PHY/NR_UE_TRANSPORT/pss_nr.c
${OPENAIR1_DIR}/PHY/NR_UE_TRANSPORT/sss_nr.c ${OPENAIR1_DIR}/PHY/NR_UE_TRANSPORT/sss_nr.c
${OPENAIR1_DIR}/PHY/NR_UE_TRANSPORT/cic_filter_nr.c ${OPENAIR1_DIR}/PHY/NR_UE_TRANSPORT/cic_filter_nr.c
${OPENAIR1_DIR}/PHY/NR_UE_TRANSPORT/dmrs_nr.c
${OPENAIR1_DIR}/PHY/NR_UE_TRANSPORT/nr_initial_sync.c ${OPENAIR1_DIR}/PHY/NR_UE_TRANSPORT/nr_initial_sync.c
${OPENAIR1_DIR}/PHY/NR_UE_TRANSPORT/nr_pbch.c ${OPENAIR1_DIR}/PHY/NR_UE_TRANSPORT/nr_pbch.c
${OPENAIR1_DIR}/PHY/NR_UE_TRANSPORT/nr_dlsch_demodulation.c ${OPENAIR1_DIR}/PHY/NR_UE_TRANSPORT/nr_dlsch_demodulation.c
...@@ -1524,6 +1524,7 @@ set(PHY_SRC_UE ...@@ -1524,6 +1524,7 @@ set(PHY_SRC_UE
${OPENAIR1_DIR}/PHY/NR_UE_TRANSPORT/nr_ulsch_ue.c ${OPENAIR1_DIR}/PHY/NR_UE_TRANSPORT/nr_ulsch_ue.c
${OPENAIR1_DIR}/PHY/NR_REFSIG/ul_ref_seq_nr.c ${OPENAIR1_DIR}/PHY/NR_REFSIG/ul_ref_seq_nr.c
${OPENAIR1_DIR}/PHY/NR_REFSIG/nr_dmrs_rx.c ${OPENAIR1_DIR}/PHY/NR_REFSIG/nr_dmrs_rx.c
${OPENAIR1_DIR}/PHY/NR_REFSIG/dmrs_nr.c
${OPENAIR1_DIR}/PHY/NR_REFSIG/nr_gold_ue.c ${OPENAIR1_DIR}/PHY/NR_REFSIG/nr_gold_ue.c
${OPENAIR1_DIR}/PHY/NR_UE_ESTIMATION/filt16a_32.c ${OPENAIR1_DIR}/PHY/NR_UE_ESTIMATION/filt16a_32.c
${OPENAIR1_DIR}/PHY/NR_UE_ESTIMATION/nr_dl_channel_estimation.c ${OPENAIR1_DIR}/PHY/NR_UE_ESTIMATION/nr_dl_channel_estimation.c
......
...@@ -386,7 +386,7 @@ void processSlotRX( PHY_VARS_NR_UE *UE, UE_nr_rxtx_proc_t *proc) { ...@@ -386,7 +386,7 @@ void processSlotRX( PHY_VARS_NR_UE *UE, UE_nr_rxtx_proc_t *proc) {
nb_rb = 50; nb_rb = 50;
start_rb = 0; start_rb = 0;
nb_symb_sch = 12; nb_symb_sch = 12;
start_symbol = 2; start_symbol = 0;
precod_nbr_layers = 1; precod_nbr_layers = 1;
mcs = 9; mcs = 9;
harq_pid = 0; harq_pid = 0;
...@@ -739,7 +739,7 @@ void *UE_thread(void *arg) { ...@@ -739,7 +739,7 @@ void *UE_thread(void *arg) {
readBlockSize, readBlockSize,
UE->frame_parms.nb_antennas_rx),""); UE->frame_parms.nb_antennas_rx),"");
if (slot_nr==18) if (slot_nr == (20+NR_UPLINK_SLOT-DURATION_RX_TO_TX - 1)%20)
AssertFatal( writeBlockSize == AssertFatal( writeBlockSize ==
UE->rfdevice.trx_write_func(&UE->rfdevice, UE->rfdevice.trx_write_func(&UE->rfdevice,
timestamp+ timestamp+
...@@ -749,7 +749,19 @@ if (slot_nr==18) ...@@ -749,7 +749,19 @@ if (slot_nr==18)
txp, txp,
writeBlockSize, writeBlockSize,
UE->frame_parms.nb_antennas_tx, UE->frame_parms.nb_antennas_tx,
4),""); 2),"");
if (slot_nr == (20+NR_UPLINK_SLOT-DURATION_RX_TO_TX)%20)
AssertFatal( writeBlockSize ==
UE->rfdevice.trx_write_func(&UE->rfdevice,
timestamp+
(DURATION_RX_TO_TX*UE->frame_parms.samples_per_slot) -
UE->frame_parms.ofdm_symbol_size-UE->frame_parms.nb_prefix_samples0 -
openair0_cfg[0].tx_sample_advance,
txp,
writeBlockSize,
UE->frame_parms.nb_antennas_tx,
3),"");
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
......
...@@ -565,7 +565,7 @@ void init_openair0(void) { ...@@ -565,7 +565,7 @@ void init_openair0(void) {
} else if (numerology==1) { } else if (numerology==1) {
if (frame_parms[0]->threequarter_fs) { if (frame_parms[0]->threequarter_fs) {
openair0_cfg[card].sample_rate=46.08e6; openair0_cfg[card].sample_rate=46.08e6;
openair0_cfg[card].samples_per_frame = 480800; openair0_cfg[card].samples_per_frame = 460800;
} }
else { else {
openair0_cfg[card].sample_rate=61.44e6; openair0_cfg[card].sample_rate=61.44e6;
......
...@@ -690,7 +690,6 @@ typedef struct { ...@@ -690,7 +690,6 @@ typedef struct {
uint8_t frame_offset; uint8_t frame_offset;
uint16_t number_symbols; uint16_t number_symbols;
uint16_t start_symbol; uint16_t start_symbol;
uint8_t nb_re_dmrs;
uint8_t length_dmrs; uint8_t length_dmrs;
nr_pusch_freq_hopping_t pusch_freq_hopping; nr_pusch_freq_hopping_t pusch_freq_hopping;
uint8_t mcs; uint8_t mcs;
......
...@@ -153,13 +153,25 @@ int phy_init_nr_gNB(PHY_VARS_gNB *gNB, ...@@ -153,13 +153,25 @@ int phy_init_nr_gNB(PHY_VARS_gNB *gNB,
} }
} }
//------------- config PUSCH DMRS parameters(to be updated from RRC)--------------//
gNB->dmrs_UplinkConfig.pusch_dmrs_type = pusch_dmrs_type1;
gNB->dmrs_UplinkConfig.pusch_dmrs_AdditionalPosition = pusch_dmrs_pos0;
gNB->dmrs_UplinkConfig.pusch_maxLength = pusch_len1;
//--------------------------------------------------------------------------------//
nr_init_pdsch_dmrs(gNB, cfg->sch_config.physical_cell_id.value); nr_init_pdsch_dmrs(gNB, cfg->sch_config.physical_cell_id.value);
// default values until overwritten by RRCConnectionReconfiguration
for (i=0;i<MAX_NR_OF_UL_ALLOCATIONS;i++){
gNB->pusch_config.pusch_TimeDomainResourceAllocation[i] = (PUSCH_TimeDomainResourceAllocation_t *)malloc16(sizeof(PUSCH_TimeDomainResourceAllocation_t));
gNB->pusch_config.pusch_TimeDomainResourceAllocation[i]->mappingType = typeB;
}
/// Transport init necessary for NR synchro /// Transport init necessary for NR synchro
init_nr_transport(gNB); init_nr_transport(gNB);
gNB->first_run_I0_measurements = gNB->first_run_I0_measurements = 1; ///This flag used to be static. With multiple gNBs this does no longer work, hence we put it in the structure. However it has to be initialized with 1, which is performed here.
1; ///This flag used to be static. With multiple gNBs this does no longer work, hence we put it in the structure. However it has to be initialized with 1, which is performed here.
common_vars->rxdata = (int32_t **)malloc16(15*sizeof(int32_t*)); common_vars->rxdata = (int32_t **)malloc16(15*sizeof(int32_t*));
common_vars->txdataF = (int32_t **)malloc16(15*sizeof(int32_t*)); common_vars->txdataF = (int32_t **)malloc16(15*sizeof(int32_t*));
common_vars->rxdataF = (int32_t **)malloc16(15*sizeof(int32_t*)); common_vars->rxdataF = (int32_t **)malloc16(15*sizeof(int32_t*));
...@@ -507,10 +519,9 @@ void init_nr_transport(PHY_VARS_gNB *gNB) { ...@@ -507,10 +519,9 @@ void init_nr_transport(PHY_VARS_gNB *gNB) {
rel15_ul->rnti = 0x1234; rel15_ul->rnti = 0x1234;
rel15_ul->ulsch_pdu_rel15.start_rb = 0; rel15_ul->ulsch_pdu_rel15.start_rb = 0;
rel15_ul->ulsch_pdu_rel15.number_rbs = 50; rel15_ul->ulsch_pdu_rel15.number_rbs = 50;
rel15_ul->ulsch_pdu_rel15.start_symbol = 2; rel15_ul->ulsch_pdu_rel15.start_symbol = 0;
rel15_ul->ulsch_pdu_rel15.number_symbols = 12; rel15_ul->ulsch_pdu_rel15.number_symbols = 14;
rel15_ul->ulsch_pdu_rel15.nb_re_dmrs = 6; rel15_ul->ulsch_pdu_rel15.length_dmrs = gNB->dmrs_UplinkConfig.pusch_maxLength;
rel15_ul->ulsch_pdu_rel15.length_dmrs = 1;
rel15_ul->ulsch_pdu_rel15.Qm = 2; rel15_ul->ulsch_pdu_rel15.Qm = 2;
rel15_ul->ulsch_pdu_rel15.R = 679; rel15_ul->ulsch_pdu_rel15.R = 679;
rel15_ul->ulsch_pdu_rel15.mcs = 9; rel15_ul->ulsch_pdu_rel15.mcs = 9;
......
...@@ -702,7 +702,7 @@ int init_nr_ue_signal(PHY_VARS_NR_UE *ue, ...@@ -702,7 +702,7 @@ int init_nr_ue_signal(PHY_VARS_NR_UE *ue,
for (i=0; i<MAX_NR_OF_UL_ALLOCATIONS; i++) { for (i=0; i<MAX_NR_OF_UL_ALLOCATIONS; i++) {
ue->pusch_config.pusch_TimeDomainResourceAllocation[i] = (PUSCH_TimeDomainResourceAllocation_t *)malloc16(sizeof(PUSCH_TimeDomainResourceAllocation_t)); ue->pusch_config.pusch_TimeDomainResourceAllocation[i] = (PUSCH_TimeDomainResourceAllocation_t *)malloc16(sizeof(PUSCH_TimeDomainResourceAllocation_t));
ue->pusch_config.pusch_TimeDomainResourceAllocation[i]->mappingType = typeA; ue->pusch_config.pusch_TimeDomainResourceAllocation[i]->mappingType = typeB;
} }
//------------- config DMRS parameters--------------// //------------- config DMRS parameters--------------//
......
...@@ -23,6 +23,7 @@ ...@@ -23,6 +23,7 @@
#include <string.h> #include <string.h>
#include "nr_ul_estimation.h" #include "nr_ul_estimation.h"
#include "PHY/sse_intrin.h"
#include "PHY/NR_REFSIG/nr_refsig.h" #include "PHY/NR_REFSIG/nr_refsig.h"
#include "PHY/NR_UE_ESTIMATION/filt16a_32.h" #include "PHY/NR_UE_ESTIMATION/filt16a_32.h"
...@@ -35,18 +36,19 @@ int nr_pusch_channel_estimation(PHY_VARS_gNB *gNB, ...@@ -35,18 +36,19 @@ int nr_pusch_channel_estimation(PHY_VARS_gNB *gNB,
unsigned short p, unsigned short p,
unsigned char symbol, unsigned char symbol,
unsigned short bwp_start_subcarrier, unsigned short bwp_start_subcarrier,
unsigned short nb_rb_pusch) unsigned short nb_rb_pusch,
dmrs_UplinkConfig_t *dmrs_UplinkConfig)
{ {
int pilot[3280] __attribute__((aligned(16))); int pilot[3280] __attribute__((aligned(16)));
unsigned char aarx; unsigned char aarx;
unsigned short k; unsigned short k;
unsigned int pilot_cnt; unsigned int pilot_cnt,re_cnt;
int16_t ch[2],*pil,*rxF,*ul_ch; int16_t ch[2],ch_r[2],ch_l[2],*pil,*rxF,*ul_ch;
int16_t *fl,*fm,*fr,*fml,*fmr,*fmm,*fdcl,*fdcr,*fdclh,*fdcrh; int16_t *fl,*fm,*fr,*fml,*fmr,*fmm,*fdcl,*fdcr,*fdclh,*fdcrh;
int ch_offset,symbol_offset, length_dmrs, UE_id = 0; int ch_offset,symbol_offset, length_dmrs, UE_id = 0;
unsigned short n_idDMRS[2] = {0,1}; //to update from pusch config unsigned short n_idDMRS[2] = {0,1}; //to update from pusch config
int32_t temp_in_ifft_0[8192*2] __attribute__((aligned(32)));
int32_t **ul_ch_estimates_time = gNB->pusch_vars[UE_id]->ul_ch_estimates_time; int32_t **ul_ch_estimates_time = gNB->pusch_vars[UE_id]->ul_ch_estimates_time;
__m128i *ul_ch_128;
#ifdef DEBUG_CH #ifdef DEBUG_CH
FILE *debug_ch_est; FILE *debug_ch_est;
...@@ -115,21 +117,21 @@ int nr_pusch_channel_estimation(PHY_VARS_gNB *gNB, ...@@ -115,21 +117,21 @@ int nr_pusch_channel_estimation(PHY_VARS_gNB *gNB,
//------------------generate DMRS------------------// //------------------generate DMRS------------------//
length_dmrs = 1; //to update from pusch config length_dmrs = gNB->dmrs_UplinkConfig.pusch_maxLength;
nr_gold_pusch(gNB, symbol, n_idDMRS, length_dmrs); nr_gold_pusch(gNB, symbol, n_idDMRS, length_dmrs);
nr_pusch_dmrs_rx(gNB, Ns, gNB->nr_gold_pusch[gNB_offset][Ns][0], &pilot[0], 1000, 0, nb_rb_pusch); nr_pusch_dmrs_rx(gNB, Ns, gNB->nr_gold_pusch[gNB_offset][Ns][0], &pilot[0], 1000, 0, nb_rb_pusch, dmrs_UplinkConfig->pusch_dmrs_type);
//------------------------------------------------// //------------------------------------------------//
for (aarx=0; aarx<gNB->frame_parms.nb_antennas_rx; aarx++) { for (aarx=0; aarx<gNB->frame_parms.nb_antennas_rx; aarx++) {
pil = (int16_t *)&pilot[0]; pil = (int16_t *)&pilot[0];
rxF = (int16_t *)&rxdataF[aarx][(symbol_offset+k+nushift)]; rxF = (int16_t *)&rxdataF[aarx][(symbol_offset+k+nushift)];
ul_ch = (int16_t *)&ul_ch_estimates[aarx][ch_offset]; ul_ch = (int16_t *)&ul_ch_estimates[aarx][ch_offset];
memset(ul_ch,0,4*(gNB->frame_parms.ofdm_symbol_size)); memset(ul_ch,0,4*(gNB->frame_parms.ofdm_symbol_size));
#ifdef DEBUG_PUSCH #ifdef DEBUG_PUSCH
printf("ch est pilot addr %p RB_DL %d\n",&pilot[0], gNB->frame_parms.N_RB_UL); printf("ch est pilot addr %p RB_DL %d\n",&pilot[0], gNB->frame_parms.N_RB_UL);
...@@ -139,6 +141,9 @@ int nr_pusch_channel_estimation(PHY_VARS_gNB *gNB, ...@@ -139,6 +141,9 @@ int nr_pusch_channel_estimation(PHY_VARS_gNB *gNB,
#endif #endif
//if ((gNB->frame_parms.N_RB_UL&1)==0) { //if ((gNB->frame_parms.N_RB_UL&1)==0) {
if (dmrs_UplinkConfig->pusch_dmrs_type == pusch_dmrs_type1){
// Treat first 2 pilots specially (left edge) // Treat first 2 pilots specially (left edge)
ch[0] = (int16_t)(((int32_t)pil[0]*rxF[0] - (int32_t)pil[1]*rxF[1])>>15); ch[0] = (int16_t)(((int32_t)pil[0]*rxF[0] - (int32_t)pil[1]*rxF[1])>>15);
ch[1] = (int16_t)(((int32_t)pil[0]*rxF[1] + (int32_t)pil[1]*rxF[0])>>15); ch[1] = (int16_t)(((int32_t)pil[0]*rxF[1] + (int32_t)pil[1]*rxF[0])>>15);
...@@ -148,6 +153,7 @@ int nr_pusch_channel_estimation(PHY_VARS_gNB *gNB, ...@@ -148,6 +153,7 @@ int nr_pusch_channel_estimation(PHY_VARS_gNB *gNB,
printf("pilot 0 : rxF - > (%d,%d) addr %p ch -> (%d,%d), pil -> (%d,%d) \n",rxF[0],rxF[1],&rxF[0],ch[0],ch[1],pil[0],pil[1]); printf("pilot 0 : rxF - > (%d,%d) addr %p ch -> (%d,%d), pil -> (%d,%d) \n",rxF[0],rxF[1],&rxF[0],ch[0],ch[1],pil[0],pil[1]);
printf("data 0 : rxF - > (%d,%d) addr %p ch -> (%d,%d), pil -> (%d,%d) \n",rxF[2],rxF[3],&rxF[2],ch[0],ch[1],pil[0],pil[1]); printf("data 0 : rxF - > (%d,%d) addr %p ch -> (%d,%d), pil -> (%d,%d) \n",rxF[2],rxF[3],&rxF[2],ch[0],ch[1],pil[0],pil[1]);
#endif #endif
multadd_real_vector_complex_scalar(fl, multadd_real_vector_complex_scalar(fl,
ch, ch,
ul_ch, ul_ch,
...@@ -196,28 +202,33 @@ int nr_pusch_channel_estimation(PHY_VARS_gNB *gNB, ...@@ -196,28 +202,33 @@ int nr_pusch_channel_estimation(PHY_VARS_gNB *gNB,
ch[0] = (int16_t)(((int32_t)pil[0]*rxF[0] - (int32_t)pil[1]*rxF[1])>>15); ch[0] = (int16_t)(((int32_t)pil[0]*rxF[0] - (int32_t)pil[1]*rxF[1])>>15);
ch[1] = (int16_t)(((int32_t)pil[0]*rxF[1] + (int32_t)pil[1]*rxF[0])>>15); ch[1] = (int16_t)(((int32_t)pil[0]*rxF[1] + (int32_t)pil[1]*rxF[0])>>15);
#ifdef DEBUG_CH
fprintf(debug_ch_est, "pilot %u : rxF - > (%d,%d) ch -> (%d,%d), pil -> (%d,%d) \n",pilot_cnt,rxF[0],rxF[1],ch[0],ch[1],pil[0],pil[1]); #ifdef DEBUG_PUSCH
//printf("pilot %d : rxF - > (%d,%d) ch -> (%d,%d), pil -> (%d,%d) \n",pilot_cnt,rxF[0],rxF[1],ch[0],ch[1],pil[0],pil[1]); printf("pilot 1 : rxF - > (%d,%d) ch -> (%d,%d), pil -> (%d,%d) \n",rxF[0],rxF[1],ch[0],ch[1],pil[0],pil[1]);
#endif #endif
multadd_real_vector_complex_scalar(fm, multadd_real_vector_complex_scalar(fml,
ch, ch,
ul_ch, ul_ch,
8); 8);
pil+=2; pil+=2;
re_offset = (re_offset+2) % gNB->frame_parms.ofdm_symbol_size; re_offset = (re_offset+2) % gNB->frame_parms.ofdm_symbol_size;
rxF = (int16_t *)&rxdataF[aarx][(symbol_offset+nushift+re_offset)]; rxF = (int16_t *)&rxdataF[aarx][(symbol_offset+nushift+re_offset)];
//printf("ul_ch addr %p\n",ul_ch);
ch[0] = (int16_t)(((int32_t)pil[0]*rxF[0] - (int32_t)pil[1]*rxF[1])>>15); ch[0] = (int16_t)(((int32_t)pil[0]*rxF[0] - (int32_t)pil[1]*rxF[1])>>15);
ch[1] = (int16_t)(((int32_t)pil[0]*rxF[1] + (int32_t)pil[1]*rxF[0])>>15); ch[1] = (int16_t)(((int32_t)pil[0]*rxF[1] + (int32_t)pil[1]*rxF[0])>>15);
#ifdef DEBUG_PUSCH
printf("pilot %u : rxF - > (%d,%d) ch -> (%d,%d), pil -> (%d,%d) \n",pilot_cnt+1,rxF[0],rxF[1],ch[0],ch[1],pil[0],pil[1]); #ifdef DEBUG_PUSCH
#endif printf("pilot %u : rxF - > (%d,%d) ch -> (%d,%d), pil -> (%d,%d) \n",pilot_cnt+1,rxF[0],rxF[1],ch[0],ch[1],pil[0],pil[1]);
#endif
multadd_real_vector_complex_scalar(fmm, multadd_real_vector_complex_scalar(fmm,
ch, ch,
ul_ch, ul_ch,
8); 8);
//for (int i= 0; i<16; i++)
//printf("ul_ch addr %p %d\n", ul_ch+i, *(ul_ch+i));
pil+=2; pil+=2;
re_offset = (re_offset+2) % gNB->frame_parms.ofdm_symbol_size; re_offset = (re_offset+2) % gNB->frame_parms.ofdm_symbol_size;
rxF = (int16_t *)&rxdataF[aarx][(symbol_offset+nushift+re_offset)]; rxF = (int16_t *)&rxdataF[aarx][(symbol_offset+nushift+re_offset)];
...@@ -332,65 +343,153 @@ int nr_pusch_channel_estimation(PHY_VARS_gNB *gNB, ...@@ -332,65 +343,153 @@ int nr_pusch_channel_estimation(PHY_VARS_gNB *gNB,
printf("%d\n",idxP); printf("%d\n",idxP);
} }
#endif #endif
} else { //pusch_dmrs_type2 |p_r,p_l,d,d,d,d,p_r,p_l,d,d,d,d|
// Treat first DMRS specially (left edge)
rxF = (int16_t *)&rxdataF[aarx][(symbol_offset+nushift+re_offset)];
ul_ch[0] = (int16_t)(((int32_t)pil[0]*rxF[0] - (int32_t)pil[1]*rxF[1])>>15);
ul_ch[1] = (int16_t)(((int32_t)pil[0]*rxF[1] + (int32_t)pil[1]*rxF[0])>>15);
pil+=2;
ul_ch+=2;
re_offset = (re_offset + 1)%gNB->frame_parms.ofdm_symbol_size;
ch_offset++;
for (re_cnt = 1; re_cnt < (nb_rb_pusch*NR_NB_SC_PER_RB) - 5; re_cnt+=6){
rxF = (int16_t *)&rxdataF[aarx][(symbol_offset+nushift+re_offset)];
ch_l[0] = (int16_t)(((int32_t)pil[0]*rxF[0] - (int32_t)pil[1]*rxF[1])>>15);
ch_l[1] = (int16_t)(((int32_t)pil[0]*rxF[1] + (int32_t)pil[1]*rxF[0])>>15);
ul_ch[0] = ch_l[0];
ul_ch[1] = ch_l[1];
pil+=2;
ul_ch+=2;
ch_offset++;
multadd_real_four_symbols_vector_complex_scalar(filt8_ml2,
ch_l,
ul_ch);
re_offset = (re_offset+5)%gNB->frame_parms.ofdm_symbol_size;
rxF = (int16_t *)&rxdataF[aarx][(symbol_offset+nushift+re_offset)];
ch_r[0] = (int16_t)(((int32_t)pil[0]*rxF[0] - (int32_t)pil[1]*rxF[1])>>15);
ch_r[1] = (int16_t)(((int32_t)pil[0]*rxF[1] + (int32_t)pil[1]*rxF[0])>>15);
multadd_real_four_symbols_vector_complex_scalar(filt8_mr2,
ch_r,
ul_ch);
//for (int re_idx = 0; re_idx < 8; re_idx+=2)
//printf("ul_ch = %d + j*%d\n", ul_ch[re_idx], ul_ch[re_idx+1]);
ul_ch+=8;
ch_offset+=4;
ul_ch[0] = ch_r[0];
ul_ch[1] = ch_r[1];
pil+=2;
ul_ch+=2;
ch_offset++;
re_offset = (re_offset + 1)%gNB->frame_parms.ofdm_symbol_size;
}
// Treat last pilot specially (right edge)
rxF = (int16_t *)&rxdataF[aarx][(symbol_offset+nushift+re_offset)];
ch_l[0] = (int16_t)(((int32_t)pil[0]*rxF[0] - (int32_t)pil[1]*rxF[1])>>15);
ch_l[1] = (int16_t)(((int32_t)pil[0]*rxF[1] + (int32_t)pil[1]*rxF[0])>>15);
ul_ch[0] = ch_l[0];
ul_ch[1] = ch_l[1];
ul_ch+=2;
ch_offset++;
multadd_real_four_symbols_vector_complex_scalar(filt8_rr1,
ch_l,
ul_ch);
multadd_real_four_symbols_vector_complex_scalar(filt8_rr2,
ch_r,
ul_ch);
ul_ch_128 = (__m128i *)&ul_ch_estimates[aarx][ch_offset];
ul_ch_128[0] = _mm_slli_epi16 (ul_ch_128[0], 2);
}
// Convert to time domain // Convert to time domain
memset(temp_in_ifft_0, 0, gNB->frame_parms.ofdm_symbol_size*sizeof(int32_t));
memcpy(temp_in_ifft_0, &ul_ch_estimates[aarx][symbol_offset], nb_rb_pusch * NR_NB_SC_PER_RB * sizeof(int32_t)); switch (gNB->frame_parms.ofdm_symbol_size) {
case 128:
switch (gNB->frame_parms.ofdm_symbol_size) { idft128((int16_t*) &ul_ch_estimates[aarx][symbol_offset],
case 128: (int16_t*) ul_ch_estimates_time[aarx],
idft128((int16_t*) temp_in_ifft_0, 1);
(int16_t*) ul_ch_estimates_time[aarx], break;
1);
break; case 256:
idft256((int16_t*) &ul_ch_estimates[aarx][symbol_offset],
case 256: (int16_t*) ul_ch_estimates_time[aarx],
idft256((int16_t*) temp_in_ifft_0, 1);
(int16_t*) ul_ch_estimates_time[aarx], break;
1);
break; case 512:
idft512((int16_t*) &ul_ch_estimates[aarx][symbol_offset],
case 512: (int16_t*) ul_ch_estimates_time[aarx],
idft512((int16_t*) temp_in_ifft_0, 1);
(int16_t*) ul_ch_estimates_time[aarx], break;
1);
break; case 1024:
idft1024((int16_t*) &ul_ch_estimates[aarx][symbol_offset],
case 1024: (int16_t*) ul_ch_estimates_time[aarx],
idft1024((int16_t*) temp_in_ifft_0, 1);
(int16_t*) ul_ch_estimates_time[aarx], break;
1);
break; case 1536:
idft1536((int16_t*) &ul_ch_estimates[aarx][symbol_offset],
case 1536: (int16_t*) ul_ch_estimates_time[aarx],
idft1536((int16_t*) temp_in_ifft_0, 1);
(int16_t*) ul_ch_estimates_time[aarx], break;
1);
break; case 2048:
idft2048((int16_t*) &ul_ch_estimates[aarx][symbol_offset],
case 2048: (int16_t*) ul_ch_estimates_time[aarx],
idft2048((int16_t*) temp_in_ifft_0, 1);
(int16_t*) ul_ch_estimates_time[aarx], break;
1);
break; case 4096:
idft4096((int16_t*) &ul_ch_estimates[aarx][symbol_offset],
case 4096: (int16_t*) ul_ch_estimates_time[aarx],
idft4096((int16_t*) temp_in_ifft_0, 1);
(int16_t*) ul_ch_estimates_time[aarx], break;
1);
break; case 8192:
idft8192((int16_t*) &ul_ch_estimates[aarx][symbol_offset],
case 8192: (int16_t*) ul_ch_estimates_time[aarx],
idft8192((int16_t*) temp_in_ifft_0, 1);
(int16_t*) ul_ch_estimates_time[aarx], break;
1);
break; default:
idft512((int16_t*) &ul_ch_estimates[aarx][symbol_offset],
default: (int16_t*) ul_ch_estimates_time[aarx],
idft512((int16_t*) temp_in_ifft_0, 1);
(int16_t*) ul_ch_estimates_time[aarx], break;
1); }
break;
}
} }
#ifdef DEBUG_CH #ifdef DEBUG_CH
......
...@@ -45,7 +45,8 @@ ...@@ -45,7 +45,8 @@
unsigned short p, unsigned short p,
unsigned char symbol, unsigned char symbol,
unsigned short bwp_start_subcarrier, unsigned short bwp_start_subcarrier,
unsigned short nb_rb_pusch); unsigned short nb_rb_pusch,
dmrs_UplinkConfig_t *dmrs_UplinkConfig);
int nr_est_timing_advance_pusch(PHY_VARS_gNB* phy_vars_gNB, int UE_id); int nr_est_timing_advance_pusch(PHY_VARS_gNB* phy_vars_gNB, int UE_id);
......
...@@ -33,6 +33,147 @@ ...@@ -33,6 +33,147 @@
#include "PHY/NR_REFSIG/ss_pbch_nr.h" #include "PHY/NR_REFSIG/ss_pbch_nr.h"
#include "PHY/NR_REFSIG/dmrs_nr.h" #include "PHY/NR_REFSIG/dmrs_nr.h"
/***********************************************************************/
// TS 38.211 Table 6.4.1.1.3-3: PUSCH DMRS positions l' within a slot for single-symbol DMRS and intra-slot frequency hopping disabled.
// The first 4 colomns are PUSCH mapping type A and the last 4 colomns are PUSCH mapping type B.
// When l' = l0, it is represented by 1
// E.g. when symbol duration is 12 in colomn 7, value 1057 ('10000100001') which means l' = l0, 5, 10.
int32_t table_6_4_1_1_3_3_pusch_dmrs_positions_l [12][8] = { // Duration in symbols
{-1, -1, -1, -1, 1, 1, 1, 1}, //<4 // (DMRS l' position)
{1, 1, 1, 1, 1, 1, 1, 1}, //4 // (DMRS l' position)
{1, 1, 1, 1, 1, 5, 5, 5}, //5 // (DMRS l' position)
{1, 1, 1, 1, 1, 5, 5, 5}, //6 // (DMRS l' position)
{1, 1, 1, 1, 1, 5, 5, 5}, //7 // (DMRS l' position)
{1, 129, 129, 129, 1, 65, 73, 73}, //8 // (DMRS l' position)
{1, 129, 129, 129, 1, 65, 73, 73}, //9 // (DMRS l' position)
{1, 513, 577, 577, 1, 257, 273, 585}, //10 // (DMRS l' position)
{1, 513, 577, 577, 1, 257, 273, 585}, //11 // (DMRS l' position)
{1, 513, 577, 2337, 1, 1025, 1057, 585}, //12 // (DMRS l' position)
{1, 2049, 2177, 2337, 1, 1025, 1057, 585}, //13 // (DMRS l' position)
{1, 2049, 2177, 2337, 1, 1025, 1057, 585}, //14 // (DMRS l' position)
};
// TS 38.211 Table 6.4.1.1.3-4: PUSCH DMRS positions l' within a slot for double-symbol DMRS and intra-slot frequency hopping disabled.
// The first 4 colomns are PUSCH mapping type A and the last 4 colomns are PUSCH mapping type B.
// When l' = l0, it is represented by 1
int32_t table_6_4_1_1_3_4_pusch_dmrs_positions_l [12][8] = { // Duration in symbols
{-1, -1, -1, -1, -1, -1, -1, -1}, //<4 // (DMRS l' position)
{1, 1, -1, -1, -1, -1, -1, -1}, //4 // (DMRS l' position)
{1, 1, -1, -1, 1, 1, -1, -1}, //5 // (DMRS l' position)
{1, 1, -1, -1, 1, 1, -1, -1}, //6 // (DMRS l' position)
{1, 1, -1, -1, 1, 1, -1, -1}, //7 // (DMRS l' position)
{1, 1, -1, -1, 1, 33, -1, -1}, //8 // (DMRS l' position)
{1, 1, -1, -1, 1, 33, -1, -1}, //9 // (DMRS l' position)
{1, 257, -1, -1, 1, 129, -1, -1}, //10 // (DMRS l' position)
{1, 257, -1, -1, 1, 129, -1, -1}, //11 // (DMRS l' position)
{1, 257, -1, -1, 1, 513, -1, -1}, //12 // (DMRS l' position)
{1, 1025, -1, -1, 1, 513, -1, -1}, //13 // (DMRS l' position)
{1, 1025, -1, -1, 1, 513, -1, -1}, //14 // (DMRS l' position)
};
int32_t get_l_prime(uint8_t duration_in_symbols, uint8_t mapping_type, pusch_dmrs_AdditionalPosition_t additional_pos, pusch_maxLength_t pusch_maxLength) {
uint8_t row, colomn;
int32_t l_prime;
colomn = additional_pos;
if (mapping_type == typeB)
colomn += 4;
if (duration_in_symbols < 4)
row = 0;
else
row = duration_in_symbols - 3;
if (pusch_maxLength == pusch_len1)
l_prime = table_6_4_1_1_3_3_pusch_dmrs_positions_l[row][colomn];
else
l_prime = table_6_4_1_1_3_4_pusch_dmrs_positions_l[row][colomn];
AssertFatal(l_prime>0,"invalid l_prime < 0\n");
return l_prime;
}
/*******************************************************************
*
* NAME : is_dmrs_symbol
*
* PARAMETERS : l ofdm symbol index within slot
* k subcarrier index
* start_sc first subcarrier index
* k_prime index alternating 0 and 1
* n index starting 0,1,...
* delta see Table 6.4.1.1.3
* duration_in_symbols number of scheduled PUSCH ofdm symbols
* dmrs_UplinkConfig DMRS uplink configuration
* mapping_type PUSCH mapping type (A or B)
* ofdm_symbol_size IFFT size
*
* RETURN : 0 if symbol(k,l) is data, or 1 if symbol(k,l) is dmrs
*
* DESCRIPTION : 3GPP TS 38.211 6.4.1.1 Demodulation reference signal for PUSCH
*
*********************************************************************/
uint8_t is_dmrs_symbol(uint8_t l,
uint16_t k,
uint16_t start_sc,
uint8_t k_prime,
uint16_t n,
uint8_t delta,
uint8_t duration_in_symbols,
dmrs_UplinkConfig_t *dmrs_UplinkConfig,
uint8_t mapping_type,
uint16_t ofdm_symbol_size) {
uint8_t is_dmrs_freq, is_dmrs_time, dmrs_type, l0;
int32_t l_prime_mask;
pusch_dmrs_AdditionalPosition_t additional_pos;
is_dmrs_freq = 0;
is_dmrs_time = 0;
dmrs_type = dmrs_UplinkConfig->pusch_dmrs_type;
additional_pos = dmrs_UplinkConfig->pusch_dmrs_AdditionalPosition;
l0 = get_l0_ul(mapping_type, 2);
l_prime_mask = get_l_prime(duration_in_symbols, mapping_type, additional_pos, dmrs_UplinkConfig->pusch_maxLength);
if (k == ((start_sc+get_dmrs_freq_idx_ul(n, k_prime, delta, dmrs_type))%ofdm_symbol_size))
is_dmrs_freq = 1;
if (l_prime_mask == 1){
if (l == l0)
is_dmrs_time = 1;
} else if ( (l==l0) || (((l_prime_mask>>l)&1) == 1 && l!=0) )
is_dmrs_time = 1;
if (dmrs_UplinkConfig->pusch_maxLength == pusch_len2){
if (((l_prime_mask>>(l-1))&1) == 1 && l!=0 && l!=1)
is_dmrs_time = 1;
if (l-1 == l0)
is_dmrs_time = 1;
}
if (is_dmrs_time && is_dmrs_freq)
return 1;
else
return 0;
}
/******************************************************************* /*******************************************************************
* *
* NAME : pseudo_random_gold_sequence * NAME : pseudo_random_gold_sequence
......
...@@ -57,6 +57,19 @@ void generate_dmrs_pbch(uint32_t dmrs_pbch_bitmap[DMRS_PBCH_I_SSB][DMRS_PBCH_N_H ...@@ -57,6 +57,19 @@ void generate_dmrs_pbch(uint32_t dmrs_pbch_bitmap[DMRS_PBCH_I_SSB][DMRS_PBCH_N_H
uint8_t get_l0_ul(uint8_t mapping_type, uint8_t dmrs_typeA_position); uint8_t get_l0_ul(uint8_t mapping_type, uint8_t dmrs_typeA_position);
uint16_t get_dmrs_freq_idx_ul(uint16_t n, uint8_t k_prime, uint8_t delta, uint8_t dmrs_type); uint16_t get_dmrs_freq_idx_ul(uint16_t n, uint8_t k_prime, uint8_t delta, uint8_t dmrs_type);
int32_t get_l_prime(uint8_t duration_in_symbols, uint8_t mapping_type, pusch_dmrs_AdditionalPosition_t additional_pos, pusch_maxLength_t pusch_maxLength);
uint8_t is_dmrs_symbol(uint8_t l,
uint16_t k,
uint16_t start_sc,
uint8_t k_prime,
uint16_t n,
uint8_t delta,
uint8_t duration_in_symbols,
dmrs_UplinkConfig_t *dmrs_UplinkConfig,
uint8_t mapping_type,
uint16_t ofdm_symbol_size);
#undef EXTERN #undef EXTERN
#endif /* DMRS_NR_H */ #endif /* DMRS_NR_H */
......
...@@ -56,9 +56,10 @@ int nr_pusch_dmrs_rx(PHY_VARS_gNB *gNB, ...@@ -56,9 +56,10 @@ int nr_pusch_dmrs_rx(PHY_VARS_gNB *gNB,
int32_t *output, int32_t *output,
unsigned short p, unsigned short p,
unsigned char lp, unsigned char lp,
unsigned short nb_pusch_rb) unsigned short nb_pusch_rb,
uint8_t dmrs_type)
{ {
int8_t w,config_type; int8_t w;
short *mod_table; short *mod_table;
unsigned char idx=0; unsigned char idx=0;
...@@ -66,18 +67,16 @@ int nr_pusch_dmrs_rx(PHY_VARS_gNB *gNB, ...@@ -66,18 +67,16 @@ int nr_pusch_dmrs_rx(PHY_VARS_gNB *gNB,
array_of_w *wf; array_of_w *wf;
array_of_w *wt; array_of_w *wt;
config_type = 0; //to be updated by higher layer wf = (dmrs_type==pusch_dmrs_type1) ? wf1 : wf2;
wt = (dmrs_type==pusch_dmrs_type1) ? wt1 : wt2;
wf = (config_type==0) ? wf1 : wf2; if (dmrs_type > 2)
wt = (config_type==0) ? wt1 : wt2; LOG_E(PHY,"Bad PUSCH DMRS config type %d\n", dmrs_type);
if (config_type > 1) if ((p>=1000) && (p<((dmrs_type==pusch_dmrs_type1) ? 1008 : 1012))) {
LOG_E(PHY,"Bad PUSCH DMRS config type %d\n", config_type);
if ((p>=1000) && (p<((config_type==0) ? 1008 : 1012))) {
if (gNB->frame_parms.Ncp == NORMAL) { if (gNB->frame_parms.Ncp == NORMAL) {
for (int i=0; i<nb_pusch_rb*((config_type==0) ? 6:4); i++) { for (int i=0; i<nb_pusch_rb*((dmrs_type==pusch_dmrs_type1) ? 6:4); i++) {
w = (wf[p-1000][i&1])*(wt[p-1000][lp]); w = (wf[p-1000][i&1])*(wt[p-1000][lp]);
mod_table = (w==1) ? nr_rx_mod_table : nr_rx_nmod_table; mod_table = (w==1) ? nr_rx_mod_table : nr_rx_nmod_table;
...@@ -86,7 +85,7 @@ int nr_pusch_dmrs_rx(PHY_VARS_gNB *gNB, ...@@ -86,7 +85,7 @@ int nr_pusch_dmrs_rx(PHY_VARS_gNB *gNB,
((int16_t*)output)[i<<1] = mod_table[(NR_MOD_TABLE_QPSK_OFFSET + idx)<<1]; ((int16_t*)output)[i<<1] = mod_table[(NR_MOD_TABLE_QPSK_OFFSET + idx)<<1];
((int16_t*)output)[(i<<1)+1] = mod_table[((NR_MOD_TABLE_QPSK_OFFSET + idx)<<1) + 1]; ((int16_t*)output)[(i<<1)+1] = mod_table[((NR_MOD_TABLE_QPSK_OFFSET + idx)<<1) + 1];
#ifdef DEBUG_PUSCH #ifdef DEBUG_PUSCH
printf("nr_pusch_dmrs_rx dmrs config type %d port %d nb_pusch_rb %d\n", config_type, p, nb_pusch_rb); printf("nr_pusch_dmrs_rx dmrs config type %d port %d nb_pusch_rb %d\n", dmrs_type, p, nb_pusch_rb);
printf("wf[%d] = %d wt[%d]= %d\n", i&1, wf[p-1000][i&1], lp, wt[p-1000][lp]); printf("wf[%d] = %d wt[%d]= %d\n", i&1, wf[p-1000][i&1], lp, wt[p-1000][lp]);
printf("i %d idx %d pusch gold %u b0-b1 %d-%d mod_dmrs %d %d\n", i, idx, nr_gold_pusch[(i<<1)>>5], (((nr_gold_pusch[(i<<1)>>5])>>((i<<1)&0x1f))&1), printf("i %d idx %d pusch gold %u b0-b1 %d-%d mod_dmrs %d %d\n", i, idx, nr_gold_pusch[(i<<1)>>5], (((nr_gold_pusch[(i<<1)>>5])>>((i<<1)&0x1f))&1),
(((nr_gold_pusch[((i<<1)+1)>>5])>>(((i<<1)+1)&0x1f))&1), ((int16_t*)output)[i<<1], ((int16_t*)output)[(i<<1)+1]); (((nr_gold_pusch[((i<<1)+1)>>5])>>(((i<<1)+1)&0x1f))&1), ((int16_t*)output)[i<<1], ((int16_t*)output)[(i<<1)+1]);
......
...@@ -47,5 +47,6 @@ int nr_pusch_dmrs_rx(PHY_VARS_gNB *gNB, ...@@ -47,5 +47,6 @@ int nr_pusch_dmrs_rx(PHY_VARS_gNB *gNB,
int32_t *output, int32_t *output,
unsigned short p, unsigned short p,
unsigned char lp, unsigned char lp,
unsigned short nb_pusch_rb); unsigned short nb_pusch_rb,
uint8_t dmrs_type);
#endif #endif
...@@ -338,8 +338,7 @@ void nr_fill_ulsch(PHY_VARS_gNB *gNB, ...@@ -338,8 +338,7 @@ void nr_fill_ulsch(PHY_VARS_gNB *gNB,
rel15_ul->ulsch_pdu_rel15.number_rbs = ulsch_pdu->rb_size; rel15_ul->ulsch_pdu_rel15.number_rbs = ulsch_pdu->rb_size;
rel15_ul->ulsch_pdu_rel15.start_symbol = ulsch_pdu->start_symbol_index; rel15_ul->ulsch_pdu_rel15.start_symbol = ulsch_pdu->start_symbol_index;
rel15_ul->ulsch_pdu_rel15.number_symbols = ulsch_pdu->nr_of_symbols; rel15_ul->ulsch_pdu_rel15.number_symbols = ulsch_pdu->nr_of_symbols;
rel15_ul->ulsch_pdu_rel15.nb_re_dmrs = 6; //where should this come from? rel15_ul->ulsch_pdu_rel15.length_dmrs = gNB->dmrs_UplinkConfig.pusch_maxLength;
rel15_ul->ulsch_pdu_rel15.length_dmrs = 1; //where should this come from?
rel15_ul->ulsch_pdu_rel15.Qm = ulsch_pdu->qam_mod_order; rel15_ul->ulsch_pdu_rel15.Qm = ulsch_pdu->qam_mod_order;
rel15_ul->ulsch_pdu_rel15.mcs = ulsch_pdu->mcs_index; rel15_ul->ulsch_pdu_rel15.mcs = ulsch_pdu->mcs_index;
rel15_ul->ulsch_pdu_rel15.rv = ulsch_pdu->pusch_data.rv_index; rel15_ul->ulsch_pdu_rel15.rv = ulsch_pdu->pusch_data.rv_index;
......
...@@ -32,7 +32,6 @@ ...@@ -32,7 +32,6 @@
#include "nr_sch_dmrs.h" #include "nr_sch_dmrs.h"
/*Table 7.4.1.1.2-1 and 7.4.1.1.2-2 38211 Columns: ap - CDM group - Delta - Wf(0) - Wf(1) - Wt(0) - Wt(1)*/ /*Table 7.4.1.1.2-1 and 7.4.1.1.2-2 38211 Columns: ap - CDM group - Delta - Wf(0) - Wf(1) - Wt(0) - Wt(1)*/
/*Table 6.4.1.1.3-1 is identical to Table 7.4.1.1.2-1 and Table 6.4.1.1.3-2 is identical to Table 7.4.1.1.2-2. UL DMRS can reuse these tables*/ /*Table 6.4.1.1.3-1 is identical to Table 7.4.1.1.2-1 and Table 6.4.1.1.3-2 is identical to Table 7.4.1.1.2-2. UL DMRS can reuse these tables*/
int8_t pdsch_dmrs_1[8][7] = {{0,0,0,1,1,1,1}, int8_t pdsch_dmrs_1[8][7] = {{0,0,0,1,1,1,1},
...@@ -57,11 +56,6 @@ int8_t pdsch_dmrs_2[12][7] = {{0,0,0,1,1,1,1}, ...@@ -57,11 +56,6 @@ int8_t pdsch_dmrs_2[12][7] = {{0,0,0,1,1,1,1},
{10,2,4,1,1,1,-1}, {10,2,4,1,1,1,-1},
{11,2,4,1,-1,1,-1}}; {11,2,4,1,-1,1,-1}};
void get_l_prime(uint8_t *l_prime, uint8_t n_symbs) {
for (int i=0; i<n_symbs; i++)
*(l_prime+i) = i;
}
void get_antenna_ports(uint8_t *ap, uint8_t n_symbs, uint8_t config) { void get_antenna_ports(uint8_t *ap, uint8_t n_symbs, uint8_t config) {
if (config == NFAPI_NR_DMRS_TYPE1) if (config == NFAPI_NR_DMRS_TYPE1)
for (int i=0; i<(4+((n_symbs-1)<<2)); i++) for (int i=0; i<(4+((n_symbs-1)<<2)); i++)
......
...@@ -30,13 +30,14 @@ ...@@ -30,13 +30,14 @@
* \warning * \warning
*/ */
#ifndef NR_SCH_DMRS_H
#define NR_SCH_DMRS_H
#include "PHY/defs_nr_common.h" #include "PHY/defs_nr_common.h"
#define NR_PDSCH_DMRS_ANTENNA_PORT0 1000 #define NR_PDSCH_DMRS_ANTENNA_PORT0 1000
#define NR_PDSCH_DMRS_NB_ANTENNA_PORTS 12 #define NR_PDSCH_DMRS_NB_ANTENNA_PORTS 12
void get_l_prime(uint8_t *l_prime, uint8_t n_symbs);
void get_antenna_ports(uint8_t *ap, uint8_t n_symbs, uint8_t config); void get_antenna_ports(uint8_t *ap, uint8_t n_symbs, uint8_t config);
void get_Wt(int8_t *Wt, uint8_t ap, uint8_t config); void get_Wt(int8_t *Wt, uint8_t ap, uint8_t config);
...@@ -48,3 +49,5 @@ uint8_t get_delta(uint8_t ap, uint8_t config); ...@@ -48,3 +49,5 @@ uint8_t get_delta(uint8_t ap, uint8_t config);
uint16_t get_dmrs_freq_idx(uint16_t n, uint8_t k_prime, uint8_t delta, uint8_t dmrs_type); uint16_t get_dmrs_freq_idx(uint16_t n, uint8_t k_prime, uint8_t delta, uint8_t dmrs_type);
uint8_t get_l0(uint8_t mapping_type, uint8_t dmrs_typeA_position); uint8_t get_l0(uint8_t mapping_type, uint8_t dmrs_typeA_position);
#endif
...@@ -62,6 +62,7 @@ void nr_rx_pusch(PHY_VARS_gNB *gNB, ...@@ -62,6 +62,7 @@ void nr_rx_pusch(PHY_VARS_gNB *gNB,
@param start_rb The starting RB in the RB allocation (used for Resource Allocation Type 1 in NR) @param start_rb The starting RB in the RB allocation (used for Resource Allocation Type 1 in NR)
@param nb_rb_pusch The number of RBs allocated (used for Resource Allocation Type 1 in NR) @param nb_rb_pusch The number of RBs allocated (used for Resource Allocation Type 1 in NR)
@param frame_parms, Pointer to frame descriptor structure @param frame_parms, Pointer to frame descriptor structure
@param is_dmrs_symbol, flag to indicate wether this OFDM symbol contains DMRS symbols or not.
*/ */
void nr_ulsch_extract_rbs_single(int **rxdataF, void nr_ulsch_extract_rbs_single(int **rxdataF,
...@@ -73,14 +74,19 @@ void nr_ulsch_extract_rbs_single(int **rxdataF, ...@@ -73,14 +74,19 @@ void nr_ulsch_extract_rbs_single(int **rxdataF,
unsigned char symbol, unsigned char symbol,
unsigned short start_rb, unsigned short start_rb,
unsigned short nb_rb_pusch, unsigned short nb_rb_pusch,
NR_DL_FRAME_PARMS *frame_parms); NR_DL_FRAME_PARMS *frame_parms,
uint8_t dmrs_symbol,
uint16_t number_symbols,
uint8_t mapping_type,
dmrs_UplinkConfig_t *dmrs_UplinkConfig);
void nr_ulsch_scale_channel(int32_t **ul_ch_estimates_ext, void nr_ulsch_scale_channel(int32_t **ul_ch_estimates_ext,
NR_DL_FRAME_PARMS *frame_parms, NR_DL_FRAME_PARMS *frame_parms,
NR_gNB_ULSCH_t **ulsch_gNB, NR_gNB_ULSCH_t **ulsch_gNB,
uint8_t symbol, uint8_t symbol,
uint8_t start_symbol, uint8_t start_symbol,
uint16_t nb_rb); uint16_t nb_rb,
pusch_dmrs_type_t pusch_dmrs_type);
/** \brief This function computes the average channel level over all allocated RBs and antennas (TX/RX) in order to compute output shift for compensated signal /** \brief This function computes the average channel level over all allocated RBs and antennas (TX/RX) in order to compute output shift for compensated signal
...@@ -118,7 +124,7 @@ void nr_ulsch_channel_compensation(int **rxdataF_ext, ...@@ -118,7 +124,7 @@ void nr_ulsch_channel_compensation(int **rxdataF_ext,
int **rho, int **rho,
NR_DL_FRAME_PARMS *frame_parms, NR_DL_FRAME_PARMS *frame_parms,
unsigned char symbol, unsigned char symbol,
uint8_t pilots, uint8_t is_dmrs_symbol,
unsigned char mod_order, unsigned char mod_order,
unsigned short nb_rb, unsigned short nb_rb,
unsigned char output_shift); unsigned char output_shift);
......
...@@ -43,6 +43,7 @@ NR_gNB_ULSCH_t *new_gNB_ulsch(uint8_t max_ldpc_iterations,uint8_t N_RB_UL, uint8 ...@@ -43,6 +43,7 @@ NR_gNB_ULSCH_t *new_gNB_ulsch(uint8_t max_ldpc_iterations,uint8_t N_RB_UL, uint8
@param ulsch_llr, Pointer to received llr in ulsch @param ulsch_llr, Pointer to received llr in ulsch
@param frame_parms, Pointer to frame descriptor structure @param frame_parms, Pointer to frame descriptor structure
@param nb_symb_sch, number of symbols used in the uplink shared channel @param nb_symb_sch, number of symbols used in the uplink shared channel
@param nb_re_dmrs, number of DMRS resource elements in one RB
@param nr_tti_rx, current received TTI @param nr_tti_rx, current received TTI
@param harq_pid, harq process id @param harq_pid, harq process id
@param is_crnti @param is_crnti
...@@ -54,6 +55,7 @@ uint32_t nr_ulsch_decoding(PHY_VARS_gNB *phy_vars_gNB, ...@@ -54,6 +55,7 @@ uint32_t nr_ulsch_decoding(PHY_VARS_gNB *phy_vars_gNB,
NR_DL_FRAME_PARMS *frame_parms, NR_DL_FRAME_PARMS *frame_parms,
uint32_t frame, uint32_t frame,
uint16_t nb_symb_sch, uint16_t nb_symb_sch,
uint16_t nb_re_dmrs,
uint8_t nr_tti_rx, uint8_t nr_tti_rx,
uint8_t harq_pid, uint8_t harq_pid,
uint8_t is_crnti); uint8_t is_crnti);
......
...@@ -279,6 +279,7 @@ uint32_t nr_ulsch_decoding(PHY_VARS_gNB *phy_vars_gNB, ...@@ -279,6 +279,7 @@ uint32_t nr_ulsch_decoding(PHY_VARS_gNB *phy_vars_gNB,
NR_DL_FRAME_PARMS *frame_parms, NR_DL_FRAME_PARMS *frame_parms,
uint32_t frame, uint32_t frame,
uint16_t nb_symb_sch, uint16_t nb_symb_sch,
uint16_t nb_re_dmrs,
uint8_t nr_tti_rx, uint8_t nr_tti_rx,
uint8_t harq_pid, uint8_t harq_pid,
uint8_t is_crnti) uint8_t is_crnti)
...@@ -324,7 +325,6 @@ uint32_t nr_ulsch_decoding(PHY_VARS_gNB *phy_vars_gNB, ...@@ -324,7 +325,6 @@ uint32_t nr_ulsch_decoding(PHY_VARS_gNB *phy_vars_gNB,
uint16_t R = nfapi_ulsch_pdu_rel15->R; uint16_t R = nfapi_ulsch_pdu_rel15->R;
uint8_t mcs = nfapi_ulsch_pdu_rel15->mcs; uint8_t mcs = nfapi_ulsch_pdu_rel15->mcs;
uint8_t n_layers = nfapi_ulsch_pdu_rel15->n_layers; uint8_t n_layers = nfapi_ulsch_pdu_rel15->n_layers;
uint8_t nb_re_dmrs = nfapi_ulsch_pdu_rel15->nb_re_dmrs;
uint8_t length_dmrs = nfapi_ulsch_pdu_rel15->length_dmrs; uint8_t length_dmrs = nfapi_ulsch_pdu_rel15->length_dmrs;
// ------------------------------------------------------------------ // ------------------------------------------------------------------
...@@ -352,7 +352,7 @@ uint32_t nr_ulsch_decoding(PHY_VARS_gNB *phy_vars_gNB, ...@@ -352,7 +352,7 @@ uint32_t nr_ulsch_decoding(PHY_VARS_gNB *phy_vars_gNB,
G = nr_get_G(nb_rb, number_symbols, nb_re_dmrs, length_dmrs, Qm, n_layers); G = nr_get_G(nb_rb, number_symbols, nb_re_dmrs, length_dmrs, Qm, n_layers);
LOG_D(PHY,"ULSCH Decoding, harq_pid %d TBS %d G %d mcs %d Nl %d nb_symb_sch %d nb_rb %d\n",harq_pid,A,G, mcs, n_layers, nb_symb_sch,nb_rb); LOG_D(PHY,"ULSCH Decoding, harq_pid %d TBS %d G %d mcs %d Nl %d nb_symb_sch %d nb_rb %d, nb_re_dmrs %d, Qm %d, n_layers %d\n",harq_pid,A,G, mcs, n_layers, nb_symb_sch,nb_rb, nb_re_dmrs, Qm, n_layers);
if (harq_process->round == 0) { if (harq_process->round == 0) {
......
This diff is collapsed.
...@@ -173,3 +173,15 @@ short filt8_dcl1_h[8]= { ...@@ -173,3 +173,15 @@ short filt8_dcl1_h[8]= {
short filt8_dcr1_h[8]= { short filt8_dcr1_h[8]= {
0,0,4096,8192,12288,16384,0,0}; 0,0,4096,8192,12288,16384,0,0};
short filt8_ml2[8] = {
13107,9830,6554,3277,0,0,0,0};
short filt8_mr2[8] = {
3277,6554,9830,13107,0,0,0,0};
short filt8_rr1[8] = {
8192,12288,16384,20480,0,0,0,0};
short filt8_rr2[8] = {
-4096,-8192,-12288,-16384,0,0,0,0};
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment