Commit e5eca66a authored by Raphael Defosseux's avatar Raphael Defosseux

Merge remote-tracking branch 'origin/fapi_for_dmrs_and_ptrs' into develop_integration_2020_w22

parents 82bbde7d 7fc9ab77
......@@ -146,7 +146,7 @@ void init_nr_ue_vars(PHY_VARS_NR_UE *ue,
ue->Mod_id = UE_id;
ue->mac_enabled = 1;
// initialize all signal buffers
// initialize all signal buffers
init_nr_ue_signal(ue,1,abstraction_flag);
// intialize transport
......@@ -357,10 +357,11 @@ static void UE_synch(void *arg) {
}
void processSlotTX( PHY_VARS_NR_UE *UE, UE_nr_rxtx_proc_t *proc) {
uint32_t nb_rb, start_rb;
uint8_t nb_symb_sch, start_symbol, mcs, precod_nbr_layers, harq_pid, rvidx;
uint16_t n_rnti;
uint32_t rb_size, rb_start;
uint16_t rnti, l_prime_mask, n_rb0, n_rb1, pdu_bit_map;
uint8_t nr_of_symbols, start_symbol_index, mcs_index, mcs_table, nrOfLayers, harq_process_id, rv_index, dmrs_config_type;
uint8_t ptrs_mcs1, ptrs_mcs2, ptrs_mcs3, ptrs_time_density, ptrs_freq_density;
nr_dcireq_t dcireq;
nr_scheduled_response_t scheduled_response;
......@@ -381,30 +382,53 @@ void processSlotTX( PHY_VARS_NR_UE *UE, UE_nr_rxtx_proc_t *proc) {
scheduled_response.frame = proc->frame_rx;
scheduled_response.slot = proc->nr_tti_rx;
//--------------------------Temporary configuration-----------------------------//
n_rnti = 0x1234;
nb_rb = 50;
start_rb = 0;
nb_symb_sch = 12;
start_symbol = 2;
precod_nbr_layers = 1;
mcs = 9;
harq_pid = 0;
rvidx = 0;
rnti = 0x1234;
rb_size = 50;
rb_start = 0;
nr_of_symbols = 12;
start_symbol_index = 2;
nrOfLayers = 1;
mcs_index = 9;
mcs_table = 0;
harq_process_id = 0;
rv_index = 0;
l_prime_mask = get_l_prime(nr_of_symbols, typeB, pusch_dmrs_pos0, pusch_len1);
dmrs_config_type = 0;
ptrs_mcs1 = 2;
ptrs_mcs2 = 4;
ptrs_mcs3 = 10;
n_rb0 = 25;
n_rb1 = 75;
pdu_bit_map = PUSCH_PDU_BITMAP_PUSCH_DATA;
ptrs_time_density = get_L_ptrs(ptrs_mcs1, ptrs_mcs2, ptrs_mcs3, mcs_index, mcs_table);
ptrs_freq_density = get_K_ptrs(n_rb0, n_rb1, rb_size);
//------------------------------------------------------------------------------//
scheduled_response.ul_config->slot = 8;
scheduled_response.ul_config->number_pdus = 1;
scheduled_response.ul_config->ul_config_list[0].pdu_type = FAPI_NR_UL_CONFIG_TYPE_PUSCH;
scheduled_response.ul_config->ul_config_list[0].ulsch_config_pdu.rnti = n_rnti;
scheduled_response.ul_config->ul_config_list[0].ulsch_config_pdu.ulsch_pdu_rel15.number_rbs = nb_rb;
scheduled_response.ul_config->ul_config_list[0].ulsch_config_pdu.ulsch_pdu_rel15.start_rb = start_rb;
scheduled_response.ul_config->ul_config_list[0].ulsch_config_pdu.ulsch_pdu_rel15.number_symbols = nb_symb_sch;
scheduled_response.ul_config->ul_config_list[0].ulsch_config_pdu.ulsch_pdu_rel15.start_symbol = start_symbol;
scheduled_response.ul_config->ul_config_list[0].ulsch_config_pdu.ulsch_pdu_rel15.mcs = mcs;
scheduled_response.ul_config->ul_config_list[0].ulsch_config_pdu.ulsch_pdu_rel15.ndi = 0;
scheduled_response.ul_config->ul_config_list[0].ulsch_config_pdu.ulsch_pdu_rel15.rv = rvidx;
scheduled_response.ul_config->ul_config_list[0].ulsch_config_pdu.ulsch_pdu_rel15.n_layers = precod_nbr_layers;
scheduled_response.ul_config->ul_config_list[0].ulsch_config_pdu.ulsch_pdu_rel15.harq_process_nbr = harq_pid;
scheduled_response.ul_config->ul_config_list[0].pusch_config_pdu.rnti = rnti;
scheduled_response.ul_config->ul_config_list[0].pusch_config_pdu.rb_size = rb_size;
scheduled_response.ul_config->ul_config_list[0].pusch_config_pdu.rb_start = rb_start;
scheduled_response.ul_config->ul_config_list[0].pusch_config_pdu.nr_of_symbols = nr_of_symbols;
scheduled_response.ul_config->ul_config_list[0].pusch_config_pdu.start_symbol_index = start_symbol_index;
scheduled_response.ul_config->ul_config_list[0].pusch_config_pdu.ul_dmrs_symb_pos = l_prime_mask << start_symbol_index;
scheduled_response.ul_config->ul_config_list[0].pusch_config_pdu.dmrs_config_type = dmrs_config_type;
scheduled_response.ul_config->ul_config_list[0].pusch_config_pdu.mcs_index = mcs_index;
scheduled_response.ul_config->ul_config_list[0].pusch_config_pdu.mcs_table = mcs_table;
scheduled_response.ul_config->ul_config_list[0].pusch_config_pdu.pusch_data.new_data_indicator = 0;
scheduled_response.ul_config->ul_config_list[0].pusch_config_pdu.pusch_data.rv_index = rv_index;
scheduled_response.ul_config->ul_config_list[0].pusch_config_pdu.nrOfLayers = nrOfLayers;
scheduled_response.ul_config->ul_config_list[0].pusch_config_pdu.pusch_data.harq_process_id = harq_process_id;
scheduled_response.ul_config->ul_config_list[0].pusch_config_pdu.pdu_bit_map = pdu_bit_map;
scheduled_response.ul_config->ul_config_list[0].pusch_config_pdu.pusch_ptrs.ptrs_time_density = ptrs_time_density;
scheduled_response.ul_config->ul_config_list[0].pusch_config_pdu.pusch_ptrs.ptrs_freq_density = ptrs_freq_density;
scheduled_response.ul_config->ul_config_list[0].pusch_config_pdu.pusch_ptrs.ptrs_ports_list = (nfapi_nr_ue_ptrs_ports_t *) malloc(2*sizeof(nfapi_nr_ue_ptrs_ports_t));
scheduled_response.ul_config->ul_config_list[0].pusch_config_pdu.pusch_ptrs.ptrs_ports_list[0].ptrs_re_offset = 0;
if (1 << ptrs_time_density >= nr_of_symbols) {
scheduled_response.ul_config->ul_config_list[0].pusch_config_pdu.pdu_bit_map &= ~PUSCH_PDU_BITMAP_PUSCH_PTRS; // disable PUSCH PTRS
}
nr_ue_scheduled_response(&scheduled_response);
......@@ -471,7 +495,6 @@ void processSlotRX( PHY_VARS_NR_UE *UE, UE_nr_rxtx_proc_t *proc) {
}
}
// no UL for now
// no UL for now
/*
if (UE->mac_enabled==1) {
......@@ -508,7 +531,7 @@ void UE_processing(void *arg) {
PHY_VARS_NR_UE *UE = rxtxD->UE;
uint8_t gNB_id = 0;
// params for UL time alignment procedure
// params for UL time alignment procedure
NR_UL_TIME_ALIGNMENT_t *ul_time_alignment = &UE->ul_time_alignment[gNB_id];
uint8_t numerology = UE->frame_parms.numerology_index;
......@@ -523,7 +546,7 @@ void UE_processing(void *arg) {
if (frame_tx == ul_time_alignment->ta_frame && slot_tx == ul_time_alignment->ta_slot) {
LOG_D(PHY,"Applying timing advance -- frame %d -- slot %d\n", frame_tx, slot_tx);
//if (nfapi_mode!=3){
//if (nfapi_mode!=3){
nr_process_timing_advance(UE->Mod_id, UE->CC_id, ul_time_alignment->ta_command, numerology, bwp_ul_NB_RB);
ul_time_alignment->ta_frame = -1;
......@@ -591,7 +614,6 @@ void readFrame(PHY_VARS_NR_UE *UE, openair0_timestamp *timestamp, bool toTrash)
void syncInFrame(PHY_VARS_NR_UE *UE, openair0_timestamp *timestamp) {
LOG_I(PHY,"Resynchronizing RX by %d samples (mode = %d)\n",UE->rx_offset,UE->mode);
void *dummy_tx[UE->frame_parms.nb_antennas_tx];
*timestamp += UE->frame_parms.get_samples_per_slot(1,&UE->frame_parms);
for ( int size=UE->rx_offset ; size > 0 ; size -= UE->frame_parms.samples_per_subframe ) {
......
......@@ -22,6 +22,8 @@
#include "fapi_nr_ue_constants.h"
#include "PHY/impl_defs_nr.h"
#define NFAPI_UE_MAX_NUM_CB 8
/*
typedef unsigned int uint32_t;
typedef unsigned short uint16_t;
......@@ -256,40 +258,124 @@ typedef struct {
} fapi_nr_ul_config_pucch_pdu;
typedef enum {pusch_freq_hopping_disabled = 0 , pusch_freq_hopping_enabled = 1}pusch_freq_hopping_t;
typedef struct{
uint8_t aperiodicSRS_ResourceTrigger;
} fapi_nr_ul_srs_config_t;
typedef struct {
uint8_t bandwidth_part_ind;
uint16_t number_rbs;
uint16_t start_rb;
uint8_t frame_offset;
uint16_t number_symbols;
uint16_t start_symbol;
pusch_freq_hopping_t pusch_freq_hopping;
uint8_t mcs;
uint8_t ndi;
uint8_t rv;
uint8_t harq_process_nbr;
int8_t accumulated_delta_PUSCH;
int8_t absolute_delta_PUSCH;
uint8_t n_layers;
uint8_t tpmi;
uint8_t n_dmrs_cdm_groups;
uint8_t dmrs_ports[4];
uint8_t n_front_load_symb;
fapi_nr_ul_srs_config_t srs_config;
uint8_t csi_reportTriggerSize;
uint8_t maxCodeBlockGroupsPerTransportBlock;
uint8_t ptrs_dmrs_association_port;
uint8_t beta_offset_ind;
} fapi_nr_ul_config_pusch_pdu_rel15_t;
typedef struct
{
uint8_t rv_index;
uint8_t harq_process_id;
uint8_t new_data_indicator;
uint32_t tb_size;
uint16_t num_cb;
uint8_t cb_present_and_position[(NFAPI_UE_MAX_NUM_CB+7) / 8];
typedef struct {
} nfapi_nr_ue_pusch_data_t;
typedef struct
{
uint16_t harq_ack_bit_length;
uint16_t csi_part1_bit_length;
uint16_t csi_part2_bit_length;
uint8_t alpha_scaling;
uint8_t beta_offset_harq_ack;
uint8_t beta_offset_csi1;
uint8_t beta_offset_csi2;
} nfapi_nr_ue_pusch_uci_t;
typedef struct
{
uint16_t ptrs_port_index;//PT-RS antenna ports [TS38.214, sec6.2.3.1 and 38.212, section 7.3.1.1.2] Bitmap occupying the 12 LSBs with: bit 0: antenna port 0 bit 11: antenna port 11 and for each bit 0: PTRS port not used 1: PTRS port used
uint8_t ptrs_dmrs_port;//DMRS port corresponding to PTRS.
uint8_t ptrs_re_offset;//PT-RS resource element offset value taken from 0~11
} nfapi_nr_ue_ptrs_ports_t;
typedef struct
{
uint8_t num_ptrs_ports;
nfapi_nr_ue_ptrs_ports_t* ptrs_ports_list;
uint8_t ptrs_time_density;
uint8_t ptrs_freq_density;
uint8_t ul_ptrs_power;
}nfapi_nr_ue_pusch_ptrs_t;
typedef struct
{
uint8_t low_papr_group_number;//Group number for Low PAPR sequence generation.
uint16_t low_papr_sequence_number;//[TS38.211, sec 5.2.2] For DFT-S-OFDM.
uint8_t ul_ptrs_sample_density;//Number of PTRS groups [But I suppose this sentence is misplaced, so as the next one. --Chenyu]
uint8_t ul_ptrs_time_density_transform_precoding;//Number of samples per PTRS group
} nfapi_nr_ue_dfts_ofdm_t;
typedef struct
{
uint16_t beam_idx;//Index of the digital beam weight vector pre-stored at cell configuration. The vector maps this input port to output TXRUs. Value: 0->65535
}nfapi_nr_ue_dig_bf_interface_t;
typedef struct
{
nfapi_nr_ue_dig_bf_interface_t* dig_bf_interface_list;
} nfapi_nr_ue_ul_beamforming_number_of_prgs_t;
typedef struct
{
uint16_t num_prgs;
uint16_t prg_size;
//watchout: dig_bf_interface here, in table 3-43 it's dig_bf_interfaces
uint8_t dig_bf_interface;
nfapi_nr_ue_ul_beamforming_number_of_prgs_t* prgs_list;//
} nfapi_nr_ue_ul_beamforming_t;
typedef struct
{
uint16_t pdu_bit_map;//Bitmap indicating presence of optional PDUs (see above)
uint16_t rnti;
fapi_nr_ul_config_pusch_pdu_rel15_t ulsch_pdu_rel15;
} fapi_nr_ul_config_pusch_pdu;
uint32_t handle;//An opaque handling returned in the RxData.indication and/or UCI.indication message
//BWP
uint16_t bwp_size;
uint16_t bwp_start;
uint8_t subcarrier_spacing;
uint8_t cyclic_prefix;
//pusch information always include
uint16_t target_code_rate;
uint8_t qam_mod_order;
uint8_t mcs_index;
uint8_t mcs_table;
uint8_t transform_precoding;
uint16_t data_scrambling_id;
uint8_t nrOfLayers;
//DMRS
uint16_t ul_dmrs_symb_pos;
uint8_t dmrs_config_type;
uint16_t ul_dmrs_scrambling_id;
uint8_t scid;
uint8_t num_dmrs_cdm_grps_no_data;
uint16_t dmrs_ports;//DMRS ports. [TS38.212 7.3.1.1.2] provides description between DCI 0-1 content and DMRS ports. Bitmap occupying the 11 LSBs with: bit 0: antenna port 1000 bit 11: antenna port 1011 and for each bit 0: DMRS port not used 1: DMRS port used
//Pusch Allocation in frequency domain [TS38.214, sec 6.1.2.2]
uint8_t resource_alloc;
uint8_t rb_bitmap[36];//
uint16_t rb_start;
uint16_t rb_size;
uint8_t vrb_to_prb_mapping;
uint8_t frequency_hopping;
uint16_t tx_direct_current_location;//The uplink Tx Direct Current location for the carrier. Only values in the value range of this field between 0 and 3299, which indicate the subcarrier index within the carrier corresponding 1o the numerology of the corresponding uplink BWP and value 3300, which indicates "Outside the carrier" and value 3301, which indicates "Undetermined position within the carrier" are used. [TS38.331, UplinkTxDirectCurrentBWP IE]
uint8_t uplink_frequency_shift_7p5khz;
//Resource Allocation in time domain
uint8_t start_symbol_index;
uint8_t nr_of_symbols;
//Optional Data only included if indicated in pduBitmap
nfapi_nr_ue_pusch_data_t pusch_data;
nfapi_nr_ue_pusch_uci_t pusch_uci;
nfapi_nr_ue_pusch_ptrs_t pusch_ptrs;
nfapi_nr_ue_dfts_ofdm_t dfts_ofdm;
//beamforming
nfapi_nr_ue_ul_beamforming_t beamforming;
//OAI specific
int8_t absolute_delta_PUSCH;
} nfapi_nr_ue_pusch_pdu_t;
typedef struct {
......@@ -300,7 +386,7 @@ typedef struct {
union {
fapi_nr_ul_config_prach_pdu prach_config_pdu;
fapi_nr_ul_config_pucch_pdu pucch_config_pdu;
fapi_nr_ul_config_pusch_pdu ulsch_config_pdu;
nfapi_nr_ue_pusch_pdu_t pusch_config_pdu;
fapi_nr_ul_config_srs_pdu srs_config_pdu;
};
} fapi_nr_ul_config_request_pdu_t;
......@@ -341,7 +427,6 @@ typedef struct {
uint8_t SubcarrierSpacing;
uint16_t number_rbs;
uint16_t start_rb;
uint8_t frame_offset;
uint16_t number_symbols;
uint16_t start_symbol;
uint16_t dlDmrsSymbPos;
......
......@@ -657,8 +657,8 @@ int init_nr_ue_signal(PHY_VARS_NR_UE *ue,
abstraction_flag = 0;
fp->nb_antennas_tx = 1;
fp->nb_antennas_rx=1;
dmrs_UplinkConfig_t *dmrs_Uplink_Config = &ue->pusch_config.dmrs_UplinkConfig;
ptrs_UplinkConfig_t *ptrs_Uplink_Config = &ue->pusch_config.dmrs_UplinkConfig.ptrs_UplinkConfig;
// dmrs_UplinkConfig_t *dmrs_Uplink_Config = &ue->pusch_config.dmrs_UplinkConfig;
// ptrs_UplinkConfig_t *ptrs_Uplink_Config = &ue->pusch_config.dmrs_UplinkConfig.ptrs_UplinkConfig;
printf("Initializing UE vars (abstraction %"PRIu8") for eNB TXant %"PRIu8", UE RXant %"PRIu8"\n",abstraction_flag,fp->nb_antennas_tx,fp->nb_antennas_rx);
//LOG_D(PHY,"[MSC_NEW][FRAME 00000][PHY_UE][MOD %02u][]\n", ue->Mod_id+NB_eNB_INST);
phy_init_nr_top(ue);
......@@ -710,9 +710,9 @@ int init_nr_ue_signal(PHY_VARS_NR_UE *ue,
}
//------------- config DMRS parameters--------------//
dmrs_Uplink_Config->pusch_dmrs_type = pusch_dmrs_type1;
dmrs_Uplink_Config->pusch_dmrs_AdditionalPosition = pusch_dmrs_pos0;
dmrs_Uplink_Config->pusch_maxLength = pusch_len1;
// dmrs_Uplink_Config->pusch_dmrs_type = pusch_dmrs_type1;
// dmrs_Uplink_Config->pusch_dmrs_AdditionalPosition = pusch_dmrs_pos0;
// dmrs_Uplink_Config->pusch_maxLength = pusch_len1;
//-------------------------------------------------//
ue->dmrs_DownlinkConfig.pdsch_dmrs_type = pdsch_dmrs_type1;
ue->dmrs_DownlinkConfig.pdsch_dmrs_AdditionalPosition = pdsch_dmrs_pos0;
......@@ -745,15 +745,13 @@ int init_nr_ue_signal(PHY_VARS_NR_UE *ue,
/////////////////////////PUSCH PTRS init/////////////////////////
///////////
ue->ptrs_configured = 0; // flag to be toggled by RCC
//------------- config PTRS parameters--------------//
ptrs_Uplink_Config->timeDensity.ptrs_mcs1 = 0; // setting MCS values to 0 indicate abscence of time_density field in the configuration
ptrs_Uplink_Config->timeDensity.ptrs_mcs2 = 0;
ptrs_Uplink_Config->timeDensity.ptrs_mcs3 = 0;
ptrs_Uplink_Config->frequencyDensity.n_rb0 = 0; // setting N_RB values to 0 indicate abscence of frequency_density field in the configuration
ptrs_Uplink_Config->frequencyDensity.n_rb1 = 0;
ptrs_Uplink_Config->resourceElementOffset = 0;
// ptrs_Uplink_Config->timeDensity.ptrs_mcs1 = 2; // setting MCS values to 0 indicate abscence of time_density field in the configuration
// ptrs_Uplink_Config->timeDensity.ptrs_mcs2 = 4;
// ptrs_Uplink_Config->timeDensity.ptrs_mcs3 = 10;
// ptrs_Uplink_Config->frequencyDensity.n_rb0 = 25; // setting N_RB values to 0 indicate abscence of frequency_density field in the configuration
// ptrs_Uplink_Config->frequencyDensity.n_rb1 = 75;
// ptrs_Uplink_Config->resourceElementOffset = 0;
//-------------------------------------------------//
///////////
......
......@@ -35,143 +35,6 @@
/***********************************************************************/
// TS 38.211 Table 6.4.1.1.3-3: PUSCH DMRS positions l' within a slot for single-symbol DMRS and intra-slot frequency hopping disabled.
// The first 4 colomns are PUSCH mapping type A and the last 4 colomns are PUSCH mapping type B.
// When l' = l0, it is represented by 1
// E.g. when symbol duration is 12 in colomn 7, value 1057 ('10000100001') which means l' = l0, 5, 10.
int32_t table_6_4_1_1_3_3_pusch_dmrs_positions_l [12][8] = { // Duration in symbols
{-1, -1, -1, -1, 1, 1, 1, 1}, //<4 // (DMRS l' position)
{1, 1, 1, 1, 1, 1, 1, 1}, //4 // (DMRS l' position)
{1, 1, 1, 1, 1, 5, 5, 5}, //5 // (DMRS l' position)
{1, 1, 1, 1, 1, 5, 5, 5}, //6 // (DMRS l' position)
{1, 1, 1, 1, 1, 5, 5, 5}, //7 // (DMRS l' position)
{1, 129, 129, 129, 1, 65, 73, 73}, //8 // (DMRS l' position)
{1, 129, 129, 129, 1, 65, 73, 73}, //9 // (DMRS l' position)
{1, 513, 577, 577, 1, 257, 273, 585}, //10 // (DMRS l' position)
{1, 513, 577, 577, 1, 257, 273, 585}, //11 // (DMRS l' position)
{1, 513, 577, 2337, 1, 1025, 1057, 585}, //12 // (DMRS l' position)
{1, 2049, 2177, 2337, 1, 1025, 1057, 585}, //13 // (DMRS l' position)
{1, 2049, 2177, 2337, 1, 1025, 1057, 585}, //14 // (DMRS l' position)
};
// TS 38.211 Table 6.4.1.1.3-4: PUSCH DMRS positions l' within a slot for double-symbol DMRS and intra-slot frequency hopping disabled.
// The first 4 colomns are PUSCH mapping type A and the last 4 colomns are PUSCH mapping type B.
// When l' = l0, it is represented by 1
int32_t table_6_4_1_1_3_4_pusch_dmrs_positions_l [12][8] = { // Duration in symbols
{-1, -1, -1, -1, -1, -1, -1, -1}, //<4 // (DMRS l' position)
{1, 1, -1, -1, -1, -1, -1, -1}, //4 // (DMRS l' position)
{1, 1, -1, -1, 1, 1, -1, -1}, //5 // (DMRS l' position)
{1, 1, -1, -1, 1, 1, -1, -1}, //6 // (DMRS l' position)
{1, 1, -1, -1, 1, 1, -1, -1}, //7 // (DMRS l' position)
{1, 1, -1, -1, 1, 33, -1, -1}, //8 // (DMRS l' position)
{1, 1, -1, -1, 1, 33, -1, -1}, //9 // (DMRS l' position)
{1, 257, -1, -1, 1, 129, -1, -1}, //10 // (DMRS l' position)
{1, 257, -1, -1, 1, 129, -1, -1}, //11 // (DMRS l' position)
{1, 257, -1, -1, 1, 513, -1, -1}, //12 // (DMRS l' position)
{1, 1025, -1, -1, 1, 513, -1, -1}, //13 // (DMRS l' position)
{1, 1025, -1, -1, 1, 513, -1, -1}, //14 // (DMRS l' position)
};
int32_t get_l_prime(uint8_t duration_in_symbols, uint8_t mapping_type, pusch_dmrs_AdditionalPosition_t additional_pos, pusch_maxLength_t pusch_maxLength) {
uint8_t row, colomn;
int32_t l_prime;
colomn = additional_pos;
if (mapping_type == typeB)
colomn += 4;
if (duration_in_symbols < 4)
row = 0;
else
row = duration_in_symbols - 3;
if (pusch_maxLength == pusch_len1)
l_prime = table_6_4_1_1_3_3_pusch_dmrs_positions_l[row][colomn];
else
l_prime = table_6_4_1_1_3_4_pusch_dmrs_positions_l[row][colomn];
AssertFatal(l_prime>0,"invalid l_prime < 0\n");
return l_prime;
}
/*******************************************************************
*
* NAME : is_dmrs_symbol
*
* PARAMETERS : l ofdm symbol index within slot
* k subcarrier index
* start_sc first subcarrier index
* k_prime index alternating 0 and 1
* n index starting 0,1,...
* delta see Table 6.4.1.1.3
* duration_in_symbols number of scheduled PUSCH ofdm symbols
* dmrs_UplinkConfig DMRS uplink configuration
* mapping_type PUSCH mapping type (A or B)
* ofdm_symbol_size IFFT size
*
* RETURN : 0 if symbol(k,l) is data, or 1 if symbol(k,l) is dmrs
*
* DESCRIPTION : 3GPP TS 38.211 6.4.1.1 Demodulation reference signal for PUSCH
*
*********************************************************************/
uint8_t is_dmrs_symbol(uint8_t l,
uint16_t k,
uint16_t start_sc,
uint8_t k_prime,
uint16_t n,
uint8_t delta,
uint8_t duration_in_symbols,
uint8_t dmrs_type,
uint16_t ofdm_symbol_size) {
uint8_t is_dmrs_freq, is_dmrs_time, l0;
int32_t l_prime_mask;
pusch_dmrs_AdditionalPosition_t additional_pos = pusch_dmrs_pos0;
pusch_maxLength_t pusch_maxLength = pusch_len1;
uint8_t mapping_type = typeB;
is_dmrs_freq = 0;
is_dmrs_time = 0;
l0 = get_l0_ul(mapping_type, 2);
l_prime_mask = get_l_prime(duration_in_symbols, mapping_type, additional_pos, pusch_maxLength);
if (k == ((start_sc+get_dmrs_freq_idx_ul(n, k_prime, delta, dmrs_type))%ofdm_symbol_size))
is_dmrs_freq = 1;
if (l_prime_mask == 1){
if (l == l0)
is_dmrs_time = 1;
} else if ( (l==l0) || (((l_prime_mask>>l)&1) == 1 && l!=0) )
is_dmrs_time = 1;
if (pusch_maxLength == pusch_len2){
if (((l_prime_mask>>(l-1))&1) == 1 && l!=0 && l!=1)
is_dmrs_time = 1;
if (l-1 == l0)
is_dmrs_time = 1;
}
if (is_dmrs_time && is_dmrs_freq)
return 1;
else
return 0;
}
/*******************************************************************
*
......@@ -364,25 +227,6 @@ void lte_gold_new(LTE_DL_FRAME_PARMS *frame_parms, uint32_t lte_gold_table[20][2
#endif
}
/*******************************************************************
*
* NAME : get_l0_ul
*
* PARAMETERS : mapping_type : PUSCH mapping type
* dmrs_typeA_position : higher layer parameter
*
* RETURN : demodulation reference signal for PUSCH
*
* DESCRIPTION : see TS 38.211 V15.4.0 Demodulation reference signals for PUSCH
*
*********************************************************************/
uint8_t get_l0_ul(uint8_t mapping_type, uint8_t dmrs_typeA_position) {
return ((mapping_type==typeA)?dmrs_typeA_position:0);
}
/*******************************************************************
*
* NAME : get_dmrs_freq_idx_ul
......
......@@ -54,21 +54,8 @@
int pseudo_random_sequence(int M_PN, uint32_t *c, uint32_t cinit);
void lte_gold_new(LTE_DL_FRAME_PARMS *frame_parms, uint32_t lte_gold_table[20][2][14], uint16_t Nid_cell);
void generate_dmrs_pbch(uint32_t dmrs_pbch_bitmap[DMRS_PBCH_I_SSB][DMRS_PBCH_N_HF][DMRS_BITMAP_SIZE], uint16_t Nid_cell);
uint8_t get_l0_ul(uint8_t mapping_type, uint8_t dmrs_typeA_position);
uint16_t get_dmrs_freq_idx_ul(uint16_t n, uint8_t k_prime, uint8_t delta, uint8_t dmrs_type);
int32_t get_l_prime(uint8_t duration_in_symbols, uint8_t mapping_type, pusch_dmrs_AdditionalPosition_t additional_pos, pusch_maxLength_t pusch_maxLength);
uint8_t is_dmrs_symbol(uint8_t l,
uint16_t k,
uint16_t start_sc,
uint8_t k_prime,
uint16_t n,
uint8_t delta,
uint8_t duration_in_symbols,
uint8_t dmrs_type,
uint16_t ofdm_symbol_size);
#undef EXTERN
#endif /* DMRS_NR_H */
......
This diff is collapsed.
......@@ -49,32 +49,36 @@
int16_t get_kRE_ref(uint8_t dmrs_antenna_port, uint8_t pusch_dmrs_type, uint8_t resourceElementOffset);
uint8_t get_K_ptrs(ptrs_UplinkConfig_t *ptrs_UplinkConfig, uint16_t N_RB);
void set_ptrs_symb_idx(uint16_t *ptrs_symbols,
uint8_t duration_in_symbols,
uint8_t start_symbol,
uint8_t dmrs_type,
uint8_t L_ptrs,
uint8_t pusch_maxLength,
uint16_t ofdm_symbol_size);
uint8_t get_L_ptrs(ptrs_UplinkConfig_t *ptrs_UplinkConfig, uint8_t I_mcs);
uint8_t is_ptrs_subcarrier(uint16_t k, uint8_t K_ptrs, uint16_t n_rnti, uint16_t N_RB, int16_t k_RE_ref, uint16_t start_sc, uint16_t ofdm_symbol_size);
uint16_t ul_dmrs_symb_pos);
uint8_t is_ptrs_symbol(uint8_t l,
uint16_t k,
uint8_t is_ptrs_subcarrier(uint16_t k,
uint16_t n_rnti,
uint16_t N_RB,
uint8_t duration_in_symbols,
uint8_t dmrs_antenna_port,
uint8_t pusch_dmrs_type,
uint8_t K_ptrs,
uint16_t ptrs_symbols,
uint16_t N_RB,
uint8_t k_RE_ref,
uint16_t start_sc,
uint16_t ofdm_symbol_size,
pusch_dmrs_type_t pusch_dmrs_type,
uint8_t resourceElementOffset);
uint16_t ofdm_symbol_size);
/*******************************************************************
*
* NAME : is_ptrs_symbol
*
* PARAMETERS : l ofdm symbol index within slot
* ptrs_symbols bit mask of ptrs
*
* RETURN : 1 if symbol is ptrs, or 0 otherwise
*
* DESCRIPTION : 3GPP TS 38.211 6.4.1.2 Phase-tracking reference signal for PUSCH
*
*********************************************************************/
static inline uint8_t is_ptrs_symbol(uint8_t l, uint16_t ptrs_symbols) { return ((ptrs_symbols >> l) & 1); }
......
......@@ -1028,10 +1028,6 @@ uint32_t nr_dlsch_decoding(PHY_VARS_NR_UE *phy_vars_ue,
uint8_t is_crnti,
uint8_t llr8_flag);
int nr_ulsch_encoding(NR_UE_ULSCH_t *ulsch,
NR_DL_FRAME_PARMS* frame_parms,
uint8_t harq_pid);
uint32_t nr_dlsch_decoding_mthread(PHY_VARS_NR_UE *phy_vars_ue,
UE_nr_rxtx_proc_t *proc,
int eNB_id,
......
......@@ -284,19 +284,17 @@ void nr_ulsch_extract_rbs_single(int32_t **rxdataF,
else
is_dmrs_re = 0;
if ( ((pusch_pdu->pdu_bit_map)>>2)& 0x01 ) {
is_ptrs_symbol_flag = is_ptrs_symbol(symbol,
(start_re + re)%frame_parms->ofdm_symbol_size,
if (pusch_pdu->pdu_bit_map & PUSCH_PDU_BITMAP_PUSCH_PTRS) {
if(is_ptrs_symbol(symbol, pusch_vars->ptrs_symbols))
is_ptrs_symbol_flag = is_ptrs_subcarrier((start_re + re) % frame_parms->ofdm_symbol_size,
n_rnti,
pusch_pdu->rb_size,
pusch_pdu->nr_of_symbols,
aarx,
pusch_pdu->dmrs_config_type,
K_ptrs,
pusch_vars->ptrs_symbols,
pusch_pdu->rb_size,
pusch_pdu->pusch_ptrs.ptrs_ports_list[0].ptrs_re_offset,
start_re,
frame_parms->ofdm_symbol_size,
pusch_pdu->dmrs_config_type,
pusch_pdu->pusch_ptrs.ptrs_ports_list[0].ptrs_re_offset);
frame_parms->ofdm_symbol_size);
if (is_ptrs_symbol_flag == 1)
num_ptrs_symbols++;
......@@ -1026,7 +1024,7 @@ void nr_rx_pusch(PHY_VARS_gNB *gNB,
unsigned char harq_pid)
{
uint8_t first_symbol_flag, aarx, aatx, dmrs_symbol_flag, ptrs_symbol_flag; // dmrs_symbol_flag, a flag to indicate DMRS REs in current symbol
uint8_t first_symbol_flag, aarx, aatx, dmrs_symbol_flag; // dmrs_symbol_flag, a flag to indicate DMRS REs in current symbol
uint32_t nb_re_pusch, bwp_start_subcarrier;
uint8_t L_ptrs = 0; // PTRS parameter
int avgs;
......@@ -1035,7 +1033,6 @@ void nr_rx_pusch(PHY_VARS_gNB *gNB,
nfapi_nr_pusch_pdu_t *rel15_ul = &gNB->ulsch[UE_id][0]->harq_processes[harq_pid]->ulsch_pdu;
dmrs_symbol_flag = 0;
ptrs_symbol_flag = 0;
first_symbol_flag = 0;
gNB->pusch_vars[UE_id]->ptrs_sc_per_ofdm_symbol = 0;
......@@ -1046,16 +1043,14 @@ void nr_rx_pusch(PHY_VARS_gNB *gNB,
gNB->pusch_vars[UE_id]->ptrs_symbols = 0;
first_symbol_flag = 1;
if ( ((rel15_ul->pdu_bit_map)>>2)& 0x01 ) { // if there is ptrs pdu
if (rel15_ul->pdu_bit_map & PUSCH_PDU_BITMAP_PUSCH_PTRS) { // if there is ptrs pdu
L_ptrs = 1<<(rel15_ul->pusch_ptrs.ptrs_time_density);
set_ptrs_symb_idx(&gNB->pusch_vars[UE_id]->ptrs_symbols,
rel15_ul->nr_of_symbols,
rel15_ul->start_symbol_index,
rel15_ul->dmrs_config_type,
L_ptrs,
1, // only dmrs of length 1 is currently supported
frame_parms->ofdm_symbol_size);
rel15_ul->ul_dmrs_symb_pos);
}
}
......@@ -1070,22 +1065,8 @@ void nr_rx_pusch(PHY_VARS_gNB *gNB,
nb_re_pusch = rel15_ul->rb_size * NR_NB_SC_PER_RB;
}
if ( ((rel15_ul->pdu_bit_map)>>2)& 0x01 ) { // if there is ptrs pdu
ptrs_symbol_flag = is_ptrs_symbol(symbol,
0,
rel15_ul->rnti,
rel15_ul->rb_size,
rel15_ul->nr_of_symbols,
0,
(rel15_ul->pusch_ptrs.ptrs_freq_density)?4:2,
gNB->pusch_vars[UE_id]->ptrs_symbols,
0,
frame_parms->ofdm_symbol_size,
rel15_ul->dmrs_config_type,
rel15_ul->pusch_ptrs.ptrs_ports_list[0].ptrs_re_offset);
}
if (ptrs_symbol_flag == 1){
if (rel15_ul->pdu_bit_map & PUSCH_PDU_BITMAP_PUSCH_PTRS) { // if there is ptrs pdu
if(is_ptrs_symbol(symbol, gNB->pusch_vars[UE_id]->ptrs_symbols))
gNB->pusch_vars[UE_id]->ptrs_symbol_index = symbol;
}
......
......@@ -1053,7 +1053,8 @@ uint32_t nr_dlsch_decoding(PHY_VARS_NR_UE *phy_vars_ue,
int nr_ulsch_encoding(NR_UE_ULSCH_t *ulsch,
NR_DL_FRAME_PARMS* frame_parms,
uint8_t harq_pid);
uint8_t harq_pid,
unsigned int G);
/*! \brief Perform PUSCH scrambling. TS 38.211 V15.4.0 subclause 6.3.1.1
@param[in] in, Pointer to input bits
......
......@@ -43,7 +43,7 @@
#endif
#include "LAYER2/NR_MAC_gNB/mac_proto.h"
#include "openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.h"
//#include "../LTE_TRANSPORT/transport_common.h"
// structures below implement 36-211 and 36-212
......@@ -86,40 +86,26 @@ typedef struct {
#endif
typedef struct {
/// NDAPI struct for UE
nfapi_nr_ue_pusch_pdu_t pusch_pdu;
/// Indicator of first transmission
uint8_t first_tx;
/// Last Ndi received for this process on DCI (used for C-RNTI only)
uint8_t DCINdi;
/// HARQ tx status
harq_result_t tx_status;
/// Flag indicating that this ULSCH has a new packet (start of new round)
// uint8_t Ndi;
/// Status Flag indicating for this ULSCH (idle,active,disabled)
SCH_status_t status;
/// Subframe scheduling indicator (i.e. Transmission opportunity indicator)
uint8_t subframe_scheduling_flag;
/// Subframe cba scheduling indicator (i.e. Transmission opportunity indicator)
uint8_t subframe_cba_scheduling_flag;
/// First Allocated RB
uint16_t first_rb;
/// Current Number of RBs
uint16_t nb_rb;
/// number of layers
uint8_t Nl;
/// Last TPC command
uint8_t TPC;
/// Transport block size
uint32_t TBS;
/// The payload + CRC size in bits, "B" from 36-212
uint32_t B;
/// Length of ACK information (bits)
uint8_t O_ACK;
/// Index of current HARQ round for this ULSCH
uint8_t round;
/// MCS format of this ULSCH
uint8_t mcs;
/// Redundancy-version of the current sub-frame
uint8_t rvidx;
/// pointer to pdu from MAC interface (TS 36.212 V15.4.0, Sec 5.1 p. 8)
unsigned char *a;
/// Pointer to the payload + CRC
......@@ -152,19 +138,11 @@ typedef struct {
uint32_t G;
// Number of modulated symbols carrying data
uint32_t num_of_mod_symbols;
// This is "L" in TS 38.214 V15.4.0 subclause 6.1.2.1
uint8_t number_of_symbols;
// This is "S" in TS 38.214 V15.4.0 subclause 6.1.2.1
uint8_t start_symbol;
// decode phich
uint8_t decode_phich;
} NR_UL_UE_HARQ_t;
typedef struct {
/// number of DMRS resource elements
uint8_t nb_re_dmrs;
/// DMRS length
uint8_t length_dmrs;
/// SRS active flag
uint8_t srs_active;
//#if defined(UPGRADE_RAT_NR)
......@@ -226,8 +204,6 @@ typedef struct {
uint8_t power_offset;
// for cooperative communication
uint8_t cooperation_flag;
/// RNTI attributed to this ULSCH
uint16_t rnti;
/// RNTI type
uint8_t rnti_type;
/// Cell ID
......
......@@ -216,12 +216,13 @@ NR_UE_ULSCH_t *new_nr_ue_ulsch(uint16_t N_RB_UL,
int nr_ulsch_encoding(NR_UE_ULSCH_t *ulsch,
NR_DL_FRAME_PARMS* frame_parms,
uint8_t harq_pid)
uint8_t harq_pid,
unsigned int G)
{
/////////////////////////parameters and variables declaration/////////////////////////
///////////
unsigned int G,crc;
unsigned int crc;
NR_UL_UE_HARQ_t *harq_process;
uint16_t nb_rb ;
uint8_t nb_symb_sch ;
......@@ -234,8 +235,6 @@ int nr_ulsch_encoding(NR_UE_ULSCH_t *ulsch,
uint32_t E,Kb;
uint8_t Ilbrm;
uint32_t Tbslbrm;
uint8_t nb_re_dmrs;
uint16_t length_dmrs;
uint16_t R;
float Coderate;
......@@ -248,20 +247,17 @@ int nr_ulsch_encoding(NR_UE_ULSCH_t *ulsch,
crc = 1;
harq_process = ulsch->harq_processes[harq_pid];
nb_rb = harq_process->nb_rb;
nb_symb_sch = harq_process->number_of_symbols;
A = harq_process->TBS;
nb_rb = harq_process->pusch_pdu.rb_size;
A = harq_process->pusch_pdu.pusch_data.tb_size;
pz = &Z;
mod_order = nr_get_Qm_ul(harq_process->mcs,0);
R = nr_get_code_rate_ul(harq_process->mcs, 0);
mod_order = nr_get_Qm_ul(harq_process->pusch_pdu.mcs_index, harq_process->pusch_pdu.mcs_table);
R = nr_get_code_rate_ul(harq_process->pusch_pdu.mcs_index, harq_process->pusch_pdu.mcs_table);
Kr=0;
r_offset=0;
BG = 1;
F=0;
Ilbrm = 0;
Tbslbrm = 950984; //max tbs
nb_re_dmrs = ulsch->nb_re_dmrs;
length_dmrs = ulsch->length_dmrs;
Coderate = 0.0;
///////////
......@@ -270,10 +266,7 @@ int nr_ulsch_encoding(NR_UE_ULSCH_t *ulsch,
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_ENB_DLSCH_ENCODING, VCD_FUNCTION_IN);
LOG_D(PHY,"ulsch coding nb_rb %d nb_symb_sch %d nb_re_dmrs %d, length_dmrs %d, harq_process->Nl = %d\n", nb_rb,nb_symb_sch, nb_re_dmrs,length_dmrs, harq_process->Nl);
G = nr_get_G(nb_rb, nb_symb_sch, nb_re_dmrs, length_dmrs,mod_order,harq_process->Nl);
LOG_D(PHY,"ulsch coding nb_rb %d, Nl = %d\n", nb_rb, harq_process->pusch_pdu.nrOfLayers);
LOG_D(PHY,"ulsch coding A %d G %d mod_order %d\n", A,G, mod_order);
// if (harq_process->Ndi == 1) { // this is a new packet
......@@ -433,15 +426,15 @@ int nr_ulsch_encoding(NR_UE_ULSCH_t *ulsch,
//start_meas(rm_stats);
#ifdef DEBUG_DLSCH_CODING
printf("rvidx in encoding = %d\n", harq_process->rvidx);
printf("rvidx in encoding = %d\n", harq_process->pusch_pdu.pusch_data.rv_index);
#endif
///////////////////////// d---->| Rate matching bit selection |---->e /////////////////////////
///////////
E = nr_get_E(G, harq_process->C, mod_order, harq_process->Nl, r);
E = nr_get_E(G, harq_process->C, mod_order, harq_process->pusch_pdu.nrOfLayers, r);
Tbslbrm = nr_compute_tbslbrm(0,nb_rb,harq_process->Nl,harq_process->C);
Tbslbrm = nr_compute_tbslbrm(0,nb_rb,harq_process->pusch_pdu.nrOfLayers,harq_process->C);
nr_rate_matching_ldpc(Ilbrm,
Tbslbrm,
......@@ -452,7 +445,7 @@ int nr_ulsch_encoding(NR_UE_ULSCH_t *ulsch,
harq_process->C,
F,
Kr-F-2*(*pz),
harq_process->rvidx,
harq_process->pusch_pdu.pusch_data.rv_index,
E);
......
This diff is collapsed.
......@@ -954,9 +954,6 @@ typedef struct {
/// PUSCH DMRS sequence
uint32_t ****nr_gold_pusch_dmrs;
/// flag to indicate if PTRS is configured
uint8_t ptrs_configured;
uint32_t X_u[64][839];
uint32_t high_speed_flag;
......
......@@ -116,16 +116,12 @@ int8_t nr_ue_scheduled_response(nr_scheduled_response_t *scheduled_response)
for(i=0; i<ul_config->number_pdus; ++i){
if(ul_config->ul_config_list[i].pdu_type == FAPI_NR_UL_CONFIG_TYPE_PUSCH){
// pusch config pdu
fapi_nr_ul_config_pusch_pdu_rel15_t *pusch_config_pdu = &ul_config->ul_config_list[i].ulsch_config_pdu.ulsch_pdu_rel15;
uint8_t current_harq_pid = pusch_config_pdu->harq_process_nbr;
ulsch0->harq_processes[current_harq_pid]->nb_rb = pusch_config_pdu->number_rbs;
ulsch0->harq_processes[current_harq_pid]->first_rb = pusch_config_pdu->start_rb;
ulsch0->harq_processes[current_harq_pid]->number_of_symbols = pusch_config_pdu->number_symbols;
ulsch0->harq_processes[current_harq_pid]->start_symbol = pusch_config_pdu->start_symbol;
ulsch0->harq_processes[current_harq_pid]->mcs = pusch_config_pdu->mcs;
ulsch0->harq_processes[current_harq_pid]->DCINdi = pusch_config_pdu->ndi;
ulsch0->harq_processes[current_harq_pid]->rvidx = pusch_config_pdu->rv;
ulsch0->harq_processes[current_harq_pid]->Nl = pusch_config_pdu->n_layers;
nfapi_nr_ue_pusch_pdu_t *pusch_config_pdu = &ul_config->ul_config_list[i].pusch_config_pdu;
uint8_t current_harq_pid = pusch_config_pdu->pusch_data.harq_process_id;
nfapi_nr_ue_pusch_pdu_t *pusch_pdu = &ulsch0->harq_processes[current_harq_pid]->pusch_pdu;
memcpy(pusch_pdu, pusch_config_pdu, sizeof(nfapi_nr_ue_pusch_pdu_t));
ulsch0->f_pusch = pusch_config_pdu->absolute_delta_PUSCH;
}
if(ul_config->ul_config_list[i].pdu_type == FAPI_NR_UL_CONFIG_TYPE_PUCCH){
......
......@@ -296,7 +296,7 @@ harq_result_t uplink_harq_process(NR_UE_ULSCH_t *ulsch, int harq_pid, int ndi, u
/* 38.321 5.4.2.1 2> if the uplink grant was received on PDCCH for the C-RNTI and the HARQ buffer of the identified process is empty */
if ((ulsch->harq_processes[harq_pid]->first_tx == 1) && (rnti_type == _C_RNTI_)) { /* no transmission yet on this process so consider its harq buffer as empty */
ulsch->harq_processes[harq_pid]->first_tx = 0;
ulsch->harq_processes[harq_pid]->DCINdi = ndi; /* store first value of ndi */
ulsch->harq_processes[harq_pid]->pusch_pdu.pusch_data.new_data_indicator = ndi; /* store first value of ndi */
ulsch->harq_processes[harq_pid]->round = 0;
ulsch->harq_processes[harq_pid]->subframe_scheduling_flag = 1;
......@@ -306,8 +306,8 @@ harq_result_t uplink_harq_process(NR_UE_ULSCH_t *ulsch, int harq_pid, int ndi, u
}
/* 38.321 5.4.2.1 2> if the received grant was not addressed to a Temporary C-RNTI on PDCCH, and the NDI provided in the associated HARQ */
/* information has been toggled compared to the value in the previous transmission of this TB of this HARQ process */
else if ((ulsch->harq_processes[harq_pid]->DCINdi != ndi) && (rnti_type != _TC_RNTI_)) { /* is ndi toogled so this is a new grant ? */
ulsch->harq_processes[harq_pid]->DCINdi = ndi; /* store first value of ndi */
else if ((ulsch->harq_processes[harq_pid]->pusch_pdu.pusch_data.new_data_indicator != ndi) && (rnti_type != _TC_RNTI_)) { /* is ndi toogled so this is a new grant ? */
ulsch->harq_processes[harq_pid]->pusch_pdu.pusch_data.new_data_indicator = ndi; /* store first value of ndi */
ulsch->harq_processes[harq_pid]->round = 0;
ulsch->harq_processes[harq_pid]->subframe_scheduling_flag = 1;
......@@ -317,7 +317,7 @@ harq_result_t uplink_harq_process(NR_UE_ULSCH_t *ulsch, int harq_pid, int ndi, u
}
/* 38.321 5.4.2.1 2> else (i.e. retransmission): */
else {
ulsch->harq_processes[harq_pid]->DCINdi = ndi; /* ndi has not toggled si this is a retransmission */
ulsch->harq_processes[harq_pid]->pusch_pdu.pusch_data.new_data_indicator = ndi; /* ndi has not toggled si this is a retransmission */
ulsch->harq_processes[harq_pid]->round++; /* increment number of retransmission */
result_harq = RETRANSMISSION_HARQ;
......
......@@ -402,7 +402,6 @@ int main(int argc, char **argv)
rel15_ul->mcs_index = Imcs;
rel15_ul->pusch_data.rv_index = rvidx;
rel15_ul->nrOfLayers = Nl;
//rel15_ul->length_dmrs = length_dmrs;
rel15_ul->target_code_rate = code_rate;
rel15_ul->pusch_data.tb_size = TBS>>3;
///////////////////////////////////////////////////
......@@ -424,15 +423,6 @@ int main(int argc, char **argv)
for (i = 0; i < TBS / 8; i++)
test_input[i] = (unsigned char) rand();
/////////////////////////[adk] preparing NR_UE_ULSCH_t parameters///////////////////////// A HOT FIX until creating nfapi_nr_ul_config_ulsch_pdu_rel15_t
///////////
ulsch_ue->nb_re_dmrs = nb_re_dmrs;
ulsch_ue->length_dmrs = length_dmrs;
ulsch_ue->rnti = n_rnti;
///////////
////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////[adk] preparing UL harq_process parameters/////////////////////////
///////////
NR_UL_UE_HARQ_t *harq_process_ul_ue = ulsch_ue->harq_processes[harq_pid];
......@@ -442,13 +432,14 @@ int main(int argc, char **argv)
if (harq_process_ul_ue) {
harq_process_ul_ue->mcs = Imcs;
harq_process_ul_ue->Nl = Nl;
harq_process_ul_ue->nb_rb = nb_rb;
harq_process_ul_ue->number_of_symbols = nb_symb_sch;
harq_process_ul_ue->pusch_pdu.rnti = n_rnti;
harq_process_ul_ue->pusch_pdu.mcs_index = Imcs;
harq_process_ul_ue->pusch_pdu.nrOfLayers = Nl;
harq_process_ul_ue->pusch_pdu.rb_size = nb_rb;
harq_process_ul_ue->pusch_pdu.nr_of_symbols = nb_symb_sch;
harq_process_ul_ue->num_of_mod_symbols = N_RE_prime*nb_rb*nb_codewords;
harq_process_ul_ue->rvidx = rvidx;
harq_process_ul_ue->TBS = TBS;
harq_process_ul_ue->pusch_pdu.pusch_data.rv_index = rvidx;
harq_process_ul_ue->pusch_pdu.pusch_data.tb_size = TBS;
harq_process_ul_ue->a = &test_input[0];
}
......@@ -461,9 +452,10 @@ int main(int argc, char **argv)
/////////////////////////ULSCH coding/////////////////////////
///////////
unsigned int G = nr_get_G(nb_rb, nb_symb_sch, nb_re_dmrs, length_dmrs, mod_order, Nl);
if (input_fd == NULL) {
nr_ulsch_encoding(ulsch_ue, frame_parms, harq_pid);
nr_ulsch_encoding(ulsch_ue, frame_parms, harq_pid, G);
}
printf("\n");
......
......@@ -129,7 +129,7 @@ int main(int argc, char **argv)
int loglvl = OAILOG_WARNING;
uint64_t SSB_positions=0x01;
uint16_t nb_symb_sch = 12;
int start_symbol = 0;
int start_symbol = 2;
uint16_t nb_rb = 50;
uint8_t Imcs = 9;
uint8_t precod_nbr_layers = 1;
......@@ -506,26 +506,30 @@ int main(int argc, char **argv)
uint16_t number_dmrs_symbols = 0;
unsigned int available_bits;
uint8_t nb_re_dmrs;
uint8_t length_dmrs = UE->pusch_config.dmrs_UplinkConfig.pusch_maxLength;
unsigned char mod_order;
uint16_t code_rate;
for (i = start_symbol; i < nb_symb_sch; i++)
number_dmrs_symbols += is_dmrs_symbol(i,
0,
0,
0,
0,
0,
nb_symb_sch,
UE->pusch_config.dmrs_UplinkConfig.pusch_dmrs_type,
frame_parms->ofdm_symbol_size);
uint8_t ptrs_mcs1 = 2;
uint8_t ptrs_mcs2 = 4;
uint8_t ptrs_mcs3 = 10;
uint16_t n_rb0 = 25;
uint16_t n_rb1 = 75;
uint8_t mcs_table = 0;
uint16_t pdu_bit_map = PUSCH_PDU_BITMAP_PUSCH_DATA; // | PUSCH_PDU_BITMAP_PUSCH_PTRS;
uint8_t length_dmrs = pusch_len1; // [hna] remove dmrs struct
uint16_t l_prime_mask = get_l_prime(nb_symb_sch, typeB, pusch_dmrs_pos0, length_dmrs); // [hna] remove dmrs struct
uint8_t ptrs_time_density = get_L_ptrs(ptrs_mcs1, ptrs_mcs2, ptrs_mcs3, Imcs, mcs_table);
uint8_t ptrs_freq_density = get_K_ptrs(n_rb0, n_rb1, nb_rb);
if(1<<ptrs_time_density >= nb_symb_sch)
pdu_bit_map &= ~PUSCH_PDU_BITMAP_PUSCH_PTRS; // disable PUSCH PTRS
for (i = 0; i < nb_symb_sch; i++) {
number_dmrs_symbols += (l_prime_mask >> i) & 0x01;
}
mod_order = nr_get_Qm_ul(Imcs, 0);
nb_re_dmrs = ((UE->pusch_config.dmrs_UplinkConfig.pusch_dmrs_type == pusch_dmrs_type1) ? 6 : 4) * number_dmrs_symbols;
code_rate = nr_get_code_rate_ul(Imcs, 0);
available_bits = nr_get_G(nb_rb, nb_symb_sch, nb_re_dmrs, length_dmrs, mod_order, 1);
TBS = nr_compute_tbs(mod_order, code_rate, nb_rb, nb_symb_sch, nb_re_dmrs*length_dmrs, 0, precod_nbr_layers);
printf("\n");
......@@ -570,16 +574,16 @@ int main(int argc, char **argv)
UL_tti_req->pdus_list[0].pdu_size = sizeof(nfapi_nr_pusch_pdu_t);
memset(pusch_pdu,0,sizeof(nfapi_nr_pusch_pdu_t));
pusch_pdu->pdu_bit_map = PUSCH_PDU_BITMAP_PUSCH_DATA;
pusch_pdu->pdu_bit_map = pdu_bit_map;
pusch_pdu->rnti = n_rnti;
pusch_pdu->mcs_index = Imcs;
pusch_pdu->mcs_table = 0;
pusch_pdu->mcs_table = mcs_table;
pusch_pdu->target_code_rate = code_rate;
pusch_pdu->qam_mod_order = mod_order;
pusch_pdu->transform_precoding = 0;
pusch_pdu->data_scrambling_id = 0;
pusch_pdu->nrOfLayers = 1;
pusch_pdu->ul_dmrs_symb_pos = 1;
pusch_pdu->ul_dmrs_symb_pos = l_prime_mask << start_symbol;
pusch_pdu->dmrs_config_type = 0;
pusch_pdu->ul_dmrs_scrambling_id = 0;
pusch_pdu->scid = 0;
......@@ -594,9 +598,11 @@ int main(int argc, char **argv)
pusch_pdu->pusch_data.rv_index = 0;
pusch_pdu->pusch_data.harq_process_id = 0;
pusch_pdu->pusch_data.new_data_indicator = 0;
pusch_pdu->pusch_data.tb_size = TBS>>3;
pusch_pdu->pusch_data.num_cb = 0;
pusch_pdu->pusch_ptrs.ptrs_time_density = ptrs_time_density;
pusch_pdu->pusch_ptrs.ptrs_freq_density = ptrs_freq_density;
pusch_pdu->pusch_ptrs.ptrs_ports_list = (nfapi_nr_ptrs_ports_t *) malloc(2*sizeof(nfapi_nr_ptrs_ports_t));
pusch_pdu->pusch_ptrs.ptrs_ports_list[0].ptrs_re_offset = 0;
// --------- setting parameters for UE --------
......@@ -611,19 +617,33 @@ int main(int argc, char **argv)
ul_config.slot = slot;
ul_config.number_pdus = 1;
ul_config.ul_config_list[0].pdu_type = FAPI_NR_UL_CONFIG_TYPE_PUSCH;
ul_config.ul_config_list[0].ulsch_config_pdu.rnti = n_rnti;
ul_config.ul_config_list[0].ulsch_config_pdu.ulsch_pdu_rel15.number_rbs = nb_rb;
ul_config.ul_config_list[0].ulsch_config_pdu.ulsch_pdu_rel15.start_rb = start_rb;
ul_config.ul_config_list[0].ulsch_config_pdu.ulsch_pdu_rel15.number_symbols = nb_symb_sch;
ul_config.ul_config_list[0].ulsch_config_pdu.ulsch_pdu_rel15.start_symbol = start_symbol;
ul_config.ul_config_list[0].ulsch_config_pdu.ulsch_pdu_rel15.mcs = Imcs;
ul_config.ul_config_list[0].ulsch_config_pdu.ulsch_pdu_rel15.ndi = 0;
ul_config.ul_config_list[0].ulsch_config_pdu.ulsch_pdu_rel15.rv = 0;
ul_config.ul_config_list[0].ulsch_config_pdu.ulsch_pdu_rel15.n_layers = precod_nbr_layers;
ul_config.ul_config_list[0].ulsch_config_pdu.ulsch_pdu_rel15.harq_process_nbr = harq_pid;
ul_config.ul_config_list[0].pusch_config_pdu.rnti = n_rnti;
ul_config.ul_config_list[0].pusch_config_pdu.pdu_bit_map = pdu_bit_map;
ul_config.ul_config_list[0].pusch_config_pdu.rb_size = nb_rb;
ul_config.ul_config_list[0].pusch_config_pdu.rb_start = start_rb;
ul_config.ul_config_list[0].pusch_config_pdu.nr_of_symbols = nb_symb_sch;
ul_config.ul_config_list[0].pusch_config_pdu.start_symbol_index = start_symbol;
ul_config.ul_config_list[0].pusch_config_pdu.ul_dmrs_symb_pos = l_prime_mask << start_symbol;
ul_config.ul_config_list[0].pusch_config_pdu.dmrs_config_type = 0;
ul_config.ul_config_list[0].pusch_config_pdu.mcs_index = Imcs;
ul_config.ul_config_list[0].pusch_config_pdu.mcs_table = mcs_table;
ul_config.ul_config_list[0].pusch_config_pdu.pusch_data.new_data_indicator = 0;
ul_config.ul_config_list[0].pusch_config_pdu.pusch_data.rv_index = 0;
ul_config.ul_config_list[0].pusch_config_pdu.nrOfLayers = precod_nbr_layers;
ul_config.ul_config_list[0].pusch_config_pdu.pusch_data.harq_process_id = harq_pid;
ul_config.ul_config_list[0].pusch_config_pdu.pusch_ptrs.ptrs_time_density = ptrs_time_density;
ul_config.ul_config_list[0].pusch_config_pdu.pusch_ptrs.ptrs_freq_density = ptrs_freq_density;
ul_config.ul_config_list[0].pusch_config_pdu.pusch_ptrs.ptrs_ports_list = (nfapi_nr_ue_ptrs_ports_t *) malloc(2*sizeof(nfapi_nr_ue_ptrs_ports_t));
ul_config.ul_config_list[0].pusch_config_pdu.pusch_ptrs.ptrs_ports_list[0].ptrs_re_offset = 0;
//there are plenty of other parameters that we don't seem to be using for now. e.g.
//ul_config.ul_config_list[0].ulsch_config_pdu.ulsch_pdu_rel15.absolute_delta_PUSCH = 0;
ul_config.ul_config_list[0].pusch_config_pdu.absolute_delta_PUSCH = 0;
nb_re_dmrs = ((ul_config.ul_config_list[0].pusch_config_pdu.dmrs_config_type == pusch_dmrs_type1) ? 6 : 4);
available_bits = nr_get_G(nb_rb, nb_symb_sch, nb_re_dmrs, number_dmrs_symbols, mod_order, 1);
TBS = nr_compute_tbs(mod_order, code_rate, nb_rb, nb_symb_sch, nb_re_dmrs * number_dmrs_symbols, 0, precod_nbr_layers);
pusch_pdu->pusch_data.tb_size = TBS>>3;
ul_config.ul_config_list[0].pusch_config_pdu.pusch_data.tb_size = TBS;
// set FAPI parameters for UE, put them in the scheduled response and call
nr_ue_scheduled_response(&scheduled_response);
......
......@@ -79,6 +79,47 @@ nr_bandentry_t nr_bandtable[] = {
{261,27500000,28350000,27500000,28350000, 2,2070833, 120}
};
// TS 38.211 Table 6.4.1.1.3-3: PUSCH DMRS positions l' within a slot for single-symbol DMRS and intra-slot frequency hopping disabled.
// The first 4 colomns are PUSCH mapping type A and the last 4 colomns are PUSCH mapping type B.
// When l' = l0, it is represented by 1
// E.g. when symbol duration is 12 in colomn 7, value 1057 ('10000100001') which means l' = l0, 5, 10.
int32_t table_6_4_1_1_3_3_pusch_dmrs_positions_l [12][8] = { // Duration in symbols
{-1, -1, -1, -1, 1, 1, 1, 1}, //<4 // (DMRS l' position)
{1, 1, 1, 1, 1, 1, 1, 1}, //4 // (DMRS l' position)
{1, 1, 1, 1, 1, 5, 5, 5}, //5 // (DMRS l' position)
{1, 1, 1, 1, 1, 5, 5, 5}, //6 // (DMRS l' position)
{1, 1, 1, 1, 1, 5, 5, 5}, //7 // (DMRS l' position)
{1, 129, 129, 129, 1, 65, 73, 73}, //8 // (DMRS l' position)
{1, 129, 129, 129, 1, 65, 73, 73}, //9 // (DMRS l' position)
{1, 513, 577, 577, 1, 257, 273, 585}, //10 // (DMRS l' position)
{1, 513, 577, 577, 1, 257, 273, 585}, //11 // (DMRS l' position)
{1, 513, 577, 2337, 1, 1025, 1057, 585}, //12 // (DMRS l' position)
{1, 2049, 2177, 2337, 1, 1025, 1057, 585}, //13 // (DMRS l' position)
{1, 2049, 2177, 2337, 1, 1025, 1057, 585}, //14 // (DMRS l' position)
};
// TS 38.211 Table 6.4.1.1.3-4: PUSCH DMRS positions l' within a slot for double-symbol DMRS and intra-slot frequency hopping disabled.
// The first 4 colomns are PUSCH mapping type A and the last 4 colomns are PUSCH mapping type B.
// When l' = l0, it is represented by 1
int32_t table_6_4_1_1_3_4_pusch_dmrs_positions_l [12][8] = { // Duration in symbols
{-1, -1, -1, -1, -1, -1, -1, -1}, //<4 // (DMRS l' position)
{1, 1, -1, -1, -1, -1, -1, -1}, //4 // (DMRS l' position)
{1, 1, -1, -1, 1, 1, -1, -1}, //5 // (DMRS l' position)
{1, 1, -1, -1, 1, 1, -1, -1}, //6 // (DMRS l' position)
{1, 1, -1, -1, 1, 1, -1, -1}, //7 // (DMRS l' position)
{1, 1, -1, -1, 1, 33, -1, -1}, //8 // (DMRS l' position)
{1, 1, -1, -1, 1, 33, -1, -1}, //9 // (DMRS l' position)
{1, 257, -1, -1, 1, 129, -1, -1}, //10 // (DMRS l' position)
{1, 257, -1, -1, 1, 129, -1, -1}, //11 // (DMRS l' position)
{1, 257, -1, -1, 1, 513, -1, -1}, //12 // (DMRS l' position)
{1, 1025, -1, -1, 1, 513, -1, -1}, //13 // (DMRS l' position)
{1, 1025, -1, -1, 1, 513, -1, -1}, //14 // (DMRS l' position)
};
#define NR_BANDTABLE_SIZE (sizeof(nr_bandtable)/sizeof(nr_bandentry_t))
void get_band(uint64_t downlink_frequency,
......@@ -517,6 +558,112 @@ int get_num_dmrs(uint16_t dmrs_mask ) {
return(num_dmrs);
}
/*******************************************************************
*
* NAME : get_l0_ul
*
* PARAMETERS : mapping_type : PUSCH mapping type
* dmrs_typeA_position : higher layer parameter
*
* RETURN : demodulation reference signal for PUSCH
*
* DESCRIPTION : see TS 38.211 V15.4.0 Demodulation reference signals for PUSCH
*
*********************************************************************/
uint8_t get_l0_ul(uint8_t mapping_type, uint8_t dmrs_typeA_position) {
return ((mapping_type==typeA)?dmrs_typeA_position:0);
}
int32_t get_l_prime(uint8_t duration_in_symbols, uint8_t mapping_type, pusch_dmrs_AdditionalPosition_t additional_pos, pusch_maxLength_t pusch_maxLength) {
uint8_t row, colomn;
int32_t l_prime;
colomn = additional_pos;
if (mapping_type == typeB)
colomn += 4;
if (duration_in_symbols < 4)
row = 0;
else
row = duration_in_symbols - 3;
if (pusch_maxLength == pusch_len1)
l_prime = table_6_4_1_1_3_3_pusch_dmrs_positions_l[row][colomn];
else
l_prime = table_6_4_1_1_3_4_pusch_dmrs_positions_l[row][colomn];
AssertFatal(l_prime>0,"invalid l_prime < 0\n");
return l_prime;
}
/*******************************************************************
*
* NAME : get_L_ptrs
*
* PARAMETERS : mcs(i) higher layer parameter in PTRS-UplinkConfig
* I_mcs MCS index used for PUSCH
* mcs_table 0 for table 5.1.3.1-1, 1 for table 5.1.3.1-1
*
* RETURN : the parameter L_ptrs
*
* DESCRIPTION : 3GPP TS 38.214 section 6.2.3.1
*
*********************************************************************/
uint8_t get_L_ptrs(uint8_t mcs1, uint8_t mcs2, uint8_t mcs3, uint8_t I_mcs, uint8_t mcs_table) {
uint8_t mcs4;
if(mcs_table == 0)
mcs4 = 29;
else
mcs4 = 28;
if (I_mcs < mcs1) {
LOG_I(PHY, "PUSH PT-RS is not present.\n");
return -1;
} else if (I_mcs >= mcs1 && I_mcs < mcs2)
return 2;
else if (I_mcs >= mcs2 && I_mcs < mcs3)
return 1;
else if (I_mcs >= mcs3 && I_mcs < mcs4)
return 0;
else {
LOG_I(PHY, "PT-RS time-density determination is obtained from the DCI for the same transport block in the initial transmission\n");
return -1;
}
}
/*******************************************************************
*
* NAME : get_K_ptrs
*
* PARAMETERS : ptrs_UplinkConfig PTRS uplink configuration
* N_RB number of RBs scheduled for PUSCH
*
* RETURN : the parameter K_ptrs
*
* DESCRIPTION : 3GPP TS 38.214 6.2.3 Table 6.2.3.1-2
*
*********************************************************************/
uint8_t get_K_ptrs(uint16_t nrb0, uint16_t nrb1, uint16_t N_RB) {
if (N_RB < nrb0) {
LOG_I(PHY,"PUSH PT-RS is not present.\n");
return -1;
} else if (N_RB >= nrb0 && N_RB < nrb1)
return 0;
else
return 1;
}
uint16_t nr_dci_size(nr_dci_format_t format,
nr_rnti_type_t rnti_type,
uint16_t N_RB) {
......
......@@ -375,7 +375,7 @@ void gNB_dlsch_ulsch_scheduler(module_id_t module_idP,
int CC_id, UE_id = 0;
gNB_MAC_INST *gNB = RC.nrmac[module_idP];
NR_UE_list_t *UE_list = &gNB->UE_list;
UE_sched_ctrl_t *ue_sched_ctl = &UE_list->UE_sched_ctrl[UE_id];
NR_UE_sched_ctrl_t *ue_sched_ctl = &UE_list->UE_sched_ctrl[UE_id];
NR_COMMON_channels_t *cc = gNB->common_channels;
NR_sched_pucch *pucch_sched = (NR_sched_pucch*) malloc(sizeof(NR_sched_pucch));
......
......@@ -760,14 +760,6 @@ void nr_schedule_uss_ulsch_phytest(int Mod_idP,
pusch_pdu->transform_precoding = 0;
pusch_pdu->data_scrambling_id = 0; //It equals the higher-layer parameter Data-scrambling-Identity if configured and the RNTI equals the C-RNTI, otherwise L2 needs to set it to physical cell id.;
pusch_pdu->nrOfLayers = 1;
//DMRS
pusch_pdu->ul_dmrs_symb_pos = 1<<2; //for now the gnb assumes dmrs in the first symbol of the scheduled pusch resource
pusch_pdu->dmrs_config_type = 0; //dmrs-type 1 (the one with a single DMRS symbol in the beginning)
pusch_pdu->ul_dmrs_scrambling_id = 0; //If provided and the PUSCH is not a msg3 PUSCH, otherwise, L2 should set this to physical cell id.
pusch_pdu->scid = 0; //DMRS sequence initialization [TS38.211, sec 6.4.1.1.1]. Should match what is sent in DCI 0_1, otherwise set to 0.
//pusch_pdu->num_dmrs_cdm_grps_no_data;
//pusch_pdu->dmrs_ports; //DMRS ports. [TS38.212 7.3.1.1.2] provides description between DCI 0-1 content and DMRS ports. Bitmap occupying the 11 LSBs with: bit 0: antenna port 1000 bit 11: antenna port 1011 and for each bit 0: DMRS port not used 1: DMRS port used
//Pusch Allocation in frequency domain [TS38.214, sec 6.1.2.2]
pusch_pdu->resource_alloc = 1; //type 1
//pusch_pdu->rb_bitmap;// for ressource alloc type 0
pusch_pdu->rb_start = 0;
......@@ -779,6 +771,40 @@ void nr_schedule_uss_ulsch_phytest(int Mod_idP,
//Resource Allocation in time domain
pusch_pdu->start_symbol_index = 2;
pusch_pdu->nr_of_symbols = 12;
// --------------------
// ------- DMRS -------
// --------------------
uint16_t l_prime_mask = get_l_prime(pusch_pdu->nr_of_symbols, typeB, pusch_dmrs_pos0, pusch_len1);
pusch_pdu->ul_dmrs_symb_pos = l_prime_mask << pusch_pdu->start_symbol_index;
pusch_pdu->dmrs_config_type = 0; // dmrs-type 1 (the one with a single DMRS symbol in the beginning)
pusch_pdu->ul_dmrs_scrambling_id = 0; // If provided and the PUSCH is not a msg3 PUSCH, otherwise, L2 should set this to physical cell id
pusch_pdu->scid = 0; // DMRS sequence initialization [TS38.211, sec 6.4.1.1.1]
// Should match what is sent in DCI 0_1, otherwise set to 0
//pusch_pdu->num_dmrs_cdm_grps_no_data;
//pusch_pdu->dmrs_ports; // DMRS ports. [TS38.212 7.3.1.1.2] provides description between DCI 0-1 content and DMRS ports
// Bitmap occupying the 11 LSBs with: bit 0: antenna port 1000 bit 11: antenna port 1011,
// and for each bit 0: DMRS port not used 1: DMRS port used
// --------------------------------------------------------------------------------------------------------------------------------------------
// --------------------
// ------- PTRS -------
// --------------------
uint8_t ptrs_mcs1 = 2; // higher layer parameter in PTRS-UplinkConfig
uint8_t ptrs_mcs2 = 4; // higher layer parameter in PTRS-UplinkConfig
uint8_t ptrs_mcs3 = 10; // higher layer parameter in PTRS-UplinkConfig
uint16_t n_rb0 = 25; // higher layer parameter in PTRS-UplinkConfig
uint16_t n_rb1 = 75; // higher layer parameter in PTRS-UplinkConfig
pusch_pdu->pusch_ptrs.ptrs_time_density = get_L_ptrs(ptrs_mcs1, ptrs_mcs2, ptrs_mcs3, pusch_pdu->mcs_index, pusch_pdu->mcs_table);
pusch_pdu->pusch_ptrs.ptrs_freq_density = get_K_ptrs(n_rb0, n_rb1, pusch_pdu->rb_size);
pusch_pdu->pusch_ptrs.ptrs_ports_list = (nfapi_nr_ptrs_ports_t *) malloc(2*sizeof(nfapi_nr_ptrs_ports_t));
pusch_pdu->pusch_ptrs.ptrs_ports_list[0].ptrs_re_offset = 0;
if(1<<pusch_pdu->pusch_ptrs.ptrs_time_density >= pusch_pdu->nr_of_symbols)
pusch_pdu->pdu_bit_map &= ~PUSCH_PDU_BITMAP_PUSCH_PTRS; // disable PUSCH PTRS
// --------------------------------------------------------------------------------------------------------------------------------------------
//Pusch Allocation in frequency domain [TS38.214, sec 6.1.2.2]
//Optional Data only included if indicated in pduBitmap
pusch_pdu->pusch_data.rv_index = 0;
pusch_pdu->pusch_data.harq_process_id = 0;
......@@ -787,7 +813,7 @@ void nr_schedule_uss_ulsch_phytest(int Mod_idP,
pusch_pdu->target_code_rate,
pusch_pdu->rb_size,
pusch_pdu->nr_of_symbols,
6, //nb_re_dmrs - not sure where this is coming from - its not in the FAPI
pusch_pdu->dmrs_config_type?4:6, //nb_re_dmrs - not sure where this is coming from - its not in the FAPI
0, //nb_rb_oh
pusch_pdu->nrOfLayers)>>3;
pusch_pdu->pusch_data.num_cb = 0; //CBG not supported
......
......@@ -245,7 +245,7 @@ void nr_rx_sdu(const module_id_t gnb_mod_idP,
int current_rnti = 0, UE_id = -1, harq_pid = 0;
gNB_MAC_INST *gNB_mac = NULL;
NR_UE_list_t *UE_list = NULL;
UE_sched_ctrl_t *UE_scheduling_control = NULL;
NR_UE_sched_ctrl_t *UE_scheduling_control = NULL;
current_rnti = rntiP;
UE_id = find_nr_UE_id(gnb_mod_idP, current_rnti);
......@@ -255,13 +255,12 @@ void nr_rx_sdu(const module_id_t gnb_mod_idP,
if (UE_id != -1) {
UE_scheduling_control = &(UE_list->UE_sched_ctrl[UE_id]);
LOG_D(MAC, "[gNB %d][PUSCH %d] CC_id %d %d.%d Received ULSCH sdu round %d from PHY (rnti %x, UE_id %d) ul_cqi %d\n",
LOG_D(MAC, "[gNB %d][PUSCH %d] CC_id %d %d.%d Received ULSCH sdu from PHY (rnti %x, UE_id %d) ul_cqi %d\n",
gnb_mod_idP,
harq_pid,
CC_idP,
frameP,
slotP,
UE_scheduling_control->round_UL[CC_idP][harq_pid],
current_rnti,
UE_id,
ul_cqi);
......
......@@ -183,6 +183,11 @@ int find_nr_UE_id(module_id_t mod_idP, rnti_t rntiP);
int add_new_nr_ue(module_id_t mod_idP, rnti_t rntiP);
int get_num_dmrs(uint16_t dmrs_mask );
uint8_t get_l0_ul(uint8_t mapping_type, uint8_t dmrs_typeA_position);
int32_t get_l_prime(uint8_t duration_in_symbols, uint8_t mapping_type, pusch_dmrs_AdditionalPosition_t additional_pos, pusch_maxLength_t pusch_maxLength);
uint8_t get_L_ptrs(uint8_t mcs1, uint8_t mcs2, uint8_t mcs3, uint8_t I_mcs, uint8_t mcs_table);
uint8_t get_K_ptrs(uint16_t nrb0, uint16_t nrb1, uint16_t N_RB);
uint16_t nr_dci_size(nr_dci_format_t format,
nr_rnti_type_t rnti_type,
......
......@@ -116,6 +116,8 @@ typedef struct {
uint64_t dlsch_in_slot_bitmap; // static bitmap signaling which slot in a tdd period contains dlsch
uint64_t ulsch_in_slot_bitmap; // static bitmap signaling which slot in a tdd period contains ulsch
NR_sched_pucch *sched_pucch;
uint16_t ta_timer;
int16_t ta_update;
} NR_UE_sched_ctrl_t;
/*! \brief UE list used by eNB to order UEs/CC for scheduling*/
......
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