Commit 3d4f6462 authored by Florian Kaltenberger's avatar Florian Kaltenberger

nr_pbchsim should use less memory now. also fixed some error messages.

parent cefd7cee
......@@ -666,14 +666,14 @@ int nr_rx_pbch( PHY_VARS_NR_UE *ue,
if(decoderState == -1)
return(decoderState);
printf("polar decoder output 0x%08x\n",nr_ue_pbch_vars->pbch_a_prime);
//printf("polar decoder output 0x%08x\n",nr_ue_pbch_vars->pbch_a_prime);
//payload un-scrambling
memset(&nr_ue_pbch_vars->pbch_a_interleaved, 0, sizeof(uint32_t) );
M = (Lmax == 64)? (NR_POLAR_PBCH_PAYLOAD_BITS - 6) : (NR_POLAR_PBCH_PAYLOAD_BITS - 3);
nushift = ((nr_ue_pbch_vars->pbch_a_prime>>24)&1) ^ (((nr_ue_pbch_vars->pbch_a_prime>>6)&1)<<1);
nr_pbch_unscrambling(nr_ue_pbch_vars,frame_parms->Nid_cell,nushift,M,NR_POLAR_PBCH_PAYLOAD_BITS,1,unscrambling_mask);
printf("nushift %d sfn 3rd %d 2nd %d", nushift,((nr_ue_pbch_vars->pbch_a_prime>>6)&1), ((nr_ue_pbch_vars->pbch_a_prime>>24)&1) );
//printf("nushift %d sfn 3rd %d 2nd %d", nushift,((nr_ue_pbch_vars->pbch_a_prime>>6)&1), ((nr_ue_pbch_vars->pbch_a_prime>>24)&1) );
//payload deinterleaving
//uint32_t in=0;
......
......@@ -383,8 +383,8 @@ void init_context_pss_nr(NR_DL_FRAME_PARMS *frame_parms_ue)
bzero( primary_synchro_nr[i], sizePss);
}
else {
msg("Fatal memory allocation problem \n");
assert(0);
LOG_E(PHY,"Fatal memory allocation problem \n");
assert(0);
}
p = malloc(LENGTH_PSS_NR*2);
if (p != NULL) {
......@@ -397,7 +397,7 @@ void init_context_pss_nr(NR_DL_FRAME_PARMS *frame_parms_ue)
bzero( primary_synchro_time_nr[i], size);
}
else {
msg("Fatal memory allocation problem \n");
LOG_E(PHY,"Fatal memory allocation problem \n");
assert(0);
}
......@@ -408,7 +408,7 @@ void init_context_pss_nr(NR_DL_FRAME_PARMS *frame_parms_ue)
bzero( pss_corr_ue[i], size);
}
else {
msg("Fatal memory allocation problem \n");
LOG_E(PHY,"Fatal memory allocation problem \n");
assert(0);
}
......@@ -437,7 +437,7 @@ void free_context_pss_nr(void)
primary_synchro_time_nr[i] = NULL;
}
else {
msg("Fatal memory deallocation problem \n");
LOG_E(PHY,"Fatal memory deallocation problem \n");
assert(0);
}
......@@ -446,7 +446,7 @@ void free_context_pss_nr(void)
primary_synchro_nr[i] = NULL;
}
else {
msg("Fatal memory deallocation problem \n");
LOG_E(PHY,"Fatal memory deallocation problem \n");
assert(0);
}
......@@ -455,7 +455,7 @@ void free_context_pss_nr(void)
pss_corr_ue[i] = NULL;
}
else {
msg("Fatal memory deallocation problem \n");
LOG_E(PHY,"Fatal memory deallocation problem \n");
assert(0);
}
}
......@@ -480,13 +480,13 @@ void init_context_synchro_nr(NR_DL_FRAME_PARMS *frame_parms_ue)
/* initialise global buffers for synchronisation */
synchroF_tmp = malloc16(SYNCF_TMP_SIZE);
if (synchroF_tmp == NULL) {
msg("Fatal memory allocation problem \n");
LOG_E(PHY,"Fatal memory allocation problem \n");
assert(0);
}
synchro_tmp = malloc16(SYNC_TMP_SIZE);
if (synchro_tmp == NULL) {
msg("Fatal memory allocation problem \n");
LOG_E(PHY,"Fatal memory allocation problem \n");
assert(0);
}
......@@ -518,7 +518,7 @@ void free_context_synchro_nr(void)
synchroF_tmp = NULL;
}
else {
msg("Fatal memory deallocation problem \n");
LOG_E(PHY,"Fatal memory deallocation problem \n");
assert(0);
}
......@@ -527,7 +527,7 @@ void free_context_synchro_nr(void)
synchro_tmp = NULL;
}
else {
msg("Fatal memory deallocation problem \n");
LOG_E(PHY,"Fatal memory deallocation problem \n");
assert(0);
}
......
......@@ -427,7 +427,7 @@ int main(int argc, char **argv)
//configure UE
UE = malloc(sizeof(PHY_VARS_NR_UE));
memcpy(&UE->frame_parms,frame_parms,sizeof(NR_DL_FRAME_PARMS));
phy_init_nr_top(UE);
//phy_init_nr_top(UE); //called from init_nr_ue_signal
if (run_initial_sync==1) UE->is_synchronized = 0;
else UE->is_synchronized = 1;
......
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