Commit 171ad1eb authored by laurent's avatar laurent

after some tests

parent c099c6aa
......@@ -1422,7 +1422,7 @@ typedef struct {
#define NFAPI_DL_CONFIG_REQUEST_DLSCH_PDU_REL12_TAG 0x203D
typedef enum {
NOCE,
RegularLTE,
CEMODEA,
CEMODEB
} UE_type_t;
......
......@@ -81,7 +81,7 @@ int32_t lte_ul_channel_estimation(PHY_VARS_eNB *eNB,
int32_t temp_in_ifft_0[2048*2] __attribute__((aligned(32)));
#if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0))
if (eNB->ulsch[UE_id]->ue_type > NOCE) harq_pid = 0;
if (eNB->ulsch[UE_id]->ue_type > RegularLTE) harq_pid = 0;
else
#endif
{
......
......@@ -1990,7 +1990,7 @@ void fill_ulsch(PHY_VARS_eNB *eNB,int UE_id,nfapi_ul_config_ulsch_pdu *ulsch_pdu
#if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0))
LOG_D(PHY,"Filling ULSCH : ue_type %d, harq_pid %d\n",ulsch->ue_type,harq_pid);
ulsch->ue_type = ulsch_pdu->ulsch_pdu_rel13.ue_type;
AssertFatal(harq_pid ==0 || ulsch->ue_type == NOCE, "Harq PID is not zero for BL/CE UE\n");
AssertFatal(harq_pid ==0 || ulsch->ue_type == RegularLTE, "Harq PID is not zero for BL/CE UE\n");
#else
ulsch->ue_type = 0;
#endif
......
......@@ -49,7 +49,9 @@ int16_t find_uci(uint16_t rnti, int frame, int subframe, PHY_VARS_eNB *eNB,find_
else if ((eNB->uci_vars[i].active == 0) && (first_free_index==-1)) first_free_index=i;
}
if (type == SEARCH_EXIST) return(-1);
else return(first_free_index);
if (first_free_index==-1)
LOG_E(MAC,"UCI table is full\n");
return(first_free_index);
}
......
......@@ -357,7 +357,7 @@ void pdsch_procedures(PHY_VARS_eNB *eNB,
subframe,
dlsch_harq->pdsch_start,
dlsch,
dlsch->ue_type==NOCE ? dlsch1 : (LTE_eNB_DLSCH_t *)NULL);
dlsch->ue_type==RegularLTE ? dlsch1 : (LTE_eNB_DLSCH_t *)NULL);
stop_meas(&eNB->dlsch_modulation_stats);
LOG_D(PHY,"Generated PDSCH dlsch_harq[round:%d]\n",dlsch_harq->round);
}
......@@ -416,7 +416,7 @@ void phy_procedures_eNB_TX(PHY_VARS_eNB *eNB,
for (i=0; i<NUMBER_OF_UE_MAX; i++) {
#if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0))
if (eNB->ulsch[i] && eNB->ulsch[i]->ue_type >NOCE) harq_pid = 0;
if (eNB->ulsch[i] && eNB->ulsch[i]->ue_type >RegularLTE) harq_pid = 0;
else
#endif
harq_pid = subframe2harq_pid(fp,ul_frame,ul_subframe);
......@@ -510,7 +510,7 @@ void phy_procedures_eNB_TX(PHY_VARS_eNB *eNB,
if((harq_pid < 0) || (harq_pid >= dlsch0->Mdlharq)) {
#if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0))
if (dlsch0->ue_type==NOCE)
if (dlsch0->ue_type==RegularLTE)
#endif
LOG_E(PHY,"harq_pid:%d corrupt must be 0-7 UE_id:%d frame:%d subframe:%d rnti:%x [ %1d.%1d.%1d.%1d.%1d.%1d.%1d.%1d\n", harq_pid,UE_id,frame,subframe,dlsch0->rnti,
dlsch0->harq_ids[frame%2][0],
......@@ -677,7 +677,7 @@ uci_procedures(PHY_VARS_eNB *eNB,
switch (uci->type) {
case SR:
case HARQ_SR: {
int pucch1_thres = (uci->ue_type == NOCE) ? eNB->pucch1_DTX_threshold : eNB->pucch1_DTX_threshold_emtc[0];
int pucch1_thres = (uci->ue_type == RegularLTE) ? eNB->pucch1_DTX_threshold : eNB->pucch1_DTX_threshold_emtc[0];
metric_SR = rx_pucch(eNB,
uci->pucch_fmt,
uci->ue_id,
......@@ -712,7 +712,7 @@ uci_procedures(PHY_VARS_eNB *eNB,
}
case HARQ: {
int pucch1ab_thres = (uci->ue_type == NOCE) ? eNB->pucch1ab_DTX_threshold : eNB->pucch1ab_DTX_threshold_emtc[0];
int pucch1ab_thres = (uci->ue_type == RegularLTE) ? eNB->pucch1ab_DTX_threshold : eNB->pucch1ab_DTX_threshold_emtc[0];
if (fp->frame_type == FDD) {
LOG_D(PHY,"Frame %d Subframe %d Demodulating PUCCH (UCI %d) for ACK/NAK (uci->pucch_fmt %d,uci->type %d.uci->frame %d, uci->subframe %d): n1_pucch0 %d SR_payload %d\n",
......@@ -1162,7 +1162,7 @@ void pusch_procedures(PHY_VARS_eNB *eNB,L1_rxtx_proc_t *proc) {
for (i = 0; i < NUMBER_OF_UE_MAX; i++) {
ulsch = eNB->ulsch[i];
if (ulsch->ue_type > NOCE) harq_pid = 0;
if (ulsch->ue_type > RegularLTE) harq_pid = 0;
else harq_pid=harq_pid0;
ulsch_harq = ulsch->harq_processes[harq_pid];
......@@ -1403,7 +1403,7 @@ void fill_rx_indication(PHY_VARS_eNB *eNB,int UE_id,int frame,int subframe) {
uint32_t harq_pid;
#if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0))
if (eNB->ulsch[UE_id]->ue_type > NOCE) harq_pid = 0;
if (eNB->ulsch[UE_id]->ue_type > RegularLTE) harq_pid = 0;
else
#endif
{
......
......@@ -166,13 +166,16 @@ unsigned int get_tx_amp(int power_dBm, int power_max_dBm, int N_RB_UL, int nb_rb
int gain_dB;
double gain_lin;
if (power_dBm<=power_max_dBm)
if ( (power_dBm<=power_max_dBm) && ! IS_SOFTMODEM_RFSIM)
gain_dB = power_dBm - power_max_dBm;
else
gain_dB = 0;
gain_lin = pow(10,.1*gain_dB);
AssertFatal((nb_rb >0) && (nb_rb <= N_RB_UL),"Illegal nb_rb/N_RB_UL combination (%d/%d)\n",nb_rb,N_RB_UL);
LOG_D(PHY," tx gain: %d = %d * sqrt ( pow(10, 0.1*max(0,%d-%d)) * %d/%d ) (gain lin=%f (dB=%d))\n",
(int)(AMP*sqrt(gain_lin*N_RB_UL/(double)nb_rb)),
AMP, power_dBm, power_max_dBm, N_RB_UL, nb_rb, gain_lin, gain_dB);
return((int)(AMP*sqrt(gain_lin*N_RB_UL/(double)nb_rb)));
}
......@@ -1099,7 +1102,7 @@ void ulsch_common_procedures(PHY_VARS_UE *ue, UE_rxtx_proc_t *proc, uint8_t empt
nsymb = (frame_parms->Ncp == 0) ? 14 : 12;
if (!(IS_SOFTMODEM_BASICSIM || IS_SOFTMODEM_RFSIM) ) {
if (!IS_SOFTMODEM_BASICSIM) {
ulsch_start = (ue->rx_offset+subframe_tx*frame_parms->samples_per_tti-
ue->hw_timing_advance-
ue->timing_advance-
......@@ -1130,7 +1133,7 @@ void ulsch_common_procedures(PHY_VARS_UE *ue, UE_rxtx_proc_t *proc, uint8_t empt
}
for (aa=0; aa<frame_parms->nb_antennas_tx; aa++) {
int *Buff = (IS_SOFTMODEM_BASICSIM || IS_SOFTMODEM_RFSIM) ? &ue->common_vars.txdata[aa][ulsch_start] :dummy_tx_buffer;
int *Buff = IS_SOFTMODEM_BASICSIM ? &ue->common_vars.txdata[aa][ulsch_start] :dummy_tx_buffer;
if (frame_parms->Ncp == 1) {
PHY_ofdm_mod(&ue->common_vars.txdataF[aa][subframe_tx*nsymb*frame_parms->ofdm_symbol_size],
......@@ -1151,7 +1154,7 @@ void ulsch_common_procedures(PHY_VARS_UE *ue, UE_rxtx_proc_t *proc, uint8_t empt
&ue->frame_parms);
}
if (IS_SOFTMODEM_BASICSIM || IS_SOFTMODEM_RFSIM ) {
if (IS_SOFTMODEM_BASICSIM ) {
apply_7_5_kHz(ue,&ue->common_vars.txdata[aa][ulsch_start],0);
apply_7_5_kHz(ue,&ue->common_vars.txdata[aa][ulsch_start],1);
} else {
......@@ -1159,7 +1162,7 @@ void ulsch_common_procedures(PHY_VARS_UE *ue, UE_rxtx_proc_t *proc, uint8_t empt
apply_7_5_kHz(ue,dummy_tx_buffer,1);
}
if (!(IS_SOFTMODEM_BASICSIM || IS_SOFTMODEM_RFSIM) ) {
if (!(IS_SOFTMODEM_BASICSIM ) ) {
overflow = ulsch_start - 9*frame_parms->samples_per_tti;
for (k=ulsch_start,l=0; k<cmin(frame_parms->samples_per_tti*LTE_NUMBER_OF_SUBFRAMES_PER_FRAME,ulsch_start+frame_parms->samples_per_tti); k++,l++) {
......@@ -1259,7 +1262,7 @@ void ue_prach_procedures(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uin
ue->prach_resources[eNB_id]->ra_RNTI);
ue->tx_total_RE[subframe_tx] = 96;
if (IS_SOFTMODEM_BASICSIM || IS_SOFTMODEM_RFSIM ) {
if (IS_SOFTMODEM_BASICSIM ) {
ue->prach_vars[eNB_id]->amp = get_tx_amp(ue->tx_power_dBm[subframe_tx],
ue->tx_power_max_dBm,
ue->frame_parms.N_RB_UL,
......@@ -1630,7 +1633,7 @@ void ue_ulsch_uespec_procedures(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB
ue->tx_total_RE[subframe_tx] = nb_rb*12;
if (IS_SOFTMODEM_BASICSIM || IS_SOFTMODEM_RFSIM ) {
if (IS_SOFTMODEM_BASICSIM ) {
tx_amp = AMP;
} else {
tx_amp = get_tx_amp(ue->tx_power_dBm[subframe_tx],
......@@ -1704,7 +1707,7 @@ void ue_srs_procedures(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uint8
Po_SRS = ue->tx_power_max_dBm;
}
if (IS_SOFTMODEM_BASICSIM || IS_SOFTMODEM_RFSIM ) {
if (IS_SOFTMODEM_BASICSIM) {
tx_amp = AMP;
} else {
if (ue->mac_enabled==1) {
......@@ -1942,7 +1945,7 @@ void ue_pucch_procedures(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uin
ue->tx_power_dBm[subframe_tx] = Po_PUCCH;
ue->tx_total_RE[subframe_tx] = 12;
if (IS_SOFTMODEM_BASICSIM || IS_SOFTMODEM_RFSIM ) {
if (IS_SOFTMODEM_BASICSIM ) {
tx_amp = AMP;
} else {
tx_amp = get_tx_amp(Po_PUCCH,
......@@ -2023,7 +2026,7 @@ void ue_pucch_procedures(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uin
ue->tx_power_dBm[subframe_tx] = Po_PUCCH;
ue->tx_total_RE[subframe_tx] = 12;
if (IS_SOFTMODEM_BASICSIM || IS_SOFTMODEM_RFSIM ) {
if (IS_SOFTMODEM_BASICSIM ) {
tx_amp = AMP;
} else {
tx_amp = get_tx_amp(Po_PUCCH,
......@@ -2269,7 +2272,7 @@ void ue_measurement_procedures(
// AGC
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_GAIN_CONTROL, VCD_FUNCTION_IN);
if (IS_SOFTMODEM_BASICSIM || IS_SOFTMODEM_RFSIM )
if (IS_SOFTMODEM_BASICSIM )
phy_adjust_gain (ue,dB_fixed(ue->measurements.rssi),0);
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_GAIN_CONTROL, VCD_FUNCTION_OUT);
......
......@@ -143,7 +143,7 @@ add_msg3(module_id_t module_idP, int CC_id, RA_t *ra, frame_t frameP,
ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.size = get_TBS_UL (ra->msg3_mcs, ra->msg3_nb_rb);
// Re13 fields
ul_config_pdu->ulsch_pdu.ulsch_pdu_rel13.ue_type = ra->rach_resource_type > CEmodeB : CEmodeA;
ul_config_pdu->ulsch_pdu.ulsch_pdu_rel13.ue_type = ra->rach_resource_type > 2 ? CEmodeB : CEmodeA;
if (ra->rach_resource_type > 0) {
pusch_maxNumRepetitionCEmodeA_r13= *(rrc->configuration.pusch_maxNumRepetitionCEmodeA_r13[CC_id]);
ul_config_pdu->ulsch_pdu.ulsch_pdu_rel13.total_number_of_repetitions= pusch_repetition_Table8_2_36213[pusch_maxNumRepetitionCEmodeA_r13][ra->pusch_repetition_levels];
......
......@@ -876,7 +876,7 @@ schedule_SI_MBMS(module_id_t module_idP, frame_t frameP,
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel10.pdsch_start = 3;
// Rel13 fields
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel13.tl.tag = NFAPI_DL_CONFIG_REQUEST_DLSCH_PDU_REL13_TAG;
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel13.ue_type = NOCE; // regular UE
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel13.ue_type = RegularLTE; // regular UE
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel13.pdsch_payload_type = 2; // not BR
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel13.initial_transmission_sf_io = 0xFFFF; // absolute SF
dl_config_request->header.message_id = NFAPI_DL_CONFIG_REQUEST;
......@@ -1160,7 +1160,7 @@ schedule_SI(module_id_t module_idP, frame_t frameP, sub_frame_t subframeP)
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel10.pdsch_start = 3;
// Rel13 fields
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel13.tl.tag = NFAPI_DL_CONFIG_REQUEST_DLSCH_PDU_REL13_TAG;
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel13.ue_type = NOCE; // regular UE
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel13.ue_type = RegularLTE; // regular UE
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel13.pdsch_payload_type = 2; // not BR
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel13.initial_transmission_sf_io = 0xFFFF; // absolute SF
dl_config_request->header.message_id = NFAPI_DL_CONFIG_REQUEST;
......
......@@ -3156,7 +3156,7 @@ schedule_PCH(module_id_t module_idP,
#endif
// Rel13 fields
#if (LTE_RRC_VERSION >= MAKE_VERSION(13, 0, 0))
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel13.ue_type = NOCE; // regular UE
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel13.ue_type = RegularLTE; // regular UE
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel13.pdsch_payload_type = 2; // not BR
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel13.initial_transmission_sf_io = 0xFFFF;
#endif
......
......@@ -396,11 +396,15 @@ void trace_pdu(int direction, uint8_t *pdu_buffer, unsigned int pdu_buffer_size,
MAC_Context_Info_t pdu_context;
int radioType=FDD_RADIO;
if (RC.eNB[0][0]!=NULL)
if (RC.eNB && RC.eNB[0][0]!=NULL)
radioType=RC.eNB[0][0]->frame_parms.frame_type== FDD ? FDD_RADIO:TDD_RADIO;
if (PHY_vars_UE_g[0][0] != NULL)
else if (PHY_vars_UE_g && PHY_vars_UE_g[0][0] != NULL)
radioType=PHY_vars_UE_g[0][0]->frame_parms.frame_type== FDD ? FDD_RADIO:TDD_RADIO;
else {
LOG_E(OPT,"not a eNB neither a UE!!! \n");
return;
}
switch (opt_type) {
case OPT_WIRESHARK :
......
......@@ -430,8 +430,8 @@ static bool flushInput(rfsimulator_state_t *t, int timeout) {
b->circularBuf[(index*nbAnt+a)%CirSize].i=0;
}
}
LOG_W(HW,"gap of: %ld in reception\n", b->th.timestamp-b->lastReceivedTS );
if ( abs(b->th.timestamp-b->lastReceivedTS) > 50 )
LOG_W(HW,"gap of: %ld in reception\n", b->th.timestamp-b->lastReceivedTS );
}
b->lastReceivedTS=b->th.timestamp;
......
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