Merge remote-tracking branch 'origin/develop' into benetel_phase_rotation
This commit is contained in:
@@ -179,7 +179,7 @@ void prach_eNB_tosplit(uint8_t *bufferZone, int bufSize, PHY_VARS_eNB *eNB, L1_r
|
||||
ru=eNB->RU_list[i];
|
||||
|
||||
for (ru_aa=0,aa=0; ru_aa<ru->nb_rx; ru_aa++,aa++) {
|
||||
eNB->prach_vars.rxsigF[0][aa] = eNB->RU_list[i]->prach_rxsigF[ru_aa];
|
||||
eNB->prach_vars.rxsigF[0][aa] = eNB->RU_list[i]->prach_rxsigF[0][ru_aa];
|
||||
int ce_level;
|
||||
|
||||
for (ce_level=0; ce_level<4; ce_level++)
|
||||
|
||||
@@ -228,7 +228,7 @@ void init_eNB_afterRU(void) {
|
||||
|
||||
for (int i=0; i<eNB->RU_list[ru_id]->nb_rx; aa++,i++) {
|
||||
LOG_I(PHY,"Attaching RU %d antenna %d to eNB antenna %d\n",eNB->RU_list[ru_id]->idx,i,aa);
|
||||
eNB->prach_vars.rxsigF[0][aa] = eNB->RU_list[ru_id]->prach_rxsigF[i];
|
||||
eNB->prach_vars.rxsigF[0][aa] = eNB->RU_list[ru_id]->prach_rxsigF[0][i];
|
||||
|
||||
for (int ce_level=0; ce_level<4; ce_level++)
|
||||
eNB->prach_vars_br.rxsigF[ce_level][aa] = eNB->RU_list[ru_id]->prach_rxsigF_br[ce_level][i];
|
||||
@@ -483,7 +483,7 @@ void prach_procedures_ocp(PHY_VARS_eNB *eNB, L1_rxtx_proc_t *proc, int br_flag)
|
||||
ru=eNB->RU_list[i];
|
||||
|
||||
for (ru_aa=0,aa=0; ru_aa<ru->nb_rx; ru_aa++,aa++) {
|
||||
eNB->prach_vars.rxsigF[0][aa] = eNB->RU_list[i]->prach_rxsigF[ru_aa];
|
||||
eNB->prach_vars.rxsigF[0][aa] = eNB->RU_list[i]->prach_rxsigF[0][ru_aa];
|
||||
int ce_level;
|
||||
|
||||
if (br_flag==1)
|
||||
|
||||
+91
-20
@@ -139,7 +139,6 @@ extern void add_subframe(uint16_t *frameP, uint16_t *subframeP, int offset);
|
||||
//#define TICK_TO_US(ts) (ts.diff)
|
||||
#define TICK_TO_US(ts) (ts.trials==0?0:ts.diff/ts.trials)
|
||||
|
||||
|
||||
static inline int rxtx(PHY_VARS_gNB *gNB, int frame_rx, int slot_rx, int frame_tx, int slot_tx, char *thread_name) {
|
||||
|
||||
sl_ahead = sf_ahead*gNB->frame_parms.slots_per_subframe;
|
||||
@@ -178,6 +177,59 @@ static inline int rxtx(PHY_VARS_gNB *gNB, int frame_rx, int slot_rx, int frame_t
|
||||
|
||||
T(T_GNB_PHY_DL_TICK, T_INT(gNB->Mod_id), T_INT(frame_tx), T_INT(slot_tx));
|
||||
|
||||
/* hack to remove UEs */
|
||||
extern int rnti_to_remove[10];
|
||||
extern volatile int rnti_to_remove_count;
|
||||
extern pthread_mutex_t rnti_to_remove_mutex;
|
||||
if (pthread_mutex_lock(&rnti_to_remove_mutex)) exit(1);
|
||||
int up_removed = 0;
|
||||
int down_removed = 0;
|
||||
int pucch_removed = 0;
|
||||
for (int i = 0; i < rnti_to_remove_count; i++) {
|
||||
LOG_W(PHY, "to remove rnti %d\n", rnti_to_remove[i]);
|
||||
void clean_gNB_ulsch(NR_gNB_ULSCH_t *ulsch);
|
||||
void clean_gNB_dlsch(NR_gNB_DLSCH_t *dlsch);
|
||||
int j;
|
||||
for (j = 0; j < NUMBER_OF_NR_ULSCH_MAX; j++)
|
||||
if (gNB->ulsch[j][0]->rnti == rnti_to_remove[i]) {
|
||||
gNB->ulsch[j][0]->rnti = 0;
|
||||
gNB->ulsch[j][0]->harq_mask = 0;
|
||||
//clean_gNB_ulsch(gNB->ulsch[j][0]);
|
||||
int h;
|
||||
for (h = 0; h < NR_MAX_ULSCH_HARQ_PROCESSES; h++) {
|
||||
gNB->ulsch[j][0]->harq_processes[h]->status = SCH_IDLE;
|
||||
gNB->ulsch[j][0]->harq_processes[h]->round = 0;
|
||||
gNB->ulsch[j][0]->harq_processes[h]->handled = 0;
|
||||
}
|
||||
up_removed++;
|
||||
}
|
||||
for (j = 0; j < NUMBER_OF_NR_DLSCH_MAX; j++)
|
||||
if (gNB->dlsch[j][0]->rnti == rnti_to_remove[i]) {
|
||||
gNB->dlsch[j][0]->rnti = 0;
|
||||
gNB->dlsch[j][0]->harq_mask = 0;
|
||||
//clean_gNB_dlsch(gNB->dlsch[j][0]);
|
||||
down_removed++;
|
||||
}
|
||||
for (j = 0; j < NUMBER_OF_NR_PUCCH_MAX; j++)
|
||||
if (gNB->pucch[j]->active > 0 &&
|
||||
gNB->pucch[j]->pucch_pdu.rnti == rnti_to_remove[i]) {
|
||||
gNB->pucch[j]->active = 0;
|
||||
gNB->pucch[j]->pucch_pdu.rnti = 0;
|
||||
pucch_removed++;
|
||||
}
|
||||
#if 0
|
||||
for (j = 0; j < NUMBER_OF_NR_PDCCH_MAX; j++)
|
||||
gNB->pdcch_pdu[j].frame = -1;
|
||||
for (j = 0; j < NUMBER_OF_NR_PDCCH_MAX; j++)
|
||||
gNB->ul_pdcch_pdu[j].frame = -1;
|
||||
for (j = 0; j < NUMBER_OF_NR_PRACH_MAX; j++)
|
||||
gNB->prach_vars.list[j].frame = -1;
|
||||
#endif
|
||||
}
|
||||
if (rnti_to_remove_count) LOG_W(PHY, "to remove rnti_to_remove_count=%d, up_removed=%d down_removed=%d pucch_removed=%d\n", rnti_to_remove_count, up_removed, down_removed, pucch_removed);
|
||||
rnti_to_remove_count = 0;
|
||||
if (pthread_mutex_unlock(&rnti_to_remove_mutex)) exit(1);
|
||||
|
||||
/*
|
||||
// if this is IF5 or 3GPP_gNB
|
||||
if (gNB && gNB->RU_list && gNB->RU_list[0] && gNB->RU_list[0]->function < NGFI_RAU_IF4p5) {
|
||||
@@ -203,11 +255,8 @@ static inline int rxtx(PHY_VARS_gNB *gNB, int frame_rx, int slot_rx, int frame_t
|
||||
// TODO: check if this is correct for PARALLEL_RU_L1_TRX_SPLIT
|
||||
|
||||
// Do PRACH RU processing
|
||||
int prach_id=find_nr_prach(gNB,frame_rx,slot_rx,0,SEARCH_EXIST);
|
||||
if (prach_id>=0) {
|
||||
L1_nr_prach_procedures(gNB,frame_rx,slot_rx,&gNB->prach_vars.list[prach_id].pdu);
|
||||
gNB->prach_vars.list[prach_id].frame=-1;
|
||||
}
|
||||
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],
|
||||
@@ -553,6 +602,8 @@ int wakeup_rxtx(PHY_VARS_gNB *gNB,RU_t *ru) {
|
||||
int i;
|
||||
struct timespec abstime;
|
||||
int time_ns = 50000;
|
||||
int wait_timer = 0;
|
||||
bool do_last_check = 1;
|
||||
|
||||
AssertFatal((ret=pthread_mutex_lock(&proc->mutex_RU))==0,"mutex_lock returns %d\n",ret);
|
||||
for (i=0; i<gNB->num_RU; i++) {
|
||||
@@ -573,22 +624,36 @@ int wakeup_rxtx(PHY_VARS_gNB *gNB,RU_t *ru) {
|
||||
AssertFatal((ret=pthread_mutex_unlock(&proc->mutex_RU))==0,"muex_unlock returns %d\n",ret);
|
||||
}
|
||||
|
||||
clock_gettime(CLOCK_REALTIME, &abstime);
|
||||
abstime.tv_nsec = abstime.tv_nsec + time_ns;
|
||||
|
||||
if (abstime.tv_nsec >= 1000*1000*1000) {
|
||||
abstime.tv_nsec -= 1000*1000*1000;
|
||||
abstime.tv_sec += 1;
|
||||
}
|
||||
|
||||
// wake up TX for subframe n+sf_ahead
|
||||
// lock the TX mutex and make sure the thread is ready
|
||||
AssertFatal((ret=pthread_mutex_timedlock(&L1_proc->mutex, &abstime)) == 0,"mutex_lock returns %d\n", ret);
|
||||
while (wait_timer < 200) {
|
||||
clock_gettime(CLOCK_REALTIME, &abstime);
|
||||
abstime.tv_nsec = abstime.tv_nsec + time_ns;
|
||||
|
||||
if (L1_proc->instance_cnt == 0) { // L1_thread is busy so abort the subframe
|
||||
AssertFatal((ret=pthread_mutex_unlock( &L1_proc->mutex))==0,"muex_unlock return %d\n",ret);
|
||||
LOG_W(PHY,"L1_thread isn't ready in %d.%d, aborting RX processing\n",ru_proc->frame_rx,ru_proc->tti_rx);
|
||||
return(-1);
|
||||
if (abstime.tv_nsec >= 1000*1000*1000) {
|
||||
abstime.tv_nsec -= 1000*1000*1000;
|
||||
abstime.tv_sec += 1;
|
||||
}
|
||||
|
||||
AssertFatal((ret=pthread_mutex_timedlock(&L1_proc->mutex, &abstime)) == 0,"mutex_lock returns %d\n", ret);
|
||||
|
||||
if (L1_proc->instance_cnt == 0) { // L1_thread is busy so wait for a bit
|
||||
AssertFatal((ret=pthread_mutex_unlock( &L1_proc->mutex))==0,"muex_unlock return %d\n",ret);
|
||||
wait_timer += 50;
|
||||
usleep(50);
|
||||
}
|
||||
else {
|
||||
do_last_check = 0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (do_last_check) {
|
||||
AssertFatal((ret=pthread_mutex_timedlock(&L1_proc->mutex, &abstime)) == 0,"mutex_lock returns %d\n", ret);
|
||||
if (L1_proc->instance_cnt == 0) { // L1_thread is busy so abort the subframe
|
||||
AssertFatal((ret=pthread_mutex_unlock( &L1_proc->mutex))==0,"muex_unlock return %d\n",ret);
|
||||
LOG_W(PHY,"L1_thread isn't ready in %d.%d, aborting RX processing\n",ru_proc->frame_rx,ru_proc->tti_rx);
|
||||
return (-1);
|
||||
}
|
||||
}
|
||||
|
||||
++L1_proc->instance_cnt;
|
||||
@@ -801,6 +866,12 @@ void init_gNB_proc(int inst) {
|
||||
pthread_mutex_init(&sync_phy_proc.mutex_phy_proc_tx, NULL);
|
||||
pthread_cond_init(&sync_phy_proc.cond_phy_proc_tx, NULL);
|
||||
sync_phy_proc.phy_proc_CC_id = 0;
|
||||
|
||||
gNB->threadPool = (tpool_t*)malloc(sizeof(tpool_t));
|
||||
gNB->respDecode = (notifiedFIFO_t*) malloc(sizeof(notifiedFIFO_t));
|
||||
char ul_pool[] = "-1,-1";
|
||||
initTpool(ul_pool, gNB->threadPool, false);
|
||||
initNotifiedFIFO(gNB->respDecode);
|
||||
}
|
||||
|
||||
|
||||
@@ -915,7 +986,7 @@ void init_eNB_afterRU(void) {
|
||||
|
||||
for (i=0; i<gNB->RU_list[ru_id]->nb_rx; aa++,i++) {
|
||||
LOG_I(PHY,"Attaching RU %d antenna %d to gNB antenna %d\n",gNB->RU_list[ru_id]->idx,i,aa);
|
||||
gNB->prach_vars.rxsigF[aa] = gNB->RU_list[ru_id]->prach_rxsigF[i];
|
||||
gNB->prach_vars.rxsigF[aa] = gNB->RU_list[ru_id]->prach_rxsigF[0][i];
|
||||
gNB->common_vars.rxdataF[aa] = gNB->RU_list[ru_id]->common.rxdataF[i];
|
||||
}
|
||||
}
|
||||
|
||||
+28
-5
@@ -1594,13 +1594,36 @@ void *ru_thread( void *param ) {
|
||||
(void*)ru->common.rxdataF[aa], fp->symbols_per_slot*fp->ofdm_symbol_size*sizeof(int32_t));
|
||||
|
||||
// Do PRACH RU processing
|
||||
|
||||
int prach_id=find_nr_prach_ru(ru,proc->frame_rx,proc->tti_rx,SEARCH_EXIST);
|
||||
uint8_t prachStartSymbol,N_dur;
|
||||
if (prach_id>=0) {
|
||||
rx_nr_prach_ru(ru,
|
||||
ru->prach_list[prach_id].fmt,
|
||||
ru->prach_list[prach_id].numRA,
|
||||
ru->prach_list[prach_id].prachStartSymbol,
|
||||
proc->frame_rx,proc->tti_rx);
|
||||
N_dur = get_nr_prach_duration(ru->prach_list[prach_id].fmt);
|
||||
/*
|
||||
get_nr_prach_info_from_index(ru->config.prach_config.prach_ConfigurationIndex.value,
|
||||
proc->frame_rx,proc->tti_rx,
|
||||
ru->config.carrier_config.dl_frequency.value,
|
||||
fp->numerology_index,
|
||||
fp->frame_type,
|
||||
&format,
|
||||
&start_symbol,
|
||||
&N_t_slot,
|
||||
&N_dur,
|
||||
&RA_sfn_index,
|
||||
&N_RA_slot,
|
||||
&config_period);
|
||||
*/
|
||||
for (int prach_oc = 0; prach_oc<ru->prach_list[prach_id].num_prach_ocas; prach_oc++) {
|
||||
prachStartSymbol = ru->prach_list[prach_id].prachStartSymbol+prach_oc*N_dur;
|
||||
//comment FK: the standard 38.211 section 5.3.2 has one extra term +14*N_RA_slot. This is because there prachStartSymbol is given wrt to start of the 15kHz slot or 60kHz slot. Here we work slot based, so this function is anyway only called in slots where there is PRACH. Its up to the MAC to schedule another PRACH PDU in the case there are there N_RA_slot \in {0,1}.
|
||||
|
||||
rx_nr_prach_ru(ru,
|
||||
ru->prach_list[prach_id].fmt, //could also use format
|
||||
ru->prach_list[prach_id].numRA,
|
||||
prachStartSymbol,
|
||||
prach_oc,
|
||||
proc->frame_rx,proc->tti_rx);
|
||||
}
|
||||
free_nr_ru_prach_entry(ru,prach_id);
|
||||
}
|
||||
}
|
||||
|
||||
+18
-1
@@ -420,7 +420,7 @@ void processSlotRX( PHY_VARS_NR_UE *UE, UE_nr_rxtx_proc_t *proc) {
|
||||
phy_procedures_slot_parallelization_nrUE_RX( UE, proc, 0, 0, 1, UE->mode, no_relay, NULL );
|
||||
#else
|
||||
uint64_t a=rdtsc();
|
||||
phy_procedures_nrUE_RX( UE, proc, 0, 1, UE->mode);
|
||||
phy_procedures_nrUE_RX( UE, proc, 0, UE->mode);
|
||||
LOG_D(PHY,"phy_procedures_nrUE_RX: slot:%d, time %lu\n", proc->nr_tti_rx, (rdtsc()-a)/3500);
|
||||
//printf(">>> nr_ue_pdcch_procedures ended\n");
|
||||
#endif
|
||||
@@ -839,6 +839,23 @@ void init_NR_UE(int nb_inst, char* rrc_config_path) {
|
||||
AssertFatal((rrc_inst = nr_l3_init_ue(rrc_config_path)) != NULL, "can not initialize RRC module\n");
|
||||
AssertFatal((mac_inst = nr_l2_init_ue(rrc_inst)) != NULL, "can not initialize L2 module\n");
|
||||
AssertFatal((mac_inst->if_module = nr_ue_if_module_init(inst)) != NULL, "can not initialize IF module\n");
|
||||
|
||||
NR_PUSCH_TimeDomainResourceAllocationList_t *pusch_TimeDomainAllocationList = NULL;
|
||||
if (mac_inst->ULbwp[0]->bwp_Dedicated->pusch_Config->choice.setup->pusch_TimeDomainAllocationList) {
|
||||
pusch_TimeDomainAllocationList = mac_inst->ULbwp[0]->bwp_Dedicated->pusch_Config->choice.setup->pusch_TimeDomainAllocationList->choice.setup;
|
||||
}
|
||||
else if (mac_inst->ULbwp[0]->bwp_Common->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList) {
|
||||
pusch_TimeDomainAllocationList = mac_inst->ULbwp[0]->bwp_Common->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList;
|
||||
}
|
||||
|
||||
if (pusch_TimeDomainAllocationList) {
|
||||
for(int i = 0; i < pusch_TimeDomainAllocationList->list.count; i++) {
|
||||
AssertFatal(*pusch_TimeDomainAllocationList->list.array[i]->k2 >= DURATION_RX_TO_TX,
|
||||
"Slot offset K2 (%ld) cannot be less than DURATION_RX_TO_TX (%d)\n",
|
||||
*pusch_TimeDomainAllocationList->list.array[i]->k2,
|
||||
DURATION_RX_TO_TX);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+3
-3
@@ -21,8 +21,8 @@
|
||||
|
||||
/* Header file generated by fdesign on Thu Aug 28 12:13:51 2014 */
|
||||
|
||||
#ifndef FD_stats_form_h_
|
||||
#define FD_stats_form_h_
|
||||
#ifndef _EXECUTABLES_STATS_H_
|
||||
#define _EXECUTABLES_STATS_H_
|
||||
|
||||
#include <forms.h>
|
||||
|
||||
@@ -43,4 +43,4 @@ typedef struct {
|
||||
|
||||
extern FD_stats_form *create_form_stats_form( void );
|
||||
|
||||
#endif /* FD_stats_form_h_ */
|
||||
#endif /* _EXECUTABLES_STATS_H_ */
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#ifndef _THREADS_T_H_
|
||||
#define _THREADS_T_H_
|
||||
#ifndef _EXECUTABLES_THREADS_T_H_
|
||||
#define _EXECUTABLES_THREADS_T_H_
|
||||
|
||||
typedef struct threads_s {
|
||||
int main;
|
||||
@@ -18,4 +18,4 @@ typedef struct threads_s {
|
||||
//int dlsch_td1_three;
|
||||
} threads_t;
|
||||
|
||||
#endif /* _THREADS_T_H_ */
|
||||
#endif /* _EXECUTABLES_THREADS_T_H_ */
|
||||
|
||||
Reference in New Issue
Block a user