Commit c7bf4f8a authored by matzakos's avatar matzakos

Merge remote-tracking branch 'origin/l1-sidelink' into Merge-L1-ON-NET

parents 59764671 e7f306be
......@@ -33,7 +33,7 @@
#include "pssch.h"
//#define PSSCH_DEBUG 1
//#define DEBUG_SCI_DECODING 1
#define DEBUG_SCI_DECODING 1
extern int
multicast_link_write_sock(int groupP, char *dataP, uint32_t sizeP);
......@@ -362,7 +362,7 @@ void pscch_codingmodulation(PHY_VARS_UE *ue,int frame_tx,int subframe_tx,uint32_
// coding part
if (ue->pscch_coded == 0) {
LOG_D(PHY,"pscch_coding\n");
LOG_I(PHY,"pscch_coding\n");
sci = sci_mapping(ue);
int length = log2_approx(slsch->N_SL_RB_data*((ue->slsch_rx.N_SL_RB_data+1)>>1))+32;
......@@ -446,7 +446,7 @@ void pscch_codingmodulation(PHY_VARS_UE *ue,int frame_tx,int subframe_tx,uint32_
int32_t d[Msymb];
int16_t gain_lin_QPSK = (int16_t)((tx_amp*ONE_OVER_SQRT2_Q15)>>15);
LOG_D(PHY,"pscch modulation, Msymb %d\n",Msymb);
LOG_I(PHY,"pscch modulation, Msymb %d\n",Msymb);
for (int i=0,j=0; i<Msymb; i++,j+=2) {
((int16_t*)&d[i])[0] = (pscch->b_tilde[j] == 1) ? (-gain_lin_QPSK) : gain_lin_QPSK;
......@@ -472,13 +472,14 @@ void pscch_codingmodulation(PHY_VARS_UE *ue,int frame_tx,int subframe_tx,uint32_
int32_t *txptr;
if (ue->generate_ul_signal[subframe_tx][0] == 0)
LOG_D(PHY,"%d.%d: clearing ul_signal\n",frame_tx,subframe_tx);
if (ue->generate_ul_signal[subframe_tx][0] == 0){
LOG_I(PHY,"%d.%d: clearing ul_signal\n",frame_tx,subframe_tx);
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));
}
}
for (int j=0,l=0; l<Nsymb2; l++) {
re_offset = re_offset0;
......@@ -513,7 +514,7 @@ void pscch_codingmodulation(PHY_VARS_UE *ue,int frame_tx,int subframe_tx,uint32_
ue->pscch_generated |= (1+slot);
ue->generate_ul_signal[subframe_tx][0] = 1;
LOG_I(PHY, "PSCCH signal generated \n");
}
......@@ -529,7 +530,7 @@ void slsch_codingmodulation(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,int frame_tx,in
AssertFatal(ue->slsch_sdu_active > 0,"ue->slsch_sdu_active isn't active\n");
LOG_D(PHY,"Generating SLSCH for rvidx %d, group_id %d, mcs %d, resource first rb %d, L_crbs %d\n",
LOG_I(PHY,"Generating SLSCH for rvidx %d, group_id %d, mcs %d, resource first rb %d, L_crbs %d\n",
slsch->rvidx,slsch->group_destination_id,slsch->mcs,slsch->RB_start+slsch->prb_Start_data,slsch->L_CRBs);
......@@ -595,7 +596,7 @@ void slsch_codingmodulation(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,int frame_tx,in
ulsch->harq_processes[0]->mcs = slsch->mcs;
ulsch->Nsymb_pusch = ((Nsymb-1)<<1);
LOG_D(PHY,"%d.%d : SLSCH nbrb %d, first rb %d\n",frame_tx,subframe_tx,slsch->L_CRBs,slsch->RB_start+slsch->prb_Start_data);
LOG_I(PHY,"%d.%d : SLSCH nbrb %d, first rb %d\n",frame_tx,subframe_tx,slsch->L_CRBs,slsch->RB_start+slsch->prb_Start_data);
ue->sl_chan = PSSCH_12;
......@@ -641,7 +642,7 @@ void slsch_codingmodulation(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,int frame_tx,in
ue->pssch_generated = 1;
ue->generate_ul_signal[subframe_tx][0] = 1;
LOG_I(PHY, "PSSCH signal generated \n");
}
void check_and_generate_pssch(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,int frame_tx,int subframe_tx) {
......@@ -668,7 +669,7 @@ void check_and_generate_pssch(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,int frame_tx,
absSF_modP = absSF_offset%P;
LOG_D(PHY,"Checking pssch for absSF_mod P %d, SubframeBitmapSL_length %d\n", absSF_modP, slsch->SubframeBitmapSL_length);
LOG_I(PHY,"Checking pssch for absSF_mod P %d, SubframeBitmapSL_length %d\n", absSF_modP, slsch->SubframeBitmapSL_length);
// This is the condition for short SCCH bitmap (slsch->SubframeBitmapSL_length bits), check that the current subframe is for SLSCH
if (absSF_modP < slsch->SubframeBitmapSL_length) return;
......@@ -684,7 +685,7 @@ void check_and_generate_pssch(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,int frame_tx,
"received Itrp %d: TRP8 is used with Itrp in 0...%d\n",
slsch->time_resource_pattern,TRP8_MAX);
LOG_D(PHY,"Checking pssch for absSF %d (trp mask %d, rv %d)\n",
LOG_I(PHY,"Checking pssch for absSF %d (trp mask %d, rv %d)\n",
absSF, trp8[slsch->time_resource_pattern][absSF_modP&7],
slsch->rvidx);
// Note : this assumes Ntrp=8 for now
......@@ -758,7 +759,7 @@ void check_and_generate_pscch(PHY_VARS_UE *ue,int frame_tx,int subframe_tx) {
uint32_t b2=(slsch->n_pscch + 1 + (a1%(LPSCCH-1)))%LPSCCH;
LOG_D(PHY,"Checking pscch for absSF %d / n_pscch %d (N_SL_RB_SC %d, LPSCCH %d, M_RB_PSCCH_RP %d, a1 %d, a2 %d, b1 %d, b2 %d) pscch_coded %d\n",
LOG_I(PHY,"Checking pscch for absSF %d / n_pscch %d (N_SL_RB_SC %d, LPSCCH %d, M_RB_PSCCH_RP %d, a1 %d, a2 %d, b1 %d, b2 %d) pscch_coded %d\n",
absSF, slsch->n_pscch,slsch->N_SL_RB_SC,LPSCCH, M_RB_PSCCH_RP,a1,a2,b1,b2,ue->pscch_coded);
ue->slsch_sdu_active = 1;
......@@ -1463,7 +1464,7 @@ void slsch_decoding(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,int frame_rx,int subfra
subframe_rx,
0,
0,
1);
ue->dlsch_rx_slsch->harq_processes[0]->TBS>256?1:0);
LOG_D(PHY,"slsch decoding round %d ret %d (%d,%d)\n",(ue->dlsch_rx_slsch->harq_processes[0]->round+3)&3,ret,
dB_fixed(ue->pusch_slsch->ulsch_power[0]),
......
......@@ -888,21 +888,28 @@ void ue_send_sl_sdu(module_id_t module_idP,
int j = 0;
for (i=0; i< MAX_NUM_LCID; i++)
if ((UE_mac_inst[module_idP].sl_info[i].groupL2Id == destinationL2Id) && (UE_mac_inst[module_idP].sl_info[i].sourceL2Id != sourceL2Id)) {
lcid = UE_mac_inst[module_idP].sl_info[i].LCID;
lcid = UE_mac_inst[module_idP].sl_info[i].LCID;
LOG_I(MAC, "Found corresponding receiver LCID for group communication: %d \n", lcid);
break;
}
for (j = 0; j< MAX_NUM_LCID; j++){
if ((longh->LCID < MAX_NUM_LCID_DATA) && (j < MAX_NUM_LCID_DATA)){
if ((UE_mac_inst[module_idP].sl_info[j].destinationL2Id == sourceL2Id) && (UE_mac_inst[module_idP].sl_info[j].sourceL2Id == destinationL2Id)) {
lcid = longh->LCID; //UE_mac_inst[module_idP].sl_info[j].LCID;
//lcid = longh->LCID;
lcid = UE_mac_inst[module_idP].sl_info[j].LCID;
LOG_I(MAC, "Found corresponding receiver LCID for DATA direct communication: %d \n", lcid);
break;
}
}
if ((longh->LCID >= MAX_NUM_LCID_DATA) && (j >= MAX_NUM_LCID_DATA)){
//PC5-S (receive message after transmitting, e.g, security-command...)
if ((UE_mac_inst[module_idP].sl_info[j].sourceL2Id == destinationL2Id) && (UE_mac_inst[module_idP].sl_info[j].destinationL2Id == 0)) {
if (UE_mac_inst[module_idP].sl_info[j].LCID > 0) lcid = longh->LCID;//UE_mac_inst[module_idP].sl_info[j].LCID;
LOG_I(MAC, "Received a PC5-S message, Tx LCID: %d Rx LCID: %d \n \n", longh->LCID, UE_mac_inst[module_idP].sl_info[j].LCID);
if (UE_mac_inst[module_idP].sl_info[j].LCID > 0) {
lcid = UE_mac_inst[module_idP].sl_info[j].LCID; //lcid = longh->LCID;
LOG_I(MAC, "Found corresponding receiver LCID for SIGNALING direct communication: %d \n", lcid);
}
break;
}
......@@ -936,7 +943,9 @@ void ue_send_sl_sdu(module_id_t module_idP,
}
*/
lcid = longh->LCID;
//lcid = longh->LCID;
//LOG_I(MAC, "Actually assigned receiver bearer: %d \n", lcid);
// LOG_I( MAC, "DestinationL2Id: 0x%08x, sl_rbid %d, longh->LCID %d \n", destinationL2Id, lcid, longh->LCID );
......@@ -3623,9 +3632,9 @@ SLSCH_t *ue_get_slsch(module_id_t module_idP,int CC_id,frame_t frameP,sub_frame_
// Notes: 1. hard-coded to 24-bit destination format for now
if (sdu_length > 0) {
LOG_D(MAC,"SFN.SF %d.%d : got %d bytes from Sidelink buffer (%d requested)\n",frameP,subframeP,sdu_length,req);
LOG_D(MAC,"sourceL2Id: 0x%08x \n",ue->sourceL2Id);
LOG_D(MAC,"groupL2Id/destinationL2Id: 0x%08x \n",ue->destinationL2Id);
LOG_I(MAC,"SFN.SF %d.%d : got %d bytes from Sidelink buffer (%d requested)\n",frameP,subframeP,sdu_length,req);
LOG_I(MAC,"sourceL2Id: 0x%08x \n",ue->sourceL2Id);
LOG_I(MAC,"groupL2Id/destinationL2Id: 0x%08x \n",ue->destinationL2Id);
slsch->payload = (unsigned char*)ue->slsch_pdu.payload;
if (sdu_length < 128) {
......
......@@ -30,7 +30,7 @@
*/
#define PDCP_FIFO_C
//#define PDCP_DEBUG 1
#define PDCP_DEBUG 1
//#define DEBUG_PDCP_FIFO_FLUSH_SDU
extern int otg_enabled;
......@@ -226,12 +226,12 @@ int pdcp_fifo_flush_sdus(const protocol_ctxt_t* const ctxt_pP)
#ifdef PDCP_DEBUG
sl_pc5s_msg_recv = calloc(1, sizeof(sidelink_pc5s_element));
memcpy((void*)sl_pc5s_msg_recv, (void*)(sdu_p->data+sizeof(pdcp_data_ind_header_t)), sizeof(sidelink_pc5s_element));
LOG_D(PDCP,"Received PC5S message, header traffic_type: %d)\n", sl_pc5s_msg_recv->pc5s_header.traffic_type);
LOG_D(PDCP,"Received PC5S message, header rb_id: %d)\n", sl_pc5s_msg_recv->pc5s_header.rb_id);
LOG_D(PDCP,"Received PC5S message, header data_size: %d)\n", sl_pc5s_msg_recv->pc5s_header.data_size);
LOG_D(PDCP,"Received PC5S message, header inst: %d)\n", sl_pc5s_msg_recv->pc5s_header.inst);
LOG_D(PDCP,"Received PC5-S message, sourceL2Id: 0x%08x\n)\n", sl_pc5s_msg_recv->pc5s_header.sourceL2Id);
LOG_D(PDCP,"Received PC5-S message, destinationL1Id: 0x%08x\n)\n", sl_pc5s_msg_recv->pc5s_header.destinationL2Id);
LOG_I(PDCP,"Received PC5S message, header traffic_type: %d)\n", sl_pc5s_msg_recv->pc5s_header.traffic_type);
LOG_I(PDCP,"Received PC5S message, header rb_id: %d)\n", sl_pc5s_msg_recv->pc5s_header.rb_id);
LOG_I(PDCP,"Received PC5S message, header data_size: %d)\n", sl_pc5s_msg_recv->pc5s_header.data_size);
LOG_I(PDCP,"Received PC5S message, header inst: %d)\n", sl_pc5s_msg_recv->pc5s_header.inst);
LOG_I(PDCP,"Received PC5-S message, sourceL2Id: 0x%08x\n)\n", sl_pc5s_msg_recv->pc5s_header.sourceL2Id);
LOG_I(PDCP,"Received PC5-S message, destinationL1Id: 0x%08x\n)\n", sl_pc5s_msg_recv->pc5s_header.destinationL2Id);
free(sl_pc5s_msg_recv);
#endif
memset(send_buf, 0, BUFSIZE);
......@@ -684,14 +684,14 @@ int pdcp_fifo_read_input_sdus (const protocol_ctxt_t* const ctxt_pP)
exit(EXIT_FAILURE);
}
} else if (pc5s_header->traffic_type == TRAFFIC_PC5S_SIGNALLING) { //if containing PC5-S message -> send to other UE
LOG_D(PDCP,"Received PC5-S message ... send to the other UE\n");
LOG_I(PDCP,"Received PC5-S message ... send to the other UE\n");
#ifdef PDCP_DEBUG
LOG_D(PDCP,"Received PC5-S message, traffic_type: %d)\n", pc5s_header->traffic_type);
LOG_D(PDCP,"Received PC5-S message, rbid: %d)\n", pc5s_header->rb_id);
LOG_D(PDCP,"Received PC5-S message, data_size: %d)\n", pc5s_header->data_size);
LOG_D(PDCP,"Received PC5-S message, inst: %d)\n", pc5s_header->inst);
LOG_D(PDCP,"Received PC5-S message,sourceL2Id: 0x%08x\n)\n", pc5s_header->sourceL2Id);
LOG_D(PDCP,"Received PC5-S message,destinationL1Id: 0x%08x\n)\n", pc5s_header->destinationL2Id);
LOG_I(PDCP,"Received PC5-S message, traffic_type: %d)\n", pc5s_header->traffic_type);
LOG_I(PDCP,"Received PC5-S message, rbid: %d)\n", pc5s_header->rb_id);
LOG_I(PDCP,"Received PC5-S message, data_size: %d)\n", pc5s_header->data_size);
LOG_I(PDCP,"Received PC5-S message, inst: %d)\n", pc5s_header->inst);
LOG_I(PDCP,"Received PC5-S message,sourceL2Id: 0x%08x\n)\n", pc5s_header->sourceL2Id);
LOG_I(PDCP,"Received PC5-S message,destinationL1Id: 0x%08x\n)\n", pc5s_header->destinationL2Id);
#endif
......
......@@ -5861,7 +5861,7 @@ void *rrc_control_socket_thread_fct(void *arg)
//configure MAC with sourceL2Id/groupL2ID
LOG_I(PHY,"Configuration MAC for sourceL2Id/GroupL2ID %d/%d\n",sourceL2Id,groupL2Id);
LOG_I(PHY,"Configuration MAC for sourceL2Id/GroupL2ID, %d/%d, UE->DRB_config[0][0]->drb_Identity: %d, group_comm_rbid: %d \n",sourceL2Id,groupL2Id,UE->DRB_config[0][0]->drb_Identity, group_comm_rbid);
rrc_mac_config_req_ue(module_id,0,0, //eNB_index =0
(RadioResourceConfigCommonSIB_t *)NULL,
(struct PhysicalConfigDedicated *)NULL,
......@@ -5896,8 +5896,8 @@ void *rrc_control_socket_thread_fct(void *arg)
#if defined(Rel10) || defined(Rel14)
,CONFIG_ACTION_ADD,
&sourceL2Id,
&groupL2Id,
NULL,
&groupL2Id,
NULL,
1025, // indicates that there is no update in the frame number
11, // /indicates that there isno update in the subframe number
......@@ -6491,7 +6491,8 @@ void *rrc_control_socket_thread_fct(void *arg)
#endif
(MeasObjectToAddMod_t **)NULL,
(MAC_MainConfig_t *)NULL,
10, //LCID
//10, //LCID
pc5s_rbid, //LCID
(struct LogicalChannelConfig *)NULL,
(MeasGapConfig_t *)NULL,
(TDD_Config_t *)NULL,
......
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