Commit 4d21a590 authored by masayuki.harada's avatar masayuki.harada

Merge branch 'develop-SA-CBRA' into integration_w5GC_CBRA

# Conflicts:
#	openair2/GNB_APP/gnb_paramdef.h
#	openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c
#	openair2/RRC/NR/rrc_gNB.c
#	openair2/RRC/NR/rrc_gNB_nsa.c
parents 4344ec94 56673386
......@@ -23,6 +23,7 @@ gNBs =
ssb_SubcarrierOffset = 0;
pdsch_AntennaPorts = 1;
pusch_AntennaPorts = 1;
servingCellConfigCommon = (
{
......@@ -46,7 +47,7 @@ gNBs =
#initialDownlinkBWP
#genericParameters
# this is RBstart=41,L=24 (275*(L-1))+RBstart
initialDLBWPlocationAndBandwidth = 6366;
initialDLBWPlocationAndBandwidth = 6368;
# subcarrierSpacing
# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120
initialDLBWPsubcarrierSpacing = 1;
......@@ -89,7 +90,7 @@ gNBs =
pMax = 20;
#initialUplinkBWP
#genericParameters
initialULBWPlocationAndBandwidth = 6366;
initialULBWPlocationAndBandwidth = 6368;
# subcarrierSpacing
# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120
initialULBWPsubcarrierSpacing = 1;
......@@ -240,7 +241,7 @@ L1s = (
RUs = (
{
local_rf = "yes"
local_rf = "yes"
nb_tx = 1
nb_rx = 1
att_tx = 0
......@@ -249,12 +250,12 @@ RUs = (
max_pdschReferenceSignalPower = -27;
max_rxgain = 75;
eNB_instances = [0];
##beamforming 1x2 matrix: 1 layer x 2 antennas
## beamforming 1x2 matrix: 1 layer x 2 antennas
bf_weights = [0x00007fff, 0x0000];
##beamforming 1x4 matrix: 1 layer x 4 antennas
## beamforming 1x4 matrix: 1 layer x 4 antennas
#bf_weights = [0x00007fff, 0x0000,0x0000, 0x0000];
## beamforming 2x2 matrix:
# bf_weights = [0x00007fff, 0x00000000, 0x00000000, 0x00007fff];
#bf_weights = [0x00007fff, 0x00000000, 0x00000000, 0x00007fff];
## beamforming 4x4 matrix:
#bf_weights = [0x00007fff, 0x0000, 0x0000, 0x0000, 0x00000000, 0x00007fff, 0x0000, 0x0000, 0x0000, 0x0000, 0x00007fff, 0x0000, 0x0000, 0x0000, 0x0000, 0x00007fff];
......
......@@ -48,7 +48,7 @@ gNBs =
#initialDownlinkBWP
#genericParameters
# this is RBstart=84,L=13 (275*(L-1))+RBstart
initialDLBWPlocationAndBandwidth = 6366; //28875; //6366; #6407; #3384;
initialDLBWPlocationAndBandwidth = 6368;
# subcarrierSpacing
# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120
initialDLBWPsubcarrierSpacing = 1;
......@@ -90,7 +90,7 @@ gNBs =
pMax = 20;
#initialUplinkBWP
#genericParameters
initialULBWPlocationAndBandwidth = 6366; //28875; //6366; #6407; #3384;
initialULBWPlocationAndBandwidth = 6368;
# subcarrierSpacing
# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120
initialULBWPsubcarrierSpacing = 1;
......
......@@ -832,7 +832,7 @@ add_library(F1AP
# Hardware dependant options
###################################
add_list1_option(NB_ANTENNAS_RX "2" "Number of antennas in reception" "1" "2" "4")
add_list1_option(NB_ANTENNAS_RX "4" "Number of antennas in reception" "1" "2" "4")
add_list1_option(NB_ANTENNAS_TX "4" "Number of antennas in transmission" "1" "2" "4")
add_list2_option(RF_BOARD "EXMIMO" "RF head type" "None" "OAI_USRP" "OAI_BLADERF" "OAI_LMSSDR" "OAI_SIMU")
......
......@@ -302,6 +302,9 @@ const char* eurecomFunctionsNames[] = {
/* PHY signals */
"ue_synch",
"ue_slot_fep",
"ue_slot_fep_pdcch",
"ue_slot_fep_pbch",
"ue_slot_fep_pdsch",
"ue_slot_fep_mbsfn",
"ue_slot_fep_mbsfn_khz_1dot25",
"ue_rrc_measurements",
......@@ -390,6 +393,8 @@ const char* eurecomFunctionsNames[] = {
"rx_pmch",
"rx_pmch_khz_1dot25",
"pdsch_procedures",
"pdsch_procedures_crnti",
//"dlsch_procedures_crnti",
"pdsch_procedures_si",
"pdsch_procedures_p",
"pdsch_procedures_ra",
......
......@@ -283,6 +283,9 @@ typedef enum {
/* PHY signals */
VCD_SIGNAL_DUMPER_FUNCTIONS_UE_SYNCH,
VCD_SIGNAL_DUMPER_FUNCTIONS_UE_SLOT_FEP,
VCD_SIGNAL_DUMPER_FUNCTIONS_UE_SLOT_FEP_PDCCH,
VCD_SIGNAL_DUMPER_FUNCTIONS_UE_SLOT_FEP_PBCH,
VCD_SIGNAL_DUMPER_FUNCTIONS_UE_SLOT_FEP_PDSCH,
VCD_SIGNAL_DUMPER_FUNCTIONS_UE_SLOT_FEP_MBSFN,
VCD_SIGNAL_DUMPER_FUNCTIONS_UE_SLOT_FEP_MBSFN_KHZ_1DOT25,
VCD_SIGNAL_DUMPER_FUNCTIONS_UE_RRC_MEASUREMENTS,
......@@ -371,9 +374,11 @@ typedef enum {
VCD_SIGNAL_DUMPER_FUNCTIONS_RX_PMCH,
VCD_SIGNAL_DUMPER_FUNCTIONS_RX_PMCH_KHZ_1DOT25,
VCD_SIGNAL_DUMPER_FUNCTIONS_PDSCH_PROC,
VCD_SIGNAL_DUMPER_FUNCTIONS_PDSCH_PROC_C,
VCD_SIGNAL_DUMPER_FUNCTIONS_PDSCH_PROC_SI,
VCD_SIGNAL_DUMPER_FUNCTIONS_PDSCH_PROC_P,
VCD_SIGNAL_DUMPER_FUNCTIONS_PDSCH_PROC_RA,
//VCD_SIGNAL_DUMPER_FUNCTIONS_DLSCH_PROC_C,
VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_UE_CONFIG_SIB2,
VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_CONFIG_SIB1_ENB,
VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_CONFIG_SIB2_ENB,
......
......@@ -73,7 +73,7 @@ typedef struct {
} T_cache_t;
/* number of VCD functions (to be kept up to date! see in T_messages.txt) */
#define VCD_NUM_FUNCTIONS (269)
#define VCD_NUM_FUNCTIONS (273)
/* number of VCD variables (to be kept up to date! see in T_messages.txt) */
#define VCD_NUM_VARIABLES (187)
......
......@@ -2411,6 +2411,21 @@ ID = VCD_FUNCTION_UE_SLOT_FEP
GROUP = ALL:VCD:UE:VCD_FUNCTION
FORMAT = int,value
VCD_NAME = ue_slot_fep
ID = VCD_FUNCTION_UE_SLOT_FEP_PDCCH
DESC = VCD function UE_SLOT_FEP_PDCCH
GROUP = ALL:VCD:UE:VCD_FUNCTION
FORMAT = int,value
VCD_NAME = ue_slot_fep_pdcch
ID = VCD_FUNCTION_UE_SLOT_FEP_PBCH
DESC = VCD function UE_SLOT_FEP_PBCH
GROUP = ALL:VCD:UE:VCD_FUNCTION
FORMAT = int,value
VCD_NAME = ue_slot_fep_pbch
ID = VCD_FUNCTION_UE_SLOT_FEP_PDSCH
DESC = VCD function UE_SLOT_FEP_PDSCH
GROUP = ALL:VCD:UE:VCD_FUNCTION
FORMAT = int,value
VCD_NAME = ue_slot_fep_pdsch
ID = VCD_FUNCTION_UE_SLOT_FEP_MBSFN
DESC = VCD function UE_SLOT_FEP_MBSFN
GROUP = ALL:VCD:UE:VCD_FUNCTION
......@@ -2851,6 +2866,11 @@ ID = VCD_FUNCTION_PDSCH_PROC
GROUP = ALL:VCD:UE:VCD_FUNCTION
FORMAT = int,value
VCD_NAME = pdsch_procedures
ID = VCD_FUNCTION_PDSCH_PROC_C
DESC = VCD function PDSCH_PROC_C
GROUP = ALL:VCD:UE:VCD_FUNCTION
FORMAT = int,value
VCD_NAME = pdsch_procedures_crnti
ID = VCD_FUNCTION_PDSCH_PROC_SI
DESC = VCD function PDSCH_PROC_SI
GROUP = ALL:VCD:UE:VCD_FUNCTION
......
......@@ -339,7 +339,9 @@ extern "C" {
int itti_create_queue(const task_info_t *taskInfo) {
pthread_mutex_lock (&lock_nb_queues);
int newQueue=nb_queues++;
AssertFatal(tasks=(task_list_t **) realloc(tasks, nb_queues * sizeof(*tasks)),"");
task_list_t **new_tasks = (task_list_t **)realloc(tasks, nb_queues * sizeof(*tasks));
AssertFatal(new_tasks != NULL, "could not realloc() tasks list");
tasks = new_tasks;
tasks[newQueue]= new task_list_t;
pthread_mutex_unlock (&lock_nb_queues);
LOG_I(TMR,"Starting itti queue: %s as task %d\n", taskInfo->name, newQueue);
......
......@@ -250,13 +250,14 @@ void rx_func(void *param) {
L1_nr_prach_procedures(gNB,frame_rx,slot_rx);
//apply the rx signal rotation here
apply_nr_rotation_ul(&gNB->frame_parms,
gNB->common_vars.rxdataF[0],
slot_rx,
0,
gNB->frame_parms.Ncp==EXTENDED?12:14,
gNB->frame_parms.ofdm_symbol_size);
for (int aa = 0; aa < gNB->frame_parms.nb_antennas_rx; aa++) {
apply_nr_rotation_ul(&gNB->frame_parms,
gNB->common_vars.rxdataF[aa],
slot_rx,
0,
gNB->frame_parms.Ncp==EXTENDED?12:14,
gNB->frame_parms.ofdm_symbol_size);
}
phy_procedures_gNB_uespec_RX(gNB, frame_rx, slot_rx);
}
......
......@@ -686,13 +686,13 @@ void *UE_thread(void *arg) {
if (flags || IS_SOFTMODEM_RFSIM)
AssertFatal( writeBlockSize ==
UE->rfdevice.trx_write_func(&UE->rfdevice,
writeTimestamp,
txp,
writeBlockSize,
UE->frame_parms.nb_antennas_tx,
flags),"");
UE->rfdevice.trx_write_func(&UE->rfdevice,
writeTimestamp,
txp,
writeBlockSize,
UE->frame_parms.nb_antennas_tx,
flags),"");
for (int i=0; i<UE->frame_parms.nb_antennas_tx; i++)
memset(txp[i], 0, writeBlockSize);
......
......@@ -144,7 +144,7 @@ int test_ldpc(short No_iteration,
t_nrLDPC_procBuf nrLDPC_procBuf;
t_nrLDPC_procBuf* p_nrLDPC_procBuf = &nrLDPC_procBuf;
t_nrLDPC_time_stats decoder_profiler;
t_nrLDPC_time_stats decoder_profiler = {0};
t_nrLDPC_time_stats* p_decoder_profiler =&decoder_profiler ;
int32_t n_iter = 0;
......
......@@ -125,7 +125,7 @@ int nr_phy_init_RU(RU_t *ru) {
int beam_count = 0;
if (ru->nb_tx>1) {//Enable beamforming when nb_tx > 1
for (p=0;p<ru->nb_log_antennas;p++) {
if ((fp->L_ssb >> (63-p)) & 0x01)//64 bit-map with the MSB @2⁶³ corresponds to SSB ssb_index 0
//if ((fp->L_ssb >> (63-p)) & 0x01)//64 bit-map with the MSB @2⁶³ corresponds to SSB ssb_index 0
beam_count++;
}
AssertFatal(ru->nb_bfw==(beam_count*ru->nb_tx),"Number of beam weights from config file is %d while the expected number is %d",ru->nb_bfw,(beam_count*ru->nb_tx));
......@@ -133,7 +133,7 @@ int nr_phy_init_RU(RU_t *ru) {
int l_ind = 0;
for (i=0; i<RC.nb_nr_L1_inst; i++) {
for (p=0;p<ru->nb_log_antennas;p++) {
if ((fp->L_ssb >> (63-p)) & 0x01) {
//if ((fp->L_ssb >> (63-p)) & 0x01) {
ru->beam_weights[i][p] = (int32_t **)malloc16_clear(ru->nb_tx*sizeof(int32_t*));
for (j=0; j<ru->nb_tx; j++) {
ru->beam_weights[i][p][j] = (int32_t *)malloc16_clear(fp->ofdm_symbol_size*sizeof(int32_t));
......@@ -142,8 +142,8 @@ int nr_phy_init_RU(RU_t *ru) {
//printf("Beam Weight %08x for beam %d and tx %d\n",ru->bw_list[i][l_ind],p,j);
l_ind++;
} // for j
} // for p
}
//}
} // for p
} //for i
}
} // !=IF5
......
This diff is collapsed.
......@@ -204,9 +204,9 @@ int nr_init_frame_parms(nfapi_nr_config_request_scf_t* cfg,
fp->slots_per_frame = 10* fp->slots_per_subframe;
fp->nb_antenna_ports_gNB = cfg->carrier_config.num_tx_ant.value;// It corresponds to pdsch_AntennaPorts
fp->nb_antenna_ports_gNB = 1; // It corresponds to the number of common antenna ports
fp->nb_antennas_rx = cfg->carrier_config.num_rx_ant.value; // It denotes the number of rx antennas at gNB
fp->nb_antennas_tx = 1; // It corresponds to the number of UE Tx antennas
fp->nb_antennas_tx = cfg->carrier_config.num_tx_ant.value; // It corresponds to pdsch_AntennaPorts
fp->symbols_per_slot = ((Ncp == NORMAL)? 14 : 12); // to redefine for different slot formats
fp->samples_per_subframe_wCP = fp->ofdm_symbol_size * fp->symbols_per_slot * fp->slots_per_subframe;
......@@ -254,6 +254,11 @@ int nr_init_frame_parms_ue(NR_DL_FRAME_PARMS *fp,
uint8_t Nid_cell = 0;
int Ncp = NORMAL;
if(fp->nb_antennas_rx == 0)
fp->nb_antennas_rx = 1;
if(fp->nb_antennas_tx == 0)
fp->nb_antennas_tx = 1;
// default values until overwritten by RRCConnectionReconfiguration
fp->nb_antenna_ports_gNB = nb_ant_ports_gNB;
fp->tdd_config = tdd_cfg;
......
......@@ -145,7 +145,8 @@ int nr_beam_precoding(int32_t **txdataF,
int slot,
int symbol,
int aa,
int nb_antenna_ports)
int nb_antenna_ports,
int offset)
{
......@@ -155,14 +156,14 @@ int nr_beam_precoding(int32_t **txdataF,
memset(&txdataF_BF[aa][symbol*frame_parms->ofdm_symbol_size],0,sizeof(int32_t)*(frame_parms->ofdm_symbol_size));
for (p=0; p<nb_antenna_ports; p++) {
if ((frame_parms->L_ssb >> (63-p)) & 0x01) {
multadd_cpx_vector((int16_t*)&txdataF[p][symbol*frame_parms->ofdm_symbol_size],
//if ((frame_parms->L_ssb >> (63-p)) & 0x01) {
multadd_cpx_vector((int16_t*)&txdataF[p][(symbol*frame_parms->ofdm_symbol_size)+offset],
(int16_t*)beam_weights[p][aa],
(int16_t*)&txdataF_BF[aa][symbol*frame_parms->ofdm_symbol_size],
0,
frame_parms->ofdm_symbol_size,
15);
}
//}
}
return 0;
}
This diff is collapsed.
......@@ -28,7 +28,13 @@
#include "PHY/NR_UE_TRANSPORT/nr_transport_ue.h"
#define DMRS_MOD_ORDER 2
/*Precoding matices: W[pmi][antenna_port][layer]*/
extern char nr_W_1l_2p[6][2][1];
extern char nr_W_2l_2p[3][2][2];
extern char nr_W_1l_4p[28][4][1];
extern char nr_W_2l_4p[22][4][2];
extern char nr_W_3l_4p[7][4][3];
extern char nr_W_4l_4p[5][4][4];
/*! \brief Perform NR modulation. TS 38.211 V15.4.0 subclause 5.1
@param[in] in, Pointer to input bits
@param[in] length, size of input bits
......@@ -98,7 +104,8 @@ int nr_beam_precoding(int32_t **txdataF,
int slot,
int symbol,
int aa,
int nb_antenna_ports
int nb_antenna_ports,
int offset
);
void apply_nr_rotation(NR_DL_FRAME_PARMS *fp,
......@@ -116,4 +123,14 @@ void apply_nr_rotation_ul(NR_DL_FRAME_PARMS *frame_parms,
int first_symbol,
int nsymb,
int length);
/*! \brief Perform NR precoding. TS 38.211 V15.4.0 subclause 6.3.1.5
@param[in] datatx_F_precoding, Pointer to n_layers*re data array
@param[in] prec_matrix, Pointer to precoding matrix
@param[in] n_layers, number of DLSCH layers
*/
int nr_layer_precoder(int16_t **datatx_F_precoding,
char *prec_matrix,
uint8_t n_layers,
int32_t re_offset);
#endif
......@@ -75,7 +75,7 @@ int nr_pusch_channel_estimation(PHY_VARS_gNB *gNB,
symbol_offset = gNB->frame_parms.ofdm_symbol_size*symbol;
k = bwp_start_subcarrier;
int re_offset = k;
int re_offset;
uint16_t nb_rb_pusch = pusch_pdu->rb_size;
......@@ -172,6 +172,7 @@ int nr_pusch_channel_estimation(PHY_VARS_gNB *gNB,
pil = (int16_t *)&pilot[0];
rxF = (int16_t *)&rxdataF[aarx][(symbol_offset+k+nushift)];
ul_ch = (int16_t *)&ul_ch_estimates[aarx][ch_offset];
re_offset = k;
memset(ul_ch,0,4*(gNB->frame_parms.ofdm_symbol_size));
......
This diff is collapsed.
......@@ -61,10 +61,8 @@ void free_gNB_dlsch(NR_gNB_DLSCH_t **dlschptr, uint16_t N_RB)
if (N_RB != 273) {
a_segments = a_segments*N_RB;
a_segments = a_segments/273 +1;
}
}
#ifdef DEBUG_DLSCH_FREE
LOG_D(PHY,"Freeing dlsch %p\n",dlsch);
#endif
......@@ -133,7 +131,7 @@ NR_gNB_DLSCH_t *new_gNB_dlsch(NR_DL_FRAME_PARMS *frame_parms,
if (N_RB != 273) {
a_segments = a_segments*N_RB;
a_segments = a_segments/273 +1;
}
}
uint16_t dlsch_bytes = a_segments*1056; // allocated bytes per segment
......@@ -145,31 +143,30 @@ NR_gNB_DLSCH_t *new_gNB_dlsch(NR_DL_FRAME_PARMS *frame_parms,
dlsch->Mdlharq = Mdlharq;
dlsch->Mlimit = 4;
dlsch->Nsoft = Nsoft;
for (layer=0; layer<NR_MAX_NB_LAYERS; layer++) {
dlsch->ue_spec_bf_weights[layer] = (int32_t **)malloc16(64 * sizeof(int32_t *));
dlsch->ue_spec_bf_weights[layer] = (int32_t**)malloc16(64*sizeof(int32_t*));
for (aa = 0; aa < 64; aa++) {
dlsch->ue_spec_bf_weights[layer][aa] = (int32_t *)malloc16(OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES * sizeof(int32_t));
for (re = 0; re < OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES; re++) {
for (aa=0; aa<64; aa++) {
dlsch->ue_spec_bf_weights[layer][aa] = (int32_t *)malloc16(OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES*sizeof(int32_t));
for (re=0;re<OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES; re++) {
dlsch->ue_spec_bf_weights[layer][aa][re] = 0x00007fff;
}
}
dlsch->txdataF[layer] =
(int32_t *)malloc16((NR_MAX_PDSCH_ENCODED_LENGTH / NR_MAX_NB_LAYERS)
* sizeof(int32_t)); // NR_MAX_NB_LAYERS is already included in NR_MAX_PDSCH_ENCODED_LENGTH
dlsch->txdataF[layer] = (int32_t *)malloc16((NR_MAX_PDSCH_ENCODED_LENGTH/NR_MAX_NB_LAYERS)*sizeof(int32_t)); // NR_MAX_NB_LAYERS is already included in NR_MAX_PDSCH_ENCODED_LENGTH
dlsch->txdataF_precoding[layer] = (int32_t *)malloc16(2*14*frame_parms->ofdm_symbol_size*sizeof(int32_t));
}
for (int q = 0; q < NR_MAX_NB_CODEWORDS; q++)
dlsch->mod_symbs[q] = (int32_t *)malloc16(NR_MAX_PDSCH_ENCODED_LENGTH * sizeof(int32_t));
for (int q=0; q<NR_MAX_NB_CODEWORDS; q++)
dlsch->mod_symbs[q] = (int32_t *)malloc16(NR_MAX_PDSCH_ENCODED_LENGTH*sizeof(int32_t));
dlsch->calib_dl_ch_estimates = (int32_t **)malloc16(64 * sizeof(int32_t *));
for (aa = 0; aa < 64; aa++) {
dlsch->calib_dl_ch_estimates[aa] = (int32_t *)malloc16(OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES * sizeof(int32_t));
dlsch->calib_dl_ch_estimates = (int32_t**)malloc16(64*sizeof(int32_t*));
for (aa=0; aa<64; aa++) {
dlsch->calib_dl_ch_estimates[aa] = (int32_t *)malloc16(OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES*sizeof(int32_t));
}
for (i = 0; i < 20; i++) {
for (i=0; i<20; i++) {
dlsch->harq_ids[0][i] = 0;
dlsch->harq_ids[1][i] = 0;
}
......@@ -268,7 +265,6 @@ int nr_dlsch_encoding(PHY_VARS_gNB *gNB,
float Coderate = 0.0;
uint8_t Nl = 4;
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_gNB_DLSCH_ENCODING, VCD_FUNCTION_IN);
A = rel15->TBSize[0]<<3;
......@@ -304,7 +300,7 @@ int nr_dlsch_encoding(PHY_VARS_gNB *gNB,
a[2+(A>>3)] = ((uint8_t*)&crc)[0];
//printf("CRC %x (A %d)\n",crc,A);
//printf("a0 %d a1 %d a2 %d\n", a[A>>3], a[1+(A>>3)], a[2+(A>>3)]);
harq->B = A+24;
// harq->b = a;
......@@ -323,7 +319,7 @@ int nr_dlsch_encoding(PHY_VARS_gNB *gNB,
a[1+(A>>3)] = ((uint8_t*)&crc)[0];
//printf("CRC %x (A %d)\n",crc,A);
//printf("a0 %d a1 %d \n", a[A>>3], a[1+(A>>3)]);
harq->B = A+16;
// harq->b = a;
......@@ -339,17 +335,17 @@ int nr_dlsch_encoding(PHY_VARS_gNB *gNB,
Coderate = (float) R /(float) 1024;
else // to scale for mcs 20 and 26 in table 5.1.3.1-2 which are decimal and input 2* in nr_tbs_tools
Coderate = (float) R /(float) 2048;
if ((A <=292) || ((A<=3824) && (Coderate <= 0.6667)) || Coderate <= 0.25)
harq->BG = 2;
else
harq->BG = 1;
start_meas(dlsch_segmentation_stats);
Kb = nr_segmentation(harq->b, harq->c, harq->B, &harq->C, &harq->K, Zc, &harq->F, harq->BG);
stop_meas(dlsch_segmentation_stats);
F = harq->F;
Kr = harq->K;
#ifdef DEBUG_DLSCH_CODING
uint16_t Kr_bytes;
......@@ -357,7 +353,7 @@ int nr_dlsch_encoding(PHY_VARS_gNB *gNB,
#endif
//printf("segment Z %d k %d Kr %d BG %d C %d\n", *Zc,harq->K,Kr,BG,harq->C);
for (r=0; r<harq->C; r++) {
//d_tmp[r] = &harq->d[r][0];
//channel_input[r] = &harq->d[r][0];
......@@ -369,7 +365,7 @@ int nr_dlsch_encoding(PHY_VARS_gNB *gNB,
LOG_D(PHY,"%d ", harq->c[r][cnt]);
}
LOG_D(PHY,"\n");
#endif
//ldpc_encoder_orig((unsigned char*)harq->c[r],harq->d[r],*Zc,Kb,Kr,BG,0);
//ldpc_encoder_optim((unsigned char*)harq->c[r],(unsigned char*)&harq->d[r][0],*Zc,Kb,Kr,BG,NULL,NULL,NULL,NULL);
......@@ -380,23 +376,22 @@ int nr_dlsch_encoding(PHY_VARS_gNB *gNB,
impp.tinput = tinput;
impp.tparity = tparity;
impp.toutput = toutput;
for(int j=0;j<(harq->C/8+1);j++) {
impp.macro_num=j;
nrLDPC_encoder(harq->c,harq->d,*Zc,Kb,Kr,harq->BG,&impp);
}
#ifdef DEBUG_DLSCH_CODING
write_output("enc_input0.m","enc_in0",&harq->c[0][0],Kr_bytes,1,4);
write_output("enc_output0.m","enc0",&harq->d[0][0],(3*8*Kr_bytes)+12,1,4);
#endif
F = harq->F;
Kr = harq->K;
for (r=0; r<harq->C; r++) {
if (F>0) {
for (int k=(Kr-F-2*(*Zc)); k<Kr-2*(*Zc); k++) {
// writing into positions d[r][k-2Zc] as in clause 5.3.2 step 2) in 38.212
......@@ -405,15 +400,13 @@ int nr_dlsch_encoding(PHY_VARS_gNB *gNB,
//printf("r %d filler bits [%d] = %d \n", r,k, harq->d[r][k]);
}
}
#ifdef DEBUG_DLSCH_CODING
LOG_D(PHY,"rvidx in encoding = %d\n", rel15->rvIndex[0]);
#endif
E = nr_get_E(G, harq->C, mod_order, rel15->nrOfLayers, r);
//#ifdef DEBUG_DLSCH_CODING
LOG_D(PHY,"Rate Matching, Code segment %d/%d (coded bits (G) %u, E %d, Filler bits %d, Filler offset %d mod_order %d, nb_rb %d)...\n",
r,
......@@ -423,13 +416,13 @@ int nr_dlsch_encoding(PHY_VARS_gNB *gNB,
F,
Kr-F-2*(*Zc),
mod_order,nb_rb);
// for tbslbrm calculation according to 5.4.2.1 of 38.212
if (rel15->nrOfLayers < Nl)
Nl = rel15->nrOfLayers;
Tbslbrm = nr_compute_tbslbrm(rel15->mcsTable[0],nb_rb,Nl);
start_meas(dlsch_rate_matching_stats);
nr_rate_matching_ldpc(Ilbrm,
Tbslbrm,
......
......@@ -320,7 +320,7 @@ void nr_processULSegment(void* arg) {
Kr_bytes = Kr>>3;
K_bits_F = Kr-ulsch_harq->F;
t_nrLDPC_time_stats procTime;
t_nrLDPC_time_stats procTime = {0};
t_nrLDPC_time_stats* p_procTime = &procTime ;
//start_meas(&phy_vars_gNB->ulsch_deinterleaving_stats);
......
......@@ -345,7 +345,9 @@ void nr_ulsch_extract_rbs_single(int32_t **rxdataF,
n = 0;
k_prime = 0;
rxF_ext_index = ul_ch0_ext_index = ul_ch0_index = 0; /* In RX Antenna(aarx) loop, Reset the index */
rxF_ext_index = 0;
ul_ch0_ext_index = 0;
ul_ch0_index = 0;
if (is_dmrs_symbol == 0) {
//
......@@ -407,7 +409,7 @@ void nr_ulsch_scale_channel(int **ul_ch_estimates_ext,
#if defined(__x86_64__)||defined(__i386__)
short rb, ch_amp;
unsigned char aatx,aarx;
unsigned char aarx;
__m128i *ul_ch128, ch_amp128;
// Determine scaling amplitude based the symbol
......@@ -425,8 +427,7 @@ void nr_ulsch_scale_channel(int **ul_ch_estimates_ext,
int off = 0;
#endif
for (aatx=0; aatx < frame_parms->nb_antenna_ports_gNB; aatx++) {
for (aarx=0; aarx < frame_parms->nb_antennas_rx; aarx++) {
for (aarx=0; aarx < frame_parms->nb_antennas_rx; aarx++) {
ul_ch128 = (__m128i *)&ul_ch_estimates_ext[aarx][symbol*(off+(nb_rb*NR_NB_SC_PER_RB))];
......@@ -455,7 +456,6 @@ void nr_ulsch_scale_channel(int **ul_ch_estimates_ext,
}
}
}
}
#endif
}
......@@ -472,6 +472,7 @@ void nr_ulsch_channel_level(int **ul_ch_estimates_ext,
short rb;
unsigned char aatx, aarx;
char nb_antennas_ue_tx = 1;
__m128i *ul_ch128, avg128U;
int16_t x = factor2(len);
......@@ -483,7 +484,7 @@ void nr_ulsch_channel_level(int **ul_ch_estimates_ext,
int off = 0;
#endif
for (aatx = 0; aatx < frame_parms->nb_antennas_tx; aatx++)
for (aatx = 0; aatx < nb_antennas_ue_tx; aatx++)
for (aarx = 0; aarx < frame_parms->nb_antennas_rx; aarx++) {
//clear average level
avg128U = _mm_setzero_si128();
......@@ -624,11 +625,12 @@ void nr_ulsch_channel_compensation(int **rxdataF_ext,
unsigned short rb;
unsigned char aatx,aarx;
char nb_antennas_ue_tx = 1;
__m128i *ul_ch128,*ul_ch128_2,*ul_ch_mag128,*ul_ch_mag128b,*rxdataF128,*rxdataF_comp128,*rho128;
__m128i mmtmpD0,mmtmpD1,mmtmpD2,mmtmpD3,QAM_amp128,QAM_amp128b;
QAM_amp128b = _mm_setzero_si128();
for (aatx=0; aatx<frame_parms->nb_antennas_tx; aatx++) {
for (aatx=0; aatx<nb_antennas_ue_tx; aatx++) {
if (mod_order == 4) {
QAM_amp128 = _mm_set1_epi16(QAM16_n1); // 2/sqrt(10)
......@@ -1164,6 +1166,7 @@ int nr_rx_pusch(PHY_VARS_gNB *gNB,
uint32_t nb_re_pusch, bwp_start_subcarrier;
int avgs;
int avg[4];
char nb_antennas_ue_tx = 1;
NR_DL_FRAME_PARMS *frame_parms = &gNB->frame_parms;
nfapi_nr_pusch_pdu_t *rel15_ul = &gNB->ulsch[ulsch_id][0]->harq_processes[harq_pid]->ulsch_pdu;
......@@ -1263,7 +1266,7 @@ int nr_rx_pusch(PHY_VARS_gNB *gNB,
avgs = 0;
for (aatx=0;aatx<frame_parms->nb_antennas_tx;aatx++)
for (aatx=0;aatx<nb_antennas_ue_tx;aatx++)
for (aarx=0;aarx<frame_parms->nb_antennas_rx;aarx++)
avgs = cmax(avgs,avg[(aatx<<1)+aarx]);
......@@ -1281,7 +1284,7 @@ int nr_rx_pusch(PHY_VARS_gNB *gNB,
gNB->pusch_vars[ulsch_id]->ul_ch_mag0,
gNB->pusch_vars[ulsch_id]->ul_ch_magb0,
gNB->pusch_vars[ulsch_id]->rxdataF_comp,
(frame_parms->nb_antennas_tx>1) ? gNB->pusch_vars[ulsch_id]->rho : NULL,
(nb_antennas_ue_tx>1) ? gNB->pusch_vars[ulsch_id]->rho : NULL,
frame_parms,
symbol,
dmrs_symbol_flag,
......
......@@ -77,9 +77,9 @@ int nr_pbch_dmrs_correlation(PHY_VARS_NR_UE *ue,
// generate pilot
nr_pbch_dmrs_rx(dmrss,ue->nr_gold_pbch[n_hf][ssb_index], &pilot[0]);
int re_offset = ssb_offset;
for (aarx=0; aarx<ue->frame_parms.nb_antennas_rx; aarx++) {
int re_offset = ssb_offset;
pil = (int16_t *)&pilot[0];
rxF = (int16_t *)&rxdataF[aarx][(symbol_offset+k+re_offset)];
......@@ -277,9 +277,9 @@ int nr_pbch_channel_estimation(PHY_VARS_NR_UE *ue,
// generate pilot
nr_pbch_dmrs_rx(dmrss,ue->nr_gold_pbch[n_hf][ssb_index], &pilot[0]);
int re_offset = ssb_offset;
for (aarx=0; aarx<ue->frame_parms.nb_antennas_rx; aarx++) {
int re_offset = ssb_offset;
pil = (int16_t *)&pilot[0];
rxF = (int16_t *)&rxdataF[aarx][(symbol_offset+k+re_offset)];
dl_ch = (int16_t *)&dl_ch_estimates[aarx][ch_offset];
......@@ -456,12 +456,12 @@ int nr_pbch_channel_estimation(PHY_VARS_NR_UE *ue,
// do ifft of channel estimate
for (aarx=0; aarx<ue->frame_parms.nb_antennas_rx; aarx++)
for (p=0; p<ue->frame_parms.nb_antenna_ports_gNB; p++) {
if (ue->pbch_vars[eNB_offset]->dl_ch_estimates[(p<<1)+aarx])
if (ue->pbch_vars[eNB_offset]->dl_ch_estimates[(p*ue->frame_parms.nb_antennas_rx)+aarx])
{
LOG_D(PHY,"Channel Impulse Computation Slot %d ThreadId %d Symbol %d ch_offset %d\n", Ns, proc->thread_id, symbol, ch_offset);
idft(idftsizeidx,
(int16_t*) &ue->pbch_vars[eNB_offset]->dl_ch_estimates[(p<<1)+aarx][ch_offset],
(int16_t*) ue->pbch_vars[eNB_offset]->dl_ch_estimates_time[(p<<1)+aarx],1);
(int16_t*) &ue->pbch_vars[eNB_offset]->dl_ch_estimates[(p*ue->frame_parms.nb_antennas_rx)+aarx][ch_offset],
(int16_t*) ue->pbch_vars[eNB_offset]->dl_ch_estimates_time[(p*ue->frame_parms.nb_antennas_rx)+aarx],1);
}
}
}
......@@ -673,7 +673,7 @@ int nr_pdsch_channel_estimation(PHY_VARS_NR_UE *ue,
int **rxdataF=ue->common_vars.common_vars_rx_data_per_thread[proc->thread_id].rxdataF;
if (ue->high_speed_flag == 0)
ch_offset = ue->frame_parms.ofdm_symbol_size ;
ch_offset = ue->frame_parms.ofdm_symbol_size;
else
ch_offset = ue->frame_parms.ofdm_symbol_size*symbol;
......@@ -694,11 +694,11 @@ int nr_pdsch_channel_estimation(PHY_VARS_NR_UE *ue,
}
uint8_t config_type = ue->dmrs_DownlinkConfig.pdsch_dmrs_type;
int8_t delta = get_delta(p, config_type);
nr_pdsch_dmrs_rx(ue,Ns,ue->nr_gold_pdsch[eNB_offset][Ns][symbol][0], &pilot[0],1000,0,nb_rb_pdsch+rb_offset);
nr_pdsch_dmrs_rx(ue,Ns,ue->nr_gold_pdsch[eNB_offset][Ns][symbol][0], &pilot[0],1000+p,0,nb_rb_pdsch+rb_offset);
if (config_type == pdsch_dmrs_type1){
nushift = (p>>1)&1;
ue->frame_parms.nushift = nushift;
if (p<4) ue->frame_parms.nushift = nushift;
switch (delta) {
case 0://port 0,1
......@@ -738,7 +738,7 @@ int nr_pdsch_channel_estimation(PHY_VARS_NR_UE *ue,
}
} else {//pdsch_dmrs_type2
nushift = delta;
ue->frame_parms.nushift = nushift;
if (p<6) ue->frame_parms.nushift = nushift;
switch (delta) {
case 0://port 0,1
fl = filt8_l2;//left interpolation Filter should be fml
......
......@@ -261,7 +261,7 @@ uint32_t nr_dlsch_decoding(PHY_VARS_NR_UE *phy_vars_ue,
int8_t llrProcBuf[NR_LDPC_MAX_NUM_LLR] __attribute__ ((aligned(32)));
t_nrLDPC_dec_params decParams;
t_nrLDPC_dec_params* p_decParams = &decParams;
t_nrLDPC_time_stats procTime;
t_nrLDPC_time_stats procTime = {0};
t_nrLDPC_time_stats* p_procTime =&procTime ;
if (!harq_process) {
......@@ -678,7 +678,7 @@ uint32_t nr_dlsch_decoding(PHY_VARS_NR_UE *phy_vars_ue,
memcpy(harq_process->b+offset,
harq_process->c[r],
Kr_bytes- - (harq_process->F>>3) -((harq_process->C>1)?3:0));
Kr_bytes - (harq_process->F>>3) - ((harq_process->C>1)?3:0));
offset += (Kr_bytes - (harq_process->F>>3) - ((harq_process->C>1)?3:0));
if (LOG_DEBUGFLAG(DEBUG_DLSCH_DECOD))
......
......@@ -60,16 +60,15 @@ uint16_t nr_pbch_extract(int **rxdataF,
uint8_t i,j,aarx;
int32_t *dl_ch0,*dl_ch0_ext,*rxF,*rxF_ext;
int nushiftmod4 = frame_parms->nushift;
unsigned int rx_offset = frame_parms->first_carrier_offset + frame_parms->ssb_start_subcarrier; //and
// if (rx_offset>= frame_parms->ofdm_symbol_size) rx_offset-=frame_parms->ofdm_symbol_size;
rx_offset=(rx_offset)%(frame_parms->ofdm_symbol_size);
AssertFatal(symbol>=1 && symbol<5,
"symbol %d illegal for PBCH extraction\n",
symbol);
for (aarx=0; aarx<frame_parms->nb_antennas_rx; aarx++) {
unsigned int rx_offset = frame_parms->first_carrier_offset + frame_parms->ssb_start_subcarrier;
rx_offset = (rx_offset)%(frame_parms->ofdm_symbol_size);
rxF = &rxdataF[aarx][(symbol+s_offset)*frame_parms->ofdm_symbol_size];
rxF_ext = &rxdataF_ext[aarx][symbol*20*12];
#ifdef DEBUG_PBCH
......
......@@ -686,11 +686,8 @@ void dlsch_detection_mrc_TM34(NR_DL_FRAME_PARMS *frame_parms,
int32_t **dl_ch_estimates,
int32_t **rxdataF_ext,
int32_t **dl_ch_estimates_ext,
uint16_t pmi,
uint8_t *pmi_ext,
uint32_t *rb_alloc,
uint8_t symbol,
uint8_t nr_slot_rx,
NR_DL_FRAME_PARMS *frame_parms)
\brief This function extracts the received resource blocks, both channel estimates and data symbols,
for the current allocation and for single antenna eNB transmission.
......@@ -698,67 +695,61 @@ void dlsch_detection_mrc_TM34(NR_DL_FRAME_PARMS *frame_parms,
@param dl_ch_estimates Channel estimates of current slot
@param rxdataF_ext FFT output for RBs in this allocation
@param dl_ch_estimates_ext Channel estimates for RBs in this allocation
@param pmi subband Precoding matrix indicator
@param pmi_ext Extracted PMI for chosen RBs
@param rb_alloc RB allocation vector
@param symbol Symbol to extract
@param nr_slot_rx Slot number
@param high_speed_flag
@param n_dmrs_cdm_groups
@param frame_parms Pointer to frame descriptor
*/
unsigned short nr_dlsch_extract_rbs_single(int **rxdataF,
int **dl_ch_estimates,
int **rxdataF_ext,
int **dl_ch_estimates_ext,
unsigned short pmi,
unsigned char *pmi_ext,
unsigned char symbol,
uint8_t pilots,
uint8_t config_type,
unsigned short start_rb,
unsigned short nb_pdsch_rb,
unsigned char nr_slot_rx,
uint32_t high_speed_flag,
unsigned short nb_rb_pdsch,
uint8_t n_dmrs_cdm_groups,
NR_DL_FRAME_PARMS *frame_parms,
uint16_t dlDmrsSymbPos);
/** \fn dlsch_extract_rbs_dual(int32_t **rxdataF,
/** \fn dlsch_extract_rbs_multiple(int32_t **rxdataF,
int32_t **dl_ch_estimates,
int32_t **rxdataF_ext,
int32_t **dl_ch_estimates_ext,
uint16_t pmi,
uint8_t *pmi_ext,
uint32_t *rb_alloc,
uint8_t symbol,
NR_DL_FRAME_PARMS *frame_parms)
unsigned char symbol
uint8_t pilots,
uint8_t config_type,
unsigned short start_rb,
unsigned short nb_rb_pdsch,
uint8_t n_dmrs_cdm_groups,
uint8_t Nl,
NR_DL_FRAME_PARMS *frame_parms,
uint16_t dlDmrsSymbPos)
\brief This function extracts the received resource blocks, both channel estimates and data symbols,
for the current allocation and for dual antenna eNB transmission.
for the current allocation and for multiple layer antenna gNB transmission.
@param rxdataF Raw FFT output of received signal
@param dl_ch_estimates Channel estimates of current slot
@param rxdataF_ext FFT output for RBs in this allocation
@param dl_ch_estimates_ext Channel estimates for RBs in this allocation
@param pmi subband Precoding matrix indicator
@param pmi_ext Extracted PMI for chosen RBs
@param rb_alloc RB allocation vector
@param Nl nb of antenna layers
@param symbol Symbol to extract
@param nr_slot_rx Slot index
@param high_speed_flag
@param n_dmrs_cdm_groups
@param frame_parms Pointer to frame descriptor
*/
unsigned short nr_dlsch_extract_rbs_dual(int **rxdataF,
int **dl_ch_estimates,
int **rxdataF_ext,
int **dl_ch_estimates_ext,
unsigned short pmi,
unsigned char *pmi_ext,
unsigned char symbol,
uint8_t pilots,
unsigned short start_rb,
unsigned short nb_rb_pdsch,
unsigned char nr_slot_rx,
uint32_t high_speed_flag,
NR_DL_FRAME_PARMS *frame_parms,
MIMO_mode_t mimo_mode);
unsigned short nr_dlsch_extract_rbs_multiple(int **rxdataF,
int **dl_ch_estimates,
int **rxdataF_ext,
int **dl_ch_estimates_ext,
unsigned char symbol,
uint8_t pilots,
uint8_t config_type,
unsigned short start_rb,
unsigned short nb_rb_pdsch,
uint8_t n_dmrs_cdm_groups,
uint8_t Nl,
NR_DL_FRAME_PARMS *frame_parms,
uint16_t dlDmrsSymbPos);
/** \fn dlsch_extract_rbs_TM7(int32_t **rxdataF,
int32_t **dl_bf_ch_estimates,
......@@ -812,8 +803,9 @@ void nr_dlsch_channel_compensation(int32_t **rxdataF_ext,
int32_t **dl_ch_magb,
int32_t **dl_ch_magr,
int32_t **rxdataF_comp,
int32_t **rho,
int32_t ***rho,
NR_DL_FRAME_PARMS *frame_parms,
uint8_t nb_aatx,
uint8_t symbol,
uint8_t start_symbol,
uint8_t first_symbol_flag,
......@@ -827,7 +819,7 @@ void nr_dlsch_channel_compensation_core(int **rxdataF_ext,
int **dl_ch_mag,
int **dl_ch_magb,
int **rxdataF_comp,
int **rho,
int ***rho,
unsigned char n_tx,
unsigned char n_rx,
unsigned char mod_order,
......@@ -898,6 +890,15 @@ void nr_dlsch_channel_level_median(int **dl_ch_estimates_ext,
int length,
int start_point);
void nr_dlsch_detection_mrc(int **rxdataF_comp,
int ***rho,
int **dl_ch_mag,
int **dl_ch_magb,
short n_tx,
short n_rx,
unsigned char symbol,
unsigned short nb_rb);
void nr_dlsch_detection_mrc_core(int **rxdataF_comp,
int **rxdataF_comp_i,
int **rho,
......@@ -971,6 +972,7 @@ void dlsch_channel_compensation_TM34(NR_DL_FRAME_PARMS *frame_parms,
*/
void nr_dlsch_channel_level(int **dl_ch_estimates_ext,
NR_DL_FRAME_PARMS *frame_parms,
uint8_t n_tx,
int32_t *avg,
uint8_t symbol,
uint32_t len,
......@@ -1002,6 +1004,8 @@ void dlsch_channel_level_TM7(int32_t **dl_bf_ch_estimates_ext,
void nr_dlsch_scale_channel(int32_t **dl_ch_estimates_ext,
NR_DL_FRAME_PARMS *frame_parms,
uint8_t n_tx,
uint8_t n_rx,
NR_UE_DLSCH_t **dlsch_ue,
uint8_t symbol,
uint8_t start_symbol,
......
......@@ -138,8 +138,10 @@ typedef struct {
typedef struct {
/// Pointers to variables related to DLSCH harq process
NR_DL_gNB_HARQ_t harq_process;
/// TX buffers for UE-spec transmission (antenna ports 5 or 7..14, prior to precoding)
/// TX buffers for UE-spec transmission (antenna layers 1,...,4 after to precoding)
int32_t *txdataF[NR_MAX_NB_LAYERS];
/// TX buffers for UE-spec transmission (antenna ports 1000 or 1001,...,1007, before precoding)
int32_t *txdataF_precoding[NR_MAX_NB_LAYERS];
/// Modulated symbols buffer
int32_t *mod_symbs[NR_MAX_NB_CODEWORDS];
/// beamforming weights for UE-spec transmission (antenna ports 5 or 7..14), for each codeword, maximum 4 layers?
......
......@@ -187,7 +187,7 @@ typedef struct {
//! estimated rssi (dBm)
short rx_rssi_dBm[NUMBER_OF_CONNECTED_gNB_MAX];
//! estimated correlation (wideband linear) between spatial channels (computed in dlsch_demodulation)
int rx_correlation[NUMBER_OF_CONNECTED_gNB_MAX][2];
int rx_correlation[NUMBER_OF_CONNECTED_gNB_MAX][4][4];
//! estimated correlation (wideband dB) between spatial channels (computed in dlsch_demodulation)
int rx_correlation_dB[NUMBER_OF_CONNECTED_gNB_MAX][2];
......@@ -332,12 +332,10 @@ typedef struct {
int32_t **dl_ch_magb1[8][8];
/// \brief Magnitude of Downlink Channel, first layer (256QAM level).
int32_t **dl_ch_magr0;
/// \brief Cross-correlation of two gNB signals.
/// - first index: rx antenna [0..nb_antennas_rx[
/// \brief Cross-correlation Matrix of the gNB Tx channel signals.
/// - first index: aatx*n_rx+aarx for all aatx=[0..n_tx[ and aarx=[0..nb_rx[
/// - second index: symbol [0..]
int32_t **rho;
/// never used... always send dl_ch_rho_ext instead...
int32_t **rho_i;
int32_t ***rho;
/// \brief Pointers to llr vectors (2 TBs).
/// - first index: ? [0..1] (hard coded)
/// - second index: ? [0..1179743] (hard coded)
......
......@@ -279,13 +279,12 @@ static void *nr_feptx_thread(void *param) {
RU_feptx_t *feptx = (RU_feptx_t *)param;
RU_t *ru;
int aa, slot, start, l, nb_antenna_ports, ret;
int aa, slot, start, l, ret;
int i;
int32_t ***bw;
NR_DL_FRAME_PARMS *fp;
int ofdm_mask_full;
int txdataF_offset;
int32_t *txdataF;
while (!oai_exit) {
ret = 0;
if (wait_on_condition(&feptx->mutex_feptx,&feptx->cond_feptx,&feptx->instance_cnt_feptx,"NR feptx thread")<0) break;
......@@ -299,7 +298,6 @@ static void *nr_feptx_thread(void *param) {
l = feptx->symbol;
fp = ru->nr_frame_parms;
start = feptx->symbol;
nb_antenna_ports = feptx->nb_antenna_ports;
ofdm_mask_full = (1<<(ru->nb_tx*2))-1;
if(ru->num_gNB != 0){
......@@ -314,16 +312,16 @@ static void *nr_feptx_thread(void *param) {
}
else {
bw = ru->beam_weights[0];
txdataF = &ru->gNB_list[0]->common_vars.txdataF[0][txdataF_offset];
for(i=0; i<fp->symbols_per_slot>>1; ++i){
nr_beam_precoding(&txdataF,
nr_beam_precoding(ru->gNB_list[0]->common_vars.txdataF,
ru->common.txdataF_BF,
fp,
bw,
slot,
l+i,
aa,
nb_antenna_ports);
ru->nb_log_antennas,
txdataF_offset);//here
}
}
stop_meas(&ru->precoding_stats);
......@@ -362,7 +360,8 @@ static void *nr_feptx_thread(void *param) {
slot,
l,
aa,
nb_antenna_ports);
ru->nb_log_antennas,
0);
}
stop_meas(&ru->precoding_stats);
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPTX_PREC+feptx->index+1 , 0);
......@@ -485,7 +484,8 @@ void nr_feptx_prec(RU_t *ru,int frame_tx,int tti_tx) {
tti_tx,
l,
aa,
ru->nb_log_antennas);
ru->nb_log_antennas,
0);
}// for (aa=0;aa<ru->nb_tx;aa++)
}// for (l=0;l<fp->symbols_per_slot;l++)
}// if (ru->nb_tx == 1)
......
......@@ -207,7 +207,9 @@ void phy_procedures_gNB_TX(PHY_VARS_gNB *gNB,
if ((frame&127) == 0) dump_pdsch_stats(gNB);
//apply the OFDM symbol rotation here
apply_nr_rotation(fp,(int16_t*) &gNB->common_vars.txdataF[0][txdataF_offset],slot,0,fp->Ncp==EXTENDED?12:14,fp->ofdm_symbol_size);
for (aa=0; aa<cfg->carrier_config.num_tx_ant.value; aa++) {
apply_nr_rotation(fp,(int16_t*) &gNB->common_vars.txdataF[aa][txdataF_offset],slot,0,fp->Ncp==EXTENDED?12:14,fp->ofdm_symbol_size);
}
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_gNB_TX+offset,0);
}
......
......@@ -777,7 +777,7 @@ int nr_ue_pdsch_procedures(PHY_VARS_NR_UE *ue, UE_nr_rxtx_proc_t *proc, int eNB_
for (m = s0; m < (s0 +s1); m++) {
if (((1<<m)&dlsch0->harq_processes[harq_pid]->dlDmrsSymbPos) > 0) {
for (uint8_t aatx=0; aatx<1; aatx++) {//for MIMO Config: it shall loop over no_layers
for (uint8_t aatx=0; aatx<dlsch0->harq_processes[harq_pid]->Nl; aatx++) {//for MIMO Config: it shall loop over no_layers
nr_pdsch_channel_estimation(ue,
proc,
0 /*eNB_id*/,
......@@ -833,43 +833,24 @@ int nr_ue_pdsch_procedures(PHY_VARS_NR_UE *ue, UE_nr_rxtx_proc_t *proc, int eNB_
slot = 1;
start_meas(&ue->dlsch_llr_stats_parallelization[proc->thread_id][slot]);
#endif
// process DLSCH received in first slot
// skip DMRS symbols (will have to check later if PDSCH/DMRS are multiplexed
if (((1<<m)&dlsch0->harq_processes[harq_pid]->dlDmrsSymbPos) == 0) {
// process DLSCH received symbols in the slot
// symbol by symbol processing (if data/DMRS are multiplexed is checked inside the function)
if (pdsch == PDSCH || pdsch == SI_PDSCH || pdsch == RA_PDSCH) {
if (nr_rx_pdsch(ue,
proc,
pdsch,
eNB_id,
eNB_id_i,
frame_rx,
nr_slot_rx,
m,
first_symbol_flag,
dual_stream_UE,
i_mod,
dlsch0->current_harq_pid) < 0)
return -1;
}
else { // This is to adjust the llr offset in the case of skipping over a dmrs symbol (i.e. in case of no PDSCH REs in DMRS)
if (pdsch == RA_PDSCH) ue->pdsch_vars[proc->thread_id][eNB_id]->llr_offset[m]=ue->pdsch_vars[proc->thread_id][eNB_id]->llr_offset[m-1];
else if (pdsch == PDSCH || pdsch == SI_PDSCH) {
if (nr_rx_pdsch(ue,
proc,
pdsch,
eNB_id,
eNB_id_i,
frame_rx,
nr_slot_rx,
m,
first_symbol_flag,
dual_stream_UE,
i_mod,
dlsch0->current_harq_pid) < 0)
return -1;
}
else AssertFatal(1==0,"Not RA_PDSCH, SI_PDSCH or PDSCH\n");
}
if (pdsch == PDSCH) LOG_D(PHY,"Done processing symbol %d : llr_offset %d\n",m,ue->pdsch_vars[proc->thread_id][eNB_id]->llr_offset[m]);
proc,
pdsch,
eNB_id,
eNB_id_i,
frame_rx,
nr_slot_rx,
m,
first_symbol_flag,
dual_stream_UE,
i_mod,
dlsch0->current_harq_pid) < 0)
return -1;
} else AssertFatal(1==0,"Not RA_PDSCH, SI_PDSCH or PDSCH\n");
#if UE_TIMING_TRACE
stop_meas(&ue->dlsch_llr_stats_parallelization[proc->thread_id][slot]);
#if DISABLE_LOG_X
......@@ -879,10 +860,9 @@ int nr_ue_pdsch_procedures(PHY_VARS_NR_UE *ue, UE_nr_rxtx_proc_t *proc, int eNB_
#endif
#endif
if(first_symbol_flag)
{
proc->first_symbol_available = 1;
}
if(first_symbol_flag) {
proc->first_symbol_available = 1;
}
} // CRNTI active
}
return 0;
......@@ -903,7 +883,7 @@ void nr_ue_dlsch_procedures(PHY_VARS_NR_UE *ue,
int harq_pid = dlsch0->current_harq_pid;
int frame_rx = proc->frame_rx;
int nr_slot_rx = proc->nr_slot_rx;
int ret=0, ret1=0;
uint32_t ret = UINT32_MAX, ret1 = UINT32_MAX;
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;
......@@ -1669,6 +1649,7 @@ int phy_procedures_nrUE_RX(PHY_VARS_NR_UE *ue,
// looking for pbch only in slot where it is supposed to be
if (slot_ssb) {
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_SLOT_FEP_PBCH, VCD_FUNCTION_IN);
LOG_D(PHY," ------ PBCH ChannelComp/LLR: frame.slot %d.%d ------ \n", frame_rx%1024, nr_slot_rx);
for (int i=1; i<4; i++) {
......@@ -1706,6 +1687,7 @@ int phy_procedures_nrUE_RX(PHY_VARS_NR_UE *ue,
LOG_D(PHY, "Doing N0 measurements in %s\n", __FUNCTION__);
nr_ue_rrc_measurements(ue, proc, nr_slot_rx);
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_SLOT_FEP_PBCH, VCD_FUNCTION_OUT);
}
}
......@@ -1719,12 +1701,12 @@ int phy_procedures_nrUE_RX(PHY_VARS_NR_UE *ue,
nr_gold_pdcch(ue, 0, 2);
LOG_D(PHY," ------ --> PDCCH ChannelComp/LLR Frame.slot %d.%d ------ \n", frame_rx%1024, nr_slot_rx);
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_SLOT_FEP_PDCCH, VCD_FUNCTION_IN);
for (uint16_t l=0; l<nb_symb_pdcch; l++) {
#if UE_TIMING_TRACE
start_meas(&ue->ofdm_demod_stats);
#endif
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_SLOT_FEP, VCD_FUNCTION_IN);
nr_slot_fep(ue,
proc,
l,
......@@ -1746,7 +1728,6 @@ int phy_procedures_nrUE_RX(PHY_VARS_NR_UE *ue,
fp->first_carrier_offset+(pdcch_vars->pdcch_config[n_ss].BWPStart + coreset_start_rb)*12,
coreset_nb_rb);
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_SLOT_FEP, VCD_FUNCTION_OUT);
#if UE_TIMING_TRACE
stop_meas(&ue->ofdm_demod_stats);
#endif
......@@ -1754,6 +1735,7 @@ int phy_procedures_nrUE_RX(PHY_VARS_NR_UE *ue,
dci_cnt = dci_cnt + nr_ue_pdcch_procedures(gNB_id, ue, proc);
}
}
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_SLOT_FEP_PDCCH, VCD_FUNCTION_OUT);
if (dci_cnt > 0) {
......@@ -1769,6 +1751,7 @@ int phy_procedures_nrUE_RX(PHY_VARS_NR_UE *ue,
}
if (dlsch) {
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_SLOT_FEP_PDSCH, VCD_FUNCTION_IN);
uint8_t harq_pid = dlsch->current_harq_pid;
NR_DL_UE_HARQ_t *dlsch0_harq = dlsch->harq_processes[harq_pid];
uint16_t nb_symb_sch = dlsch0_harq->nb_symbols;
......@@ -1789,6 +1772,7 @@ int phy_procedures_nrUE_RX(PHY_VARS_NR_UE *ue,
m, //to be updated from higher layer
nr_slot_rx);
}
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_SLOT_FEP_PDSCH, VCD_FUNCTION_OUT);
}
} else {
LOG_D(PHY,"[UE %d] Frame %d, nr_slot_rx %d: No DCIs found\n", ue->Mod_id, frame_rx, nr_slot_rx);
......@@ -1802,7 +1786,7 @@ int phy_procedures_nrUE_RX(PHY_VARS_NR_UE *ue,
// do procedures for C-RNTI
int ret_pdsch = 0;
if (ue->dlsch[proc->thread_id][gNB_id][0]->active == 1) {
//VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PDSCH_PROC, VCD_FUNCTION_IN);
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PDSCH_PROC_C, VCD_FUNCTION_IN);
ret_pdsch = nr_ue_pdsch_procedures(ue,
proc,
gNB_id,
......@@ -1811,6 +1795,7 @@ int phy_procedures_nrUE_RX(PHY_VARS_NR_UE *ue,
NULL);
nr_ue_measurement_procedures(2, ue, proc, gNB_id, nr_slot_rx);
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PDSCH_PROC_C, VCD_FUNCTION_OUT);
}
// do procedures for SI-RNTI
......@@ -1859,7 +1844,6 @@ int phy_procedures_nrUE_RX(PHY_VARS_NR_UE *ue,
// deactivate dlsch once dlsch proc is done
ue->dlsch_p[gNB_id]->active = 0;
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PDSCH_PROC_P, VCD_FUNCTION_OUT);
}
......
This diff is collapsed.
......@@ -677,9 +677,9 @@ int main(int argc, char **argv)
gNB->if_inst->NR_PHY_config_req = nr_phy_config_request;
// common configuration
rrc_mac_config_req_gNB(0,0,n_rx,pusch_tgt_snrx10,pucch_tgt_snrx10,scc,0,0,NULL);
rrc_mac_config_req_gNB(0,0,n_tx,n_rx,pusch_tgt_snrx10,pucch_tgt_snrx10,scc,0,0,NULL);
// UE dedicated configuration
rrc_mac_config_req_gNB(0,0,1,pusch_tgt_snrx10,pucch_tgt_snrx10,NULL,1,secondaryCellGroup->spCellConfig->reconfigurationWithSync->newUE_Identity,secondaryCellGroup);
rrc_mac_config_req_gNB(0,0,1,1,pusch_tgt_snrx10,pucch_tgt_snrx10,NULL,1,secondaryCellGroup->spCellConfig->reconfigurationWithSync->newUE_Identity,secondaryCellGroup);
phy_init_nr_gNB(gNB,0,0);
N_RB_DL = gNB->frame_parms.N_RB_DL;
......
......@@ -48,9 +48,9 @@ void multipath_tv_channel(channel_desc_t *desc,
printf("[TV CHANNEL] keep = %d : path_loss = %g (%f), nb_rx %d, nb_tx %d, dd %d, len %d max_doppler %g\n",keep_channel,path_loss,desc->path_loss_dB,desc->nb_rx,desc->nb_tx,dd,desc->channel_length,
desc->max_Doppler);
#endif
tx = (double complex **)malloc(desc->nb_tx*sizeof(double complex));
rx = (double complex **)malloc(desc->nb_rx*sizeof(double complex));
H_t= (double complex ** *) malloc(desc->nb_tx*desc->nb_rx*sizeof(double complex **));
tx = (double complex **)malloc(desc->nb_tx*sizeof(double complex *));
rx = (double complex **)malloc(desc->nb_rx*sizeof(double complex *));
H_t= (double complex ***) malloc(desc->nb_tx*desc->nb_rx*sizeof(double complex **));
// tv_H_t = (double complex *) malloc(length*sizeof(double complex));
rx_temp= (double complex *) calloc(length,sizeof(double complex));
......@@ -63,10 +63,10 @@ void multipath_tv_channel(channel_desc_t *desc,
}
for(i=0; i<desc->nb_tx*desc->nb_rx; i++) {
H_t[i] = (double complex **) malloc(length*sizeof(double complex *));
H_t[i] = (double complex **)malloc(desc->nb_taps*sizeof(double complex *));
for(j=0; j<length; j++) {
H_t[i][j] = (double complex *) calloc (desc->nb_taps,sizeof(double complex));
for(j=0; j<desc->nb_taps; j++) {
H_t[i][j] = (double complex *)calloc(length,sizeof(double complex));
}
}
......@@ -116,7 +116,7 @@ void multipath_tv_channel(channel_desc_t *desc,
free(rx);
for(i=0; i<desc->nb_rx*desc->nb_tx; i++) {
for(j=0; j<length; j++) {
for(j=0; j<desc->nb_taps; j++) {
free(H_t[i][j]);
}
......@@ -131,14 +131,29 @@ void multipath_tv_channel(channel_desc_t *desc,
void tv_channel(channel_desc_t *desc,double complex ***H,uint32_t length){
int i,j,p,l,k;
double *alpha,*phi_rad,pi=acos(-1),*w_Hz;
double *alpha,***phi_rad,pi=acos(-1),***w_Hz;
alpha = (double *)calloc(desc->nb_paths,sizeof(double));
phi_rad = (double *)calloc(desc->nb_paths,sizeof(double));
w_Hz = (double *)calloc(desc->nb_paths,sizeof(double));
phi_rad = (double ***)malloc(desc->nb_rx*desc->nb_tx*sizeof(double **));
w_Hz = (double ***)malloc(desc->nb_rx*desc->nb_tx*sizeof(double **));
for(i=0; i<desc->nb_paths; i++) {
w_Hz[i]=desc->max_Doppler*cos(frand_a_b(0,2*pi));
phi_rad[i]=frand_a_b(0,2*pi);
for(i=0; i<desc->nb_tx*desc->nb_rx; i++) {
phi_rad[i] = (double **) malloc(desc->nb_taps*sizeof(double *));
w_Hz[i] = (double **) malloc(desc->nb_taps*sizeof(double *));
for(j=0; j<desc->nb_taps; j++) {
phi_rad[i][j] = (double *) malloc(desc->nb_paths*sizeof(double));
w_Hz[i][j] = (double *) malloc(desc->nb_paths*sizeof(double));
}
}
for(i=0; i<desc->nb_tx*desc->nb_rx; i++) {
for (j = 0; j<desc->nb_taps; j++) {
for(k=0; k<desc->nb_paths; k++) {
w_Hz[i][j][k] = desc->max_Doppler*cos(frand_a_b(0,2*M_PI));
phi_rad[i][j][k] = frand_a_b(0,2*M_PI);
//printf("w_hz[%d][%d][%d]=f_d*cos(theta) = %f\n",i,j,k,w_Hz[i][j][k]);
//printf("phi_rad[%d][%d][%d] = %f\n",i,j,k,phi_rad[i][j][k]);
}
}
}
if(desc->ricean_factor == 1) {
......@@ -153,44 +168,34 @@ void tv_channel(channel_desc_t *desc,double complex ***H,uint32_t length){
}
}
/*
// This is the code when we only consider a SISO case
for(i=0;i<length;i++)
{
for(j=0;j<desc->nb_taps;j++)
{
for(p=0;p<desc->nb_paths;p++)
{
H[i][j] += sqrt(desc->amps[j]/2)*alpha[p]*cexp(-I*(2*pi*w_Hz[p]*i*(1/(desc->sampling_rate*1e6))+phi_rad[p]));
}
}
}
for(j=0;j<desc->nb_paths;j++)
{
phi_rad[j] = fmod(2*pi*w_Hz[j]*(length-1)*(1/desc->sampling_rate)+phi_rad[j],2*pi);
}
*/
// if MIMO
// SISO or MIMO
for (i=0; i<desc->nb_rx; i++) {
for(j=0; j<desc->nb_tx; j++) {
for(k=0; k<length; k++) {
for(l=0; l<desc->nb_taps; l++) {
H[i+(j*desc->nb_rx)][k][l] = 0;
for(k=0; k<desc->nb_taps; k++) {
for(l=0; l<length; l++) {
for(p=0; p<desc->nb_paths; p++) {
H[i+(j*desc->nb_rx)][k][l] += sqrt(desc->amps[l]/2)*alpha[p]*cexp(I*(2*pi*w_Hz[p]*k*(1/(desc->sampling_rate*1e6))+phi_rad[p]));
H[i+(j*desc->nb_rx)][k][l] += sqrt(desc->amps[k])*alpha[p]*cexp(I*(2*pi*w_Hz[i+(j*desc->nb_rx)][k][p]*l*(1/(desc->sampling_rate*1e6))+phi_rad[i+(j*desc->nb_rx)][k][p]));
}
}
}
for(j=0; j<desc->nb_paths; j++) {
phi_rad[j] = fmod(2*pi*w_Hz[j]*(length-1)*(1/desc->sampling_rate)+phi_rad[j],2*pi);
//printf("H[tx%d][rx%d][k%d] = %f+j%f \n",j,i,k,creal(H[i+(j*desc->nb_rx)][k][0]),cimag(H[i+(j*desc->nb_rx)][k][0]));
}
}
}
//accumlate the phase
/*for(k=0; k<desc->nb_taps; k++) {
* for(j=0; j<desc->nb_paths; j++) {
* desc->random_phase[k][j] = fmod(2*pi*w_Hz[k][j]*(length-1)*(1/(desc->sampling_rate*1e6))+phi_rad[k][j],2*pi);
* }
* }*/
free(alpha);
for(i=0; i<desc->nb_rx*desc->nb_tx; i++) {
for (j=0; j<desc->nb_taps; j++) {
free(w_Hz[i][j]);
free(phi_rad[i][j]);
}
free(w_Hz[i]);
free(phi_rad[i]);
}
free(w_Hz);
free(phi_rad);
}
......@@ -203,7 +208,7 @@ void tv_conv(double complex **h, double complex *x, double complex *y, uint32_t
for(i=0; i<((int)nb_samples-dd); i++) {
for(j=0; j<nb_taps; j++) {
if(i>j)
y[i+dd] += creal(h[i][j])*creal(x[i-j])-cimag(h[i][j])*cimag(x[i-j]) + I*(creal(h[i][j])*cimag(x[i-j])+cimag(h[i][j])*creal(x[i-j]));
y[i+dd] += creal(h[j][i])*creal(x[i-j])-cimag(h[j][i])*cimag(x[i-j]) + I*(creal(h[j][i])*cimag(x[i-j])+cimag(h[j][i])*creal(x[i-j]));
}
}
}
......
......@@ -61,7 +61,7 @@ static telnetshell_vardef_t channelmod_vardef[] = {
static double snr_dB=25;
static double sinr_dB=0;
static unsigned int max_chan;
static channel_desc_t** defined_channels;
static channel_desc_t **defined_channels;
void fill_channel_desc(channel_desc_t *chan_desc,
uint8_t nb_tx,
uint8_t nb_rx,
......@@ -1185,11 +1185,11 @@ channel_desc_t *new_channel_desc_scm(uint8_t nb_tx,
1);
break;
case Rayleigh1:
case Rayleigh1://MIMO Test uses Rayleigh1
nb_taps = 1;
Td = 0;
channel_length = 1;
ricean_factor = 1;
ricean_factor = 0.0;
aoa = .03;
maxDoppler = 0;
fill_channel_desc(chan_desc,nb_tx,
......@@ -1632,7 +1632,7 @@ channel_desc_t *new_channel_desc_scm(uint8_t nb_tx,
void free_channel_desc_scm(channel_desc_t *ch) {
// Must be made cleanly, a lot of leaks...
defined_channels[ch->chan_idx]=NULL;
if (max_chan != 0) defined_channels[ch->chan_idx]=NULL;
if(ch->free_flags&CHANMODEL_FREE_AMPS)
free(ch->amps);
for (int i = 0; i<ch->nb_tx*ch->nb_rx; i++) {
......
......@@ -409,6 +409,7 @@ typedef struct NRRrcConfigurationReq_s {
NR_ServingCellConfig_t *scd;
int ssb_SubcarrierOffset;
int pdsch_AntennaPorts;
int pusch_AntennaPorts;
int pusch_TargetSNRx10;
int pucch_TargetSNRx10;
} gNB_RrcConfigurationReq;
......
......@@ -302,7 +302,7 @@ void fix_scc(NR_ServingCellConfigCommon_t *scc,uint64_t ssbmap) {
void prepare_scd(NR_ServingCellConfig_t *scd) {
// Allocate downlink structures
scd->downlinkBWP_ToAddModList = CALLOC(1, sizeof(scd->downlinkBWP_ToAddModList));
scd->downlinkBWP_ToAddModList = CALLOC(1, sizeof(*scd->downlinkBWP_ToAddModList));
// Downlink bandwidth part
NR_BWP_Downlink_t *bwp = calloc(1, sizeof(*bwp));
......@@ -323,29 +323,25 @@ void prepare_scd(NR_ServingCellConfig_t *scd) {
NR_DMRS_DownlinkCfg->phaseTrackingRS->present = NR_SetupRelease_PTRS_DownlinkConfig_PR_setup;
NR_DMRS_DownlinkCfg->phaseTrackingRS->choice.setup = CALLOC(1, sizeof(*NR_DMRS_DownlinkCfg->phaseTrackingRS->choice.setup));
NR_PTRS_DownlinkConfig_t *NR_PTRS_DownlinkCfg = NR_DMRS_DownlinkCfg->phaseTrackingRS->choice.setup;
NR_PTRS_DownlinkCfg->frequencyDensity = CALLOC(1, sizeof(NR_PTRS_DownlinkCfg->frequencyDensity));
int *dl_rbs[2];
NR_PTRS_DownlinkCfg->frequencyDensity = CALLOC(1, sizeof(*NR_PTRS_DownlinkCfg->frequencyDensity));
long *dl_rbs = CALLOC(2, sizeof(long));
for (int i=0;i<2;i++) {
dl_rbs[i] = CALLOC(1, sizeof(*dl_rbs[i]));
*dl_rbs[i] = 0;
ASN_SEQUENCE_ADD(&NR_PTRS_DownlinkCfg->frequencyDensity->list, dl_rbs[i]);
ASN_SEQUENCE_ADD(&NR_PTRS_DownlinkCfg->frequencyDensity->list, &dl_rbs[i]);
}
NR_PTRS_DownlinkCfg->timeDensity = CALLOC(1, sizeof(NR_PTRS_DownlinkCfg->timeDensity));
int *dl_mcs[3];
NR_PTRS_DownlinkCfg->timeDensity = CALLOC(1, sizeof(*NR_PTRS_DownlinkCfg->timeDensity));
long *dl_mcs = CALLOC(3, sizeof(long));
for (int i=0;i<3;i++) {
dl_mcs[i] = CALLOC(1, sizeof(*dl_mcs[i]));
*dl_mcs[i] = 0;
ASN_SEQUENCE_ADD(&NR_PTRS_DownlinkCfg->timeDensity->list, dl_mcs[i]);
ASN_SEQUENCE_ADD(&NR_PTRS_DownlinkCfg->timeDensity->list, &dl_mcs[i]);
}
NR_PTRS_DownlinkCfg->epre_Ratio = CALLOC(1, sizeof(NR_PTRS_DownlinkCfg->epre_Ratio));
NR_PTRS_DownlinkCfg->resourceElementOffset = CALLOC(1, sizeof(NR_PTRS_DownlinkCfg->resourceElementOffset));
NR_PTRS_DownlinkCfg->epre_Ratio = CALLOC(1, sizeof(*NR_PTRS_DownlinkCfg->epre_Ratio));
NR_PTRS_DownlinkCfg->resourceElementOffset = CALLOC(1, sizeof(*NR_PTRS_DownlinkCfg->resourceElementOffset));
*NR_PTRS_DownlinkCfg->resourceElementOffset = 0;
ASN_SEQUENCE_ADD(&scd->downlinkBWP_ToAddModList->list,bwp);
// Allocate uplink structures
scd->uplinkConfig = CALLOC(1, sizeof(NR_UplinkConfig_t));
scd->uplinkConfig->uplinkBWP_ToAddModList = CALLOC(1, sizeof(scd->uplinkConfig->uplinkBWP_ToAddModList));
scd->uplinkConfig = CALLOC(1, sizeof(*scd->uplinkConfig));
scd->uplinkConfig->uplinkBWP_ToAddModList = CALLOC(1, sizeof(*scd->uplinkConfig->uplinkBWP_ToAddModList));
NR_PUSCH_Config_t *pusch_Config = CALLOC(1, sizeof(*pusch_Config));
......@@ -360,20 +356,16 @@ void prepare_scd(NR_ServingCellConfig_t *scd) {
NR_PTRS_UplinkConfig_t *NR_PTRS_UplinkConfig = NR_DMRS_UplinkConfig->phaseTrackingRS->choice.setup;
NR_PTRS_UplinkConfig->transformPrecoderDisabled = CALLOC(1, sizeof(*NR_PTRS_UplinkConfig->transformPrecoderDisabled));
NR_PTRS_UplinkConfig->transformPrecoderDisabled->frequencyDensity = CALLOC(1, sizeof(*NR_PTRS_UplinkConfig->transformPrecoderDisabled->frequencyDensity));
int *n_rbs[2];
long *n_rbs = CALLOC(2, sizeof(long));
for (int i=0;i<2;i++) {
n_rbs[i] = CALLOC(1, sizeof(*n_rbs[i]));
*n_rbs[i] = 0;
ASN_SEQUENCE_ADD(&NR_PTRS_UplinkConfig->transformPrecoderDisabled->frequencyDensity->list, n_rbs[i]);
ASN_SEQUENCE_ADD(&NR_PTRS_UplinkConfig->transformPrecoderDisabled->frequencyDensity->list, &n_rbs[i]);
}
NR_PTRS_UplinkConfig->transformPrecoderDisabled->timeDensity = CALLOC(1, sizeof(*NR_PTRS_UplinkConfig->transformPrecoderDisabled->timeDensity));
int *ptrs_mcs[3];
long *ptrs_mcs = CALLOC(3, sizeof(long));
for (int i = 0; i < 3; i++) {
ptrs_mcs[i] = CALLOC(1, sizeof(*ptrs_mcs[i]));
*ptrs_mcs[i] = 0;
ASN_SEQUENCE_ADD(&NR_PTRS_UplinkConfig->transformPrecoderDisabled->timeDensity->list, ptrs_mcs[i]);
ASN_SEQUENCE_ADD(&NR_PTRS_UplinkConfig->transformPrecoderDisabled->timeDensity->list, &ptrs_mcs[i]);
}
NR_PTRS_UplinkConfig->transformPrecoderDisabled->resourceElementOffset = CALLOC(1, sizeof(NR_PTRS_UplinkConfig->transformPrecoderDisabled->resourceElementOffset));
NR_PTRS_UplinkConfig->transformPrecoderDisabled->resourceElementOffset = CALLOC(1, sizeof(*NR_PTRS_UplinkConfig->transformPrecoderDisabled->resourceElementOffset));
*NR_PTRS_UplinkConfig->transformPrecoderDisabled->resourceElementOffset = 0;
// UL bandwidth part
......@@ -1007,6 +999,8 @@ void RCconfig_NRRRC(MessageDef *msg_p, uint32_t i, gNB_RRC_INST *rrc) {
NRRRC_CONFIGURATION_REQ (msg_p).ssb_SubcarrierOffset = *GNBParamList.paramarray[i][GNB_SSB_SUBCARRIEROFFSET_IDX].iptr;
printf("pdsch_AntennaPorts %d\n",*GNBParamList.paramarray[i][GNB_PDSCH_ANTENNAPORTS_IDX].iptr);
NRRRC_CONFIGURATION_REQ (msg_p).pdsch_AntennaPorts = *GNBParamList.paramarray[i][GNB_PDSCH_ANTENNAPORTS_IDX].iptr;
printf("pusch_AntennaPorts %d\n",*GNBParamList.paramarray[i][GNB_PUSCH_ANTENNAPORTS_IDX].iptr);
NRRRC_CONFIGURATION_REQ (msg_p).pusch_AntennaPorts = *GNBParamList.paramarray[i][GNB_PUSCH_ANTENNAPORTS_IDX].iptr;
printf("pusch_TargetSNRx10 %d\n",*GNBParamList.paramarray[i][GNB_PUSCH_TARGETPOW_X10_IDX].iptr);
NRRRC_CONFIGURATION_REQ (msg_p).pusch_TargetSNRx10 = *GNBParamList.paramarray[i][GNB_PUSCH_TARGETPOW_X10_IDX].iptr;
printf("pucch_TargetSNRx10 %d\n",*GNBParamList.paramarray[i][GNB_PUCCH_TARGETPOW_X10_IDX].iptr);
......
......@@ -115,6 +115,7 @@ typedef enum {
#define GNB_CONFIG_STRING_REMOTE_S_PORTD "remote_s_portd"
#define GNB_CONFIG_STRING_SSBSUBCARRIEROFFSET "ssb_SubcarrierOffset"
#define GNB_CONFIG_STRING_PDSCHANTENNAPORTS "pdsch_AntennaPorts"
#define GNB_CONFIG_STRING_PUSCHANTENNAPORTS "pusch_AntennaPorts"
#define GNB_CONFIG_STRING_PUSCHTARGETPOWX10 "pusch_TargetSNRx10"
#define GNB_CONFIG_STRING_PUCCHTARGETPOWX10 "pucch_TargetSNRx10"
#define GNB_CONFIG_STRING_NR_CELLID "nr_cellid"
......@@ -140,6 +141,7 @@ typedef enum {
{GNB_CONFIG_STRING_REMOTE_S_PORTD, NULL, 0, uptr:NULL, defuintval:50001, TYPE_UINT, 0}, \
{GNB_CONFIG_STRING_SSBSUBCARRIEROFFSET, NULL, 0, iptr:NULL, defintval:31, TYPE_INT, 0}, \
{GNB_CONFIG_STRING_PDSCHANTENNAPORTS, NULL, 0, iptr:NULL, defintval:1, TYPE_INT, 0}, \
{GNB_CONFIG_STRING_PUSCHANTENNAPORTS, NULL, 0, iptr:NULL, defintval:1, TYPE_INT, 0}, \
{GNB_CONFIG_STRING_PUSCHTARGETPOWX10, NULL, 0, iptr:NULL, defintval:200, TYPE_INT, 0}, \
{GNB_CONFIG_STRING_PUCCHTARGETPOWX10, NULL, 0, iptr:NULL, defintval:200, TYPE_INT, 0}, \
{GNB_CONFIG_STRING_NR_CELLID, NULL, 0, u64ptr:NULL, defint64val:0, TYPE_UINT64, 0}, \
......@@ -161,9 +163,10 @@ typedef enum {
#define GNB_REMOTE_S_PORTD_IDX 13
#define GNB_SSB_SUBCARRIEROFFSET_IDX 14
#define GNB_PDSCH_ANTENNAPORTS_IDX 15
#define GNB_PUSCH_TARGETPOW_X10_IDX 16
#define GNB_PUCCH_TARGETPOW_X10_IDX 17
#define GNB_NRCELLID_IDX 18
#define GNB_PUSCH_ANTENNAPORTS_IDX 16
#define GNB_PUSCH_TARGETPOW_X10_IDX 17
#define GNB_PUCCH_TARGETPOW_X10_IDX 18
#define GNB_NRCELLID_IDX 19
#define TRACKING_AREA_CODE_OKRANGE {0x0001,0xFFFD}
#define GNBPARAMS_CHECK { \
......
......@@ -1789,7 +1789,7 @@ void nr_ue_process_mac_pdu(nr_downlink_indication_t *dl_info,
frame_t frameP = dl_info->frame;
int slot = dl_info->slot;
uint8_t *pduP = (dl_info->rx_ind->rx_indication_body + pdu_id)->pdsch_pdu.pdu;
uint16_t pdu_len = (dl_info->rx_ind->rx_indication_body + pdu_id)->pdsch_pdu.pdu_length;
int32_t pdu_len = (dl_info->rx_ind->rx_indication_body + pdu_id)->pdsch_pdu.pdu_length;
uint8_t gNB_index = dl_info->gNB_index;
uint8_t CC_id = dl_info->cc_id;
uint8_t done = 0;
......@@ -1800,7 +1800,7 @@ void nr_ue_process_mac_pdu(nr_downlink_indication_t *dl_info,
return;
}
LOG_D(MAC, "In %s [%d.%d]: processing PDU %d of %d total number of PDUs...\n", __FUNCTION__, frameP, slot, pdu_id, dl_info->rx_ind->number_pdus);
LOG_D(MAC, "In %s [%d.%d]: processing PDU %d (with length %d) of %d total number of PDUs...\n", __FUNCTION__, frameP, slot, pdu_id, pdu_len, dl_info->rx_ind->number_pdus);
while (!done && pdu_len > 0){
mac_ce_len = 0x0000;
......@@ -1827,6 +1827,12 @@ void nr_ue_process_mac_pdu(nr_downlink_indication_t *dl_info,
mac_subheader_len = 2;
}
// Check if it is a valid CCCH message, we get all 00's messages very often
if ( pdu_len != (mac_subheader_len+mac_sdu_len) ) {
LOG_D(NR_MAC, "%s() Invalid CCCH message!, pdu_len: %d\n", __func__, pdu_len);
return;
}
if ( mac_sdu_len > 0 ) {
LOG_D(NR_MAC,"DL_SCH_LCID_CCCH with payload len %d: bits\n", mac_sdu_len);
......@@ -2037,7 +2043,7 @@ void nr_ue_process_mac_pdu(nr_downlink_indication_t *dl_info,
pduP += ( mac_subheader_len + mac_ce_len + mac_sdu_len );
pdu_len -= ( mac_subheader_len + mac_ce_len + mac_sdu_len );
if (pdu_len < 0)
LOG_E(MAC, "[MAC] nr_ue_process_mac_pdu, residual mac pdu length %d < 0!\n", pdu_len);
LOG_E(MAC, "[UE %d][%d.%d] nr_ue_process_mac_pdu, residual mac pdu length %d < 0!\n", module_idP, frameP, slot, pdu_len);
}
}
......@@ -2372,7 +2378,7 @@ int nr_ue_process_rar(nr_downlink_indication_t *dl_info, NR_UL_TIME_ALIGNMENT_t
rnti = mac->crnti;
}
// FIXME: To be removed
#ifdef DEBUG_RAR
LOG_I(NR_MAC, "rarh->E = 0x%x\n", rarh->E);
LOG_I(NR_MAC, "rarh->T = 0x%x\n", rarh->T);
LOG_I(NR_MAC, "rarh->RAPID = 0x%x (%i)\n", rarh->RAPID, rarh->RAPID);
......@@ -2390,20 +2396,19 @@ int nr_ue_process_rar(nr_downlink_indication_t *dl_info, NR_UL_TIME_ALIGNMENT_t
LOG_I(NR_MAC, "rar->TCRNTI_1 = 0x%x\n", rar->TCRNTI_1);
LOG_I(NR_MAC, "rar->TCRNTI_2 = 0x%x\n", rar->TCRNTI_2);
//#ifdef DEBUG_RAR
LOG_I(NR_MAC, "In %s:[%d.%d]: [UE %d] Received RAR with t_alloc %d f_alloc %d ta_command %d mcs %d freq_hopping %d tpc_command %d t_crnti %x \n",
__FUNCTION__,
frame,
slot,
mod_id,
rar_grant.Msg3_t_alloc,
rar_grant.Msg3_f_alloc,
ul_time_alignment->ta_command,
rar_grant.mcs,
rar_grant.freq_hopping,
tpc_command,
ra->t_crnti);
//#endif
LOG_I(NR_MAC, "In %s:[%d.%d]: [UE %d] Received RAR with t_alloc %d f_alloc %d ta_command %d mcs %d freq_hopping %d tpc_command %d t_crnti %x \n",
__FUNCTION__,
frame,
slot,
mod_id,
rar_grant.Msg3_t_alloc,
rar_grant.Msg3_f_alloc,
ul_time_alignment->ta_command,
rar_grant.mcs,
rar_grant.freq_hopping,
tpc_command,
ra->t_crnti);
#endif
// Schedule Msg3
ret = nr_ue_pusch_scheduler(mac, is_Msg3, frame, slot, &frame_tx, &slot_tx, rar_grant.Msg3_t_alloc);
......
......@@ -54,7 +54,7 @@ extern RAN_CONTEXT_t RC;
extern void mac_top_init_gNB(void);
extern uint8_t nfapi_mode;
void config_common(int Mod_idP, int pdsch_AntennaPorts, NR_ServingCellConfigCommon_t *scc) {
void config_common(int Mod_idP, int pdsch_AntennaPorts, int pusch_AntennaPorts, NR_ServingCellConfigCommon_t *scc) {
nfapi_nr_config_request_scf_t *cfg = &RC.nrmac[Mod_idP]->config[0];
RC.nrmac[Mod_idP]->common_channels[0].ServingCellConfigCommon = scc;
......@@ -279,7 +279,8 @@ void config_common(int Mod_idP, int pdsch_AntennaPorts, NR_ServingCellConfigComm
num_ssb += (cfg->ssb_table.ssb_mask_list[1].ssb_mask.value>>i)&1;
}
cfg->carrier_config.num_rx_ant.value = cfg->carrier_config.num_tx_ant.value;
cfg->carrier_config.num_rx_ant.value = pusch_AntennaPorts;
AssertFatal(pusch_AntennaPorts > 0 && pusch_AntennaPorts < 13, "pusch_AntennaPorts in 1...12\n");
cfg->carrier_config.num_rx_ant.tl.tag = NFAPI_NR_CONFIG_NUM_RX_ANT_TAG;
LOG_I(MAC,"Set TX/RX antenna number to %d (num ssb %d: %x,%x)\n",cfg->carrier_config.num_tx_ant.value,num_ssb,cfg->ssb_table.ssb_mask_list[0].ssb_mask.value,cfg->ssb_table.ssb_mask_list[1].ssb_mask.value);
AssertFatal(cfg->carrier_config.num_tx_ant.value > 0,"carrier_config.num_tx_ant.value %d !\n",cfg->carrier_config.num_tx_ant.value );
......@@ -315,9 +316,10 @@ void config_common(int Mod_idP, int pdsch_AntennaPorts, NR_ServingCellConfigComm
}
extern uint16_t sl_ahead;
int rrc_mac_config_req_gNB(module_id_t Mod_idP,
int ssb_SubcarrierOffset,
int rrc_mac_config_req_gNB(module_id_t Mod_idP,
int ssb_SubcarrierOffset,
int pdsch_AntennaPorts,
int pusch_AntennaPorts,
int pusch_tgt_snrx10,
int pucch_tgt_snrx10,
NR_ServingCellConfigCommon_t *scc,
......@@ -363,7 +365,8 @@ int rrc_mac_config_req_gNB(module_id_t Mod_idP,
LOG_I(MAC,"Configuring common parameters from NR ServingCellConfig\n");
config_common(Mod_idP,
pdsch_AntennaPorts,
pdsch_AntennaPorts,
pusch_AntennaPorts,
scc);
LOG_E(MAC, "%s() %s:%d RC.nrmac[Mod_idP]->if_inst->NR_PHY_config_req:%p\n", __FUNCTION__, __FILE__, __LINE__, RC.nrmac[Mod_idP]->if_inst->NR_PHY_config_req);
......
......@@ -1519,7 +1519,7 @@ void nr_fill_rar(uint8_t Mod_idP,
rar->UL_GRANT_3 = (uint8_t) (ul_grant >> 8) & 0xff;
rar->UL_GRANT_4 = (uint8_t) ul_grant & 0xff;
// FIXME: To be removed
#ifdef DEBUG_RAR
//LOG_I(NR_MAC, "rarbi->E = 0x%x\n", rarbi->E);
//LOG_I(NR_MAC, "rarbi->T = 0x%x\n", rarbi->T);
//LOG_I(NR_MAC, "rarbi->R = 0x%x\n", rarbi->R);
......@@ -1541,6 +1541,7 @@ void nr_fill_rar(uint8_t Mod_idP,
LOG_I(NR_MAC, "rar->TCRNTI_1 = 0x%x\n", rar->TCRNTI_1);
LOG_I(NR_MAC, "rar->TCRNTI_2 = 0x%x\n", rar->TCRNTI_2);
#endif
int mcs = (unsigned char) (rar->UL_GRANT_4 >> 4);
// time alloc
......
......@@ -268,7 +268,7 @@ void nr_process_mac_pdu(
// Check if it is a valid CCCH1 message, we get all 00's messages very often
if (pdu_len != 9) {
//LOG_E(MAC, "%s() Invalid CCCH1 message!, pdu_len: %d\n", __func__, pdu_len);
LOG_D(NR_MAC, "%s() Invalid CCCH1 message!, pdu_len: %d\n", __func__, pdu_len);
return;
}
} else {
......@@ -535,7 +535,7 @@ void nr_rx_sdu(const module_id_t gnb_mod_idP,
// random access pusch with TC-RNTI
if (ra->rnti != current_rnti) {
LOG_W(NR_MAC,
"expected TC-RNTI %04x to match current RNTI %04x\n",
"expected TC_RNTI %04x to match current RNTI %04x\n",
ra->rnti,
current_rnti);
continue;
......@@ -553,7 +553,7 @@ void nr_rx_sdu(const module_id_t gnb_mod_idP,
i);
LOG_I(NR_MAC,
"[gNB %d][RAPROC] PUSCH with TC-RNTI %x received correctly, "
"[gNB %d][RAPROC] PUSCH with TC_RNTI %x received correctly, "
"adding UE MAC Context UE_id %d/RNTI %04x\n",
gnb_mod_idP,
current_rnti,
......@@ -572,7 +572,7 @@ void nr_rx_sdu(const module_id_t gnb_mod_idP,
LOG_I(NR_MAC,"[RAPROC] RA-Msg3 received (sdu_lenP %d)\n",sdu_lenP);
LOG_D(NR_MAC,"[RAPROC] Received Msg3:\n");
for (int k = 0; k < sdu_lenP; k++) {
LOG_I(NR_MAC,"(%i): 0x%x\n",k,sduP[k]);
LOG_D(NR_MAC,"(%i): 0x%x\n",k,sduP[k]);
}
// UE Contention Resolution Identity
......@@ -588,7 +588,7 @@ void nr_rx_sdu(const module_id_t gnb_mod_idP,
ra->state = Msg4;
ra->Msg4_frame = ( frameP +2 ) % 1024;
ra->Msg4_slot = 1;
LOG_I(MAC, "Scheduling RA-Msg4 for TC-RNTI %04x (state %d, frame %d, slot %d)\n", ra->rnti, ra->state, ra->Msg4_frame, ra->Msg4_slot);
LOG_I(NR_MAC, "Scheduling RA-Msg4 for TC_RNTI %04x (state %d, frame %d, slot %d)\n", ra->rnti, ra->state, ra->Msg4_frame, ra->Msg4_slot);
}
return;
......
......@@ -42,12 +42,14 @@ void mac_top_init_gNB(void);
void config_common(int Mod_idP,
int pdsch_AntennaPorts,
int pusch_AntennaPorts,
NR_ServingCellConfigCommon_t *scc
);
int rrc_mac_config_req_gNB(module_id_t Mod_idP,
int ssb_SubcarrierOffset,
int rrc_mac_config_req_gNB(module_id_t Mod_idP,
int ssb_SubcarrierOffset,
int pdsch_AntennaPorts,
int pusch_AntennaPorts,
int pusch_tgt_snrx10,
int pucch_tgt_snrx10,
NR_ServingCellConfigCommon_t *scc,
......
......@@ -148,7 +148,7 @@ typedef struct UE_RRC_INFO_NB_IoT_s {
//Measurement Report not supported in NB-IoT
#define PAYLOAD_SIZE_MAX 1024
#define RRC_BUF_SIZE 255
#define RRC_BUF_SIZE 8192
#define UNDEF_SECURITY_MODE 0xff
#define NO_SECURITY_MODE 0x20
......
......@@ -327,7 +327,7 @@ typedef enum SL_TRIGGER_e {
#define MAX_MEAS_ID 6
#define PAYLOAD_SIZE_MAX 1024
#define RRC_BUF_SIZE 255
#define RRC_BUF_SIZE 8192
#define UNDEF_SECURITY_MODE 0xff
#define NO_SECURITY_MODE 0x20
......
......@@ -128,7 +128,7 @@ typedef enum UE_STATE_NR_e {
#define MAX_MEAS_ID 6
#define PAYLOAD_SIZE_MAX 1024
#define RRC_BUF_SIZE 255
#define RRC_BUF_SIZE 8192
#define UNDEF_SECURITY_MODE 0xff
#define NO_SECURITY_MODE 0x20
......@@ -443,6 +443,7 @@ typedef struct {
NR_BCCH_DL_SCH_Message_t systemInformation; // SIB23
int ssb_SubcarrierOffset;
int pdsch_AntennaPorts;
int pusch_AntennaPorts;
int pusch_TargetSNRx10;
int pucch_TargetSNRx10;
NR_BCCH_DL_SCH_Message_t *siblock1;
......
......@@ -236,6 +236,7 @@ static void init_NR_SI(gNB_RRC_INST *rrc, gNB_RrcConfigurationReq *configuration
rrc_mac_config_req_gNB(rrc->module_id,
rrc->carrier.ssb_SubcarrierOffset,
rrc->carrier.pdsch_AntennaPorts,
rrc->carrier.pusch_AntennaPorts,
rrc->carrier.pusch_TargetSNRx10,
rrc->carrier.pucch_TargetSNRx10,
(NR_ServingCellConfigCommon_t *)rrc->carrier.servingcellconfigcommon,
......@@ -329,6 +330,7 @@ char openair_rrc_gNB_configuration(const module_id_t gnb_mod_idP, gNB_RrcConfigu
rrc->carrier.servingcellconfigcommon = configuration->scc;
rrc->carrier.ssb_SubcarrierOffset = configuration->ssb_SubcarrierOffset;
rrc->carrier.pdsch_AntennaPorts = configuration->pdsch_AntennaPorts;
rrc->carrier.pusch_AntennaPorts = configuration->pusch_AntennaPorts;
rrc->carrier.pusch_TargetSNRx10 = configuration->pusch_TargetSNRx10;
rrc->carrier.pucch_TargetSNRx10 = configuration->pucch_TargetSNRx10;
/// System Information INIT
......@@ -538,6 +540,7 @@ rrc_gNB_generate_RRCSetup_for_RRCReestablishmentRequest(
rrc_mac_config_req_gNB(rrc_instance_p->module_id,
rrc_instance_p->carrier.ssb_SubcarrierOffset,
rrc_instance_p->carrier.pdsch_AntennaPorts,
rrc_instance_p->carrier.pusch_AntennaPorts,
rrc_instance_p->carrier.pusch_TargetSNRx10,
rrc_instance_p->carrier.pucch_TargetSNRx10,
(NR_ServingCellConfigCommon_t *)rrc_instance_p->carrier.servingcellconfigcommon,
......
......@@ -358,6 +358,7 @@ void rrc_add_nsa_user(gNB_RRC_INST *rrc,struct rrc_gNB_ue_context_s *ue_context_
rrc_mac_config_req_gNB(rrc->module_id,
rrc->carrier.ssb_SubcarrierOffset,
rrc->carrier.pdsch_AntennaPorts,
rrc->carrier.pusch_AntennaPorts,
rrc->carrier.pusch_TargetSNRx10,
rrc->carrier.pucch_TargetSNRx10,
NULL,
......
......@@ -656,7 +656,7 @@ void fill_default_secondaryCellGroup(NR_ServingCellConfigCommon_t *servingcellco
}
bwp->bwp_Dedicated->pdsch_Config->choice.setup->dataScramblingIdentityPDSCH = NULL;
bwp->bwp_Dedicated->pdsch_Config->choice.setup->dmrs_DownlinkForPDSCH_MappingTypeA->choice.setup->dmrs_Type=NULL;
bwp->bwp_Dedicated->pdsch_Config->choice.setup->dmrs_DownlinkForPDSCH_MappingTypeA->choice.setup->dmrs_Type=NULL;//calloc(1,sizeof(*bwp->bwp_Dedicated->pdsch_Config->choice.setup->dmrs_DownlinkForPDSCH_MappingTypeA->choice.setup->dmrs_Type));
bwp->bwp_Dedicated->pdsch_Config->choice.setup->dmrs_DownlinkForPDSCH_MappingTypeA->choice.setup->maxLength=NULL;
bwp->bwp_Dedicated->pdsch_Config->choice.setup->dmrs_DownlinkForPDSCH_MappingTypeA->choice.setup->scramblingID0=NULL;
bwp->bwp_Dedicated->pdsch_Config->choice.setup->dmrs_DownlinkForPDSCH_MappingTypeA->choice.setup->scramblingID1=NULL;
......
......@@ -25,7 +25,6 @@
*/
#define _LARGEFILE_SOURCE
#define _FILE_OFFSET_BITS 64
#define NB_ANTENNAS_RX 2
#include <string.h>
#include <pthread.h>
#include <unistd.h>
......
......@@ -54,7 +54,7 @@
#include <targets/ARCH/rfsimulator/rfsimulator.h>
#define PORT 4043 //default TCP port for this simulator
#define CirSize 307200 // 100ms is enough
#define CirSize 6144000 // 100ms is enough
#define sampleToByte(a,b) ((a)*(b)*sizeof(sample_t))
#define byteToSample(a,b) ((a)/(sizeof(sample_t)*(b)))
......
......@@ -23,6 +23,7 @@ gNBs =
ssb_SubcarrierOffset = 31; //0;
pdsch_AntennaPorts = 1;
pusch_AntennaPorts = 1;
#pusch_TargetSNRx10 = 200;
#pucch_TargetSNRx10 = 200;
pusch_TargetSNRx10 = 200;
......@@ -50,7 +51,7 @@ gNBs =
#initialDownlinkBWP
#genericParameters
# this is RBstart=84,L=13 (275*(L-1))+RBstart
initialDLBWPlocationAndBandwidth = 6366; //28875; //6366; #6407; #3384;
initialDLBWPlocationAndBandwidth = 6368;
# subcarrierSpacing
# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120
initialDLBWPsubcarrierSpacing = 1;
......@@ -92,7 +93,7 @@ gNBs =
pMax = 20;
#initialUplinkBWP
#genericParameters
initialULBWPlocationAndBandwidth = 6366; //28875; //6366; #6407; #3384;
initialULBWPlocationAndBandwidth = 6368;
# subcarrierSpacing
# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120
initialULBWPsubcarrierSpacing = 1;
......
......@@ -23,6 +23,7 @@ gNBs =
ssb_SubcarrierOffset = 0;
pdsch_AntennaPorts = 1;
pusch_AntennaPorts = 1;
servingCellConfigCommon = (
{
......
......@@ -23,6 +23,7 @@ gNBs =
ssb_SubcarrierOffset = 0;
pdsch_AntennaPorts = 1;
pusch_AntennaPorts = 1;
servingCellConfigCommon = (
{
......
......@@ -23,6 +23,7 @@ gNBs =
ssb_SubcarrierOffset = 0;
pdsch_AntennaPorts = 1;
pusch_AntennaPorts = 1;
pusch_TargetSNRx10 = 200;
pucch_TargetSNRx10 = 200;
......
......@@ -23,6 +23,7 @@ gNBs =
ssb_SubcarrierOffset = 0;
pdsch_AntennaPorts = 1;
pusch_AntennaPorts = 1;
servingCellConfigCommon = (
{
......@@ -238,7 +239,7 @@ L1s = (
RUs = (
{
local_rf = "yes"
local_rf = "yes"
nb_tx = 1;
nb_rx = 1;
att_tx = 0;
......@@ -247,15 +248,14 @@ RUs = (
max_pdschReferenceSignalPower = -27;
max_rxgain = 75;
eNB_instances = [0];
##beamforming 1x2 matrix: 1 layer x 2 antennas
## beamforming 1x2 matrix: 1 layer x 2 antennas
bf_weights = [0x00007fff, 0x0000];
##beamforming 1x4 matrix: 1 layer x 4 antennas
## beamforming 1x4 matrix: 1 layer x 4 antennas
#bf_weights = [0x00007fff, 0x0000,0x0000, 0x0000];
## beamforming 2x2 matrix:
# bf_weights = [0x00007fff, 0x00000000, 0x00000000, 0x00007fff];
#bf_weights = [0x00007fff, 0x00000000, 0x00000000, 0x00007fff];
## beamforming 4x4 matrix:
#bf_weights = [0x00007fff, 0x0000, 0x0000, 0x0000, 0x00000000, 0x00007fff, 0x0000, 0x0000, 0x0000, 0x0000, 0x00007fff, 0x0000, 0x0000, 0x0000, 0x0000, 0x00007fff];
sdr_addrs = "addr=192.168.10.2,mgmt_addr=192.168.10.2,second_addr=192.168.20.2";
clock_src = "external";
# if_freq = 3700000000L;
......
......@@ -23,6 +23,7 @@ gNBs =
ssb_SubcarrierOffset = 0;
pdsch_AntennaPorts = 1;
pusch_AntennaPorts = 1;
servingCellConfigCommon = (
{
......@@ -238,7 +239,7 @@ L1s = (
RUs = (
{
local_rf = "yes"
local_rf = "yes"
nb_tx = 1;
nb_rx = 1;
att_tx = 0;
......@@ -247,15 +248,14 @@ RUs = (
max_pdschReferenceSignalPower = -27;
max_rxgain = 114;
eNB_instances = [0];
##beamforming 1x2 matrix: 1 layer x 2 antennas
## beamforming 1x2 matrix: 1 layer x 2 antennas
bf_weights = [0x00007fff, 0x0000];
##beamforming 1x4 matrix: 1 layer x 4 antennas
## beamforming 1x4 matrix: 1 layer x 4 antennas
#bf_weights = [0x00007fff, 0x0000,0x0000, 0x0000];
## beamforming 2x2 matrix:
# bf_weights = [0x00007fff, 0x00000000, 0x00000000, 0x00007fff];
#bf_weights = [0x00007fff, 0x00000000, 0x00000000, 0x00007fff];
## beamforming 4x4 matrix:
#bf_weights = [0x00007fff, 0x0000, 0x0000, 0x0000, 0x00000000, 0x00007fff, 0x0000, 0x0000, 0x0000, 0x0000, 0x00007fff, 0x0000, 0x0000, 0x0000, 0x0000, 0x00007fff];
sdr_addrs = "type=x300";
clock_src = "external";
# if_freq = 3700000000L;
......
......@@ -23,6 +23,7 @@ gNBs =
ssb_SubcarrierOffset = 31;
pdsch_AntennaPorts = 1;
pusch_AntennaPorts = 1;
servingCellConfigCommon = (
{
......@@ -46,7 +47,7 @@ gNBs =
#initialDownlinkBWP
#genericParameters
# this is RBstart=84,L=13 (275*(L-1))+RBstart
initialDLBWPlocationAndBandwidth = 6366;
initialDLBWPlocationAndBandwidth = 6368;
# subcarrierSpacing
# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120
initialDLBWPsubcarrierSpacing = 1;
......@@ -83,7 +84,7 @@ gNBs =
pMax = 20;
#initialUplinkBWP
#genericParameters
initialULBWPlocationAndBandwidth = 6366;
initialULBWPlocationAndBandwidth = 6368;
# subcarrierSpacing
# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120
initialULBWPsubcarrierSpacing = 1;
......
......@@ -23,6 +23,7 @@ gNBs =
ssb_SubcarrierOffset = 0;
pdsch_AntennaPorts = 1;
pusch_AntennaPorts = 1;
servingCellConfigCommon = (
{
......@@ -46,7 +47,7 @@ gNBs =
#initialDownlinkBWP
#genericParameters
# this is RBstart=0,L=50 (275*(L-1))+RBstart
initialDLBWPlocationAndBandwidth = 6366;
initialDLBWPlocationAndBandwidth = 6368;
# subcarrierSpacing
# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120
initialDLBWPsubcarrierSpacing = 1;
......@@ -89,7 +90,7 @@ gNBs =
pMax = 20;
#initialUplinkBWP
#genericParameters
initialULBWPlocationAndBandwidth = 6366;
initialULBWPlocationAndBandwidth = 6368;
# subcarrierSpacing
# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120
initialULBWPsubcarrierSpacing = 1;
......
......@@ -23,6 +23,7 @@ gNBs =
ssb_SubcarrierOffset = 0;
pdsch_AntennaPorts = 1;
pusch_AntennaPorts = 1;
servingCellConfigCommon = (
{
......
......@@ -23,6 +23,7 @@ gNBs =
ssb_SubcarrierOffset = 0;
pdsch_AntennaPorts = 1;
pusch_AntennaPorts = 1;
servingCellConfigCommon = (
{
......@@ -282,6 +283,7 @@ L1s = (
{
num_cc = 1;
tr_n_preference = "local_mac";
pusch_proc_threads = 8;
}
);
......@@ -296,8 +298,14 @@ RUs = (
max_pdschReferenceSignalPower = -27;
max_rxgain = 114;
eNB_instances = [0];
#beamforming 1x4 matrix:
bf_weights = [0x00007fff, 0x0000, 0x0000, 0x0000];
## beamforming 1x2 matrix: 1 layer x 2 antennas
bf_weights = [0x00007fff, 0x0000];
## beamforming 1x4 matrix: 1 layer x 4 antennas
#bf_weights = [0x00007fff, 0x0000,0x0000, 0x0000];
## beamforming 2x2 matrix:
#bf_weights = [0x00007fff, 0x00000000, 0x00000000, 0x00007fff];
## beamforming 4x4 matrix:
#bf_weights = [0x00007fff, 0x0000, 0x0000, 0x0000, 0x00000000, 0x00007fff, 0x0000, 0x0000, 0x0000, 0x0000, 0x00007fff, 0x0000, 0x0000, 0x0000, 0x0000, 0x00007fff];
sdr_addrs = "type=x300";
clock_src = "external";
}
......
......@@ -23,6 +23,7 @@ gNBs =
ssb_SubcarrierOffset = 0;
pdsch_AntennaPorts = 1;
pusch_AntennaPorts = 1;
servingCellConfigCommon = (
{
......@@ -228,7 +229,7 @@ L1s = (
RUs = (
{
local_rf = "yes"
local_rf = "yes"
nb_tx = 1
nb_rx = 1
att_tx = 0
......@@ -237,7 +238,15 @@ RUs = (
max_pdschReferenceSignalPower = -27;
max_rxgain = 114;
eNB_instances = [0];
sdr_addrs = "type=b200";
## beamforming 1x2 matrix: 1 layer x 2 antennas
#bf_weights = [0x00007fff, 0x00007fff];
## beamforming 1x4 matrix: 1 layer x 4 antennas
#bf_weights = [0x00007fff, 0x0000,0x0000, 0x0000];
## beamforming 2x2 matrix:
#bf_weights = [0x00007fff, 0x00000000, 0x00000000, 0x00007fff];
## beamforming 4x4 matrix:
#bf_weights = [0x00007fff, 0x0000, 0x0000, 0x0000, 0x00000000, 0x00007fff, 0x0000, 0x0000, 0x0000, 0x0000, 0x00007fff, 0x0000, 0x0000, 0x0000, 0x0000, 0x00007fff];
sdr_addrs = "type=b200";
#clock_src = "external";
}
);
......
......@@ -23,6 +23,7 @@ gNBs =
ssb_SubcarrierOffset = 0;
pdsch_AntennaPorts = 1;
pusch_AntennaPorts = 1;
servingCellConfigCommon = (
{
......@@ -46,7 +47,7 @@ gNBs =
#initialDownlinkBWP
#genericParameters
# this is RBstart=41,L=24 (275*(L-1))+RBstart
initialDLBWPlocationAndBandwidth = 6366;
initialDLBWPlocationAndBandwidth = 6368;
# subcarrierSpacing
# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120
initialDLBWPsubcarrierSpacing = 1;
......@@ -89,7 +90,7 @@ gNBs =
pMax = 20;
#initialUplinkBWP
#genericParameters
initialULBWPlocationAndBandwidth = 6366;
initialULBWPlocationAndBandwidth = 6368;
# subcarrierSpacing
# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120
initialULBWPsubcarrierSpacing = 1;
......@@ -239,7 +240,7 @@ L1s = (
RUs = (
{
local_rf = "yes"
local_rf = "yes"
nb_tx = 1
nb_rx = 1
att_tx = 0
......@@ -248,15 +249,14 @@ RUs = (
max_pdschReferenceSignalPower = -27;
max_rxgain = 50;
eNB_instances = [0];
##beamforming 1x2 matrix: 1 layer x 2 antennas
bf_weights = [0x00007fff, 0x0000];
##beamforming 1x4 matrix: 1 layer x 4 antennas
## beamforming 1x2 matrix: 1 layer x 2 antennas
#bf_weights = [0x00007fff, 0x00007fff];
## beamforming 1x4 matrix: 1 layer x 4 antennas
#bf_weights = [0x00007fff, 0x0000,0x0000, 0x0000];
## beamforming 2x2 matrix:
# bf_weights = [0x00007fff, 0x00000000, 0x00000000, 0x00007fff];
#bf_weights = [0x00007fff, 0x00000000, 0x00000000, 0x00007fff];
## beamforming 4x4 matrix:
#bf_weights = [0x00007fff, 0x0000, 0x0000, 0x0000, 0x00000000, 0x00007fff, 0x0000, 0x0000, 0x0000, 0x0000, 0x00007fff, 0x0000, 0x0000, 0x0000, 0x0000, 0x00007fff];
sdr_addrs = "addr=192.168.10.2,mgmt_addr=192.168.10.2,second_addr=192.168.20.2";
clock_src = "external";
}
......
......@@ -23,6 +23,7 @@ gNBs =
ssb_SubcarrierOffset = 0;
pdsch_AntennaPorts = 1;
pusch_AntennaPorts = 1;
servingCellConfigCommon = (
{
......@@ -46,7 +47,7 @@ gNBs =
#initialDownlinkBWP
#genericParameters
# this is RBstart=0,L=50 (275*(L-1))+RBstart
initialDLBWPlocationAndBandwidth = 6366;
initialDLBWPlocationAndBandwidth = 6368;
# subcarrierSpacing
# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120
initialDLBWPsubcarrierSpacing = 1;
......@@ -89,7 +90,7 @@ gNBs =
pMax = 20;
#initialUplinkBWP
#genericParameters
initialULBWPlocationAndBandwidth = 6366;
initialULBWPlocationAndBandwidth = 6368;
# subcarrierSpacing
# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120
initialULBWPsubcarrierSpacing = 1;
......@@ -256,7 +257,6 @@ RUs = (
# bf_weights = [0x00007fff, 0x00000000, 0x00000000, 0x00007fff];
## beamforming 4x4 matrix:
#bf_weights = [0x00007fff, 0x0000, 0x0000, 0x0000, 0x00000000, 0x00007fff, 0x0000, 0x0000, 0x0000, 0x0000, 0x00007fff, 0x0000, 0x0000, 0x0000, 0x0000, 0x00007fff];
sdr_addrs = "type=x300";
clock_src = "external";
}
......
......@@ -23,6 +23,7 @@ gNBs =
ssb_SubcarrierOffset = 0;
pdsch_AntennaPorts = 1;
pusch_AntennaPorts = 1;
servingCellConfigCommon = (
{
......
......@@ -23,6 +23,7 @@ gNBs =
ssb_SubcarrierOffset = 0;
pdsch_AntennaPorts = 1;
pusch_AntennaPorts = 1;
servingCellConfigCommon = (
{
......
......@@ -23,6 +23,7 @@ gNBs =
ssb_SubcarrierOffset = 0;
pdsch_AntennaPorts = 1;
pusch_AntennaPorts = 1;
servingCellConfigCommon = (
{
......@@ -257,8 +258,8 @@ RUs = (
## beamforming 4x4 matrix:
#bf_weights = [0x00007fff, 0x0000, 0x0000, 0x0000, 0x00000000, 0x00007fff, 0x0000, 0x0000, 0x0000, 0x0000, 0x00007fff, 0x0000, 0x0000, 0x0000, 0x0000, 0x00007fff];
sdr_addrs = "type=b200";
#"addr=192.168.18.207";
#"addr=192.168.10.2,mgmt_addr=192.168.10.2,second_addr=192.168.20.2";
#"addr=192.168.18.207";
#"addr=192.168.10.2,mgmt_addr=192.168.10.2,second_addr=192.168.20.2";
clock_src = "external";
}
);
......
......@@ -23,6 +23,7 @@ gNBs =
ssb_SubcarrierOffset = 0;
pdsch_AntennaPorts = 1;
pusch_AntennaPorts = 1;
servingCellConfigCommon = (
{
......
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