Commit 574399fa authored by gauthier's avatar gauthier

some formatting changes in physcope for eNodeB. fixes for joint SR/ACK-NAK detection.

parent e44146b7
...@@ -160,7 +160,7 @@ void phy_scope_eNB(FD_lte_phy_scope_enb *form, ...@@ -160,7 +160,7 @@ void phy_scope_eNB(FD_lte_phy_scope_enb *form,
int UE_id) int UE_id)
{ {
int eNB_id = 0; int eNB_id = 0;
int i,arx,atx,ind,k; int i,i2,arx,atx,ind,k;
LTE_DL_FRAME_PARMS *frame_parms = &phy_vars_enb->lte_frame_parms; LTE_DL_FRAME_PARMS *frame_parms = &phy_vars_enb->lte_frame_parms;
int nsymb_ce = 12*frame_parms->N_RB_UL*frame_parms->symbols_per_tti; int nsymb_ce = 12*frame_parms->N_RB_UL*frame_parms->symbols_per_tti;
uint8_t nb_antennas_rx = frame_parms->nb_antennas_rx; uint8_t nb_antennas_rx = frame_parms->nb_antennas_rx;
...@@ -181,6 +181,7 @@ void phy_scope_eNB(FD_lte_phy_scope_enb *form, ...@@ -181,6 +181,7 @@ void phy_scope_eNB(FD_lte_phy_scope_enb *form,
float chest_t_abs[nb_antennas_rx][frame_parms->ofdm_symbol_size]; float chest_t_abs[nb_antennas_rx][frame_parms->ofdm_symbol_size];
float *chest_f_abs; float *chest_f_abs;
float time[FRAME_LENGTH_COMPLEX_SAMPLES]; float time[FRAME_LENGTH_COMPLEX_SAMPLES];
float time2[2048];
float freq[nsymb_ce*nb_antennas_rx*nb_antennas_tx]; float freq[nsymb_ce*nb_antennas_rx*nb_antennas_tx];
int frame = phy_vars_enb->proc[0].frame_tx; int frame = phy_vars_enb->proc[0].frame_tx;
uint32_t total_dlsch_bitrate = phy_vars_enb->total_dlsch_bitrate; uint32_t total_dlsch_bitrate = phy_vars_enb->total_dlsch_bitrate;
...@@ -238,19 +239,21 @@ void phy_scope_eNB(FD_lte_phy_scope_enb *form, ...@@ -238,19 +239,21 @@ void phy_scope_eNB(FD_lte_phy_scope_enb *form,
if (chest_t[0] !=NULL) { if (chest_t[0] !=NULL) {
for (i=0; i<(frame_parms->ofdm_symbol_size); i++) { for (i=0; i<(frame_parms->ofdm_symbol_size); i++) {
chest_t_abs[0][i] = 10*log10((float) (chest_t[0][2*i]*chest_t[0][2*i]+chest_t[0][2*i+1]*chest_t[0][2*i+1])); i2 = (i+(frame_parms->ofdm_symbol_size>>1))%frame_parms->ofdm_symbol_size;
time2[i] = (float)(i-(frame_parms->ofdm_symbol_size>>1));
chest_t_abs[0][i] = 10*log10((float) (1+chest_t[0][2*i2]*chest_t[0][2*i2]+chest_t[0][2*i2+1]*chest_t[0][2*i2+1]));
if (chest_t_abs[0][i] > ymax) if (chest_t_abs[0][i] > ymax)
ymax = chest_t_abs[0][i]; ymax = chest_t_abs[0][i];
} }
fl_set_xyplot_data(form->chest_t,time,chest_t_abs[0],(frame_parms->ofdm_symbol_size),"","",""); fl_set_xyplot_data(form->chest_t,time2,chest_t_abs[0],(frame_parms->ofdm_symbol_size),"","","");
} }
for (arx=1; arx<nb_antennas_rx; arx++) { for (arx=1; arx<nb_antennas_rx; arx++) {
if (chest_t[arx] !=NULL) { if (chest_t[arx] !=NULL) {
for (i=0; i<(frame_parms->ofdm_symbol_size>>3); i++) { for (i=0; i<(frame_parms->ofdm_symbol_size>>3); i++) {
chest_t_abs[arx][i] = 10*log10((float) (chest_t[arx][2*i]*chest_t[arx][2*i]+chest_t[arx][2*i+1]*chest_t[arx][2*i+1])); chest_t_abs[arx][i] = 10*log10((float) (1+chest_t[arx][2*i]*chest_t[arx][2*i]+chest_t[arx][2*i+1]*chest_t[arx][2*i+1]));
if (chest_t_abs[arx][i] > ymax) if (chest_t_abs[arx][i] > ymax)
ymax = chest_t_abs[arx][i]; ymax = chest_t_abs[arx][i];
......
...@@ -3122,7 +3122,7 @@ void phy_procedures_eNB_RX(const unsigned char sched_subframe,PHY_VARS_eNB *phy_ ...@@ -3122,7 +3122,7 @@ void phy_procedures_eNB_RX(const unsigned char sched_subframe,PHY_VARS_eNB *phy_
int16_t n1_pucch0,n1_pucch1,n1_pucch2,n1_pucch3; int16_t n1_pucch0,n1_pucch1,n1_pucch2,n1_pucch3;
uint8_t do_SR = 0; uint8_t do_SR = 0;
uint8_t pucch_sel = 0; uint8_t pucch_sel = 0;
int32_t metric0=0,metric1=0; int32_t metric0=0,metric1=0,metric0_SR=0;
ANFBmode_t bundling_flag; ANFBmode_t bundling_flag;
PUCCH_FMT_t format; PUCCH_FMT_t format;
uint8_t nPRS; uint8_t nPRS;
...@@ -3664,7 +3664,7 @@ void phy_procedures_eNB_RX(const unsigned char sched_subframe,PHY_VARS_eNB *phy_ ...@@ -3664,7 +3664,7 @@ void phy_procedures_eNB_RX(const unsigned char sched_subframe,PHY_VARS_eNB *phy_
harq_pid, harq_pid,
&phy_vars_eNB->ulsch_eNB[i]->Msg3_flag); &phy_vars_eNB->ulsch_eNB[i]->Msg3_flag);
// false msg3 detection by MAC: empty PDU // one-shot msg3 detection by MAC: empty PDU (e.g. CRNTI)
if (phy_vars_eNB->ulsch_eNB[i]->Msg3_flag == 0 ) { if (phy_vars_eNB->ulsch_eNB[i]->Msg3_flag == 0 ) {
phy_vars_eNB->eNB_UE_stats[i].mode = PRACH; phy_vars_eNB->eNB_UE_stats[i].mode = PRACH;
mac_xface->cancel_ra_proc(phy_vars_eNB->Mod_id, mac_xface->cancel_ra_proc(phy_vars_eNB->Mod_id,
...@@ -3868,7 +3868,7 @@ void phy_procedures_eNB_RX(const unsigned char sched_subframe,PHY_VARS_eNB *phy_ ...@@ -3868,7 +3868,7 @@ void phy_procedures_eNB_RX(const unsigned char sched_subframe,PHY_VARS_eNB *phy_
phy_vars_eNB->eNB_UE_stats[i].sr_total++; phy_vars_eNB->eNB_UE_stats[i].sr_total++;
if (abstraction_flag == 0) if (abstraction_flag == 0)
metric0 = rx_pucch(phy_vars_eNB, metric0_SR = rx_pucch(phy_vars_eNB,
pucch_format1, pucch_format1,
i, i,
phy_vars_eNB->scheduling_request_config[i].sr_PUCCH_ResourceIndex, phy_vars_eNB->scheduling_request_config[i].sr_PUCCH_ResourceIndex,
...@@ -3880,7 +3880,7 @@ void phy_procedures_eNB_RX(const unsigned char sched_subframe,PHY_VARS_eNB *phy_ ...@@ -3880,7 +3880,7 @@ void phy_procedures_eNB_RX(const unsigned char sched_subframe,PHY_VARS_eNB *phy_
#ifdef PHY_ABSTRACTION #ifdef PHY_ABSTRACTION
else { else {
metric0 = rx_pucch_emul(phy_vars_eNB, metric0_SR = rx_pucch_emul(phy_vars_eNB,
i, i,
pucch_format1, pucch_format1,
0, 0,
...@@ -3921,20 +3921,35 @@ void phy_procedures_eNB_RX(const unsigned char sched_subframe,PHY_VARS_eNB *phy_ ...@@ -3921,20 +3921,35 @@ void phy_procedures_eNB_RX(const unsigned char sched_subframe,PHY_VARS_eNB *phy_
if ((n1_pucch0==-1) && (n1_pucch1==-1)) { // just check for SR if ((n1_pucch0==-1) && (n1_pucch1==-1)) { // just check for SR
} else if (phy_vars_eNB->lte_frame_parms.frame_type==FDD) { // FDD } else if (phy_vars_eNB->lte_frame_parms.frame_type==FDD) { // FDD
// if SR was detected, use the n1_pucch from SR, else use n1_pucch0 // if SR was detected, use the n1_pucch from SR, else use n1_pucch0
n1_pucch0 = (SR_payload==1) ? phy_vars_eNB->scheduling_request_config[i].sr_PUCCH_ResourceIndex:n1_pucch0; // n1_pucch0 = (SR_payload==1) ? phy_vars_eNB->scheduling_request_config[i].sr_PUCCH_ResourceIndex:n1_pucch0;
LOG_D(PHY,"Demodulating PUCCH for ACK/NAK: n1_pucch0 %d (%d), SR_payload %d\n",n1_pucch0,phy_vars_eNB->scheduling_request_config[i].sr_PUCCH_ResourceIndex,SR_payload); LOG_D(PHY,"Demodulating PUCCH for ACK/NAK: n1_pucch0 %d (%d), SR_payload %d\n",n1_pucch0,phy_vars_eNB->scheduling_request_config[i].sr_PUCCH_ResourceIndex,SR_payload);
if (abstraction_flag == 0) if (abstraction_flag == 0) {
metric0 = rx_pucch(phy_vars_eNB, metric0 = rx_pucch(phy_vars_eNB,
pucch_format1a, pucch_format1a,
i, i,
(uint16_t)n1_pucch0, (uint16_t)n1_pucch0,
0, //n2_pucch 0, //n2_pucch
1, // shortened format 0, // shortened format
pucch_payload0,
subframe,
PUCCH1a_THRES);
if (metric0 < metric0_SR)
metric0=rx_pucch(phy_vars_eNB,
pucch_format1a,
i,
phy_vars_eNB->scheduling_request_config[i].sr_PUCCH_ResourceIndex,
0, //n2_pucch
0, // shortened format
pucch_payload0, pucch_payload0,
subframe, subframe,
PUCCH1a_THRES); PUCCH1a_THRES);
}
else { else {
#ifdef PHY_ABSTRACTION #ifdef PHY_ABSTRACTION
metric0 = rx_pucch_emul(phy_vars_eNB,i, metric0 = rx_pucch_emul(phy_vars_eNB,i,
...@@ -3986,12 +4001,12 @@ void phy_procedures_eNB_RX(const unsigned char sched_subframe,PHY_VARS_eNB *phy_ ...@@ -3986,12 +4001,12 @@ void phy_procedures_eNB_RX(const unsigned char sched_subframe,PHY_VARS_eNB *phy_
#endif #endif
if (abstraction_flag == 0) if (abstraction_flag == 0)
metric0 = rx_pucch(phy_vars_eNB, metric0_SR = rx_pucch(phy_vars_eNB,
format, format,
i, i,
phy_vars_eNB->scheduling_request_config[i].sr_PUCCH_ResourceIndex, phy_vars_eNB->scheduling_request_config[i].sr_PUCCH_ResourceIndex,
0, //n2_pucch 0, //n2_pucch
1, // shortened format 0, // shortened format
pucch_payload0, pucch_payload0,
subframe, subframe,
PUCCH1a_THRES); PUCCH1a_THRES);
...@@ -4022,7 +4037,7 @@ void phy_procedures_eNB_RX(const unsigned char sched_subframe,PHY_VARS_eNB *phy_ ...@@ -4022,7 +4037,7 @@ void phy_procedures_eNB_RX(const unsigned char sched_subframe,PHY_VARS_eNB *phy_
i, i,
(uint16_t)n1_pucch0, (uint16_t)n1_pucch0,
0, // n2_pucch 0, // n2_pucch
1, // shortened format 0, // shortened format
pucch_payload0, pucch_payload0,
subframe, subframe,
PUCCH1a_THRES); PUCCH1a_THRES);
...@@ -4045,7 +4060,7 @@ void phy_procedures_eNB_RX(const unsigned char sched_subframe,PHY_VARS_eNB *phy_ ...@@ -4045,7 +4060,7 @@ void phy_procedures_eNB_RX(const unsigned char sched_subframe,PHY_VARS_eNB *phy_
i, i,
(uint16_t)n1_pucch1, (uint16_t)n1_pucch1,
0, //n2_pucch 0, //n2_pucch
1, // shortened format 0, // shortened format
pucch_payload1, pucch_payload1,
subframe, subframe,
PUCCH1a_THRES); PUCCH1a_THRES);
......
...@@ -88,6 +88,7 @@ void rx_sdu( ...@@ -88,6 +88,7 @@ void rx_sdu(
int ii,j; int ii,j;
eNB_MAC_INST *eNB = &eNB_mac_inst[enb_mod_idP]; eNB_MAC_INST *eNB = &eNB_mac_inst[enb_mod_idP];
UE_list_t *UE_list= &eNB->UE_list; UE_list_t *UE_list= &eNB->UE_list;
int crnti_rx=0;
start_meas(&eNB->rx_ulsch_sdu); start_meas(&eNB->rx_ulsch_sdu);
...@@ -128,9 +129,9 @@ void rx_sdu( ...@@ -128,9 +129,9 @@ void rx_sdu(
case CRNTI: case CRNTI:
UE_id = find_UE_id(enb_mod_idP,(((uint16_t)payload_ptr[0])<<8) + payload_ptr[1]); UE_id = find_UE_id(enb_mod_idP,(((uint16_t)payload_ptr[0])<<8) + payload_ptr[1]);
LOG_I(MAC, "[eNB %d] CC_id %d MAC CE_LCID %d (ce %d/%d): CRNTI %x (UE_id %d) in Msg3\n",enb_mod_idP, CC_idP, rx_ces[i], i,num_ce,(((uint16_t)payload_ptr[0])<<8) + payload_ptr[1],UE_id); LOG_I(MAC, "[eNB %d] CC_id %d MAC CE_LCID %d (ce %d/%d): CRNTI %x (UE_id %d) in Msg3\n",enb_mod_idP, CC_idP, rx_ces[i], i,num_ce,(((uint16_t)payload_ptr[0])<<8) + payload_ptr[1],UE_id);
crnti_rx=1;
payload_ptr+=2; payload_ptr+=2;
/* we don't process this CE yet */
if (msg3_flagP != NULL) { if (msg3_flagP != NULL) {
*msg3_flagP = 0; *msg3_flagP = 0;
} }
...@@ -144,6 +145,9 @@ void rx_sdu( ...@@ -144,6 +145,9 @@ void rx_sdu(
LOG_D(MAC, "[eNB %d] CC_id %d MAC CE_LCID %d : Received short BSR LCGID = %u bsr = %d\n", LOG_D(MAC, "[eNB %d] CC_id %d MAC CE_LCID %d : Received short BSR LCGID = %u bsr = %d\n",
enb_mod_idP, CC_idP, rx_ces[i], lcgid, payload_ptr[0] & 0x3f); enb_mod_idP, CC_idP, rx_ces[i], lcgid, payload_ptr[0] & 0x3f);
if (crnti_rx==1)
LOG_I(MAC, "[eNB %d] CC_id %d MAC CE_LCID %d : Received short BSR LCGID = %u bsr = %d\n",
enb_mod_idP, CC_idP, rx_ces[i], lcgid, payload_ptr[0] & 0x3f);
if (UE_id != -1) { if (UE_id != -1) {
UE_list->UE_template[CC_idP][UE_id].bsr_info[lcgid] = (payload_ptr[0] & 0x3f); UE_list->UE_template[CC_idP][UE_id].bsr_info[lcgid] = (payload_ptr[0] & 0x3f);
...@@ -175,6 +179,15 @@ void rx_sdu( ...@@ -175,6 +179,15 @@ void rx_sdu(
UE_list->UE_template[CC_idP][UE_id].bsr_info[LCGID1], UE_list->UE_template[CC_idP][UE_id].bsr_info[LCGID1],
UE_list->UE_template[CC_idP][UE_id].bsr_info[LCGID2], UE_list->UE_template[CC_idP][UE_id].bsr_info[LCGID2],
UE_list->UE_template[CC_idP][UE_id].bsr_info[LCGID3]); UE_list->UE_template[CC_idP][UE_id].bsr_info[LCGID3]);
if (crnti_rx==1)
LOG_I(MAC, "[eNB %d] CC_id %d MAC CE_LCID %d: Received long BSR LCGID0 = %u LCGID1 = "
"%u LCGID2 = %u LCGID3 = %u\n",
enb_mod_idP, CC_idP,
rx_ces[i],
UE_list->UE_template[CC_idP][UE_id].bsr_info[LCGID0],
UE_list->UE_template[CC_idP][UE_id].bsr_info[LCGID1],
UE_list->UE_template[CC_idP][UE_id].bsr_info[LCGID2],
UE_list->UE_template[CC_idP][UE_id].bsr_info[LCGID3]);
if (UE_list->UE_template[CC_idP][UE_id].bsr_info[LCGID0] == 0 ) { if (UE_list->UE_template[CC_idP][UE_id].bsr_info[LCGID0] == 0 ) {
UE_list->UE_template[CC_idP][UE_id].ul_buffer_creation_time[LCGID0]=0; UE_list->UE_template[CC_idP][UE_id].ul_buffer_creation_time[LCGID0]=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