Remove max number of HARQ rounds from L1
Contributors: francescomani <email@francescomani.it> Rodolphe Bertolini <rodolphe.bertolini@cea.fr>
This commit is contained in:
committed by
Robert Schmidt
parent
add469e7ca
commit
9e5a77e6e3
@@ -34,19 +34,6 @@
|
||||
#include "PHY/NR_REFSIG/nr_refsig.h"
|
||||
#include "PHY/MODULATION/nr_modulation.h"
|
||||
|
||||
#if 0
|
||||
void phy_config_harq_ue(module_id_t Mod_id,
|
||||
int CC_id,
|
||||
uint8_t gNB_id,
|
||||
uint16_t max_harq_tx) {
|
||||
int num_of_threads,num_of_code_words;
|
||||
PHY_VARS_NR_UE *phy_vars_ue = PHY_vars_UE_g[Mod_id][CC_id];
|
||||
|
||||
for (num_of_threads=0; num_of_threads<RX_NB_TH_MAX; num_of_threads++)
|
||||
for (num_of_code_words=0; num_of_code_words<NR_MAX_NB_CODEWORDS; num_of_code_words++)
|
||||
phy_vars_ue->ulsch[num_of_threads][gNB_id][num_of_code_words]->Mlimit = max_harq_tx;
|
||||
}
|
||||
#endif
|
||||
|
||||
extern uint16_t beta_cqi[16];
|
||||
|
||||
|
||||
@@ -123,7 +123,6 @@ NR_gNB_DLSCH_t *new_gNB_dlsch(NR_DL_FRAME_PARMS *frame_parms,
|
||||
bzero(dlsch,sizeof(NR_gNB_DLSCH_t));
|
||||
dlsch->Kmimo = Kmimo;
|
||||
dlsch->Mdlharq = Mdlharq;
|
||||
dlsch->Mlimit = 4;
|
||||
dlsch->Nsoft = Nsoft;
|
||||
|
||||
int txdataf_size = frame_parms->N_RB_DL*NR_SYMBOLS_PER_SLOT*NR_NB_SC_PER_RB*8; // max pdsch encoded length for each layer
|
||||
|
||||
@@ -68,12 +68,20 @@ void nr_fill_ulsch(PHY_VARS_gNB *gNB,
|
||||
ulsch->rnti = ulsch_pdu->rnti;
|
||||
//ulsch->rnti_type;
|
||||
ulsch->harq_mask |= 1<<harq_pid;
|
||||
ulsch->harq_process_id[slot] = harq_pid;
|
||||
|
||||
ulsch->harq_processes[harq_pid]->frame=frame;
|
||||
ulsch->harq_processes[harq_pid]->slot=slot;
|
||||
ulsch->harq_processes[harq_pid]->handled= 0;
|
||||
ulsch->harq_processes[harq_pid]->status= NR_ACTIVE;
|
||||
NR_UL_gNB_HARQ_t *harq = ulsch->harq_processes[harq_pid];
|
||||
harq->frame=frame;
|
||||
harq->slot=slot;
|
||||
harq->handled = 0;
|
||||
harq->status= NR_ACTIVE;
|
||||
harq->new_rx = harq->ndi != ulsch_pdu->pusch_data.new_data_indicator;
|
||||
if (harq->new_rx) {
|
||||
harq->ndi = ulsch_pdu->pusch_data.new_data_indicator;
|
||||
harq->round = 0;
|
||||
} else {
|
||||
harq->round++;
|
||||
}
|
||||
|
||||
memcpy((void*)&ulsch->harq_processes[harq_pid]->ulsch_pdu, (void*)ulsch_pdu, sizeof(nfapi_nr_pusch_pdu_t));
|
||||
|
||||
LOG_D(PHY,"Initializing nFAPI for ULSCH, UE %d, harq_pid %d\n",ulsch_id,harq_pid);
|
||||
|
||||
@@ -101,7 +101,6 @@ NR_gNB_ULSCH_t *new_gNB_ulsch(uint8_t max_ldpc_iterations, uint16_t N_RB_UL)
|
||||
ulsch = (NR_gNB_ULSCH_t *)malloc16_clear(sizeof(NR_gNB_ULSCH_t));
|
||||
|
||||
ulsch->max_ldpc_iterations = max_ldpc_iterations;
|
||||
ulsch->Mlimit = 4;
|
||||
|
||||
for (i=0; i<NR_MAX_ULSCH_HARQ_PROCESSES; i++) {
|
||||
|
||||
@@ -136,10 +135,8 @@ void clean_gNB_ulsch(NR_gNB_ULSCH_t *ulsch)
|
||||
ulsch->rnti_type = 0;
|
||||
ulsch->cyclicShift = 0;
|
||||
ulsch->cooperation_flag = 0;
|
||||
ulsch->Mlimit = 0;
|
||||
ulsch->max_ldpc_iterations = 0;
|
||||
ulsch->last_iteration_cnt = 0;
|
||||
for (i=0;i<NR_MAX_SLOTS_PER_FRAME;i++) ulsch->harq_process_id[i] = 0;
|
||||
|
||||
for (i=0; i<NR_MAX_ULSCH_HARQ_PROCESSES; i++) {
|
||||
if (ulsch->harq_processes[i]){
|
||||
|
||||
@@ -140,7 +140,6 @@ NR_UE_DLSCH_t *new_nr_ue_dlsch(uint8_t Kmimo,uint8_t Mdlharq,uint32_t Nsoft,uint
|
||||
dlsch->Mdlharq = Mdlharq;
|
||||
dlsch->number_harq_processes_for_pdsch = Mdlharq;
|
||||
dlsch->Nsoft = Nsoft;
|
||||
dlsch->Mlimit = 4;
|
||||
dlsch->max_ldpc_iterations = max_ldpc_iterations;
|
||||
|
||||
for (int i=0; i<Mdlharq; i++) {
|
||||
@@ -222,7 +221,6 @@ bool nr_ue_postDecode(PHY_VARS_NR_UE *phy_vars_ue, notifiedFIFO_elt_t *req, bool
|
||||
//LOG_D(PHY,"[UE %d] DLSCH: Setting ACK for nr_slot_rx %d TBS %d mcs %d nb_rb %d harq_process->round %d\n",
|
||||
// phy_vars_ue->Mod_id,nr_slot_rx,harq_process->TBS,harq_process->mcs,harq_process->nb_rb, harq_process->round);
|
||||
harq_process->status = SCH_IDLE;
|
||||
harq_process->DLround = 0;
|
||||
harq_process->ack = 1;
|
||||
|
||||
//LOG_D(PHY,"[UE %d] DLSCH: Setting ACK for SFN/SF %d/%d (pid %d, status %d, round %d, TBS %d, mcs %d)\n",
|
||||
@@ -237,11 +235,6 @@ bool nr_ue_postDecode(PHY_VARS_NR_UE *phy_vars_ue, notifiedFIFO_elt_t *req, bool
|
||||
//LOG_D(PHY,"[UE %d] DLSCH: Setting NAK for SFN/SF %d/%d (pid %d, status %d, round %d, TBS %d, mcs %d) Kr %d r %d harq_process->round %d\n",
|
||||
// phy_vars_ue->Mod_id, frame, nr_slot_rx, harq_pid,harq_process->status, harq_process->round,harq_process->TBS,harq_process->mcs,Kr,r,harq_process->round);
|
||||
harq_process->ack = 0;
|
||||
if (harq_process->DLround >= dlsch->Mlimit) {
|
||||
harq_process->status = SCH_IDLE;
|
||||
harq_process->DLround = 0;
|
||||
phy_vars_ue->dl_stats[4]++;
|
||||
}
|
||||
|
||||
//if(is_crnti) {
|
||||
// LOG_D(PHY,"[UE %d] DLSCH: Setting NACK for nr_slot_rx %d (pid %d, pid status %d, round %d/Max %d, TBS %d)\n",
|
||||
@@ -496,8 +489,6 @@ uint32_t nr_dlsch_decoding(PHY_VARS_NR_UE *phy_vars_ue,
|
||||
}
|
||||
*/
|
||||
nb_rb = harq_process->nb_rb;
|
||||
harq_process->trials[harq_process->DLround]++;
|
||||
|
||||
A = harq_process->TBS;
|
||||
ret = dlsch->max_ldpc_iterations + 1;
|
||||
dlsch->last_iteration_cnt = ret;
|
||||
|
||||
@@ -161,15 +161,13 @@ typedef struct {
|
||||
//uint8_t num_cba_dci[10];
|
||||
/// allocated CBA RNTI
|
||||
//uint16_t cba_rnti[4];//NUM_MAX_CBA_GROUP];
|
||||
/// UL max-harq-retransmission
|
||||
uint16_t Mlimit;
|
||||
} NR_UE_ULSCH_t;
|
||||
|
||||
typedef struct {
|
||||
/// Indicator of first reception
|
||||
uint8_t first_rx;
|
||||
/// Last Ndi received for this process on DCI (used for C-RNTI only)
|
||||
uint8_t DCINdi;
|
||||
uint8_t Ndi;
|
||||
/// DLSCH status flag indicating
|
||||
SCH_status_t status;
|
||||
/// Transport block size
|
||||
@@ -241,10 +239,6 @@ typedef struct {
|
||||
vrb_t vrb_type;
|
||||
/// downlink power offset field
|
||||
uint8_t dl_power_off;
|
||||
/// trials per round statistics
|
||||
uint32_t trials[8];
|
||||
/// error statistics per round
|
||||
uint32_t errors[8];
|
||||
/// codeword this transport block is mapped to
|
||||
uint8_t codeword;
|
||||
/// HARQ-ACKs
|
||||
@@ -311,9 +305,7 @@ typedef struct {
|
||||
/// Maximum number of LDPC iterations
|
||||
uint8_t max_ldpc_iterations;
|
||||
/// number of iterations used in last turbo decoding
|
||||
uint8_t last_iteration_cnt;
|
||||
/// Maximum number of HARQ rounds
|
||||
uint8_t Mlimit;
|
||||
uint8_t last_iteration_cnt;
|
||||
} NR_UE_DLSCH_t;
|
||||
|
||||
typedef enum {format0_0,
|
||||
|
||||
@@ -130,10 +130,6 @@ NR_UE_ULSCH_t *new_nr_ue_ulsch(uint16_t N_RB_UL, int number_of_harq_pids, NR_DL_
|
||||
memset(ulsch, 0, sizeof(*ulsch));
|
||||
|
||||
ulsch->number_harq_processes_for_pusch = NR_MAX_ULSCH_HARQ_PROCESSES;
|
||||
ulsch->Mlimit = 4; // maximum harq retransmissions
|
||||
|
||||
//for (i=0; i<10; i++)
|
||||
//ulsch->harq_ids[i] = 0;
|
||||
|
||||
for (int i = 0; i < number_of_harq_pids; i++) {
|
||||
|
||||
|
||||
@@ -188,8 +188,6 @@ typedef struct {
|
||||
uint8_t codebook_index;
|
||||
/// Maximum number of HARQ processes
|
||||
uint8_t Mdlharq;
|
||||
/// Maximum number of HARQ rounds
|
||||
uint8_t Mlimit;
|
||||
/// MIMO transmission mode indicator for this sub-frame
|
||||
uint8_t Kmimo;
|
||||
/// Nsoft parameter related to UE Category
|
||||
@@ -345,8 +343,6 @@ typedef struct {
|
||||
typedef struct {
|
||||
/// Pointers to 16 HARQ processes for the ULSCH
|
||||
NR_UL_gNB_HARQ_t *harq_processes[NR_MAX_ULSCH_HARQ_PROCESSES];
|
||||
/// Current HARQ process id
|
||||
int harq_process_id[NR_MAX_SLOTS_PER_FRAME];
|
||||
/// HARQ process mask, indicates which processes are currently active
|
||||
uint16_t harq_mask;
|
||||
/// ACK/NAK Bundling flag
|
||||
@@ -373,8 +369,6 @@ typedef struct {
|
||||
uint8_t cyclicShift;
|
||||
/// for cooperative communication
|
||||
uint8_t cooperation_flag;
|
||||
/// Maximum number of HARQ rounds
|
||||
uint8_t Mlimit;
|
||||
/// Maximum number of LDPC iterations
|
||||
uint8_t max_ldpc_iterations;
|
||||
/// number of iterations used in last LDPC decoding
|
||||
|
||||
@@ -978,8 +978,8 @@ typedef struct {
|
||||
SLIST_HEAD(ral_thresholds_gen_poll_s, ral_threshold_phy_t) ral_thresholds_gen_polled[RAL_LINK_PARAM_GEN_MAX];
|
||||
SLIST_HEAD(ral_thresholds_lte_poll_s, ral_threshold_phy_t) ral_thresholds_lte_polled[RAL_LINK_PARAM_LTE_MAX];
|
||||
#endif
|
||||
|
||||
int dl_stats[5];
|
||||
int dl_errors;
|
||||
int dl_stats[8];
|
||||
void* scopeData;
|
||||
} PHY_VARS_NR_UE;
|
||||
|
||||
|
||||
@@ -242,13 +242,6 @@ void nr_postDecode(PHY_VARS_gNB *gNB, notifiedFIFO_elt_t *req) {
|
||||
ulsch_harq->ulsch_pdu.rb_size,
|
||||
ulsch_harq->TBS,
|
||||
r);
|
||||
ulsch_harq->round++;
|
||||
if (ulsch_harq->round >= ulsch->Mlimit) {
|
||||
ulsch_harq->status = SCH_IDLE;
|
||||
ulsch_harq->round = 0;
|
||||
ulsch_harq->handled = 0;
|
||||
ulsch->harq_mask &= ~(1 << rdata->harq_pid);
|
||||
}
|
||||
ulsch_harq->handled = 1;
|
||||
|
||||
LOG_D(PHY, "ULSCH %d in error\n",rdata->ulsch_id);
|
||||
@@ -413,17 +406,8 @@ void nr_fill_indication(PHY_VARS_gNB *gNB, int frame, int slot_rx, int ULSCH_id,
|
||||
if (timing_advance_update > 63) timing_advance_update = 63;
|
||||
|
||||
if (crc_flag == 0) LOG_D(PHY, "%d.%d : Received PUSCH : Estimated timing advance PUSCH is = %d, timing_advance_update is %d \n", frame,slot_rx,sync_pos,timing_advance_update);
|
||||
else if (harq_process->round>0 || dtx_flag == 0) { // increment round if crc_flag == 1 and not(dtx_flag ==1 and round==0)
|
||||
harq_process->round++;
|
||||
if (harq_process->round >= ulsch->Mlimit) {
|
||||
harq_process->status = SCH_IDLE;
|
||||
harq_process->round = 0;
|
||||
harq_process->handled = 0;
|
||||
ulsch->harq_mask &= ~(1 << harq_pid);
|
||||
}
|
||||
}
|
||||
// estimate UL_CQI for MAC
|
||||
|
||||
// estimate UL_CQI for MAC
|
||||
int SNRtimes10 = dB_fixed_x10(gNB->pusch_vars[ULSCH_id]->ulsch_power_tot) -
|
||||
dB_fixed_x10(gNB->pusch_vars[ULSCH_id]->ulsch_noise_power_tot);
|
||||
|
||||
|
||||
@@ -308,7 +308,7 @@ void init_downlink_harq_status(NR_DL_UE_HARQ_t *dl_harq)
|
||||
dl_harq->status = SCH_IDLE;
|
||||
dl_harq->first_rx = 1;
|
||||
dl_harq->DLround = 0;
|
||||
dl_harq->DCINdi = 1;
|
||||
dl_harq->Ndi = 1;
|
||||
dl_harq->ack = DL_ACKNACK_NO_SET;
|
||||
}
|
||||
|
||||
@@ -329,7 +329,7 @@ void init_downlink_harq_status(NR_DL_UE_HARQ_t *dl_harq)
|
||||
*
|
||||
*********************************************************************/
|
||||
|
||||
void downlink_harq_process(NR_DL_UE_HARQ_t *dl_harq, int harq_pid, int ndi, int rv, uint8_t rnti_type) {
|
||||
void downlink_harq_process(NR_DL_UE_HARQ_t *dl_harq, int harq_pid, int dci_ndi, int rv, uint8_t rnti_type) {
|
||||
|
||||
if (rnti_type == _SI_RNTI_ ||
|
||||
rnti_type == _P_RNTI_ ||
|
||||
@@ -339,10 +339,9 @@ void downlink_harq_process(NR_DL_UE_HARQ_t *dl_harq, int harq_pid, int ndi, int
|
||||
dl_harq->first_rx = 1;
|
||||
} else {
|
||||
LOG_D(PHY,"receive harq process: %p harqPid=%d, rv=%d, ndi=%d, rntiType=%d new transmission= %s\n",
|
||||
dl_harq, harq_pid, rv, ndi, rnti_type, dl_harq->DCINdi != ndi ? "yes":"no");
|
||||
dl_harq, harq_pid, rv, dci_ndi, rnti_type, dl_harq->Ndi != dci_ndi ? "yes":"no");
|
||||
AssertFatal(rv<4 && rv>=0, "invalid redondancy version %d\n", rv);
|
||||
|
||||
if (ndi!=dl_harq->DCINdi) {
|
||||
if (dci_ndi!=dl_harq->Ndi) {
|
||||
if (dl_harq->ack == DL_NACK)
|
||||
LOG_D(PHY,"New transmission on a harq pid (%d) never acknowledged\n", harq_pid);
|
||||
else
|
||||
@@ -354,7 +353,7 @@ void downlink_harq_process(NR_DL_UE_HARQ_t *dl_harq, int harq_pid, int ndi, int
|
||||
LOG_D(PHY,"Starting retransmission on a harq pid (%d), rv (%d)\n", harq_pid, rv);
|
||||
}
|
||||
|
||||
if (ndi!=dl_harq->DCINdi) {
|
||||
if (dci_ndi!=dl_harq->Ndi) {
|
||||
dl_harq->first_rx = true;
|
||||
dl_harq->DLround = 0;
|
||||
} else {
|
||||
@@ -364,7 +363,7 @@ void downlink_harq_process(NR_DL_UE_HARQ_t *dl_harq, int harq_pid, int ndi, int
|
||||
|
||||
dl_harq->status = ACTIVE;
|
||||
|
||||
dl_harq->DCINdi = ndi;
|
||||
dl_harq->Ndi = dci_ndi;
|
||||
//dl_harq->status = SCH_IDLE;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user