merge develop,fix basic sim and warnings
This commit is contained in:
@@ -525,7 +525,7 @@ int main(int argc, char *argv[])
|
||||
time_stats_t time_optim[10], time_decoder[10];
|
||||
n_iter_stats_t dec_iter[3];
|
||||
|
||||
short BG=0,Zc,Kb;
|
||||
short BG=0,Zc,Kb=0;
|
||||
|
||||
while ((c = getopt (argc, argv, "q:r:s:S:l:n:d:i:t:u:h")) != -1)
|
||||
switch (c)
|
||||
|
||||
@@ -36,7 +36,7 @@
|
||||
|
||||
#include "common/utils/LOG/log.h"
|
||||
#include "common/utils/LOG/vcd_signal_dumper.h"
|
||||
|
||||
#include "executables/softmodem-common.h"
|
||||
|
||||
//uint8_t ncs_cell[20][7];
|
||||
//#define DEBUG_PUCCH_TXS
|
||||
@@ -801,9 +801,8 @@ uint32_t rx_pucch(PHY_VARS_eNB *eNB,
|
||||
for (j=0; j<NUMBER_OF_UE_MAX; j++) {
|
||||
eNB->pucch1_stats_cnt[j][i]=0;
|
||||
eNB->pucch1ab_stats_cnt[j][i]=0;
|
||||
#if defined(USRP_REC_PLAY) // not 100% sure
|
||||
eNB->pucch1_stats_thres[j][i]=0;
|
||||
#endif
|
||||
if ( IS_SOFTMODEM_IQPLAYER)
|
||||
eNB->pucch1_stats_thres[j][i]=0;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1193,15 +1192,13 @@ uint32_t rx_pucch(PHY_VARS_eNB *eNB,
|
||||
stat_re=0;
|
||||
stat_im=0;
|
||||
// Do detection now
|
||||
#if defined(USRP_REC_PLAY)
|
||||
|
||||
// It looks like the value is a bit messy when RF is replayed.
|
||||
|
||||
// It looks like the pucch1_thres value is a bit messy when RF is replayed.
|
||||
// For instance i assume to skip pucch1_thres from the test below.
|
||||
// Not 100% sure
|
||||
if (sigma2_dB<(dB_fixed(stat_max))) {//
|
||||
#else
|
||||
if (sigma2_dB<(dB_fixed(stat_max)-pucch1_thres)) {//
|
||||
#endif
|
||||
|
||||
if (sigma2_dB<(dB_fixed(stat_max) - (IS_SOFTMODEM_IQPLAYER?0:pucch1_thres)) ) {//
|
||||
chL = (nsymb>>1)-4;
|
||||
chest_mag=0;
|
||||
cfo = (frame_parms->Ncp==0) ? &cfo_pucch_np[14*phase_max] : &cfo_pucch_ep[12*phase_max];
|
||||
@@ -1339,11 +1336,7 @@ uint32_t rx_pucch(PHY_VARS_eNB *eNB,
|
||||
if (fmt==pucch_format1b)
|
||||
*(1+payload) = (stat_im<0) ? 1 : 2;
|
||||
} else { // insufficient energy on PUCCH so NAK
|
||||
#if defined(USRP_REC_PLAY)
|
||||
LOG_D(PHY,"PUCCH 1a/b: NAK subframe %d : sigma2_dB %d, stat_max %d, pucch1_thres %d\n",subframe,sigma2_dB,dB_fixed(stat_max),pucch1_thres);
|
||||
#else
|
||||
LOG_D(PHY,"In pucch.c PUCCH 1a/b: NAK subframe %d : sigma2_dB %d, stat_max %d, pucch1_thres %d\n",subframe,sigma2_dB,dB_fixed(stat_max),pucch1_thres);
|
||||
#endif
|
||||
*payload = 4; // DTX
|
||||
((int16_t *)&eNB->pucch1ab_stats[UE_id][(subframe<<10) + (eNB->pucch1ab_stats_cnt[UE_id][subframe])])[0] = (int16_t)(stat_re);
|
||||
((int16_t *)&eNB->pucch1ab_stats[UE_id][(subframe<<10) + (eNB->pucch1ab_stats_cnt[UE_id][subframe])])[1] = (int16_t)(stat_im);
|
||||
|
||||
@@ -711,6 +711,15 @@ uint32_t nr_ulsch_decoding(PHY_VARS_gNB *phy_vars_gNB,
|
||||
|
||||
}
|
||||
|
||||
#ifdef DEBUG_ULSCH_DECODING
|
||||
LOG_I(PHY, "Decoder output (payload): \n");
|
||||
for (i = 0; i < harq_process->TBS / 8; i++) {
|
||||
//harq_process_ul_ue->a[i] = (unsigned char) rand();
|
||||
//printf("a[%d]=0x%02x\n",i,harq_process_ul_ue->a[i]);
|
||||
printf("0x%02x",harq_process->b[i]);
|
||||
}
|
||||
#endif
|
||||
|
||||
ulsch->last_iteration_cnt = ret;
|
||||
|
||||
return(ret);
|
||||
|
||||
@@ -1078,6 +1078,7 @@ void nr_pusch_codeword_scrambling(uint8_t *in,
|
||||
|
||||
void nr_ue_ulsch_procedures(PHY_VARS_NR_UE *UE,
|
||||
unsigned char harq_pid,
|
||||
uint8_t frame,
|
||||
uint8_t slot,
|
||||
uint8_t thread_id,
|
||||
int gNB_id);
|
||||
|
||||
@@ -41,9 +41,15 @@
|
||||
#include "PHY/NR_TRANSPORT/nr_sch_dmrs.h"
|
||||
#include "PHY/defs_nr_common.h"
|
||||
#include "PHY/TOOLS/tools_defs.h"
|
||||
#include "executables/nr-softmodem.h"
|
||||
#include "executables/softmodem-common.h"
|
||||
#include "LAYER2/NR_MAC_UE/mac_proto.h"
|
||||
|
||||
//#define DEBUG_SCFDMA
|
||||
//#define DEBUG_PUSCH_MAPPING
|
||||
//#define DEBUG_MAC_PDU
|
||||
|
||||
//extern int32_t uplink_counter;
|
||||
|
||||
void nr_pusch_codeword_scrambling(uint8_t *in,
|
||||
uint32_t size,
|
||||
@@ -86,6 +92,7 @@ void nr_pusch_codeword_scrambling(uint8_t *in,
|
||||
|
||||
void nr_ue_ulsch_procedures(PHY_VARS_NR_UE *UE,
|
||||
unsigned char harq_pid,
|
||||
uint8_t frame,
|
||||
uint8_t slot,
|
||||
uint8_t thread_id,
|
||||
int gNB_id) {
|
||||
@@ -104,11 +111,13 @@ void nr_ue_ulsch_procedures(PHY_VARS_NR_UE *UE,
|
||||
int ap, start_symbol, Nid_cell, i;
|
||||
int sample_offsetF, N_RE_prime, N_PRB_oh;
|
||||
uint16_t n_rnti;
|
||||
uint8_t data_existing =0;
|
||||
|
||||
NR_UE_ULSCH_t *ulsch_ue;
|
||||
NR_UL_UE_HARQ_t *harq_process_ul_ue;
|
||||
NR_DL_FRAME_PARMS *frame_parms = &UE->frame_parms;
|
||||
NR_UE_PUSCH *pusch_ue = UE->pusch_vars[thread_id][gNB_id];
|
||||
uint8_t ulsch_input_buffer[MAX_ULSCH_PAYLOAD_BYTES];
|
||||
|
||||
num_of_codewords = 1; // tmp assumption
|
||||
n_rnti = 0x1234;
|
||||
@@ -157,14 +166,54 @@ void nr_ue_ulsch_procedures(PHY_VARS_NR_UE *UE,
|
||||
0,
|
||||
harq_process_ul_ue->Nl);
|
||||
|
||||
uint8_t access_mode = SCHEDULED_ACCESS;
|
||||
|
||||
//-----------------------------------------------------//
|
||||
// to be removed later when MAC is ready
|
||||
|
||||
if (harq_process_ul_ue != NULL){
|
||||
for (i = 0; i < harq_process_ul_ue->TBS / 8; i++) {
|
||||
harq_process_ul_ue->a[i] = (unsigned char) rand();
|
||||
//printf("input encoder a[%d]=0x%02x\n",i,harq_process_ul_ue->a[i]);
|
||||
}
|
||||
|
||||
if (IS_SOFTMODEM_NOS1){
|
||||
data_existing = nr_ue_get_sdu(UE->Mod_id, UE->CC_id, frame,
|
||||
slot, 0, ulsch_input_buffer, harq_process_ul_ue->TBS/8, &access_mode);
|
||||
//IP traffic to be transmitted
|
||||
if(data_existing){
|
||||
//harq_process_ul_ue->a = (unsigned char*)calloc(harq_process_ul_ue->TBS/8, sizeof(unsigned char));
|
||||
memcpy(harq_process_ul_ue->a, ulsch_input_buffer, harq_process_ul_ue->TBS/8);
|
||||
|
||||
#ifdef DEBUG_MAC_PDU
|
||||
LOG_I(PHY, "Printing MAC PDU to be encoded, TBS is: %d \n", harq_process_ul_ue->TBS/8);
|
||||
for (i = 0; i < harq_process_ul_ue->TBS / 8; i++) {
|
||||
printf("0x%02x",harq_process_ul_ue->a[i]);
|
||||
}
|
||||
printf("\n");
|
||||
#endif
|
||||
}
|
||||
//Random traffic to be transmitted if there is no IP traffic available for this Tx opportunity
|
||||
else{
|
||||
//Use zeros for the header bytes in noS1 mode, in order to make sure that the LCID is not valid
|
||||
//and block this traffic from being forwarded to the upper layers at the gNB
|
||||
uint16_t payload_offset = 5;
|
||||
LOG_D(PHY, "Random data to be tranmsitted: \n");
|
||||
//Give the header bytes some dummy value in order to block the random packet at the MAC layer of the receiver
|
||||
for (i = 0; i<payload_offset; i++)
|
||||
harq_process_ul_ue->a[i] = 0;
|
||||
|
||||
for (i = payload_offset; i < harq_process_ul_ue->TBS / 8; i++) {
|
||||
harq_process_ul_ue->a[i] = (unsigned char) rand();
|
||||
//printf(" input encoder a[%d]=0x%02x\n",i,harq_process_ul_ue->a[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
//else if(uplink_counter == 0){ //if(!IS_SOFTMODEM_NOS1){
|
||||
else{
|
||||
LOG_D(PHY, "Random data to be tranmsitted: \n");
|
||||
for (i = 0; i < harq_process_ul_ue->TBS / 8; i++) {
|
||||
harq_process_ul_ue->a[i] = (unsigned char) rand();
|
||||
//printf(" input encoder a[%d]=0x%02x\n",i,harq_process_ul_ue->a[i]);
|
||||
}
|
||||
//uplink_counter++;
|
||||
}
|
||||
} else {
|
||||
LOG_E(PHY, "[phy_procedures_nrUE_TX] harq_process_ul_ue is NULL !!\n");
|
||||
return;
|
||||
@@ -175,6 +224,7 @@ void nr_ue_ulsch_procedures(PHY_VARS_NR_UE *UE,
|
||||
/////////////////////////ULSCH coding/////////////////////////
|
||||
///////////
|
||||
|
||||
|
||||
nr_ulsch_encoding(ulsch_ue, frame_parms, harq_pid);
|
||||
|
||||
///////////
|
||||
@@ -219,6 +269,7 @@ void nr_ue_ulsch_procedures(PHY_VARS_NR_UE *UE,
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
//}
|
||||
}
|
||||
|
||||
/////////////////////////DMRS Modulation/////////////////////////
|
||||
@@ -372,10 +423,12 @@ void nr_ue_ulsch_procedures(PHY_VARS_NR_UE *UE,
|
||||
}
|
||||
}
|
||||
|
||||
//}
|
||||
|
||||
///////////
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
|
||||
return;
|
||||
LOG_D(PHY, "Is data existing ?: %d \n", data_existing);
|
||||
}
|
||||
|
||||
|
||||
@@ -406,6 +459,13 @@ uint8_t nr_ue_pusch_common_procedures(PHY_VARS_NR_UE *UE,
|
||||
if (tx_offset < 0)
|
||||
tx_offset += frame_parms->samples_per_frame;
|
||||
|
||||
// clear the transmit data array for the current subframe
|
||||
/*for (int aa=0; aa<UE->frame_parms.nb_antennas_tx; aa++) {
|
||||
memset(&UE->common_vars.txdata[aa][tx_offset],0,UE->frame_parms.samples_per_slot*sizeof(int32_t));
|
||||
//memset(&UE->common_vars.txdataF[aa][tx_offset],0,UE->frame_parms.samples_per_slot*sizeof(int32_t));
|
||||
}*/
|
||||
|
||||
|
||||
txdata = UE->common_vars.txdata;
|
||||
txdataF = UE->common_vars.txdataF;
|
||||
|
||||
|
||||
@@ -46,9 +46,7 @@
|
||||
|
||||
#include <time.h>
|
||||
|
||||
#if defined(ENABLE_ITTI)
|
||||
#include "intertask_interface.h"
|
||||
#endif
|
||||
#include "intertask_interface.h"
|
||||
|
||||
|
||||
extern int oai_nfapi_rach_ind(nfapi_rach_indication_t *rach_ind);
|
||||
|
||||
@@ -47,4 +47,4 @@ void handle_nr_nfapi_dlsch_pdu(PHY_VARS_gNB *gNB,int frame,int slot,
|
||||
|
||||
void nr_fill_rx_indication(PHY_VARS_gNB *gNB, int frame, int slot_rx, int UE_id, uint8_t harq_pid);
|
||||
|
||||
void nr_fill_crc_indication(PHY_VARS_gNB *gNB, int frame, int slot_rx, int UE_id, uint8_t crc_flag);
|
||||
void nr_fill_crc_indication(PHY_VARS_gNB *gNB, int frame, int slot_rx, int UE_id, uint8_t crc_flag);
|
||||
|
||||
@@ -39,15 +39,15 @@
|
||||
#include "PHY/INIT/phy_init.h"
|
||||
#include "PHY/MODULATION/nr_modulation.h"
|
||||
#include "T.h"
|
||||
#include "executables/nr-softmodem.h"
|
||||
#include "executables/softmodem-common.h"
|
||||
|
||||
#include "assertions.h"
|
||||
#include "msc.h"
|
||||
|
||||
#include <time.h>
|
||||
|
||||
#if defined(ENABLE_ITTI)
|
||||
#include "intertask_interface.h"
|
||||
#endif
|
||||
#include "intertask_interface.h"
|
||||
|
||||
extern uint8_t nfapi_mode;
|
||||
/*
|
||||
@@ -285,8 +285,14 @@ void nr_ulsch_procedures(PHY_VARS_gNB *gNB, int frame_rx, int slot_rx, int UE_id
|
||||
|
||||
if (ret > gNB->ulsch[UE_id][0]->max_ldpc_iterations)
|
||||
LOG_I(PHY, "ULSCH in error\n");
|
||||
else
|
||||
LOG_I(PHY, "ULSCH received ok\n");
|
||||
//gNB->ulsch[UE_id+1][0]->harq_processes[harq_pid]->b
|
||||
else if(gNB->ulsch[UE_id][0]->harq_processes[harq_pid]->b!=NULL){
|
||||
LOG_I(PHY, "ULSCH received ok \n");
|
||||
if(IS_SOFTMODEM_NOS1){ //&& gNB->ulsch[UE_id][0]->rnti == 0x1234
|
||||
nr_fill_crc_indication (gNB,frame_rx, slot_rx, UE_id, 0);
|
||||
nr_fill_rx_indication(gNB, frame_rx, slot_rx, UE_id, harq_pid);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -298,25 +304,35 @@ void nr_fill_rx_indication(PHY_VARS_gNB *gNB, int frame, int slot_rx, int UE_id,
|
||||
// --------------------
|
||||
|
||||
nfapi_rx_indication_pdu_t *pdu;
|
||||
|
||||
int timing_advance_update;
|
||||
int sync_pos;
|
||||
|
||||
NR_gNB_ULSCH_t *ulsch = gNB->ulsch[UE_id][0];
|
||||
NR_UL_gNB_HARQ_t *harq_process = ulsch->harq_processes[harq_pid];
|
||||
|
||||
uint16_t mu = gNB->gNB_config.subframe_config.numerology_index_mu.value;
|
||||
// pthread_mutex_lock(&gNB->UL_INFO_mutex);
|
||||
|
||||
// gNB->UL_INFO.rx_ind.sfn_sf = frame<<4| slot_rx;
|
||||
// gNB->UL_INFO.rx_ind.rx_indication_body.tl.tag = NFAPI_RX_INDICATION_BODY_TAG;
|
||||
pthread_mutex_lock(&gNB->UL_INFO_mutex);
|
||||
|
||||
pdu = &gNB->UL_INFO.rx_ind.rx_indication_body.rx_pdu_list[gNB->UL_INFO.rx_ind.rx_indication_body.number_of_pdus];
|
||||
gNB->UL_INFO.rx_ind.sfn_sf = frame<<4| slot_rx;
|
||||
gNB->UL_INFO.rx_ind.rx_indication_body.tl.tag = NFAPI_RX_INDICATION_BODY_TAG;
|
||||
gNB->UL_INFO.rx_ind.rx_indication_body.rx_pdu_list->rx_indication_rel8.length = gNB->ulsch[UE_id][0]->harq_processes[harq_pid]->TBS>>3;
|
||||
|
||||
// pdu->rx_ue_information.handle = gNB->ulsch[UE_id+1][0]->handle;
|
||||
// pdu->rx_ue_information.tl.tag = NFAPI_RX_UE_INFORMATION_TAG;
|
||||
// pdu->rx_ue_information.rnti = gNB->ulsch[UE_id+1][0]->rnti;
|
||||
// pdu->rx_indication_rel8.tl.tag = NFAPI_RX_INDICATION_REL8_TAG;
|
||||
// pdu->rx_indication_rel8.length = gNB->ulsch[UE_id+1][0]->harq_processes[harq_pid]->TBS>>3;
|
||||
// pdu->rx_indication_rel8.offset = 1; // DJP - I dont understand - but broken unless 1 ???? 0; // filled in at the end of the UL_INFO formation
|
||||
pdu = &gNB->UL_INFO.rx_ind.rx_indication_body.rx_pdu_list[gNB->UL_INFO.rx_ind.rx_indication_body.number_of_pdus];
|
||||
|
||||
pdu->data = gNB->ulsch[UE_id+1][0]->harq_processes[harq_pid]->b;
|
||||
//pdu->rx_ue_information.handle = gNB->ulsch[UE_id+1][0]->handle;
|
||||
pdu->rx_ue_information.tl.tag = NFAPI_RX_UE_INFORMATION_TAG;
|
||||
pdu->rx_ue_information.rnti = gNB->ulsch[UE_id][0]->rnti;
|
||||
pdu->rx_indication_rel8.tl.tag = NFAPI_RX_INDICATION_REL8_TAG;
|
||||
pdu->rx_indication_rel8.offset = 1; // DJP - I dont understand - but broken unless 1 ???? 0; // filled in at the end of the UL_INFO formation
|
||||
pdu->data = harq_process->b;//gNB->ulsch[UE_id+1][0]->harq_processes[harq_pid]->b;
|
||||
// estimate timing advance for MAC
|
||||
sync_pos = nr_est_timing_advance_pusch(gNB, UE_id);
|
||||
timing_advance_update = sync_pos; // - gNB->frame_parms.nb_prefix_samples/4; //to check
|
||||
// printf("\x1B[33m" "timing_advance_update = %d\n" "\x1B[0m", timing_advance_update);
|
||||
|
||||
//pdu->data = gNB->ulsch[UE_id+1][0]->harq_processes[harq_pid]->b;
|
||||
sync_pos = nr_est_timing_advance_pusch(gNB, UE_id); // estimate timing advance for MAC
|
||||
timing_advance_update = sync_pos * (1 << mu); // scale by the used scs numerology
|
||||
|
||||
@@ -340,37 +356,37 @@ void nr_fill_rx_indication(PHY_VARS_gNB *gNB, int frame, int slot_rx, int UE_id,
|
||||
pdu->rx_indication_rel8.timing_advance = timing_advance_update;
|
||||
|
||||
// estimate UL_CQI for MAC (from antenna port 0 only)
|
||||
// int SNRtimes10 = dB_fixed_times10(gNB->pusch_vars[UE_id]->ulsch_power[0]) - 300;//(10*gNB->measurements.n0_power_dB[0]);
|
||||
int SNRtimes10 = dB_fixed_times10(gNB->pusch_vars[UE_id]->ulsch_power[0]) - 300;//(10*gNB->measurements.n0_power_dB[0]);
|
||||
|
||||
// if (SNRtimes10 < -640) pdu->rx_indication_rel8.ul_cqi=0;
|
||||
// else if (SNRtimes10 > 635) pdu->rx_indication_rel8.ul_cqi=255;
|
||||
// else pdu->rx_indication_rel8.ul_cqi=(640+SNRtimes10)/5;
|
||||
if (SNRtimes10 < -640) pdu->rx_indication_rel8.ul_cqi=0;
|
||||
else if (SNRtimes10 > 635) pdu->rx_indication_rel8.ul_cqi=255;
|
||||
else pdu->rx_indication_rel8.ul_cqi=(640+SNRtimes10)/5;
|
||||
|
||||
// LOG_D(PHY,"[PUSCH %d] Frame %d Subframe %d Filling RX_indication with SNR %d (%d), timing_advance %d (update %d)\n",
|
||||
// harq_pid,frame,slot_rx,SNRtimes10,pdu->rx_indication_rel8.ul_cqi,pdu->rx_indication_rel8.timing_advance,
|
||||
// timing_advance_update);
|
||||
|
||||
gNB->UL_INFO.rx_ind.rx_indication_body.number_of_pdus++;
|
||||
// gNB->UL_INFO.rx_ind.sfn_sf = frame<<4 | slot_rx;
|
||||
gNB->UL_INFO.rx_ind.sfn_sf = frame<<4 | slot_rx;
|
||||
|
||||
// pthread_mutex_unlock(&gNB->UL_INFO_mutex);
|
||||
pthread_mutex_unlock(&gNB->UL_INFO_mutex);
|
||||
}
|
||||
|
||||
void nr_fill_crc_indication (PHY_VARS_gNB *gNB, int frame, int slot_rx, int UE_id, uint8_t crc_flag){
|
||||
// pthread_mutex_lock(&gNB->UL_INFO_mutex);
|
||||
// nfapi_crc_indication_pdu_t *pdu = &gNB->UL_INFO.crc_ind.crc_indication_body.crc_pdu_list[gNB->UL_INFO.crc_ind.crc_indication_body.number_of_crcs];
|
||||
// gNB->UL_INFO.crc_ind.sfn_sf = frame<<4 | subframe;
|
||||
// gNB->UL_INFO.crc_ind.header.message_id = NFAPI_CRC_INDICATION;
|
||||
// gNB->UL_INFO.crc_ind.crc_indication_body.tl.tag = NFAPI_CRC_INDICATION_BODY_TAG;
|
||||
// pdu->instance_length = 0; // don't know what to do with this
|
||||
// // pdu->rx_ue_information.handle = handle;
|
||||
// pdu->rx_ue_information.tl.tag = NFAPI_RX_UE_INFORMATION_TAG;
|
||||
// pdu->rx_ue_information.rnti = gNB->ulsch[UE_id]->rnti;
|
||||
// pdu->crc_indication_rel8.tl.tag = NFAPI_CRC_INDICATION_REL8_TAG;
|
||||
// pdu->crc_indication_rel8.crc_flag = crc_flag;
|
||||
void nr_fill_crc_indication (PHY_VARS_gNB *gNB, int frame, int slot_rx, int UE_id, uint8_t crc_flag) {
|
||||
pthread_mutex_lock(&gNB->UL_INFO_mutex);
|
||||
nfapi_crc_indication_pdu_t *pdu = &gNB->UL_INFO. crc_ind.crc_indication_body.crc_pdu_list[gNB->UL_INFO.crc_ind.crc_indication_body.number_of_crcs];
|
||||
gNB->UL_INFO.crc_ind.sfn_sf = frame<<4 | slot_rx;
|
||||
gNB->UL_INFO.crc_ind.header.message_id = NFAPI_CRC_INDICATION;
|
||||
gNB->UL_INFO.crc_ind.crc_indication_body.tl.tag = NFAPI_CRC_INDICATION_BODY_TAG;
|
||||
pdu->instance_length = 0; // don't know what to do with this
|
||||
// pdu->rx_ue_information.handle = handle;
|
||||
pdu->rx_ue_information.tl.tag = NFAPI_RX_UE_INFORMATION_TAG;
|
||||
pdu->rx_ue_information.rnti = gNB->ulsch[UE_id][0]->rnti;
|
||||
pdu->crc_indication_rel8.tl.tag = NFAPI_CRC_INDICATION_REL8_TAG;
|
||||
pdu->crc_indication_rel8.crc_flag = crc_flag;
|
||||
gNB->UL_INFO.crc_ind.crc_indication_body.number_of_crcs++;
|
||||
//LOG_D(PHY, "%s() rnti:%04x crcs:%d crc_flag:%d\n", __FUNCTION__, pdu->rx_ue_information.rnti, gNB->UL_INFO.crc_ind.crc_indication_body.number_of_crcs, crc_flag);
|
||||
// pthread_mutex_unlock(&gNB->UL_INFO_mutex);
|
||||
//LOG_D(PHY, "%s() rnti:%04x crcs:%d crc_flag:%d\n", __FUNCTION__, pdu->rx_ue_information.rnti, eNB->UL_INFO.crc_ind.crc_indication_body.number_of_crcs, crc_flag);
|
||||
pthread_mutex_unlock(&gNB->UL_INFO_mutex);
|
||||
}
|
||||
|
||||
void phy_procedures_gNB_common_RX(PHY_VARS_gNB *gNB, int frame_rx, int slot_rx) {
|
||||
@@ -422,8 +438,6 @@ void phy_procedures_gNB_uespec_RX(PHY_VARS_gNB *gNB, int frame_rx, int slot_rx)
|
||||
//LOG_M("rxdataF_comp.m","rxF_comp",gNB->pusch_vars[UE_id]->rxdataF_comp[0],6900,1,1);
|
||||
//LOG_M("rxdataF_ext.m","rxF_ext",gNB->pusch_vars[UE_id]->rxdataF_ext[0],6900,1,1);
|
||||
nr_ulsch_procedures(gNB, frame_rx, slot_rx, UE_id, harq_pid);
|
||||
nr_fill_rx_indication(gNB, frame_rx, slot_rx, UE_id, harq_pid); // indicate SDU to MAC
|
||||
nr_fill_crc_indication(gNB, frame_rx, slot_rx, UE_id, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -74,15 +74,7 @@ fifo_dump_emos_UE emos_dump_UE;
|
||||
|
||||
#include "common/utils/LOG/vcd_signal_dumper.h"
|
||||
#include "UTIL/OPT/opt.h"
|
||||
|
||||
#if defined(ENABLE_ITTI)
|
||||
# include "intertask_interface.h"
|
||||
#endif
|
||||
|
||||
//#include "PHY/defs.h"
|
||||
|
||||
//#include "PHY/CODING/extern.h"
|
||||
|
||||
#include "intertask_interface.h"
|
||||
#include "T.h"
|
||||
|
||||
#define DLSCH_RB_ALLOC 0x1fbf // skip DC RB (total 23/25 RBs)
|
||||
@@ -2493,6 +2485,7 @@ void phy_procedures_nrUE_TX(PHY_VARS_NR_UE *ue,
|
||||
|
||||
nr_ue_ulsch_procedures(ue,
|
||||
harq_pid,
|
||||
frame_tx,
|
||||
slot_tx,
|
||||
thread_id,
|
||||
gNB_id);
|
||||
@@ -2507,8 +2500,8 @@ void phy_procedures_nrUE_TX(PHY_VARS_NR_UE *ue,
|
||||
} // UE_mode==PUSCH
|
||||
*/
|
||||
|
||||
|
||||
nr_ue_pusch_common_procedures(ue,
|
||||
LOG_D(PHY, "Sending data \n");
|
||||
nr_ue_pusch_common_procedures(ue,
|
||||
harq_pid,
|
||||
slot_tx,
|
||||
thread_id,
|
||||
@@ -2517,6 +2510,7 @@ void phy_procedures_nrUE_TX(PHY_VARS_NR_UE *ue,
|
||||
|
||||
|
||||
|
||||
|
||||
/*
|
||||
if ((ue->UE_mode[eNB_id] == PRACH) &&
|
||||
(ue->frame_parms.prach_config_common.prach_Config_enabled==1)) {
|
||||
|
||||
@@ -53,11 +53,7 @@
|
||||
|
||||
#include "common/utils/LOG/vcd_signal_dumper.h"
|
||||
#include "UTIL/OPT/opt.h"
|
||||
|
||||
#if defined(ENABLE_ITTI)
|
||||
#include "intertask_interface.h"
|
||||
#endif
|
||||
|
||||
#include "intertask_interface.h"
|
||||
#include "PHY/defs_UE.h"
|
||||
|
||||
#include "PHY/CODING/coding_extern.h"
|
||||
@@ -4885,10 +4881,8 @@ void phy_procedures_UE_lte(PHY_VARS_UE *ue,
|
||||
uint8_t abstraction_flag,
|
||||
uint8_t do_pdcch_flag,
|
||||
runmode_t mode) {
|
||||
#if defined(ENABLE_ITTI)
|
||||
MessageDef *msg_p;
|
||||
int result;
|
||||
#endif
|
||||
int frame_rx = proc->frame_rx;
|
||||
int frame_tx = proc->frame_tx;
|
||||
int subframe_rx = proc->subframe_rx;
|
||||
@@ -4905,9 +4899,6 @@ void phy_procedures_UE_lte(PHY_VARS_UE *ue,
|
||||
if ( LOG_DEBUGFLAG(UE_TIMING)) {
|
||||
start_meas(&ue->phy_proc[ue->current_thread_id[subframe_rx]]);
|
||||
}
|
||||
|
||||
#if defined(ENABLE_ITTI)
|
||||
|
||||
do {
|
||||
// Checks if a message has been sent to PHY sub-task
|
||||
itti_poll_msg (TASK_PHY_UE, &msg_p);
|
||||
@@ -4929,8 +4920,6 @@ void phy_procedures_UE_lte(PHY_VARS_UE *ue,
|
||||
}
|
||||
} while(msg_p != NULL);
|
||||
|
||||
#endif
|
||||
|
||||
for (slot=0; slot<2; slot++) {
|
||||
if ((subframe_select(&ue->frame_parms,subframe_tx)==SF_UL)||
|
||||
(ue->frame_parms.frame_type == FDD)) {
|
||||
|
||||
@@ -68,58 +68,19 @@ uint16_t NB_UE_INST = 1;
|
||||
|
||||
//Dummy Functions
|
||||
lte_subframe_t subframe_select(LTE_DL_FRAME_PARMS *frame_parms, unsigned char subframe) {return(SF_DL);}
|
||||
int rlc_module_init (int enb) {return(0);}
|
||||
//int rlc_module_init (int enb) {return(0);}
|
||||
void pdcp_layer_init (void) {}
|
||||
boolean_t pdcp_data_ind( const protocol_ctxt_t *const ctxt_pP, const srb_flag_t srb_flagP, const MBMS_flag_t MBMS_flagP, const rb_id_t rb_idP,
|
||||
const sdu_size_t sdu_buffer_sizeP, mem_block_t *const sdu_buffer_pP)
|
||||
{return (0);}
|
||||
|
||||
int rrc_init_nr_global_param (void) {return(0);}
|
||||
void config_common(int Mod_idP,int CC_idP,int Nid_cell,int nr_bandP,uint64_t SSB_positions,uint16_t ssb_periodicity,uint64_t dl_CarrierFreqP,uint32_t dl_BandwidthP);
|
||||
int8_t nr_mac_rrc_data_ind_ue(const module_id_t module_id, const int CC_id, const uint8_t gNB_index,
|
||||
const int8_t channel, const uint8_t* pduP, const sdu_size_t pdu_len) {return(0);}
|
||||
uint64_t get_softmodem_optmask(void) {return 0;}
|
||||
mac_rlc_status_resp_t mac_rlc_status_ind(const module_id_t module_idP,
|
||||
const rnti_t rntiP,
|
||||
const eNB_index_t eNB_index,
|
||||
const frame_t frameP,
|
||||
const sub_frame_t subframeP,
|
||||
const eNB_flag_t enb_flagP,
|
||||
const MBMS_flag_t MBMS_flagP,
|
||||
const logical_chan_id_t channel_idP,
|
||||
const tb_size_t tb_sizeP,
|
||||
const uint32_t sourceL2Id,
|
||||
const uint32_t destinationL2Id) {mac_rlc_status_resp_t mac_rlc_status_resp = {0}; return mac_rlc_status_resp;}
|
||||
tbs_size_t mac_rlc_data_req(const module_id_t module_idP,
|
||||
const rnti_t rntiP,
|
||||
const eNB_index_t eNB_index,
|
||||
const frame_t frameP,
|
||||
const eNB_flag_t enb_flagP,
|
||||
const MBMS_flag_t MBMS_flagP,
|
||||
const logical_chan_id_t channel_idP,
|
||||
const tb_size_t tb_sizeP,
|
||||
char *buffer_pP,
|
||||
const uint32_t sourceL2Id,
|
||||
const uint32_t destinationL2Id) {return 0;}
|
||||
int generate_dlsch_header(unsigned char *mac_header,
|
||||
unsigned char num_sdus,
|
||||
unsigned short *sdu_lengths,
|
||||
unsigned char *sdu_lcids,
|
||||
unsigned char drx_cmd,
|
||||
unsigned short timing_advance_cmd,
|
||||
unsigned char *ue_cont_res_id,
|
||||
unsigned char short_padding,
|
||||
unsigned short post_padding){return 0;}
|
||||
void nr_ip_over_LTE_DRB_preconfiguration(void){}
|
||||
void mac_rlc_data_ind (
|
||||
const module_id_t module_idP,
|
||||
const rnti_t rntiP,
|
||||
const eNB_index_t eNB_index,
|
||||
const frame_t frameP,
|
||||
const eNB_flag_t enb_flagP,
|
||||
const MBMS_flag_t MBMS_flagP,
|
||||
const logical_chan_id_t channel_idP,
|
||||
char *buffer_pP,
|
||||
const tb_size_t tb_sizeP,
|
||||
num_tb_t num_tbP,
|
||||
crc_t *crcs_pP)
|
||||
{}
|
||||
|
||||
|
||||
// needed for some functions
|
||||
openair0_config_t openair0_cfg[MAX_CARDS];
|
||||
|
||||
@@ -60,6 +60,7 @@ uint16_t NB_UE_INST = 1;
|
||||
|
||||
// needed for some functions
|
||||
openair0_config_t openair0_cfg[MAX_CARDS];
|
||||
uint64_t get_softmodem_optmask(void) {return 0;}
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
|
||||
@@ -70,53 +70,12 @@ uint16_t NB_UE_INST = 1;
|
||||
// dummy functions
|
||||
int8_t nr_mac_rrc_data_ind_ue(const module_id_t module_id, const int CC_id, const uint8_t gNB_index,
|
||||
const int8_t channel, const uint8_t* pduP, const sdu_size_t pdu_len) { return 0; }
|
||||
void mac_rlc_data_ind ( const module_id_t module_idP,
|
||||
const rnti_t rntiP,
|
||||
const eNB_index_t eNB_index,
|
||||
const frame_t frameP,
|
||||
const eNB_flag_t enb_flagP,
|
||||
const MBMS_flag_t MBMS_flagP,
|
||||
const logical_chan_id_t channel_idP,
|
||||
char *buffer_pP,
|
||||
const tb_size_t tb_sizeP,
|
||||
num_tb_t num_tbP,
|
||||
crc_t *crcs_pP){}
|
||||
mac_rlc_status_resp_t mac_rlc_status_ind( const module_id_t module_idP,
|
||||
const rnti_t rntiP,
|
||||
const eNB_index_t eNB_index,
|
||||
const frame_t frameP,
|
||||
const sub_frame_t subframeP,
|
||||
const eNB_flag_t enb_flagP,
|
||||
const MBMS_flag_t MBMS_flagP,
|
||||
const logical_chan_id_t channel_idP,
|
||||
const tb_size_t tb_sizeP,
|
||||
const uint32_t sourceL2Id,
|
||||
const uint32_t destinationL2Id)
|
||||
{mac_rlc_status_resp_t mac_rlc_status_resp = {0}; return mac_rlc_status_resp;}
|
||||
tbs_size_t mac_rlc_data_req( const module_id_t module_idP,
|
||||
const rnti_t rntiP,
|
||||
const eNB_index_t eNB_index,
|
||||
const frame_t frameP,
|
||||
const eNB_flag_t enb_flagP,
|
||||
const MBMS_flag_t MBMS_flagP,
|
||||
const logical_chan_id_t channel_idP,
|
||||
const tb_size_t tb_sizeP,
|
||||
char *buffer_pP,
|
||||
const uint32_t sourceL2Id,
|
||||
const uint32_t destinationL2Id )
|
||||
{return 0;}
|
||||
int generate_dlsch_header(unsigned char *mac_header,
|
||||
unsigned char num_sdus,
|
||||
unsigned short *sdu_lengths,
|
||||
unsigned char *sdu_lcids,
|
||||
unsigned char drx_cmd,
|
||||
unsigned short timing_advance_cmd,
|
||||
unsigned char *ue_cont_res_id,
|
||||
unsigned char short_padding,
|
||||
unsigned short post_padding){return 0;}
|
||||
uint64_t get_softmodem_optmask(void) {return 0;}
|
||||
int rlc_module_init (int enb) {return(0);}
|
||||
//int rlc_module_init (int enb) {return(0);}
|
||||
void pdcp_layer_init (void) {}
|
||||
boolean_t pdcp_data_ind( const protocol_ctxt_t *const ctxt_pP, const srb_flag_t srb_flagP, const MBMS_flag_t MBMS_flagP, const rb_id_t rb_idP,
|
||||
const sdu_size_t sdu_buffer_sizeP, mem_block_t *const sdu_buffer_pP)
|
||||
{return (0);}
|
||||
void nr_ip_over_LTE_DRB_preconfiguration(void){}
|
||||
|
||||
// needed for some functions
|
||||
|
||||
Reference in New Issue
Block a user