Commit 8176d242 authored by Raymond Knopp's avatar Raymond Knopp

Preconfigured Discovery pool configuration to L1/L2wq

parent bc85cb19
......@@ -604,6 +604,8 @@ void check_and_generate_psdch(PHY_VARS_UE *ue,int frame_tx,int subframe_tx) {
uint32_t absSF = (frame_tx*10)+subframe_tx;
uint32_t absSF_offset,absSF_modP;
LOG_I(PHY,"Checking SLDCH (O %d, P %d, abssF %d\n",O,P,absSF);
absSF_offset = absSF-O;
if (absSF_offset < O) return;
......
......@@ -48,6 +48,8 @@ void check_and_generate_slss(PHY_VARS_UE *ue,int frame_tx,int subframe_tx) {
LOG_D(PHY,"check_and_generate_slss: frame_tx %d, subframe_tx %d : slss->SL_offsetIndicator %d, slss->slmib_length %d\n",
frame_tx,subframe_tx,slss->SL_OffsetIndicator, slss->slmib_length);
if (ue->is_SynchRef == 0) return;
if ((((10*frame_tx) + subframe_tx)%40) != slss->SL_OffsetIndicator) return;
if (slss->slmib_length == 0) return;
......
......@@ -1412,6 +1412,7 @@ typedef struct {
unsigned char first_run_timing_advance[NUMBER_OF_CONNECTED_eNB_MAX];
uint8_t sidelink_active;
uint8_t SLonly;
uint8_t SLsynconly;
uint8_t destination_id;
// DMRS group-hopping sequences for PSBCH (index 0) and 256 possible PSSCH (indices 1...256)
uint32_t gh[257][20];
......
......@@ -2356,7 +2356,7 @@ void phy_procedures_UE_SL_TX(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc) {
AssertFatal(frame_tx>=0 && frame_tx < 1024, "frame_tx %d is not in 0...1023\n",frame_tx);
AssertFatal(subframe_tx>=0 && subframe_tx < 10, "frame_tx %d is not in 0...9\n",subframe_tx);
LOG_D(PHY,"****** start Sidelink TX-Chain for AbsSubframe %d.%d ******\n", frame_tx, subframe_tx);
LOG_I(PHY,"****** start Sidelink TX-Chain for AbsSubframe %d.%d ******\n", frame_tx, subframe_tx);
if (ue->SLonly == 1) {
......@@ -2379,17 +2379,17 @@ void phy_procedures_UE_SL_TX(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc) {
// check for SLDCH
AssertFatal(0==pthread_mutex_lock(&ue->sldch_mutex),"");
if ((ue->sldch = ue_get_sldch(ue->Mod_id,ue->CC_id,frame_tx,subframe_tx)) != NULL) generate_sldch(ue,ue->sldch,frame_tx,subframe_tx);
if ((ue->sldch = ue_get_sldch(ue->Mod_id,ue->CC_id,frame_tx,subframe_tx)) != NULL) check_and_generate_psdch(ue,frame_tx,subframe_tx);
AssertFatal(0==pthread_mutex_unlock(&ue->sldch_mutex),"");
LOG_D(PHY,"ULSCH (after sldch) : signal F energy %d dB (txdataF %p)\n",dB_fixed(signal_energy(&ue->common_vars.txdataF[0][subframe_tx*14*ue->frame_parms.ofdm_symbol_size],14*ue->frame_parms.ofdm_symbol_size)),&ue->common_vars.txdataF[0][subframe_tx*14*ue->frame_parms.ofdm_symbol_size]);
LOG_I(PHY,"ULSCH (after sldch) : signal F energy %d dB (txdataF %p)\n",dB_fixed(signal_energy(&ue->common_vars.txdataF[0][subframe_tx*14*ue->frame_parms.ofdm_symbol_size],14*ue->frame_parms.ofdm_symbol_size)),&ue->common_vars.txdataF[0][subframe_tx*14*ue->frame_parms.ofdm_symbol_size]);
// check for SLSCH
AssertFatal(0==pthread_mutex_lock(&ue->slsch_mutex),"");
if ((ue->slsch = ue_get_slsch(ue->Mod_id,ue->CC_id,frame_tx,subframe_tx)) != NULL) generate_slsch(ue,proc,ue->slsch,frame_tx,subframe_tx);
AssertFatal(0==pthread_mutex_unlock(&ue->slsch_mutex),"");
LOG_D(PHY,"ULSCH (after slsch) : signal F energy %d dB (txdataF %p)\n",dB_fixed(signal_energy(&ue->common_vars.txdataF[0][subframe_tx*14*ue->frame_parms.ofdm_symbol_size],14*ue->frame_parms.ofdm_symbol_size)),&ue->common_vars.txdataF[0][subframe_tx*14*ue->frame_parms.ofdm_symbol_size]);
LOG_D(PHY,"****** end Sidelink TX-Chain for AbsSubframe %d.%d (ul %d) ******\n", frame_tx, subframe_tx,
LOG_I(PHY,"****** end Sidelink TX-Chain for AbsSubframe %d.%d (ul %d) ******\n", frame_tx, subframe_tx,
ue->generate_ul_signal[subframe_tx][0]);
if (ue->SLonly == 1) {
......
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
......@@ -668,9 +667,82 @@ rrc_mac_config_req_ue(module_id_t Mod_idP,
"PSCCH bitmap limited to 42 bits\n");
UE_mac_inst[Mod_idP].slsch.SubframeBitmapSL_length = SubframeBitmapSL[preconfigpool->sc_TF_ResourceConfig_r12.subframeBitmap_r12.present];
UE_mac_inst[Mod_idP].slsch.bitmap1 = *((uint64_t*)preconfigpool->sc_TF_ResourceConfig_r12.subframeBitmap_r12.choice.bs40_r12.buf);
AssertFatal(SL_Preconfiguration_r12->ext1!=NULL,"there is no Rel13 extension in SL preconfiguration\n");
AssertFatal(SL_Preconfiguration_r12->ext1->preconfigDisc_r13!=NULL,"there is no SL discovery configuration\n");
AssertFatal(SL_Preconfiguration_r12->ext1->preconfigDisc_r13->discRxPoolList_r13.list.count==1,"Discover RX pool list count %d != 1\n",
SL_Preconfiguration_r12->ext1->preconfigDisc_r13->discRxPoolList_r13.list.count);
SL_PreconfigDiscPool_r13_t *discrxpool=SL_Preconfiguration_r12->ext1->preconfigDisc_r13->discRxPoolList_r13.list.array[0];
/// Discovery Type
UE_mac_inst[Mod_idP].sldch.type = disc_type1;
/// Number of SL resource blocks (1-100)
UE_mac_inst[Mod_idP].sldch.N_SL_RB = discrxpool->tf_ResourceConfig_r13.prb_Num_r12;
/// prb-start (0-99)
UE_mac_inst[Mod_idP].sldch.prb_Start= discrxpool->tf_ResourceConfig_r13.prb_Start_r12;
/// prb-End (0-99)
UE_mac_inst[Mod_idP].sldch.prb_End = discrxpool->tf_ResourceConfig_r13.prb_End_r12;
/// SL-OffsetIndicator (0-10239)
AssertFatal(discrxpool->tf_ResourceConfig_r13.offsetIndicator_r12.present == SL_OffsetIndicator_r12_PR_small_r12,
"offsetIndicator_r12 is not PR_small_r12\n");
UE_mac_inst[Mod_idP].sldch.offsetIndicator = discrxpool->tf_ResourceConfig_r13.offsetIndicator_r12.choice.small_r12 ;
AssertFatal(discrxpool->tf_ResourceConfig_r13.subframeBitmap_r12.present > SubframeBitmapSL_r12_PR_NOTHING &&
discrxpool->tf_ResourceConfig_r13.subframeBitmap_r12.present <= SubframeBitmapSL_r12_PR_bs42_r12,
"illegal subframeBitmap %d\n",discrxpool->tf_ResourceConfig_r13.subframeBitmap_r12.present);
/// PSDCH subframe bitmap (up to 100 bits, first 64)
switch (discrxpool->tf_ResourceConfig_r13.subframeBitmap_r12.present) {
case SubframeBitmapSL_r12_PR_NOTHING:
AssertFatal(1==0,"Should never get here\n");
break;
case SubframeBitmapSL_r12_PR_bs4_r12:
UE_mac_inst[Mod_idP].sldch.bitmap1 = *(uint64_t*)discrxpool->tf_ResourceConfig_r13.subframeBitmap_r12.choice.bs4_r12.buf;
UE_mac_inst[Mod_idP].sldch.bitmap_length = 4;
break;
case SubframeBitmapSL_r12_PR_bs8_r12:
UE_mac_inst[Mod_idP].sldch.bitmap1 = *(uint64_t*)discrxpool->tf_ResourceConfig_r13.subframeBitmap_r12.choice.bs8_r12.buf;
UE_mac_inst[Mod_idP].sldch.bitmap_length = 9;
break;
case SubframeBitmapSL_r12_PR_bs12_r12:
UE_mac_inst[Mod_idP].sldch.bitmap1 = *(uint64_t*)discrxpool->tf_ResourceConfig_r13.subframeBitmap_r12.choice.bs12_r12.buf;
UE_mac_inst[Mod_idP].sldch.bitmap_length = 12;
break;
case SubframeBitmapSL_r12_PR_bs16_r12:
UE_mac_inst[Mod_idP].sldch.bitmap1 = *(uint64_t*)discrxpool->tf_ResourceConfig_r13.subframeBitmap_r12.choice.bs16_r12.buf;
UE_mac_inst[Mod_idP].sldch.bitmap_length = 16;
break;
case SubframeBitmapSL_r12_PR_bs30_r12:
UE_mac_inst[Mod_idP].sldch.bitmap1 = *(uint64_t*)discrxpool->tf_ResourceConfig_r13.subframeBitmap_r12.choice.bs30_r12.buf;
UE_mac_inst[Mod_idP].sldch.bitmap_length = 30;
break;
case SubframeBitmapSL_r12_PR_bs40_r12:
UE_mac_inst[Mod_idP].sldch.bitmap1 = *(uint64_t*)discrxpool->tf_ResourceConfig_r13.subframeBitmap_r12.choice.bs40_r12.buf;
UE_mac_inst[Mod_idP].sldch.bitmap_length = 40;
break;
case SubframeBitmapSL_r12_PR_bs42_r12:
UE_mac_inst[Mod_idP].sldch.bitmap1 = *(uint64_t*)discrxpool->tf_ResourceConfig_r13.subframeBitmap_r12.choice.bs42_r12.buf;
UE_mac_inst[Mod_idP].sldch.bitmap_length = 42;
break;
}
/// PSDCH subframe bitmap (up to 100 bits, second 36)
UE_mac_inst[Mod_idP].sldch.bitmap2 = 0;
/// SL-Discovery Period
AssertFatal(SL_PreconfigDiscPool_r13__discPeriod_r13_spare == 15, "specifications have changed, update table\n");
int sldisc_period[SL_PreconfigDiscPool_r13__discPeriod_r13_spare] = {4,6,7,8,12,14,16,24,28,32,64,128,256,512,1024};
UE_mac_inst[Mod_idP].sldch.discPeriod = sldisc_period[discrxpool->discPeriod_r13];
/// Number of Repetitions (N_R)
UE_mac_inst[Mod_idP].sldch.numRepetitions = discrxpool->numRepetition_r13;
/// Number of retransmissions (numRetx-r12)
UE_mac_inst[Mod_idP].sldch.numRetx = discrxpool->numRetx_r13;
}
if (directFrameNumber_r12<1025) UE_mac_inst[Mod_idP].directFrameNumber_r12 = directFrameNumber_r12;
if (directSubframeNumber_r12<11) UE_mac_inst[Mod_idP].directSubframeNumber_r12 = directSubframeNumber_r12;
if (sl_Bandwidth_r12) UE_mac_inst[Mod_idP].sl_Bandwidth_r12 = *sl_Bandwidth_r12;
#endif
......@@ -679,3 +751,4 @@ rrc_mac_config_req_ue(module_id_t Mod_idP,
return (0);
}
......@@ -3197,7 +3197,6 @@ SLDCH_t *ue_get_sldch(module_id_t Mod_id,int CC_id,frame_t frame_tx,sub_frame_t
LOG_I(MAC,"Got %d bytes from RRC for SLDCH @ %p\n",sldch->payload_length,sldch);
return (sldch);
}
else
return((SLDCH_t*)NULL);
}
......
......@@ -135,6 +135,13 @@ mac_rrc_data_req_ue(
UE_rrc_inst[Mod_idP].SL_Discovery[eNB_indexP].Tx_buffer.payload_size = 0;
return(Ret_size);
}
else if (Srb_idP == SL_DISCOVERY) {
LOG_I(RRC,"[UE %d] Frame %d Filling DUMMY SL DISCOVERY SRB_ID %d\n",Mod_idP,frameP,Srb_idP);
for (int i=0;i<29;i++) buffer_pP[i] = i;
LOG_I(RRC,"[UE %d] Sending SL_Discovery, size %d bytes\n",Mod_idP,29);
return(29);
}
#endif
return(0);
......
......@@ -79,6 +79,7 @@
#define CONFIG_HLP_ENABLESL "Enable SL functionality"
#define CONFIG_HLP_SLONLY "Use SL only (i.e. wire UE to off-network state)"
#define CONFIG_HLP_SYNCHREF "Hard-wire UE as SynchRef UE for SL"
#define CONFIG_HLP_SLSYNCONLY "Run UE with only searching procedure for SynchREF"
#define CONFIG_HLP_MSLOTS "Skip the missed slots/subframes \n"
#define CONFIG_HLP_ULMCS "Set the maximum uplink MCS\n"
#define CONFIG_HLP_TDD "Set hardware to TDD mode (default: FDD). Used only with -U (otherwise set in config file).\n"
......@@ -139,6 +140,7 @@
{"ue-enable-sl", CONFIG_HLP_ENABLESL, PARAMFLAG_BOOL, iptr:&sidelink_active, defintval:0, TYPE_INT, 0}, \
{"ue-sl-only", CONFIG_HLP_SLONLY, PARAMFLAG_BOOL, iptr:&SLonly, defintval:0, TYPE_INT, 0}, \
{"ue-synchref", CONFIG_HLP_SYNCHREF, PARAMFLAG_BOOL, iptr:&synchRef, defintval:0, TYPE_INT, 0}, \
{"ue-slsync-only", CONFIG_HLP_SLSYNCONLY, PARAMFLAG_BOOL, iptr:&slsynconly, defintval:0, TYPE_INT, 0}, \
{"r" , CONFIG_HLP_PRB, 0, u8ptr:&(frame_parms[0]->N_RB_DL), defintval:25, TYPE_UINT8, 0}, \
}
......@@ -265,7 +267,7 @@ extern void set_function_spec_param(RU_t *ru);
extern int setup_ue_buffers(PHY_VARS_UE **phy_vars_ue, openair0_config_t *openair0_cfg);
extern void fill_ue_band_info(void);
extern void init_UE(int,int,int,int,int,int,int);
extern void init_UE(int,int,int,int,int,int,int,int);
extern void init_thread(int sched_runtime, int sched_deadline, int sched_fifo, cpu_set_t *cpuset, char * name);
extern void reset_opp_meas(void);
......
......@@ -80,7 +80,7 @@ void *UE_thread(void *arg);
void *UE_threadSL(void *arg);
void init_UE_stub(int nb_inst,int,int,char*,int);
void ue_stub_rx_handler(unsigned int, char *);
void init_UE(int,int,int,int,int,int,int);
void init_UE(int,int,int,int,int,int,int,int);
int32_t **rxdata;
int32_t **txdata;
......@@ -223,7 +223,7 @@ void init_thread(int sched_runtime, int sched_deadline, int sched_fifo, cpu_set_
}
void init_UE(int nb_inst,int eMBMS_active, int uecap_xer_in, int timing_correction,int sidelink_active,int SLonly,int isSynchRef) {
void init_UE(int nb_inst,int eMBMS_active, int uecap_xer_in, int timing_correction,int sidelink_active,int SLonly,int isSynchRef,int slsynconly) {
PHY_VARS_UE *UE;
int inst;
......@@ -245,6 +245,7 @@ void init_UE(int nb_inst,int eMBMS_active, int uecap_xer_in, int timing_correcti
PHY_vars_UE_g[inst][0]->SLonly = SLonly;
PHY_vars_UE_g[inst][0]->is_SynchRef = isSynchRef;
PHY_vars_UE_g[inst][0]->SLsynconly;
LOG_I(PHY,"Intializing UE Threads for instance %d (%p,%p)...\n",inst,PHY_vars_UE_g[inst],PHY_vars_UE_g[inst][0]);
init_UE_threads(inst);
......@@ -764,7 +765,7 @@ static void *UE_thread_synchSL(void *arg)
AssertFatal ( 0== pthread_mutex_lock(&UE->proc.mutex_synchSL), "");
UE->proc.instance_cnt_synchSL--;
// Remove this to go to steady-state mode
UE->is_synchronizedSL=0;
if (UE->SLsynconly==1) UE->is_synchronizedSL=0;
AssertFatal ( 0== pthread_mutex_unlock(&UE->proc.mutex_synchSL), "");
}
}
......
......@@ -160,6 +160,7 @@ char emul_iface[100];
int sidelink_active=0;
int SLonly=0;
int synchRef=0;
int slsynconly=0;
#if MAX_NUM_CCs == 1
rx_gain_t rx_gain_mode[MAX_NUM_CCs][4] = {{max_gain,max_gain,max_gain,max_gain}};
......@@ -1040,7 +1041,7 @@ int main( int argc, char **argv )
// start the main threads
int eMBMS_active = 0;
init_UE(1,eMBMS_active,uecap_xer_in,0,sidelink_active,SLonly,synchRef);
init_UE(1,eMBMS_active,uecap_xer_in,0,sidelink_active,SLonly,synchRef,slsynconly);
if (phy_test==0) {
printf("Filling UE band info\n");
......
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