Commit 652e52b7 authored by Florian Kaltenberger's avatar Florian Kaltenberger

TM3 still WIP but regression tests are already ok

parent 4bda0839
...@@ -169,7 +169,7 @@ void extract_CQI(void *o,UCI_format_t uci_format,LTE_eNB_UE_stats *stats, uint8_ ...@@ -169,7 +169,7 @@ void extract_CQI(void *o,UCI_format_t uci_format,LTE_eNB_UE_stats *stats, uint8_
//UCI_format fmt; //UCI_format fmt;
//uint8_t N_RB_DL = 25; //uint8_t N_RB_DL = 25;
uint8_t i; uint8_t i;
LOG_I(PHY,"[eNB][UCI] N_RB_DL %d uci format %d\n", N_RB_DL,uci_format); LOG_D(PHY,"[eNB][UCI] N_RB_DL %d uci format %d\n", N_RB_DL,uci_format);
switch(N_RB_DL) { switch(N_RB_DL) {
case 6: case 6:
......
...@@ -505,6 +505,17 @@ int16_t get_hundred_times_delta_IF_mac(module_id_t module_idP, uint8_t CC_id, rn ...@@ -505,6 +505,17 @@ int16_t get_hundred_times_delta_IF_mac(module_id_t module_idP, uint8_t CC_id, rn
int16_t get_target_pusch_rx_power(module_id_t module_idP, uint8_t CC_id); int16_t get_target_pusch_rx_power(module_id_t module_idP, uint8_t CC_id);
int16_t get_target_pucch_rx_power(module_id_t module_idP, uint8_t CC_id); int16_t get_target_pucch_rx_power(module_id_t module_idP, uint8_t CC_id);
/*! \brief This function is typically called from the MAC and asks the PHY for a harq_pid for rnti to use in frame.subframe. The function will also return the current round (round is a vector of size 2 for the 2 TBs for DL) correspoing to this harq_pid. If the round (rounds) is (are) 0 then the harq_pid is free.
@param Mod_id
@param CC_id
@param rnti
@param frame
@param subframe
@param harq_pid
@param round
@param ul_flag
@returns 0 on succes, -1 for error
*/
int get_ue_active_harq_pid(uint8_t Mod_id,uint8_t CC_id,uint16_t rnti,int frame, uint8_t subframe,uint8_t *harq_pid,uint8_t *round,uint8_t ul_flag); int get_ue_active_harq_pid(uint8_t Mod_id,uint8_t CC_id,uint16_t rnti,int frame, uint8_t subframe,uint8_t *harq_pid,uint8_t *round,uint8_t ul_flag);
void dump_dlsch(PHY_VARS_UE *phy_vars_ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uint8_t subframe,uint8_t harq_pid); void dump_dlsch(PHY_VARS_UE *phy_vars_ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uint8_t subframe,uint8_t harq_pid);
......
...@@ -235,7 +235,7 @@ int8_t find_next_ue_index(PHY_VARS_eNB *eNB) ...@@ -235,7 +235,7 @@ int8_t find_next_ue_index(PHY_VARS_eNB *eNB)
int get_ue_active_harq_pid(const uint8_t Mod_id,const uint8_t CC_id,const uint16_t rnti, const int frame, const uint8_t subframe,uint8_t *harq_pid,uint8_t *round,const uint8_t harq_flag) int get_ue_active_harq_pid(const uint8_t Mod_id,const uint8_t CC_id,const uint16_t rnti, const int frame, const uint8_t subframe,uint8_t *harq_pid,uint8_t *round,const uint8_t harq_flag)
{ {
LTE_eNB_DLSCH_t *DLSCH_ptr; LTE_eNB_DLSCH_t *DLSCH_ptr[2];
LTE_eNB_ULSCH_t *ULSCH_ptr; LTE_eNB_ULSCH_t *ULSCH_ptr;
uint8_t ulsch_subframe,ulsch_frame; uint8_t ulsch_subframe,ulsch_frame;
int i; int i;
...@@ -244,17 +244,19 @@ int get_ue_active_harq_pid(const uint8_t Mod_id,const uint8_t CC_id,const uint16 ...@@ -244,17 +244,19 @@ int get_ue_active_harq_pid(const uint8_t Mod_id,const uint8_t CC_id,const uint16
if (UE_id==-1) { if (UE_id==-1) {
LOG_D(PHY,"Cannot find UE with rnti %x (Mod_id %d, CC_id %d)\n",rnti, Mod_id, CC_id); LOG_D(PHY,"Cannot find UE with rnti %x (Mod_id %d, CC_id %d)\n",rnti, Mod_id, CC_id);
*round=0; *round=0;
*(round+1)=0;
return(-1); return(-1);
} }
if ((harq_flag == openair_harq_DL) || (harq_flag == openair_harq_RA)) {// this is a DL request if ((harq_flag == openair_harq_DL) || (harq_flag == openair_harq_RA)) {// this is a DL request
DLSCH_ptr = PHY_vars_eNB_g[Mod_id][CC_id]->dlsch[(uint32_t)UE_id][0]; DLSCH_ptr[0] = PHY_vars_eNB_g[Mod_id][CC_id]->dlsch[(uint32_t)UE_id][0];
DLSCH_ptr[1] = PHY_vars_eNB_g[Mod_id][CC_id]->dlsch[(uint32_t)UE_id][1];
if (harq_flag == openair_harq_RA) { if (harq_flag == openair_harq_RA) {
if (DLSCH_ptr->harq_processes[0] != NULL) { if (DLSCH_ptr[0]->harq_processes[0] != NULL) {
*harq_pid = 0; *harq_pid = 0;
*round = DLSCH_ptr->harq_processes[0]->round; *round = DLSCH_ptr[0]->harq_processes[0]->round;
return 0; return 0;
} else { } else {
return -1; return -1;
...@@ -264,12 +266,17 @@ int get_ue_active_harq_pid(const uint8_t Mod_id,const uint8_t CC_id,const uint16 ...@@ -264,12 +266,17 @@ int get_ue_active_harq_pid(const uint8_t Mod_id,const uint8_t CC_id,const uint16
/* let's go synchronous for the moment - maybe we can change at some point */ /* let's go synchronous for the moment - maybe we can change at some point */
i = (frame * 10 + subframe) % 8; i = (frame * 10 + subframe) % 8;
if (DLSCH_ptr->harq_processes[i]->status == ACTIVE) { if ((DLSCH_ptr[0]->harq_processes[i]->status == ACTIVE) ||
(DLSCH_ptr[1]->harq_processes[i]->status == ACTIVE)) { //at least one of the two TBs is active
*harq_pid = i; *harq_pid = i;
*round = DLSCH_ptr->harq_processes[i]->round; *round = DLSCH_ptr[0]->harq_processes[i]->round;
} else if (DLSCH_ptr->harq_processes[i]->status == SCH_IDLE) { *(round+1) = DLSCH_ptr[1]->harq_processes[i]->round;
} else if ((DLSCH_ptr[0]->harq_processes[i]->status == SCH_IDLE) &&
(DLSCH_ptr[1]->harq_processes[i]->status == SCH_IDLE)){ //none of the two TBs is active
*harq_pid = i; *harq_pid = i;
*round = 0; *round = 0;
*(round+1) = 0;
} else { } else {
printf("%s:%d: bad state for harq process - PLEASE REPORT!!\n", __FILE__, __LINE__); printf("%s:%d: bad state for harq process - PLEASE REPORT!!\n", __FILE__, __LINE__);
abort(); abort();
...@@ -1586,21 +1593,20 @@ void process_HARQ_feedback(uint8_t UE_id, ...@@ -1586,21 +1593,20 @@ void process_HARQ_feedback(uint8_t UE_id,
dlsch_ACK[0][0] = eNB->ulsch[(uint8_t)UE_id]->harq_processes[harq_pid]->o_ACK[0]; dlsch_ACK[0][0] = eNB->ulsch[(uint8_t)UE_id]->harq_processes[harq_pid]->o_ACK[0];
dlsch_ACK[1][0] = eNB->ulsch[(uint8_t)UE_id]->harq_processes[harq_pid]->o_ACK[1]; dlsch_ACK[1][0] = eNB->ulsch[(uint8_t)UE_id]->harq_processes[harq_pid]->o_ACK[1];
if (dlsch->subframe_tx[subframe_m4]==1) if (dlsch->subframe_tx[subframe_m4]==1)
LOG_D(PHY,"[eNB %d] Frame %d: Received ACK/NAK %d on PUSCH for subframe %d\n",eNB->Mod_id, LOG_I(PHY,"[eNB %d] Frame %d: Received ACK/NAK %d,%d on PUSCH for harq_pid %d, subframe %d\n",eNB->Mod_id,
frame,dlsch_ACK[0],subframe_m4); frame,dlsch_ACK[0][0],dlsch_ACK[1][0],dl_harq_pid[0],subframe_m4);
} }
else { else {
dlsch_ACK[0][0] = pucch_payload[0]; dlsch_ACK[0][0] = pucch_payload[0];
dlsch_ACK[1][0] = pucch_payload[1]; dlsch_ACK[1][0] = pucch_payload[1];
LOG_D(PHY,"[eNB %d] Frame %d: Received ACK/NAK %d on PUCCH for subframe %d\n",eNB->Mod_id, LOG_I(PHY,"[eNB %d] Frame %d: Received ACK/NAK %d,%d on PUCCH for harq_pid %d, subframe %d\n",eNB->Mod_id,
frame,dlsch_ACK[0],subframe_m4); frame,dlsch_ACK[0][0],dlsch_ACK[1][0],dl_harq_pid[0],subframe_m4);
/* /*
if (dlsch_ACK[0]==0) if (dlsch_ACK[0]==0)
AssertFatal(0,"Exiting on NAK on PUCCH\n"); AssertFatal(0,"Exiting on NAK on PUCCH\n");
*/ */
} }
#if defined(MESSAGE_CHART_GENERATOR_PHY) #if defined(MESSAGE_CHART_GENERATOR_PHY)
MSC_LOG_RX_MESSAGE( MSC_LOG_RX_MESSAGE(
MSC_PHY_ENB,MSC_PHY_UE, MSC_PHY_ENB,MSC_PHY_UE,
...@@ -1765,10 +1771,10 @@ void process_HARQ_feedback(uint8_t UE_id, ...@@ -1765,10 +1771,10 @@ void process_HARQ_feedback(uint8_t UE_id,
if (dlsch_harq_proc->round == dlsch->Mlimit) { if (dlsch_harq_proc->round == dlsch->Mlimit) {
// This was the last round for DLSCH so reset round and increment l2_error counter // This was the last round for DLSCH so reset round and increment l2_error counter
#ifdef DEBUG_PHY_PROC //#ifdef DEBUG_PHY_PROC
LOG_W(PHY,"[eNB %d][PDSCH %x/%d] DLSCH retransmissions exhausted, dropping packet\n",eNB->Mod_id, LOG_W(PHY,"[eNB %d][PDSCH %x/%d] DLSCH retransmissions exhausted, dropping packet\n",eNB->Mod_id,
dlsch->rnti,dl_harq_pid[m]); dlsch->rnti,dl_harq_pid[m]);
#endif //#endif
#if defined(MESSAGE_CHART_GENERATOR_PHY) #if defined(MESSAGE_CHART_GENERATOR_PHY)
MSC_LOG_EVENT(MSC_PHY_ENB, "0 HARQ DLSCH Failed RNTI %"PRIx16" round %u", MSC_LOG_EVENT(MSC_PHY_ENB, "0 HARQ DLSCH Failed RNTI %"PRIx16" round %u",
dlsch->rnti, dlsch->rnti,
......
...@@ -775,7 +775,7 @@ typedef struct { ...@@ -775,7 +775,7 @@ typedef struct {
// resource scheduling information // resource scheduling information
uint8_t harq_pid[MAX_NUM_CCs]; uint8_t harq_pid[MAX_NUM_CCs];
uint8_t round[MAX_NUM_CCs]; uint8_t round[MAX_NUM_CCs][2];
uint8_t dl_pow_off[MAX_NUM_CCs]; uint8_t dl_pow_off[MAX_NUM_CCs];
uint16_t pre_nb_available_rbs[MAX_NUM_CCs]; uint16_t pre_nb_available_rbs[MAX_NUM_CCs];
unsigned char rballoc_sub_UE[MAX_NUM_CCs][N_RBG_MAX]; unsigned char rballoc_sub_UE[MAX_NUM_CCs][N_RBG_MAX];
......
This diff is collapsed.
...@@ -671,7 +671,7 @@ void add_ue_spec_dci(DCI_PDU *DCI_pdu,void *pdu,rnti_t rnti,unsigned char dci_si ...@@ -671,7 +671,7 @@ void add_ue_spec_dci(DCI_PDU *DCI_pdu,void *pdu,rnti_t rnti,unsigned char dci_si
DCI_pdu->Num_ue_spec_dci++; DCI_pdu->Num_ue_spec_dci++;
LOG_I(MAC,"add ue specific dci format %d for rnti %x \n",dci_fmt,rnti); LOG_D(MAC,"add ue specific dci format %d for rnti %x \n",dci_fmt,rnti);
} }
......
...@@ -267,18 +267,18 @@ int maxround(module_id_t Mod_id,uint16_t rnti,int frame,sub_frame_t subframe,uin ...@@ -267,18 +267,18 @@ int maxround(module_id_t Mod_id,uint16_t rnti,int frame,sub_frame_t subframe,uin
{ {
uint8_t round,round_max=0,UE_id; uint8_t round,round_max=0,UE_id;
int CC_id; int CC_id,tb;
UE_list_t *UE_list = &eNB_mac_inst[Mod_id].UE_list; UE_list_t *UE_list = &eNB_mac_inst[Mod_id].UE_list;
for (CC_id=0; CC_id<MAX_NUM_CCs; CC_id++) {
UE_id = find_UE_id(Mod_id,rnti); UE_id = find_UE_id(Mod_id,rnti);
round = UE_list->UE_sched_ctrl[UE_id].round[CC_id]; for (CC_id=0; CC_id<MAX_NUM_CCs; CC_id++) {
for (tb=0;tb<2;tb++) {
round = UE_list->UE_sched_ctrl[UE_id].round[CC_id][tb];
if (round > round_max) { if (round > round_max) {
round_max = round; round_max = round;
} }
} }
}
return round_max; return round_max;
} }
...@@ -505,8 +505,9 @@ void dlsch_scheduler_pre_processor (module_id_t Mod_id, ...@@ -505,8 +505,9 @@ void dlsch_scheduler_pre_processor (module_id_t Mod_id,
int *mbsfn_flag) int *mbsfn_flag)
{ {
unsigned char rballoc_sub[MAX_NUM_CCs][N_RBG_MAX],harq_pid=0,round=0,total_ue_count; unsigned char rballoc_sub[MAX_NUM_CCs][N_RBG_MAX];
unsigned char MIMO_mode_indicator[MAX_NUM_CCs][N_RBG_MAX]; unsigned char MIMO_mode_indicator[MAX_NUM_CCs][N_RBG_MAX];
unsigned char harq_pid=0,round[2]={0,0},total_ue_count;
int UE_id, i; int UE_id, i;
uint16_t ii,j; uint16_t ii,j;
uint16_t nb_rbs_required[MAX_NUM_CCs][NUMBER_OF_UE_MAX]; uint16_t nb_rbs_required[MAX_NUM_CCs][NUMBER_OF_UE_MAX];
...@@ -601,7 +602,8 @@ void dlsch_scheduler_pre_processor (module_id_t Mod_id, ...@@ -601,7 +602,8 @@ void dlsch_scheduler_pre_processor (module_id_t Mod_id,
CC_id = UE_list->ordered_CCids[ii][UE_id]; CC_id = UE_list->ordered_CCids[ii][UE_id];
ue_sched_ctl = &UE_list->UE_sched_ctrl[UE_id]; ue_sched_ctl = &UE_list->UE_sched_ctrl[UE_id];
harq_pid = ue_sched_ctl->harq_pid[CC_id]; harq_pid = ue_sched_ctl->harq_pid[CC_id];
round = ue_sched_ctl->round[CC_id]; round[0] = ue_sched_ctl->round[CC_id][0];
round[1] = ue_sched_ctl->round[CC_id][1];
// if there is no available harq_process, skip the UE // if there is no available harq_process, skip the UE
if (UE_list->UE_sched_ctrl[UE_id].harq_pid[CC_id]<0) if (UE_list->UE_sched_ctrl[UE_id].harq_pid[CC_id]<0)
...@@ -613,7 +615,7 @@ void dlsch_scheduler_pre_processor (module_id_t Mod_id, ...@@ -613,7 +615,7 @@ void dlsch_scheduler_pre_processor (module_id_t Mod_id,
// mac_xface->get_ue_active_harq_pid(Mod_id,CC_id,rnti,frameP,subframeP,&harq_pid,&round,0); // mac_xface->get_ue_active_harq_pid(Mod_id,CC_id,rnti,frameP,subframeP,&harq_pid,&round,0);
if(round>0) { if ((round[1]>0) || (round[1]>0)) {
nb_rbs_required[CC_id][UE_id] = UE_list->UE_template[CC_id][UE_id].nb_rb[harq_pid]; nb_rbs_required[CC_id][UE_id] = UE_list->UE_template[CC_id][UE_id].nb_rb[harq_pid];
} }
...@@ -704,7 +706,8 @@ void dlsch_scheduler_pre_processor (module_id_t Mod_id, ...@@ -704,7 +706,8 @@ void dlsch_scheduler_pre_processor (module_id_t Mod_id,
CC_id = UE_list->ordered_CCids[ii][UE_id]; CC_id = UE_list->ordered_CCids[ii][UE_id];
ue_sched_ctl = &UE_list->UE_sched_ctrl[UE_id]; ue_sched_ctl = &UE_list->UE_sched_ctrl[UE_id];
harq_pid = ue_sched_ctl->harq_pid[CC_id]; harq_pid = ue_sched_ctl->harq_pid[CC_id];
round = ue_sched_ctl->round[CC_id]; round[0] = ue_sched_ctl->round[CC_id][0];
round[1] = ue_sched_ctl->round[CC_id][1];
rnti = UE_RNTI(Mod_id,UE_id); rnti = UE_RNTI(Mod_id,UE_id);
...@@ -921,7 +924,7 @@ void dlsch_scheduler_pre_processor_reset (int module_idP, ...@@ -921,7 +924,7 @@ void dlsch_scheduler_pre_processor_reset (int module_idP,
mac_xface->get_ue_active_harq_pid(module_idP,CC_id,rnti, mac_xface->get_ue_active_harq_pid(module_idP,CC_id,rnti,
frameP,subframeP, frameP,subframeP,
&ue_sched_ctl->harq_pid[CC_id], &ue_sched_ctl->harq_pid[CC_id],
&ue_sched_ctl->round[CC_id], &ue_sched_ctl->round[CC_id][0],
openair_harq_DL); openair_harq_DL);
if (ue_sched_ctl->ta_timer == 0) { if (ue_sched_ctl->ta_timer == 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