Merge branch 'develop' into integration_2021_wk13_b
This commit is contained in:
@@ -46,13 +46,13 @@ void sumUpStatsSlot(time_stats_t *res, time_stats_t src[RX_NB_TH][2], int lastAc
|
||||
}
|
||||
|
||||
double squareRoot(time_stats_t *ptr) {
|
||||
double timeBase=1/(1000*cpu_freq_GHz);
|
||||
double timeBase=1/(1000*get_cpu_freq_GHz());
|
||||
return sqrt((double)ptr->diff_square*pow(timeBase,2)/ptr->trials -
|
||||
pow((double)ptr->diff/ptr->trials*timeBase,2));
|
||||
}
|
||||
|
||||
void printDistribution(time_stats_t *ptr, varArray_t *sortedList, char *txt) {
|
||||
double timeBase=1/(1000*cpu_freq_GHz);
|
||||
double timeBase=1/(1000*get_cpu_freq_GHz());
|
||||
printf("%-43s %6.2f us (%d trials)\n",
|
||||
txt,
|
||||
(double)ptr->diff/ptr->trials*timeBase,
|
||||
@@ -69,7 +69,7 @@ void printStatIndent(time_stats_t *ptr, char *txt) {
|
||||
}
|
||||
|
||||
void printStatIndent2(time_stats_t *ptr, char *txt) {
|
||||
double timeBase=1/(1000*cpu_freq_GHz);
|
||||
double timeBase=1/(1000*get_cpu_freq_GHz());
|
||||
printf(" |__ %-34s %6.2f us (%3d trials)\n",
|
||||
txt,
|
||||
ptr->trials?((double)ptr->diff)/ptr->trials*timeBase:0,
|
||||
@@ -77,7 +77,7 @@ void printStatIndent2(time_stats_t *ptr, char *txt) {
|
||||
}
|
||||
|
||||
void printStatIndent3(time_stats_t *ptr, char *txt) {
|
||||
double timeBase=1/(1000*cpu_freq_GHz);
|
||||
double timeBase=1/(1000*get_cpu_freq_GHz());
|
||||
printf(" |__ %-30s %6.2f us (%3d trials)\n",
|
||||
txt,
|
||||
ptr->trials?((double)ptr->diff)/ptr->trials*timeBase:0,
|
||||
|
||||
@@ -65,11 +65,14 @@ void feptx_ofdm(RU_t *ru, int frame, int subframe);
|
||||
void feptx_prec(RU_t *ru, int frame, int subframe);
|
||||
|
||||
double cpuf;
|
||||
#define inMicroS(a) (((double)(a))/(cpu_freq_GHz*1000.0))
|
||||
#define inMicroS(a) (((double)(a))/(get_cpu_freq_GHz()*1000.0))
|
||||
//#define MCS_COUNT 23//added for PHY abstraction
|
||||
#include <openair1/SIMULATION/LTE_PHY/common_sim.h>
|
||||
|
||||
int otg_enabled=0;
|
||||
THREAD_STRUCT thread_struct;
|
||||
nfapi_ue_release_request_body_t release_rntis;
|
||||
|
||||
/*the following parameters are used to control the processing times calculations*/
|
||||
double t_tx_max = -1000000000; /*!< \brief initial max process time for tx */
|
||||
double t_rx_max = -1000000000; /*!< \brief initial max process time for rx */
|
||||
@@ -1179,7 +1182,7 @@ int main(int argc, char **argv) {
|
||||
DS_TDL,
|
||||
forgetting_factor,
|
||||
rx_sample_offset,
|
||||
0);
|
||||
0, 0);
|
||||
reset_meas(&eNB2UE[0]->random_channel);
|
||||
reset_meas(&eNB2UE[0]->interp_time);
|
||||
|
||||
@@ -1193,7 +1196,7 @@ int main(int argc, char **argv) {
|
||||
DS_TDL,
|
||||
forgetting_factor,
|
||||
rx_sample_offset,
|
||||
0);
|
||||
0, 0);
|
||||
reset_meas(&eNB2UE[n]->random_channel);
|
||||
reset_meas(&eNB2UE[n]->interp_time);
|
||||
}
|
||||
|
||||
@@ -988,7 +988,7 @@ int main(int argc, char **argv)
|
||||
N_RB2channel_bandwidth(eNB->frame_parms.N_RB_DL),
|
||||
forgetting_factor,
|
||||
rx_sample_offset,
|
||||
0);
|
||||
0, 0);
|
||||
|
||||
if(num_rounds>1) {
|
||||
for(n=1; n<8; n++)
|
||||
@@ -999,7 +999,7 @@ int main(int argc, char **argv)
|
||||
N_RB2channel_bandwidth(eNB->frame_parms.N_RB_DL),
|
||||
forgetting_factor,
|
||||
rx_sample_offset,
|
||||
0);
|
||||
0, 0);
|
||||
}
|
||||
|
||||
if (eNB2UE[0]==NULL) {
|
||||
|
||||
@@ -834,7 +834,7 @@ int main(int argc, char **argv) {
|
||||
N_RB2channel_bandwidth(eNB->frame_parms.N_RB_DL),
|
||||
forgetting_factor,
|
||||
rx_sample_offset,
|
||||
0);
|
||||
0, 0);
|
||||
|
||||
if(num_rounds>1) {
|
||||
for(n=1; n<4; n++)
|
||||
@@ -845,7 +845,7 @@ int main(int argc, char **argv) {
|
||||
N_RB2channel_bandwidth(eNB->frame_parms.N_RB_DL),
|
||||
forgetting_factor,
|
||||
rx_sample_offset,
|
||||
0);
|
||||
0, 0);
|
||||
}
|
||||
|
||||
if (eNB2UE[0]==NULL) {
|
||||
|
||||
@@ -1290,7 +1290,7 @@ int main(int argc, char **argv) {
|
||||
N_RB2channel_bandwidth(eNB->frame_parms.N_RB_DL),
|
||||
forgetting_factor,
|
||||
rx_sample_offset,
|
||||
0);
|
||||
0, 0);
|
||||
reset_meas(&eNB2UE[0]->random_channel);
|
||||
reset_meas(&eNB2UE[0]->interp_time);
|
||||
|
||||
@@ -1303,7 +1303,7 @@ int main(int argc, char **argv) {
|
||||
N_RB2channel_bandwidth(eNB->frame_parms.N_RB_DL),
|
||||
forgetting_factor,
|
||||
rx_sample_offset,
|
||||
0);
|
||||
0, 0);
|
||||
reset_meas(&eNB2UE[n]->random_channel);
|
||||
reset_meas(&eNB2UE[n]->interp_time);
|
||||
}
|
||||
|
||||
@@ -386,7 +386,7 @@ int main(int argc, char **argv) {
|
||||
N_RB2channel_bandwidth(eNB->frame_parms.N_RB_DL),
|
||||
0,
|
||||
0,
|
||||
0);
|
||||
0, 0);
|
||||
|
||||
if (interf1>-20)
|
||||
eNB2UE1 = new_channel_desc_scm(eNB->frame_parms.nb_antennas_tx,
|
||||
@@ -396,7 +396,7 @@ int main(int argc, char **argv) {
|
||||
N_RB2channel_bandwidth(eNB->frame_parms.N_RB_DL),
|
||||
0,
|
||||
4,
|
||||
0);
|
||||
0, 0);
|
||||
|
||||
if (interf2>-20)
|
||||
eNB2UE2 = new_channel_desc_scm(eNB->frame_parms.nb_antennas_tx,
|
||||
@@ -406,7 +406,7 @@ int main(int argc, char **argv) {
|
||||
N_RB2channel_bandwidth(eNB->frame_parms.N_RB_DL),
|
||||
0,
|
||||
8,
|
||||
0);
|
||||
0, 0);
|
||||
|
||||
if (eNB2UE==NULL) {
|
||||
msg("Problem generating channel model. Exiting.\n");
|
||||
|
||||
@@ -708,7 +708,7 @@ int main(int argc, char **argv) {
|
||||
N_RB2channel_bandwidth(eNB->frame_parms.N_RB_DL),
|
||||
0,
|
||||
0,
|
||||
0);
|
||||
0, 0);
|
||||
L1_rxtx_proc_t *proc_rxtx = (subframe == 0)? &eNB->proc.L1_proc: &eNB->proc.L1_proc_tx;
|
||||
eNB->ulsch[0] = new_eNB_ulsch(MAX_TURBO_ITERATIONS,N_RB_DL,0);
|
||||
UE->ulsch[0] = new_ue_ulsch(N_RB_DL,0);
|
||||
|
||||
@@ -343,7 +343,7 @@ int main(int argc, char **argv) {
|
||||
N_RB2channel_bandwidth(eNB->frame_parms.N_RB_UL),
|
||||
0.0,
|
||||
delay,
|
||||
0);
|
||||
0, 0);
|
||||
|
||||
if (UE2eNB==NULL) {
|
||||
msg("Problem generating channel model. Exiting.\n");
|
||||
|
||||
@@ -323,7 +323,7 @@ int main(int argc, char **argv) {
|
||||
N_RB2channel_bandwidth(eNB->frame_parms.N_RB_UL),
|
||||
0.0,
|
||||
0,
|
||||
0);
|
||||
0, 0);
|
||||
|
||||
if (UE2eNB==NULL) {
|
||||
printf("Problem generating channel model. Exiting.\n");
|
||||
|
||||
@@ -335,7 +335,7 @@ int main(int argc, char **argv) {
|
||||
N_RB2channel_bandwidth(PHY_vars_eNB->lte_frame_parms.N_RB_DL),
|
||||
0,
|
||||
0,
|
||||
0);
|
||||
0, 0);
|
||||
|
||||
if (eNB2UE==NULL) {
|
||||
msg("Problem generating channel model. Exiting.\n");
|
||||
|
||||
@@ -724,7 +724,7 @@ int main(int argc, char **argv) {
|
||||
BW,
|
||||
0,
|
||||
0,
|
||||
0);
|
||||
0, 0);
|
||||
|
||||
if (interf1>-20)
|
||||
eNB2UE1 = new_channel_desc_scm(PHY_vars_eNB->lte_frame_parms.nb_antennas_tx,
|
||||
@@ -733,7 +733,7 @@ int main(int argc, char **argv) {
|
||||
BW,
|
||||
0,
|
||||
0,
|
||||
0);
|
||||
0, 0);
|
||||
|
||||
if (interf2>-20)
|
||||
eNB2UE2 = new_channel_desc_scm(PHY_vars_eNB->lte_frame_parms.nb_antennas_tx,
|
||||
@@ -742,7 +742,7 @@ int main(int argc, char **argv) {
|
||||
BW,
|
||||
0,
|
||||
0,
|
||||
0);
|
||||
0, 0);
|
||||
|
||||
if (eNB2UE==NULL) {
|
||||
msg("Problem generating channel model. Exiting.\n");
|
||||
|
||||
@@ -57,7 +57,7 @@
|
||||
#include "executables/split_headers.h"
|
||||
|
||||
double cpuf;
|
||||
#define inMicroS(a) (((double)(a))/(cpu_freq_GHz*1000.0))
|
||||
#define inMicroS(a) (((double)(a))/(get_cpu_freq_GHz()*1000.0))
|
||||
//#define MCS_COUNT 23//added for PHY abstraction
|
||||
#include <openair1/SIMULATION/LTE_PHY/common_sim.h>
|
||||
channel_desc_t *eNB2UE[NUMBER_OF_eNB_MAX][NUMBER_OF_UE_MAX];
|
||||
@@ -70,6 +70,9 @@ node_desc_t *ue_data[NUMBER_OF_UE_MAX];
|
||||
extern uint16_t beta_ack[16],beta_ri[16],beta_cqi[16];
|
||||
//extern char* namepointer_chMag ;
|
||||
int xforms=0;
|
||||
THREAD_STRUCT thread_struct;
|
||||
nfapi_ue_release_request_body_t release_rntis;
|
||||
|
||||
FD_lte_phy_scope_enb *form_enb;
|
||||
char title[255];
|
||||
|
||||
@@ -734,7 +737,7 @@ int main(int argc, char **argv) {
|
||||
30e-9,
|
||||
forgetting_factor,
|
||||
delay,
|
||||
0);
|
||||
0, 0);
|
||||
// set Doppler
|
||||
UE2eNB->max_Doppler = maxDoppler;
|
||||
|
||||
|
||||
@@ -339,7 +339,7 @@ int main(int argc, char **argv)
|
||||
61.44e6, //N_RB2sampling_rate(N_RB_DL),
|
||||
40e6, //N_RB2channel_bandwidth(N_RB_DL),
|
||||
DS_TDL,
|
||||
0, 0, 0);
|
||||
0, 0, 0, 0);
|
||||
|
||||
if (gNB2UE == NULL) {
|
||||
printf("Problem generating channel model. Exiting.\n");
|
||||
|
||||
@@ -63,7 +63,7 @@
|
||||
//#include "openair1/SIMULATION/NR_PHY/nr_dummy_functions.c"
|
||||
#include "PHY/NR_REFSIG/ptrs_nr.h"
|
||||
#include "NR_RRCReconfiguration.h"
|
||||
#define inMicroS(a) (((double)(a))/(cpu_freq_GHz*1000.0))
|
||||
#define inMicroS(a) (((double)(a))/(get_cpu_freq_GHz()*1000.0))
|
||||
#include "SIMULATION/LTE_PHY/common_sim.h"
|
||||
|
||||
#include <openair2/LAYER2/MAC/mac_vars.h>
|
||||
@@ -83,16 +83,23 @@ uint16_t sf_ahead=4 ;
|
||||
uint16_t sl_ahead=0;
|
||||
//uint8_t nfapi_mode = 0;
|
||||
uint64_t downlink_frequency[MAX_NUM_CCs][4];
|
||||
THREAD_STRUCT thread_struct;
|
||||
nfapi_ue_release_request_body_t release_rntis;
|
||||
msc_interface_t msc_interface;
|
||||
|
||||
|
||||
// dummy functions
|
||||
int dummy_nr_ue_ul_indication(nr_uplink_indication_t *ul_info) { return(0); }
|
||||
|
||||
int8_t nr_mac_rrc_data_ind_ue(const module_id_t module_id,
|
||||
const int CC_id,
|
||||
const uint8_t gNB_index,
|
||||
const int8_t channel,
|
||||
const uint8_t* pduP,
|
||||
const sdu_size_t pdu_len)
|
||||
int8_t nr_mac_rrc_data_ind_ue(const module_id_t module_id,
|
||||
const int CC_id,
|
||||
const uint8_t gNB_index,
|
||||
const frame_t frame,
|
||||
const sub_frame_t sub_frame,
|
||||
const rnti_t rnti,
|
||||
const channel_t channel,
|
||||
const uint8_t* pduP,
|
||||
const sdu_size_t pdu_len)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
@@ -793,7 +800,7 @@ int main(int argc, char **argv)
|
||||
30e-9,
|
||||
0,
|
||||
0,
|
||||
0);
|
||||
0, 0);
|
||||
|
||||
if (gNB2UE==NULL) {
|
||||
printf("Problem generating channel model. Exiting.\n");
|
||||
|
||||
@@ -480,7 +480,7 @@ int main(int argc, char **argv)
|
||||
300e-9,
|
||||
0,
|
||||
0,
|
||||
0);
|
||||
0, 0);
|
||||
|
||||
if (gNB2UE==NULL) {
|
||||
printf("Problem generating channel model. Exiting.\n");
|
||||
|
||||
@@ -37,6 +37,7 @@
|
||||
#include "SCHED_NR_UE/phy_frame_config_nr.h"
|
||||
#include "PHY/phy_vars_nr_ue.h"
|
||||
#include "PHY/NR_REFSIG/refsig_defs_ue.h"
|
||||
#include "PHY/MODULATION/nr_modulation.h"
|
||||
#include "PHY/MODULATION/modulation_eNB.h"
|
||||
#include "PHY/MODULATION/modulation_UE.h"
|
||||
#include "PHY/INIT/phy_init.h"
|
||||
@@ -47,6 +48,7 @@
|
||||
#include "OCG_vars.h"
|
||||
#include <openair2/LAYER2/MAC/mac_vars.h>
|
||||
#include <openair2/RRC/LTE/rrc_vars.h>
|
||||
#include <openair2/RRC/NR_UE/rrc_defs.h>
|
||||
//#include "openair1/SIMULATION/NR_PHY/nr_dummy_functions.c"
|
||||
|
||||
|
||||
@@ -65,10 +67,12 @@ extern uint16_t prach_root_sequence_map0_3[838];
|
||||
openair0_config_t openair0_cfg[MAX_CARDS];
|
||||
//uint8_t nfapi_mode=0;
|
||||
uint16_t sl_ahead = 0;
|
||||
msc_interface_t msc_interface;
|
||||
|
||||
//void dump_nr_prach_config(NR_DL_FRAME_PARMS *frame_parms,uint8_t subframe);
|
||||
|
||||
/* temporary dummy implem of get_softmodem_optmask, till basic simulators implemented as device */
|
||||
msc_interface_t msc_interface;
|
||||
uint64_t get_softmodem_optmask(void) {return 0;}
|
||||
softmodem_params_t *get_softmodem_params(void) {return 0;}
|
||||
int oai_nfapi_dl_tti_req(nfapi_nr_dl_tti_request_t *dl_config_req) { return(0); }
|
||||
@@ -130,7 +134,18 @@ nr_rrc_gNB_process_GTPV1U_CREATE_TUNNEL_RESP(
|
||||
return 0;
|
||||
}
|
||||
|
||||
int8_t nr_mac_rrc_data_ind_ue(const module_id_t module_id, const int CC_id, const uint8_t gNB_index, const int8_t channel, const uint8_t* pduP, const sdu_size_t pdu_len) {return 0;}
|
||||
int8_t nr_mac_rrc_data_ind_ue(const module_id_t module_id,
|
||||
const int CC_id,
|
||||
const uint8_t gNB_index,
|
||||
const frame_t frame,
|
||||
const sub_frame_t sub_frame,
|
||||
const rnti_t rnti,
|
||||
const channel_t channel,
|
||||
const uint8_t* pduP,
|
||||
const sdu_size_t pdu_len)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
void nr_rrc_ue_generate_RRCSetupRequest(module_id_t module_id, const uint8_t gNB_index)
|
||||
{
|
||||
@@ -165,7 +180,7 @@ int main(int argc, char **argv){
|
||||
|
||||
double sigma2, sigma2_dB = 0, SNR, snr0 = -2.0, snr1 = 0.0, ue_speed0 = 0.0, ue_speed1 = 0.0;
|
||||
double **s_re, **s_im, **r_re, **r_im, iqim = 0.0, delay_avg = 0, ue_speed = 0, fs, bw;
|
||||
int i, aa, aarx, **txdata, trial, n_frames = 1, prach_start, rx_prach_start; //, ntrials=1;
|
||||
int i, l, aa, aarx, **txdata, trial, n_frames = 1, prach_start, rx_prach_start; //, ntrials=1;
|
||||
int N_RB_UL = 106, delay = 0, NCS_config = 13, rootSequenceIndex = 1, threequarter_fs = 0, mu = 1, fd_occasion = 0, loglvl = OAILOG_INFO, numRA = 0, prachStartSymbol = 0;
|
||||
uint8_t snr1set = 0, ue_speed1set = 0, transmission_mode = 1, n_tx = 1, n_rx = 1, awgn_flag = 0, msg1_frequencystart = 0, num_prach_fd_occasions = 1, prach_format=0;
|
||||
uint8_t frame = 1, slot=19, slot_gNB=19, config_index = 98, prach_sequence_length = 1, restrictedSetConfig = 0, N_dur, N_t_slot, start_symbol;
|
||||
@@ -662,7 +677,7 @@ int main(int argc, char **argv){
|
||||
DS_TDL,
|
||||
0.0,
|
||||
delay,
|
||||
0);
|
||||
0, 0);
|
||||
|
||||
if (UE2gNB==NULL) {
|
||||
printf("Problem generating channel model. Exiting.\n");
|
||||
@@ -800,7 +815,17 @@ int main(int argc, char **argv){
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
for (l = 0; l < frame_parms->symbols_per_slot; l++) {
|
||||
for (aa = 0; aa < frame_parms->nb_antennas_rx; aa++) {
|
||||
nr_slot_fep_ul(frame_parms,
|
||||
ru->common.rxdata[aa],
|
||||
ru->common.rxdataF[aa],
|
||||
l,
|
||||
slot,
|
||||
ru->N_TA_offset);
|
||||
}
|
||||
}
|
||||
|
||||
rx_nr_prach_ru(ru, prach_format, numRA, prachStartSymbol, prachOccasion, frame, slot);
|
||||
|
||||
gNB->prach_vars.rxsigF = ru->prach_rxsigF[prachOccasion];
|
||||
@@ -823,7 +848,8 @@ int main(int argc, char **argv){
|
||||
LOG_M("prachF0.m","prachF0", &gNB->prach_vars.prachF[0], N_ZC, 1, 1);
|
||||
LOG_M("rxsig0.m","rxs0", &gNB->common_vars.rxdata[0][subframe*frame_parms->samples_per_subframe], frame_parms->samples_per_subframe, 1, 1);
|
||||
LOG_M("ru_rxsig0.m","rxs0", &ru->common.rxdata[0][subframe*frame_parms->samples_per_subframe], frame_parms->samples_per_subframe, 1, 1);
|
||||
LOG_M("ru_rxsigF0.m","rxsF0", ru->prach_rxsigF[0][0], N_ZC, 1, 1);
|
||||
LOG_M("ru_rxsigF0.m","rxsF0", ru->common.rxdataF[0], frame_parms->ofdm_symbol_size*frame_parms->symbols_per_slot, 1, 1);
|
||||
LOG_M("ru_prach_rxsigF0.m","rxsF0", ru->prach_rxsigF[0][0], N_ZC, 1, 1);
|
||||
LOG_M("prach_preamble.m","prachp", &gNB->X_u[0], N_ZC, 1, 1);
|
||||
LOG_M("ue_prach_preamble.m","prachp", &UE->X_u[0], N_ZC, 1, 1);
|
||||
#endif
|
||||
|
||||
@@ -418,7 +418,7 @@ int main(int argc, char **argv)
|
||||
printf("FFO = %lf; IFO = %d\n",eps-IFO,IFO);
|
||||
}
|
||||
|
||||
UE2gNB = new_channel_desc_scm(n_tx, n_rx, channel_model, fs, bw, DS_TDL,0, 0, 0);
|
||||
UE2gNB = new_channel_desc_scm(n_tx, n_rx, channel_model, fs, bw, DS_TDL,0, 0, 0, 0);
|
||||
|
||||
if (UE2gNB==NULL) {
|
||||
printf("Problem generating channel model. Exiting.\n");
|
||||
|
||||
@@ -364,7 +364,7 @@ int main(int argc, char **argv)
|
||||
61.44e6, //N_RB2sampling_rate(N_RB_DL),
|
||||
40e6, //N_RB2channel_bandwidth(N_RB_DL),
|
||||
DS_TDL,
|
||||
0,0,0);
|
||||
0,0,0, 0);
|
||||
|
||||
if (gNB2UE == NULL) {
|
||||
printf("Problem generating channel model. Exiting.\n");
|
||||
|
||||
@@ -57,7 +57,7 @@
|
||||
#include "openair2/LAYER2/NR_MAC_gNB/mac_proto.h"
|
||||
#include "common/utils/threadPool/thread-pool.h"
|
||||
#include "PHY/NR_REFSIG/ptrs_nr.h"
|
||||
#define inMicroS(a) (((double)(a))/(cpu_freq_GHz*1000.0))
|
||||
#define inMicroS(a) (((double)(a))/(get_cpu_freq_GHz()*1000.0))
|
||||
#include "SIMULATION/LTE_PHY/common_sim.h"
|
||||
|
||||
#include <openair2/LAYER2/MAC/mac_vars.h>
|
||||
@@ -81,11 +81,25 @@ uint16_t sl_ahead=0;
|
||||
double cpuf;
|
||||
//uint8_t nfapi_mode = 0;
|
||||
uint64_t downlink_frequency[MAX_NUM_CCs][4];
|
||||
THREAD_STRUCT thread_struct;
|
||||
nfapi_ue_release_request_body_t release_rntis;
|
||||
msc_interface_t msc_interface;
|
||||
|
||||
extern void fix_scd(NR_ServingCellConfig_t *scd);// forward declaration
|
||||
|
||||
int8_t nr_mac_rrc_data_ind_ue(const module_id_t module_id, const int CC_id, const uint8_t gNB_index,
|
||||
const int8_t channel, const uint8_t* pduP, const sdu_size_t pdu_len) { return 0; }
|
||||
int8_t nr_mac_rrc_data_ind_ue(const module_id_t module_id,
|
||||
const int CC_id,
|
||||
const uint8_t gNB_index,
|
||||
const frame_t frame,
|
||||
const sub_frame_t sub_frame,
|
||||
const rnti_t rnti,
|
||||
const channel_t channel,
|
||||
const uint8_t* pduP,
|
||||
const sdu_size_t pdu_len)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
int generate_dlsch_header(unsigned char *mac_header,
|
||||
unsigned char num_sdus,
|
||||
unsigned short *sdu_lengths,
|
||||
@@ -593,7 +607,7 @@ int main(int argc, char **argv)
|
||||
sampling_frequency,
|
||||
bandwidth,
|
||||
DS_TDL,
|
||||
0, 0, 0);
|
||||
0, 0, 0, 0);
|
||||
|
||||
if (UE2gNB == NULL) {
|
||||
printf("Problem generating channel model. Exiting.\n");
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
# Channel simulation source files
|
||||
|
||||
1. [random_channel.c](../random_channel.c)
|
||||
1. [sim.h](../sim.h)
|
||||
|
||||
|
||||
|
||||
[channel simulation main page](channel_simulation.md)
|
||||
[oai Wikis home](https://gitlab.eurecom.fr/oai/openairinterface5g/wikis/home)
|
||||
@@ -0,0 +1,13 @@
|
||||
# OAI channel simulation feature
|
||||
|
||||
oai includes a channel simulation feature that any component can use to alter time domain samples of a RF channel by applying pre-defined models as defined, for example, in 3GPP TR 36.873 or TR 38.901
|
||||
|
||||
Definition, configuration and run-time modification of a channel model are implemented in common code included in UEs, gNb, eNB and used when running with the rfsimulator or the L1 simulator. Phy simulators are also using channel simulation but configuration is done via dedicated command line options. The rfsimulator is the only option to get access to all the configurations and run-time modifications features of oai channel simulation.
|
||||
|
||||
## Documentation
|
||||
|
||||
* [runtime usage](rtusage.md)
|
||||
* [developer usage](devusage.md)
|
||||
* [module architecture](arch.md)
|
||||
|
||||
[oai Wikis home](https://gitlab.eurecom.fr/oai/openairinterface5g/wikis/home)
|
||||
@@ -0,0 +1,7 @@
|
||||
### channel simulation developer usage
|
||||
|
||||
|
||||
[Configuring the channel simulation](rtusage.md)
|
||||
|
||||
[channel simulation main page](channel_simulation.md)
|
||||
[oai Wikis home](https://gitlab.eurecom.fr/oai/openairinterface5g/wikis/home)
|
||||
@@ -0,0 +1,69 @@
|
||||
## configuring the channel simulation
|
||||
Oai channel simulation is using the [config module](../../../config/config.md) to get its parameters at init time. The [telnet server](../../telnetsrv/DOC/telnetsrv.md) includes a set of commands which can be used to dynamically modify some channel model parameters
|
||||
|
||||
All channel simulation parameters are defined in the `channelmod` section. Most parameters are specific to a channel model and are only used by the rfsimulator.
|
||||
|
||||
### global parameters
|
||||
|
||||
| name | type | default | description |
|
||||
|:---:|:---:|:---:|:----|
|
||||
| `max_chan` | integer | `25` | Maximum number of channel model that can be defined in the system. Must be greater than the number of model definitions in the model list loaded at init time. |
|
||||
| `modellist` | character string | `DefaultChannelList` | Name of the channel models list to load at init time. |
|
||||
|
||||
### Model lists
|
||||
|
||||
Several model lists can be defined in the oai configuration file. One, defined by the `modellist` parameter is loaded at init time. In the configuration file each model list item describes a channel model using a group of parameters:
|
||||
|
||||
| parameter name | type | default | description |
|
||||
|:---:|:---:|:---:|:----|
|
||||
| `model name` | character string | mandatory |name of the model, as used in the code to retrieve a model definition|
|
||||
| `type` | | `AWGN` | name of the channel modelization algorithm applied on rf signal. The list of available model types can be listed via the [telnet server](../../telnetsrv/DOC/telnetsrv.md) or by entering an invalid type name |
|
||||
| `ploss_dB` | real (float) | | path loss of the channel, in dB |
|
||||
| `noise_power_dB` | real (double) | | noise of the channel in dB |
|
||||
| `forgetfact` | real (double) | | |
|
||||
| `offset` | integer | | |
|
||||
| `ds_tdl` | real double | | |
|
||||
|
||||
Channel simulation parameters can also be specified on the command line:
|
||||
|
||||
```bash
|
||||
./lte-softmodem -O ../../../ci-scripts/conf_files/enb.band7.tm1.50PRB.usrpb210.conf --noS1 --rfsim --rfsimulator.options chanmod --rfsimulator.serveraddr enb --telnetsrv --channelmod.modellist modellist_rfsimu_2 --channelmod.modellist_rfsimu_2.[1].offset 120
|
||||
```
|
||||
### Using the telnet server to modify channel simulator parameters
|
||||
The telnet server includes a `channelmod` command which can be used to dynamically modify some channel model parameters. This command is only available when channel simulation is enabled (via `rfsimulator.options chanmod` option when running the rfsimulator. `channelmod` command has its own help:
|
||||
|
||||
```
|
||||
$ telnet 127.0.0.1 9090
|
||||
Trying 127.0.0.1...
|
||||
Connected to 127.0.0.1.
|
||||
Escape character is '^]'.
|
||||
|
||||
softmodem_enb> help
|
||||
.....................................
|
||||
module 6 = channelmod:
|
||||
channelmod help
|
||||
channelmod show <predef,current>
|
||||
channelmod modify <channelid> <param> <value>
|
||||
module 7 = rfsimu:
|
||||
rfsimu setmodel <model name> <model type>
|
||||
softmodem_enb> channelmod help
|
||||
channelmod commands can be used to display or modify channel models parameters
|
||||
channelmod show predef: display predefined model algorithms available in oai
|
||||
channelmod show current: display the currently used models in the running executable
|
||||
channelmod modify <model index> <param name> <param value>: set the specified parameters in a current model to the given value
|
||||
<model index> specifies the model, the show current model command can be used to list the current models indexes
|
||||
<param name> can be one of "riceanf", "aoa", "randaoa", "ploss", "noise_power_dB", "offset", "forgetf"
|
||||
softmodem_enb>
|
||||
|
||||
```
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
The [rfsimulator documentation](../../../../targets/ARCH/rfsimulator/README.md ) has also some specific information when using the channel simulation via this tool.
|
||||
|
||||
[channel simulation main page](channel_simulation.md)
|
||||
[oai Wikis home](https://gitlab.eurecom.fr/oai/openairinterface5g/wikis/home)
|
||||
@@ -26,6 +26,7 @@
|
||||
#include "sim.h"
|
||||
|
||||
|
||||
static uint16_t LUTSin[ResolSinCos+1];
|
||||
/* linear phase noise model */
|
||||
void phase_noise(double ts, int16_t * InRe, int16_t * InIm)
|
||||
{
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -89,6 +89,7 @@ typedef struct {
|
||||
double path_loss_dB;
|
||||
///additional delay of channel in samples.
|
||||
int32_t channel_offset;
|
||||
float noise_power_dB;
|
||||
///This parameter (0...1) allows for simple 1st order temporal variation. 0 means a new channel every call, 1 means keep channel constant all the time
|
||||
double forgetting_factor;
|
||||
///needs to be set to 1 for the first call, 0 otherwise.
|
||||
@@ -106,8 +107,10 @@ typedef struct {
|
||||
unsigned int chan_idx;
|
||||
/// id of the channel modeling algorithm
|
||||
int modelid;
|
||||
/// identifies channel descriptor owner (the module which created this descriptor)
|
||||
/// identifies channel descriptor owner (the module which created this descriptor
|
||||
channelmod_moduleid_t module_id;
|
||||
/// name of this descriptor,used for model created from config file at init time
|
||||
char *model_name;
|
||||
/// flags to properly trigger memory free
|
||||
unsigned int free_flags;
|
||||
} channel_desc_t;
|
||||
@@ -241,12 +244,37 @@ typedef enum {
|
||||
|
||||
#define CONFIG_HLP_SNR "Set average SNR in dB (for --siml1 option)\n"
|
||||
#define CHANNELMOD_SECTION "channelmod"
|
||||
|
||||
/* global channel modelization parameters */
|
||||
#define CHANNELMOD_MODELLIST_PARANAME "modellist"
|
||||
|
||||
#define CHANNELMOD_HELP_MODELLIST "<list name> channel list name in config file describing the model type and its parameters\n"
|
||||
#define CHANNELMOD_PARAMS_DESC { \
|
||||
{"s" , CONFIG_HLP_SNR, PARAMFLAG_CMDLINE_NOPREFIXENABLED, dblptr:&snr_dB, defdblval:25, TYPE_DOUBLE, 0},\
|
||||
{"sinr_dB", NULL, 0 , dblptr:&sinr_dB, defdblval:0 , TYPE_DOUBLE, 0},\
|
||||
{"max_chan, CONFIG_HLP_MAX_CHAN", 0, uptr:&max_chan, defintval:10, TYPE_UINT, 0},\
|
||||
{"s" , CONFIG_HLP_SNR, PARAMFLAG_CMDLINE_NOPREFIXENABLED, dblptr:&snr_dB, defdblval:25, TYPE_DOUBLE, 0},\
|
||||
{"sinr_dB", NULL, 0, dblptr:&sinr_dB, defdblval:0 , TYPE_DOUBLE, 0},\
|
||||
{"max_chan", "Max number of runtime models", 0, uptr:&max_chan, defintval:10, TYPE_UINT, 0},\
|
||||
{CHANNELMOD_MODELLIST_PARANAME, CHANNELMOD_HELP_MODELLIST, 0, strptr:(char **)&modellist_name, defstrval:"DefaultChannelList", TYPE_STRING, 60 },\
|
||||
}
|
||||
|
||||
/* parameters for one model */
|
||||
#define CHANNELMOD_MODEL_NAME_PNAME "model_name"
|
||||
#define CHANNELMOD_MODEL_TYPE_PNAME "type"
|
||||
#define CHANNELMOD_MODEL_PL_PNAME "ploss_dB"
|
||||
#define CHANNELMOD_MODEL_NP_PNAME "noise_power_dB"
|
||||
#define CHANNELMOD_MODEL_FF_PNAME "forgetfact"
|
||||
#define CHANNELMOD_MODEL_CO_PNAME "offset"
|
||||
#define CHANNELMOD_MODEL_DT_PNAME "ds_tdl"
|
||||
|
||||
#define CHANNELMOD_MODEL_PARAMS_DESC { \
|
||||
{CHANNELMOD_MODEL_NAME_PNAME, "name of the model\n", 0, strptr:NULL , defstrval:"", TYPE_STRING, 0 },\
|
||||
{CHANNELMOD_MODEL_TYPE_PNAME, "name of the model type\n", 0, strptr:NULL , defstrval:"AWGN", TYPE_STRING, 0 },\
|
||||
{CHANNELMOD_MODEL_PL_PNAME, "channel path loss in dB\n", 0, dblptr:NULL, defdblval:0, TYPE_DOUBLE, 0 },\
|
||||
{CHANNELMOD_MODEL_NP_PNAME, "channel noise in dB\n", 0, dblptr:NULL, defdblval:-50, TYPE_DOUBLE, 0 },\
|
||||
{CHANNELMOD_MODEL_FF_PNAME, "channel forget factor ((0 to 1)\n", 0, dblptr:NULL, defdblval:0, TYPE_DOUBLE, 0 },\
|
||||
{CHANNELMOD_MODEL_CO_PNAME, "channel offset in samps\n", 0, iptr:NULL, defintval:0, TYPE_INT, 0 },\
|
||||
{CHANNELMOD_MODEL_DT_PNAME, "delay spread for TDL models\n", 0, dblptr:NULL, defdblval:0, TYPE_DOUBLE, 0 }\
|
||||
}
|
||||
|
||||
#include "platform_constants.h"
|
||||
|
||||
typedef struct {
|
||||
@@ -275,12 +303,17 @@ typedef struct {
|
||||
channel_desc_t *new_channel_desc_scm(uint8_t nb_tx,
|
||||
uint8_t nb_rx,
|
||||
SCM_t channel_model,
|
||||
double sampling_rate,
|
||||
double sampling_rate,
|
||||
double channel_bandwidth,
|
||||
double TDL_DS,
|
||||
double TDL_DS,
|
||||
double forgetting_factor,
|
||||
int32_t channel_offset,
|
||||
double path_loss_dB);
|
||||
double path_loss_dB,
|
||||
float noise_power_dB);
|
||||
|
||||
channel_desc_t *find_channel_desc_fromname( char *modelname );
|
||||
|
||||
|
||||
/**
|
||||
\brief free memory allocated for a model descriptor
|
||||
\param ch points to the model, which cannot be used after calling this fuction
|
||||
@@ -293,6 +326,12 @@ void free_channel_desc_scm(channel_desc_t *ch);
|
||||
\param module_id identifies the channel model. should be define as a macro in simu.h
|
||||
*/
|
||||
void set_channeldesc_owner(channel_desc_t *cdesc, channelmod_moduleid_t module_id);
|
||||
/**
|
||||
\brief This function set a model name to a model descriptor, can be later used to identify a allocated channel model
|
||||
\param cdesc points to the model descriptor
|
||||
\param module_name is the C string to use as model name for the channel pointed by cdesc
|
||||
*/
|
||||
void set_channeldesc_name(channel_desc_t *cdesc,char *modelname);
|
||||
/** \fn void random_channel(channel_desc_t *desc)
|
||||
\brief This routine generates a random channel response (time domain) according to a tapped delay line model.
|
||||
\param desc Pointer to the channel descriptor
|
||||
@@ -452,11 +491,11 @@ void multipath_tv_channel(channel_desc_t *desc,
|
||||
/**@} */
|
||||
/**@} */
|
||||
|
||||
int modelid_fromname(char *modelname);
|
||||
int modelid_fromstrtype(char *modeltype);
|
||||
double channelmod_get_snr_dB(void);
|
||||
double channelmod_get_sinr_dB(void);
|
||||
void init_channelmod(void) ;
|
||||
|
||||
int load_channellist(uint8_t nb_tx, uint8_t nb_rx, double sampling_rate, double channel_bandwidth) ;
|
||||
double N_RB2sampling_rate(uint16_t N_RB);
|
||||
double N_RB2channel_bandwidth(uint16_t N_RB);
|
||||
|
||||
@@ -468,7 +507,6 @@ double N_RB2channel_bandwidth(uint16_t N_RB);
|
||||
*/
|
||||
//look-up table for the sine (cosine) function
|
||||
#define ResolSinCos 100
|
||||
uint16_t LUTSin[ResolSinCos+1];
|
||||
void InitSinLUT( void );
|
||||
void phase_noise(double ts, int16_t * InRe, int16_t * InIm);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user