Commit 7a577094 authored by David Price's avatar David Price

Crashes around msg4 time, but understand that need to get the ACK for the UE...

Crashes around msg4 time, but understand that need to get the ACK for the UE UL of msg3 back to UE within 4ms
parent 74cbde7c
...@@ -1109,8 +1109,6 @@ int pnf_phy_tx_req(nfapi_pnf_p7_config_t* pnf_p7, nfapi_tx_request_t* req) ...@@ -1109,8 +1109,6 @@ int pnf_phy_tx_req(nfapi_pnf_p7_config_t* pnf_p7, nfapi_tx_request_t* req)
return 0; return 0;
} }
extern void subtract_subframe(uint16_t *frameP, uint16_t *subframeP, int offset);
int pnf_phy_ul_config_req(nfapi_pnf_p7_config_t* pnf_p7, nfapi_ul_config_request_t* req) int pnf_phy_ul_config_req(nfapi_pnf_p7_config_t* pnf_p7, nfapi_ul_config_request_t* req)
{ {
LOG_D(PHY,"[PNF] UL_CONFIG_REQ %s() sfn_sf:%d pdu:%d rach_prach_frequency_resources:%d srs_present:%u\n", LOG_D(PHY,"[PNF] UL_CONFIG_REQ %s() sfn_sf:%d pdu:%d rach_prach_frequency_resources:%d srs_present:%u\n",
...@@ -1142,17 +1140,13 @@ int pnf_phy_ul_config_req(nfapi_pnf_p7_config_t* pnf_p7, nfapi_ul_config_request ...@@ -1142,17 +1140,13 @@ int pnf_phy_ul_config_req(nfapi_pnf_p7_config_t* pnf_p7, nfapi_ul_config_request
return -4; return -4;
} }
int sfn = NFAPI_SFNSF2SFN(req->sfn_sf); uint16_t sfn = NFAPI_SFNSF2SFN(req->sfn_sf);
int sf = NFAPI_SFNSF2SF(req->sfn_sf); uint16_t sf = NFAPI_SFNSF2SF(req->sfn_sf);
struct PHY_VARS_eNB_s *eNB = RC.eNB[0][0]; struct PHY_VARS_eNB_s *eNB = RC.eNB[0][0];
eNB_rxtx_proc_t *proc = &eNB->proc.proc_rxtx[0]; eNB_rxtx_proc_t *proc = &eNB->proc.proc_rxtx[0];
nfapi_ul_config_request_pdu_t* ul_config_pdu_list = req->ul_config_request_body.ul_config_pdu_list; nfapi_ul_config_request_pdu_t* ul_config_pdu_list = req->ul_config_request_body.ul_config_pdu_list;
// subframe works off TX SFN/SF which is 4 ahead, need to put it back to RX SFN/SF
// probably could just use proc->frame_rx
subtract_subframe(&sfn, &sf, 4);
for (int i=0;i<req->ul_config_request_body.number_of_pdus;i++) for (int i=0;i<req->ul_config_request_body.number_of_pdus;i++)
{ {
NFAPI_TRACE(NFAPI_TRACE_INFO, "%s() sfn/sf:%d PDU[%d] size:%d\n", __FUNCTION__, NFAPI_SFNSF2DEC(req->sfn_sf), i, ul_config_pdu_list[i].pdu_size); NFAPI_TRACE(NFAPI_TRACE_INFO, "%s() sfn/sf:%d PDU[%d] size:%d\n", __FUNCTION__, NFAPI_SFNSF2DEC(req->sfn_sf), i, ul_config_pdu_list[i].pdu_size);
......
...@@ -291,8 +291,6 @@ int vnf_unpack_vendor_extension_tlv(nfapi_tl_t* tl, uint8_t **ppReadPackedMessag ...@@ -291,8 +291,6 @@ int vnf_unpack_vendor_extension_tlv(nfapi_tl_t* tl, uint8_t **ppReadPackedMessag
void install_schedule_handlers(IF_Module_t *if_inst); void install_schedule_handlers(IF_Module_t *if_inst);
extern int single_thread_flag; extern int single_thread_flag;
extern void init_eNB_afterRU(void); extern void init_eNB_afterRU(void);
extern void add_subframe(uint16_t *frameP, uint16_t *subframeP, int offset);
extern void subtract_subframe(uint16_t *frameP, uint16_t *subframeP, int offset);
void oai_create_enb(void) void oai_create_enb(void)
{ {
...@@ -327,10 +325,12 @@ void oai_create_enb(void) ...@@ -327,10 +325,12 @@ void oai_create_enb(void)
printf("%s() Waiting for eNB to become configured (by RRC/PHY) - need to wait otherwise NFAPI messages won't contain correct values\n", __FUNCTION__); printf("%s() Waiting for eNB to become configured (by RRC/PHY) - need to wait otherwise NFAPI messages won't contain correct values\n", __FUNCTION__);
usleep(50000); usleep(50000);
} while(eNB->configured != 1); } while(eNB->configured != 1);
printf("%s() eNB is now configured\n", __FUNCTION__);
} }
void oai_enb_init(void) void oai_enb_init(void)
{ {
printf("%s() About to call init_eNB_afterRU()\n", __FUNCTION__);
init_eNB_afterRU(); init_eNB_afterRU();
} }
...@@ -492,6 +492,8 @@ int wake_eNB_rxtx(PHY_VARS_eNB *eNB, uint16_t sfn, uint16_t sf) ...@@ -492,6 +492,8 @@ int wake_eNB_rxtx(PHY_VARS_eNB *eNB, uint16_t sfn, uint16_t sf)
LTE_DL_FRAME_PARMS *fp = &eNB->frame_parms; LTE_DL_FRAME_PARMS *fp = &eNB->frame_parms;
//printf("%s(eNB:%p, sfn:%d, sf:%d)\n", __FUNCTION__, eNB, sfn, sf);
//int i; //int i;
struct timespec wait; struct timespec wait;
...@@ -593,7 +595,7 @@ int phy_subframe_indication(struct nfapi_vnf_p7_config* config, uint16_t phy_id, ...@@ -593,7 +595,7 @@ int phy_subframe_indication(struct nfapi_vnf_p7_config* config, uint16_t phy_id,
static uint8_t first_time = 1; static uint8_t first_time = 1;
if (first_time) if (first_time)
{ {
printf("[VNF] subframe indication %d\n", sfn_sf); printf("[VNF] subframe indication %d\n", NFAPI_SFNSF2DEC(sfn_sf));
first_time = 0; first_time = 0;
} }
...@@ -601,6 +603,8 @@ int phy_subframe_indication(struct nfapi_vnf_p7_config* config, uint16_t phy_id, ...@@ -601,6 +603,8 @@ int phy_subframe_indication(struct nfapi_vnf_p7_config* config, uint16_t phy_id,
//mac_subframe_ind(p7_vnf->mac, phy_id, sfn_sf); //mac_subframe_ind(p7_vnf->mac, phy_id, sfn_sf);
#if 1 #if 1
//if (RC.eNB) printf("RC.eNB[0][0]->configured:%d\n", RC.eNB[0][0]->configured);
if (RC.eNB && RC.eNB[0][0]->configured) if (RC.eNB && RC.eNB[0][0]->configured)
{ {
uint16_t sfn = NFAPI_SFNSF2SFN(sfn_sf); uint16_t sfn = NFAPI_SFNSF2SFN(sfn_sf);
...@@ -630,9 +634,8 @@ int phy_rach_indication(struct nfapi_vnf_p7_config* config, nfapi_rach_indicatio ...@@ -630,9 +634,8 @@ int phy_rach_indication(struct nfapi_vnf_p7_config* config, nfapi_rach_indicatio
pthread_mutex_lock(&eNB->UL_INFO_mutex); pthread_mutex_lock(&eNB->UL_INFO_mutex);
eNB->UL_INFO.rach_ind.number_of_preambles = ind->rach_indication_body.number_of_preambles; eNB->UL_INFO.rach_ind = *ind;
eNB->UL_INFO.rach_ind.preamble_list = eNB->preamble_list; eNB->UL_INFO.rach_ind.rach_indication_body.preamble_list = eNB->preamble_list;
eNB->UL_INFO.rach_ind.tl.tag = NFAPI_RACH_INDICATION_BODY_TAG;
for (int i=0;i<ind->rach_indication_body.number_of_preambles++;i++) for (int i=0;i<ind->rach_indication_body.number_of_preambles++;i++)
{ {
...@@ -702,13 +705,14 @@ int phy_crc_indication(struct nfapi_vnf_p7_config* config, nfapi_crc_indication_ ...@@ -702,13 +705,14 @@ int phy_crc_indication(struct nfapi_vnf_p7_config* config, nfapi_crc_indication_
for (int i=0; i<ind->crc_indication_body.number_of_crcs; i++) for (int i=0; i<ind->crc_indication_body.number_of_crcs; i++)
{ {
memcpy(&dest_ind->crc_indication_body.crc_pdu_list[i], &ind->crc_indication_body.crc_pdu_list[i], sizeof(ind->crc_indication_body.crc_pdu_list[0]));
LOG_D(MAC, "%s() PDU[%d] rnti:%04x UL_INFO:rnti:%04x\n", LOG_D(MAC, "%s() PDU[%d] rnti:%04x UL_INFO:rnti:%04x\n",
__FUNCTION__, __FUNCTION__,
i, i,
ind->crc_indication_body.crc_pdu_list[i].rx_ue_information.rnti, ind->crc_indication_body.crc_pdu_list[i].rx_ue_information.rnti,
eNB->UL_INFO.crc_ind.crc_indication_body.crc_pdu_list[i].rx_ue_information.rnti); eNB->UL_INFO.crc_ind.crc_indication_body.crc_pdu_list[i].rx_ue_information.rnti);
memcpy(&dest_ind->crc_indication_body.crc_pdu_list[i], &ind->crc_indication_body.crc_pdu_list[i], sizeof(ind->crc_indication_body.crc_pdu_list[0]));
} }
pthread_mutex_unlock(&eNB->UL_INFO_mutex); pthread_mutex_unlock(&eNB->UL_INFO_mutex);
......
This diff is collapsed.
...@@ -107,6 +107,11 @@ void phy_config_request(PHY_Config_t *phy_config) { ...@@ -107,6 +107,11 @@ void phy_config_request(PHY_Config_t *phy_config) {
AssertFatal(RC.eNB[Mod_id][CC_id] != NULL, "PHY instance %d, CCid %d doesn't exist\n",Mod_id,CC_id); AssertFatal(RC.eNB[Mod_id][CC_id] != NULL, "PHY instance %d, CCid %d doesn't exist\n",Mod_id,CC_id);
if (RC.eNB[Mod_id][CC_id]->configured == 1)
{
LOG_E(PHY,"Already eNB already configured, do nothing\n");
return;
}
RC.eNB[Mod_id][CC_id]->mac_enabled = 1; RC.eNB[Mod_id][CC_id]->mac_enabled = 1;
......
...@@ -43,6 +43,7 @@ ...@@ -43,6 +43,7 @@
#include "assertions.h" #include "assertions.h"
#include "T.h" #include "T.h"
#include "UTIL/LOG/log.h" #include "UTIL/LOG/log.h"
#include "UTIL/LOG/vcd_signal_dumper.h"
//#define DEBUG_DCI_ENCODING 1 //#define DEBUG_DCI_ENCODING 1
//#define DEBUG_DCI_DECODING 1 //#define DEBUG_DCI_DECODING 1
...@@ -2065,6 +2066,8 @@ void pdcch_scrambling(LTE_DL_FRAME_PARMS *frame_parms, ...@@ -2065,6 +2066,8 @@ void pdcch_scrambling(LTE_DL_FRAME_PARMS *frame_parms,
uint8_t reset; uint8_t reset;
uint32_t x1, x2, s=0; uint32_t x1, x2, s=0;
//LOG_D(PHY, "%s(fp, subframe:%d, e, length:%d)\n", __FUNCTION__, subframe, length);
reset = 1; reset = 1;
// x1 is set in lte_gold_generic // x1 is set in lte_gold_generic
...@@ -2252,11 +2255,13 @@ uint8_t generate_dci_top(uint8_t num_pdcch_symbols, ...@@ -2252,11 +2255,13 @@ uint8_t generate_dci_top(uint8_t num_pdcch_symbols,
} }
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_GENERATE_PCFICH,1);
generate_pcfich(num_pdcch_symbols, generate_pcfich(num_pdcch_symbols,
amp, amp,
frame_parms, frame_parms,
txdataF, txdataF,
subframe); subframe);
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_GENERATE_PCFICH,0);
wbar[0] = &wbar0[0]; wbar[0] = &wbar0[0];
wbar[1] = &wbar1[0]; wbar[1] = &wbar1[0];
y[0] = &yseq0[0]; y[0] = &yseq0[0];
...@@ -2277,6 +2282,7 @@ uint8_t generate_dci_top(uint8_t num_pdcch_symbols, ...@@ -2277,6 +2282,7 @@ uint8_t generate_dci_top(uint8_t num_pdcch_symbols,
e_ptr = e; e_ptr = e;
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_GENERATE_DCI0,1);
// generate DCIs in order of decreasing aggregation level, then common/ue spec // generate DCIs in order of decreasing aggregation level, then common/ue spec
// MAC is assumed to have ordered the UE spec DCI according to the RNTI-based randomization // MAC is assumed to have ordered the UE spec DCI according to the RNTI-based randomization
...@@ -2303,20 +2309,26 @@ uint8_t generate_dci_top(uint8_t num_pdcch_symbols, ...@@ -2303,20 +2309,26 @@ uint8_t generate_dci_top(uint8_t num_pdcch_symbols,
} }
} }
} }
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_GENERATE_DCI0,0);
// Scrambling // Scrambling
#ifdef DEBUG_DCI_ENCODING #ifdef DEBUG_DCI_ENCODING
printf("pdcch scrambling\n"); printf("pdcch scrambling\n");
#endif #endif
//LOG_D(PHY, "num_pdcch_symbols:%d mi:%d nquad:%d\n", num_pdcch_symbols, mi, get_nquad(num_pdcch_symbols, frame_parms, mi));
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PDCCH_SCRAMBLING,1);
pdcch_scrambling(frame_parms, pdcch_scrambling(frame_parms,
subframe, subframe,
e, e,
8*get_nquad(num_pdcch_symbols, frame_parms, mi)); 8*get_nquad(num_pdcch_symbols, frame_parms, mi));
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PDCCH_SCRAMBLING,0);
//72*get_nCCE(num_pdcch_symbols,frame_parms,mi)); //72*get_nCCE(num_pdcch_symbols,frame_parms,mi));
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PDCCH_MODULATION,1);
// Now do modulation // Now do modulation
if (frame_parms->nb_antenna_ports_eNB==1) if (frame_parms->nb_antenna_ports_eNB==1)
gain_lin_QPSK = (int16_t)((amp*ONE_OVER_SQRT2_Q15)>>15); gain_lin_QPSK = (int16_t)((amp*ONE_OVER_SQRT2_Q15)>>15);
...@@ -2329,6 +2341,7 @@ uint8_t generate_dci_top(uint8_t num_pdcch_symbols, ...@@ -2329,6 +2341,7 @@ uint8_t generate_dci_top(uint8_t num_pdcch_symbols,
printf(" PDCCH Modulation, Msymb %d, Msymb2 %d,gain_lin_QPSK %d\n",Msymb,Msymb2,gain_lin_QPSK); printf(" PDCCH Modulation, Msymb %d, Msymb2 %d,gain_lin_QPSK %d\n",Msymb,Msymb2,gain_lin_QPSK);
#endif #endif
//LOG_D(PHY,"%s() Msymb2:%d\n", __FUNCTION__, Msymb2);
if (frame_parms->nb_antenna_ports_eNB==1) { //SISO if (frame_parms->nb_antenna_ports_eNB==1) { //SISO
...@@ -2375,16 +2388,20 @@ uint8_t generate_dci_top(uint8_t num_pdcch_symbols, ...@@ -2375,16 +2388,20 @@ uint8_t generate_dci_top(uint8_t num_pdcch_symbols,
} }
} }
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PDCCH_MODULATION,0);
#ifdef DEBUG_DCI_ENCODING #ifdef DEBUG_DCI_ENCODING
printf(" PDCCH Interleaving\n"); printf(" PDCCH Interleaving\n");
#endif #endif
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PDCCH_INTERLEAVING,1);
// printf("y %p (%p,%p), wbar %p (%p,%p)\n",y,y[0],y[1],wbar,wbar[0],wbar[1]); // printf("y %p (%p,%p), wbar %p (%p,%p)\n",y,y[0],y[1],wbar,wbar[0],wbar[1]);
// This is the interleaving procedure defined in 36-211, first part of Section 6.8.5 // This is the interleaving procedure defined in 36-211, first part of Section 6.8.5
pdcch_interleaving(frame_parms,&y[0],&wbar[0],num_pdcch_symbols,mi); pdcch_interleaving(frame_parms,&y[0],&wbar[0],num_pdcch_symbols,mi);
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PDCCH_INTERLEAVING,0);
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PDCCH_TX,1);
mprime=0; mprime=0;
nsymb = (frame_parms->Ncp==0) ? 14:12; nsymb = (frame_parms->Ncp==0) ? 14:12;
re_offset = frame_parms->first_carrier_offset; re_offset = frame_parms->first_carrier_offset;
...@@ -2519,6 +2536,7 @@ uint8_t generate_dci_top(uint8_t num_pdcch_symbols, ...@@ -2519,6 +2536,7 @@ uint8_t generate_dci_top(uint8_t num_pdcch_symbols,
if (re_offset == (frame_parms->ofdm_symbol_size)) if (re_offset == (frame_parms->ofdm_symbol_size))
re_offset = 1; re_offset = 1;
} // kprime loop } // kprime loop
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PDCCH_TX,0);
return(num_pdcch_symbols); return(num_pdcch_symbols);
} }
......
...@@ -2529,13 +2529,15 @@ void fill_ulsch(PHY_VARS_eNB *eNB,nfapi_ul_config_ulsch_pdu *ulsch_pdu,int frame ...@@ -2529,13 +2529,15 @@ void fill_ulsch(PHY_VARS_eNB *eNB,nfapi_ul_config_ulsch_pdu *ulsch_pdu,int frame
else ulsch->harq_processes[harq_pid]->round++; else ulsch->harq_processes[harq_pid]->round++;
ulsch->rnti = ulsch_pdu->ulsch_pdu_rel8.rnti; ulsch->rnti = ulsch_pdu->ulsch_pdu_rel8.rnti;
LOG_D(PHY,"Filling ULSCH %x (UE_id %d) (new_ulsch %d) for Frame %d, Subframe %d : harq_pid %d, first_rb %d, nb_rb %d, rvidx %d, Qm %d, TBS %d, round %d \n", LOG_D(PHY,"Filling ULSCH %x (UE_id %d) (new_ulsch %d) for Frame %d, Subframe %d : harq_pid %d, status %d, handled %d, first_rb %d, nb_rb %d, rvidx %d, Qm %d, TBS %d, round %d \n",
ulsch->rnti, ulsch->rnti,
UE_id, UE_id,
new_ulsch, new_ulsch,
frame, frame,
subframe, subframe,
harq_pid, harq_pid,
ulsch->harq_processes[harq_pid]->status,
ulsch->harq_processes[harq_pid]->handled,
ulsch->harq_processes[harq_pid]->first_rb, ulsch->harq_processes[harq_pid]->first_rb,
ulsch->harq_processes[harq_pid]->nb_rb, ulsch->harq_processes[harq_pid]->nb_rb,
ulsch->harq_processes[harq_pid]->rvidx, ulsch->harq_processes[harq_pid]->rvidx,
...@@ -6396,7 +6398,7 @@ uint8_t pdcch_alloc2ul_subframe(LTE_DL_FRAME_PARMS *frame_parms,uint8_t n) ...@@ -6396,7 +6398,7 @@ uint8_t pdcch_alloc2ul_subframe(LTE_DL_FRAME_PARMS *frame_parms,uint8_t n)
else else
ul_subframe = ((n+4)%10); ul_subframe = ((n+4)%10);
LOG_D(PHY, "subframe %d: PUSCH subframe = %d\n", n, ul_subframe); //LOG_D(PHY, "subframe %d: PUSCH subframe = %d\n", n, ul_subframe);
return ul_subframe; return ul_subframe;
} }
...@@ -6437,7 +6439,7 @@ uint32_t pdcch_alloc2ul_frame(LTE_DL_FRAME_PARMS *frame_parms,uint32_t frame, ui ...@@ -6437,7 +6439,7 @@ uint32_t pdcch_alloc2ul_frame(LTE_DL_FRAME_PARMS *frame_parms,uint32_t frame, ui
else else
ul_frame = (frame+(n>=6 ? 1 : 0)); ul_frame = (frame+(n>=6 ? 1 : 0));
LOG_D(PHY, "frame %d subframe %d: PUSCH frame = %d\n", frame, n, ul_frame); //LOG_D(PHY, "frame %d subframe %d: PUSCH frame = %d\n", frame, n, ul_frame);
return ul_frame % 1024; return ul_frame % 1024;
} }
......
...@@ -174,7 +174,7 @@ int generate_pbch(LTE_eNB_PBCH *eNB_pbch, ...@@ -174,7 +174,7 @@ int generate_pbch(LTE_eNB_PBCH *eNB_pbch,
pbch_E = (frame_parms->Ncp==NORMAL) ? 1920 : 1728; //RE/RB * #RB * bits/RB (QPSK) pbch_E = (frame_parms->Ncp==NORMAL) ? 1920 : 1728; //RE/RB * #RB * bits/RB (QPSK)
// pbch_E_bytes = pbch_coded_bits>>3; // pbch_E_bytes = pbch_coded_bits>>3;
//LOG_D(PHY,"%s(eNB_pbch:%p txdataF:%p amp:%d frame_parms:%p pbch_pdu:%p frame_mod4:%d)\n", __FUNCTION__, eNB_pbch, txdataF, amp, frame_parms, pbch_pdu, frame_mod4==0); LOG_D(PHY,"%s(eNB_pbch:%p txdataF:%p amp:%d frame_parms:%p pbch_pdu:%p frame_mod4:%d)\n", __FUNCTION__, eNB_pbch, txdataF, amp, frame_parms, pbch_pdu, frame_mod4==0);
if (frame_mod4==0) { if (frame_mod4==0) {
bzero(pbch_a,PBCH_A>>3); bzero(pbch_a,PBCH_A>>3);
......
...@@ -162,7 +162,7 @@ int phich_frame2_pusch_frame(LTE_DL_FRAME_PARMS *frame_parms, int frame, int sub ...@@ -162,7 +162,7 @@ int phich_frame2_pusch_frame(LTE_DL_FRAME_PARMS *frame_parms, int frame, int sub
pusch_frame = (frame); pusch_frame = (frame);
} }
LOG_D(PHY, "frame %d subframe %d: PUSCH frame = %d\n", frame, subframe, pusch_frame); //LOG_D(PHY, "frame %d subframe %d: PUSCH frame = %d\n", frame, subframe, pusch_frame);
return pusch_frame % 1024; return pusch_frame % 1024;
} }
......
...@@ -488,18 +488,23 @@ void phy_procedures_eNB_TX(PHY_VARS_eNB *eNB, ...@@ -488,18 +488,23 @@ void phy_procedures_eNB_TX(PHY_VARS_eNB *eNB,
//LOG_D(PHY,"Before generate_dci_top num_pdcch_symbols:%d num_dci:%d dci_alloc:dci_length:%d\n", num_pdcch_symbols, num_dci, eNB->pdcch_vars[subframe&1].dci_alloc[0].dci_length); //LOG_D(PHY,"Before generate_dci_top num_pdcch_symbols:%d num_dci:%d dci_alloc:dci_length:%d\n", num_pdcch_symbols, num_dci, eNB->pdcch_vars[subframe&1].dci_alloc[0].dci_length);
generate_dci_top(num_pdcch_symbols, VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_ENB_PDCCH_TX,1);
num_dci,
&eNB->pdcch_vars[subframe&1].dci_alloc[0], if (nfapi_mode == 0 || nfapi_mode == 1) {
0, generate_dci_top(num_pdcch_symbols,
AMP, num_dci,
fp, &eNB->pdcch_vars[subframe&1].dci_alloc[0],
eNB->common_vars.txdataF, 0,
subframe); AMP,
fp,
eNB->common_vars.txdataF,
subframe);
}
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_ENB_PDCCH_TX,0); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_ENB_PDCCH_TX,0);
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_GENERATE_DLSCH,1);
// Now scan UE specific DLSCH // Now scan UE specific DLSCH
LTE_eNB_DLSCH_t *dlsch0,*dlsch1; LTE_eNB_DLSCH_t *dlsch0,*dlsch1;
for (UE_id=0; UE_id<NUMBER_OF_UE_MAX; UE_id++) for (UE_id=0; UE_id<NUMBER_OF_UE_MAX; UE_id++)
...@@ -543,12 +548,15 @@ void phy_procedures_eNB_TX(PHY_VARS_eNB *eNB, ...@@ -543,12 +548,15 @@ void phy_procedures_eNB_TX(PHY_VARS_eNB *eNB,
dlsch0->subframe_tx[subframe]=0; dlsch0->subframe_tx[subframe]=0;
} }
} }
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_GENERATE_DLSCH,0);
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_GENERATE_PHICH,0);
generate_phich_top(eNB, generate_phich_top(eNB,
proc, proc,
AMP); AMP);
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_GENERATE_PHICH,1);
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_ENB_TX+offset,0); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_ENB_TX+offset,0);
if (do_meas==1) stop_meas(&eNB->phy_proc_tx); if (do_meas==1) stop_meas(&eNB->phy_proc_tx);
...@@ -570,14 +578,14 @@ void prach_procedures(PHY_VARS_eNB *eNB, ...@@ -570,14 +578,14 @@ void prach_procedures(PHY_VARS_eNB *eNB,
subframe = eNB->proc.subframe_prach_br; subframe = eNB->proc.subframe_prach_br;
frame = eNB->proc.frame_prach_br; frame = eNB->proc.frame_prach_br;
pthread_mutex_lock(&eNB->UL_INFO_mutex); pthread_mutex_lock(&eNB->UL_INFO_mutex);
eNB->UL_INFO.rach_ind_br.number_of_preambles=0; eNB->UL_INFO.rach_ind_br.rach_indication_body.number_of_preambles=0;
pthread_mutex_unlock(&eNB->UL_INFO_mutex); pthread_mutex_unlock(&eNB->UL_INFO_mutex);
} }
else else
#endif #endif
{ {
pthread_mutex_lock(&eNB->UL_INFO_mutex); pthread_mutex_lock(&eNB->UL_INFO_mutex);
eNB->UL_INFO.rach_ind.number_of_preambles=0; eNB->UL_INFO.rach_ind.rach_indication_body.number_of_preambles=0;
pthread_mutex_unlock(&eNB->UL_INFO_mutex); pthread_mutex_unlock(&eNB->UL_INFO_mutex);
subframe = eNB->proc.subframe_prach; subframe = eNB->proc.subframe_prach;
frame = eNB->proc.frame_prach; frame = eNB->proc.frame_prach;
...@@ -632,7 +640,7 @@ void prach_procedures(PHY_VARS_eNB *eNB, ...@@ -632,7 +640,7 @@ void prach_procedures(PHY_VARS_eNB *eNB,
prach_mask = is_prach_subframe(&eNB->frame_parms,eNB->proc.frame_prach_br,eNB->proc.subframe_prach_br); prach_mask = is_prach_subframe(&eNB->frame_parms,eNB->proc.frame_prach_br,eNB->proc.subframe_prach_br);
eNB->UL_INFO.rach_ind_br.preamble_list = eNB->preamble_list_br; eNB->UL_INFO.rach_ind_br.rach_indication_body.preamble_list = eNB->preamble_list_br;
int ind=0; int ind=0;
int ce_level=0; int ce_level=0;
/* Save for later, it doesn't work /* Save for later, it doesn't work
...@@ -645,7 +653,7 @@ void prach_procedures(PHY_VARS_eNB *eNB, ...@@ -645,7 +653,7 @@ void prach_procedures(PHY_VARS_eNB *eNB,
*/ */
if (eNB->frame_parms.prach_emtc_config_common.prach_ConfigInfo.prach_CElevel_enable[0]==1){ if (eNB->frame_parms.prach_emtc_config_common.prach_ConfigInfo.prach_CElevel_enable[0]==1){
if (max_preamble_energy[0] > 350) { if (max_preamble_energy[0] > 350) {
eNB->UL_INFO.rach_ind_br.number_of_preambles++; eNB->UL_INFO.rach_ind_br.rach_indication_body.number_of_preambles++;
eNB->preamble_list_br[ind].preamble_rel8.timing_advance = max_preamble_delay[ind];// eNB->preamble_list_br[ind].preamble_rel8.timing_advance = max_preamble_delay[ind];//
eNB->preamble_list_br[ind].preamble_rel8.preamble = max_preamble[ind]; eNB->preamble_list_br[ind].preamble_rel8.preamble = max_preamble[ind];
...@@ -691,9 +699,11 @@ void prach_procedures(PHY_VARS_eNB *eNB, ...@@ -691,9 +699,11 @@ void prach_procedures(PHY_VARS_eNB *eNB,
pthread_mutex_lock(&eNB->UL_INFO_mutex); pthread_mutex_lock(&eNB->UL_INFO_mutex);
eNB->UL_INFO.rach_ind.number_of_preambles = 1; eNB->UL_INFO.rach_ind.rach_indication_body.number_of_preambles = 1;
eNB->UL_INFO.rach_ind.preamble_list = &eNB->preamble_list[0]; eNB->UL_INFO.rach_ind.rach_indication_body.preamble_list = &eNB->preamble_list[0];
eNB->UL_INFO.rach_ind.tl.tag = NFAPI_RACH_INDICATION_BODY_TAG; eNB->UL_INFO.rach_ind.rach_indication_body.tl.tag = NFAPI_RACH_INDICATION_BODY_TAG;
eNB->UL_INFO.rach_ind.header.message_id = NFAPI_RACH_INDICATION;
eNB->UL_INFO.rach_ind.sfn_sf = frame<<4 | subframe;
eNB->preamble_list[0].preamble_rel8.tl.tag = NFAPI_PREAMBLE_REL8_TAG; eNB->preamble_list[0].preamble_rel8.tl.tag = NFAPI_PREAMBLE_REL8_TAG;
eNB->preamble_list[0].preamble_rel8.timing_advance = max_preamble_delay[0]; eNB->preamble_list[0].preamble_rel8.timing_advance = max_preamble_delay[0];
...@@ -705,21 +715,17 @@ void prach_procedures(PHY_VARS_eNB *eNB, ...@@ -705,21 +715,17 @@ void prach_procedures(PHY_VARS_eNB *eNB,
// If NFAPI PNF then we need to send the message to the VNF // If NFAPI PNF then we need to send the message to the VNF
if (nfapi_mode == 1) if (nfapi_mode == 1)
{ {
nfapi_rach_indication_t rach_ind;
rach_ind.header.message_id = NFAPI_RACH_INDICATION;
rach_ind.sfn_sf = frame<<4 | subframe;
rach_ind.rach_indication_body = eNB->UL_INFO.rach_ind;
LOG_E(PHY,"\n\n\n\nDJP - this needs to be sent to VNF **********************************************\n\n\n\n"); LOG_E(PHY,"\n\n\n\nDJP - this needs to be sent to VNF **********************************************\n\n\n\n");
LOG_E(PHY,"Filling NFAPI indication for RACH : SFN_SF:%d TA %d, Preamble %d, rnti %x, rach_resource_type %d\n", LOG_E(PHY,"Filling NFAPI indication for RACH : SFN_SF:%d TA %d, Preamble %d, rnti %x, rach_resource_type %d\n",
NFAPI_SFNSF2DEC(rach_ind.sfn_sf), NFAPI_SFNSF2DEC(eNB->UL_INFO.rach_ind.sfn_sf),
eNB->preamble_list[0].preamble_rel8.timing_advance, eNB->preamble_list[0].preamble_rel8.timing_advance,
eNB->preamble_list[0].preamble_rel8.preamble, eNB->preamble_list[0].preamble_rel8.preamble,
eNB->preamble_list[0].preamble_rel8.rnti, eNB->preamble_list[0].preamble_rel8.rnti,
eNB->preamble_list[0].preamble_rel13.rach_resource_type); eNB->preamble_list[0].preamble_rel13.rach_resource_type);
oai_nfapi_rach_ind(&eNB->UL_INFO.rach_ind);
oai_nfapi_rach_ind(&rach_ind); eNB->UL_INFO.rach_ind.rach_indication_body.number_of_preambles = 0;
} }
pthread_mutex_unlock(&eNB->UL_INFO_mutex); pthread_mutex_unlock(&eNB->UL_INFO_mutex);
...@@ -1315,8 +1321,9 @@ void pusch_procedures(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc) ...@@ -1315,8 +1321,9 @@ void pusch_procedures(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc)
for (i=0; i<NUMBER_OF_UE_MAX; i++) { for (i=0; i<NUMBER_OF_UE_MAX; i++) {
ulsch = eNB->ulsch[i]; ulsch = eNB->ulsch[i];
ulsch_harq = ulsch->harq_processes[harq_pid]; ulsch_harq = ulsch->harq_processes[harq_pid];
if (ulsch->rnti>0) LOG_D(PHY,"Frame %d, subframe %d: PUSCH procedures, harq_pid %d, UE %d/%x\n", if (ulsch->rnti>0) LOG_D(PHY,"eNB->ulsch[%d]->harq_processes[harq_pid:%d] Frame %d, subframe %d: PUSCH procedures, harq_pid %d, UE %d/%x ulsch_harq[status:%d frame:%d subframe:%d handled:%d]\n",
frame,subframe,harq_pid,i,ulsch->rnti); i, harq_pid, frame,subframe,harq_pid,i,ulsch->rnti,
ulsch_harq->status, ulsch_harq->frame, ulsch_harq->subframe, ulsch_harq->handled);
if ((ulsch) && if ((ulsch) &&
(ulsch->rnti>0) && (ulsch->rnti>0) &&
...@@ -1995,7 +2002,7 @@ void fill_crc_indication(PHY_VARS_eNB *eNB,int UE_id,int frame,int subframe,uint ...@@ -1995,7 +2002,7 @@ void fill_crc_indication(PHY_VARS_eNB *eNB,int UE_id,int frame,int subframe,uint
eNB->UL_INFO.crc_ind.crc_indication_body.number_of_crcs++; eNB->UL_INFO.crc_ind.crc_indication_body.number_of_crcs++;
LOG_D(PHY, "%s() rnti:%04x crcs:%d\n", __FUNCTION__, pdu->rx_ue_information.rnti, eNB->UL_INFO.crc_ind.crc_indication_body.number_of_crcs); LOG_D(PHY, "%s() rnti:%04x crcs:%d crc_flag:%d\n", __FUNCTION__, pdu->rx_ue_information.rnti, eNB->UL_INFO.crc_ind.crc_indication_body.number_of_crcs, crc_flag);
pthread_mutex_unlock(&eNB->UL_INFO_mutex); pthread_mutex_unlock(&eNB->UL_INFO_mutex);
} }
......
...@@ -307,6 +307,9 @@ void RCconfig_L1(void) { ...@@ -307,6 +307,9 @@ void RCconfig_L1(void) {
configure_nfapi_pnf(RC.eNB[j][0]->eth_params_n.remote_addr, RC.eNB[j][0]->eth_params_n.remote_portc, RC.eNB[j][0]->eth_params_n.my_addr, RC.eNB[j][0]->eth_params_n.my_portd, RC.eNB[j][0]->eth_params_n .remote_portd); configure_nfapi_pnf(RC.eNB[j][0]->eth_params_n.remote_addr, RC.eNB[j][0]->eth_params_n.remote_portc, RC.eNB[j][0]->eth_params_n.my_addr, RC.eNB[j][0]->eth_params_n.my_portd, RC.eNB[j][0]->eth_params_n .remote_portd);
set_comp_log(PHY, LOG_DEBUG, LOG_FULL, 1);
printf("DJP - forcing PHY to DEBUG - should see similar line if it works\n");
LOG_E(PHY,"%s() DJP - forcing PHY to LOG_DEBUG for NFAPI PNF\n", __FUNCTION__);
} }
else { // other midhaul else { // other midhaul
} }
...@@ -391,6 +394,14 @@ void RCconfig_macrlc() { ...@@ -391,6 +394,14 @@ void RCconfig_macrlc() {
printf("**************** vnf_port:%d\n", RC.mac[j]->eth_params_s.my_portc); printf("**************** vnf_port:%d\n", RC.mac[j]->eth_params_s.my_portc);
configure_nfapi_vnf(RC.mac[j]->eth_params_s.my_addr, RC.mac[j]->eth_params_s.my_portc); configure_nfapi_vnf(RC.mac[j]->eth_params_s.my_addr, RC.mac[j]->eth_params_s.my_portc);
printf("**************** RETURNED FROM configure_nfapi_vnf() vnf_port:%d\n", RC.mac[j]->eth_params_s.my_portc); printf("**************** RETURNED FROM configure_nfapi_vnf() vnf_port:%d\n", RC.mac[j]->eth_params_s.my_portc);
set_comp_log(MAC, LOG_DEBUG, LOG_FULL, 1);
set_comp_log(RRC, LOG_DEBUG, LOG_FULL, 1);
set_comp_log(PHY, LOG_DEBUG, LOG_FULL, 1);
printf("DJP - forcing MAC/RRC/PHY to DEBUG - should see similar line if it works\n");
LOG_D(MAC,"%s() DJP - forcing MAC to LOG_DEBUG for VNF\n", __FUNCTION__);
LOG_D(RRC,"%s() DJP - forcing RRC to LOG_DEBUG for VNF\n", __FUNCTION__);
LOG_I(PHY,"%s() DJP - forcing PHY to LOG_DEBUG for VNF\n", __FUNCTION__);
} else { // other midhaul } else { // other midhaul
AssertFatal(1==0,"MACRLC %d: %s unknown southbound midhaul\n",j,*(MacRLC_ParamList.paramarray[j][MACRLC_TRANSPORT_S_PREFERENCE_IDX].strptr)); AssertFatal(1==0,"MACRLC %d: %s unknown southbound midhaul\n",j,*(MacRLC_ParamList.paramarray[j][MACRLC_TRANSPORT_S_PREFERENCE_IDX].strptr));
...@@ -474,7 +485,7 @@ int RCconfig_RRC(MessageDef *msg_p, uint32_t i, eNB_RRC_INST *rrc) { ...@@ -474,7 +485,7 @@ int RCconfig_RRC(MessageDef *msg_p, uint32_t i, eNB_RRC_INST *rrc) {
int32_t rach_powerRampingStep = 0; int32_t rach_powerRampingStep = 0;
int32_t rach_preambleInitialReceivedTargetPower = 0; int32_t rach_preambleInitialReceivedTargetPower = 0;
int32_t rach_preambleTransMax = 0; int32_t rach_preambleTransMax = 0;
int32_t rach_raResponseWindowSize = 0; int32_t rach_raResponseWindowSize = 10;
int32_t rach_macContentionResolutionTimer = 0; int32_t rach_macContentionResolutionTimer = 0;
int32_t rach_maxHARQ_Msg3Tx = 0; int32_t rach_maxHARQ_Msg3Tx = 0;
int32_t pcch_defaultPagingCycle = 0; int32_t pcch_defaultPagingCycle = 0;
......
...@@ -747,18 +747,21 @@ int rrc_mac_config_req_eNB(module_id_t Mod_idP, ...@@ -747,18 +747,21 @@ int rrc_mac_config_req_eNB(module_id_t Mod_idP,
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_RRC_MAC_CONFIG, VCD_FUNCTION_IN); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_RRC_MAC_CONFIG, VCD_FUNCTION_IN);
LOG_D(MAC, "RC.mac:%p mib:%p\n", RC.mac, mib);
if (mib!=NULL) {
if (RC.mac == NULL) l2_init_eNB(); if (RC.mac == NULL) {
l2_init_eNB();
mac_top_init_eNB(); mac_top_init_eNB();
}
RC.mac[Mod_idP]->common_channels[CC_idP].mib = mib; if (mib!=NULL) {
RC.mac[Mod_idP]->common_channels[CC_idP].physCellId = physCellId; RC.mac[Mod_idP]->common_channels[CC_idP].mib = mib;