Commit 803fcb59 authored by Robert Schmidt's avatar Robert Schmidt

Merge remote-tracking branch 'origin/assigned_value_is_garbage_or_undefined'...

Merge remote-tracking branch 'origin/assigned_value_is_garbage_or_undefined' into integration_2023_w43
parents 2f7658d7 364f98ac
......@@ -743,7 +743,8 @@ void *UE_thread(void *arg)
//this thread should be over the processing thread to keep in real time
PHY_VARS_NR_UE *UE = (PHY_VARS_NR_UE *) arg;
// int tx_enabled = 0;
openair0_timestamp timestamp, writeTimestamp;
openair0_timestamp timestamp = 0;
openair0_timestamp writeTimestamp = 0;
void *rxp[NB_ANTENNAS_RX];
int start_rx_stream = 0;
fapi_nr_config_request_t *cfg = &UE->nrUE_config;
......
......@@ -392,9 +392,9 @@ void nr_polar_rate_matching_pattern(uint16_t *rmp,
uint16_t E)
{
uint8_t i;
uint16_t *d, *y, ind;
uint16_t *d, ind;
d = (uint16_t *)malloc(sizeof(uint16_t) * N);
y = (uint16_t *)malloc(sizeof(uint16_t) * N);
uint16_t* y = calloc(N, sizeof(uint16_t));
for (int m=0; m<=N-1; m++) d[m]=m;
......@@ -412,11 +412,11 @@ void nr_polar_rate_matching_pattern(uint16_t *rmp,
} else {
if ( (K/(double)E) <= (7.0/16) ) { //puncturing
for (int k=0; k<=E-1; k++) {
rmp[k]=y[k+N-E];
rmp[k]=y[k+N-E];
}
} else { //shortening
for (int k=0; k<=E-1; k++) {
rmp[k]=y[k];
rmp[k]=y[k];
}
}
}
......
......@@ -151,6 +151,7 @@ int init_frame_parms(LTE_DL_FRAME_PARMS *frame_parms,
frame_parms->ofdm_symbol_size = 256*osf;
frame_parms->samples_per_tti = 3840*osf;
frame_parms->first_carrier_offset = frame_parms->ofdm_symbol_size - 90;
AssertFatal(log2_osf < 4 ,"log2_osf %d will cause undefined behaviour \n", log2_osf);
frame_parms->nb_prefix_samples>>=(3-log2_osf);
frame_parms->nb_prefix_samples0>>=(3-log2_osf);
frame_parms->N_RBGS = 2;
......
......@@ -1065,8 +1065,8 @@ int allocate_REs_in_RB_pilots_QPSK_tm2(PHY_VARS_eNB* phy_vars_eNB,
first_re=6;
re=first_re;
x0p=&x0[*jj];
uint64_t tmp0[4];
uint64_t tmp1[4];
uint64_t tmp0[4] = {0};
uint64_t tmp1[4] = {0};
qam4_table_offset=(((uint32_t)x0p[0]))|
(((uint32_t)x0p[1])<<1)|
......@@ -1338,8 +1338,8 @@ int allocate_REs_in_RB_pilots_16QAM_tm2(PHY_VARS_eNB* phy_vars_eNB,
first_re=6;
re=first_re;
x0p=&x0[*jj];
uint64_t tmp0[4];
uint64_t tmp1[4];
uint64_t tmp0[4] = {0};
uint64_t tmp1[4] = {0};
qam16_table_offset=(((uint32_t)x0p[0])<<1)|(((uint32_t)x0p[2]))|
(((uint32_t)x0p[1])<<3)|(((uint32_t)x0p[3])<<2) |
......@@ -1503,8 +1503,8 @@ int allocate_REs_in_RB_pilots_64QAM_tm2(PHY_VARS_eNB* phy_vars_eNB,
x0p=&x0[*jj];
uint64_t tmp0[4];
uint64_t tmp1[4];
uint64_t tmp0[4] = {0};
uint64_t tmp1[4] = {0};
// 12-bits corresponds to 2 64QAM symbols input which generates 2 64QAM symbols on 2 TX antenna ports
qam64_table_offset=(((uint32_t)x0p[0])<<2)|(((uint32_t)x0p[2])<<1)|(((uint32_t)x0p[4]))|
......@@ -1691,7 +1691,8 @@ int allocate_REs_in_RB(PHY_VARS_eNB* phy_vars_eNB,
int16_t re_off=re_offset;
uint8_t first_re,last_re;
int32_t tmp_sample1,tmp_sample2;
int32_t tmp_sample1 = 0;
int32_t tmp_sample2 = 0;
int16_t tmp_amp=amp;
int s=1;
int mprime2 = mprime,ind,ind_dword,ind_qpsk_symb;
......
......@@ -327,7 +327,7 @@ void cic_decimator(int16_t *input_buffer, int16_t *output_buffer, int length, in
}
/* get working buffers */
buffer_one = malloc(length*sizeof(int32_t) * 2); /* for i&q samples */
buffer_one = calloc(length, sizeof(int32_t) * 2); /* for i&q samples */
if (buffer_one == NULL) {
msg("Fatal memory allocation problem \n");
assert(0);
......
......@@ -608,8 +608,6 @@ int nr_csi_rs_pmi_estimation(const PHY_VARS_NR_UE *ue,
uint32_t *precoded_sinr_dB) {
const NR_DL_FRAME_PARMS *frame_parms = &ue->frame_parms;
memset(i1,0,3*sizeof(uint8_t));
i2[0] = 0;
// i1 is a three-element vector in the form of [i11 i12 i13], when CodebookType is specified as 'Type1SinglePanel'.
// Note that i13 is not applicable when the number of transmission layers is one of {1, 5, 6, 7, 8}.
......@@ -904,8 +902,8 @@ void nr_ue_csi_rs_procedures(PHY_VARS_NR_UE *ue, UE_nr_rxtx_proc_t *proc, c16_t
uint8_t rank_indicator = 0;
uint32_t precoded_sinr_dB = 0;
uint8_t cqi = 0;
uint8_t i1[3];
uint8_t i2[1];
uint8_t i1[3] = {0};
uint8_t i2[1] = {0};
nfapi_nr_dl_tti_csi_rs_pdu_rel15_t csi_params = convert_csirs_pdu(csirs_config_pdu);
nr_generate_csi_rs(frame_parms,
ue->nr_csi_info->csi_rs_generated_signal,
......
......@@ -292,6 +292,7 @@ void nr_ue_ulsch_procedures(PHY_VARS_NR_UE *UE,
/// Transform-coded "y"-sequences (for definition see 38-211 V15.3.0 2018-09, subsection 6.3.1.4)
int32_t y[max_num_re] __attribute__ ((aligned(16)));
memset(y, 0, max_num_re*sizeof(int32_t));
if (pusch_pdu->transform_precoding == transformPrecoder_enabled) {
......
......@@ -666,9 +666,9 @@ void nr_generate_pucch2(const PHY_VARS_NR_UE *ue,
printf("\t [nr_generate_pucch2] start function at slot(nr_slot_tx)=%d with payload=%lu and nr_bit=%d\n",nr_slot_tx, pucch_pdu->payload, pucch_pdu->n_bit);
#endif
// b is the block of bits transmitted on the physical channel after payload coding
uint64_t b[16]; // limit to 1024-bit encoded length
uint64_t b[16] = {0}; // limit to 1024-bit encoded length
// M_bit is the number of bits of block b (payload after encoding)
uint16_t M_bit;
uint16_t M_bit = 0;
nr_uci_encoding(pucch_pdu->payload,
pucch_pdu->n_bit,
2,0,
......@@ -687,7 +687,8 @@ void nr_generate_pucch2(const PHY_VARS_NR_UE *ue,
* n_id = {0,1,...,1023} equals the higher-layer parameter Data-scrambling-Identity if configured
* n_id = N_ID_cell if higher layer parameter not configured
*/
uint8_t *btilde = malloc(sizeof(int8_t)*M_bit);
uint8_t *btilde = calloc(M_bit, sizeof(uint8_t));
// rnti is given by the C-RNTI
uint16_t rnti=pucch_pdu->rnti;
#ifdef DEBUG_NR_PUCCH_TX
......@@ -716,8 +717,8 @@ void nr_generate_pucch2(const PHY_VARS_NR_UE *ue,
*/
//#define ONE_OVER_SQRT2_S 23171 // 32767/sqrt(2) = 23170 (ONE_OVER_SQRT2)
// complex-valued symbol d(0)
int16_t *d_re = malloc(sizeof(int16_t)*M_bit);
int16_t *d_im = malloc(sizeof(int16_t)*M_bit);
int16_t *d_re = calloc(M_bit, sizeof(int16_t));
int16_t *d_im = calloc(M_bit, sizeof(int16_t));
uint16_t m_symbol = (M_bit%2==0) ? M_bit/2 : floor(M_bit/2)+1;
for (int i=0; i < m_symbol; i++) { // QPSK modulation subclause 5.1.3
......
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