debugging for TDD
This commit is contained in:
@@ -108,8 +108,7 @@ schedule_SRS(module_id_t module_idP, frame_t frameP, sub_frame_t subframeP)
|
||||
if ((1 << tmp) & deltaTSFC) {
|
||||
// This is an SRS subframe, loop over UEs
|
||||
for (UE_id = 0; UE_id < NUMBER_OF_UE_MAX; UE_id++) {
|
||||
if (RC.mac[module_idP]->UE_list.active[UE_id] != TRUE)
|
||||
continue;
|
||||
if (RC.mac[module_idP]->UE_list.active[UE_id] != TRUE) continue;
|
||||
ul_req = &RC.mac[module_idP]->UL_req[CC_id].ul_config_request_body;
|
||||
// drop the allocation if the UE hasn't send RRCConnectionSetupComplete yet
|
||||
if (mac_eNB_get_rrc_status(module_idP,UE_RNTI(module_idP, UE_id)) < RRC_CONNECTED) continue;
|
||||
@@ -124,6 +123,7 @@ schedule_SRS(module_id_t module_idP, frame_t frameP, sub_frame_t subframeP)
|
||||
soundingRS_UL_ConfigDedicated->choice.
|
||||
setup.srs_ConfigIndex,
|
||||
&srsPeriodicity, &srsOffset);
|
||||
|
||||
if (((10 * frameP + subframeP) % srsPeriodicity) == srsOffset) {
|
||||
// Program SRS
|
||||
ul_req->srs_present = 1;
|
||||
@@ -262,7 +262,7 @@ schedule_SR(module_id_t module_idP, frame_t frameP, sub_frame_t subframeP)
|
||||
ul_req_body = &ul_req->ul_config_request_body;
|
||||
|
||||
// drop the allocation if the UE hasn't send RRCConnectionSetupComplete yet
|
||||
if (mac_eNB_get_rrc_status(module_idP, UE_RNTI(module_idP, UE_id)) < RRC_CONNECTED) continue;
|
||||
//if (mac_eNB_get_rrc_status(module_idP, UE_RNTI(module_idP, UE_id)) < RRC_CONNECTED) continue;
|
||||
|
||||
AssertFatal(UE_list->
|
||||
UE_template[CC_id][UE_id].physicalConfigDedicated!= NULL,
|
||||
|
||||
@@ -1053,11 +1053,17 @@ generate_Msg4(module_id_t module_idP, int CC_idP, frame_t frameP,
|
||||
"Frame %d, Subframe %d: Preparing for Msg4 retransmission currently %d.%d\n",
|
||||
frameP, subframeP, ra->Msg4_frame,
|
||||
ra->Msg4_subframe);
|
||||
if (ra->Msg4_subframe > 1)
|
||||
if (cc[CC_idP].tdd_Config == NULL) {
|
||||
if (ra->Msg4_subframe > 1)
|
||||
ra->Msg4_frame++;
|
||||
ra->Msg4_frame &= 1023;
|
||||
ra->Msg4_subframe = (ra->Msg4_subframe + 8) % 10;
|
||||
LOG_D(MAC,
|
||||
ra->Msg4_frame &= 1023;
|
||||
ra->Msg4_subframe = (ra->Msg4_subframe + 8) % 10;
|
||||
}
|
||||
else {
|
||||
ra->Msg4_frame++;
|
||||
ra->Msg4_frame &= 1023;
|
||||
}
|
||||
LOG_I(MAC,
|
||||
"Frame %d, Subframe %d: Msg4 retransmission in %d.%d\n",
|
||||
frameP, subframeP, ra->Msg4_frame,
|
||||
ra->Msg4_subframe);
|
||||
@@ -1132,7 +1138,7 @@ generate_Msg4(module_id_t module_idP, int CC_idP, frame_t frameP,
|
||||
|
||||
dl_req->sfn_sf = mac->TX_req[CC_idP].sfn_sf;
|
||||
|
||||
LOG_D(MAC, "Filling UCI ACK/NAK information, cce_idx %d\n",
|
||||
LOG_I(MAC, "Filling UCI ACK/NAK information, cce_idx %d\n",
|
||||
dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.cce_idx);
|
||||
// Program PUCCH1a for ACK/NAK
|
||||
// Program ACK/NAK for Msg4 PDSCH
|
||||
@@ -1321,20 +1327,24 @@ check_Msg4_retransmission(module_id_t module_idP, int CC_idP,
|
||||
dci_dl_pdu_rel8.cce_idx);
|
||||
|
||||
// prepare frame for retransmission
|
||||
if (ra->Msg4_subframe > 1)
|
||||
if (cc->tdd_Config==NULL) {
|
||||
if (ra->Msg4_subframe > 1)
|
||||
ra->Msg4_frame++;
|
||||
ra->Msg4_frame &= 1023;
|
||||
ra->Msg4_subframe = (ra->Msg4_subframe + 8) % 10;
|
||||
|
||||
ra->Msg4_frame &= 1023;
|
||||
ra->Msg4_subframe = (ra->Msg4_subframe + 8) % 10;
|
||||
}
|
||||
else ra->Msg4_frame++;
|
||||
|
||||
LOG_W(MAC,
|
||||
"[eNB %d][RAPROC] CC_id %d Frame %d, subframeP %d: Msg4 not acknowledged, adding ue specific dci (rnti %x) for RA (Msg4 Retransmission round %d in %d.%d)\n",
|
||||
module_idP, CC_idP, frameP, subframeP, ra->rnti,
|
||||
round, ra->Msg4_frame, ra->Msg4_subframe);
|
||||
AssertFatal(1==0,"Shouldn't happen exit\n");
|
||||
|
||||
} // Msg4 frame/subframe
|
||||
} // regular LTE case
|
||||
} else {
|
||||
LOG_D(MAC,
|
||||
LOG_I(MAC,
|
||||
"[eNB %d][RAPROC] CC_id %d Frame %d, subframeP %d : Msg4 acknowledged\n",
|
||||
module_idP, CC_idP, frameP, subframeP);
|
||||
ra->state = IDLE;
|
||||
@@ -1370,7 +1380,7 @@ schedule_RA(module_id_t module_idP, frame_t frameP, sub_frame_t subframeP)
|
||||
|
||||
ra = (RA_t *) & cc[CC_id].ra[i];
|
||||
|
||||
LOG_I(MAC,"RA[state:%d]\n",ra->state);
|
||||
LOG_D(MAC,"RA[state:%d]\n",ra->state);
|
||||
|
||||
if (ra->state == MSG2)
|
||||
generate_Msg2(module_idP, CC_id, frameP, subframeP, ra);
|
||||
|
||||
@@ -627,7 +627,7 @@ uint16_t get_pucch1_absSF(COMMON_channels_t * cc, uint16_t dlsch_absSF)
|
||||
case 3:
|
||||
if ((sf == 5) || (sf == 6) || (sf == 7) || (sf == 8)
|
||||
|| (sf == 9))
|
||||
return ((10 * nextf) + (sf >> 1)); // ACK/NAK in 2,3,4 resp. next frame
|
||||
return ((10 * nextf) + ((sf-1) >> 1)); // ACK/NAK in 2,3,4 resp. next frame
|
||||
else if (sf == 1)
|
||||
return ((10 * nextf) + 2); // ACK/NAK in 2 next frame
|
||||
else if (sf == 0)
|
||||
@@ -1380,7 +1380,7 @@ fill_nfapi_uci_acknak(module_id_t module_idP,
|
||||
rntiP,
|
||||
absSFP,
|
||||
&ul_config_pdu->uci_harq_pdu.harq_information, cce_idxP);
|
||||
LOG_D(MAC,
|
||||
LOG_I(MAC,
|
||||
"Filled in UCI HARQ request for rnti %x SF %d.%d acknakSF %d.%d, cce_idxP %d-> n1_pucch %d\n",
|
||||
rntiP, absSFP / 10, absSFP % 10, ackNAK_absSF / 10,
|
||||
ackNAK_absSF % 10, cce_idxP,
|
||||
@@ -3255,14 +3255,89 @@ extract_harq(module_id_t mod_idP, int CC_idP, int UE_id,
|
||||
AssertFatal(numCC == 1,
|
||||
"numCC %d > 1, should not be using Format1a/b\n",
|
||||
numCC);
|
||||
|
||||
uint8_t harq_pid = ((10 * frameP) + subframeP + 10236) & 7;
|
||||
|
||||
LOG_I(MAC,"frame %d subframe %d harq_pid %d mode %d tmode[0] %d num_ack_nak %d round %d\n",frameP,subframeP,harq_pid,harq_indication_fdd->mode,tmode[0],num_ack_nak,sched_ctl->round[CC_idP][harq_pid]);
|
||||
|
||||
AssertFatal(numCC == 1,
|
||||
"numCC %d > 1, should not be using Format1a/b\n",
|
||||
numCC);
|
||||
|
||||
|
||||
if (tmode[0] == 1 || tmode[0] == 2 || tmode[0] == 5 || tmode[0] == 6 || tmode[0] == 7) { // NOTE: have to handle the case of TM9-10 with 1 antenna port
|
||||
// single ACK/NAK bit
|
||||
AssertFatal(num_ack_nak == 1,
|
||||
"num_ack_nak %d > 1 for 1 CC and single-layer transmission frame:%d subframe:%d\n",
|
||||
num_ack_nak,frameP,subframeP);
|
||||
AssertFatal(sched_ctl->round[CC_idP][harq_pid] < 8,
|
||||
"Got ACK/NAK for inactive harq_pid %d for UE %d/%x\n",
|
||||
harq_pid, UE_id, rnti);
|
||||
AssertFatal(pdu[0] == 1 || pdu[0] == 2
|
||||
|| pdu[0] == 4,
|
||||
"Received ACK/NAK %d which is not 1 or 2 for harq_pid %d from UE %d/%x\n",
|
||||
pdu[0], harq_pid, UE_id, rnti);
|
||||
LOG_D(MAC, "Received %d for harq_pid %d\n", pdu[0],
|
||||
harq_pid);
|
||||
|
||||
pdu = &harq_indication_fdd->harq_data[0].bundling.value_0;
|
||||
if (pdu[0] == 1) { // ACK
|
||||
sched_ctl->round[CC_idP][harq_pid] = 8; // release HARQ process
|
||||
sched_ctl->tbcnt[CC_idP][harq_pid] = 0;
|
||||
} else if (pdu[0] == 2 || pdu[0] == 4) // NAK (treat DTX as NAK)
|
||||
sched_ctl->round[CC_idP][harq_pid]++; // increment round
|
||||
} else {
|
||||
// one or two ACK/NAK bits
|
||||
AssertFatal(num_ack_nak <= 2,
|
||||
"num_ack_nak %d > 2 for 1 CC and TM3/4/8/9/10\n",
|
||||
num_ack_nak);
|
||||
if ((num_ack_nak == 2)
|
||||
&& (sched_ctl->round[CC_idP][harq_pid] < 8)
|
||||
&& (sched_ctl->tbcnt[CC_idP][harq_pid] == 1)
|
||||
&& (pdu[0] == 1) && (pdu[1] == 1)) {
|
||||
sched_ctl->round[CC_idP][harq_pid] = 8;
|
||||
sched_ctl->tbcnt[CC_idP][harq_pid] = 0;
|
||||
}
|
||||
if ((num_ack_nak == 2)
|
||||
&& (sched_ctl->round[CC_idP][harq_pid] < 8)
|
||||
&& (sched_ctl->tbcnt[CC_idP][harq_pid] == 1)
|
||||
&& (pdu[0] == 2) && (pdu[1] == 2))
|
||||
sched_ctl->round[CC_idP][harq_pid]++;
|
||||
else if (((num_ack_nak == 2)
|
||||
&& (sched_ctl->round[CC_idP][harq_pid] < 8)
|
||||
&& (sched_ctl->tbcnt[0][harq_pid] == 2)
|
||||
&& (pdu[0] == 1) && (pdu[1] == 2))
|
||||
|| ((num_ack_nak == 2)
|
||||
&& (sched_ctl->round[CC_idP][harq_pid] < 8)
|
||||
&& (sched_ctl->tbcnt[CC_idP][harq_pid] == 2)
|
||||
&& (pdu[0] == 2) && (pdu[1] == 1))) {
|
||||
sched_ctl->round[CC_idP][harq_pid]++;
|
||||
sched_ctl->tbcnt[CC_idP][harq_pid] = 1;
|
||||
} else if ((num_ack_nak == 2)
|
||||
&& (sched_ctl->round[CC_idP][harq_pid] < 8)
|
||||
&& (sched_ctl->tbcnt[CC_idP][harq_pid] == 2)
|
||||
&& (pdu[0] == 2) && (pdu[1] == 2))
|
||||
sched_ctl->round[CC_idP][harq_pid]++;
|
||||
else
|
||||
AssertFatal(1 == 0,
|
||||
"Illegal ACK/NAK/round combination (%d,%d,%d,%d,%d) for harq_pid %d, UE %d/%x\n",
|
||||
num_ack_nak,
|
||||
sched_ctl->round[CC_idP][harq_pid],
|
||||
sched_ctl->round[CC_idP][harq_pid], pdu[0],
|
||||
pdu[1], harq_pid, UE_id, rnti);
|
||||
}
|
||||
break;
|
||||
case 1: // Channel Selection
|
||||
AssertFatal(1==0,"Can't do channel selection yet in TDD\n");
|
||||
break;
|
||||
case 1: // Channel Selection
|
||||
case 2: // Format 2
|
||||
AssertFatal(1==0,"Can't do Format 2 yet in TDD\n");
|
||||
break;
|
||||
case 2: // Format 3
|
||||
break;
|
||||
case 3: // Format 4
|
||||
case 3: // Format 3
|
||||
AssertFatal(1==0,"Can't do Format 3 yet in TDD\n");
|
||||
break;
|
||||
case 4: // Format 5
|
||||
AssertFatal(1==0,"Can't do Format 4 yet in TDD\n");
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
@@ -3272,7 +3347,7 @@ extract_harq(module_id_t mod_idP, int CC_idP, int UE_id,
|
||||
|
||||
uint8_t harq_pid = ((10 * frameP) + subframeP + 10236) & 7;
|
||||
|
||||
LOG_D(MAC,"frame %d subframe %d harq_pid %d mode %d tmode[0] %d num_ack_nak %d round %d\n",frameP,subframeP,harq_pid,harq_indication_fdd->mode,tmode[0],num_ack_nak,sched_ctl->round[CC_idP][harq_pid]);
|
||||
LOG_I(MAC,"frame %d subframe %d harq_pid %d mode %d tmode[0] %d num_ack_nak %d round %d\n",frameP,subframeP,harq_pid,harq_indication_fdd->mode,tmode[0],num_ack_nak,sched_ctl->round[CC_idP][harq_pid]);
|
||||
|
||||
switch (harq_indication_fdd->mode) {
|
||||
case 0: // Format 1a/b (10.1.2.1)
|
||||
@@ -4026,8 +4101,12 @@ static int nack_or_dtx_reported(
|
||||
int i;
|
||||
|
||||
if (cc->tdd_Config) {
|
||||
AssertFatal(0==1, "TDD to be done. FAPI structures (see nfapi_harq_indication_tdd_rel13_t) are not clean. To be cleaned as well?\n");
|
||||
abort();
|
||||
LOG_W(MAC,"FAPI structures (see nfapi_harq_indication_tdd_rel13_t) are not clean. To be cleaned as well?\n");
|
||||
nfapi_harq_indication_tdd_rel13_t *hi = &harq_pdu->harq_indication_tdd_rel13;
|
||||
for (i = 0; i < hi->number_of_ack_nack; hi++)
|
||||
if (hi->harq_data[i].bundling.value_0 != 1)
|
||||
return 1;
|
||||
return 0;
|
||||
} else {
|
||||
nfapi_harq_indication_fdd_rel13_t *hi = &harq_pdu->harq_indication_fdd_rel13;
|
||||
for (i = 0; i < hi->number_of_ack_nack; hi++)
|
||||
@@ -4054,7 +4133,7 @@ harq_indication(module_id_t mod_idP, int CC_idP, frame_t frameP,
|
||||
UE_sched_ctrl *sched_ctl = &UE_list->UE_sched_ctrl[UE_id];
|
||||
COMMON_channels_t *cc = &RC.mac[mod_idP]->common_channels[CC_idP];
|
||||
// extract HARQ Information
|
||||
LOG_D(MAC,
|
||||
LOG_I(MAC,
|
||||
"Frame %d, subframe %d: Received harq indication (%d) from UE %d/%x, ul_cqi %d\n",
|
||||
frameP, subframeP, channel, UE_id, rnti, ul_cqi);
|
||||
if (cc->tdd_Config)
|
||||
|
||||
@@ -160,8 +160,8 @@ rx_sdu(const module_id_t enb_mod_idP,
|
||||
|
||||
if (UE_id != -1) {
|
||||
LOG_D(MAC,
|
||||
"[eNB %d][PUSCH %d] CC_id %d Received ULSCH sdu round %d from PHY (rnti %x, UE_id %d) ul_cqi %d\n",
|
||||
enb_mod_idP, harq_pid, CC_idP,
|
||||
"[eNB %d][PUSCH %d] SFN.SF %d.%d : CC_id %d Received ULSCH sdu round %d from PHY (rnti %x, UE_id %d) ul_cqi %d\n",
|
||||
enb_mod_idP, harq_pid, frameP,subframeP, CC_idP,
|
||||
UE_list->UE_sched_ctrl[UE_id].round_UL[CC_idP][harq_pid],
|
||||
current_rnti, UE_id, ul_cqi);
|
||||
|
||||
@@ -225,8 +225,8 @@ rx_sdu(const module_id_t enb_mod_idP,
|
||||
maxHARQ_Msg3Tx);
|
||||
|
||||
LOG_I(MAC,
|
||||
"[eNB %d][PUSCH %d] CC_id %d [RAPROC Msg3] Received ULSCH sdu round %d from PHY (rnti %x, RA_id %d) ul_cqi %d\n",
|
||||
enb_mod_idP, harq_pid, CC_idP, ra[RA_id].msg3_round,
|
||||
"[eNB %d][PUSCH %d] SFN.SF %d.%d CC_id %d [RAPROC Msg3] : Received ULSCH sdu round %d from PHY (rnti %x, RA_id %d) ul_cqi %d\n",
|
||||
enb_mod_idP, harq_pid, frameP,subframeP,CC_idP, ra[RA_id].msg3_round,
|
||||
current_rnti, RA_id, ul_cqi);
|
||||
|
||||
first_rb = ra->msg3_first_rb;
|
||||
@@ -247,9 +247,15 @@ rx_sdu(const module_id_t enb_mod_idP,
|
||||
first_rb = UE_list->UE_template[CC_idP][UE_id].first_rb_ul[harq_pid];
|
||||
ra[RA_id].msg3_round++;
|
||||
// prepare handling of retransmission
|
||||
ra[RA_id].Msg3_frame = (ra[RA_id].Msg3_frame + ((ra[RA_id].Msg3_subframe > 1) ? 1 : 0)) % 1024;
|
||||
ra[RA_id].Msg3_subframe = (ra[RA_id].Msg3_subframe + 8) % 10;
|
||||
add_msg3(enb_mod_idP, CC_idP, &ra[RA_id], frameP, subframeP);
|
||||
if (RC.mac[enb_mod_idP]->common_channels[CC_idP].tdd_Config == NULL) {
|
||||
ra[RA_id].Msg3_frame = (ra[RA_id].Msg3_frame + ((ra[RA_id].Msg3_subframe > 1) ? 1 : 0)) % 1024;
|
||||
ra[RA_id].Msg3_subframe = (ra[RA_id].Msg3_subframe + 8) % 10;
|
||||
}
|
||||
else {
|
||||
ra[RA_id].Msg3_frame++;
|
||||
ra[RA_id].Msg3_frame&=1023;
|
||||
}
|
||||
// add_msg3(enb_mod_idP, CC_idP, &ra[RA_id], frameP, subframeP);
|
||||
}
|
||||
return;
|
||||
}
|
||||
@@ -561,9 +567,10 @@ rx_sdu(const module_id_t enb_mod_idP,
|
||||
|
||||
|
||||
// Program Msg4 PDCCH+DLSCH/MPDCCH transmission 4 subframes from now, // Check if this is ok for BL/CE, or if the rule is different
|
||||
// make sure this works for all TDD configurations!
|
||||
ra->Msg4_frame = frameP + ((subframeP > 5) ? 1 : 0);
|
||||
ra->Msg4_subframe = (subframeP + 4) % 10;
|
||||
|
||||
|
||||
} // if process is active
|
||||
} // loop on RA processes
|
||||
|
||||
|
||||
Reference in New Issue
Block a user