Commit c87b3905 authored by francescomani's avatar francescomani

code formatting

parent 2039a4f2
...@@ -299,7 +299,7 @@ uint16_t get_dmrs_freq_idx_ul(uint16_t n, uint8_t k_prime, uint8_t delta, uint8_ ...@@ -299,7 +299,7 @@ uint16_t get_dmrs_freq_idx_ul(uint16_t n, uint8_t k_prime, uint8_t delta, uint8_
int8_t get_next_dmrs_symbol_in_slot(uint16_t ul_dmrs_symb_pos, uint8_t counter, uint8_t end_symbol) int8_t get_next_dmrs_symbol_in_slot(uint16_t ul_dmrs_symb_pos, uint8_t counter, uint8_t end_symbol)
{ {
for(uint8_t symbol = counter; symbol < end_symbol; symbol++) { for(uint8_t symbol = counter; symbol < end_symbol; symbol++) {
if((ul_dmrs_symb_pos >> symbol) & 0x01 ) { if((ul_dmrs_symb_pos >> symbol) & 0x01) {
return symbol; return symbol;
} }
} }
...@@ -322,19 +322,19 @@ int8_t get_valid_dmrs_idx_for_channel_est(uint16_t dmrs_symb_pos, uint8_t count ...@@ -322,19 +322,19 @@ int8_t get_valid_dmrs_idx_for_channel_est(uint16_t dmrs_symb_pos, uint8_t count
{ {
int8_t symbIdx = -1; int8_t symbIdx = -1;
/* if current symbol is DMRS then return this index */ /* if current symbol is DMRS then return this index */
if(is_dmrs_symbol(counter, dmrs_symb_pos ) ==1) { if(is_dmrs_symbol(counter, dmrs_symb_pos) == 1) {
return counter; return counter;
} }
/* find previous DMRS symbol */ /* find previous DMRS symbol */
for(int8_t symbol = counter;symbol >=0 ; symbol--) { for(int8_t symbol = counter; symbol >= 0 ; symbol--) {
if((1<<symbol & dmrs_symb_pos)> 0) { if((1 << symbol & dmrs_symb_pos) > 0) {
symbIdx = symbol; symbIdx = symbol;
break; break;
} }
} }
/* if there is no previous dmrs available then find the next possible*/ /* if there is no previous dmrs available then find the next possible*/
if(symbIdx == -1) { if(symbIdx == -1) {
symbIdx = get_next_dmrs_symbol_in_slot(dmrs_symb_pos,counter,15); symbIdx = get_next_dmrs_symbol_in_slot(dmrs_symb_pos, counter, 15);
} }
return symbIdx; return symbIdx;
} }
......
...@@ -276,7 +276,7 @@ void nr_idft(int32_t *z, uint32_t Msc_PUSCH) ...@@ -276,7 +276,7 @@ void nr_idft(int32_t *z, uint32_t Msc_PUSCH)
} }
static void nr_ulsch_extract_rbs (c16_t* const rxdataF, static void nr_ulsch_extract_rbs(c16_t* const rxdataF,
c16_t* const chF, c16_t* const chF,
c16_t *rxFext, c16_t *rxFext,
c16_t *chFext, c16_t *chFext,
...@@ -301,8 +301,7 @@ static void nr_ulsch_extract_rbs (c16_t* const rxdataF, ...@@ -301,8 +301,7 @@ static void nr_ulsch_extract_rbs (c16_t* const rxdataF,
if (is_dmrs_symbol == 0) { if (is_dmrs_symbol == 0) {
if (start_re + nb_re_pusch <= frame_parms->ofdm_symbol_size) if (start_re + nb_re_pusch <= frame_parms->ofdm_symbol_size)
memcpy(rxF_ext, &rxF[start_re], nb_re_pusch * sizeof(c16_t)); memcpy(rxF_ext, &rxF[start_re], nb_re_pusch * sizeof(c16_t));
else else {
{
int neg_length = frame_parms->ofdm_symbol_size - start_re; int neg_length = frame_parms->ofdm_symbol_size - start_re;
int pos_length = nb_re_pusch - neg_length; int pos_length = nb_re_pusch - neg_length;
memcpy(rxF_ext, &rxF[start_re], neg_length * sizeof(c16_t)); memcpy(rxF_ext, &rxF[start_re], neg_length * sizeof(c16_t));
...@@ -310,57 +309,47 @@ static void nr_ulsch_extract_rbs (c16_t* const rxdataF, ...@@ -310,57 +309,47 @@ static void nr_ulsch_extract_rbs (c16_t* const rxdataF,
} }
memcpy(ul_ch0_ext, ul_ch0, nb_re_pusch * sizeof(c16_t)); memcpy(ul_ch0_ext, ul_ch0, nb_re_pusch * sizeof(c16_t));
} }
else if (pusch_pdu->dmrs_config_type == pusch_dmrs_type1) // 6 REs / PRB else if (pusch_pdu->dmrs_config_type == pusch_dmrs_type1) { // 6 REs / PRB
{
AssertFatal(delta == 0 || delta == 1, "Illegal delta %d\n",delta); AssertFatal(delta == 0 || delta == 1, "Illegal delta %d\n",delta);
c16_t *rxF32 = &rxF[start_re]; c16_t *rxF32 = &rxF[start_re];
if (start_re + nb_re_pusch < frame_parms->ofdm_symbol_size) { if (start_re + nb_re_pusch < frame_parms->ofdm_symbol_size) {
for (int idx = 1 - delta; idx < nb_re_pusch; idx += 2) for (int idx = 1 - delta; idx < nb_re_pusch; idx += 2) {
{
*rxF_ext++ = rxF32[idx]; *rxF_ext++ = rxF32[idx];
*ul_ch0_ext++ = ul_ch0[idx]; *ul_ch0_ext++ = ul_ch0[idx];
} }
} }
else // handle the two pieces around DC else { // handle the two pieces around DC
{
int neg_length = frame_parms->ofdm_symbol_size - start_re; int neg_length = frame_parms->ofdm_symbol_size - start_re;
int pos_length = nb_re_pusch - neg_length; int pos_length = nb_re_pusch - neg_length;
int idx, idx2; int idx, idx2;
for (idx = 1 - delta; idx < neg_length; idx += 2) for (idx = 1 - delta; idx < neg_length; idx += 2) {
{
*rxF_ext++ = rxF32[idx]; *rxF_ext++ = rxF32[idx];
*ul_ch0_ext++= ul_ch0[idx]; *ul_ch0_ext++= ul_ch0[idx];
} }
rxF32 = rxF; rxF32 = rxF;
idx2 = idx; idx2 = idx;
for (idx = 1 - delta; idx < pos_length; idx += 2, idx2 += 2) for (idx = 1 - delta; idx < pos_length; idx += 2, idx2 += 2) {
{
*rxF_ext++ = rxF32[idx]; *rxF_ext++ = rxF32[idx];
*ul_ch0_ext++ = ul_ch0[idx2]; *ul_ch0_ext++ = ul_ch0[idx2];
} }
} }
} }
else if (pusch_pdu->dmrs_config_type == pusch_dmrs_type2) // 8 REs / PRB else if (pusch_pdu->dmrs_config_type == pusch_dmrs_type2) { // 8 REs / PRB
{
AssertFatal(delta==0||delta==2||delta==4,"Illegal delta %d\n",delta); AssertFatal(delta==0||delta==2||delta==4,"Illegal delta %d\n",delta);
if (start_re + nb_re_pusch < frame_parms->ofdm_symbol_size) if (start_re + nb_re_pusch < frame_parms->ofdm_symbol_size) {
{ for (int idx = 0; idx < nb_re_pusch; idx ++) {
for (int idx = 0; idx < nb_re_pusch; idx ++)
{
if (idx % 6 == 2 * delta || idx % 6 == 2 * delta + 1) if (idx % 6 == 2 * delta || idx % 6 == 2 * delta + 1)
continue; continue;
*rxF_ext++ = rxF[idx]; *rxF_ext++ = rxF[idx];
*ul_ch0_ext++ = ul_ch0[idx]; *ul_ch0_ext++ = ul_ch0[idx];
} }
} }
else else {
{
int neg_length = frame_parms->ofdm_symbol_size - start_re; int neg_length = frame_parms->ofdm_symbol_size - start_re;
int pos_length = nb_re_pusch - neg_length; int pos_length = nb_re_pusch - neg_length;
c16_t *rxF64 = &rxF[start_re]; c16_t *rxF64 = &rxF[start_re];
int idx, idx2; int idx, idx2;
for (idx = 0; idx < neg_length; idx ++) for (idx = 0; idx < neg_length; idx ++) {
{
if (idx % 6 == 2 * delta || idx % 6 == 2 * delta + 1) if (idx % 6 == 2 * delta || idx % 6 == 2 * delta + 1)
continue; continue;
*rxF_ext++ = rxF64[idx]; *rxF_ext++ = rxF64[idx];
...@@ -368,8 +357,7 @@ static void nr_ulsch_extract_rbs (c16_t* const rxdataF, ...@@ -368,8 +357,7 @@ static void nr_ulsch_extract_rbs (c16_t* const rxdataF,
} }
rxF64 = rxF; rxF64 = rxF;
idx2 = idx; idx2 = idx;
for (idx = 0; idx < pos_length; idx++, idx2++) for (idx = 0; idx < pos_length; idx++, idx2++) {
{
if (idx % 6 == 2 * delta || idx % 6 == 2 * delta + 1) if (idx % 6 == 2 * delta || idx % 6 == 2 * delta + 1)
continue; continue;
*rxF_ext++ = rxF64[idx]; *rxF_ext++ = rxF64[idx];
...@@ -1586,10 +1574,13 @@ int nr_rx_pusch_tp(PHY_VARS_gNB *gNB, ...@@ -1586,10 +1574,13 @@ int nr_rx_pusch_tp(PHY_VARS_gNB *gNB,
int nb_re_pusch = 0, meas_symbol = -1; int nb_re_pusch = 0, meas_symbol = -1;
for(meas_symbol = rel15_ul->start_symbol_index; meas_symbol < end_symbol; meas_symbol++) for(meas_symbol = rel15_ul->start_symbol_index; meas_symbol < end_symbol; meas_symbol++)
if ((nb_re_pusch = get_nb_re_pusch(frame_parms,rel15_ul,meas_symbol)) > 0) if ((nb_re_pusch = get_nb_re_pusch(frame_parms, rel15_ul, meas_symbol)) > 0)
break; break;
AssertFatal(nb_re_pusch>0 && meas_symbol>=0,"nb_re_pusch %d cannot be 0 or meas_symbol %d cannot be negative here\n",nb_re_pusch,meas_symbol); AssertFatal(nb_re_pusch > 0 && meas_symbol >= 0,
"nb_re_pusch %d cannot be 0 or meas_symbol %d cannot be negative here\n",
nb_re_pusch,
meas_symbol);
// extract the first dmrs for the channel level computation // extract the first dmrs for the channel level computation
// extract the data in the OFDM frame, to the start of the array // extract the data in the OFDM frame, to the start of the array
...@@ -1605,9 +1596,9 @@ int nr_rx_pusch_tp(PHY_VARS_gNB *gNB, ...@@ -1605,9 +1596,9 @@ int nr_rx_pusch_tp(PHY_VARS_gNB *gNB,
for (int aarx = 0; aarx < frame_parms->nb_antennas_rx; aarx++) for (int aarx = 0; aarx < frame_parms->nb_antennas_rx; aarx++)
for (int aatx = 0; aatx < rel15_ul->nrOfLayers; aatx++) for (int aatx = 0; aatx < rel15_ul->nrOfLayers; aatx++)
nr_ulsch_extract_rbs(gNB->common_vars.rxdataF[aarx], nr_ulsch_extract_rbs(gNB->common_vars.rxdataF[aarx],
(c16_t *)pusch_vars->ul_ch_estimates[aatx * frame_parms->nb_antennas_rx + aarx], (c16_t*)pusch_vars->ul_ch_estimates[aatx * frame_parms->nb_antennas_rx + aarx],
(c16_t*)&pusch_vars->rxdataF_ext[aarx][meas_symbol * nb_re_pusch], (c16_t*)&pusch_vars->rxdataF_ext[aarx][meas_symbol * nb_re_pusch],
(c16_t*)&pusch_vars->ul_ch_estimates_ext[aatx*frame_parms->nb_antennas_rx+aarx][meas_symbol * nb_re_pusch], (c16_t*)&pusch_vars->ul_ch_estimates_ext[aatx * frame_parms->nb_antennas_rx+aarx][meas_symbol * nb_re_pusch],
soffset + meas_symbol * frame_parms->ofdm_symbol_size, soffset + meas_symbol * frame_parms->ofdm_symbol_size,
dmrs_symbol * frame_parms->ofdm_symbol_size, dmrs_symbol * frame_parms->ofdm_symbol_size,
aarx, aarx,
...@@ -1657,10 +1648,9 @@ int nr_rx_pusch_tp(PHY_VARS_gNB *gNB, ...@@ -1657,10 +1648,9 @@ int nr_rx_pusch_tp(PHY_VARS_gNB *gNB,
start_meas(&gNB->rx_pusch_symbol_processing_stats); start_meas(&gNB->rx_pusch_symbol_processing_stats);
int numSymbols = gNB->num_pusch_symbols_per_thread; int numSymbols = gNB->num_pusch_symbols_per_thread;
for(uint8_t symbol = rel15_ul->start_symbol_index; symbol < end_symbol; symbol += numSymbols) for(uint8_t symbol = rel15_ul->start_symbol_index; symbol < end_symbol; symbol += numSymbols) {
{
int total_res = 0; int total_res = 0;
for (int s = 0; s < numSymbols;s++) { for (int s = 0; s < numSymbols; s++) {
pusch_vars->ul_valid_re_per_slot[symbol+s] = get_nb_re_pusch(frame_parms,rel15_ul,symbol+s); pusch_vars->ul_valid_re_per_slot[symbol+s] = get_nb_re_pusch(frame_parms,rel15_ul,symbol+s);
pusch_vars->llr_offset[symbol+s] = ((symbol+s) == rel15_ul->start_symbol_index) ? pusch_vars->llr_offset[symbol+s] = ((symbol+s) == rel15_ul->start_symbol_index) ?
0 : 0 :
......
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