Merge remote-tracking branch 'origin/develop' into scs_60_iisc
# Conflicts: # ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.usrpn310.conf # ci-scripts/conf_files/gnb.band78.sa.fr1.162PRB.2x2.usrpn310.conf # openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c
This commit is contained in:
@@ -106,7 +106,7 @@ void phy_config_request(PHY_Config_t *phy_config) {
|
||||
int Ncp = cfg->subframe_config.dl_cyclic_prefix_type.value;
|
||||
int p_eNB = cfg->rf_config.tx_antenna_ports.value;
|
||||
uint32_t dl_CarrierFreq = cfg->nfapi_config.earfcn.value;
|
||||
LOG_I(PHY,"Configuring MIB for instance %d, CCid %d : (band %d,N_RB_DL %d, N_RB_UL %d, Nid_cell %d,eNB_tx_antenna_ports %d,Ncp %d,DL freq %u,phich_config.resource %d, phich_config.duration %d)\n",
|
||||
LOG_A(PHY,"Configuring MIB for instance %d, CCid %d : (band %d,N_RB_DL %d, N_RB_UL %d, Nid_cell %d,eNB_tx_antenna_ports %d,Ncp %d,DL freq %u,phich_config.resource %d, phich_config.duration %d)\n",
|
||||
Mod_id, CC_id, eutra_band, dl_Bandwidth, ul_Bandwidth, Nid_cell, p_eNB,Ncp,dl_CarrierFreq,
|
||||
cfg->phich_config.phich_resource.value,
|
||||
cfg->phich_config.phich_duration.value);
|
||||
|
||||
@@ -548,7 +548,7 @@ void phy_config_dedicated_ue(module_id_t Mod_id,int CC_id,uint8_t eNB_id,
|
||||
phy_vars_ue->decode_MIB = 0;
|
||||
}
|
||||
|
||||
if(NFAPI_MODE!=NFAPI_UE_STUB_PNF) {
|
||||
if(NFAPI_MODE!=NFAPI_UE_STUB_PNF && NFAPI_MODE!=NFAPI_MODE_STANDALONE_PNF) {
|
||||
//phy_vars_ue->pdcch_vars[1][eNB_id]->crnti = phy_vars_ue->pdcch_vars[0][eNB_id]->crnti;
|
||||
if(phy_vars_ue->pdcch_vars[0][eNB_id]->crnti == 0x1234)
|
||||
phy_vars_ue->pdcch_vars[0][eNB_id]->crnti = phy_vars_ue->pdcch_vars[1][eNB_id]->crnti;
|
||||
|
||||
@@ -487,7 +487,7 @@ void nr_phy_config_request(NR_PHY_Config_t *phy_config) {
|
||||
LOG_I(PHY, "DL frequency %lu Hz, UL frequency %lu Hz: band %d, uldl offset %d Hz\n", fp->dl_CarrierFreq, fp->ul_CarrierFreq, fp->nr_band, dlul_offset);
|
||||
|
||||
fp->threequarter_fs = openair0_cfg[0].threequarter_fs;
|
||||
LOG_I(PHY,"Configuring MIB for instance %d, : (Nid_cell %d,DL freq %llu, UL freq %llu)\n",
|
||||
LOG_A(PHY,"Configuring MIB for instance %d, : (Nid_cell %d,DL freq %llu, UL freq %llu)\n",
|
||||
Mod_id,
|
||||
gNB_config->cell_config.phy_cell_id.value,
|
||||
(unsigned long long)fp->dl_CarrierFreq,
|
||||
|
||||
@@ -2921,6 +2921,9 @@ int allocate_REs_in_RB_MCH_khz_1dot25(int32_t **txdataF,
|
||||
uint8_t skip_dc,
|
||||
LTE_DL_FRAME_PARMS *frame_parms)
|
||||
{
|
||||
if (!qam_table_s)
|
||||
abort();
|
||||
|
||||
uint32_t tti_offset;
|
||||
uint8_t re,offset;
|
||||
uint8_t qam64_table_offset_re = 0;
|
||||
|
||||
@@ -370,7 +370,7 @@ int rx_pdsch(PHY_VARS_UE *ue,
|
||||
|
||||
#if UE_TIMING_TRACE
|
||||
stop_meas(&ue->generic_stat_bis[ue->current_thread_id[subframe]][slot]);
|
||||
LOG_I(PHY, "[AbsSFN %d.%d] Slot%d Symbol %d Flag %d type %d: Pilot/Data extraction %5.2f \n",frame,subframe,slot,symbol,
|
||||
LOG_D(PHY, "[AbsSFN %d.%d] Slot%d Symbol %d Flag %d type %d: Pilot/Data extraction %5.2f \n",frame,subframe,slot,symbol,
|
||||
ue->high_speed_flag,type,ue->generic_stat_bis[ue->current_thread_id[subframe]][slot].p_time/(cpuf*1000.0));
|
||||
#endif
|
||||
#if UE_TIMING_TRACE
|
||||
@@ -398,7 +398,7 @@ int rx_pdsch(PHY_VARS_UE *ue,
|
||||
|
||||
#if UE_TIMING_TRACE
|
||||
stop_meas(&ue->generic_stat_bis[ue->current_thread_id[subframe]][slot]);
|
||||
LOG_I(PHY, "[AbsSFN %d.%d] Slot%d Symbol %d: Channel Scale %5.2f \n",frame,subframe,slot,symbol,ue->generic_stat_bis[ue->current_thread_id[subframe]][slot].p_time/(cpuf*1000.0));
|
||||
LOG_D(PHY, "[AbsSFN %d.%d] Slot%d Symbol %d: Channel Scale %5.2f \n",frame,subframe,slot,symbol,ue->generic_stat_bis[ue->current_thread_id[subframe]][slot].p_time/(cpuf*1000.0));
|
||||
start_meas(&ue->generic_stat_bis[ue->current_thread_id[subframe]][slot]);
|
||||
#endif
|
||||
|
||||
@@ -507,7 +507,7 @@ int rx_pdsch(PHY_VARS_UE *ue,
|
||||
#endif
|
||||
#if UE_TIMING_TRACE
|
||||
stop_meas(&ue->generic_stat_bis[ue->current_thread_id[subframe]][slot]);
|
||||
LOG_I(PHY, "[AbsSFN %d.%d] Slot%d Symbol %d first_symbol_flag %d: Channel Level %5.2f \n",frame,subframe,slot,symbol,first_symbol_flag,
|
||||
LOG_D(PHY, "[AbsSFN %d.%d] Slot%d Symbol %d first_symbol_flag %d: Channel Level %5.2f \n",frame,subframe,slot,symbol,first_symbol_flag,
|
||||
ue->generic_stat_bis[ue->current_thread_id[subframe]][slot].p_time/(cpuf*1000.0));
|
||||
start_meas(&ue->generic_stat_bis[ue->current_thread_id[subframe]][slot]);
|
||||
#endif
|
||||
@@ -731,7 +731,7 @@ int rx_pdsch(PHY_VARS_UE *ue,
|
||||
|
||||
#if UE_TIMING_TRACE
|
||||
stop_meas(&ue->generic_stat_bis[ue->current_thread_id[subframe]][slot]);
|
||||
LOG_I(PHY, "[AbsSFN %d.%d] Slot%d Symbol %d log2_maxh %d Channel Comp %5.2f \n",frame,subframe,slot,symbol,pdsch_vars[eNB_id]->log2_maxh,
|
||||
LOG_D(PHY, "[AbsSFN %d.%d] Slot%d Symbol %d log2_maxh %d Channel Comp %5.2f \n",frame,subframe,slot,symbol,pdsch_vars[eNB_id]->log2_maxh,
|
||||
ue->generic_stat_bis[ue->current_thread_id[subframe]][slot].p_time/(cpuf*1000.0));
|
||||
start_meas(&ue->generic_stat_bis[ue->current_thread_id[subframe]][slot]);
|
||||
#endif
|
||||
@@ -805,7 +805,7 @@ int rx_pdsch(PHY_VARS_UE *ue,
|
||||
|
||||
#if UE_TIMING_TRACE
|
||||
stop_meas(&ue->generic_stat_bis[ue->current_thread_id[subframe]][slot]);
|
||||
LOG_I(PHY, "[AbsSFN %d.%d] Slot%d Symbol %d: Channel Combine %5.2f \n",frame,subframe,slot,symbol,ue->generic_stat_bis[ue->current_thread_id[subframe]][slot].p_time/(cpuf*1000.0));
|
||||
LOG_D(PHY, "[AbsSFN %d.%d] Slot%d Symbol %d: Channel Combine %5.2f \n",frame,subframe,slot,symbol,ue->generic_stat_bis[ue->current_thread_id[subframe]][slot].p_time/(cpuf*1000.0));
|
||||
start_meas(&ue->generic_stat_bis[ue->current_thread_id[subframe]][slot]);
|
||||
#endif
|
||||
//printf("LLR dlsch0_harq->Qm %d rx_type %d cw0 %d cw1 %d symbol %d \n",dlsch0_harq->Qm,rx_type,codeword_TB0,codeword_TB1,symbol);
|
||||
|
||||
@@ -105,14 +105,19 @@ void set_ptrs_symb_idx(uint16_t *ptrs_symbols,
|
||||
uint8_t L_ptrs,
|
||||
uint16_t ul_dmrs_symb_pos) {
|
||||
|
||||
uint8_t i = 0, last_symbol, is_dmrs_symbol, l_ref;
|
||||
int8_t l_counter;
|
||||
uint i = 0, last_symbol, l_ref;
|
||||
int l_counter;
|
||||
l_ref = start_symbol;
|
||||
last_symbol = start_symbol + duration_in_symbols - 1;
|
||||
if (L_ptrs==0) {
|
||||
LOG_E(PHY,"bug: impossible L_ptrs\n");
|
||||
*ptrs_symbols = 0;
|
||||
return;
|
||||
}
|
||||
|
||||
while ( (l_ref + i*L_ptrs) <= last_symbol) {
|
||||
|
||||
is_dmrs_symbol = 0;
|
||||
int is_dmrs_symbol = 0;
|
||||
|
||||
for(l_counter = l_ref + i*L_ptrs; l_counter >= max(l_ref + (i-1)*L_ptrs + 1, l_ref); l_counter--) {
|
||||
|
||||
@@ -259,9 +264,13 @@ void nr_ptrs_cpe_estimation(uint8_t K_ptrs,
|
||||
uint16_t re_cnt = 0;
|
||||
uint16_t cnt = 0;
|
||||
unsigned short nb_re_pdsch = NR_NB_SC_PER_RB * nb_rb;
|
||||
if (K_ptrs==0) {
|
||||
LOG_E(PHY,"K_ptrs == 0\n");
|
||||
return;
|
||||
}
|
||||
uint16_t sc_per_symbol = (nb_rb + K_ptrs - 1)/K_ptrs;
|
||||
int16_t *ptrs_p = (int16_t *)malloc(sizeof(int32_t)*(sc_per_symbol));
|
||||
int16_t *dmrs_comp_p = (int16_t *)malloc(sizeof(int32_t)*(sc_per_symbol));
|
||||
int16_t *ptrs_p = (int16_t *)malloc(sizeof(int32_t)*((1 + sc_per_symbol/4)*4));
|
||||
int16_t *dmrs_comp_p = (int16_t *)malloc(sizeof(int32_t)*((1 + sc_per_symbol/4)*4));
|
||||
double abs = 0.0;
|
||||
double real = 0.0;
|
||||
double imag = 0.0;
|
||||
|
||||
@@ -213,7 +213,7 @@ void ldpc8blocks( void *p) {
|
||||
for (int rr=impp->macro_num*8; rr < impp->n_segments && rr < (impp->macro_num+1)*8; rr++ ) {
|
||||
if (impp->F>0) {
|
||||
// writing into positions d[r][k-2Zc] as in clause 5.3.2 step 2) in 38.212
|
||||
memset(&impp->d[rr][Kr-impp->F-2*(*impp->Zc)], impp->F, NR_NULL);
|
||||
memset(&impp->d[rr][Kr-impp->F-2*(*impp->Zc)], NR_NULL, impp->F);
|
||||
}
|
||||
|
||||
#ifdef DEBUG_DLSCH_CODING
|
||||
|
||||
@@ -32,6 +32,7 @@
|
||||
*/
|
||||
|
||||
#include "nr_dlsch.h"
|
||||
#include "../../../nfapi/oai_integration/vendor_ext.h"
|
||||
|
||||
extern void set_taus_seed(unsigned int seed_type);
|
||||
|
||||
|
||||
@@ -111,7 +111,7 @@ NR_gNB_ULSCH_t *new_gNB_ulsch(uint8_t max_ldpc_iterations,uint16_t N_RB_UL, uint
|
||||
{
|
||||
|
||||
NR_gNB_ULSCH_t *ulsch;
|
||||
uint8_t exit_flag = 0,i,r;
|
||||
uint8_t i,r;
|
||||
uint16_t a_segments = MAX_NUM_NR_ULSCH_SEGMENTS; //number of segments to be allocated
|
||||
|
||||
if (N_RB_UL != 273) {
|
||||
@@ -120,68 +120,26 @@ NR_gNB_ULSCH_t *new_gNB_ulsch(uint8_t max_ldpc_iterations,uint16_t N_RB_UL, uint
|
||||
}
|
||||
|
||||
uint16_t ulsch_bytes = a_segments*1056; // allocated bytes per segment
|
||||
ulsch = (NR_gNB_ULSCH_t *)malloc16(sizeof(NR_gNB_ULSCH_t));
|
||||
|
||||
if (ulsch) {
|
||||
|
||||
memset(ulsch,0,sizeof(NR_gNB_ULSCH_t));
|
||||
|
||||
ulsch->max_ldpc_iterations = max_ldpc_iterations;
|
||||
ulsch->Mlimit = 4;
|
||||
|
||||
for (i=0; i<NR_MAX_ULSCH_HARQ_PROCESSES; i++) {
|
||||
|
||||
ulsch->harq_processes[i] = (NR_UL_gNB_HARQ_t *)malloc16(sizeof(NR_UL_gNB_HARQ_t));
|
||||
|
||||
if (ulsch->harq_processes[i]) {
|
||||
|
||||
memset(ulsch->harq_processes[i],0,sizeof(NR_UL_gNB_HARQ_t));
|
||||
|
||||
ulsch->harq_processes[i]->b = (uint8_t*)malloc16(ulsch_bytes);
|
||||
|
||||
if (ulsch->harq_processes[i]->b)
|
||||
memset(ulsch->harq_processes[i]->b,0,ulsch_bytes);
|
||||
else
|
||||
exit_flag=3;
|
||||
|
||||
if (abstraction_flag == 0) {
|
||||
for (r=0; r<a_segments; r++) {
|
||||
|
||||
ulsch->harq_processes[i]->p_nrLDPC_procBuf[r] = nrLDPC_init_mem();
|
||||
|
||||
ulsch->harq_processes[i]->c[r] = (uint8_t*)malloc16(8448*sizeof(uint8_t));
|
||||
|
||||
if (ulsch->harq_processes[i]->c[r])
|
||||
memset(ulsch->harq_processes[i]->c[r],0,8448*sizeof(uint8_t));
|
||||
else
|
||||
exit_flag=2;
|
||||
|
||||
ulsch->harq_processes[i]->d[r] = (int16_t*)malloc16((68*384)*sizeof(int16_t));
|
||||
|
||||
if (ulsch->harq_processes[i]->d[r])
|
||||
memset(ulsch->harq_processes[i]->d[r],0,(68*384)*sizeof(int16_t));
|
||||
else
|
||||
exit_flag=2;
|
||||
|
||||
ulsch->harq_processes[i]->w[r] = (int16_t*)malloc16((3*(6144+64))*sizeof(int16_t));
|
||||
|
||||
if (ulsch->harq_processes[i]->w[r])
|
||||
memset(ulsch->harq_processes[i]->w[r],0,(3*(6144+64))*sizeof(int16_t));
|
||||
else
|
||||
exit_flag=2;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
exit_flag=1;
|
||||
ulsch = (NR_gNB_ULSCH_t *)malloc16_clear(sizeof(NR_gNB_ULSCH_t));
|
||||
|
||||
ulsch->max_ldpc_iterations = max_ldpc_iterations;
|
||||
ulsch->Mlimit = 4;
|
||||
|
||||
for (i=0; i<NR_MAX_ULSCH_HARQ_PROCESSES; i++) {
|
||||
|
||||
ulsch->harq_processes[i] = (NR_UL_gNB_HARQ_t *)malloc16_clear(sizeof(NR_UL_gNB_HARQ_t));
|
||||
ulsch->harq_processes[i]->b = (uint8_t*)malloc16_clear(ulsch_bytes);
|
||||
if (abstraction_flag == 0) {
|
||||
for (r=0; r<a_segments; r++) {
|
||||
ulsch->harq_processes[i]->p_nrLDPC_procBuf[r] = nrLDPC_init_mem();
|
||||
ulsch->harq_processes[i]->c[r] = (uint8_t*)malloc16_clear(8448*sizeof(uint8_t));
|
||||
ulsch->harq_processes[i]->d[r] = (int16_t*)malloc16_clear((68*384)*sizeof(int16_t));
|
||||
ulsch->harq_processes[i]->w[r] = (int16_t*)malloc16_clear((3*(6144+64))*sizeof(int16_t));
|
||||
}
|
||||
}
|
||||
|
||||
if (exit_flag==0)
|
||||
return(ulsch);
|
||||
}
|
||||
printf("new_gNB_ulsch with size %zu: exit_flag = %hhu\n",sizeof(NR_UL_gNB_HARQ_t), exit_flag);
|
||||
free_gNB_ulsch(&ulsch,N_RB_UL);
|
||||
return(NULL);
|
||||
|
||||
return(ulsch);
|
||||
}
|
||||
|
||||
void clean_gNB_ulsch(NR_gNB_ULSCH_t *ulsch)
|
||||
|
||||
@@ -47,6 +47,7 @@
|
||||
#include "PHY/NR_REFSIG/nr_refsig.h"
|
||||
#include "common/utils/LOG/log.h"
|
||||
#include "common/utils/LOG/vcd_signal_dumper.h"
|
||||
#include "nfapi/oai_integration/vendor_ext.h"
|
||||
|
||||
#include "nfapi/oai_integration/vendor_ext.h"
|
||||
|
||||
@@ -88,7 +89,8 @@ void nr_fill_pucch(PHY_VARS_gNB *gNB,
|
||||
int frame,
|
||||
int slot,
|
||||
nfapi_nr_pucch_pdu_t *pucch_pdu) {
|
||||
|
||||
if (NFAPI_MODE == NFAPI_MODE_PNF)
|
||||
gNB->pucch[0]->active = 0; //check if ture in monolithic mode
|
||||
int id = nr_find_pucch(pucch_pdu->rnti,frame,slot,gNB);
|
||||
AssertFatal( (id>=0) && (id<NUMBER_OF_NR_PUCCH_MAX),
|
||||
"invalid id found for pucch !!! rnti %04x id %d\n",pucch_pdu->rnti,id);
|
||||
|
||||
@@ -601,11 +601,11 @@ int nr_rx_pbch( PHY_VARS_NR_UE *ue,
|
||||
#endif
|
||||
|
||||
nr_downlink_indication_t dl_indication;
|
||||
fapi_nr_rx_indication_t rx_ind;
|
||||
fapi_nr_rx_indication_t *rx_ind = calloc(1, sizeof(*rx_ind));
|
||||
uint16_t number_pdus = 1;
|
||||
|
||||
nr_fill_dl_indication(&dl_indication, NULL, &rx_ind, proc, ue, gNB_id);
|
||||
nr_fill_rx_indication(&rx_ind, FAPI_NR_RX_PDU_TYPE_SSB, gNB_id, ue, NULL, NULL, number_pdus);
|
||||
nr_fill_dl_indication(&dl_indication, NULL, rx_ind, proc, ue, gNB_id);
|
||||
nr_fill_rx_indication(rx_ind, FAPI_NR_RX_PDU_TYPE_SSB, gNB_id, ue, NULL, NULL, number_pdus, proc);
|
||||
|
||||
if (ue->if_inst && ue->if_inst->dl_indication)
|
||||
ue->if_inst->dl_indication(&dl_indication, NULL);
|
||||
|
||||
@@ -258,7 +258,6 @@ int nr_ulsch_encoding(PHY_VARS_NR_UE *ue,
|
||||
Ilbrm = 0;
|
||||
Tbslbrm = 950984; //max tbs
|
||||
Coderate = 0.0;
|
||||
trace_NRpdu(DIRECTION_UPLINK, harq_process->a, harq_process->pusch_pdu.pusch_data.tb_size, 0, WS_C_RNTI, 0, 0, 0,0, 0);
|
||||
///////////
|
||||
/////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
@@ -45,6 +45,7 @@
|
||||
#include "executables/nr-softmodem.h"
|
||||
#include "executables/softmodem-common.h"
|
||||
#include "PHY/NR_REFSIG/ul_ref_seq_nr.h"
|
||||
#include <openair2/UTIL/OPT/opt.h>
|
||||
|
||||
//#define DEBUG_PUSCH_MAPPING
|
||||
//#define DEBUG_MAC_PDU
|
||||
@@ -163,9 +164,15 @@ void nr_ue_ulsch_procedures(PHY_VARS_NR_UE *UE,
|
||||
nb_dmrs_re_per_rb, number_dmrs_symbols, mod_order, Nl);
|
||||
|
||||
|
||||
trace_NRpdu(DIRECTION_UPLINK,
|
||||
ulsch_ue->harq_processes[harq_pid]->a,
|
||||
ulsch_ue->harq_processes[harq_pid]->pusch_pdu.pusch_data.tb_size,
|
||||
0, WS_C_RNTI, rnti, frame, slot, 0, 0);
|
||||
|
||||
if (nr_ulsch_encoding(UE, ulsch_ue, frame_parms, harq_pid, G) == -1)
|
||||
return;
|
||||
|
||||
|
||||
///////////
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
@@ -240,7 +240,7 @@ static void genericWaterFall (OAIgraph_t *graph, scopeSample_t *values, const in
|
||||
for (int pix=0; pix<graph->w; pix++) {
|
||||
scopeSample_t *end=values+(pix+1)*samplesPerPixel;
|
||||
end-=2;
|
||||
AssertFatal(end <= values+datasize,"diff : %ld", end-values+datasize);
|
||||
AssertFatal(end <= values+datasize,"diff : %tu", end-values+datasize);
|
||||
double val=0;
|
||||
|
||||
for (scopeSample_t *s=values+(pix)*samplesPerPixel;
|
||||
|
||||
@@ -24,6 +24,7 @@
|
||||
|
||||
#include "PHY/types.h"
|
||||
#include "PHY/defs_eNB.h"
|
||||
#include "PHY/defs_gNB.h"
|
||||
#include "PHY/defs_UE.h"
|
||||
|
||||
char* namepointer_chMag ;
|
||||
@@ -42,6 +43,7 @@ char* namepointer_log2;
|
||||
|
||||
PHY_VARS_UE ***PHY_vars_UE_g;
|
||||
UL_RCC_IND_t UL_RCC_INFO;
|
||||
NR_UL_IND_t UL_INFO;
|
||||
|
||||
unsigned short rev[2048],rev_times4[8192],rev_half[1024];
|
||||
unsigned short rev256[256],rev512[512],rev1024[1024],rev4096[4096],rev2048[2048],rev8192[8192];
|
||||
@@ -81,7 +83,7 @@ const double sinr_to_cqi[4][16]= { {-2.5051, -2.5051, -1.7451, -0.3655, 1.0812,
|
||||
};
|
||||
|
||||
//int cqi_to_mcs[16]={0, 0, 1, 3, 5, 7, 9, 13, 15, 16, 20, 23, 25, 27, 27, 27};
|
||||
const int cqi_to_mcs[16]= {0, 0, 1, 2, 4, 6, 8, 11, 13, 16, 18, 20, 23, 25, 27, 28};
|
||||
const int cqi_to_mcs[16]= {0, 0, 1, 2, 4, 6, 8, 11, 13, 16, 18, 20, 23, 25, 27, 27};
|
||||
|
||||
//for SNR to MI conversion 7 th order Polynomial coeff
|
||||
const double q_qam16[8]= {3.21151853033897e-10,5.55435952230651e-09,-2.30760065362117e-07,-6.25587743817859e-06,4.62251036452795e-06,0.00224150813158937,0.0393723140344367,0.245486379182639};
|
||||
|
||||
@@ -84,7 +84,7 @@ const double sinr_to_cqi[4][16]= { {-2.5051, -2.5051, -1.7451, -0.3655, 1.0812,
|
||||
};
|
||||
|
||||
//int cqi_to_mcs[16]={0, 0, 1, 3, 5, 7, 9, 13, 15, 16, 20, 23, 25, 27, 27, 27};
|
||||
const int cqi_to_mcs[16]= {0, 0, 1, 2, 4, 6, 8, 11, 13, 16, 18, 20, 23, 25, 27, 28};
|
||||
const int cqi_to_mcs[16]= {0, 0, 1, 2, 4, 6, 8, 11, 13, 16, 18, 20, 23, 25, 27, 27};
|
||||
|
||||
//for SNR to MI conversion 7 th order Polynomial coeff
|
||||
const double q_qam16[8]= {3.21151853033897e-10,5.55435952230651e-09,-2.30760065362117e-07,-6.25587743817859e-06,4.62251036452795e-06,0.00224150813158937,0.0393723140344367,0.245486379182639};
|
||||
|
||||
@@ -73,7 +73,7 @@ const double sinr_to_cqi[4][16]= { {-2.5051, -2.5051, -1.7451, -0.3655, 1.0812,
|
||||
};
|
||||
|
||||
//int cqi_to_mcs[16]={0, 0, 1, 3, 5, 7, 9, 13, 15, 16, 20, 23, 25, 27, 27, 27};
|
||||
const int cqi_to_mcs[16]= {0, 0, 1, 2, 4, 6, 8, 11, 13, 16, 18, 20, 23, 25, 27, 28};
|
||||
const int cqi_to_mcs[16]= {0, 0, 1, 2, 4, 6, 8, 11, 13, 16, 18, 20, 23, 25, 27, 27};
|
||||
|
||||
//for SNR to MI conversion 7 th order Polynomial coeff
|
||||
const double q_qam16[8]= {3.21151853033897e-10,5.55435952230651e-09,-2.30760065362117e-07,-6.25587743817859e-06,4.62251036452795e-06,0.00224150813158937,0.0393723140344367,0.245486379182639};
|
||||
|
||||
@@ -755,6 +755,7 @@ void fill_sr_indication(int UEid, PHY_VARS_eNB *eNB,uint16_t rnti,int frame,int
|
||||
pthread_mutex_lock(&eNB->UL_INFO_mutex);
|
||||
nfapi_sr_indication_t *sr_ind = &eNB->UL_INFO.sr_ind;
|
||||
nfapi_sr_indication_body_t *sr_ind_body = &sr_ind->sr_indication_body;
|
||||
assert(sr_ind_body->number_of_srs <= NFAPI_SR_IND_MAX_PDU);
|
||||
nfapi_sr_indication_pdu_t *pdu = &sr_ind_body->sr_pdu_list[sr_ind_body->number_of_srs];
|
||||
sr_ind->sfn_sf = frame<<4|subframe;
|
||||
sr_ind->header.message_id = NFAPI_RX_SR_INDICATION;
|
||||
@@ -1580,6 +1581,7 @@ void fill_rx_indication(PHY_VARS_eNB *eNB,
|
||||
pthread_mutex_lock(&eNB->UL_INFO_mutex);
|
||||
eNB->UL_INFO.rx_ind.sfn_sf = frame<<4| subframe;
|
||||
eNB->UL_INFO.rx_ind.rx_indication_body.tl.tag = NFAPI_RX_INDICATION_BODY_TAG;
|
||||
assert(eNB->UL_INFO.rx_ind.rx_indication_body.number_of_pdus <= NFAPI_RX_IND_MAX_PDU);
|
||||
pdu = &eNB->UL_INFO.rx_ind.rx_indication_body.rx_pdu_list[eNB->UL_INFO.rx_ind.rx_indication_body.number_of_pdus];
|
||||
// pdu->rx_ue_information.handle = eNB->ulsch[ULSCH_id]->handle;
|
||||
pdu->rx_ue_information.tl.tag = NFAPI_RX_UE_INFORMATION_TAG;
|
||||
@@ -1587,7 +1589,11 @@ void fill_rx_indication(PHY_VARS_eNB *eNB,
|
||||
pdu->rx_indication_rel8.tl.tag = NFAPI_RX_INDICATION_REL8_TAG;
|
||||
pdu->rx_indication_rel8.length = eNB->ulsch[ULSCH_id]->harq_processes[harq_pid]->TBS>>3;
|
||||
pdu->rx_indication_rel8.offset = 1; // DJP - I dont understand - but broken unless 1 ???? 0; // filled in at the end of the UL_INFO formation
|
||||
pdu->data = eNB->ulsch[ULSCH_id]->harq_processes[harq_pid]->decodedBytes;
|
||||
assert(pdu->rx_indication_rel8.length <= NFAPI_RX_IND_DATA_MAX);
|
||||
memcpy(pdu->rx_ind_data,
|
||||
eNB->ulsch[ULSCH_id]->harq_processes[harq_pid]->decodedBytes,
|
||||
pdu->rx_indication_rel8.length);
|
||||
|
||||
// estimate timing advance for MAC
|
||||
sync_pos = lte_est_timing_advance_pusch(&eNB->frame_parms, eNB->pusch_vars[ULSCH_id]->drs_ch_estimates_time);
|
||||
timing_advance_update = sync_pos;
|
||||
@@ -1832,6 +1838,7 @@ int getM(PHY_VARS_eNB *eNB,int frame,int subframe) {
|
||||
|
||||
void fill_ulsch_cqi_indication (PHY_VARS_eNB *eNB, uint16_t frame, uint8_t subframe, LTE_UL_eNB_HARQ_t *ulsch_harq, uint16_t rnti) {
|
||||
pthread_mutex_lock (&eNB->UL_INFO_mutex);
|
||||
assert(eNB->UL_INFO.cqi_ind.cqi_indication_body.number_of_cqis <= NFAPI_CQI_IND_MAX_PDU);
|
||||
nfapi_cqi_indication_pdu_t *pdu = &eNB->UL_INFO.cqi_ind.cqi_indication_body.cqi_pdu_list[eNB->UL_INFO.cqi_ind.cqi_indication_body.number_of_cqis];
|
||||
nfapi_cqi_indication_raw_pdu_t *raw_pdu = &eNB->UL_INFO.cqi_ind.cqi_indication_body.cqi_raw_pdu_list[eNB->UL_INFO.cqi_ind.cqi_indication_body.number_of_cqis];
|
||||
pdu->instance_length = 0;
|
||||
@@ -1878,6 +1885,7 @@ void fill_ulsch_harq_indication (PHY_VARS_eNB *eNB, LTE_UL_eNB_HARQ_t *ulsch_har
|
||||
|
||||
//AssertFatal(DLSCH_id>=0,"DLSCH_id doesn't exist\n");
|
||||
pthread_mutex_lock(&eNB->UL_INFO_mutex);
|
||||
assert(eNB->UL_INFO.harq_ind.harq_indication_body.number_of_harqs <= NFAPI_HARQ_IND_MAX_PDU);
|
||||
nfapi_harq_indication_pdu_t *pdu = &eNB->UL_INFO.harq_ind.harq_indication_body.harq_pdu_list[eNB->UL_INFO.harq_ind.harq_indication_body.number_of_harqs];
|
||||
int M;
|
||||
int i;
|
||||
@@ -1948,6 +1956,7 @@ void fill_uci_harq_indication (int UEid, PHY_VARS_eNB *eNB, LTE_eNB_UCI *uci, in
|
||||
pthread_mutex_lock(&eNB->UL_INFO_mutex);
|
||||
nfapi_harq_indication_t *ind = &eNB->UL_INFO.harq_ind;
|
||||
nfapi_harq_indication_body_t *body = &ind->harq_indication_body;
|
||||
assert(eNB->UL_INFO.harq_ind.harq_indication_body.number_of_harqs <= NFAPI_HARQ_IND_MAX_PDU);
|
||||
nfapi_harq_indication_pdu_t *pdu = &body->harq_pdu_list[eNB->UL_INFO.harq_ind.harq_indication_body.number_of_harqs];
|
||||
ind->sfn_sf = frame<<4|subframe;
|
||||
ind->header.message_id = NFAPI_HARQ_INDICATION;
|
||||
@@ -2124,6 +2133,7 @@ void fill_uci_harq_indication (int UEid, PHY_VARS_eNB *eNB, LTE_eNB_UCI *uci, in
|
||||
|
||||
void fill_crc_indication (PHY_VARS_eNB *eNB, int ULSCH_id, int frame, int subframe, uint8_t crc_flag) {
|
||||
pthread_mutex_lock(&eNB->UL_INFO_mutex);
|
||||
assert(eNB->UL_INFO.crc_ind.crc_indication_body.number_of_crcs <= NFAPI_CRC_IND_MAX_PDU);
|
||||
nfapi_crc_indication_pdu_t *pdu = &eNB->UL_INFO.crc_ind.crc_indication_body.crc_pdu_list[eNB->UL_INFO.crc_ind.crc_indication_body.number_of_crcs];
|
||||
eNB->UL_INFO.crc_ind.sfn_sf = frame<<4 | subframe;
|
||||
eNB->UL_INFO.crc_ind.header.message_id = NFAPI_CRC_INDICATION;
|
||||
|
||||
@@ -149,16 +149,15 @@ void nr_schedule_response(NR_Sched_Rsp_t *Sched_INFO){
|
||||
|
||||
gNB = RC.gNB[Mod_id];
|
||||
|
||||
notifiedFIFO_elt_t *res;
|
||||
res = pullTpool(gNB->resp_L1_tx, gNB->threadPool);
|
||||
processingData_L1tx_t *msgTx = (processingData_L1tx_t *)NotifiedFifoData(res);
|
||||
|
||||
uint8_t number_dl_pdu = (DL_req==NULL) ? 0 : DL_req->dl_tti_request_body.nPDUs;
|
||||
uint8_t number_ul_dci_pdu = (UL_dci_req==NULL) ? 0 : UL_dci_req->numPdus;
|
||||
uint8_t number_ul_tti_pdu = (UL_tti_req==NULL) ? 0 : UL_tti_req->n_pdus;
|
||||
uint8_t number_tx_data_pdu = (TX_req == NULL) ? 0 : TX_req->Number_of_PDUs;
|
||||
|
||||
if (NFAPI_MODE == NFAPI_MONOLITHIC){
|
||||
notifiedFIFO_elt_t *res;
|
||||
res = pullTpool(gNB->resp_L1_tx, gNB->threadPool);
|
||||
processingData_L1tx_t *msgTx = (processingData_L1tx_t *)NotifiedFifoData(res);
|
||||
if (DL_req != NULL && TX_req!=NULL && (number_dl_pdu > 0 || number_ul_dci_pdu > 0 || number_ul_tti_pdu > 0))
|
||||
LOG_D(PHY,"NFAPI: Sched_INFO:SFN/SLOT:%04d/%d DL_req:SFN/SLO:%04d/%d:dl_pdu:%d tx_req:SFN/SLOT:%04d/%d:pdus:%d;ul_dci %d ul_tti %d\n",
|
||||
frame,slot,
|
||||
@@ -241,12 +240,12 @@ void nr_schedule_response(NR_Sched_Rsp_t *Sched_INFO){
|
||||
if (number_ul_dci_pdu>0)
|
||||
oai_nfapi_ul_dci_req(UL_dci_req);
|
||||
|
||||
if (number_dl_pdu>0)
|
||||
oai_nfapi_dl_tti_req(DL_req);
|
||||
|
||||
if (number_tx_data_pdu>0)
|
||||
oai_nfapi_tx_data_req(TX_req);
|
||||
|
||||
}
|
||||
if (number_dl_pdu>0)
|
||||
oai_nfapi_dl_tti_req(DL_req);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -477,9 +477,10 @@ void nr_feptx_prec(RU_t *ru,int frame_tx,int tti_tx) {
|
||||
memcpy((void*)ru->common.txdataF[i],
|
||||
(void*)&gNB->common_vars.txdataF[i][txdataF_offset],
|
||||
fp->samples_per_slot_wCP*sizeof(int32_t));
|
||||
memcpy((void*)&ru->common.beam_id[i][slot_tx*fp->symbols_per_slot],
|
||||
(void*)&gNB->common_vars.beam_id[i][slot_tx*fp->symbols_per_slot],
|
||||
fp->symbols_per_slot*sizeof(uint8_t));
|
||||
if (ru->do_precoding == 1)
|
||||
memcpy((void*)&ru->common.beam_id[i][slot_tx*fp->symbols_per_slot],
|
||||
(void*)&gNB->common_vars.beam_id[i][slot_tx*fp->symbols_per_slot],
|
||||
fp->symbols_per_slot*sizeof(uint8_t));
|
||||
}
|
||||
|
||||
if (ru->nb_tx == 1 && ru->nb_log_antennas == 1) {
|
||||
|
||||
@@ -456,6 +456,7 @@ void nr_fill_indication(PHY_VARS_gNB *gNB, int frame, int slot_rx, int ULSCH_id,
|
||||
|
||||
|
||||
if (0/*pusch_pdu->mcs_index == 9*/) {
|
||||
__attribute__((unused))
|
||||
#ifdef __AVX2__
|
||||
int off = ((pusch_pdu->rb_size&1) == 1)? 4:0;
|
||||
#else
|
||||
@@ -660,6 +661,8 @@ int phy_procedures_gNB_uespec_RX(PHY_VARS_gNB *gNB, int frame_rx, int slot_rx) {
|
||||
for (int i=0;i<NUMBER_OF_NR_PUCCH_MAX;i++){
|
||||
NR_gNB_PUCCH_t *pucch = gNB->pucch[i];
|
||||
if (pucch) {
|
||||
if (NFAPI_MODE == NFAPI_MODE_PNF)
|
||||
pucch->frame = frame_rx;
|
||||
if ((pucch->active == 1) &&
|
||||
(pucch->frame == frame_rx) &&
|
||||
(pucch->slot == slot_rx) ) {
|
||||
|
||||
@@ -416,7 +416,8 @@ void nr_fill_rx_indication(fapi_nr_rx_indication_t *rx_ind,
|
||||
PHY_VARS_NR_UE *ue,
|
||||
NR_UE_DLSCH_t *dlsch0,
|
||||
NR_UE_DLSCH_t *dlsch1,
|
||||
uint16_t n_pdus);
|
||||
uint16_t n_pdus,
|
||||
UE_nr_rxtx_proc_t *proc);
|
||||
|
||||
bool nr_ue_dlsch_procedures(PHY_VARS_NR_UE *ue,
|
||||
UE_nr_rxtx_proc_t *proc,
|
||||
|
||||
@@ -39,11 +39,176 @@
|
||||
|
||||
#include "PHY/defs_nr_UE.h"
|
||||
#include "PHY/impl_defs_nr.h"
|
||||
#include "utils.h"
|
||||
|
||||
extern PHY_VARS_NR_UE ***PHY_vars_UE_g;
|
||||
|
||||
const char *dl_pdu_type[]={"DCI", "DLSCH", "RA_DLSCH", "SI_DLSCH", "P_DLSCH"};
|
||||
const char *ul_pdu_type[]={"PRACH", "PUCCH", "PUSCH", "SRS"};
|
||||
queue_t nr_rx_ind_queue;
|
||||
queue_t nr_crc_ind_queue;
|
||||
queue_t nr_uci_ind_queue;
|
||||
|
||||
int8_t nr_ue_scheduled_response_stub(nr_scheduled_response_t *scheduled_response) {
|
||||
|
||||
if(scheduled_response != NULL)
|
||||
{
|
||||
if (scheduled_response->ul_config != NULL)
|
||||
{
|
||||
fapi_nr_ul_config_request_t *ul_config = scheduled_response->ul_config;
|
||||
AssertFatal(ul_config->number_pdus < sizeof(ul_config->ul_config_list) / sizeof(ul_config->ul_config_list[0]),
|
||||
"Too many ul_config pdus %d", ul_config->number_pdus);
|
||||
for (int i = 0; i < ul_config->number_pdus; ++i)
|
||||
{
|
||||
LOG_I(PHY, "In %s: processing type %d PDU of %d total UL PDUs (ul_config %p) \n",
|
||||
__FUNCTION__, ul_config->ul_config_list[i].pdu_type, ul_config->number_pdus, ul_config);
|
||||
|
||||
uint8_t pdu_type = ul_config->ul_config_list[i].pdu_type;
|
||||
switch (pdu_type)
|
||||
{
|
||||
case (FAPI_NR_UL_CONFIG_TYPE_PUSCH):
|
||||
{
|
||||
nfapi_nr_rx_data_indication_t *rx_ind = CALLOC(1, sizeof(*rx_ind));
|
||||
nfapi_nr_crc_indication_t *crc_ind = CALLOC(1, sizeof(*crc_ind));
|
||||
nfapi_nr_ue_pusch_pdu_t *pusch_config_pdu = &ul_config->ul_config_list[i].pusch_config_pdu;
|
||||
if (scheduled_response->tx_request)
|
||||
{
|
||||
AssertFatal(scheduled_response->tx_request->number_of_pdus <
|
||||
sizeof(scheduled_response->tx_request->tx_request_body) / sizeof(scheduled_response->tx_request->tx_request_body[0]),
|
||||
"Too many tx_req pdus %d", scheduled_response->tx_request->number_of_pdus);
|
||||
rx_ind->header.message_id = NFAPI_NR_PHY_MSG_TYPE_RX_DATA_INDICATION;
|
||||
rx_ind->sfn = scheduled_response->ul_config->sfn;
|
||||
rx_ind->slot = scheduled_response->ul_config->slot;
|
||||
rx_ind->number_of_pdus = scheduled_response->tx_request->number_of_pdus;
|
||||
rx_ind->pdu_list = CALLOC(rx_ind->number_of_pdus, sizeof(*rx_ind->pdu_list));
|
||||
for (int j = 0; j < rx_ind->number_of_pdus; j++)
|
||||
{
|
||||
fapi_nr_tx_request_body_t *tx_req_body = &scheduled_response->tx_request->tx_request_body[j];
|
||||
rx_ind->pdu_list[j].handle = pusch_config_pdu->handle;
|
||||
rx_ind->pdu_list[j].harq_id = pusch_config_pdu->pusch_data.harq_process_id;
|
||||
rx_ind->pdu_list[j].pdu_length = tx_req_body->pdu_length;
|
||||
rx_ind->pdu_list[j].pdu = CALLOC(tx_req_body->pdu_length, sizeof(*rx_ind->pdu_list[j].pdu));
|
||||
memcpy(rx_ind->pdu_list[j].pdu, tx_req_body->pdu, tx_req_body->pdu_length * sizeof(*rx_ind->pdu_list[j].pdu));
|
||||
rx_ind->pdu_list[j].rnti = pusch_config_pdu->rnti;
|
||||
rx_ind->pdu_list[j].timing_advance = scheduled_response->tx_request->tx_config.timing_advance;
|
||||
rx_ind->pdu_list[j].ul_cqi = scheduled_response->tx_request->tx_config.ul_cqi;
|
||||
char buffer[1024];
|
||||
hexdump(rx_ind->pdu_list[j].pdu, rx_ind->pdu_list[j].pdu_length, buffer, sizeof(buffer));
|
||||
LOG_D(NR_MAC, "Hexdump of pdu %s before queuing rx_ind\n",
|
||||
buffer);
|
||||
}
|
||||
|
||||
crc_ind->header.message_id = NFAPI_NR_PHY_MSG_TYPE_CRC_INDICATION;
|
||||
crc_ind->number_crcs = scheduled_response->ul_config->number_pdus;
|
||||
crc_ind->sfn = scheduled_response->ul_config->sfn;
|
||||
crc_ind->slot = scheduled_response->ul_config->slot;
|
||||
crc_ind->crc_list = CALLOC(crc_ind->number_crcs, sizeof(*crc_ind->crc_list));
|
||||
for (int j = 0; j < crc_ind->number_crcs; j++)
|
||||
{
|
||||
crc_ind->crc_list[j].handle = pusch_config_pdu->handle;
|
||||
crc_ind->crc_list[j].harq_id = pusch_config_pdu->pusch_data.harq_process_id;
|
||||
LOG_D(NR_MAC, "This is the harq pid %d for crc_list[%d]\n", crc_ind->crc_list[j].harq_id, j);
|
||||
LOG_D(NR_MAC, "This is sched sfn/sl [%d %d] and crc sfn/sl [%d %d]\n",
|
||||
scheduled_response->frame, scheduled_response->slot, crc_ind->sfn, crc_ind->slot);
|
||||
crc_ind->crc_list[j].num_cb = pusch_config_pdu->pusch_data.num_cb;
|
||||
crc_ind->crc_list[j].rnti = pusch_config_pdu->rnti;
|
||||
crc_ind->crc_list[j].tb_crc_status = 0;
|
||||
crc_ind->crc_list[j].timing_advance = scheduled_response->tx_request->tx_config.timing_advance;
|
||||
crc_ind->crc_list[j].ul_cqi = 255;
|
||||
}
|
||||
|
||||
if (!put_queue(&nr_rx_ind_queue, rx_ind))
|
||||
{
|
||||
LOG_E(NR_MAC, "Put_queue failed for rx_ind\n");
|
||||
for (int i = 0; i < rx_ind->number_of_pdus; i++)
|
||||
{
|
||||
free(rx_ind->pdu_list[i].pdu);
|
||||
rx_ind->pdu_list[i].pdu = NULL;
|
||||
}
|
||||
|
||||
free(rx_ind->pdu_list);
|
||||
rx_ind->pdu_list = NULL;
|
||||
free(rx_ind);
|
||||
rx_ind = NULL;
|
||||
}
|
||||
if (!put_queue(&nr_crc_ind_queue, crc_ind))
|
||||
{
|
||||
LOG_E(NR_MAC, "Put_queue failed for crc_ind\n");
|
||||
free(crc_ind->crc_list);
|
||||
crc_ind->crc_list = NULL;
|
||||
free(crc_ind);
|
||||
crc_ind = NULL;
|
||||
}
|
||||
|
||||
LOG_D(PHY, "In %s: Filled queue rx/crc_ind which was filled by ulconfig. \n", __FUNCTION__);
|
||||
|
||||
scheduled_response->tx_request->number_of_pdus = 0;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
default:
|
||||
LOG_I(NR_MAC, "Unknown ul_config->pdu_type %d\n", pdu_type);
|
||||
break;
|
||||
}
|
||||
}
|
||||
scheduled_response->ul_config->number_pdus = 0;
|
||||
}
|
||||
|
||||
if (scheduled_response->dl_config != NULL)
|
||||
{
|
||||
fapi_nr_dl_config_request_t *dl_config = scheduled_response->dl_config;
|
||||
AssertFatal(dl_config->number_pdus < sizeof(dl_config->dl_config_list) / sizeof(dl_config->dl_config_list[0]),
|
||||
"Too many dl_config pdus %d", dl_config->number_pdus);
|
||||
for (int i = 0; i < dl_config->number_pdus; ++i)
|
||||
{
|
||||
LOG_D(PHY, "In %s: processing %s PDU of %d total DL PDUs (dl_config %p) \n",
|
||||
__FUNCTION__, dl_pdu_type[dl_config->dl_config_list[i].pdu_type - 1], dl_config->number_pdus, dl_config);
|
||||
|
||||
uint8_t pdu_type = dl_config->dl_config_list[i].pdu_type;
|
||||
switch (pdu_type)
|
||||
{
|
||||
case (FAPI_NR_DL_CONFIG_TYPE_DLSCH):
|
||||
{
|
||||
nfapi_nr_uci_indication_t *uci_ind = CALLOC(1, sizeof(*uci_ind));
|
||||
uci_ind->header.message_id = NFAPI_NR_PHY_MSG_TYPE_UCI_INDICATION;
|
||||
uci_ind->sfn = scheduled_response->frame;
|
||||
uci_ind->slot = scheduled_response->slot;
|
||||
uci_ind->num_ucis = 1;
|
||||
uci_ind->uci_list = CALLOC(uci_ind->num_ucis, sizeof(*uci_ind->uci_list));
|
||||
for (int j = 0; j < uci_ind->num_ucis; j++)
|
||||
{
|
||||
nfapi_nr_uci_pucch_pdu_format_0_1_t *pdu_0_1 = &uci_ind->uci_list[j].pucch_pdu_format_0_1;
|
||||
uci_ind->uci_list[j].pdu_type = NFAPI_NR_UCI_FORMAT_0_1_PDU_TYPE;
|
||||
uci_ind->uci_list[j].pdu_size = sizeof(nfapi_nr_uci_pucch_pdu_format_0_1_t);
|
||||
memset(pdu_0_1, 0, sizeof(*pdu_0_1));
|
||||
pdu_0_1->handle = 0;
|
||||
pdu_0_1->rnti = dl_config->dl_config_list[i].dlsch_config_pdu.rnti;
|
||||
pdu_0_1->pucch_format = 1;
|
||||
pdu_0_1->ul_cqi = 255;
|
||||
pdu_0_1->timing_advance = 0;
|
||||
pdu_0_1->rssi = 0;
|
||||
}
|
||||
|
||||
LOG_I(NR_PHY, "In %s: Filled queue uci_ind which was filled by dlconfig.\n"
|
||||
"uci_num %d, SFN/SLOT: [%d, %d]\n",
|
||||
__FUNCTION__, uci_ind->num_ucis, uci_ind->sfn, uci_ind->slot);
|
||||
|
||||
if (!put_queue(&nr_uci_ind_queue, uci_ind))
|
||||
{
|
||||
LOG_E(NR_MAC, "Put_queue failed for uci_ind\n");
|
||||
free(uci_ind->uci_list);
|
||||
free(uci_ind);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
int8_t nr_ue_scheduled_response(nr_scheduled_response_t *scheduled_response){
|
||||
|
||||
|
||||
@@ -34,11 +34,15 @@
|
||||
#define __FAPI_NR_UE_L1_H__
|
||||
|
||||
#include "NR_IF_Module.h"
|
||||
#include "openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.h"
|
||||
#include "openair2/LAYER2/NR_MAC_UE/mac_proto.h"
|
||||
|
||||
/**\brief NR UE FAPI-like P7 messages, scheduled response from L2 indicating L1
|
||||
\param scheduled_response including transmission config(dl_config, ul_config) and data transmission (tx_req)*/
|
||||
int8_t nr_ue_scheduled_response(nr_scheduled_response_t *scheduled_response);
|
||||
|
||||
int8_t nr_ue_scheduled_response_stub(nr_scheduled_response_t *scheduled_response);
|
||||
|
||||
/**\brief NR UE FAPI-like P5 message, physical configuration from L2 to configure L1
|
||||
\param scheduled_response including transmission config(dl_config, ul_config) and data transmission (tx_req)*/
|
||||
int8_t nr_ue_phy_config_request(nr_phy_config_t *phy_config);
|
||||
|
||||
@@ -121,7 +121,8 @@ void nr_fill_rx_indication(fapi_nr_rx_indication_t *rx_ind,
|
||||
PHY_VARS_NR_UE *ue,
|
||||
NR_UE_DLSCH_t *dlsch0,
|
||||
NR_UE_DLSCH_t *dlsch1,
|
||||
uint16_t n_pdus){
|
||||
uint16_t n_pdus,
|
||||
UE_nr_rxtx_proc_t *proc ){
|
||||
|
||||
|
||||
NR_DL_FRAME_PARMS *frame_parms = &ue->frame_parms;
|
||||
@@ -130,6 +131,16 @@ void nr_fill_rx_indication(fapi_nr_rx_indication_t *rx_ind,
|
||||
LOG_E(PHY, "In %s: multiple number of DL PDUs not supported yet...\n", __FUNCTION__);
|
||||
}
|
||||
|
||||
if (pdu_type != FAPI_NR_RX_PDU_TYPE_SSB)
|
||||
trace_NRpdu(DIRECTION_DOWNLINK,
|
||||
dlsch0->harq_processes[dlsch0->current_harq_pid]->b,
|
||||
dlsch0->harq_processes[dlsch0->current_harq_pid]->TBS / 8,
|
||||
pdu_type,
|
||||
WS_C_RNTI,
|
||||
dlsch0->rnti,
|
||||
proc->frame_rx,
|
||||
proc->nr_slot_rx,
|
||||
0,0);
|
||||
switch (pdu_type){
|
||||
case FAPI_NR_RX_PDU_TYPE_SIB:
|
||||
rx_ind->rx_indication_body[n_pdus - 1].pdsch_pdu.harq_pid = dlsch0->current_harq_pid;
|
||||
@@ -478,7 +489,7 @@ int nr_ue_pdcch_procedures(uint8_t gNB_id,
|
||||
int frame_rx = proc->frame_rx;
|
||||
int nr_slot_rx = proc->nr_slot_rx;
|
||||
unsigned int dci_cnt=0;
|
||||
fapi_nr_dci_indication_t dci_ind = {0};
|
||||
fapi_nr_dci_indication_t *dci_ind = calloc(1, sizeof(*dci_ind));
|
||||
nr_downlink_indication_t dl_indication;
|
||||
|
||||
NR_UE_PDCCH *pdcch_vars = ue->pdcch_vars[proc->thread_id][gNB_id];
|
||||
@@ -677,7 +688,7 @@ int nr_ue_pdcch_procedures(uint8_t gNB_id,
|
||||
n_ss);
|
||||
#endif
|
||||
|
||||
dci_cnt = nr_dci_decoding_procedure(ue, proc, &dci_ind, rel15);
|
||||
dci_cnt = nr_dci_decoding_procedure(ue, proc, dci_ind, rel15);
|
||||
|
||||
#ifdef NR_PDCCH_SCHED_DEBUG
|
||||
LOG_I(PHY,"<-NR_PDCCH_PHY_PROCEDURES_LTE_UE (nr_ue_pdcch_procedures)-> Ending function nr_dci_decoding_procedure() -> dci_cnt=%u\n",dci_cnt);
|
||||
@@ -691,12 +702,12 @@ int nr_ue_pdcch_procedures(uint8_t gNB_id,
|
||||
ue->Mod_id,frame_rx%1024,nr_slot_rx,nr_mode_string[ue->UE_mode[gNB_id]],
|
||||
i + 1,
|
||||
dci_cnt,
|
||||
dci_ind.dci_list[i].rnti,
|
||||
dci_ind.dci_list[i].dci_format);
|
||||
dci_ind->dci_list[i].rnti,
|
||||
dci_ind->dci_list[i].dci_format);
|
||||
}
|
||||
ue->pdcch_vars[proc->thread_id][gNB_id]->dci_received += dci_cnt;
|
||||
|
||||
dci_ind.number_of_dcis = dci_cnt;
|
||||
dci_ind->number_of_dcis = dci_cnt;
|
||||
/*
|
||||
for (int i=0; i<dci_cnt; i++) {
|
||||
|
||||
@@ -734,7 +745,7 @@ int nr_ue_pdcch_procedures(uint8_t gNB_id,
|
||||
*/
|
||||
|
||||
// fill dl_indication message
|
||||
nr_fill_dl_indication(&dl_indication, &dci_ind, NULL, proc, ue, gNB_id);
|
||||
nr_fill_dl_indication(&dl_indication, dci_ind, NULL, proc, ue, gNB_id);
|
||||
// send to mac
|
||||
ue->if_inst->dl_indication(&dl_indication, NULL);
|
||||
|
||||
@@ -873,7 +884,7 @@ bool nr_ue_dlsch_procedures(PHY_VARS_NR_UE *ue,
|
||||
NR_UE_PDSCH *pdsch_vars;
|
||||
uint16_t dmrs_len = get_num_dmrs(dlsch0->harq_processes[dlsch0->current_harq_pid]->dlDmrsSymbPos);
|
||||
nr_downlink_indication_t dl_indication;
|
||||
fapi_nr_rx_indication_t rx_ind;
|
||||
fapi_nr_rx_indication_t *rx_ind = calloc(1, sizeof(*rx_ind));
|
||||
uint16_t number_pdus = 1;
|
||||
// params for UL time alignment procedure
|
||||
NR_UL_TIME_ALIGNMENT_t *ul_time_alignment = &ue->ul_time_alignment[gNB_id];
|
||||
@@ -1002,17 +1013,17 @@ bool nr_ue_dlsch_procedures(PHY_VARS_NR_UE *ue,
|
||||
|
||||
switch (pdsch) {
|
||||
case RA_PDSCH:
|
||||
nr_fill_dl_indication(&dl_indication, NULL, &rx_ind, proc, ue, gNB_id);
|
||||
nr_fill_rx_indication(&rx_ind, FAPI_NR_RX_PDU_TYPE_RAR, gNB_id, ue, dlsch0, NULL, number_pdus);
|
||||
nr_fill_dl_indication(&dl_indication, NULL, rx_ind, proc, ue, gNB_id);
|
||||
nr_fill_rx_indication(rx_ind, FAPI_NR_RX_PDU_TYPE_RAR, gNB_id, ue, dlsch0, NULL, number_pdus, proc);
|
||||
ue->UE_mode[gNB_id] = RA_RESPONSE;
|
||||
break;
|
||||
case PDSCH:
|
||||
nr_fill_dl_indication(&dl_indication, NULL, &rx_ind, proc, ue, gNB_id);
|
||||
nr_fill_rx_indication(&rx_ind, FAPI_NR_RX_PDU_TYPE_DLSCH, gNB_id, ue, dlsch0, NULL, number_pdus);
|
||||
nr_fill_dl_indication(&dl_indication, NULL, rx_ind, proc, ue, gNB_id);
|
||||
nr_fill_rx_indication(rx_ind, FAPI_NR_RX_PDU_TYPE_DLSCH, gNB_id, ue, dlsch0, NULL, number_pdus, proc);
|
||||
break;
|
||||
case SI_PDSCH:
|
||||
nr_fill_dl_indication(&dl_indication, NULL, &rx_ind, proc, ue, gNB_id);
|
||||
nr_fill_rx_indication(&rx_ind, FAPI_NR_RX_PDU_TYPE_SIB, gNB_id, ue, dlsch0, NULL, number_pdus);
|
||||
nr_fill_dl_indication(&dl_indication, NULL, rx_ind, proc, ue, gNB_id);
|
||||
nr_fill_rx_indication(rx_ind, FAPI_NR_RX_PDU_TYPE_SIB, gNB_id, ue, dlsch0, NULL, number_pdus, proc);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
||||
@@ -3193,7 +3193,7 @@ void ue_pdsch_procedures(PHY_VARS_UE *ue,
|
||||
slot = 1;
|
||||
|
||||
stop_meas(&ue->dlsch_llr_stats_parallelization[ue->current_thread_id[subframe_rx]][slot]);
|
||||
LOG_I(PHY, "[AbsSFN %d.%d] LLR Computation Symbol %d %5.2f \n",proc->frame_rx,subframe_rx,m,ue->dlsch_llr_stats_parallelization[ue->current_thread_id[subframe_rx]][slot].p_time/(cpuf*1000.0));
|
||||
LOG_D(PHY, "[AbsSFN %d.%d] LLR Computation Symbol %d %5.2f \n",proc->frame_rx,subframe_rx,m,ue->dlsch_llr_stats_parallelization[ue->current_thread_id[subframe_rx]][slot].p_time/(cpuf*1000.0));
|
||||
}
|
||||
|
||||
if(first_symbol_flag) {
|
||||
@@ -3686,6 +3686,7 @@ void *UE_thread_slot1_dl_processing(void *arg) {
|
||||
if ( (proc->sub_frame_start+1)%RX_NB_TH == 1 && threads.slot1_proc_two != -1 )
|
||||
CPU_SET(threads.slot1_proc_two, &cpuset);
|
||||
|
||||
// cppcheck-suppress moduloAlwaysTrueFalse
|
||||
if ( (proc->sub_frame_start+1)%RX_NB_TH == 2 && threads.slot1_proc_three != -1 )
|
||||
CPU_SET(threads.slot1_proc_three, &cpuset);
|
||||
|
||||
@@ -3825,7 +3826,7 @@ void *UE_thread_slot1_dl_processing(void *arg) {
|
||||
|
||||
if ( LOG_DEBUGFLAG(UE_TIMING)) {
|
||||
stop_meas(&ue->ue_front_end_per_slot_stat[ue->current_thread_id[subframe_rx]][1]);
|
||||
LOG_I(PHY, "[AbsSFN %d.%d] Slot1: FFT + Channel Estimate + Pdsch Proc Slot0 %5.2f \n",frame_rx,subframe_rx,ue->ue_front_end_per_slot_stat[ue->current_thread_id[subframe_rx]][1].p_time/(cpuf*1000.0));
|
||||
LOG_D(PHY, "[AbsSFN %d.%d] Slot1: FFT + Channel Estimate + Pdsch Proc Slot0 %5.2f \n",frame_rx,subframe_rx,ue->ue_front_end_per_slot_stat[ue->current_thread_id[subframe_rx]][1].p_time/(cpuf*1000.0));
|
||||
}
|
||||
|
||||
//wait until pdcch is decoded
|
||||
@@ -3919,7 +3920,7 @@ void *UE_thread_slot1_dl_processing(void *arg) {
|
||||
|
||||
if ( LOG_DEBUGFLAG(UE_TIMING)) {
|
||||
stop_meas(&ue->pdsch_procedures_per_slot_stat[ue->current_thread_id[subframe_rx]][1]);
|
||||
LOG_I(PHY, "[AbsSFN %d.%d] Slot1: LLR Computation %5.2f \n",frame_rx,subframe_rx,ue->pdsch_procedures_per_slot_stat[ue->current_thread_id[subframe_rx]][1].p_time/(cpuf*1000.0));
|
||||
LOG_D(PHY, "[AbsSFN %d.%d] Slot1: LLR Computation %5.2f \n",frame_rx,subframe_rx,ue->pdsch_procedures_per_slot_stat[ue->current_thread_id[subframe_rx]][1].p_time/(cpuf*1000.0));
|
||||
}
|
||||
|
||||
if (pthread_mutex_lock(&proc->mutex_slot1_dl_processing) != 0) {
|
||||
@@ -4145,7 +4146,7 @@ int phy_procedures_slot_parallelization_UE_RX(PHY_VARS_UE *ue,
|
||||
LOG_E(PHY,"[UE %d] Frame %d, subframe %d: Error in pdcch procedures\n",ue->Mod_id,frame_rx,subframe_rx);
|
||||
|
||||
if (LOG_DEBUGFLAG(UE_TIMING)) {
|
||||
LOG_I(PHY, "[AbsSFN %d.%d] Slot0: PDCCH %5.2f \n",frame_rx,subframe_rx,ue->pdcch_procedures_stat[ue->current_thread_id[subframe_rx]].p_time/(cpuf*1000.0));
|
||||
LOG_D(PHY, "[AbsSFN %d.%d] Slot0: PDCCH %5.2f \n",frame_rx,subframe_rx,ue->pdcch_procedures_stat[ue->current_thread_id[subframe_rx]].p_time/(cpuf*1000.0));
|
||||
}
|
||||
|
||||
//proc->dci_slot0_available = 1;
|
||||
@@ -4155,7 +4156,7 @@ int phy_procedures_slot_parallelization_UE_RX(PHY_VARS_UE *ue,
|
||||
//proc->dci_slot0_available=1;
|
||||
if (LOG_DEBUGFLAG(UE_TIMING)) {
|
||||
stop_meas(&ue->pdcch_procedures_stat[ue->current_thread_id[subframe_rx]]);
|
||||
LOG_I(PHY, "[AbsSFN %d.%d] Slot0: PDCCH %5.2f \n",frame_rx,subframe_rx,ue->pdcch_procedures_stat[ue->current_thread_id[subframe_rx]].p_time/(cpuf*1000.0));
|
||||
LOG_D(PHY, "[AbsSFN %d.%d] Slot0: PDCCH %5.2f \n",frame_rx,subframe_rx,ue->pdcch_procedures_stat[ue->current_thread_id[subframe_rx]].p_time/(cpuf*1000.0));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4164,7 +4165,7 @@ int phy_procedures_slot_parallelization_UE_RX(PHY_VARS_UE *ue,
|
||||
// first slot has been processed (FFTs + Channel Estimation, PCFICH/PHICH/PDCCH)
|
||||
if (LOG_DEBUGFLAG(UE_TIMING)) {
|
||||
stop_meas(&ue->ue_front_end_per_slot_stat[ue->current_thread_id[subframe_rx]][0]);
|
||||
LOG_I(PHY, "[AbsSFN %d.%d] Slot0: FFT + Channel Estimate + PCFICH/PHICH/PDCCH %5.2f \n",frame_rx,subframe_rx,
|
||||
LOG_D(PHY, "[AbsSFN %d.%d] Slot0: FFT + Channel Estimate + PCFICH/PHICH/PDCCH %5.2f \n",frame_rx,subframe_rx,
|
||||
ue->ue_front_end_per_slot_stat[ue->current_thread_id[subframe_rx]][0].p_time/(cpuf*1000.0));
|
||||
}
|
||||
|
||||
@@ -4178,7 +4179,7 @@ int phy_procedures_slot_parallelization_UE_RX(PHY_VARS_UE *ue,
|
||||
|
||||
if (LOG_DEBUGFLAG(UE_TIMING)) {
|
||||
stop_meas(&ue->ue_front_end_stat[ue->current_thread_id[subframe_rx]]);
|
||||
LOG_I(PHY, "[AbsSFN %d.%d] FULL FE Processing %5.2f \n",frame_rx,subframe_rx,ue->ue_front_end_per_slot_stat[ue->current_thread_id[subframe_rx]][0].p_time/(cpuf*1000.0));
|
||||
LOG_D(PHY, "[AbsSFN %d.%d] FULL FE Processing %5.2f \n",frame_rx,subframe_rx,ue->ue_front_end_per_slot_stat[ue->current_thread_id[subframe_rx]][0].p_time/(cpuf*1000.0));
|
||||
}
|
||||
|
||||
/**** End Subframe FE Processing ****/
|
||||
@@ -4266,7 +4267,7 @@ int phy_procedures_slot_parallelization_UE_RX(PHY_VARS_UE *ue,
|
||||
|
||||
if (LOG_DEBUGFLAG(UE_TIMING)) {
|
||||
stop_meas(&ue->pdsch_procedures_per_slot_stat[ue->current_thread_id[subframe_rx]][0]);
|
||||
LOG_I(PHY, "[AbsSFN %d.%d] Slot0: LLR Computation %5.2f \n",frame_rx,subframe_rx,ue->pdsch_procedures_per_slot_stat[ue->current_thread_id[subframe_rx]][0].p_time/(cpuf*1000.0));
|
||||
LOG_D(PHY, "[AbsSFN %d.%d] Slot0: LLR Computation %5.2f \n",frame_rx,subframe_rx,ue->pdsch_procedures_per_slot_stat[ue->current_thread_id[subframe_rx]][0].p_time/(cpuf*1000.0));
|
||||
}
|
||||
|
||||
//wait until LLR Slot1 is done
|
||||
@@ -4279,7 +4280,7 @@ int phy_procedures_slot_parallelization_UE_RX(PHY_VARS_UE *ue,
|
||||
|
||||
if (LOG_DEBUGFLAG(UE_TIMING)) {
|
||||
stop_meas(&ue->pdsch_procedures_stat[ue->current_thread_id[subframe_rx]]);
|
||||
LOG_I(PHY, "[AbsSFN %d.%d] Full LLR Computation %5.2f \n",frame_rx,subframe_rx,ue->pdsch_procedures_stat[ue->current_thread_id[subframe_rx]].p_time/(cpuf*1000.0));
|
||||
LOG_D(PHY, "[AbsSFN %d.%d] Full LLR Computation %5.2f \n",frame_rx,subframe_rx,ue->pdsch_procedures_stat[ue->current_thread_id[subframe_rx]].p_time/(cpuf*1000.0));
|
||||
}
|
||||
|
||||
//=====================================================================//
|
||||
@@ -4351,7 +4352,7 @@ int phy_procedures_slot_parallelization_UE_RX(PHY_VARS_UE *ue,
|
||||
|
||||
if (LOG_DEBUGFLAG(UE_TIMING)) {
|
||||
stop_meas(&ue->dlsch_procedures_stat[ue->current_thread_id[subframe_rx]]);
|
||||
LOG_I(PHY, "[AbsSFN %d.%d] Channel Decoder: %5.2f \n",frame_rx,subframe_rx,ue->dlsch_procedures_stat[ue->current_thread_id[subframe_rx]].p_time/(cpuf*1000.0));
|
||||
LOG_D(PHY, "[AbsSFN %d.%d] Channel Decoder: %5.2f \n",frame_rx,subframe_rx,ue->dlsch_procedures_stat[ue->current_thread_id[subframe_rx]].p_time/(cpuf*1000.0));
|
||||
}
|
||||
|
||||
// duplicate harq structure
|
||||
|
||||
@@ -115,7 +115,7 @@ void pusch_power_cntl(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uint8_
|
||||
}
|
||||
|
||||
int8_t get_PHR(uint8_t Mod_id, uint8_t CC_id,uint8_t eNB_index) {
|
||||
if(NFAPI_MODE!=NFAPI_UE_STUB_PNF)
|
||||
if(NFAPI_MODE!=NFAPI_UE_STUB_PNF && NFAPI_MODE!=NFAPI_MODE_STANDALONE_PNF)
|
||||
return PHY_vars_UE_g[Mod_id][CC_id]->ulsch[eNB_index]->PHR;
|
||||
else
|
||||
return 40; // l1l2 simulator => ideal conditions
|
||||
|
||||
@@ -56,7 +56,7 @@ struct nlmsghdr *nas_nlh_rx = NULL;
|
||||
struct iovec nas_iov_tx;
|
||||
struct iovec nas_iov_rx = {nl_rx_buf, sizeof(nl_rx_buf)};
|
||||
|
||||
int nas_sock_fd[MAX_MOBILES_PER_ENB];
|
||||
int nas_sock_fd[MAX_MOBILES_PER_ENB*2]; //Allocated for both LTE UE and NR UE.
|
||||
|
||||
int nas_sock_mbms_fd;
|
||||
|
||||
@@ -70,7 +70,7 @@ static int tun_alloc(char *dev) {
|
||||
int fd, err;
|
||||
|
||||
if( (fd = open("/dev/net/tun", O_RDWR)) < 0 ) {
|
||||
printf("[TUN] failed to open /dev/net/tun\n");
|
||||
LOG_E(PDCP, "[TUN] failed to open /dev/net/tun\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -95,15 +95,20 @@ static int tun_alloc(char *dev) {
|
||||
}
|
||||
|
||||
|
||||
int netlink_init_mbms_tun(char *ifprefix) {
|
||||
int netlink_init_mbms_tun(char *ifprefix, int id) {//for UE, id = 1, 2, ...,
|
||||
int ret;
|
||||
char ifname[64];
|
||||
|
||||
sprintf(ifname, "oaitun_%.3s1",ifprefix); // added "1": for historical reasons
|
||||
if (id > 0) {
|
||||
sprintf(ifname, "oaitun_%.3s%d", ifprefix, id-1);
|
||||
}
|
||||
else {
|
||||
sprintf(ifname, "oaitun_%.3s1", ifprefix); // added "1": for historical reasons
|
||||
}
|
||||
nas_sock_mbms_fd = tun_alloc(ifname);
|
||||
|
||||
if (nas_sock_mbms_fd == -1) {
|
||||
printf("[NETLINK] Error opening socket %s (%d:%s)\n",ifname,errno, strerror(errno));
|
||||
printf("[NETLINK] Error opening mbms socket %s (%d:%s)\n",ifname,errno, strerror(errno));
|
||||
exit(1);
|
||||
}
|
||||
|
||||
@@ -123,88 +128,36 @@ int netlink_init_mbms_tun(char *ifprefix) {
|
||||
nas_src_addr.nl_pid = 1;//getpid(); /* self pid */
|
||||
nas_src_addr.nl_groups = 0; /* not in mcast groups */
|
||||
ret = bind(nas_sock_mbms_fd, (struct sockaddr *)&nas_src_addr, sizeof(nas_src_addr));
|
||||
memset(&nas_dest_addr, 0, sizeof(nas_dest_addr));
|
||||
nas_dest_addr.nl_family = AF_NETLINK;
|
||||
nas_dest_addr.nl_pid = 0; /* For Linux Kernel */
|
||||
nas_dest_addr.nl_groups = 0; /* unicast */
|
||||
// TX PART
|
||||
nas_nlh_tx=(struct nlmsghdr *)malloc(NLMSG_SPACE(NL_MAX_PAYLOAD));
|
||||
memset(nas_nlh_tx, 0, NLMSG_SPACE(NL_MAX_PAYLOAD));
|
||||
/* Fill the netlink message header */
|
||||
nas_nlh_tx->nlmsg_len = NLMSG_SPACE(NL_MAX_PAYLOAD);
|
||||
nas_nlh_tx->nlmsg_pid = 1;//getpid(); /* self pid */
|
||||
nas_nlh_tx->nlmsg_flags = 0;
|
||||
nas_iov_tx.iov_base = (void *)nas_nlh_tx;
|
||||
nas_iov_tx.iov_len = nas_nlh_tx->nlmsg_len;
|
||||
memset(&nas_msg_tx,0,sizeof(nas_msg_tx));
|
||||
nas_msg_tx.msg_name = (void *)&nas_dest_addr;
|
||||
nas_msg_tx.msg_namelen = sizeof(nas_dest_addr);
|
||||
nas_msg_tx.msg_iov = &nas_iov_tx;
|
||||
nas_msg_tx.msg_iovlen = 1;
|
||||
// RX PART
|
||||
memset(&nas_msg_rx,0,sizeof(nas_msg_rx));
|
||||
nas_msg_rx.msg_name = (void *)&nas_src_addr;
|
||||
nas_msg_rx.msg_namelen = sizeof(nas_src_addr);
|
||||
nas_msg_rx.msg_iov = &nas_iov_rx;
|
||||
nas_msg_rx.msg_iovlen = 1;
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
int netlink_init_tun(char *ifprefix, int num_if) {
|
||||
int netlink_init_tun(char *ifprefix, int num_if, int id) {//for UE, id = 1, 2, ...,
|
||||
int ret;
|
||||
char ifname[64];
|
||||
|
||||
for (int i = 0; i < num_if; i++) {
|
||||
int begx = (id == 0) ? 0 : id - 1;
|
||||
int endx = (id == 0) ? num_if : id;
|
||||
for (int i = begx; i < endx; i++) {
|
||||
sprintf(ifname, "oaitun_%.3s%d",ifprefix,i+1);
|
||||
nas_sock_fd[i] = tun_alloc(ifname);
|
||||
|
||||
if (nas_sock_fd[i] == -1) {
|
||||
printf("[NETLINK] Error opening socket %s (%d:%s)\n",ifname,errno, strerror(errno));
|
||||
LOG_E(PDCP, "TUN: Error opening socket %s (%d:%s)\n",ifname,errno, strerror(errno));
|
||||
exit(1);
|
||||
}
|
||||
|
||||
printf("[NETLINK]Opened socket %s with fd nas_sock_fd[%d]=%d\n",
|
||||
LOG_I(PDCP, "TUN: Opened socket %s with fd nas_sock_fd[%d]=%d\n",
|
||||
ifname, i, nas_sock_fd[i]);
|
||||
ret = fcntl(nas_sock_fd[i],F_SETFL,O_NONBLOCK);
|
||||
|
||||
if (ret == -1) {
|
||||
printf("[NETLINK] Error fcntl (%d:%s)\n",errno, strerror(errno));
|
||||
LOG_E(PDCP, "TUN: Error fcntl (%d:%s)\n",errno, strerror(errno));
|
||||
|
||||
if (LINK_ENB_PDCP_TO_IP_DRIVER) {
|
||||
exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
memset(&nas_src_addr, 0, sizeof(nas_src_addr));
|
||||
nas_src_addr.nl_family = AF_NETLINK;
|
||||
nas_src_addr.nl_pid = 1;//getpid(); /* self pid */
|
||||
nas_src_addr.nl_groups = 0; /* not in mcast groups */
|
||||
ret = bind(nas_sock_fd[i], (struct sockaddr *)&nas_src_addr, sizeof(nas_src_addr));
|
||||
memset(&nas_dest_addr, 0, sizeof(nas_dest_addr));
|
||||
nas_dest_addr.nl_family = AF_NETLINK;
|
||||
nas_dest_addr.nl_pid = 0; /* For Linux Kernel */
|
||||
nas_dest_addr.nl_groups = 0; /* unicast */
|
||||
// TX PART
|
||||
nas_nlh_tx=(struct nlmsghdr *)malloc(NLMSG_SPACE(NL_MAX_PAYLOAD));
|
||||
memset(nas_nlh_tx, 0, NLMSG_SPACE(NL_MAX_PAYLOAD));
|
||||
/* Fill the netlink message header */
|
||||
nas_nlh_tx->nlmsg_len = NLMSG_SPACE(NL_MAX_PAYLOAD);
|
||||
nas_nlh_tx->nlmsg_pid = 1;//getpid(); /* self pid */
|
||||
nas_nlh_tx->nlmsg_flags = 0;
|
||||
nas_iov_tx.iov_base = (void *)nas_nlh_tx;
|
||||
nas_iov_tx.iov_len = nas_nlh_tx->nlmsg_len;
|
||||
memset(&nas_msg_tx,0,sizeof(nas_msg_tx));
|
||||
nas_msg_tx.msg_name = (void *)&nas_dest_addr;
|
||||
nas_msg_tx.msg_namelen = sizeof(nas_dest_addr);
|
||||
nas_msg_tx.msg_iov = &nas_iov_tx;
|
||||
nas_msg_tx.msg_iovlen = 1;
|
||||
// RX PART
|
||||
memset(&nas_msg_rx,0,sizeof(nas_msg_rx));
|
||||
nas_msg_rx.msg_name = (void *)&nas_src_addr;
|
||||
nas_msg_rx.msg_namelen = sizeof(nas_src_addr);
|
||||
nas_msg_rx.msg_iov = &nas_iov_rx;
|
||||
nas_msg_rx.msg_iovlen = 1;
|
||||
} /* for */
|
||||
|
||||
return 1;
|
||||
@@ -216,7 +169,7 @@ int netlink_init(void) {
|
||||
nas_sock_fd[0] = socket(PF_NETLINK, SOCK_RAW,GRAAL_NETLINK_ID);
|
||||
|
||||
if (nas_sock_fd[0] == -1) {
|
||||
printf("[NETLINK] Error opening socket %d (%d:%s)\n",nas_sock_fd[0],errno, strerror(errno));
|
||||
printf("[NETLINK] Error opening GRAAL_NETLINK_ID socket %d (%d:%s)\n",nas_sock_fd[0],errno, strerror(errno));
|
||||
|
||||
if (LINK_ENB_PDCP_TO_IP_DRIVER) {
|
||||
exit(1);
|
||||
@@ -244,6 +197,7 @@ int netlink_init(void) {
|
||||
nas_dest_addr.nl_pid = 0; /* For Linux Kernel */
|
||||
nas_dest_addr.nl_groups = 0; /* unicast */
|
||||
// TX PART
|
||||
free(nas_nlh_tx);
|
||||
nas_nlh_tx=(struct nlmsghdr *)malloc(NLMSG_SPACE(NL_MAX_PAYLOAD));
|
||||
memset(nas_nlh_tx, 0, NLMSG_SPACE(NL_MAX_PAYLOAD));
|
||||
/* Fill the netlink message header */
|
||||
@@ -266,3 +220,8 @@ int netlink_init(void) {
|
||||
return(nas_sock_fd[0]);
|
||||
}
|
||||
|
||||
void netlink_cleanup(void)
|
||||
{
|
||||
free(nas_nlh_tx);
|
||||
nas_nlh_tx = NULL;
|
||||
}
|
||||
|
||||
@@ -62,7 +62,8 @@ int multicast_link_read_data_from_sock(uint8_t eNB_flag);
|
||||
void clear_eNB_transport_info(uint8_t);
|
||||
void clear_UE_transport_info(uint8_t);
|
||||
int netlink_init(void);
|
||||
int netlink_init_tun(char *ifsuffix, int num_if);
|
||||
int netlink_init_mbms_tun(char *ifsuffix);
|
||||
int netlink_init_tun(char *ifsuffix, int num_if, int id);
|
||||
int netlink_init_mbms_tun(char *ifsuffix, int id);
|
||||
void netlink_cleanup(void);
|
||||
|
||||
#endif /* EMU_PROTO_H_ */
|
||||
|
||||
@@ -134,16 +134,16 @@ struct option * parse_oai_options(paramdef_t *options) {
|
||||
|
||||
void display_options_values(paramdef_t *options, int verbose) {
|
||||
for(paramdef_t * ptr=options; ptr->optname[0]!=0; ptr++) {
|
||||
char varText[256]="need specific display";
|
||||
char varText[256]={0};
|
||||
|
||||
if (ptr->voidptr != NULL) {
|
||||
if ( (ptr->paramflags & PARAMFLAG_BOOL) )
|
||||
strcpy(varText, *(bool *)ptr->iptr ? "True": "False" );
|
||||
else switch (ptr->type) {
|
||||
case TYPE_INT:
|
||||
sprintf(varText,"%d",*ptr->iptr);
|
||||
break;
|
||||
|
||||
case TYPE_INT:
|
||||
sprintf(varText,"%d",*ptr->iptr);
|
||||
break;
|
||||
|
||||
case TYPE_DOUBLE:
|
||||
sprintf(varText,"%.2f",*ptr->dblptr);
|
||||
break;
|
||||
@@ -157,6 +157,7 @@ void display_options_values(paramdef_t *options, int verbose) {
|
||||
break;
|
||||
|
||||
default:
|
||||
strcpy(varText,"Need specific display");
|
||||
printf("not decoded type\n");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
@@ -634,7 +634,7 @@ int main(int argc, char **argv) {
|
||||
// num_layers = 1;
|
||||
perfect_ce = 0;
|
||||
static paramdef_t options[] = {
|
||||
{ "awgn", "Use AWGN channel and not multipath", PARAMFLAG_BOOL, strptr:NULL, defintval:0, TYPE_INT, 0, NULL, NULL },
|
||||
{ "awgn", "Use AWGN channel and not multipath", PARAMFLAG_BOOL, iptr:&awgn_flag, defintval:0, TYPE_INT, 0, NULL, NULL },
|
||||
{ "Abstx", "Turns on calibration mode for abstraction.", PARAMFLAG_BOOL, iptr:&abstx, defintval:0, TYPE_INT, 0 },
|
||||
{ "bTDD", "Set the tdd configuration mode",0, iptr:&tdd_config, defintval:3, TYPE_INT, 0 },
|
||||
{ "BnbRBs", "The LTE bandwith in RBs (100 is 20MHz)",0, iptr:&N_RB_DL, defintval:25, TYPE_INT, 0 },
|
||||
|
||||
@@ -71,6 +71,7 @@
|
||||
#include <openair2/RRC/LTE/rrc_vars.h>
|
||||
|
||||
#include <executables/softmodem-common.h>
|
||||
#include <openair3/ocp-gtpu/gtp_itf.h>
|
||||
|
||||
LCHAN_DESC DCCH_LCHAN_DESC,DTCH_DL_LCHAN_DESC,DTCH_UL_LCHAN_DESC;
|
||||
rlc_info_t Rlc_info_um,Rlc_info_am_config;
|
||||
@@ -89,6 +90,13 @@ uint64_t downlink_frequency[MAX_NUM_CCs][4];
|
||||
THREAD_STRUCT thread_struct;
|
||||
nfapi_ue_release_request_body_t release_rntis;
|
||||
uint32_t N_RB_DL = 106;
|
||||
//Fixme: Uniq dirty DU instance, by global var, datamodel need better management
|
||||
instance_t DUuniqInstance=0;
|
||||
instance_t CUuniqInstance=0;
|
||||
teid_t newGtpuCreateTunnel(instance_t instance, rnti_t rnti, int incoming_bearer_id, int outgoing_bearer_id, teid_t outgoing_teid,
|
||||
transport_layer_addr_t remoteAddr, int port, gtpCallback callBack) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
// dummy functions
|
||||
int dummy_nr_ue_ul_indication(nr_uplink_indication_t *ul_info) { return(0); }
|
||||
@@ -131,12 +139,6 @@ rrc_data_ind(
|
||||
{
|
||||
}
|
||||
|
||||
int ocp_gtpv1u_create_s1u_tunnel(instance_t instance,
|
||||
const gtpv1u_enb_create_tunnel_req_t *create_tunnel_req,
|
||||
gtpv1u_enb_create_tunnel_resp_t *create_tunnel_resp) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
gtpv1u_create_s1u_tunnel(
|
||||
const instance_t instanceP,
|
||||
|
||||
@@ -34,4 +34,5 @@ void nr_fill_rx_indication(fapi_nr_rx_indication_t *rx_ind,
|
||||
PHY_VARS_NR_UE *ue,
|
||||
NR_UE_DLSCH_t *dlsch0,
|
||||
NR_UE_DLSCH_t *dlsch1,
|
||||
uint16_t n_pdus) {}
|
||||
uint16_t n_pdus,
|
||||
UE_nr_rxtx_proc_t *proc) {}
|
||||
|
||||
@@ -193,6 +193,7 @@ int main(int argc, char **argv)
|
||||
|
||||
int frame=0;
|
||||
int frame_length_complex_samples;
|
||||
__attribute__((unused))
|
||||
int frame_length_complex_samples_no_prefix;
|
||||
NR_DL_FRAME_PARMS *frame_parms;
|
||||
|
||||
|
||||
@@ -52,6 +52,7 @@
|
||||
#include <executables/softmodem-common.h>
|
||||
#include <openair2/RRC/NR_UE/rrc_defs.h>
|
||||
//#include "openair1/SIMULATION/NR_PHY/nr_dummy_functions.c"
|
||||
#include <openair3/ocp-gtpu/gtp_itf.h>
|
||||
|
||||
#define NR_PRACH_DEBUG 1
|
||||
#define PRACH_WRITE_OUTPUT_DEBUG 1
|
||||
@@ -88,6 +89,13 @@ int oai_nfapi_nr_crc_indication(nfapi_nr_crc_indication_t *ind) { return(0); }
|
||||
int oai_nfapi_nr_srs_indication(nfapi_nr_srs_indication_t *ind) { return(0); }
|
||||
int oai_nfapi_nr_uci_indication(nfapi_nr_uci_indication_t *ind) { return(0); }
|
||||
int oai_nfapi_nr_rach_indication(nfapi_nr_rach_indication_t *ind) { return(0); }
|
||||
//Fixme: Uniq dirty DU instance, by global var, datamodel need better management
|
||||
instance_t DUuniqInstance=0;
|
||||
instance_t CUuniqInstance=0;
|
||||
teid_t newGtpuCreateTunnel(instance_t instance, rnti_t rnti, int incoming_bearer_id, int outgoing_bearer_id, teid_t outgoing_teid,
|
||||
transport_layer_addr_t remoteAddr, int port, gtpCallback callBack) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
void
|
||||
rrc_data_ind(
|
||||
@@ -99,12 +107,6 @@ rrc_data_ind(
|
||||
{
|
||||
}
|
||||
|
||||
int ocp_gtpv1u_create_s1u_tunnel(instance_t instance,
|
||||
const gtpv1u_enb_create_tunnel_req_t *create_tunnel_req,
|
||||
gtpv1u_enb_create_tunnel_resp_t *create_tunnel_resp) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
gtpv1u_create_s1u_tunnel(
|
||||
const instance_t instanceP,
|
||||
|
||||
@@ -65,6 +65,7 @@
|
||||
|
||||
#include <executables/softmodem-common.h>
|
||||
#include "PHY/NR_REFSIG/ul_ref_seq_nr.h"
|
||||
#include <openair3/ocp-gtpu/gtp_itf.h>
|
||||
//#define DEBUG_ULSIM
|
||||
|
||||
LCHAN_DESC DCCH_LCHAN_DESC,DTCH_DL_LCHAN_DESC,DTCH_UL_LCHAN_DESC;
|
||||
@@ -85,6 +86,13 @@ THREAD_STRUCT thread_struct;
|
||||
nfapi_ue_release_request_body_t release_rntis;
|
||||
uint32_t N_RB_DL = 106;
|
||||
|
||||
//Fixme: Uniq dirty DU instance, by global var, datamodel need better management
|
||||
instance_t DUuniqInstance=0;
|
||||
instance_t CUuniqInstance=0;
|
||||
teid_t newGtpuCreateTunnel(instance_t instance, rnti_t rnti, int incoming_bearer_id, int outgoing_bearer_id, teid_t outgoing_teid,
|
||||
transport_layer_addr_t remoteAddr, int port, gtpCallback callBack) {
|
||||
return 0;
|
||||
}
|
||||
extern void fix_scd(NR_ServingCellConfig_t *scd);// forward declaration
|
||||
|
||||
int8_t nr_mac_rrc_data_ind_ue(const module_id_t module_id,
|
||||
@@ -120,11 +128,6 @@ rrc_data_ind(
|
||||
{
|
||||
}
|
||||
|
||||
int ocp_gtpv1u_create_s1u_tunnel(instance_t instance,
|
||||
const gtpv1u_enb_create_tunnel_req_t *create_tunnel_req,
|
||||
gtpv1u_enb_create_tunnel_resp_t *create_tunnel_resp) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
gtpv1u_create_s1u_tunnel(
|
||||
@@ -1278,8 +1281,10 @@ int main(int argc, char **argv)
|
||||
|
||||
if (n_trials == 1 && round==0) {
|
||||
#ifdef __AVX2__
|
||||
__attribute__((unused))
|
||||
int off = ((nb_rb&1) == 1)? 4:0;
|
||||
#else
|
||||
__attribute__((unused))
|
||||
int off = 0;
|
||||
#endif
|
||||
|
||||
|
||||
@@ -21,10 +21,12 @@
|
||||
|
||||
#include <time.h>
|
||||
#include <stdlib.h>
|
||||
#include <fcntl.h>
|
||||
#include <unistd.h>
|
||||
//#include "SIMULATION/TOOLS/sim.h"
|
||||
|
||||
|
||||
unsigned int s0, s1, s2, b;
|
||||
static unsigned int s0, s1, s2;
|
||||
|
||||
//----------------------------------------------
|
||||
//
|
||||
@@ -34,7 +36,7 @@ unsigned int s0, s1, s2, b;
|
||||
|
||||
unsigned int taus(void)
|
||||
{
|
||||
b = (((s0 << 13) ^ s0) >> 19);
|
||||
unsigned int b = (((s0 << 13) ^ s0) >> 19);
|
||||
s0 = (((s0 & 0xFFFFFFFE) << 12)^ b);
|
||||
b = (((s1 << 2) ^ s1) >> 25);
|
||||
s1 = (((s1 & 0xFFFFFFF8) << 4)^ b);
|
||||
@@ -50,9 +52,20 @@ void set_taus_seed(unsigned int seed_init)
|
||||
unsigned long result = 0;
|
||||
|
||||
if (seed_init == 0) {
|
||||
s0 = (unsigned int)time(NULL);
|
||||
s1 = (unsigned int)time(NULL);
|
||||
s2 = (unsigned int)time(NULL);
|
||||
unsigned int data[3];
|
||||
int fd = open("/dev/urandom", O_RDONLY);
|
||||
if (fd == -1)
|
||||
{
|
||||
abort();
|
||||
}
|
||||
if (read(fd, data, sizeof(data)) != sizeof(data))
|
||||
{
|
||||
abort();
|
||||
}
|
||||
close(fd);
|
||||
s0 = data[0];
|
||||
s1 = data[1];
|
||||
s2 = data[2];
|
||||
} else {
|
||||
/* Use reentrant version of rand48 to ensure that no conflicts with other generators occur */
|
||||
srand48_r((long int)seed_init, &buffer);
|
||||
|
||||
Reference in New Issue
Block a user