Commit f0c6b74d authored by knopp's avatar knopp
Browse files

initialization of transport channels in nr_dlsim

parent 09a481d9
...@@ -51,7 +51,7 @@ void nr_polar_init(t_nrPolar_paramsPtr *polarParams, ...@@ -51,7 +51,7 @@ void nr_polar_init(t_nrPolar_paramsPtr *polarParams,
//Parse the list. If the node is already created, return without initialization. //Parse the list. If the node is already created, return without initialization.
while (currentPtr != NULL) { while (currentPtr != NULL) {
printf("currentPtr->idx %d, (%d,%d)\n",currentPtr->idx,currentPtr->payloadBits,currentPtr->encoderLength); //printf("currentPtr->idx %d, (%d,%d)\n",currentPtr->idx,currentPtr->payloadBits,currentPtr->encoderLength);
if (currentPtr->idx == (messageType * messageLength * aggregation_prime)) return; if (currentPtr->idx == (messageType * messageLength * aggregation_prime)) return;
else currentPtr = currentPtr->nextPtr; else currentPtr = currentPtr->nextPtr;
} }
...@@ -64,7 +64,7 @@ void nr_polar_init(t_nrPolar_paramsPtr *polarParams, ...@@ -64,7 +64,7 @@ void nr_polar_init(t_nrPolar_paramsPtr *polarParams,
newPolarInitNode->idx = (messageType * messageLength * aggregation_prime); newPolarInitNode->idx = (messageType * messageLength * aggregation_prime);
newPolarInitNode->nextPtr = NULL; newPolarInitNode->nextPtr = NULL;
printf("newPolarInitNode->idx %d, (%d,%d,%d:%d)\n",newPolarInitNode->idx,messageType,messageLength,aggregation_prime,aggregation_level); //printf("newPolarInitNode->idx %d, (%d,%d,%d:%d)\n",newPolarInitNode->idx,messageType,messageLength,aggregation_prime,aggregation_level);
if (messageType == 0) { //PBCH if (messageType == 0) { //PBCH
newPolarInitNode->n_max = NR_POLAR_PBCH_N_MAX; newPolarInitNode->n_max = NR_POLAR_PBCH_N_MAX;
...@@ -178,7 +178,7 @@ void nr_polar_init(t_nrPolar_paramsPtr *polarParams, ...@@ -178,7 +178,7 @@ void nr_polar_init(t_nrPolar_paramsPtr *polarParams,
if (currentPtr == NULL) if (currentPtr == NULL)
{ {
*polarParams = newPolarInitNode; *polarParams = newPolarInitNode;
printf("Creating first polarParams entry index %d, %p\n",newPolarInitNode->idx,*polarParams); //printf("Creating first polarParams entry index %d, %p\n",newPolarInitNode->idx,*polarParams);
return; return;
} }
//Else, add node to the end of the linked list. //Else, add node to the end of the linked list.
......
...@@ -542,7 +542,7 @@ int nr_rx_pbch( PHY_VARS_NR_UE *ue, ...@@ -542,7 +542,7 @@ int nr_rx_pbch( PHY_VARS_NR_UE *ue,
uint8_t ssb_index=0; uint8_t ssb_index=0;
//uint16_t crc; //uint16_t crc;
unsigned short idx_demod =0; unsigned short idx_demod =0;
int8_t decoderState=0; uint32_t decoderState=0;
uint8_t decoderListSize = 8, pathMetricAppr = 0; uint8_t decoderListSize = 8, pathMetricAppr = 0;
time_stats_t polar_decoder_init,polar_rate_matching,decoding,bit_extraction,deinterleaving; time_stats_t polar_decoder_init,polar_rate_matching,decoding,bit_extraction,deinterleaving;
...@@ -672,7 +672,7 @@ int nr_rx_pbch( PHY_VARS_NR_UE *ue, ...@@ -672,7 +672,7 @@ int nr_rx_pbch( PHY_VARS_NR_UE *ue,
decoderState = polar_decoder_int16(pbch_e_rx,(uint8_t*)&nr_ue_pbch_vars->pbch_a_prime,currentPtr); decoderState = polar_decoder_int16(pbch_e_rx,(uint8_t*)&nr_ue_pbch_vars->pbch_a_prime,currentPtr);
if(decoderState > 0) return(decoderState); if(decoderState) 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);
......
...@@ -487,6 +487,8 @@ int main(int argc, char **argv) ...@@ -487,6 +487,8 @@ int main(int argc, char **argv)
exit(-1); exit(-1);
} }
init_nr_ue_transport(UE,0);
nr_gold_pbch(UE); nr_gold_pbch(UE);
nr_gold_pdcch(UE,0,2); nr_gold_pdcch(UE,0,2);
......
...@@ -453,13 +453,13 @@ void eNB_top(PHY_VARS_eNB *eNB, int frame_rx, int subframe_rx, char *string,RU_t ...@@ -453,13 +453,13 @@ void eNB_top(PHY_VARS_eNB *eNB, int frame_rx, int subframe_rx, char *string,RU_t
proc_rxtx->timestamp_tx = ru_proc->timestamp_rx + (sf_ahead*fp->samples_per_tti); proc_rxtx->timestamp_tx = ru_proc->timestamp_rx + (sf_ahead*fp->samples_per_tti);
proc_rxtx->frame_rx = ru_proc->frame_rx; proc_rxtx->frame_rx = ru_proc->frame_rx;
proc_rxtx->subframe_rx = ru_proc->subframe_rx; proc_rxtx->subframe_rx = ru_proc->tti_rx;
proc_rxtx->frame_tx = (proc_rxtx->subframe_rx > (9-sf_ahead)) ? (proc_rxtx->frame_rx+1)&1023 : proc_rxtx->frame_rx; proc_rxtx->frame_tx = (proc_rxtx->subframe_rx > (9-sf_ahead)) ? (proc_rxtx->frame_rx+1)&1023 : proc_rxtx->frame_rx;
proc_rxtx->subframe_tx = (proc_rxtx->subframe_rx + sf_ahead)%10; proc_rxtx->subframe_tx = (proc_rxtx->subframe_rx + sf_ahead)%10;
if (rxtx(eNB,proc_rxtx,string) < 0) LOG_E(PHY,"eNB %d CC_id %d failed during execution\n",eNB->Mod_id,eNB->CC_id); if (rxtx(eNB,proc_rxtx,string) < 0) LOG_E(PHY,"eNB %d CC_id %d failed during execution\n",eNB->Mod_id,eNB->CC_id);
ru_proc->timestamp_tx = proc_rxtx->timestamp_tx; ru_proc->timestamp_tx = proc_rxtx->timestamp_tx;
ru_proc->subframe_tx = proc_rxtx->subframe_tx; ru_proc->tti_tx = proc_rxtx->subframe_tx;
ru_proc->frame_tx = proc_rxtx->frame_tx; ru_proc->frame_tx = proc_rxtx->frame_tx;
} }
} }
...@@ -474,24 +474,24 @@ int wakeup_txfh(eNB_rxtx_proc_t *proc,RU_proc_t *ru_proc) { ...@@ -474,24 +474,24 @@ int wakeup_txfh(eNB_rxtx_proc_t *proc,RU_proc_t *ru_proc) {
if(wait_on_condition(&ru_proc->mutex_eNBs,&ru_proc->cond_eNBs,&ru_proc->ru_tx_ready,"wakeup_txfh")<0) { if(wait_on_condition(&ru_proc->mutex_eNBs,&ru_proc->cond_eNBs,&ru_proc->ru_tx_ready,"wakeup_txfh")<0) {
LOG_E(PHY,"Frame %d, subframe %d: TX FH not ready\n", ru_proc->frame_tx, ru_proc->subframe_tx); LOG_E(PHY,"Frame %d, subframe %d: TX FH not ready\n", ru_proc->frame_tx, ru_proc->tti_tx);
return(-1); return(-1);
} }
if (release_thread(&ru_proc->mutex_eNBs,&ru_proc->ru_tx_ready,"wakeup_txfh")<0) return(-1); if (release_thread(&ru_proc->mutex_eNBs,&ru_proc->ru_tx_ready,"wakeup_txfh")<0) return(-1);
if (ru_proc->instance_cnt_eNBs == 0) { if (ru_proc->instance_cnt_eNBs == 0) {
LOG_E(PHY,"Frame %d, subframe %d: TX FH thread busy, dropping Frame %d, subframe %d\n", ru_proc->frame_tx, ru_proc->subframe_tx, proc->frame_rx, proc->subframe_rx); LOG_E(PHY,"Frame %d, subframe %d: TX FH thread busy, dropping Frame %d, subframe %d\n", ru_proc->frame_tx, ru_proc->tti_tx, proc->frame_rx, proc->subframe_rx);
return(-1); return(-1);
} }
if (pthread_mutex_timedlock(&ru_proc->mutex_eNBs,&wait) != 0) { if (pthread_mutex_timedlock(&ru_proc->mutex_eNBs,&wait) != 0) {
LOG_E( PHY, "[eNB] ERROR pthread_mutex_lock for eNB TX1 thread %d (IC %d)\n", ru_proc->subframe_rx&1,ru_proc->instance_cnt_eNBs ); LOG_E( PHY, "[eNB] ERROR pthread_mutex_lock for eNB TX1 thread %d (IC %d)\n", ru_proc->tti_rx&1,ru_proc->instance_cnt_eNBs );
exit_fun( "error locking mutex_eNB" ); exit_fun( "error locking mutex_eNB" );
return(-1); return(-1);
} }
++ru_proc->instance_cnt_eNBs; ++ru_proc->instance_cnt_eNBs;
ru_proc->timestamp_tx = proc->timestamp_tx; ru_proc->timestamp_tx = proc->timestamp_tx;
ru_proc->subframe_tx = proc->subframe_tx; ru_proc->tti_tx = proc->subframe_tx;
ru_proc->frame_tx = proc->frame_tx; ru_proc->frame_tx = proc->frame_tx;
// the thread can now be woken up // the thread can now be woken up
...@@ -622,7 +622,7 @@ int wakeup_rxtx(PHY_VARS_eNB *eNB,RU_t *ru) { ...@@ -622,7 +622,7 @@ int wakeup_rxtx(PHY_VARS_eNB *eNB,RU_t *ru) {
// and proc->subframe_tx = proc->subframe_rx+sf_ahead // and proc->subframe_tx = proc->subframe_rx+sf_ahead
proc_rxtx0->timestamp_tx = ru_proc->timestamp_rx + (sf_ahead*fp->samples_per_tti); proc_rxtx0->timestamp_tx = ru_proc->timestamp_rx + (sf_ahead*fp->samples_per_tti);
proc_rxtx0->frame_rx = ru_proc->frame_rx; proc_rxtx0->frame_rx = ru_proc->frame_rx;
proc_rxtx0->subframe_rx = ru_proc->subframe_rx; proc_rxtx0->subframe_rx = ru_proc->tti_rx;
proc_rxtx0->frame_tx = (proc_rxtx0->subframe_rx > (9-sf_ahead)) ? (proc_rxtx0->frame_rx+1)&1023 : proc_rxtx0->frame_rx; proc_rxtx0->frame_tx = (proc_rxtx0->subframe_rx > (9-sf_ahead)) ? (proc_rxtx0->frame_rx+1)&1023 : proc_rxtx0->frame_rx;
proc_rxtx0->subframe_tx = (proc_rxtx0->subframe_rx + sf_ahead)%10; proc_rxtx0->subframe_tx = (proc_rxtx0->subframe_rx + sf_ahead)%10;
......
This diff is collapsed.
...@@ -658,8 +658,6 @@ void set_default_frame_parms(NR_DL_FRAME_PARMS *frame_parms[MAX_NUM_CCs]) { ...@@ -658,8 +658,6 @@ void set_default_frame_parms(NR_DL_FRAME_PARMS *frame_parms[MAX_NUM_CCs]) {
config[CC_id]->subframe_config.dl_cyclic_prefix_type.value = 0; //NORMAL config[CC_id]->subframe_config.dl_cyclic_prefix_type.value = 0; //NORMAL
config[CC_id]->rf_config.dl_carrier_bandwidth.value = 106; config[CC_id]->rf_config.dl_carrier_bandwidth.value = 106;
config[CC_id]->rf_config.ul_carrier_bandwidth.value = 106; config[CC_id]->rf_config.ul_carrier_bandwidth.value = 106;
config[CC_id]->rf_config.tx_antenna_ports.value = 1;
config[CC_id]->rf_config.rx_antenna_ports.value = 1;
config[CC_id]->sch_config.physical_cell_id.value = 0; config[CC_id]->sch_config.physical_cell_id.value = 0;
frame_parms[CC_id]->frame_type = FDD; frame_parms[CC_id]->frame_type = FDD;
......
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