Commit f2764943 authored by cig's avatar cig

Completed dlsch demodulation for RA PDSCH

parent c56854af
...@@ -132,7 +132,7 @@ int nr_rx_pdsch(PHY_VARS_NR_UE *ue, ...@@ -132,7 +132,7 @@ int nr_rx_pdsch(PHY_VARS_NR_UE *ue,
unsigned short nb_rb = 0, round; unsigned short nb_rb = 0, round;
int avgs = 0;// rb; int avgs = 0;// rb;
NR_DL_UE_HARQ_t *dlsch0_harq,*dlsch1_harq = 0; NR_DL_UE_HARQ_t *dlsch0_harq, *dlsch1_harq = NULL;
uint8_t beamforming_mode; uint8_t beamforming_mode;
...@@ -157,82 +157,87 @@ int nr_rx_pdsch(PHY_VARS_NR_UE *ue, ...@@ -157,82 +157,87 @@ int nr_rx_pdsch(PHY_VARS_NR_UE *ue,
int32_t median[16]; int32_t median[16];
uint32_t len; uint32_t len;
switch (type) { switch (type) {
case SI_PDSCH: case SI_PDSCH:
pdsch_vars = ue->pdsch_vars_SI; pdsch_vars = ue->pdsch_vars_SI;
dlsch = &ue->dlsch_SI[eNB_id]; dlsch = &ue->dlsch_SI[eNB_id];
dlsch0_harq = dlsch[0]->harq_processes[harq_pid]; dlsch0_harq = dlsch[0]->harq_processes[harq_pid];
beamforming_mode = 0; beamforming_mode = 0;
break; break;
case RA_PDSCH: case RA_PDSCH:
pdsch_vars = ue->pdsch_vars_ra; pdsch_vars = ue->pdsch_vars_ra;
dlsch = &ue->dlsch_ra[eNB_id]; dlsch = &ue->dlsch_ra[eNB_id];
dlsch0_harq = dlsch[0]->harq_processes[harq_pid]; dlsch0_harq = dlsch[0]->harq_processes[harq_pid];
beamforming_mode = 0; beamforming_mode = 0;
break; break;
case PDSCH: case PDSCH:
pdsch_vars = ue->pdsch_vars[ue->current_thread_id[nr_tti_rx]]; pdsch_vars = ue->pdsch_vars[ue->current_thread_id[nr_tti_rx]];
dlsch = ue->dlsch[ue->current_thread_id[nr_tti_rx]][eNB_id]; dlsch = ue->dlsch[ue->current_thread_id[nr_tti_rx]][eNB_id];
dlsch[0]->harq_processes[harq_pid]->Qm = nr_get_Qm_dl(dlsch[0]->harq_processes[harq_pid]->mcs, dlsch[0]->harq_processes[harq_pid]->mcs_table); beamforming_mode = ue->transmission_mode[eNB_id] < 7 ? 0 :ue->transmission_mode[eNB_id];
dlsch[0]->harq_processes[harq_pid]->R = nr_get_code_rate_dl(dlsch[0]->harq_processes[harq_pid]->mcs, dlsch[0]->harq_processes[harq_pid]->mcs_table);
dlsch0_harq = dlsch[0]->harq_processes[harq_pid];
dlsch1_harq = dlsch[1]->harq_processes[harq_pid];
//printf("status TB0 = %d, status TB1 = %d \n", dlsch[0]->harq_processes[harq_pid]->status, dlsch[1]->harq_processes[harq_pid]->status); //printf("status TB0 = %d, status TB1 = %d \n", dlsch[0]->harq_processes[harq_pid]->status, dlsch[1]->harq_processes[harq_pid]->status);
LOG_D(PHY,"AbsSubframe %d.%d / Sym %d harq_pid %d, harq status %d.%d \n", LOG_D(PHY,"AbsSubframe %d.%d / Sym %d harq_pid %d, harq status %d.%d \n", frame, nr_tti_rx, symbol, harq_pid, dlsch0_harq->status, dlsch1_harq->status);
frame,nr_tti_rx,symbol,harq_pid,
dlsch[0]->harq_processes[harq_pid]->status, if ((dlsch0_harq->status == ACTIVE) && (dlsch1_harq->status == ACTIVE)){
dlsch[1]->harq_processes[harq_pid]->status); codeword_TB0 = dlsch0_harq->codeword;
codeword_TB1 = dlsch1_harq->codeword;
if ((dlsch[0]->harq_processes[harq_pid]->status == ACTIVE) &&
(dlsch[1]->harq_processes[harq_pid]->status == ACTIVE)){
codeword_TB0 = dlsch[0]->harq_processes[harq_pid]->codeword;
codeword_TB1 = dlsch[1]->harq_processes[harq_pid]->codeword;
dlsch0_harq = dlsch[codeword_TB0]->harq_processes[harq_pid]; dlsch0_harq = dlsch[codeword_TB0]->harq_processes[harq_pid];
dlsch1_harq = dlsch[codeword_TB1]->harq_processes[harq_pid]; dlsch1_harq = dlsch[codeword_TB1]->harq_processes[harq_pid];
#ifdef DEBUG_HARQ
printf("[DEMOD] I am assuming both TBs are active\n"); #ifdef DEBUG_HARQ
#endif printf("[DEMOD] I am assuming both TBs are active\n");
} #endif
else if ((dlsch[0]->harq_processes[harq_pid]->status == ACTIVE) &&
(dlsch[1]->harq_processes[harq_pid]->status != ACTIVE) ) { } else if ((dlsch0_harq->status == ACTIVE) && (dlsch1_harq->status != ACTIVE) ) {
codeword_TB0 = dlsch[0]->harq_processes[harq_pid]->codeword; codeword_TB0 = dlsch0_harq->codeword;
codeword_TB1 = -1;
dlsch0_harq = dlsch[0]->harq_processes[harq_pid]; dlsch0_harq = dlsch[0]->harq_processes[harq_pid];
dlsch1_harq = NULL; dlsch1_harq = NULL;
codeword_TB1 = -1;
#ifdef DEBUG_HARQ #ifdef DEBUG_HARQ
printf("[DEMOD] I am assuming only TB0 is active\n"); printf("[DEMOD] I am assuming only TB0 is active\n");
#endif #endif
}
else if ((dlsch[0]->harq_processes[harq_pid]->status != ACTIVE) && } else if ((dlsch0_harq->status != ACTIVE) && (dlsch1_harq->status == ACTIVE)){
(dlsch[1]->harq_processes[harq_pid]->status == ACTIVE) ){
codeword_TB1 = dlsch[1]->harq_processes[harq_pid]->codeword;
dlsch0_harq = dlsch[1]->harq_processes[harq_pid];
dlsch1_harq = NULL;
codeword_TB0 = -1; codeword_TB0 = -1;
#ifdef DEBUG_HARQ codeword_TB1 = dlsch1_harq->codeword;
printf("[DEMOD] I am assuming only TB1 is active, it is in cw %d\n", dlsch0_harq->codeword); dlsch0_harq = NULL;
#endif dlsch1_harq = dlsch[1]->harq_processes[codeword_TB1];
}
else { #ifdef DEBUG_HARQ
LOG_E(PHY,"[UE][FATAL] nr_tti_rx %d: no active DLSCH\n",nr_tti_rx); printf("[DEMOD] I am assuming only TB1 is active, it is in cw %d\n", dlsch0_harq->codeword);
#endif
AssertFatal(1 == 0, "[UE][FATAL] DLSCH: TB0 not active and TB1 active case is not supported %d\n");
} else {
LOG_E(PHY,"[UE][FATAL] nr_tti_rx %d: no active DLSCH\n", nr_tti_rx);
return(-1); return(-1);
} }
beamforming_mode = ue->transmission_mode[eNB_id]<7?0:ue->transmission_mode[eNB_id];
break; break;
default: default:
AssertFatal(1==0,"[UE][FATAL] nr_tti_rx %d: Unknown PDSCH format %d\n",nr_tti_rx,type); AssertFatal(1 == 0, "[UE][FATAL] nr_tti_rx %d: Unknown PDSCH format %d\n", nr_tti_rx, type);
return(-1); return(-1);
break; break;
} }
#ifdef DEBUG_HARQ dlsch0_harq->Qm = nr_get_Qm_dl(dlsch[0]->harq_processes[harq_pid]->mcs, dlsch[0]->harq_processes[harq_pid]->mcs_table);
printf("[DEMOD] MIMO mode = %d\n", dlsch0_harq->mimo_mode); dlsch0_harq->R = nr_get_code_rate_dl(dlsch[0]->harq_processes[harq_pid]->mcs, dlsch[0]->harq_processes[harq_pid]->mcs_table);
printf("[DEMOD] cw for TB0 = %d, cw for TB1 = %d\n", codeword_TB0, codeword_TB1);
#endif #ifdef DEBUG_HARQ
printf("[DEMOD] MIMO mode = %d\n", dlsch0_harq->mimo_mode);
printf("[DEMOD] cw for TB0 = %d, cw for TB1 = %d\n", codeword_TB0, codeword_TB1);
#endif
start_rb = dlsch0_harq->start_rb; start_rb = dlsch0_harq->start_rb;
nb_rb_pdsch = dlsch0_harq->nb_rb; nb_rb_pdsch = dlsch0_harq->nb_rb;
...@@ -270,7 +275,6 @@ int nr_rx_pdsch(PHY_VARS_NR_UE *ue, ...@@ -270,7 +275,6 @@ int nr_rx_pdsch(PHY_VARS_NR_UE *ue,
return(-1); return(-1);
} }
if (dlsch0_harq->mimo_mode==NR_DUALSTREAM) { if (dlsch0_harq->mimo_mode==NR_DUALSTREAM) {
DevAssert(dlsch1_harq); DevAssert(dlsch1_harq);
} }
......
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