From f18e6e42abf1f8c329c25993023c1cbbb270866e Mon Sep 17 00:00:00 2001 From: Guy De Souza Date: Tue, 30 Oct 2018 18:17:53 +0100 Subject: [PATCH] Payload fixing --- openair1/PHY/NR_TRANSPORT/nr_dlsch.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/openair1/PHY/NR_TRANSPORT/nr_dlsch.c b/openair1/PHY/NR_TRANSPORT/nr_dlsch.c index ec1d2db2ee..f75b34a616 100644 --- a/openair1/PHY/NR_TRANSPORT/nr_dlsch.c +++ b/openair1/PHY/NR_TRANSPORT/nr_dlsch.c @@ -205,6 +205,7 @@ uint8_t nr_generate_pdsch(NR_gNB_DLSCH_t dlsch, uint16_t encoded_length = nb_symbols*Qm; /// CRC, coding, interleaving and rate matching + memset((void*)harq->pdu, 1, (TBS>>3)*sizeof(uint8_t)); nr_dlsch_encoding(harq->pdu, subframe, &dlsch, &frame_parms); #ifdef DEBUG_DLSCH printf("PDSCH encoding:\nPayload:\n"); @@ -279,13 +280,13 @@ for (int l=0; lnb_layers; l++) //to be moved to init phase potentially, for now tx_layers 1-8 are mapped on antenna ports 1000-1007 /// DMRS QPSK modulation - uint16_t n_dmrs = rel15->n_prb*rel15->nb_re_dmrs; + uint16_t n_dmrs = (rel15->n_prb*rel15->nb_re_dmrs)<<1; int16_t mod_dmrs[n_dmrs<<1]; uint8_t dmrs_type = config.pdsch_config.dmrs_type.value; l0 = get_l0(dmrs_type, 2);//config.pdsch_config.dmrs_typeA_position.value); nr_modulation(pdsch_dmrs[l0], n_dmrs, MOD_QPSK, mod_dmrs); #ifdef DEBUG_DLSCH -printf("DMRS modulation (single symbol %d, %d symbols):\n", l0, n_dmrs); +printf("DMRS modulation (single symbol %d, %d symbols, type %d):\n", l0, n_dmrs, dmrs_type); for (int i=0; i>3; i++) { for (int j=0; j<8; j++) { printf("%d %d\t", mod_dmrs[((i<<3)+j)<<1], mod_dmrs[(((i<<3)+j)<<1)+1]); @@ -334,18 +335,21 @@ dmrs_idx, l, k, k_prime, n, ((int16_t*)txdataF[ap])[(l*frame_parms.ofdm_symbol_s k_prime&=1; } - ((int16_t*)txdataF[ap])[(l*frame_parms.ofdm_symbol_size + k)<<1] = (amp * tx_layers[ap][m<<1]) >> 15; - ((int16_t*)txdataF[ap])[((l*frame_parms.ofdm_symbol_size + k)<<1) + 1] = (amp * tx_layers[ap][(m<<1) + 1]) >> 15; + else { + + ((int16_t*)txdataF[ap])[(l*frame_parms.ofdm_symbol_size + k)<<1] = (amp * tx_layers[ap][m<<1]) >> 15; + ((int16_t*)txdataF[ap])[((l*frame_parms.ofdm_symbol_size + k)<<1) + 1] = (amp * tx_layers[ap][(m<<1) + 1]) >> 15; #ifdef DEBUG_DLSCH_MAPPING printf("m %d\t l %d \t k %d \t txdataF: %d %d\n", m, l, k, ((int16_t*)txdataF[ap])[(l*frame_parms.ofdm_symbol_size + k)<<1], ((int16_t*)txdataF[ap])[((l*frame_parms.ofdm_symbol_size + k)<<1) + 1]); #endif - m++; + m++; + } } } #ifdef DEBUG_FILE_OUTPUT - write_output("txdataF_dlsch.m", "txdataF_dlsch", &txdataF[0][28*frame_parms.ofdm_symbol_size], frame_parms.samples_per_subframe_wCP>>1, 1, 1); + write_output("txdataF_dlsch.m", "txdataF_dlsch", txdataF[0], frame_parms.samples_per_subframe_wCP>>1, 1, 1); #endif return 0;