Commit bd4d8164 authored by Raymond Knopp's avatar Raymond Knopp

addition of synchronization path and configuration of resource pools

parent 47658e56
......@@ -1094,9 +1094,12 @@ set(PHY_SRC
${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/prach.c
${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/pmch.c
${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/pch.c
${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/slpss.c
${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/slsss.c
${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/slss.c
${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/sldch.c
${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/slsch.c
${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/slbch.c
${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/group_hopping.c
${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/srs_modulation.c
${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/drs_modulation.c
......@@ -1189,9 +1192,12 @@ set(PHY_SRC_UE
${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/prach.c
${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/pmch.c
${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/pch.c
${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/slpss.c
${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/slsss.c
${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/slss.c
${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/sldch.c
${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/slsch.c
${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/slbch.c
${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/group_hopping.c
${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/srs_modulation.c
${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/drs_modulation.c
......
......@@ -976,10 +976,10 @@ int init_lte_ue_signal(PHY_VARS_UE *ue,
ue->pusch_sldch->rxdataF_comp[aa] = (int32_t*)malloc16_clear(ue->frame_parms.N_RB_DL*12*14*sizeof(int32_t));
ue->pusch_sldch->ul_ch_mag[aa] = (int32_t*)malloc16_clear(ue->frame_parms.N_RB_DL*12*14*sizeof(int32_t));
}
ue->slsch_dlsch_llr = (int16_t **)malloc(2*6*12*1200*sizeof(int16_t*));
ue->slsch_ulsch_llr = (int16_t **)malloc(2*6*12*1200*sizeof(int16_t*));
ue->sldch_dlsch_llr = (int16_t **)malloc(2*2*12*1200*sizeof(int16_t*));
ue->sldch_ulsch_llr = (int16_t **)malloc(2*2*12*1200*sizeof(int16_t*));
ue->slsch_dlsch_llr = (int16_t *)malloc(2*6*12*1200*sizeof(int16_t*));
ue->slsch_ulsch_llr = (int16_t *)malloc(2*6*12*1200*sizeof(int16_t*));
ue->sldch_dlsch_llr = (int16_t *)malloc(2*2*12*1200*sizeof(int16_t*));
ue->sldch_ulsch_llr = (int16_t *)malloc(2*2*12*1200*sizeof(int16_t*));
......
......@@ -872,8 +872,20 @@ typedef enum {
typedef struct {
// SL Configuration
/// Number of SL resource blocks (1-100)
uint32_t N_SL_RB;
/// prb-start (0-99)
uint32_t prb_Start;
/// prb-End (0-99)
uint32_t prb_End;
/// SL-OffsetIndicator (0-10239)
uint32_t SL_OffsetIndicator;
uint16_t slss_id;
uint8_t slmib_length;
uint8_t *slmib;
} SLSS_t;
typedef struct {
......
......@@ -120,7 +120,14 @@ int generate_drs_pusch(PHY_VARS_UE *ue,
linc = (7 - frame_parms->Ncp);
break;
case PSBCH:
AssertFatal(1==0,"PSBCH Transmission not supported for now\n");
u0=ue->gh[ue->slsch->group_destination_id][ljmod10<<1];
u1=ue->gh[ue->slsch->group_destination_id][1+(ljmod10<<1)];
v0=0;//frame_parms->pusch_config_common.ul_ReferenceSignalsPUSCH.seqhop[subframe<<1];
v1=0;//frame_parms->pusch_config_common.ul_ReferenceSignalsPUSCH.seqhop[1+(subframe<<1)];
cyclic_shift0 = (ue->frame_parms.Nid_SL>>1)&7;
cyclic_shift1 = (ue->frame_parms.Nid_SL>>1)&7;
lstart = (3 - frame_parms->Ncp);
linc = (7 - frame_parms->Ncp);
break;
case NO_SL:
u0=frame_parms->pusch_config_common.ul_ReferenceSignalsPUSCH.grouphop[subframe<<1];
......
......@@ -296,7 +296,8 @@ int generate_pbch(LTE_eNB_PBCH *eNB_pbch,
pbch_scrambling(frame_parms,
eNB_pbch->pbch_e,
pbch_E);
pbch_E,
0);
#ifdef DEBUG_PBCH
if (frame_mod4==0) {
write_output("pbch_e_s.m","pbch_e_s",
......@@ -731,7 +732,8 @@ void pbch_detection_mrc(LTE_DL_FRAME_PARMS *frame_parms,
void pbch_scrambling(LTE_DL_FRAME_PARMS *frame_parms,
uint8_t *pbch_e,
uint32_t length)
uint32_t length,
int SLflag)
{
int i;
uint8_t reset;
......@@ -739,7 +741,7 @@ void pbch_scrambling(LTE_DL_FRAME_PARMS *frame_parms,
reset = 1;
// x1 is set in lte_gold_generic
x2 = frame_parms->Nid_cell; //this is c_init in 36.211 Sec 6.6.1
x2 = SLflag==0 ? frame_parms->Nid_cell : frame_parms->Nid_SL; //this is c_init in 36.211 Sec 6.6.1
// msg("pbch_scrambling: Nid_cell = %d\n",x2);
for (i=0; i<length; i++) {
......
......@@ -1432,10 +1432,12 @@ uint16_t rx_pbch_emul(PHY_VARS_UE *phy_vars_ue,
/*! \brief PBCH scrambling. Applies 36.211 PBCH scrambling procedure.
\param frame_parms Pointer to frame descriptor
\param coded_data Output of the coding and rate matching
\param length Length of the sequence*/
\param length Length of the sequence
\param Flag to indicate that this is for PSBCH instead of PBCH*/
void pbch_scrambling(LTE_DL_FRAME_PARMS *frame_parms,
uint8_t* coded_data,
uint32_t length);
uint32_t length,
int SL_flag);
/*! \brief PBCH unscrambling
This is similar to pbch_scrabling with the difference that inputs are signed s16s (llr values) and instead of flipping bits we change signs.
......@@ -1486,29 +1488,6 @@ uint8_t generate_dci_top_emul(PHY_VARS_eNB *phy_vars_eNB,
DCI_ALLOC_t *dci_alloc,
uint8_t subframe);
/*! \brief Top-level generation route for Sidelink BCH,PSS and SSS
\param ue pointer to UE descriptor
\param slss pointer to SLSS configuration and payload
\param frame_tx Frame number
\param subframe_tx subframe number
*/
void generate_slss(PHY_VARS_UE *ue,SLSS_t *slss,int frame_tx,int subframe_tx);
/*! \brief Top-level generation route for Sidelink Discovery Channel
\param ue pointer to UE descriptor
\param sldch pointer to SLDCH configuration and payload
\param frame_tx Frame number
\param subframe_tx subframe number
*/
void generate_sldch(PHY_VARS_UE *ue,SLDCH_t *sldch,int frame_tx,int subframe_tx);
/*! \brief Top-level generation route for Sidelink Shared Channel
\param ue pointer to UE descriptor
\param slsch pointer to SLSCH configuration and payload
\param frame_tx Frame number
\param subframe_tx subframe number
*/
void generate_slsch(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,SLSCH_t *slss,int frame_tx,int subframe_tx);
void generate_64qam_table(void);
void generate_16qam_table(void);
......@@ -2331,5 +2310,40 @@ int8_t find_ulsch(uint16_t rnti, PHY_VARS_eNB *eNB,find_type_t type);
int8_t find_uci(uint16_t rnti, int frame, int subframe, PHY_VARS_eNB *eNB,find_type_t type);
int generate_slpss(int32_t **txdataF,
short amp,
LTE_DL_FRAME_PARMS *frame_parms,
unsigned short symbol,
int subframe);
int generate_slsss(int32_t **txdataF,
int subframe,
int16_t amp,
LTE_DL_FRAME_PARMS *frame_parms,
uint16_t symbol);
/*! \brief Top-level generation route for Sidelink BCH,PSS and SSS
\param ue pointer to UE descriptor
\param frame_tx Frame number
\param subframe_tx subframe number
*/
void check_and_generate_slss(PHY_VARS_UE *ue,int frame_tx,int subframe_tx);
/*! \brief Top-level generation route for Sidelink Discovery Channel
\param ue pointer to UE descriptor
\param sldch pointer to SLDCH configuration and payload
\param frame_tx Frame number
\param subframe_tx subframe number
*/
void generate_sldch(PHY_VARS_UE *ue,SLDCH_t *sldch,int frame_tx,int subframe_tx);
/*! \brief Top-level generation route for Sidelink Shared Channel
\param ue pointer to UE descriptor
\param slsch pointer to SLSCH configuration and payload
\param frame_tx Frame number
\param subframe_tx subframe number
*/
void generate_slsch(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,SLSCH_t *slss,int frame_tx,int subframe_tx);
/**@}*/
#endif
......@@ -43,7 +43,8 @@ int generate_pss(int32_t **txdataF,
short amp,
LTE_DL_FRAME_PARMS *frame_parms,
unsigned short symbol,
unsigned short slot_offset)
unsigned short slot_offset
)
{
unsigned int Nsymb;
......
......@@ -465,7 +465,7 @@ void sldch_codingmodulation(PHY_VARS_UE *ue,int frame_tx,int subframe_tx,int npr
tx_amp = get_tx_amp(ue->tx_power_dBm[subframe_tx],
ue->tx_power_max_dBm,
ue->frame_parms.N_RB_UL,
1);
2);
#else
tx_amp = AMP;
#endif
......
......@@ -42,23 +42,32 @@ void generate_sl_grouphop(PHY_VARS_UE *ue)
uint8_t reset=1;
uint32_t x1, x2, s=0;
uint32_t fss_pusch;
uint32_t destid;
for (int destid=0;destid<256;destid++) {
for (int index=0;index<257;index++) {
// This is from Section 5.5.1.3
fss_pusch = destid%30;
x2 = destid/30;
if (index > 0) { // PSSCH
destid=index-1;
fss_pusch = destid%30;
x2 = destid/30;
#ifdef DEBUG_SLGROUPHOP
printf("[PHY] SL GroupHop %d:",destid);
printf("[PHY] SL GroupHop %d:",destid);
#endif
}
else { // PSBCH
fss_pusch =(ue->frame_parms.Nid_SL/16)%30;
x2 = ue->frame_parms.Nid_SL/30;
}
for (ns=0; ns<20; ns++) {
if ((ns&3) == 0) {
s = lte_gold_generic(&x1,&x2,reset);
reset = 0;
}
ue->gh[destid][ns] = (((uint8_t*)&s)[ns&3]+fss_pusch)%30;
ue->gh[index][ns] = (((uint8_t*)&s)[ns&3]+fss_pusch)%30;
#ifdef DEBUG_SLGROUPHOP
......@@ -602,7 +611,7 @@ void slsch_codingmodulation(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,int frame_tx,in
slsch->RB_start,
slsch->L_CRBs,
0,
ue->gh[slsch->group_destination_id],
ue->gh[1+slsch->group_destination_id],
ljmod10);
ue->pssch_generated = 1;
......@@ -1179,7 +1188,7 @@ void slsch_decoding(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,int frame_rx,int subfra
write_output("slsch_rxF_ext.m","slschrxF_ext",rxdataF_ext[0],14*12*ue->frame_parms.N_RB_DL,1,1);
#endif
uint32_t u = ue->gh[ue->slsch->group_destination_id][ljmod10<<1];
uint32_t u = ue->gh[1+ue->slsch->group_destination_id][ljmod10<<1];
uint32_t v = 0;
uint32_t cyclic_shift=(ue->slsch->group_destination_id>>1)&7;
......@@ -1196,7 +1205,7 @@ void slsch_decoding(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,int frame_rx,int subfra
3,
1, // interpolation
0);
u = ue->gh[ue->slsch->group_destination_id][1+(ljmod10<<1)];
u = ue->gh[1+ue->slsch->group_destination_id][1+(ljmod10<<1)];
lte_ul_channel_estimation(&ue->frame_parms,
(int32_t**)drs_ch_estimates,
(int32_t**)NULL,
......
......@@ -34,10 +34,71 @@
#include "PHY/defs.h"
void generate_slss(PHY_VARS_UE *ue,SLSS_t *slss,int frame_tx,int subframe_tx) {
void check_and_generate_slss(PHY_VARS_UE *ue,int frame_tx,int subframe_tx) {
AssertFatal(1==0,"Should get here yet for UE %d\n",ue->Mod_id);
AssertFatal(frame_tx<1024 && frame_tx>=0,"frame %d is illegal\n",frame_tx);
AssertFatal(subframe_tx<10 && subframe_tx>=0,"subframe %d is illegal\n",subframe_tx);
}
SLSS_t *slss = ue->slss;
int tx_amp;
if (slss->slmib == NULL) return;
if ((((10*frame_tx) + subframe_tx)%40) != slss->SL_OffsetIndicator) return;
// here we have a transmission opportunity for SLSS
ue->frame_parms.Nid_SL = slss->slss_id;
// 6 PRBs => ceil(10*log10(6)) = 8
ue->tx_power_dBm[subframe_tx] = 8;
ue->tx_total_RE[subframe_tx] = 72;
#if defined(EXMIMO) || defined(OAI_USRP) || defined(OAI_BLADERF) || defined(OAI_LMSSDR)
tx_amp = get_tx_amp(ue->tx_power_dBm[subframe_tx],
ue->tx_power_max_dBm,
ue->frame_parms.N_RB_UL,
6);
#else
tx_amp = AMP;
#endif
for (int aa=0; aa<ue->frame_parms.nb_antennas_tx; aa++) {
memset(&ue->common_vars.txdataF[aa][subframe_tx*ue->frame_parms.ofdm_symbol_size*ue->frame_parms.symbols_per_tti],
0,
ue->frame_parms.ofdm_symbol_size*ue->frame_parms.symbols_per_tti*sizeof(int32_t));
}
// PSS
generate_slpss(ue->common_vars.txdataF,
tx_amp,
&ue->frame_parms,
1,
subframe_tx
);
generate_slpss(ue->common_vars.txdataF,
tx_amp,
&ue->frame_parms,
2,
subframe_tx
);
generate_slbch(ue->common_vars.txdataF,
tx_amp,
&ue->frame_parms,
2,
subframe_tx);
ue->sl_chan = PSBCH;
generate_drs_pusch(ue,
NULL,
0,
tx_amp,
subframe_tx,
(1+(ue->frame_parms.N_RB_UL/2))-3,
6,
0,
NULL,
0);
}
#endif
......@@ -1283,6 +1283,8 @@ typedef struct {
int16_t *slsch_ulsch_llr;
int16_t *sldch_dlsch_llr;
int16_t *sldch_ulsch_llr;
SLSCH_t *slss;
SLSCH_t slss_rx;
SLSCH_t *slsch;
SLSCH_t slsch_rx;
int slsch_active;
......@@ -1372,7 +1374,8 @@ typedef struct {
unsigned char first_run_timing_advance[NUMBER_OF_CONNECTED_eNB_MAX];
uint8_t sidelink_active;
uint8_t destination_id;
uint32_t gh[256][20];
// DMRS group-hopping sequences for PSBCH (index 0) and 256 possible PSSCH (indices 1...256)
uint32_t gh[257][20];
uint8_t pscch_coded;
uint8_t pscch_generated;
uint8_t pssch_generated;
......
......@@ -55,6 +55,8 @@ extern PHY_VARS_eNB * PHY_vars_eNB_g[MAX_eNB][MAX_NUM_CCs];
extern short primary_synch0[144];
extern short primary_synch1[144];
extern short primary_synch2[144];
extern short primary_synch0SL[144];
extern short primary_synch1SL[144];
extern unsigned char primary_synch0_tab[72];
extern unsigned char primary_synch1_tab[72];
extern unsigned char primary_synch2_tab[72];
......
......@@ -576,6 +576,8 @@ typedef struct {
uint16_t Nid_cell;
/// MBSFN Area ID
uint16_t Nid_cell_mbsfn;
/// Sidelink Cell ID
uint16_t Nid_SL;
/// Cyclic Prefix for DL (0=Normal CP, 1=Extended CP)
lte_prefix_type_t Ncp;
/// Cyclic Prefix for UL (0=Normal CP, 1=Extended CP)
......
......@@ -200,6 +200,7 @@
#define ONE_OVER_SQRT2_Q15 23170
#define ONE_OVER_2_Q15 16384
#define SQRT_18_OVER_32_Q15 17656
// QAM amplitude definitions
......
......@@ -32,6 +32,7 @@ char* namepointer_log2;
#include "PHY/LTE_REFSIG/primary_synch.h"
#include "PHY/LTE_REFSIG/primary_synch_SL.h"
int16_t *primary_synch0_time;
int16_t *primary_synch1_time;
int16_t *primary_synch2_time;
......
......@@ -2350,8 +2350,7 @@ void phy_procedures_UE_SL_TX(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc) {
LOG_D(PHY,"****** start Sidelink TX-Chain for AbsSubframe %d.%d ******\n", frame_tx, subframe_tx);
// check for SLBCH/SLSS
if ((slss = ue_get_slss(ue->Mod_id,ue->CC_id,frame_tx,subframe_tx)) != NULL ||
ue->sidelink_active == 1) generate_slss(ue,slss,frame_tx,subframe_tx);
if ((ue->slss = ue_get_slss(ue->Mod_id,ue->CC_id,frame_tx,subframe_tx)) != NULL) check_and_generate_slss(ue,frame_tx,subframe_tx);
// check for SLDCH
if ((sldch = ue_get_sldch(ue->Mod_id,ue->CC_id,frame_tx,subframe_tx)) != NULL) generate_sldch(ue,sldch,frame_tx,subframe_tx);
......
......@@ -138,7 +138,9 @@ rrc_mac_config_req_ue(module_id_t Mod_idP,
#if defined(Rel14)
,config_action_t config_action
,const uint32_t * const sourceL2Id
,const uint32_t * const destinationL2Id
,const uint32_t * const destinationL2Id,
SL_Preconfiguration_r12_t *SL_Preconfiguration_r12_t
#endif
)
{
......
......@@ -64,6 +64,7 @@
#ifdef Rel14
#include "SystemInformationBlockType1-v1310-IEs.h"
#include "SystemInformationBlockType18-r12.h"
#include "SL-Preconfiguration-r12.h"
#endif
#include "RadioResourceConfigCommonSIB.h"
#include "nfapi_interface.h"
......@@ -1402,6 +1403,7 @@ typedef struct {
int sltx_active;
SLSCH_t slsch;
SLDCH_t sldch;
SLSS_t slss;
ULSCH_PDU slsch_pdu;
int slsch_lcid;
#endif
......
......@@ -1026,9 +1026,10 @@ int rrc_mac_config_req_ue(module_id_t module_idP,
uint8_t num_active_cba_groups, uint16_t cba_rnti
#endif
#if defined(Rel14)
,config_action_t config_action
,const uint32_t * const sourceL2Id
,const uint32_t * const destinationL2Id
,config_action_t config_action,
const uint32_t * const sourceL2Id,
const uint32_t * const destinationL2Id,
SL_Preconfiguration_r12_t *SL_Preconfiguration_r12_t
#endif
);
......
......@@ -3139,8 +3139,12 @@ int get_db_dl_PathlossChange(uint8_t dl_PathlossChange)
SLSS_t *ue_get_slss(module_id_t Mod_id,int CC_id,frame_t frame_tx,sub_frame_t subframe_tx) {
UE_MAC_INST *ue = &UE_mac_inst[Mod_id];
SLSS_t *slss = &UE_mac_inst[Mod_id].slss;
// call RRC get check for SL-MIB
return((SLSS_t*)NULL);
return((SLSS_t*)slss);
}
SLDCH_t *ue_get_sldch(module_id_t Mod_id,int CC_id,frame_t frame_tx,sub_frame_t subframe_tx) {
......
This diff is collapsed.
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