Merge remote-tracking branch 'origin/NR_UE_reworking_UCI_procedures' into integration_2021_w32
This commit is contained in:
@@ -1506,7 +1506,6 @@ set(SCHED_SRC_NR_UE
|
||||
${OPENAIR1_DIR}/SCHED_NR_UE/phy_frame_config_nr_ue.c
|
||||
${OPENAIR1_DIR}/SCHED_NR_UE/harq_nr.c
|
||||
${OPENAIR1_DIR}/SCHED_NR_UE/pucch_uci_ue_nr.c
|
||||
${OPENAIR1_DIR}/SCHED_NR_UE/pucch_power_control_ue_nr.c
|
||||
)
|
||||
add_library(SCHED_NR_UE_LIB ${SCHED_SRC_NR_UE})
|
||||
|
||||
|
||||
+9
-6
@@ -220,7 +220,6 @@ static void UE_synch(void *arg) {
|
||||
LOG_I(PHY, "[UE thread Synch] Running Initial Synch (mode %d)\n",UE->mode);
|
||||
|
||||
uint64_t dl_carrier, ul_carrier;
|
||||
double rx_gain_off = 0;
|
||||
nr_get_carrier_frequencies(&UE->frame_parms, &dl_carrier, &ul_carrier);
|
||||
|
||||
if (nr_initial_sync(&syncD->proc, UE, 2) == 0) {
|
||||
@@ -230,7 +229,7 @@ static void UE_synch(void *arg) {
|
||||
|
||||
// rerun with new cell parameters and frequency-offset
|
||||
// todo: the freq_offset computed on DL shall be scaled before being applied to UL
|
||||
nr_rf_card_config(&openair0_cfg[UE->rf_map.card], rx_gain_off, ul_carrier, dl_carrier, freq_offset);
|
||||
nr_rf_card_config_freq(&openair0_cfg[UE->rf_map.card], ul_carrier, dl_carrier, freq_offset);
|
||||
|
||||
LOG_I(PHY,"Got synch: hw_slot_offset %d, carrier off %d Hz, rxgain %f (DL %f Hz, UL %f Hz)\n",
|
||||
hw_slot_offset,
|
||||
@@ -264,7 +263,7 @@ static void UE_synch(void *arg) {
|
||||
|
||||
freq_offset *= -1;
|
||||
|
||||
nr_rf_card_config(&openair0_cfg[UE->rf_map.card], rx_gain_off, ul_carrier, dl_carrier, freq_offset);
|
||||
nr_rf_card_config_freq(&openair0_cfg[UE->rf_map.card], ul_carrier, dl_carrier, freq_offset);
|
||||
|
||||
LOG_I(PHY, "Initial sync failed: trying carrier off %d Hz\n", freq_offset);
|
||||
|
||||
@@ -307,11 +306,12 @@ void processSlotTX(void *arg) {
|
||||
ul_indication.frame_tx = proc->frame_tx;
|
||||
ul_indication.slot_tx = proc->nr_slot_tx;
|
||||
ul_indication.thread_id = proc->thread_id;
|
||||
ul_indication.ue_sched_mode = rxtxD->ue_sched_mode;
|
||||
|
||||
UE->if_inst->ul_indication(&ul_indication);
|
||||
}
|
||||
|
||||
if (UE->mode != loop_through_memory) {
|
||||
if ((UE->mode != loop_through_memory) && (rxtxD->ue_sched_mode != NOT_PUSCH)) {
|
||||
phy_procedures_nrUE_TX(UE,proc,0);
|
||||
}
|
||||
}
|
||||
@@ -358,6 +358,9 @@ void processSlotRX(void *arg) {
|
||||
nr_pdcp_tick(proc->frame_rx, proc->nr_slot_rx / UE->frame_parms.slots_per_subframe);
|
||||
}
|
||||
}
|
||||
// calling UL_indication to schedule things other than PUSCH (eg, PUCCH)
|
||||
rxtxD->ue_sched_mode = NOT_PUSCH;
|
||||
processSlotTX(rxtxD);
|
||||
|
||||
// Wait for PUSCH processing to finish
|
||||
notifiedFIFO_elt_t *res;
|
||||
@@ -365,6 +368,7 @@ void processSlotRX(void *arg) {
|
||||
delNotifiedFIFO_elt(res);
|
||||
|
||||
} else {
|
||||
rxtxD->ue_sched_mode = SCHED_ALL;
|
||||
processSlotTX(rxtxD);
|
||||
}
|
||||
|
||||
@@ -373,8 +377,7 @@ void processSlotRX(void *arg) {
|
||||
if (get_softmodem_params()->usim_test==0) {
|
||||
pucch_procedures_ue_nr(UE,
|
||||
gNB_id,
|
||||
proc,
|
||||
FALSE);
|
||||
proc);
|
||||
}
|
||||
|
||||
LOG_D(PHY, "Sending Uplink data \n");
|
||||
|
||||
@@ -372,7 +372,8 @@ void init_openair0(void) {
|
||||
|
||||
nr_get_carrier_frequencies(frame_parms, &dl_carrier, &ul_carrier);
|
||||
|
||||
nr_rf_card_config(&openair0_cfg[card], rx_gain_off, ul_carrier, dl_carrier, freq_off);
|
||||
nr_rf_card_config_freq(&openair0_cfg[card], ul_carrier, dl_carrier, freq_off);
|
||||
nr_rf_card_config_gain(&openair0_cfg[card], rx_gain_off);
|
||||
|
||||
openair0_cfg[card].configFilename = get_softmodem_params()->rf_config_file;
|
||||
|
||||
|
||||
@@ -101,6 +101,8 @@ typedef struct {
|
||||
|
||||
|
||||
typedef struct {
|
||||
uint8_t harq_pid;
|
||||
uint8_t ack_nack;
|
||||
uint32_t pdu_length;
|
||||
uint8_t* pdu;
|
||||
} fapi_nr_pdsch_pdu_t;
|
||||
@@ -112,20 +114,14 @@ typedef struct {
|
||||
uint8_t ssb_length;
|
||||
uint16_t cell_id;
|
||||
uint16_t ssb_start_subcarrier;
|
||||
short rsrp_dBm;
|
||||
} fapi_nr_ssb_pdu_t;
|
||||
|
||||
typedef struct {
|
||||
uint32_t pdu_length;
|
||||
uint8_t* pdu;
|
||||
uint32_t sibs_mask;
|
||||
} fapi_nr_sib_pdu_t;
|
||||
|
||||
typedef struct {
|
||||
uint8_t pdu_type;
|
||||
union {
|
||||
fapi_nr_pdsch_pdu_t pdsch_pdu;
|
||||
fapi_nr_ssb_pdu_t ssb_pdu;
|
||||
fapi_nr_sib_pdu_t sib_pdu;
|
||||
};
|
||||
} fapi_nr_rx_indication_body_t;
|
||||
|
||||
@@ -187,87 +183,33 @@ typedef struct {
|
||||
} fapi_nr_ul_config_prach_pdu;
|
||||
|
||||
typedef struct {
|
||||
|
||||
pucch_format_nr_t format; /* format 0 1 2 3 4 */
|
||||
uint8_t initialCyclicShift; /* x x */
|
||||
uint8_t nrofSymbols; /* x x x x x */
|
||||
uint8_t startingSymbolIndex; /* x x x x x */
|
||||
uint8_t timeDomainOCC; /* x */
|
||||
uint8_t nrofPRBs; /* x x */
|
||||
uint16_t startingPRB; /* maxNrofPhysicalResourceBlocks = 275 */
|
||||
uint8_t occ_length; /* x */
|
||||
uint8_t occ_Index; /* x */
|
||||
|
||||
feature_status_t intraSlotFrequencyHopping;
|
||||
uint16_t secondHopPRB;
|
||||
|
||||
/*
|
||||
-- Enabling inter-slot frequency hopping when PUCCH Format 1, 3 or 4 is repeated over multiple slots.
|
||||
-- The field is not applicable for format 2.
|
||||
*/
|
||||
feature_status_t interslotFrequencyHopping;
|
||||
/*
|
||||
-- Enabling 2 DMRS symbols per hop of a PUCCH Format 3 or 4 if both hops are more than X symbols when FH is enabled (X=4).
|
||||
-- Enabling 4 DMRS sybmols for a PUCCH Format 3 or 4 with more than 2X+1 symbols when FH is disabled (X=4).
|
||||
-- Corresponds to L1 parameter 'PUCCH-F3-F4-additional-DMRS' (see 38.213, section 9.2.1)
|
||||
-- The field is not applicable for format 1 and 2.
|
||||
*/
|
||||
enable_feature_t additionalDMRS;
|
||||
/*
|
||||
-- Max coding rate to determine how to feedback UCI on PUCCH for format 2, 3 or 4
|
||||
-- Corresponds to L1 parameter 'PUCCH-F2-maximum-coderate', 'PUCCH-F3-maximum-coderate' and 'PUCCH-F4-maximum-coderate'
|
||||
-- (see 38.213, section 9.2.5)
|
||||
-- The field is not applicable for format 1.
|
||||
*/
|
||||
PUCCH_MaxCodeRate_t maxCodeRate;
|
||||
/*
|
||||
-- Number of slots with the same PUCCH F1, F3 or F4. When the field is absent the UE applies the value n1.
|
||||
-- Corresponds to L1 parameter 'PUCCH-F1-number-of-slots', 'PUCCH-F3-number-of-slots' and 'PUCCH-F4-number-of-slots'
|
||||
-- (see 38.213, section 9.2.6)
|
||||
-- The field is not applicable for format 2.
|
||||
*/
|
||||
uint8_t nrofSlots;
|
||||
/*
|
||||
-- Enabling pi/2 BPSK for UCI symbols instead of QPSK for PUCCH.
|
||||
-- Corresponds to L1 parameter 'PUCCH-PF3-PF4-pi/2PBSK' (see 38.213, section 9.2.5)
|
||||
-- The field is not applicable for format 1 and 2.
|
||||
*/
|
||||
feature_status_t pi2PBSK;
|
||||
/*
|
||||
-- Enabling simultaneous transmission of CSI and HARQ-ACK feedback with or without SR with PUCCH Format 2, 3 or 4
|
||||
-- Corresponds to L1 parameter 'PUCCH-F2-Simultaneous-HARQ-ACK-CSI', 'PUCCH-F3-Simultaneous-HARQ-ACK-CSI' and
|
||||
-- 'PUCCH-F4-Simultaneous-HARQ-ACK-CSI' (see 38.213, section 9.2.5)
|
||||
-- When the field is absent the UE applies the value OFF
|
||||
-- The field is not applicable for format 1.
|
||||
*/
|
||||
enable_feature_t simultaneousHARQ_ACK_CSI;
|
||||
/*
|
||||
-- Configuration of group- and sequence hopping for all the PUCCH formats 0, 1, 3 and 4. "neither" implies neither group
|
||||
-- or sequence hopping is enabled. "enable" enables group hopping and disables sequence hopping. "disable"” disables group
|
||||
-- hopping and enables sequence hopping. Corresponds to L1 parameter 'PUCCH-GroupHopping' (see 38.211, section 6.4.1.3)
|
||||
pucch-GroupHopping ENUMERATED { neither, enable, disable },
|
||||
*/
|
||||
pucch_GroupHopping_t pucch_GroupHopping;
|
||||
/*
|
||||
-- Cell-Specific scrambling ID for group hoppping and sequence hopping if enabled.
|
||||
-- Corresponds to L1 parameter 'HoppingID' (see 38.211, section 6.3.2.2)
|
||||
hoppingId BIT STRING (SIZE (10)) OPTIONAL, -- Need R
|
||||
*/
|
||||
uint16_t hoppingId;
|
||||
/*
|
||||
-- Power control parameter P0 for PUCCH transmissions. Value in dBm. Only even values (step size 2) allowed.
|
||||
-- Corresponds to L1 parameter 'p0-nominal-pucch' (see 38.213, section 7.2)
|
||||
p0-nominal INTEGER (-202..24) OPTIONAL, -- Need R
|
||||
*/
|
||||
int8_t p0_nominal;
|
||||
|
||||
int8_t deltaF_PUCCH_f[NUMBER_PUCCH_FORMAT_NR];
|
||||
uint8_t p0_PUCCH_Id; /* INTEGER (1..8) */
|
||||
int8_t p0_PUCCH_Value;
|
||||
// pathlossReferenceRSs SEQUENCE (SIZE (1..maxNrofPUCCH-PathlossReferenceRSs)) OF PUCCH-PathlossReferenceRS OPTIONAL, -- Need M
|
||||
int8_t twoPUCCH_PC_AdjustmentStates;
|
||||
|
||||
} fapi_nr_ul_config_pucch_pdu;
|
||||
uint16_t rnti;
|
||||
uint16_t bwp_size;
|
||||
uint16_t bwp_start;
|
||||
uint8_t format_type;
|
||||
uint8_t start_symbol_index;
|
||||
uint8_t nr_of_symbols;
|
||||
uint16_t prb_start;
|
||||
uint16_t prb_size;
|
||||
uint32_t hopping_id;
|
||||
uint8_t freq_hop_flag;
|
||||
uint8_t group_hop_flag;
|
||||
uint8_t sequence_hop_flag;
|
||||
uint16_t second_hop_prb;
|
||||
uint16_t initial_cyclic_shift;
|
||||
uint8_t time_domain_occ_idx;
|
||||
uint8_t add_dmrs_flag;
|
||||
uint16_t dmrs_scrambling_id;
|
||||
uint16_t data_scrambling_id;
|
||||
uint8_t dmrs_cyclic_shift;
|
||||
uint8_t pi_2bpsk;
|
||||
uint8_t mcs;
|
||||
uint8_t pre_dft_occ_idx;
|
||||
uint8_t pre_dft_occ_len;
|
||||
int16_t pucch_tx_power;
|
||||
uint32_t n_bit;
|
||||
uint64_t payload;
|
||||
} fapi_nr_ul_config_pucch_pdu;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
@@ -459,11 +401,8 @@ typedef struct {
|
||||
uint8_t tb2_rv;
|
||||
uint8_t harq_process_nbr;
|
||||
vrb_to_prb_mapping_t vrb_to_prb_mapping;
|
||||
uint8_t dai;
|
||||
double scaling_factor_S;
|
||||
int8_t accumulated_delta_PUCCH;
|
||||
uint8_t pucch_resource_id;
|
||||
uint8_t pdsch_to_harq_feedback_time_ind;
|
||||
uint8_t n_dmrs_cdm_groups;
|
||||
uint8_t dmrs_ports[10];
|
||||
uint8_t n_front_load_symb;
|
||||
@@ -510,437 +449,6 @@ typedef struct {
|
||||
} fapi_nr_dl_config_request_t;
|
||||
|
||||
|
||||
//
|
||||
// P5
|
||||
//
|
||||
|
||||
|
||||
|
||||
typedef struct {
|
||||
fapi_nr_coreset_t coreset;
|
||||
|
||||
uint8_t monitoring_slot_peridicity;
|
||||
uint8_t monitoring_slot_offset;
|
||||
uint16_t duration;
|
||||
uint16_t monitoring_symbols_within_slot;
|
||||
uint8_t number_of_candidates[5]; // aggregation level 1, 2, 4, 8, 16
|
||||
|
||||
uint8_t dci_2_0_number_of_candidates[5]; // aggregation level 1, 2, 4, 8, 16
|
||||
uint8_t dci_2_3_monitorying_periodicity;
|
||||
uint8_t dci_2_3_number_of_candidates;
|
||||
|
||||
} fapi_nr_search_space_t;
|
||||
|
||||
typedef struct {
|
||||
fapi_nr_search_space_t search_space_sib1;
|
||||
fapi_nr_search_space_t search_space_others_sib;
|
||||
fapi_nr_search_space_t search_space_paging;
|
||||
//fapi_nr_coreset_t coreset_ra; // common coreset
|
||||
fapi_nr_search_space_t search_space_ra;
|
||||
} fapi_nr_pdcch_config_common_t;
|
||||
|
||||
typedef struct {
|
||||
uint8_t k0;
|
||||
uint8_t mapping_type;
|
||||
uint8_t symbol_starting;
|
||||
uint8_t symbol_length;
|
||||
} fapi_nr_pdsch_time_domain_resource_allocation_t;
|
||||
|
||||
typedef struct {
|
||||
fapi_nr_pdsch_time_domain_resource_allocation_t allocation_list[FAPI_NR_MAX_NUM_DL_ALLOCATIONS];
|
||||
} fapi_nr_pdsch_config_common_t;
|
||||
|
||||
typedef struct {
|
||||
uint8_t prach_configuration_index;
|
||||
uint8_t msg1_fdm;
|
||||
uint8_t msg1_frequency_start;
|
||||
uint8_t zero_correlation_zone_config;
|
||||
uint8_t preamble_received_target_power;
|
||||
uint8_t preamble_transmission_max;
|
||||
uint8_t power_ramping_step;
|
||||
uint8_t ra_window_size;
|
||||
|
||||
uint8_t total_number_of_preamble;
|
||||
uint8_t ssb_occasion_per_rach;
|
||||
uint8_t cb_preamble_per_ssb;
|
||||
|
||||
uint8_t group_a_msg3_size;
|
||||
uint8_t group_a_number_of_preamble;
|
||||
uint8_t group_b_power_offset;
|
||||
uint8_t contention_resolution_timer;
|
||||
uint8_t rsrp_threshold_ssb;
|
||||
uint8_t rsrp_threshold_ssb_sul;
|
||||
uint8_t prach_length; // l839, l139
|
||||
uint8_t prach_root_sequence_index; // 0 - 837 for l839, 0 - 137 for l139
|
||||
uint8_t msg1_subcarrier_spacing;
|
||||
uint8_t restrictedset_config;
|
||||
uint8_t msg3_transform_precoding;
|
||||
} fapi_nr_rach_config_common_t;
|
||||
|
||||
typedef struct {
|
||||
uint8_t k2;
|
||||
uint8_t mapping_type;
|
||||
uint8_t symbol_starting;
|
||||
uint8_t symbol_length;
|
||||
} fapi_nr_pusch_time_domain_resource_allocation_t;
|
||||
|
||||
typedef struct {
|
||||
uint8_t group_hopping_enabled_transform_precoding;
|
||||
fapi_nr_pusch_time_domain_resource_allocation_t allocation_list[FAPI_NR_MAX_NUM_UL_ALLOCATIONS];
|
||||
uint8_t msg3_delta_preamble;
|
||||
uint8_t p0_nominal_with_grant;
|
||||
} fapi_nr_pusch_config_common_t;
|
||||
|
||||
typedef struct {
|
||||
uint8_t pucch_resource_common;
|
||||
uint8_t pucch_group_hopping;
|
||||
uint8_t hopping_id;
|
||||
uint8_t p0_nominal;
|
||||
} fapi_nr_pucch_config_common_t;
|
||||
|
||||
typedef struct {
|
||||
|
||||
fapi_nr_pdcch_config_common_t pdcch_config_common;
|
||||
fapi_nr_pdsch_config_common_t pdsch_config_common;
|
||||
|
||||
} fapi_nr_dl_bwp_common_config_t;
|
||||
|
||||
|
||||
|
||||
typedef struct {
|
||||
uint16_t int_rnti;
|
||||
uint8_t time_frequency_set;
|
||||
uint8_t dci_payload_size;
|
||||
uint8_t serving_cell_id[FAPI_NR_MAX_NUM_SERVING_CELLS]; // interrupt configuration per serving cell
|
||||
uint8_t position_in_dci[FAPI_NR_MAX_NUM_SERVING_CELLS]; // interrupt configuration per serving cell
|
||||
} fapi_nr_downlink_preemption_t;
|
||||
|
||||
typedef struct {
|
||||
uint8_t tpc_index;
|
||||
uint8_t tpc_index_sul;
|
||||
uint8_t target_cell;
|
||||
} fapi_nr_pusch_tpc_command_config_t;
|
||||
|
||||
typedef struct {
|
||||
uint8_t tpc_index_pcell;
|
||||
uint8_t tpc_index_pucch_scell;
|
||||
} fapi_nr_pucch_tpc_command_config_t;
|
||||
|
||||
typedef struct {
|
||||
uint8_t starting_bit_of_format_2_3;
|
||||
uint8_t feild_type_format_2_3;
|
||||
} fapi_nr_srs_tpc_command_config_t;
|
||||
|
||||
typedef struct {
|
||||
fapi_nr_downlink_preemption_t downlink_preemption;
|
||||
fapi_nr_pusch_tpc_command_config_t tpc_pusch;
|
||||
fapi_nr_pucch_tpc_command_config_t tpc_pucch;
|
||||
fapi_nr_srs_tpc_command_config_t tpc_srs;
|
||||
} fapi_nr_pdcch_config_dedicated_t;
|
||||
|
||||
typedef struct {
|
||||
uint8_t dmrs_type;
|
||||
uint8_t dmrs_addition_position;
|
||||
uint8_t max_length;
|
||||
uint16_t scrambling_id0;
|
||||
uint16_t scrambling_id1;
|
||||
uint8_t ptrs_frequency_density[2]; // phase tracking rs
|
||||
uint8_t ptrs_time_density[3]; // phase tracking rs
|
||||
uint8_t ptrs_epre_ratio; // phase tracking rs
|
||||
uint8_t ptrs_resource_element_offset; // phase tracking rs
|
||||
} fapi_nr_dmrs_downlink_config_t;
|
||||
|
||||
typedef struct {
|
||||
uint8_t bwp_or_cell_level;
|
||||
uint8_t pattern_type;
|
||||
uint32_t resource_blocks[9]; // bitmaps type 275 bits
|
||||
uint8_t slot_type; // bitmaps type one/two slot(s)
|
||||
uint32_t symbols_in_resouece_block; // bitmaps type 14/28 bits
|
||||
uint8_t periodic; // bitmaps type
|
||||
uint32_t pattern[2]; // bitmaps type 2/4/5/8/10/20/40 bits
|
||||
|
||||
fapi_nr_coreset_t coreset; // coreset
|
||||
|
||||
uint8_t subcarrier_spacing;
|
||||
uint8_t mode;
|
||||
} fapi_nr_rate_matching_pattern_group_t;
|
||||
|
||||
typedef struct {
|
||||
// resource mapping
|
||||
uint8_t row; // row1/row2/row4/other
|
||||
uint16_t frequency_domain_allocation; // 4/12/3/6 bits
|
||||
uint8_t number_of_ports;
|
||||
uint8_t first_ofdm_symbol_in_time_domain;
|
||||
uint8_t first_ofdm_symbol_in_time_domain2;
|
||||
uint8_t cdm_type;
|
||||
uint8_t density; // .5/1/3
|
||||
uint8_t density_dot5_type; // even/odd PRBs
|
||||
|
||||
uint8_t frequency_band_starting_rb; // freqBand
|
||||
uint8_t frequency_band_number_of_rb; // freqBand
|
||||
|
||||
// periodicityAndOffset
|
||||
uint8_t periodicity; // slot4/5/8/10/16/20/32/40/64/80/160/320/640
|
||||
uint32_t offset; // 0..639 bits
|
||||
} fapi_nr_zp_csi_rs_resource_t;
|
||||
|
||||
typedef struct {
|
||||
uint16_t data_scrambling_id_pdsch;
|
||||
fapi_nr_dmrs_downlink_config_t dmrs_dl_for_pdsch_mapping_type_a;
|
||||
fapi_nr_dmrs_downlink_config_t dmrs_dl_for_pdsch_mapping_type_b;
|
||||
uint8_t vrb_to_prb_interleaver;
|
||||
uint8_t resource_allocation;
|
||||
fapi_nr_pdsch_time_domain_resource_allocation_t allocation_list[FAPI_NR_MAX_NUM_DL_ALLOCATIONS];
|
||||
uint8_t pdsch_aggregation_factor;
|
||||
fapi_nr_rate_matching_pattern_group_t rate_matching_pattern_group1;
|
||||
fapi_nr_rate_matching_pattern_group_t rate_matching_pattern_group2;
|
||||
uint8_t rbg_size;
|
||||
uint8_t mcs_table;
|
||||
uint8_t max_num_of_code_word_scheduled_by_dci;
|
||||
uint8_t bundle_size; // prb_bundling static
|
||||
uint8_t bundle_size_set1; // prb_bundling dynamic
|
||||
uint8_t bundle_size_set2; // prb_bundling dynamic
|
||||
fapi_nr_zp_csi_rs_resource_t periodically_zp_csi_rs_resource_set[FAPI_NR_MAX_NUM_ZP_CSI_RS_RESOURCE_PER_SET];
|
||||
} fapi_nr_pdsch_config_dedicated_t;
|
||||
|
||||
typedef struct {
|
||||
uint16_t starting_prb;
|
||||
uint8_t intra_slot_frequency_hopping;
|
||||
uint16_t second_hop_prb;
|
||||
uint8_t format; // pucch format 0..4
|
||||
uint8_t initial_cyclic_shift;
|
||||
uint8_t number_of_symbols;
|
||||
uint8_t starting_symbol_index;
|
||||
uint8_t time_domain_occ;
|
||||
uint8_t number_of_prbs;
|
||||
uint8_t occ_length;
|
||||
uint8_t occ_index;
|
||||
} fapi_nr_pucch_resource_t;
|
||||
|
||||
typedef struct {
|
||||
uint8_t periodicity;
|
||||
uint8_t number_of_harq_process;
|
||||
fapi_nr_pucch_resource_t n1_pucch_an;
|
||||
} fapi_nr_sps_config_t;
|
||||
|
||||
typedef struct {
|
||||
uint8_t beam_failure_instance_max_count;
|
||||
uint8_t beam_failure_detection_timer;
|
||||
} fapi_nr_radio_link_monitoring_config_t;
|
||||
|
||||
typedef struct {
|
||||
fapi_nr_pdcch_config_dedicated_t pdcch_config_dedicated;
|
||||
fapi_nr_pdsch_config_dedicated_t pdsch_config_dedicated;
|
||||
fapi_nr_sps_config_t sps_config;
|
||||
fapi_nr_radio_link_monitoring_config_t radio_link_monitoring_config;
|
||||
|
||||
} fapi_nr_dl_bwp_dedicated_config_t;
|
||||
|
||||
typedef struct {
|
||||
fapi_nr_rach_config_common_t rach_config_common;
|
||||
fapi_nr_pusch_config_common_t pusch_config_common;
|
||||
fapi_nr_pucch_config_common_t pucch_config_common;
|
||||
|
||||
} fapi_nr_ul_bwp_common_config_t;
|
||||
|
||||
typedef struct {
|
||||
uint8_t inter_slot_frequency_hopping;
|
||||
uint8_t additional_dmrs;
|
||||
uint8_t max_code_rate;
|
||||
uint8_t number_of_slots;
|
||||
uint8_t pi2bpsk;
|
||||
uint8_t simultaneous_harq_ack_csi;
|
||||
} fapi_nr_pucch_format_config_t;
|
||||
|
||||
typedef struct {
|
||||
fapi_nr_pucch_format_config_t format1;
|
||||
fapi_nr_pucch_format_config_t format2;
|
||||
fapi_nr_pucch_format_config_t format3;
|
||||
fapi_nr_pucch_format_config_t format4;
|
||||
fapi_nr_pucch_resource_t multi_csi_pucch_resources[2];
|
||||
uint8_t dl_data_to_ul_ack[8];
|
||||
// pucch power control
|
||||
uint8_t deltaF_pucch_f0;
|
||||
uint8_t deltaF_pucch_f1;
|
||||
uint8_t deltaF_pucch_f2;
|
||||
uint8_t deltaF_pucch_f3;
|
||||
uint8_t deltaF_pucch_f4;
|
||||
uint8_t two_pucch_pc_adjusment_states;
|
||||
} fapi_nr_pucch_config_dedicated_t;
|
||||
|
||||
typedef struct {
|
||||
uint8_t dmrs_type;
|
||||
uint8_t dmrs_addition_position;
|
||||
uint8_t ptrs_uplink_config; // to indicate if PTRS Uplink is configured of not
|
||||
uint8_t ptrs_type; //cp-OFDM, dft-S-OFDM
|
||||
uint16_t ptrs_frequency_density[2];
|
||||
uint8_t ptrs_time_density[3];
|
||||
uint8_t ptrs_max_number_of_ports;
|
||||
uint8_t ptrs_resource_element_offset;
|
||||
uint8_t ptrs_power;
|
||||
uint16_t ptrs_sample_density[5];
|
||||
uint8_t ptrs_time_density_transform_precoding;
|
||||
|
||||
uint8_t max_length;
|
||||
uint16_t scrambling_id0;
|
||||
uint16_t scrambling_id1;
|
||||
uint8_t npusch_identity;
|
||||
uint8_t disable_sequence_group_hopping;
|
||||
uint8_t sequence_hopping_enable;
|
||||
} fapi_nr_dmrs_uplink_config_t;
|
||||
|
||||
typedef struct {
|
||||
uint8_t tpc_accmulation;
|
||||
uint8_t msg3_alpha;
|
||||
uint8_t p0_nominal_with_grant;
|
||||
uint8_t two_pusch_pc_adjustments_states;
|
||||
uint8_t delta_mcs;
|
||||
} fapi_nr_pusch_power_control_t;
|
||||
|
||||
typedef enum {tx_config_codebook = 1, tx_config_nonCodebook = 2} tx_config_t;
|
||||
typedef enum {transform_precoder_enabled = 0, transform_precoder_disabled = 1} transform_precoder_t;
|
||||
typedef enum {
|
||||
codebook_subset_fullyAndPartialAndNonCoherent = 1,
|
||||
codebook_subset_partialAndNonCoherent = 2,
|
||||
codebook_subset_nonCoherent = 3} codebook_subset_t;
|
||||
typedef struct {
|
||||
uint16_t data_scrambling_identity;
|
||||
tx_config_t tx_config;
|
||||
fapi_nr_dmrs_uplink_config_t dmrs_ul_for_pusch_mapping_type_a;
|
||||
fapi_nr_dmrs_uplink_config_t dmrs_ul_for_pusch_mapping_type_b;
|
||||
fapi_nr_pusch_power_control_t pusch_power_control;
|
||||
uint8_t frequency_hopping;
|
||||
uint16_t frequency_hopping_offset_lists[4];
|
||||
uint8_t resource_allocation;
|
||||
fapi_nr_pusch_time_domain_resource_allocation_t allocation_list[FAPI_NR_MAX_NUM_UL_ALLOCATIONS];
|
||||
uint8_t pusch_aggregation_factor;
|
||||
uint8_t mcs_table;
|
||||
uint8_t mcs_table_transform_precoder;
|
||||
transform_precoder_t transform_precoder;
|
||||
codebook_subset_t codebook_subset;
|
||||
uint8_t max_rank;
|
||||
uint8_t rbg_size;
|
||||
|
||||
//uci-OnPUSCH
|
||||
uint8_t uci_on_pusch_type; //dynamic, semi-static
|
||||
uint8_t beta_offset_ack_index1[4];
|
||||
uint8_t beta_offset_ack_index2[4];
|
||||
uint8_t beta_offset_ack_index3[4];
|
||||
uint8_t beta_offset_csi_part1_index1[4];
|
||||
uint8_t beta_offset_csi_part1_index2[4];
|
||||
uint8_t beta_offset_csi_part2_index1[4];
|
||||
uint8_t beta_offset_csi_part2_index2[4];
|
||||
|
||||
uint8_t tp_pi2BPSK;
|
||||
} fapi_nr_pusch_config_dedicated_t;
|
||||
|
||||
typedef struct {
|
||||
uint8_t frequency_hopping;
|
||||
fapi_nr_dmrs_uplink_config_t cg_dmrs_configuration;
|
||||
uint8_t mcs_table;
|
||||
uint8_t mcs_table_transform_precoder;
|
||||
|
||||
//uci-OnPUSCH
|
||||
uint8_t uci_on_pusch_type; //dynamic, semi-static
|
||||
uint8_t beta_offset_ack_index1[4];
|
||||
uint8_t beta_offset_ack_index2[4];
|
||||
uint8_t beta_offset_ack_index3[4];
|
||||
uint8_t beta_offset_csi_part1_index1[4];
|
||||
uint8_t beta_offset_csi_part1_index2[4];
|
||||
uint8_t beta_offset_csi_part2_index1[4];
|
||||
uint8_t beta_offset_csi_part2_index2[4];
|
||||
|
||||
uint8_t resource_allocation;
|
||||
// rgb-Size structure missing in spec.
|
||||
uint8_t power_control_loop_to_use;
|
||||
// p0-PUSCH-Alpha
|
||||
uint8_t p0;
|
||||
uint8_t alpha;
|
||||
|
||||
uint8_t transform_precoder;
|
||||
uint8_t number_of_harq_process;
|
||||
uint8_t rep_k;
|
||||
uint8_t rep_k_rv;
|
||||
uint8_t periodicity;
|
||||
uint8_t configured_grant_timer;
|
||||
// rrc-ConfiguredUplinkGrant
|
||||
uint16_t time_domain_offset;
|
||||
uint8_t time_domain_allocation;
|
||||
uint32_t frequency_domain_allocation;
|
||||
uint8_t antenna_ports;
|
||||
uint8_t dmrs_seq_initialization;
|
||||
uint8_t precoding_and_number_of_layers;
|
||||
uint8_t srs_resource_indicator;
|
||||
uint8_t mcs_and_tbs;
|
||||
uint8_t frequency_hopping_offset;
|
||||
uint8_t path_loss_reference_index;
|
||||
|
||||
} fapi_nr_configured_grant_config_t;
|
||||
|
||||
typedef struct {
|
||||
uint8_t qcl_type1_serving_cell_index;
|
||||
uint8_t qcl_type1_bwp_id;
|
||||
uint8_t qcl_type1_rs_type; // csi-rs or ssb
|
||||
uint8_t qcl_type1_nzp_csi_rs_resource_id;
|
||||
uint8_t qcl_type1_ssb_index;
|
||||
uint8_t qcl_type1_type;
|
||||
|
||||
uint8_t qcl_type2_serving_cell_index;
|
||||
uint8_t qcl_type2_bwp_id;
|
||||
uint8_t qcl_type2_rs_type; // csi-rs or ssb
|
||||
uint8_t qcl_type2_nzp_csi_rs_resource_id;
|
||||
uint8_t qcl_type2_ssb_index;
|
||||
uint8_t qcl_type2_type;
|
||||
|
||||
} fapi_nr_tci_state_t;
|
||||
|
||||
typedef struct {
|
||||
uint8_t root_sequence_index;
|
||||
// rach genertic
|
||||
uint8_t prach_configuration_index;
|
||||
uint8_t msg1_fdm;
|
||||
uint8_t msg1_frequency_start;
|
||||
uint8_t zero_correlation_zone_config;
|
||||
uint8_t preamble_received_target_power;
|
||||
uint8_t preamble_transmission_max;
|
||||
uint8_t power_ramping_step;
|
||||
uint8_t ra_window_size;
|
||||
|
||||
uint8_t rsrp_threshold_ssb;
|
||||
// PRACH-ResourceDedicatedBFR
|
||||
uint8_t bfr_ssb_index[FAPI_NR_MAX_NUM_CANDIDATE_BEAMS];
|
||||
uint8_t bfr_ssb_ra_preamble_index[FAPI_NR_MAX_NUM_CANDIDATE_BEAMS];
|
||||
// NZP-CSI-RS-Resource
|
||||
uint8_t bfr_csi_rs_nzp_resource_mapping[FAPI_NR_MAX_NUM_CANDIDATE_BEAMS];
|
||||
uint8_t bfr_csi_rs_power_control_offset[FAPI_NR_MAX_NUM_CANDIDATE_BEAMS];
|
||||
uint8_t bfr_csi_rs_power_control_offset_ss[FAPI_NR_MAX_NUM_CANDIDATE_BEAMS];
|
||||
uint16_t bfr_csi_rs_scrambling_id[FAPI_NR_MAX_NUM_CANDIDATE_BEAMS];
|
||||
uint8_t bfr_csi_rs_resource_periodicity[FAPI_NR_MAX_NUM_CANDIDATE_BEAMS];
|
||||
uint16_t bfr_csi_rs_resource_offset[FAPI_NR_MAX_NUM_CANDIDATE_BEAMS];
|
||||
fapi_nr_tci_state_t qcl_infomation_periodic_csi_rs[FAPI_NR_MAX_NUM_CANDIDATE_BEAMS];
|
||||
|
||||
uint8_t bfr_csirs_ra_occasions[FAPI_NR_MAX_NUM_CANDIDATE_BEAMS];
|
||||
uint8_t bfr_csirs_ra_preamble_index[FAPI_NR_MAX_NUM_CANDIDATE_BEAMS][FAPI_NR_MAX_RA_OCCASION_PER_CSIRS];
|
||||
|
||||
uint8_t ssb_per_rach_occasion;
|
||||
uint8_t ra_ssb_occasion_mask_index;
|
||||
fapi_nr_search_space_t recovery_search_space;
|
||||
// RA-Prioritization
|
||||
uint8_t power_ramping_step_high_priority;
|
||||
uint8_t scaling_factor_bi;
|
||||
uint8_t beam_failure_recovery_timer;
|
||||
} fapi_nr_beam_failure_recovery_config_t;
|
||||
|
||||
typedef struct {
|
||||
fapi_nr_pucch_config_dedicated_t pucch_config_dedicated;
|
||||
fapi_nr_pusch_config_dedicated_t pusch_config_dedicated;
|
||||
fapi_nr_configured_grant_config_t configured_grant_config;
|
||||
// SRS-Config
|
||||
uint8_t srs_tpc_accumulation;
|
||||
fapi_nr_beam_failure_recovery_config_t beam_failure_recovery_config;
|
||||
|
||||
} fapi_nr_ul_bwp_dedicated_config_t;
|
||||
|
||||
#define FAPI_NR_CONFIG_REQUEST_MASK_PBCH 0x01
|
||||
#define FAPI_NR_CONFIG_REQUEST_MASK_DL_BWP_COMMON 0x02
|
||||
#define FAPI_NR_CONFIG_REQUEST_MASK_UL_BWP_COMMON 0x04
|
||||
|
||||
@@ -181,6 +181,16 @@ int init_nr_ue_signal(PHY_VARS_NR_UE *ue,
|
||||
}
|
||||
}
|
||||
|
||||
/////////////////////////PUCCH init/////////////////////////
|
||||
///////////
|
||||
for (th_id = 0; th_id < RX_NB_TH_MAX; th_id++) {
|
||||
for (gNB_id = 0; gNB_id < ue->n_connected_gNB; gNB_id++) {
|
||||
ue->pucch_vars[th_id][gNB_id] = (NR_UE_PUCCH *)malloc16(sizeof(NR_UE_PUCCH));
|
||||
for (i=0; i<2; i++)
|
||||
ue->pucch_vars[th_id][gNB_id]->active[i] = false;
|
||||
}
|
||||
}
|
||||
|
||||
///////////
|
||||
////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
@@ -129,8 +129,10 @@ int nr_pusch_channel_estimation(PHY_VARS_gNB *gNB,
|
||||
|
||||
//------------------generate DMRS------------------//
|
||||
|
||||
if (pusch_pdu->transform_precoding == transform_precoder_disabled) {
|
||||
nr_pusch_dmrs_rx(gNB, Ns, gNB->nr_gold_pusch_dmrs[pusch_pdu->scid][Ns][symbol], &pilot[0], 1000, 0, nb_rb_pusch, (pusch_pdu->bwp_start + pusch_pdu->rb_start)*NR_NB_SC_PER_RB, pusch_pdu->dmrs_config_type);
|
||||
// transform precoding = 1 means disabled
|
||||
if (pusch_pdu->transform_precoding == 1) {
|
||||
nr_pusch_dmrs_rx(gNB, Ns, gNB->nr_gold_pusch_dmrs[pusch_pdu->scid][Ns][symbol], &pilot[0], 1000, 0, nb_rb_pusch,
|
||||
(pusch_pdu->bwp_start + pusch_pdu->rb_start)*NR_NB_SC_PER_RB, pusch_pdu->dmrs_config_type);
|
||||
}
|
||||
else { // if transform precoding or SC-FDMA is enabled in Uplink
|
||||
|
||||
|
||||
@@ -1317,7 +1317,8 @@ int nr_rx_pusch(PHY_VARS_gNB *gNB,
|
||||
rel15_ul->rb_size);
|
||||
stop_meas(&gNB->ulsch_mrc_stats);
|
||||
|
||||
if (rel15_ul->transform_precoding == transform_precoder_enabled) {
|
||||
// transform precoding = 0 means enabled
|
||||
if (rel15_ul->transform_precoding == 0) {
|
||||
|
||||
#ifdef __AVX2__
|
||||
// For odd number of resource blocks need byte alignment to multiple of 8
|
||||
|
||||
@@ -963,7 +963,8 @@ uint8_t nr_dci_decoding_procedure(PHY_VARS_NR_UE *ue,
|
||||
currentPtrDCI);
|
||||
|
||||
n_rnti = rel15->rnti;
|
||||
LOG_D(PHY, "(%i.%i) dci indication (rnti %x,dci format %s,n_CCE %d,payloadSize %d)\n", proc->frame_rx, proc->nr_slot_rx,n_rnti,nr_dci_format_string[rel15->dci_format_options[k]],CCEind,dci_length);
|
||||
LOG_D(PHY, "(%i.%i) dci indication (rnti %x,dci format %s,n_CCE %d,payloadSize %d)\n",
|
||||
proc->frame_rx, proc->nr_slot_rx,n_rnti,nr_dci_format_string[rel15->dci_format_options[k]],CCEind,dci_length);
|
||||
if (crc == n_rnti) {
|
||||
LOG_D(PHY, "(%i.%i) Received dci indication (rnti %x,dci format %s,n_CCE %d,payloadSize %d,payload %llx)\n",
|
||||
proc->frame_rx, proc->nr_slot_rx,n_rnti,nr_dci_format_string[rel15->dci_format_options[k]],CCEind,dci_length,*(unsigned long long*)dci_estimation);
|
||||
@@ -978,6 +979,7 @@ uint8_t nr_dci_decoding_procedure(PHY_VARS_NR_UE *ue,
|
||||
dci_ind->slot = proc->nr_slot_rx;
|
||||
dci_ind->dci_list[dci_ind->number_of_dcis].rnti = n_rnti;
|
||||
dci_ind->dci_list[dci_ind->number_of_dcis].n_CCE = CCEind;
|
||||
dci_ind->dci_list[dci_ind->number_of_dcis].N_CCE = L;
|
||||
dci_ind->dci_list[dci_ind->number_of_dcis].dci_format = rel15->dci_format_options[k];
|
||||
dci_ind->dci_list[dci_ind->number_of_dcis].payloadSize = dci_length;
|
||||
memcpy((void*)dci_ind->dci_list[dci_ind->number_of_dcis].payloadBits,(void*)dci_estimation,8);
|
||||
|
||||
@@ -625,9 +625,7 @@ uint32_t nr_dlsch_decoding(PHY_VARS_NR_UE *phy_vars_ue,
|
||||
LOG_D(PHY,"[UE %d] DLSCH: Setting NAK for SFN/SF %d/%d (pid %d, status %d, round %d, TBS %d, mcs %d) Kr %d r %d harq_process->round %d\n",
|
||||
phy_vars_ue->Mod_id, frame, nr_slot_rx, harq_pid,harq_process->status, harq_process->round,harq_process->TBS,harq_process->mcs,Kr,r,harq_process->round);
|
||||
|
||||
harq_process->harq_ack.ack = 0;
|
||||
harq_process->harq_ack.harq_id = harq_pid;
|
||||
harq_process->harq_ack.send_harq_status = 1;
|
||||
harq_process->ack = 0;
|
||||
harq_process->errors[harq_process->round]++;
|
||||
|
||||
if (harq_process->round >= dlsch->Mlimit) {
|
||||
@@ -650,9 +648,7 @@ uint32_t nr_dlsch_decoding(PHY_VARS_NR_UE *phy_vars_ue,
|
||||
|
||||
harq_process->status = SCH_IDLE;
|
||||
harq_process->round = 0;
|
||||
harq_process->harq_ack.ack = 1;
|
||||
harq_process->harq_ack.harq_id = harq_pid;
|
||||
harq_process->harq_ack.send_harq_status = 1;
|
||||
harq_process->ack = 1;
|
||||
|
||||
//LOG_D(PHY,"[UE %d] DLSCH: Setting ACK for SFN/SF %d/%d (pid %d, status %d, round %d, TBS %d, mcs %d)\n",
|
||||
// phy_vars_ue->Mod_id, frame, subframe, harq_pid, harq_process->status, harq_process->round,harq_process->TBS,harq_process->mcs);
|
||||
@@ -1170,9 +1166,7 @@ uint32_t nr_dlsch_decoding_mthread(PHY_VARS_NR_UE *phy_vars_ue,
|
||||
if (LOG_DEBUGFLAG(DEBUG_DLSCH_DECOD))
|
||||
LOG_I(PHY,"[UE %d] DLSCH: Setting NAK for SFN/SF %d/%d (pid %d, status %d, round %d, TBS %d, mcs %d) Kr %d r %d harq_process->round %d\n",
|
||||
phy_vars_ue->Mod_id, frame, nr_slot_rx, harq_pid,harq_process->status, harq_process->round,harq_process->TBS,harq_process->mcs,Kr,r,harq_process->round);
|
||||
harq_process->harq_ack.ack = 0;
|
||||
harq_process->harq_ack.harq_id = harq_pid;
|
||||
harq_process->harq_ack.send_harq_status = 1;
|
||||
harq_process->ack = 0;
|
||||
harq_process->errors[harq_process->round]++;
|
||||
harq_process->round++;
|
||||
|
||||
@@ -1194,9 +1188,7 @@ uint32_t nr_dlsch_decoding_mthread(PHY_VARS_NR_UE *phy_vars_ue,
|
||||
|
||||
harq_process->status = SCH_IDLE;
|
||||
harq_process->round = 0;
|
||||
harq_process->harq_ack.ack = 1;
|
||||
harq_process->harq_ack.harq_id = harq_pid;
|
||||
harq_process->harq_ack.send_harq_status = 1;
|
||||
harq_process->ack = 1;
|
||||
//LOG_I(PHY,"[UE %d] DLSCH: Setting ACK for SFN/SF %d/%d (pid %d, status %d, round %d, TBS %d, mcs %d)\n",
|
||||
// phy_vars_ue->Mod_id, frame, subframe, harq_pid, harq_process->status, harq_process->round,harq_process->TBS,harq_process->mcs);
|
||||
|
||||
|
||||
@@ -607,7 +607,7 @@ int nr_rx_pbch( PHY_VARS_NR_UE *ue,
|
||||
uint16_t number_pdus = 1;
|
||||
|
||||
nr_fill_dl_indication(&dl_indication, NULL, &rx_ind, proc, ue, gNB_id);
|
||||
nr_fill_rx_indication(&rx_ind, FAPI_NR_RX_PDU_TYPE_SSB, gNB_id, ue, NULL, number_pdus);
|
||||
nr_fill_rx_indication(&rx_ind, FAPI_NR_RX_PDU_TYPE_SSB, gNB_id, ue, NULL, NULL, number_pdus);
|
||||
|
||||
if (ue->if_inst && ue->if_inst->dl_indication)
|
||||
ue->if_inst->dl_indication(&dl_indication, NULL);
|
||||
|
||||
@@ -1475,11 +1475,13 @@ void nr_get_carrier_frequencies(NR_DL_FRAME_PARMS *fp,
|
||||
@param dl_Carrier DL carrier to be set
|
||||
@param freq_offset Freq offset to be set
|
||||
*/
|
||||
void nr_rf_card_config(openair0_config_t *openair0_cfg,
|
||||
double rx_gain_off,
|
||||
uint64_t ul_Carrier,
|
||||
uint64_t dl_Carrier,
|
||||
int freq_offset);
|
||||
void nr_rf_card_config_gain(openair0_config_t *openair0_cfg,
|
||||
double rx_gain_off);
|
||||
|
||||
void nr_rf_card_config_freq(openair0_config_t *openair0_cfg,
|
||||
uint64_t ul_Carrier,
|
||||
uint64_t dl_Carrier,
|
||||
int freq_offset);
|
||||
|
||||
|
||||
void print_CQI(void *o,UCI_format_t uci_format,uint8_t eNB_id,int N_RB_DL);
|
||||
|
||||
@@ -56,34 +56,6 @@ typedef enum {
|
||||
RETRANSMISSION_HARQ
|
||||
} harq_result_t;
|
||||
|
||||
//#if defined(UPGRADE_RAT_NR)
|
||||
#if 1
|
||||
typedef struct {
|
||||
/// HARQ process id
|
||||
uint8_t harq_id;
|
||||
/// HARQ rx status
|
||||
harq_result_t rx_status;
|
||||
/// ACK bits (after decoding) 0:NACK / 1:ACK / 2:DTX
|
||||
uint8_t ack;
|
||||
/// send status (for PUCCH)
|
||||
uint8_t send_harq_status;
|
||||
/// nCCE (for PUCCH)
|
||||
uint8_t nCCE;
|
||||
/// DAI value detected from DCI1/1a/1b/1d/2/2a/2b/2c. 0xff indicates not touched
|
||||
uint8_t vDAI_DL;
|
||||
/// DAI value detected from DCI0/4. 0xff indicates not touched
|
||||
uint8_t vDAI_UL;
|
||||
/// allow to define pucch parameters TS 38.213 9.2.3 UE procedure for reporting HARQ-ACK
|
||||
uint8_t pucch_resource_indicator;
|
||||
/// slot on which feedback ack should be send to network
|
||||
uint16_t slot_for_feedback_ack;
|
||||
/// index of a first CCE for the PDCCH reception
|
||||
uint8_t n_CCE;
|
||||
/// number of CCEs in a control resource set of a PDCCH reception conveying DCI format 1_0
|
||||
uint8_t N_CCE;
|
||||
} NR_UE_HARQ_STATUS_t;
|
||||
#endif
|
||||
|
||||
typedef struct {
|
||||
/// NDAPI struct for UE
|
||||
nfapi_nr_ue_pusch_pdu_t pusch_pdu;
|
||||
@@ -319,7 +291,7 @@ typedef struct {
|
||||
/// codeword this transport block is mapped to
|
||||
uint8_t codeword;
|
||||
/// HARQ-ACKs
|
||||
NR_UE_HARQ_STATUS_t harq_ack;
|
||||
uint8_t ack;
|
||||
/// PTRS Frequency Density
|
||||
uint8_t PTRSFreqDensity;
|
||||
/// PTRS Time Density
|
||||
|
||||
@@ -48,11 +48,9 @@ void nr_get_carrier_frequencies(NR_DL_FRAME_PARMS *fp, uint64_t *dl_carrier, uin
|
||||
|
||||
}
|
||||
|
||||
void nr_rf_card_config(openair0_config_t *openair0_cfg,
|
||||
double rx_gain_offset,
|
||||
uint64_t ul_carrier,
|
||||
uint64_t dl_carrier,
|
||||
int freq_offset){
|
||||
|
||||
void nr_rf_card_config_gain(openair0_config_t *openair0_cfg,
|
||||
double rx_gain_off){
|
||||
|
||||
uint8_t mod_id = 0;
|
||||
uint8_t cc_id = 0;
|
||||
@@ -61,6 +59,36 @@ void nr_rf_card_config(openair0_config_t *openair0_cfg,
|
||||
double rx_gain = ue->rx_total_gain_dB;
|
||||
double tx_gain = ue->tx_total_gain_dB;
|
||||
|
||||
for (int i = rf_chain; i < rf_chain + 4; i++) {
|
||||
|
||||
if (tx_gain)
|
||||
openair0_cfg->tx_gain[i] = tx_gain;
|
||||
if (rx_gain)
|
||||
openair0_cfg->rx_gain[i] = rx_gain - rx_gain_off;
|
||||
|
||||
openair0_cfg->autocal[i] = 1;
|
||||
|
||||
if (i < openair0_cfg->rx_num_channels) {
|
||||
LOG_I(PHY, "HW: Configuring channel %d (rf_chain %d): setting tx_gain %f, rx_gain %f\n",
|
||||
i,
|
||||
rf_chain,
|
||||
openair0_cfg->tx_gain[i],
|
||||
openair0_cfg->rx_gain[i]);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
void nr_rf_card_config_freq(openair0_config_t *openair0_cfg,
|
||||
uint64_t ul_carrier,
|
||||
uint64_t dl_carrier,
|
||||
int freq_offset){
|
||||
|
||||
uint8_t mod_id = 0;
|
||||
uint8_t cc_id = 0;
|
||||
PHY_VARS_NR_UE *ue = PHY_vars_UE_g[mod_id][cc_id];
|
||||
int rf_chain = ue->rf_map.chain;
|
||||
|
||||
for (int i = rf_chain; i < rf_chain + 4; i++) {
|
||||
|
||||
if (i < openair0_cfg->rx_num_channels)
|
||||
@@ -73,22 +101,15 @@ void nr_rf_card_config(openair0_config_t *openair0_cfg,
|
||||
else
|
||||
openair0_cfg->tx_freq[i] = 0.0;
|
||||
|
||||
if (tx_gain)
|
||||
openair0_cfg->tx_gain[i] = tx_gain;
|
||||
if (rx_gain)
|
||||
openair0_cfg->rx_gain[i] = rx_gain - rx_gain_offset;
|
||||
|
||||
openair0_cfg->autocal[i] = 1;
|
||||
|
||||
if (i < openair0_cfg->rx_num_channels) {
|
||||
LOG_I(PHY, "HW: Configuring channel %d (rf_chain %d): setting tx_gain %f, rx_gain %f, tx_freq %f Hz, rx_freq %f Hz\n",
|
||||
LOG_I(PHY, "HW: Configuring channel %d (rf_chain %d): setting tx_freq %f Hz, rx_freq %f Hz\n",
|
||||
i,
|
||||
rf_chain,
|
||||
openair0_cfg->tx_gain[i],
|
||||
openair0_cfg->rx_gain[i],
|
||||
openair0_cfg->tx_freq[i],
|
||||
openair0_cfg->rx_freq[i]);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -252,14 +252,15 @@ void nr_ue_ulsch_procedures(PHY_VARS_NR_UE *UE,
|
||||
uint8_t u = 0, v = 0;
|
||||
int16_t *dmrs_seq = NULL;
|
||||
|
||||
if (pusch_pdu->transform_precoding == transform_precoder_enabled) {
|
||||
// if transform precoding is enbaled (value 0)
|
||||
if (pusch_pdu->transform_precoding == 0) {
|
||||
|
||||
uint32_t nb_re_pusch=nb_rb * NR_NB_SC_PER_RB;
|
||||
uint32_t y_offset = 0;
|
||||
uint16_t num_dmrs_res_per_symbol = nb_rb*(NR_NB_SC_PER_RB/2);
|
||||
|
||||
// Calculate index to dmrs seq array based on number of DMRS Subcarriers on this symbol
|
||||
index = get_index_for_dmrs_lowpapr_seq(num_dmrs_res_per_symbol);
|
||||
index = get_index_for_dmrs_lowpapr_seq(num_dmrs_res_per_symbol);
|
||||
u = pusch_pdu->dfts_ofdm.low_papr_group_number;
|
||||
v = pusch_pdu->dfts_ofdm.low_papr_sequence_number;
|
||||
dmrs_seq = dmrs_lowpaprtype1_ul_ref_sig[u][v][index];
|
||||
@@ -297,7 +298,7 @@ void nr_ue_ulsch_procedures(PHY_VARS_NR_UE *UE,
|
||||
}
|
||||
|
||||
printf("NR_ULSCH_UE: numSym: %d, num_dmrs_sym: %d", number_of_symbols,number_dmrs_symbols);
|
||||
for (int ll = 0; ll < (number_of_symbols-number_dmrs_symbols); ll++) {
|
||||
for (int ll = 0; ll < (number_of_symbols-number_dmrs_symbols); ll++) {
|
||||
|
||||
nr_idft(&debug_symbols[offset], nb_re_pusch);
|
||||
|
||||
@@ -353,8 +354,8 @@ void nr_ue_ulsch_procedures(PHY_VARS_NR_UE *UE,
|
||||
if ((ul_dmrs_symb_pos >> l) & 0x01) {
|
||||
is_dmrs_sym = 1;
|
||||
|
||||
|
||||
if (pusch_pdu->transform_precoding == transform_precoder_disabled){
|
||||
// transform precoding disabled (value 1)
|
||||
if (pusch_pdu->transform_precoding == 1){
|
||||
|
||||
if (dmrs_type == pusch_dmrs_type1)
|
||||
dmrs_idx = (pusch_pdu->bwp_start + start_rb)*6;
|
||||
@@ -371,9 +372,9 @@ void nr_ue_ulsch_procedures(PHY_VARS_NR_UE *UE,
|
||||
}
|
||||
|
||||
|
||||
} else if (pusch_pdu->pdu_bit_map & PUSCH_PDU_BITMAP_PUSCH_PTRS) {
|
||||
} else if (pusch_pdu->pdu_bit_map & PUSCH_PDU_BITMAP_PUSCH_PTRS) {
|
||||
|
||||
AssertFatal(pusch_pdu->transform_precoding == transform_precoder_disabled, "PTRS NOT SUPPORTED IF TRANSFORM PRECODING IS ENABLED\n");
|
||||
AssertFatal(pusch_pdu->transform_precoding == 1, "PTRS NOT SUPPORTED IF TRANSFORM PRECODING IS ENABLED\n");
|
||||
|
||||
if(is_ptrs_symbol(l, ulsch_ue->ptrs_symbols)) {
|
||||
is_ptrs_sym = 1;
|
||||
@@ -404,8 +405,8 @@ void nr_ue_ulsch_procedures(PHY_VARS_NR_UE *UE,
|
||||
}
|
||||
|
||||
if (is_dmrs == 1) {
|
||||
|
||||
if (pusch_pdu->transform_precoding == transform_precoder_enabled) {
|
||||
// if transform precoding is enabled
|
||||
if (pusch_pdu->transform_precoding == 0) {
|
||||
|
||||
((int16_t*)txdataF[ap])[(sample_offsetF)<<1] = (Wt[l_prime[0]]*Wf[k_prime]*AMP*dmrs_seq[2*dmrs_idx]) >> 15;
|
||||
((int16_t*)txdataF[ap])[((sample_offsetF)<<1) + 1] = (Wt[l_prime[0]]*Wf[k_prime]*AMP*dmrs_seq[(2*dmrs_idx) + 1]) >> 15;
|
||||
|
||||
@@ -54,16 +54,10 @@
|
||||
void nr_generate_pucch0(PHY_VARS_NR_UE *ue,
|
||||
int32_t **txdataF,
|
||||
NR_DL_FRAME_PARMS *frame_parms,
|
||||
long pucch_GroupHopping,
|
||||
long hoppingId,
|
||||
int16_t amp,
|
||||
int nr_slot_tx,
|
||||
uint8_t m0,
|
||||
uint8_t mcs,
|
||||
uint8_t nrofSymbols,
|
||||
uint8_t startingSymbolIndex,
|
||||
uint16_t startingPRB,
|
||||
uint16_t secondHopPRB) {
|
||||
fapi_nr_ul_config_pucch_pdu *pucch_pdu) {
|
||||
|
||||
#ifdef DEBUG_NR_PUCCH_TX
|
||||
printf("\t [nr_generate_pucch0] start function at slot(nr_slot_tx)=%d\n",nr_slot_tx);
|
||||
#endif
|
||||
@@ -97,21 +91,31 @@ void nr_generate_pucch0(PHY_VARS_NR_UE *ue,
|
||||
// the value of u,v (delta always 0 for PUCCH) has to be calculated according to TS 38.211 Subclause 6.3.2.2.1
|
||||
uint8_t u[2]={0,0},v[2]={0,0};
|
||||
|
||||
LOG_D(PHY,"pucch0: nr_symbols %d, start_symbol %d, prb_start %d, second_hop_prb %d, group_hop_flag %d, sequence_hop_flag %d, mcs %d\n",pucch_pdu->nr_of_symbols,pucch_pdu->start_symbol_index,pucch_pdu->prb_start,pucch_pdu->second_hop_prb,pucch_pdu->group_hop_flag,pucch_pdu->sequence_hop_flag,pucch_pdu->mcs);
|
||||
|
||||
|
||||
#ifdef DEBUG_NR_PUCCH_TX
|
||||
printf("\t [nr_generate_pucch0] sequence generation: variable initialization for test\n");
|
||||
#endif
|
||||
// x_n contains the sequence r_u_v_alpha_delta(n)
|
||||
int16_t x_n_re[2][24],x_n_im[2][24];
|
||||
|
||||
uint16_t startingPRB = pucch_pdu->prb_start + pucch_pdu->bwp_start;
|
||||
pucch_GroupHopping_t pucch_GroupHopping = pucch_pdu->group_hop_flag + (pucch_pdu->sequence_hop_flag<<1);
|
||||
|
||||
// we proceed to calculate alpha according to TS 38.211 Subclause 6.3.2.2.2
|
||||
int prb_offset[2]={startingPRB,startingPRB};
|
||||
nr_group_sequence_hopping(pucch_GroupHopping,hoppingId,0,nr_slot_tx,&u[0],&v[0]); // calculating u and v value
|
||||
if (startingPRB!=secondHopPRB) {
|
||||
nr_group_sequence_hopping(pucch_GroupHopping,hoppingId,1,nr_slot_tx,&u[1],&v[1]); // calculating u and v value
|
||||
prb_offset[1] = secondHopPRB;
|
||||
nr_group_sequence_hopping(pucch_GroupHopping,pucch_pdu->hopping_id,0,nr_slot_tx,&u[0],&v[0]); // calculating u and v value
|
||||
if (pucch_pdu->freq_hop_flag == 1) {
|
||||
nr_group_sequence_hopping(pucch_GroupHopping,pucch_pdu->hopping_id,1,nr_slot_tx,&u[1],&v[1]); // calculating u and v value
|
||||
prb_offset[1] = pucch_pdu->second_hop_prb;
|
||||
}
|
||||
for (int l=0; l<nrofSymbols; l++) {
|
||||
alpha = nr_cyclic_shift_hopping(hoppingId,m0,mcs,l,startingSymbolIndex,nr_slot_tx);
|
||||
for (int l=0; l<pucch_pdu->nr_of_symbols; l++) {
|
||||
alpha = nr_cyclic_shift_hopping(pucch_pdu->hopping_id,
|
||||
pucch_pdu->initial_cyclic_shift,
|
||||
pucch_pdu->mcs,l,
|
||||
pucch_pdu->start_symbol_index,
|
||||
nr_slot_tx);
|
||||
#ifdef DEBUG_NR_PUCCH_TX
|
||||
printf("\t [nr_generate_pucch0] sequence generation \tu=%d \tv=%d \talpha=%lf \t(for symbol l=%d)\n",u[l],v[l],alpha,l);
|
||||
#endif
|
||||
@@ -135,8 +139,8 @@ void nr_generate_pucch0(PHY_VARS_NR_UE *ue,
|
||||
uint32_t re_offset=0;
|
||||
uint8_t l2;
|
||||
|
||||
for (int l=0; l<nrofSymbols; l++) {
|
||||
l2=l+startingSymbolIndex;
|
||||
for (int l=0; l<pucch_pdu->nr_of_symbols; l++) {
|
||||
l2=l+pucch_pdu->start_symbol_index;
|
||||
re_offset = (12*prb_offset[l]) + frame_parms->first_carrier_offset;
|
||||
if (re_offset>= frame_parms->ofdm_symbol_size)
|
||||
re_offset-=frame_parms->ofdm_symbol_size;
|
||||
@@ -168,20 +172,20 @@ void nr_generate_pucch0(PHY_VARS_NR_UE *ue,
|
||||
void nr_generate_pucch1(PHY_VARS_NR_UE *ue,
|
||||
int32_t **txdataF,
|
||||
NR_DL_FRAME_PARMS *frame_parms,
|
||||
PUCCH_CONFIG_DEDICATED *pucch_config_dedicated,
|
||||
uint64_t payload,
|
||||
int16_t amp,
|
||||
int nr_slot_tx,
|
||||
uint8_t m0,
|
||||
uint8_t nrofSymbols,
|
||||
uint8_t startingSymbolIndex,
|
||||
uint16_t startingPRB,
|
||||
uint16_t startingPRB_intraSlotHopping,
|
||||
uint8_t timeDomainOCC,
|
||||
uint8_t nr_bit) {
|
||||
fapi_nr_ul_config_pucch_pdu *pucch_pdu) {
|
||||
|
||||
uint16_t m0 = pucch_pdu->initial_cyclic_shift;
|
||||
uint64_t payload = pucch_pdu->payload;
|
||||
uint8_t startingSymbolIndex = pucch_pdu->start_symbol_index;
|
||||
uint8_t nrofSymbols = pucch_pdu->nr_of_symbols;
|
||||
uint16_t startingPRB = pucch_pdu->prb_start + pucch_pdu->bwp_start;
|
||||
uint8_t timeDomainOCC = pucch_pdu->time_domain_occ_idx;
|
||||
|
||||
#ifdef DEBUG_NR_PUCCH_TX
|
||||
printf("\t [nr_generate_pucch1] start function at slot(nr_slot_tx)=%d payload=%lu m0=%d nrofSymbols=%d startingSymbolIndex=%d startingPRB=%d startingPRB_intraSlotHopping=%d timeDomainOCC=%d nr_bit=%d\n",
|
||||
nr_slot_tx,payload,m0,nrofSymbols,startingSymbolIndex,startingPRB,startingPRB_intraSlotHopping,timeDomainOCC,nr_bit);
|
||||
printf("\t [nr_generate_pucch1] start function at slot(nr_slot_tx)=%d payload=%lu m0=%d nrofSymbols=%d startingSymbolIndex=%d startingPRB=%d second_hop_prb=%d timeDomainOCC=%d nr_bit=%d\n",
|
||||
nr_slot_tx,payload,m0,nrofSymbols,startingSymbolIndex,startingPRB,pucch_pdu->second_hop_prb,timeDomainOCC,pucch_pdu->n_bit);
|
||||
#endif
|
||||
/*
|
||||
* Implement TS 38.211 Subclause 6.3.2.4.1 Sequence modulation
|
||||
@@ -190,12 +194,12 @@ void nr_generate_pucch1(PHY_VARS_NR_UE *ue,
|
||||
// complex-valued symbol d_re, d_im containing complex-valued symbol d(0):
|
||||
int16_t d_re=0, d_im=0;
|
||||
|
||||
if (nr_bit == 1) { // using BPSK if M_bit=1 according to TC 38.211 Subclause 5.1.2
|
||||
if (pucch_pdu->n_bit == 1) { // using BPSK if M_bit=1 according to TC 38.211 Subclause 5.1.2
|
||||
d_re = (payload&1)==0 ? (int16_t)(((int32_t)amp*ONE_OVER_SQRT2)>>15) : -(int16_t)(((int32_t)amp*ONE_OVER_SQRT2)>>15);
|
||||
d_im = (payload&1)==0 ? (int16_t)(((int32_t)amp*ONE_OVER_SQRT2)>>15) : -(int16_t)(((int32_t)amp*ONE_OVER_SQRT2)>>15);
|
||||
}
|
||||
|
||||
if (nr_bit == 2) { // using QPSK if M_bit=2 according to TC 38.211 Subclause 5.1.2
|
||||
if (pucch_pdu->n_bit == 2) { // using QPSK if M_bit=2 according to TC 38.211 Subclause 5.1.2
|
||||
if (((payload&1)==0) && (((payload>>1)&1)==0)) {
|
||||
d_re = (int16_t)(((int32_t)amp*ONE_OVER_SQRT2)>>15); // 32767/sqrt(2) = 23170 (ONE_OVER_SQRT2)
|
||||
d_im = (int16_t)(((int32_t)amp*ONE_OVER_SQRT2)>>15);
|
||||
@@ -256,7 +260,7 @@ void nr_generate_pucch1(PHY_VARS_NR_UE *ue,
|
||||
//uint8_t PUCCH_Frequency_Hopping = 0 ; // from higher layers
|
||||
uint8_t intraSlotFrequencyHopping = 0;
|
||||
|
||||
if (startingPRB != startingPRB_intraSlotHopping) {
|
||||
if (pucch_pdu->freq_hop_flag) {
|
||||
intraSlotFrequencyHopping=1;
|
||||
}
|
||||
|
||||
@@ -287,8 +291,9 @@ void nr_generate_pucch1(PHY_VARS_NR_UE *ue,
|
||||
printf("\t [nr_generate_pucch1] entering function nr_group_sequence_hopping with n_hop=%d, nr_slot_tx=%d\n",
|
||||
n_hop,nr_slot_tx);
|
||||
#endif
|
||||
nr_group_sequence_hopping(ue->pucch_config_common_nr->pucch_GroupHopping,ue->pucch_config_common_nr->hoppingId,n_hop,nr_slot_tx,&u,&v); // calculating u and v value
|
||||
alpha = nr_cyclic_shift_hopping(ue->pucch_config_common_nr->hoppingId,m0,mcs,l,lprime,nr_slot_tx);
|
||||
pucch_GroupHopping_t pucch_GroupHopping = pucch_pdu->group_hop_flag + (pucch_pdu->sequence_hop_flag<<1);
|
||||
nr_group_sequence_hopping(pucch_GroupHopping,pucch_pdu->hopping_id,n_hop,nr_slot_tx,&u,&v); // calculating u and v value
|
||||
alpha = nr_cyclic_shift_hopping(pucch_pdu->hopping_id,m0,mcs,l,lprime,nr_slot_tx);
|
||||
|
||||
for (int n=0; n<12; n++) {
|
||||
r_u_v_alpha_delta_re[n] = (int16_t)(((((int32_t)(round(32767*cos(alpha*n))) * table_5_2_2_2_2_Re[u][n])>>15)
|
||||
@@ -441,7 +446,7 @@ void nr_generate_pucch1(PHY_VARS_NR_UE *ue,
|
||||
}
|
||||
|
||||
if ((intraSlotFrequencyHopping == 1) && (l<floor(nrofSymbols/2))) { // intra-slot hopping enabled, we need to calculate new offset PRB
|
||||
startingPRB = startingPRB + startingPRB_intraSlotHopping;
|
||||
startingPRB = startingPRB + pucch_pdu->second_hop_prb;
|
||||
}
|
||||
|
||||
if ((startingPRB < (frame_parms->N_RB_DL>>1)) && ((frame_parms->N_RB_DL & 1) == 0)) { // if number RBs in bandwidth is even and current PRB is lower band
|
||||
@@ -834,7 +839,7 @@ inline void nr_pucch2_3_4_scrambling(uint16_t M_bit,uint16_t rnti,uint16_t n_id,
|
||||
c = (uint8_t)((s>>i)&1);
|
||||
btildep[i] = (((B>>i)&1) ^ c);
|
||||
#ifdef DEBUG_NR_PUCCH_TX
|
||||
printf("\t\t\t btilde[%d]=%lx from unscrambled bit %d and scrambling %d (%x)\n",i+(iprime<<5),btilde[i],((B>>i)&1),c,s>>i);
|
||||
printf("\t\t\t btilde[%d]=%x from unscrambled bit %d and scrambling %d (%x)\n",i+(iprime<<5),btilde[i],((B>>i)&1),c,s>>i);
|
||||
#endif
|
||||
}
|
||||
M_bit3-=32;
|
||||
@@ -848,7 +853,7 @@ inline void nr_pucch2_3_4_scrambling(uint16_t M_bit,uint16_t rnti,uint16_t n_id,
|
||||
}
|
||||
void nr_uci_encoding(uint64_t payload,
|
||||
uint8_t nr_bit,
|
||||
pucch_format_nr_t fmt,
|
||||
int fmt,
|
||||
uint8_t is_pi_over_2_bpsk_enabled,
|
||||
uint8_t nrofSymbols,
|
||||
uint8_t nrofPRB,
|
||||
@@ -868,9 +873,9 @@ void nr_uci_encoding(uint64_t payload,
|
||||
// E is the rate matching output sequence length as given in TS 38.212 subclause 6.3.1.4.1
|
||||
uint16_t E=0,E_init;
|
||||
|
||||
if (fmt == pucch_format2_nr) E = 16*nrofSymbols*nrofPRB;
|
||||
if (fmt == 2) E = 16*nrofSymbols*nrofPRB;
|
||||
|
||||
if (fmt == pucch_format3_nr) {
|
||||
if (fmt == 3) {
|
||||
E_init = (is_pi_over_2_bpsk_enabled == 0) ? 24:12;
|
||||
|
||||
if (nrofSymbols == 4) {
|
||||
@@ -895,7 +900,7 @@ void nr_uci_encoding(uint64_t payload,
|
||||
}
|
||||
}
|
||||
|
||||
if (fmt == pucch_format4_nr) {
|
||||
if (fmt == 4) {
|
||||
E_init = (is_pi_over_2_bpsk_enabled == 0) ? 24:12;
|
||||
|
||||
if (nrofSymbols == 4) {
|
||||
@@ -953,28 +958,24 @@ void nr_uci_encoding(uint64_t payload,
|
||||
}
|
||||
//#if 0
|
||||
void nr_generate_pucch2(PHY_VARS_NR_UE *ue,
|
||||
uint16_t crnti,
|
||||
uint32_t dmrs_scrambling_id,
|
||||
uint32_t data_scrambling_id,
|
||||
int32_t **txdataF,
|
||||
NR_DL_FRAME_PARMS *frame_parms,
|
||||
PUCCH_CONFIG_DEDICATED *pucch_config_dedicated,
|
||||
uint64_t payload,
|
||||
int16_t amp,
|
||||
int nr_slot_tx,
|
||||
uint8_t nrofSymbols,
|
||||
uint8_t startingSymbolIndex,
|
||||
uint8_t nrofPRB,
|
||||
uint16_t startingPRB,
|
||||
uint8_t nr_bit) {
|
||||
fapi_nr_ul_config_pucch_pdu *pucch_pdu) {
|
||||
#ifdef DEBUG_NR_PUCCH_TX
|
||||
printf("\t [nr_generate_pucch2] start function at slot(nr_slot_tx)=%d with payload=%lu and nr_bit=%d\n",nr_slot_tx, payload, nr_bit);
|
||||
printf("\t [nr_generate_pucch2] start function at slot(nr_slot_tx)=%d with payload=%lu and nr_bit=%d\n",nr_slot_tx, pucch_pdu->payload, pucch_pdu->n_bit);
|
||||
#endif
|
||||
// b is the block of bits transmitted on the physical channel after payload coding
|
||||
uint64_t b[16]; // limit to 1024-bit encoded length
|
||||
// M_bit is the number of bits of block b (payload after encoding)
|
||||
uint16_t M_bit;
|
||||
nr_uci_encoding(payload,nr_bit,pucch_format2_nr,0,nrofSymbols,nrofPRB,1,0,0,&b[0],&M_bit);
|
||||
nr_uci_encoding(pucch_pdu->payload,
|
||||
pucch_pdu->n_bit,
|
||||
2,0,
|
||||
pucch_pdu->nr_of_symbols,
|
||||
pucch_pdu->prb_size,
|
||||
1,0,0,&b[0],&M_bit);
|
||||
/*
|
||||
* Implementing TS 38.211
|
||||
* Subclauses 6.3.2.5.1 Scrambling (PUCCH format 2)
|
||||
@@ -989,14 +990,14 @@ void nr_generate_pucch2(PHY_VARS_NR_UE *ue,
|
||||
*/
|
||||
uint8_t *btilde = malloc(sizeof(int8_t)*M_bit);
|
||||
// rnti is given by the C-RNTI
|
||||
uint16_t rnti=crnti;
|
||||
uint16_t rnti=pucch_pdu->rnti;
|
||||
#ifdef DEBUG_NR_PUCCH_TX
|
||||
printf("\t [nr_generate_pucch2] rnti = %d ,\n",rnti);
|
||||
#endif
|
||||
/*
|
||||
* Implementing TS 38.211 Subclause 6.3.2.5.1 scrambling format 2
|
||||
*/
|
||||
nr_pucch2_3_4_scrambling(M_bit,rnti,data_scrambling_id,&b[0],btilde);
|
||||
nr_pucch2_3_4_scrambling(M_bit,rnti,pucch_pdu->data_scrambling_id,&b[0],btilde);
|
||||
/*
|
||||
* Implementing TS 38.211 Subclause 6.3.2.5.2 modulation format 2
|
||||
* btilde shall be modulated as described in subclause 5.1 using QPSK
|
||||
@@ -1042,9 +1043,12 @@ void nr_generate_pucch2(PHY_VARS_NR_UE *ue,
|
||||
uint32_t x1, x2, s=0;
|
||||
int i=0;
|
||||
int m=0;
|
||||
uint8_t startingSymbolIndex = pucch_pdu->start_symbol_index;
|
||||
uint16_t startingPRB = pucch_pdu->prb_start + pucch_pdu->bwp_start;
|
||||
|
||||
for (int l=0; l<nrofSymbols; l++) {
|
||||
x2 = (((1<<17)*((14*nr_slot_tx) + (l+startingSymbolIndex) + 1)*((2*dmrs_scrambling_id) + 1)) + (2*dmrs_scrambling_id))%(1U<<31); // c_init calculation according to TS38.211 subclause
|
||||
for (int l=0; l<pucch_pdu->nr_of_symbols; l++) {
|
||||
// c_init calculation according to TS38.211 subclause
|
||||
x2 = (((1<<17)*((14*nr_slot_tx) + (l+startingSymbolIndex) + 1)*((2*pucch_pdu->dmrs_scrambling_id) + 1)) + (2*pucch_pdu->dmrs_scrambling_id))%(1U<<31);
|
||||
|
||||
int reset = 1;
|
||||
for (int ii=0; ii<=(startingPRB>>2); ii++) {
|
||||
@@ -1052,7 +1056,7 @@ void nr_generate_pucch2(PHY_VARS_NR_UE *ue,
|
||||
reset = 0;
|
||||
}
|
||||
m = 0;
|
||||
for (int rb=0; rb<nrofPRB; rb++) {
|
||||
for (int rb=0; rb<pucch_pdu->prb_size; rb++) {
|
||||
//startingPRB = startingPRB + rb;
|
||||
if (((rb+startingPRB) < (frame_parms->N_RB_DL>>1)) && ((frame_parms->N_RB_DL & 1) == 0)) { // if number RBs in bandwidth is even and current PRB is lower band
|
||||
re_offset = ((l+startingSymbolIndex)*frame_parms->ofdm_symbol_size) + (12*(rb+startingPRB)) + frame_parms->first_carrier_offset;
|
||||
@@ -1124,52 +1128,53 @@ void nr_generate_pucch2(PHY_VARS_NR_UE *ue,
|
||||
}
|
||||
//#if 0
|
||||
void nr_generate_pucch3_4(PHY_VARS_NR_UE *ue,
|
||||
uint16_t crnti,
|
||||
int32_t **txdataF,
|
||||
NR_DL_FRAME_PARMS *frame_parms,
|
||||
pucch_format_nr_t fmt,
|
||||
PUCCH_CONFIG_DEDICATED *pucch_config_dedicated,
|
||||
uint64_t payload,
|
||||
int16_t amp,
|
||||
int nr_slot_tx,
|
||||
uint8_t nrofSymbols,
|
||||
uint8_t startingSymbolIndex,
|
||||
uint8_t nrofPRB,
|
||||
uint16_t startingPRB,
|
||||
uint16_t startingPRB_intraSlotHopping,
|
||||
uint8_t nr_bit,
|
||||
uint8_t occ_length_format4,
|
||||
uint8_t occ_index_format4) {
|
||||
fapi_nr_ul_config_pucch_pdu *pucch_pdu) {
|
||||
#ifdef DEBUG_NR_PUCCH_TX
|
||||
printf("\t [nr_generate_pucch3_4] start function at slot(nr_slot_tx)=%d with payload=%lu and nr_bit=%d\n", nr_slot_tx, payload, nr_bit);
|
||||
printf("\t [nr_generate_pucch3_4] start function at slot(nr_slot_tx)=%d with payload=%lu and nr_bit=%d\n", nr_slot_tx, pucch_pdu->payload, pucch_pdu->n_bit);
|
||||
#endif
|
||||
// b is the block of bits transmitted on the physical channel after payload coding
|
||||
uint64_t b[16];
|
||||
// M_bit is the number of bits of block b (payload after encoding)
|
||||
uint16_t M_bit;
|
||||
// parameter PUCCH-F4-preDFT-OCC-length set of {2,4} -> to use table -1 or -2
|
||||
uint8_t n_SF_PUCCH_s = 2; // in format 4, n_SF_PUCCH_s = {2,4}, provided by higher layer parameter PUCCH-F4-preDFT-OCC-length (in format 3 n_SF_PUCCH_s=1), FIXME!!!
|
||||
uint8_t is_pi_over_2_bpsk_enabled = 0; // this value has to be provided by higher layers parameter
|
||||
// in format 4, n_SF_PUCCH_s = {2,4}, provided by higher layer parameter PUCCH-F4-preDFT-OCC-length (in format 3 n_SF_PUCCH_s=1)
|
||||
uint8_t n_SF_PUCCH_s;
|
||||
if (pucch_pdu->format_type == 3)
|
||||
n_SF_PUCCH_s = 1;
|
||||
else
|
||||
n_SF_PUCCH_s = pucch_pdu->pre_dft_occ_len;
|
||||
uint8_t is_pi_over_2_bpsk_enabled = pucch_pdu->pi_2bpsk;
|
||||
// Intra-slot frequency hopping shall be assumed when the higher-layer parameter intraSlotFrequencyHopping is provided,
|
||||
// regardless of whether the frequency-hop distance is zero or not,
|
||||
// otherwise no intra-slot frequency hopping shall be assumed
|
||||
//uint8_t PUCCH_Frequency_Hopping = 0 ; // from higher layers
|
||||
uint8_t intraSlotFrequencyHopping = 0;
|
||||
|
||||
if (startingPRB != startingPRB_intraSlotHopping) {
|
||||
if (pucch_pdu->freq_hop_flag) {
|
||||
intraSlotFrequencyHopping=1;
|
||||
#ifdef DEBUG_NR_PUCCH_TX
|
||||
printf("\t [nr_generate_pucch3_4] intraSlotFrequencyHopping=%d \n",intraSlotFrequencyHopping);
|
||||
#endif
|
||||
}
|
||||
|
||||
// add_dmrs indicates if we are using or not Additional DM-RS for formats 3 and 4. From higher layers. FIXME!!!
|
||||
uint8_t add_dmrs = 0;
|
||||
uint8_t nrofSymbols = pucch_pdu->nr_of_symbols;
|
||||
uint16_t nrofPRB = pucch_pdu->prb_size;
|
||||
uint16_t startingPRB = pucch_pdu->prb_start + pucch_pdu->bwp_start;
|
||||
uint8_t add_dmrs = pucch_pdu->add_dmrs_flag;
|
||||
|
||||
//nrofPRB = 2; // only for test purposes
|
||||
if (fmt == pucch_format4_nr) nrofPRB = 1;
|
||||
|
||||
nr_uci_encoding(payload,nr_bit,fmt,is_pi_over_2_bpsk_enabled,nrofSymbols,nrofPRB,n_SF_PUCCH_s,intraSlotFrequencyHopping,add_dmrs,&b[0],&M_bit);
|
||||
nr_uci_encoding(pucch_pdu->payload,
|
||||
pucch_pdu->n_bit,
|
||||
pucch_pdu->format_type,
|
||||
is_pi_over_2_bpsk_enabled,
|
||||
nrofSymbols,nrofPRB,
|
||||
n_SF_PUCCH_s,
|
||||
intraSlotFrequencyHopping,
|
||||
add_dmrs,
|
||||
&b[0],&M_bit);
|
||||
/*
|
||||
* Implementing TS 38.211
|
||||
* Subclauses 6.3.2.6.1 Scrambling (PUCCH formats 3 and 4)
|
||||
@@ -1184,7 +1189,7 @@ void nr_generate_pucch3_4(PHY_VARS_NR_UE *ue,
|
||||
*/
|
||||
uint8_t *btilde = malloc(sizeof(int8_t)*M_bit);
|
||||
// rnti is given by the C-RNTI
|
||||
uint16_t rnti=crnti, n_id=0;
|
||||
uint16_t rnti=pucch_pdu->rnti, n_id=0;
|
||||
#ifdef DEBUG_NR_PUCCH_TX
|
||||
printf("\t [nr_generate_pucch3_4] rnti = %d ,\n",rnti);
|
||||
#endif
|
||||
@@ -1300,12 +1305,11 @@ void nr_generate_pucch3_4(PHY_VARS_NR_UE *ue,
|
||||
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
|
||||
{0, 0, 0, 1, 1, 1, 0, 0, 0,-1,-1,-1}
|
||||
};
|
||||
//uint8_t occ_Length = occ_length_format4; // higher layer parameter occ-Length
|
||||
uint8_t occ_Index = occ_index_format4; // higher layer parameter occ-Index
|
||||
|
||||
uint8_t occ_Index = pucch_pdu->pre_dft_occ_idx; // higher layer parameter occ-Index
|
||||
|
||||
//occ_Index = 1; //only for testing purposes; to be removed FIXME!!!
|
||||
if (fmt == pucch_format3_nr) { // no block-wise spreading for format 3
|
||||
n_SF_PUCCH_s = 1;
|
||||
if (pucch_pdu->format_type == 3) { // no block-wise spreading for format 3
|
||||
|
||||
for (int l=0; l < floor(m_symbol/(12*nrofPRB)); l++) {
|
||||
for (int k=0; k < (12*nrofPRB); k++) {
|
||||
@@ -1319,7 +1323,7 @@ void nr_generate_pucch3_4(PHY_VARS_NR_UE *ue,
|
||||
}
|
||||
}
|
||||
|
||||
if (fmt == pucch_format4_nr) {
|
||||
if (pucch_pdu->format_type == 4) {
|
||||
nrofPRB = 1;
|
||||
|
||||
for (int l=0; l < floor((n_SF_PUCCH_s*m_symbol)/(12*nrofPRB)); l++) {
|
||||
@@ -1414,9 +1418,9 @@ void nr_generate_pucch3_4(PHY_VARS_NR_UE *ue,
|
||||
uint8_t m0;
|
||||
uint8_t mcs=0;
|
||||
|
||||
if (fmt == pucch_format3_nr) m0 = 0;
|
||||
if (pucch_pdu->format_type == 3) m0 = 0;
|
||||
|
||||
if (fmt == pucch_format4_nr) {
|
||||
if (pucch_pdu->format_type == 4) {
|
||||
if (n_SF_PUCCH_s == 2) {
|
||||
m0 = (occ_Index == 0) ? 0 : 6;
|
||||
}
|
||||
@@ -1456,7 +1460,8 @@ void nr_generate_pucch3_4(PHY_VARS_NR_UE *ue,
|
||||
for (int l=0; l<nrofSymbols; l++) {
|
||||
if ((intraSlotFrequencyHopping == 1) && (l >= (int)floor(nrofSymbols/2))) n_hop = 1; // n_hop = 1 for second hop
|
||||
|
||||
nr_group_sequence_hopping(ue->pucch_config_common_nr->pucch_GroupHopping,ue->pucch_config_common_nr->hoppingId,n_hop,nr_slot_tx,&u,&v); // calculating u and v value
|
||||
pucch_GroupHopping_t pucch_GroupHopping = pucch_pdu->group_hop_flag + (pucch_pdu->sequence_hop_flag<<1);
|
||||
nr_group_sequence_hopping(pucch_GroupHopping,pucch_pdu->hopping_id,n_hop,nr_slot_tx,&u,&v); // calculating u and v value
|
||||
|
||||
// Next we proceed to calculate base sequence for DM-RS signal, according to TS 38.211 subclause 6.4.1.33
|
||||
if (nrofPRB >= 3) { // TS 38.211 subclause 5.2.2.1 (Base sequences of length 36 or larger) applies
|
||||
@@ -1501,12 +1506,13 @@ void nr_generate_pucch3_4(PHY_VARS_NR_UE *ue,
|
||||
}
|
||||
}
|
||||
|
||||
uint8_t startingSymbolIndex = pucch_pdu->start_symbol_index;
|
||||
uint16_t j=0;
|
||||
alpha = nr_cyclic_shift_hopping(ue->pucch_config_common_nr->hoppingId,m0,mcs,l,startingSymbolIndex,nr_slot_tx);
|
||||
alpha = nr_cyclic_shift_hopping(pucch_pdu->hopping_id,m0,mcs,l,startingSymbolIndex,nr_slot_tx);
|
||||
|
||||
for (int rb=0; rb<nrofPRB; rb++) {
|
||||
if ((intraSlotFrequencyHopping == 1) && (l<floor(nrofSymbols/2))) { // intra-slot hopping enabled, we need to calculate new offset PRB
|
||||
startingPRB = startingPRB + startingPRB_intraSlotHopping;
|
||||
startingPRB = startingPRB + pucch_pdu->second_hop_prb;
|
||||
}
|
||||
|
||||
//startingPRB = startingPRB + rb;
|
||||
|
||||
@@ -49,65 +49,30 @@
|
||||
void nr_generate_pucch0(PHY_VARS_NR_UE *ue,
|
||||
int32_t **txdataF,
|
||||
NR_DL_FRAME_PARMS *frame_parms,
|
||||
long pucch_GroupHopping,
|
||||
long hoppingId,
|
||||
int16_t amp,
|
||||
int nr_slot_tx,
|
||||
uint8_t m0,
|
||||
uint8_t mcs,
|
||||
uint8_t nrofSymbols,
|
||||
uint8_t startingSymbolIndex,
|
||||
uint16_t startingPRB,
|
||||
uint16_t secondHopPRB);
|
||||
fapi_nr_ul_config_pucch_pdu *pucch_pdu);
|
||||
|
||||
void nr_generate_pucch1(PHY_VARS_NR_UE *ue,
|
||||
int32_t **txdataF,
|
||||
NR_DL_FRAME_PARMS *frame_parms,
|
||||
PUCCH_CONFIG_DEDICATED *pucch_config_dedicated,
|
||||
uint64_t payload,
|
||||
int16_t amp,
|
||||
int nr_slot_tx,
|
||||
uint8_t m0,
|
||||
uint8_t nrofSymbols,
|
||||
uint8_t startingSymbolIndex,
|
||||
uint16_t startingPRB,
|
||||
uint16_t startingPRB_intraSlotHopping,
|
||||
uint8_t timeDomainOCC,
|
||||
uint8_t nr_bit);
|
||||
fapi_nr_ul_config_pucch_pdu *pucch_pdu);
|
||||
|
||||
void nr_generate_pucch2(PHY_VARS_NR_UE *ue,
|
||||
uint16_t crnti,
|
||||
uint32_t dmrs_scrambling_id,
|
||||
uint32_t data_scrambling_id,
|
||||
int32_t **txdataF,
|
||||
NR_DL_FRAME_PARMS *frame_parms,
|
||||
PUCCH_CONFIG_DEDICATED *pucch_config_dedicated,
|
||||
uint64_t payload,
|
||||
int16_t amp,
|
||||
int nr_slot_tx,
|
||||
uint8_t nrofSymbols,
|
||||
uint8_t startingSymbolIndex,
|
||||
uint8_t nrofPRB,
|
||||
uint16_t startingPRB,
|
||||
uint8_t nr_bit);
|
||||
fapi_nr_ul_config_pucch_pdu *pucch_pdu);
|
||||
|
||||
void nr_generate_pucch3_4(PHY_VARS_NR_UE *ue,
|
||||
uint16_t crnti,
|
||||
int32_t **txdataF,
|
||||
NR_DL_FRAME_PARMS *frame_parms,
|
||||
pucch_format_nr_t fmt,
|
||||
PUCCH_CONFIG_DEDICATED *pucch_config_dedicated,
|
||||
uint64_t payload,
|
||||
int16_t amp,
|
||||
int nr_slot_tx,
|
||||
uint8_t nrofSymbols,
|
||||
uint8_t startingSymbolIndex,
|
||||
uint8_t nrofPRB,
|
||||
uint16_t startingPRB,
|
||||
uint16_t startingPRB_intraSlotHopping,
|
||||
uint8_t nr_bit,
|
||||
uint8_t occ_length_format4,
|
||||
uint8_t occ_index_format4);
|
||||
fapi_nr_ul_config_pucch_pdu *pucch_pdu);
|
||||
|
||||
// tables for mcs values for different payloads
|
||||
static const uint8_t table1_mcs[]={0,6,3,9};
|
||||
|
||||
@@ -235,6 +235,11 @@ typedef struct {
|
||||
int32_t *txdataF_layers[NR_MAX_NB_LAYERS];
|
||||
} NR_UE_PUSCH;
|
||||
|
||||
typedef struct {
|
||||
bool active[2];
|
||||
fapi_nr_ul_config_pucch_pdu pucch_pdu[2];
|
||||
} NR_UE_PUCCH;
|
||||
|
||||
typedef struct {
|
||||
/// \brief Holds the transmit data in time domain.
|
||||
/// For IFFT_FPGA this points to the same memory as PHY_vars->tx_vars[a].TX_DMA_BUFFER.
|
||||
@@ -810,6 +815,7 @@ typedef struct {
|
||||
NR_UE_PDCCH *pdcch_vars[RX_NB_TH_MAX][NUMBER_OF_CONNECTED_gNB_MAX];
|
||||
NR_UE_PRACH *prach_vars[NUMBER_OF_CONNECTED_gNB_MAX];
|
||||
NR_UE_PUSCH *pusch_vars[RX_NB_TH_MAX][NUMBER_OF_CONNECTED_gNB_MAX];
|
||||
NR_UE_PUCCH *pucch_vars[RX_NB_TH_MAX][NUMBER_OF_CONNECTED_gNB_MAX];
|
||||
NR_UE_DLSCH_t *dlsch[RX_NB_TH_MAX][NUMBER_OF_CONNECTED_gNB_MAX][NR_MAX_NB_CODEWORDS]; // two RxTx Threads
|
||||
NR_UE_ULSCH_t *ulsch[RX_NB_TH_MAX][NUMBER_OF_CONNECTED_gNB_MAX][NR_MAX_NB_CODEWORDS]; // two code words
|
||||
NR_UE_DLSCH_t *dlsch_SI[NUMBER_OF_CONNECTED_gNB_MAX];
|
||||
@@ -957,15 +963,10 @@ typedef struct {
|
||||
/// PUSCH contention-based access vars
|
||||
PUSCH_CA_CONFIG_DEDICATED pusch_ca_config_dedicated[NUMBER_OF_eNB_MAX]; // lola
|
||||
|
||||
/// PUCCH variables
|
||||
|
||||
PUCCH_CONFIG_DEDICATED pucch_config_dedicated[NUMBER_OF_CONNECTED_gNB_MAX];
|
||||
|
||||
//#if defined(UPGRADE_RAT_NR)
|
||||
#if 1
|
||||
SystemInformationBlockType1_nr_t systemInformationBlockType1_nr;
|
||||
PUCCH_ConfigCommon_nr_t pucch_config_common_nr[NUMBER_OF_CONNECTED_gNB_MAX];
|
||||
PUCCH_Config_t pucch_config_dedicated_nr[NUMBER_OF_CONNECTED_gNB_MAX];
|
||||
#endif
|
||||
|
||||
uint8_t ncs_cell[20][7];
|
||||
@@ -1068,6 +1069,7 @@ typedef struct {
|
||||
typedef struct nr_rxtx_thread_data_s {
|
||||
UE_nr_rxtx_proc_t proc;
|
||||
PHY_VARS_NR_UE *UE;
|
||||
NR_UE_SCHED_MODE_t ue_sched_mode;
|
||||
notifiedFIFO_t txFifo;
|
||||
} nr_rxtx_thread_data_t;
|
||||
|
||||
|
||||
@@ -427,23 +427,10 @@ typedef struct {
|
||||
*
|
||||
************************************************************************/
|
||||
|
||||
#define MAX_NR_OF_PUCCH_P0_PER_SET (8)
|
||||
#define NUMBER_PUCCH_FORMAT_NR (5)
|
||||
|
||||
typedef int8_t power_level_t; /* INTEGER (-16..15) */
|
||||
|
||||
typedef struct {
|
||||
uint8_t p0_PUCCH_Id; /* INTEGER (1..8) */
|
||||
power_level_t p0_PUCCH_Value;
|
||||
} P0_PUCCH_t;
|
||||
|
||||
typedef struct {
|
||||
power_level_t deltaF_PUCCH_f[NUMBER_PUCCH_FORMAT_NR];
|
||||
P0_PUCCH_t *p0_Set[MAX_NR_OF_PUCCH_P0_PER_SET];
|
||||
// pathlossReferenceRSs SEQUENCE (SIZE (1..maxNrofPUCCH-PathlossReferenceRSs)) OF PUCCH-PathlossReferenceRS OPTIONAL, -- Need M
|
||||
int8_t twoPUCCH_PC_AdjustmentStates;
|
||||
|
||||
} PUCCH_PowerControl_t;
|
||||
|
||||
/***********************************************************************
|
||||
*
|
||||
@@ -633,9 +620,10 @@ typedef struct {
|
||||
PUCCH_FormatConfig_t *formatConfig[NUMBER_PUCCH_FORMAT_NR-1]; /* format 0 is not there */
|
||||
uint8_t dl_DataToUL_ACK[NB_DL_DATA_TO_UL_ACK]; /* table TS 38.213 Table 9.2.3-1: Mapping of PSDCH-to-HARQ_feedback timing indicator field values to numbers of slots */
|
||||
void *spatial_Relation_Info[MAX_NR_OF_SPATIAL_RELATION_INFOS];
|
||||
PUCCH_PowerControl_t pucch_PowerControl;
|
||||
} PUCCH_Config_t;
|
||||
|
||||
|
||||
|
||||
/***********************************************************************
|
||||
*
|
||||
* FUNCTIONALITY : Scheduling Request Configuration (SR)
|
||||
|
||||
@@ -417,6 +417,7 @@ void nr_fill_rx_indication(fapi_nr_rx_indication_t *rx_ind,
|
||||
uint8_t gNB_id,
|
||||
PHY_VARS_NR_UE *ue,
|
||||
NR_UE_DLSCH_t *dlsch0,
|
||||
NR_UE_DLSCH_t *dlsch1,
|
||||
uint16_t n_pdus);
|
||||
|
||||
|
||||
|
||||
@@ -47,6 +47,7 @@ const char *ul_pdu_type[]={"PRACH", "PUCCH", "PUSCH", "SRS"};
|
||||
|
||||
int8_t nr_ue_scheduled_response(nr_scheduled_response_t *scheduled_response){
|
||||
|
||||
bool found = false;
|
||||
if(scheduled_response != NULL){
|
||||
|
||||
module_id_t module_id = scheduled_response->module_id;
|
||||
@@ -59,7 +60,7 @@ int8_t nr_ue_scheduled_response(nr_scheduled_response_t *scheduled_response){
|
||||
NR_UE_DLSCH_t *dlsch0 = NULL;
|
||||
NR_UE_PDCCH *pdcch_vars = PHY_vars_UE_g[module_id][cc_id]->pdcch_vars[thread_id][0];
|
||||
NR_UE_ULSCH_t *ulsch0 = PHY_vars_UE_g[module_id][cc_id]->ulsch[thread_id][0][0];
|
||||
NR_DL_FRAME_PARMS frame_parms = PHY_vars_UE_g[module_id][cc_id]->frame_parms;
|
||||
NR_UE_PUCCH *pucch_vars = PHY_vars_UE_g[module_id][cc_id]->pucch_vars[thread_id][0];
|
||||
|
||||
if(scheduled_response->dl_config != NULL){
|
||||
fapi_nr_dl_config_request_t *dl_config = scheduled_response->dl_config;
|
||||
@@ -118,26 +119,19 @@ int8_t nr_ue_scheduled_response(nr_scheduled_response_t *scheduled_response){
|
||||
dlsch0_harq->mcs = dlsch_config_pdu->mcs;
|
||||
dlsch0_harq->rvidx = dlsch_config_pdu->rv;
|
||||
dlsch0->g_pucch = dlsch_config_pdu->accumulated_delta_PUCCH;
|
||||
dlsch0_harq->harq_ack.pucch_resource_indicator = dlsch_config_pdu->pucch_resource_id;
|
||||
dlsch0_harq->harq_ack.slot_for_feedback_ack = (slot+dlsch_config_pdu->pdsch_to_harq_feedback_time_ind)%frame_parms.slots_per_frame;
|
||||
|
||||
//get nrOfLayers from DCI info
|
||||
uint8_t Nl = 0;
|
||||
for (i = 0; i < 4; i++) {
|
||||
if (dlsch_config_pdu->dmrs_ports[i] >= i) Nl += 1;
|
||||
}
|
||||
dlsch0_harq->Nl = Nl;
|
||||
|
||||
dlsch0_harq->mcs_table=dlsch_config_pdu->mcs_table;
|
||||
dlsch0_harq->harq_ack.rx_status = downlink_harq_process(dlsch0_harq, dlsch0->current_harq_pid, dlsch_config_pdu->ndi, dlsch0->rnti_type);
|
||||
downlink_harq_process(dlsch0_harq, dlsch0->current_harq_pid, dlsch_config_pdu->ndi, dlsch0->rnti_type);
|
||||
if (dlsch0_harq->status != ACTIVE) {
|
||||
// dlsch0_harq->status not ACTIVE may be due to false retransmission. Reset the
|
||||
// following flag to skip PDSCH procedures in that case.
|
||||
dlsch0->active = 0;
|
||||
dlsch0_harq->harq_ack.ack = 1;
|
||||
dlsch0_harq->harq_ack.send_harq_status = 1;
|
||||
}
|
||||
dlsch0_harq->harq_ack.vDAI_DL = dlsch_config_pdu->dai;
|
||||
/* PTRS */
|
||||
dlsch0_harq->PTRSFreqDensity = dlsch_config_pdu->PTRSFreqDensity;
|
||||
dlsch0_harq->PTRSTimeDensity = dlsch_config_pdu->PTRSTimeDensity;
|
||||
@@ -145,7 +139,7 @@ int8_t nr_ue_scheduled_response(nr_scheduled_response_t *scheduled_response){
|
||||
dlsch0_harq->nEpreRatioOfPDSCHToPTRS = dlsch_config_pdu->nEpreRatioOfPDSCHToPTRS;
|
||||
dlsch0_harq->PTRSReOffset = dlsch_config_pdu->PTRSReOffset;
|
||||
dlsch0_harq->pduBitmap = dlsch_config_pdu->pduBitmap;
|
||||
LOG_D(MAC, ">>>> \tdlsch0->g_pucch = %d\tdlsch0_harq.mcs = %d\tpdsch_to_harq_feedback_time_ind = %d\tslot_for_feedback_ack = %d\n", dlsch0->g_pucch, dlsch0_harq->mcs, dlsch_config_pdu->pdsch_to_harq_feedback_time_ind, dlsch0_harq->harq_ack.slot_for_feedback_ack);
|
||||
LOG_D(MAC, ">>>> \tdlsch0->g_pucch = %d\tdlsch0_harq.mcs = %d\n", dlsch0->g_pucch, dlsch0_harq->mcs);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -161,7 +155,7 @@ int8_t nr_ue_scheduled_response(nr_scheduled_response_t *scheduled_response){
|
||||
AssertFatal(ul_config->ul_config_list[i].pdu_type <= FAPI_NR_UL_CONFIG_TYPES,"pdu_type %d out of bounds\n",ul_config->ul_config_list[i].pdu_type);
|
||||
LOG_D(PHY, "In %s: processing %s PDU of %d total UL PDUs (ul_config %p) \n", __FUNCTION__, ul_pdu_type[ul_config->ul_config_list[i].pdu_type - 1], ul_config->number_pdus, ul_config);
|
||||
|
||||
uint8_t pdu_type = ul_config->ul_config_list[i].pdu_type, pucch_resource_id, current_harq_pid, format, gNB_id = 0;
|
||||
uint8_t pdu_type = ul_config->ul_config_list[i].pdu_type, current_harq_pid, gNB_id = 0;
|
||||
/* PRACH */
|
||||
//NR_PRACH_RESOURCES_t *prach_resources;
|
||||
fapi_nr_ul_config_prach_pdu *prach_config_pdu;
|
||||
@@ -169,9 +163,6 @@ int8_t nr_ue_scheduled_response(nr_scheduled_response_t *scheduled_response){
|
||||
nfapi_nr_ue_pusch_pdu_t *pusch_config_pdu;
|
||||
/* PUCCH */
|
||||
fapi_nr_ul_config_pucch_pdu *pucch_config_pdu;
|
||||
PUCCH_ConfigCommon_nr_t *pucch_config_common_nr;
|
||||
PUCCH_Config_t *pucch_config_dedicated_nr;
|
||||
PUCCH_format_t *format_params;
|
||||
|
||||
switch (pdu_type){
|
||||
|
||||
@@ -209,47 +200,19 @@ int8_t nr_ue_scheduled_response(nr_scheduled_response_t *scheduled_response){
|
||||
break;
|
||||
|
||||
case (FAPI_NR_UL_CONFIG_TYPE_PUCCH):
|
||||
// pucch config pdu
|
||||
found = false;
|
||||
pucch_config_pdu = &ul_config->ul_config_list[i].pucch_config_pdu;
|
||||
pucch_resource_id = 0; //FIXME!!!
|
||||
format = 1; // FIXME!!!
|
||||
pucch_config_common_nr = &PHY_vars_UE_g[module_id][cc_id]->pucch_config_common_nr[0];
|
||||
pucch_config_dedicated_nr = &PHY_vars_UE_g[module_id][cc_id]->pucch_config_dedicated_nr[0];
|
||||
format_params = &pucch_config_dedicated_nr->PUCCH_Resource[pucch_resource_id]->format_parameters;
|
||||
|
||||
format_params->initialCyclicShift = pucch_config_pdu->initialCyclicShift;
|
||||
format_params->nrofSymbols = pucch_config_pdu->nrofSymbols;
|
||||
format_params->startingSymbolIndex = pucch_config_pdu->startingSymbolIndex;
|
||||
format_params->nrofPRBs = pucch_config_pdu->nrofPRBs;
|
||||
format_params->timeDomainOCC = pucch_config_pdu->timeDomainOCC;
|
||||
format_params->occ_length = pucch_config_pdu->occ_length;
|
||||
format_params->occ_Index = pucch_config_pdu->occ_Index;
|
||||
|
||||
pucch_config_dedicated_nr->PUCCH_Resource[pucch_resource_id]->startingPRB = pucch_config_pdu->startingPRB;
|
||||
pucch_config_dedicated_nr->PUCCH_Resource[pucch_resource_id]->intraSlotFrequencyHopping = pucch_config_pdu->intraSlotFrequencyHopping;
|
||||
pucch_config_dedicated_nr->PUCCH_Resource[pucch_resource_id]->secondHopPRB = pucch_config_pdu->secondHopPRB; // Not sure this parameter is used
|
||||
pucch_config_dedicated_nr->formatConfig[format - 1]->additionalDMRS = pucch_config_pdu->additionalDMRS; // At this point we need to know which format is going to be used
|
||||
pucch_config_dedicated_nr->formatConfig[format - 1]->pi2PBSK = pucch_config_pdu->pi2PBSK;
|
||||
|
||||
pucch_config_common_nr->pucch_GroupHopping = pucch_config_pdu->pucch_GroupHopping;
|
||||
pucch_config_common_nr->hoppingId = pucch_config_pdu->hoppingId;
|
||||
pucch_config_common_nr->p0_nominal = pucch_config_pdu->p0_nominal;
|
||||
|
||||
/* pucch_config_dedicated->PUCCH_Resource[pucch_resource_id]->format_parameters.initialCyclicShift = pucch_config_pdu->initialCyclicShift;
|
||||
pucch_config_dedicated->PUCCH_Resource[pucch_resource_id]->format_parameters.nrofSymbols = pucch_config_pdu->nrofSymbols;
|
||||
pucch_config_dedicated->PUCCH_Resource[pucch_resource_id]->format_parameters.startingSymbolIndex = pucch_config_pdu->startingSymbolIndex;
|
||||
pucch_config_dedicated->PUCCH_Resource[pucch_resource_id]->format_parameters.nrofPRBs = pucch_config_pdu->nrofPRBs;
|
||||
pucch_config_dedicated->PUCCH_Resource[pucch_resource_id]->startingPRB = pucch_config_pdu->startingPRB;
|
||||
pucch_config_dedicated->PUCCH_Resource[pucch_resource_id]->format_parameters.timeDomainOCC = pucch_config_pdu->timeDomainOCC;
|
||||
pucch_config_dedicated->PUCCH_Resource[pucch_resource_id]->format_parameters.occ_length = pucch_config_pdu->occ_length;
|
||||
pucch_config_dedicated->PUCCH_Resource[pucch_resource_id]->format_parameters.occ_Index = pucch_config_pdu->occ_Index;
|
||||
pucch_config_dedicated->PUCCH_Resource[pucch_resource_id]->intraSlotFrequencyHopping = pucch_config_pdu->intraSlotFrequencyHopping;
|
||||
pucch_config_dedicated->PUCCH_Resource[pucch_resource_id]->secondHopPRB = pucch_config_pdu->secondHopPRB; // Not sure this parameter is used
|
||||
pucch_config_dedicated->formatConfig[format-1]->additionalDMRS = pucch_config_pdu->additionalDMRS; // At this point we need to know which format is going to be used
|
||||
pucch_config_dedicated->formatConfig[format-1]->pi2PBSK = pucch_config_pdu->pi2PBSK;
|
||||
pucch_config_common->pucch_GroupHopping = pucch_config_pdu->pucch_GroupHopping;
|
||||
pucch_config_common->hoppingId = pucch_config_pdu->hoppingId;
|
||||
pucch_config_common->p0_nominal = pucch_config_pdu->p0_nominal;*/
|
||||
for(int j=0; j<2; j++) {
|
||||
if(pucch_vars->active[j] == false) {
|
||||
LOG_D(PHY,"%d.%d Copying pucch pdu to UE PHY\n",scheduled_response->frame,slot);
|
||||
memcpy((void*)&(pucch_vars->pucch_pdu[j]), (void*)pucch_config_pdu, sizeof(fapi_nr_ul_config_pucch_pdu));
|
||||
pucch_vars->active[j] = true;
|
||||
found = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!found)
|
||||
LOG_E(PHY, "Couldn't find allocation for PUCCH PDU in PUCCH VARS\n");
|
||||
break;
|
||||
|
||||
case (FAPI_NR_UL_CONFIG_TYPE_PRACH):
|
||||
|
||||
@@ -98,43 +98,6 @@
|
||||
#define DL_DCI (1)
|
||||
#define UL_DCI (0)
|
||||
|
||||
/*******************************************************************
|
||||
*
|
||||
* NAME : get_dci_info_for_harq
|
||||
*
|
||||
* PARAMETERS : pointer to ue context
|
||||
* id of current gNB
|
||||
* number of uplink processes
|
||||
* maximum number of uplink retransmissions
|
||||
* RETURN : none
|
||||
*
|
||||
* DESCRIPTION : update HARQ entity with information from DCI
|
||||
* TS 38.212 7.3.1.2 DCI formats for scheduling PDSCH
|
||||
*
|
||||
*********************************************************************/
|
||||
|
||||
void get_dci_info_for_harq(PHY_VARS_NR_UE *ue, NR_DCI_INFO_EXTRACTED_t *nr_dci_info_extracted,
|
||||
NR_UE_DLSCH_t **dlsch, NR_UE_ULSCH_t *ulsch, uint8_t slot, uint8_t tx_offset)
|
||||
{
|
||||
if (nr_dci_info_extracted->identifier_dci_formats == DL_DCI) {
|
||||
|
||||
dlsch[0]->current_harq_pid = nr_dci_info_extracted->harq_process_number;
|
||||
|
||||
NR_DL_UE_HARQ_t *dl_harq = dlsch[0]->harq_processes[dlsch[0]->current_harq_pid];
|
||||
|
||||
dl_harq->harq_ack.vDAI_DL = nr_dci_info_extracted->dai+1;
|
||||
dl_harq->harq_ack.pucch_resource_indicator = nr_dci_info_extracted->pucch_resource_ind;
|
||||
dl_harq->harq_ack.slot_for_feedback_ack = (slot + nr_dci_info_extracted->pdsch_to_harq_feedback_time_ind)%ue->frame_parms.slots_per_subframe;
|
||||
dl_harq->harq_ack.harq_id = nr_dci_info_extracted->harq_process_number;
|
||||
dl_harq->harq_ack.rx_status = downlink_harq_process(dl_harq, dlsch[0]->current_harq_pid, nr_dci_info_extracted->ndi, dlsch[0]->rnti_type);
|
||||
}
|
||||
else if (nr_dci_info_extracted->identifier_dci_formats == UL_DCI) {
|
||||
|
||||
/* store harq id for which pusch should be transmitted at rx_slot + tx_offset */
|
||||
set_tx_harq_id(ulsch, nr_dci_info_extracted->harq_process_number, (slot + tx_offset)%ue->frame_parms.slots_per_subframe);
|
||||
ulsch->harq_processes[nr_dci_info_extracted->harq_process_number]->tx_status = uplink_harq_process(ulsch, nr_dci_info_extracted->harq_process_number, nr_dci_info_extracted->ndi, ulsch->rnti_type);
|
||||
}
|
||||
}
|
||||
|
||||
/*******************************************************************
|
||||
*
|
||||
@@ -345,96 +308,7 @@ void init_downlink_harq_status(NR_DL_UE_HARQ_t *dl_harq)
|
||||
dl_harq->status = SCH_IDLE;
|
||||
dl_harq->first_tx = 1;
|
||||
dl_harq->round = 0;
|
||||
dl_harq->harq_ack.ack = DL_ACKNACK_NO_SET;
|
||||
dl_harq->harq_ack.send_harq_status = 0;
|
||||
dl_harq->harq_ack.vDAI_UL = UL_DAI_NO_SET;
|
||||
dl_harq->harq_ack.vDAI_DL = DL_DAI_NO_SET;
|
||||
dl_harq->harq_ack.slot_for_feedback_ack = NR_MAX_SLOTS_PER_FRAME;
|
||||
dl_harq->harq_ack.pucch_resource_indicator = MAX_PUCCH_RESOURCE_INDICATOR;
|
||||
dl_harq->harq_ack.n_CCE = 0;
|
||||
dl_harq->harq_ack.N_CCE = 0;;
|
||||
}
|
||||
|
||||
/*******************************************************************
|
||||
*
|
||||
* NAME : config_downlink_harq_process
|
||||
*
|
||||
* PARAMETERS : pointer to ue context
|
||||
* id of current gNB
|
||||
* number of downlink processes
|
||||
*
|
||||
* RETURN : none
|
||||
*
|
||||
* DESCRIPTION : configuration of downlink HARQ entity
|
||||
*
|
||||
*********************************************************************/
|
||||
|
||||
void config_downlink_harq_process(PHY_VARS_NR_UE *ue, int gNB_id, int TB_id, int execution_thread_number, uint8_t number_harq_processes_for_pdsch)
|
||||
{
|
||||
NR_UE_DLSCH_t *dlsch;
|
||||
|
||||
dlsch = (NR_UE_DLSCH_t *)malloc16(sizeof(NR_UE_DLSCH_t));
|
||||
|
||||
if (dlsch != NULL) {
|
||||
|
||||
memset(dlsch,0,sizeof(NR_UE_DLSCH_t));
|
||||
|
||||
ue->dlsch[execution_thread_number][gNB_id][TB_id] = dlsch;
|
||||
}
|
||||
else {
|
||||
LOG_E(PHY, "Fatal memory allocation problem at line %d in function %s of file %s \n", __LINE__ , __func__, __FILE__);
|
||||
assert(0);
|
||||
}
|
||||
|
||||
dlsch->Mdlharq = number_harq_processes_for_pdsch; /* an additional HARQ is reserved for PBCCH */
|
||||
dlsch->number_harq_processes_for_pdsch = number_harq_processes_for_pdsch;
|
||||
|
||||
/* allocation of HARQ process context */
|
||||
for (int harq_pid = 0; harq_pid < number_harq_processes_for_pdsch; harq_pid++) {
|
||||
|
||||
//dlsch->harq_processes[harq_pid] = (NR_DL_UE_HARQ_t *)malloc16(sizeof(NR_DL_UE_HARQ_t));
|
||||
|
||||
/*if (dlsch->harq_processes[harq_pid] == NULL) {
|
||||
LOG_E(PHY, "Fatal memory allocation problem at line %d in function %s of file %s \n", __LINE__ , __func__, __FILE__);
|
||||
assert(0);
|
||||
}*/
|
||||
|
||||
memset(&dlsch->harq_processes[harq_pid],0,sizeof(NR_DL_UE_HARQ_t));
|
||||
|
||||
NR_DL_UE_HARQ_t *dl_harq = dlsch->harq_processes[harq_pid];
|
||||
|
||||
init_downlink_harq_status(dl_harq);
|
||||
}
|
||||
}
|
||||
|
||||
/*******************************************************************
|
||||
*
|
||||
* NAME : release_downlink_harq_process
|
||||
*
|
||||
* PARAMETERS : pointer to ue context
|
||||
* id of current gNB
|
||||
* TB_id transport block identity 0 or 1
|
||||
* execution_thread_number thread number for current downlink processing
|
||||
* RETURN : none
|
||||
*
|
||||
* DESCRIPTION : release of HARQ downlink entity
|
||||
*
|
||||
*********************************************************************/
|
||||
|
||||
void release_downlink_harq_process(PHY_VARS_NR_UE *ue, int gNB_id, int TB_id, int execution_thread_number)
|
||||
{
|
||||
NR_UE_DLSCH_t *dlsch = ue->dlsch[execution_thread_number][gNB_id][TB_id];
|
||||
|
||||
/*for (int process_id = 0; process_id < dlsch->Mdlharq; process_id++) {
|
||||
|
||||
free16(dlsch->harq_processes[process_id],sizeof(NR_DL_UE_HARQ_t));
|
||||
|
||||
dlsch->harq_processes[process_id] = NULL;
|
||||
}*/
|
||||
|
||||
free16(dlsch,sizeof(NR_UE_DLSCH_t));
|
||||
|
||||
ue->dlsch[execution_thread_number][gNB_id][TB_id] = NULL;
|
||||
dl_harq->ack = DL_ACKNACK_NO_SET;
|
||||
}
|
||||
|
||||
/*******************************************************************
|
||||
@@ -454,18 +328,15 @@ void release_downlink_harq_process(PHY_VARS_NR_UE *ue, int gNB_id, int TB_id, in
|
||||
*
|
||||
*********************************************************************/
|
||||
|
||||
harq_result_t downlink_harq_process(NR_DL_UE_HARQ_t *dl_harq, int harq_pid, int ndi, uint8_t rnti_type)
|
||||
{
|
||||
harq_result_t result_harq = RETRANSMISSION_HARQ;
|
||||
void downlink_harq_process(NR_DL_UE_HARQ_t *dl_harq, int harq_pid, int ndi, uint8_t rnti_type) {
|
||||
|
||||
if (rnti_type == _CS_RNTI_)
|
||||
{
|
||||
if (rnti_type == _CS_RNTI_) {
|
||||
LOG_E(PHY, "Fatal error in HARQ entity due to not supported CS_RNTI at line %d in function %s of file %s \n", __LINE__ , __func__, __FILE__);
|
||||
return(NEW_TRANSMISSION_HARQ);
|
||||
return;
|
||||
}
|
||||
else if ((rnti_type != _C_RNTI_) && (rnti_type != _TC_RNTI_)) {
|
||||
/* harq mechanism is not relevant for other rnti */
|
||||
return(NEW_TRANSMISSION_HARQ);
|
||||
return;
|
||||
}
|
||||
|
||||
if (dl_harq->first_tx == 1) {
|
||||
@@ -474,8 +345,6 @@ harq_result_t downlink_harq_process(NR_DL_UE_HARQ_t *dl_harq, int harq_pid, int
|
||||
dl_harq->DCINdi = ndi;
|
||||
dl_harq->first_tx = 0;
|
||||
|
||||
result_harq = NEW_TRANSMISSION_HARQ;
|
||||
|
||||
LOG_D(PHY, "[HARQ-DL-PDSCH harqId : %d] first new reception \n", harq_pid);
|
||||
}
|
||||
else if (dl_harq->DCINdi != ndi) {
|
||||
@@ -483,20 +352,15 @@ harq_result_t downlink_harq_process(NR_DL_UE_HARQ_t *dl_harq, int harq_pid, int
|
||||
dl_harq->status = ACTIVE;
|
||||
dl_harq->DCINdi = ndi;
|
||||
|
||||
result_harq = NEW_TRANSMISSION_HARQ;
|
||||
|
||||
LOG_D(PHY, "[HARQ-DL-PDSCH harqId : %d] new reception due to toogle of ndi \n", harq_pid);
|
||||
}
|
||||
else {
|
||||
|
||||
dl_harq->round++;
|
||||
|
||||
if (dl_harq->harq_ack.ack) dl_harq->status = SCH_IDLE;
|
||||
|
||||
result_harq = RETRANSMISSION_HARQ;
|
||||
if (dl_harq->ack) dl_harq->status = SCH_IDLE;
|
||||
|
||||
LOG_D(PHY, "[HARQ-DL-PDSCH harqId : %d] reception of a retransmission \n", harq_pid);
|
||||
}
|
||||
|
||||
return (result_harq);
|
||||
}
|
||||
|
||||
|
||||
@@ -46,8 +46,6 @@
|
||||
|
||||
#define NR_DEFAULT_DLSCH_HARQ_PROCESSES (8) /* TS 38.214 5.1 */
|
||||
|
||||
#define NR_DL_MAX_DAI (4) /* TS 38.213 table 9.1.3-1 Value of counter DAI for DCI format 1_0 and 1_1 */
|
||||
#define NR_DL_MAX_NB_CW (2) /* number of downlink code word */
|
||||
#define DL_ACKNACK_NO_SET (2)
|
||||
#define DL_NACK (0)
|
||||
#define DL_ACK (1)
|
||||
@@ -68,18 +66,6 @@
|
||||
/*************** FUNCTIONS ****************************************/
|
||||
|
||||
|
||||
/** \brief This function updates HARQ context according to dci
|
||||
@param PHY_VARS_NR_UE ue context
|
||||
@param nr_dci_info_extracted extracted information from dci
|
||||
@param dlsch downlink context
|
||||
@param ulsch uplink context
|
||||
@param nr_slot_rx rx slot
|
||||
@param tx_offset slot offset for tx
|
||||
@returns none */
|
||||
|
||||
void get_dci_info_for_harq(PHY_VARS_NR_UE *ue, NR_DCI_INFO_EXTRACTED_t *nr_dci_info_extracted,
|
||||
NR_UE_DLSCH_t **dlsch, NR_UE_ULSCH_t *ulsch, uint8_t nr_slot_rx, uint8_t tx_offset);
|
||||
|
||||
/** \brief This function configures uplink HARQ context
|
||||
@param PHY_VARS_NR_UE ue context
|
||||
@param gNB_id gNodeB identifier
|
||||
@@ -127,24 +113,6 @@ harq_result_t uplink_harq_process(NR_UE_ULSCH_t *ulsch, int harq_pid, int ndi, u
|
||||
|
||||
void init_downlink_harq_status(NR_DL_UE_HARQ_t *dl_harq);
|
||||
|
||||
/** \brief This function configures downlink HARQ context
|
||||
@param PHY_VARS_NR_UE ue context
|
||||
@param gNB_id gNodeB identifier
|
||||
@param TB_id transport block identifier
|
||||
@param execution_thread_number thread_number
|
||||
@param number_harq_processes maximum number of downlink HARQ processes
|
||||
@returns none */
|
||||
|
||||
void config_downlink_harq_process(PHY_VARS_NR_UE *ue, int gNB_id, int TB_id, int execution_thread_number, uint8_t number_harq_processes);
|
||||
|
||||
/** \brief This function releases downlink HARQ context
|
||||
@param PHY_VARS_NR_UE ue context
|
||||
@param gNB_id gNodeB identifier
|
||||
@param TB_id transport block identifier
|
||||
@param execution_thread_number thread_number
|
||||
@returns none */
|
||||
|
||||
void release_downlink_harq_process(PHY_VARS_NR_UE *ue, int gNB_id, int TB_id, int execution_thread_number);
|
||||
|
||||
/** \brief This function update downlink harq context and return reception type (new transmission or retransmission)
|
||||
@param dlsch downlink harq context
|
||||
@@ -152,7 +120,7 @@ void release_downlink_harq_process(PHY_VARS_NR_UE *ue, int gNB_id, int TB_id, in
|
||||
@param rnti_type type of rnti
|
||||
@returns retransmission or new transmission */
|
||||
|
||||
harq_result_t downlink_harq_process(NR_DL_UE_HARQ_t *dlsch, int harq_pid, int ndi, uint8_t rnti_type);
|
||||
void downlink_harq_process(NR_DL_UE_HARQ_t *dlsch, int harq_pid, int ndi, uint8_t rnti_type);
|
||||
|
||||
#undef EXTERN
|
||||
#undef INIT_VARIABLES_HARQ_NR_H
|
||||
|
||||
@@ -122,9 +122,10 @@ void nr_fill_rx_indication(fapi_nr_rx_indication_t *rx_ind,
|
||||
uint8_t gNB_id,
|
||||
PHY_VARS_NR_UE *ue,
|
||||
NR_UE_DLSCH_t *dlsch0,
|
||||
NR_UE_DLSCH_t *dlsch1,
|
||||
uint16_t n_pdus){
|
||||
|
||||
int harq_pid;
|
||||
|
||||
NR_DL_FRAME_PARMS *frame_parms = &ue->frame_parms;
|
||||
|
||||
if (n_pdus > 1){
|
||||
@@ -133,11 +134,27 @@ void nr_fill_rx_indication(fapi_nr_rx_indication_t *rx_ind,
|
||||
|
||||
switch (pdu_type){
|
||||
case FAPI_NR_RX_PDU_TYPE_SIB:
|
||||
rx_ind->rx_indication_body[n_pdus - 1].pdsch_pdu.harq_pid = dlsch0->current_harq_pid;
|
||||
rx_ind->rx_indication_body[n_pdus - 1].pdsch_pdu.ack_nack = dlsch0->harq_processes[dlsch0->current_harq_pid]->ack;
|
||||
rx_ind->rx_indication_body[n_pdus - 1].pdsch_pdu.pdu = dlsch0->harq_processes[dlsch0->current_harq_pid]->b;
|
||||
rx_ind->rx_indication_body[n_pdus - 1].pdsch_pdu.pdu_length = dlsch0->harq_processes[dlsch0->current_harq_pid]->TBS / 8;
|
||||
break;
|
||||
case FAPI_NR_RX_PDU_TYPE_DLSCH:
|
||||
if(dlsch0) {
|
||||
rx_ind->rx_indication_body[n_pdus - 1].pdsch_pdu.harq_pid = dlsch0->current_harq_pid;
|
||||
rx_ind->rx_indication_body[n_pdus - 1].pdsch_pdu.ack_nack = dlsch0->harq_processes[dlsch0->current_harq_pid]->ack;
|
||||
rx_ind->rx_indication_body[n_pdus - 1].pdsch_pdu.pdu = dlsch0->harq_processes[dlsch0->current_harq_pid]->b;
|
||||
rx_ind->rx_indication_body[n_pdus - 1].pdsch_pdu.pdu_length = dlsch0->harq_processes[dlsch0->current_harq_pid]->TBS / 8;
|
||||
}
|
||||
if(dlsch1) {
|
||||
AssertFatal(1==0,"Second codeword currently not supported\n");
|
||||
}
|
||||
break;
|
||||
case FAPI_NR_RX_PDU_TYPE_RAR:
|
||||
harq_pid = dlsch0->current_harq_pid;
|
||||
rx_ind->rx_indication_body[n_pdus - 1].pdsch_pdu.pdu = dlsch0->harq_processes[harq_pid]->b;
|
||||
rx_ind->rx_indication_body[n_pdus - 1].pdsch_pdu.pdu_length = dlsch0->harq_processes[harq_pid]->TBS / 8;
|
||||
rx_ind->rx_indication_body[n_pdus - 1].pdsch_pdu.harq_pid = dlsch0->current_harq_pid;
|
||||
rx_ind->rx_indication_body[n_pdus - 1].pdsch_pdu.ack_nack = dlsch0->harq_processes[dlsch0->current_harq_pid]->ack;
|
||||
rx_ind->rx_indication_body[n_pdus - 1].pdsch_pdu.pdu = dlsch0->harq_processes[dlsch0->current_harq_pid]->b;
|
||||
rx_ind->rx_indication_body[n_pdus - 1].pdsch_pdu.pdu_length = dlsch0->harq_processes[dlsch0->current_harq_pid]->TBS / 8;
|
||||
break;
|
||||
case FAPI_NR_RX_PDU_TYPE_SSB:
|
||||
rx_ind->rx_indication_body[n_pdus - 1].ssb_pdu.pdu = ue->pbch_vars[gNB_id]->decoded_output;
|
||||
@@ -146,6 +163,7 @@ void nr_fill_rx_indication(fapi_nr_rx_indication_t *rx_ind,
|
||||
rx_ind->rx_indication_body[n_pdus - 1].ssb_pdu.ssb_length = frame_parms->Lmax;
|
||||
rx_ind->rx_indication_body[n_pdus - 1].ssb_pdu.cell_id = frame_parms->Nid_cell;
|
||||
rx_ind->rx_indication_body[n_pdus - 1].ssb_pdu.ssb_start_subcarrier = frame_parms->ssb_start_subcarrier;
|
||||
rx_ind->rx_indication_body[n_pdus - 1].ssb_pdu.rsrp_dBm = ue->measurements.rsrp_dBm[gNB_id];
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
@@ -854,13 +872,13 @@ int nr_ue_pdsch_procedures(PHY_VARS_NR_UE *ue, UE_nr_rxtx_proc_t *proc, int gNB_
|
||||
}
|
||||
|
||||
void nr_ue_dlsch_procedures(PHY_VARS_NR_UE *ue,
|
||||
UE_nr_rxtx_proc_t *proc,
|
||||
int gNB_id,
|
||||
PDSCH_t pdsch,
|
||||
NR_UE_DLSCH_t *dlsch0,
|
||||
NR_UE_DLSCH_t *dlsch1,
|
||||
int *dlsch_errors,
|
||||
uint8_t dlsch_parallel) {
|
||||
UE_nr_rxtx_proc_t *proc,
|
||||
int gNB_id,
|
||||
PDSCH_t pdsch,
|
||||
NR_UE_DLSCH_t *dlsch0,
|
||||
NR_UE_DLSCH_t *dlsch1,
|
||||
int *dlsch_errors,
|
||||
uint8_t dlsch_parallel) {
|
||||
|
||||
if (dlsch0==NULL)
|
||||
AssertFatal(0,"dlsch0 should be defined at this level \n");
|
||||
@@ -951,17 +969,17 @@ void nr_ue_dlsch_procedures(PHY_VARS_NR_UE *ue,
|
||||
dlsch0->harq_processes[harq_pid]->Qm,
|
||||
dlsch0->harq_processes[harq_pid]->Nl);
|
||||
#if UE_TIMING_TRACE
|
||||
start_meas(&ue->dlsch_unscrambling_stats);
|
||||
start_meas(&ue->dlsch_unscrambling_stats);
|
||||
#endif
|
||||
nr_dlsch_unscrambling(pdsch_vars->llr[0],
|
||||
dlsch0->harq_processes[harq_pid]->G,
|
||||
0,
|
||||
ue->frame_parms.Nid_cell,
|
||||
dlsch0->rnti);
|
||||
nr_dlsch_unscrambling(pdsch_vars->llr[0],
|
||||
dlsch0->harq_processes[harq_pid]->G,
|
||||
0,
|
||||
ue->frame_parms.Nid_cell,
|
||||
dlsch0->rnti);
|
||||
|
||||
|
||||
#if UE_TIMING_TRACE
|
||||
stop_meas(&ue->dlsch_unscrambling_stats);
|
||||
stop_meas(&ue->dlsch_unscrambling_stats);
|
||||
#endif
|
||||
|
||||
#if 0
|
||||
@@ -976,79 +994,99 @@ void nr_ue_dlsch_procedures(PHY_VARS_NR_UE *ue,
|
||||
#endif
|
||||
|
||||
#if UE_TIMING_TRACE
|
||||
start_meas(&ue->dlsch_decoding_stats[proc->thread_id]);
|
||||
start_meas(&ue->dlsch_decoding_stats[proc->thread_id]);
|
||||
#endif
|
||||
|
||||
if( dlsch_parallel)
|
||||
{
|
||||
ret = nr_dlsch_decoding_mthread(ue,
|
||||
proc,
|
||||
gNB_id,
|
||||
pdsch_vars->llr[0],
|
||||
&ue->frame_parms,
|
||||
dlsch0,
|
||||
dlsch0->harq_processes[harq_pid],
|
||||
frame_rx,
|
||||
nb_symb_sch,
|
||||
nr_slot_rx,
|
||||
harq_pid,
|
||||
pdsch==PDSCH?1:0,
|
||||
dlsch0->harq_processes[harq_pid]->TBS>256?1:0);
|
||||
LOG_T(PHY,"dlsch decoding is parallelized, ret = %d\n", ret);
|
||||
if( dlsch_parallel) {
|
||||
ret = nr_dlsch_decoding_mthread(ue,
|
||||
proc,
|
||||
gNB_id,
|
||||
pdsch_vars->llr[0],
|
||||
&ue->frame_parms,
|
||||
dlsch0,
|
||||
dlsch0->harq_processes[harq_pid],
|
||||
frame_rx,
|
||||
nb_symb_sch,
|
||||
nr_slot_rx,
|
||||
harq_pid,
|
||||
pdsch==PDSCH?1:0,
|
||||
dlsch0->harq_processes[harq_pid]->TBS>256?1:0);
|
||||
|
||||
LOG_T(PHY,"dlsch decoding is parallelized, ret = %d\n", ret);
|
||||
}
|
||||
else
|
||||
{
|
||||
ret = nr_dlsch_decoding(ue,
|
||||
proc,
|
||||
gNB_id,
|
||||
pdsch_vars->llr[0],
|
||||
&ue->frame_parms,
|
||||
dlsch0,
|
||||
dlsch0->harq_processes[harq_pid],
|
||||
frame_rx,
|
||||
nb_symb_sch,
|
||||
nr_slot_rx,
|
||||
harq_pid,
|
||||
pdsch==PDSCH?1:0,
|
||||
dlsch0->harq_processes[harq_pid]->TBS>256?1:0);
|
||||
else {
|
||||
ret = nr_dlsch_decoding(ue,
|
||||
proc,
|
||||
gNB_id,
|
||||
pdsch_vars->llr[0],
|
||||
&ue->frame_parms,
|
||||
dlsch0,
|
||||
dlsch0->harq_processes[harq_pid],
|
||||
frame_rx,
|
||||
nb_symb_sch,
|
||||
nr_slot_rx,
|
||||
harq_pid,
|
||||
pdsch==PDSCH?1:0,
|
||||
dlsch0->harq_processes[harq_pid]->TBS>256?1:0);
|
||||
LOG_T(PHY,"Sequential dlsch decoding , ret = %d\n", ret);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
switch (pdsch) {
|
||||
case RA_PDSCH:
|
||||
nr_fill_dl_indication(&dl_indication, NULL, &rx_ind, proc, ue, gNB_id);
|
||||
nr_fill_rx_indication(&rx_ind, FAPI_NR_RX_PDU_TYPE_RAR, gNB_id, ue, dlsch0, NULL, number_pdus);
|
||||
ue->UE_mode[gNB_id] = RA_RESPONSE;
|
||||
break;
|
||||
case PDSCH:
|
||||
nr_fill_dl_indication(&dl_indication, NULL, &rx_ind, proc, ue, gNB_id);
|
||||
nr_fill_rx_indication(&rx_ind, FAPI_NR_RX_PDU_TYPE_DLSCH, gNB_id, ue, dlsch0, NULL, number_pdus);
|
||||
break;
|
||||
case SI_PDSCH:
|
||||
nr_fill_dl_indication(&dl_indication, NULL, &rx_ind, proc, ue, gNB_id);
|
||||
nr_fill_rx_indication(&rx_ind, FAPI_NR_RX_PDU_TYPE_SIB, gNB_id, ue, dlsch0, NULL, number_pdus);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
LOG_D(PHY, "In %s DL PDU length in bits: %d, in bytes: %d \n", __FUNCTION__, dlsch0->harq_processes[harq_pid]->TBS, dlsch0->harq_processes[harq_pid]->TBS / 8);
|
||||
|
||||
|
||||
|
||||
#if UE_TIMING_TRACE
|
||||
stop_meas(&ue->dlsch_decoding_stats[proc->thread_id]);
|
||||
stop_meas(&ue->dlsch_decoding_stats[proc->thread_id]);
|
||||
#if DISABLE_LOG_X
|
||||
printf(" --> Unscrambling for CW0 %5.3f\n",
|
||||
(ue->dlsch_unscrambling_stats.p_time)/(cpuf*1000.0));
|
||||
printf("AbsSubframe %d.%d --> LDPC Decoding for CW0 %5.3f\n",
|
||||
frame_rx%1024, nr_slot_rx,(ue->dlsch_decoding_stats[proc->thread_id].p_time)/(cpuf*1000.0));
|
||||
printf(" --> Unscrambling for CW0 %5.3f\n",
|
||||
(ue->dlsch_unscrambling_stats.p_time)/(cpuf*1000.0));
|
||||
printf("AbsSubframe %d.%d --> LDPC Decoding for CW0 %5.3f\n",
|
||||
frame_rx%1024, nr_slot_rx,(ue->dlsch_decoding_stats[proc->thread_id].p_time)/(cpuf*1000.0));
|
||||
#else
|
||||
LOG_I(PHY, " --> Unscrambling for CW0 %5.3f\n",
|
||||
(ue->dlsch_unscrambling_stats.p_time)/(cpuf*1000.0));
|
||||
LOG_I(PHY, "AbsSubframe %d.%d --> LDPC Decoding for CW0 %5.3f\n",
|
||||
frame_rx%1024, nr_slot_rx,(ue->dlsch_decoding_stats[proc->thread_id].p_time)/(cpuf*1000.0));
|
||||
LOG_I(PHY, " --> Unscrambling for CW0 %5.3f\n",
|
||||
(ue->dlsch_unscrambling_stats.p_time)/(cpuf*1000.0));
|
||||
LOG_I(PHY, "AbsSubframe %d.%d --> LDPC Decoding for CW0 %5.3f\n",
|
||||
frame_rx%1024, nr_slot_rx,(ue->dlsch_decoding_stats[proc->thread_id].p_time)/(cpuf*1000.0));
|
||||
#endif
|
||||
|
||||
#endif
|
||||
if(is_cw1_active)
|
||||
{
|
||||
// start ldpc decode for CW 1
|
||||
dlsch1->harq_processes[harq_pid]->G = nr_get_G(dlsch1->harq_processes[harq_pid]->nb_rb,
|
||||
nb_symb_sch,
|
||||
nb_re_dmrs,
|
||||
dmrs_len,
|
||||
dlsch1->harq_processes[harq_pid]->Qm,
|
||||
dlsch1->harq_processes[harq_pid]->Nl);
|
||||
if(is_cw1_active) {
|
||||
// start ldpc decode for CW 1
|
||||
dlsch1->harq_processes[harq_pid]->G = nr_get_G(dlsch1->harq_processes[harq_pid]->nb_rb,
|
||||
nb_symb_sch,
|
||||
nb_re_dmrs,
|
||||
dmrs_len,
|
||||
dlsch1->harq_processes[harq_pid]->Qm,
|
||||
dlsch1->harq_processes[harq_pid]->Nl);
|
||||
#if UE_TIMING_TRACE
|
||||
start_meas(&ue->dlsch_unscrambling_stats);
|
||||
start_meas(&ue->dlsch_unscrambling_stats);
|
||||
#endif
|
||||
nr_dlsch_unscrambling(pdsch_vars->llr[1],
|
||||
dlsch1->harq_processes[harq_pid]->G,
|
||||
0,
|
||||
ue->frame_parms.Nid_cell,
|
||||
dlsch1->rnti);
|
||||
nr_dlsch_unscrambling(pdsch_vars->llr[1],
|
||||
dlsch1->harq_processes[harq_pid]->G,
|
||||
0,
|
||||
ue->frame_parms.Nid_cell,
|
||||
dlsch1->rnti);
|
||||
#if UE_TIMING_TRACE
|
||||
stop_meas(&ue->dlsch_unscrambling_stats);
|
||||
stop_meas(&ue->dlsch_unscrambling_stats);
|
||||
#endif
|
||||
|
||||
#if 0
|
||||
@@ -1062,228 +1100,203 @@ void nr_ue_dlsch_procedures(PHY_VARS_NR_UE *ue,
|
||||
#endif
|
||||
|
||||
#if UE_TIMING_TRACE
|
||||
start_meas(&ue->dlsch_decoding_stats[proc->thread_id]);
|
||||
start_meas(&ue->dlsch_decoding_stats[proc->thread_id]);
|
||||
#endif
|
||||
|
||||
if(dlsch_parallel)
|
||||
{
|
||||
ret1 = nr_dlsch_decoding_mthread(ue,
|
||||
proc,
|
||||
gNB_id,
|
||||
pdsch_vars->llr[1],
|
||||
&ue->frame_parms,
|
||||
dlsch1,
|
||||
dlsch1->harq_processes[harq_pid],
|
||||
frame_rx,
|
||||
nb_symb_sch,
|
||||
nr_slot_rx,
|
||||
harq_pid,
|
||||
pdsch==PDSCH?1:0,
|
||||
dlsch1->harq_processes[harq_pid]->TBS>256?1:0);
|
||||
LOG_T(PHY,"CW dlsch decoding is parallelized, ret1 = %d\n", ret1);
|
||||
}
|
||||
else
|
||||
{
|
||||
ret1 = nr_dlsch_decoding(ue,
|
||||
proc,
|
||||
gNB_id,
|
||||
pdsch_vars->llr[1],
|
||||
&ue->frame_parms,
|
||||
dlsch1,
|
||||
dlsch1->harq_processes[harq_pid],
|
||||
frame_rx,
|
||||
nb_symb_sch,
|
||||
nr_slot_rx,
|
||||
harq_pid,
|
||||
pdsch==PDSCH?1:0,//proc->decoder_switch,
|
||||
dlsch1->harq_processes[harq_pid]->TBS>256?1:0);
|
||||
LOG_T(PHY,"CWW sequential dlsch decoding, ret1 = %d\n", ret1);
|
||||
}
|
||||
if(dlsch_parallel) {
|
||||
ret1 = nr_dlsch_decoding_mthread(ue,
|
||||
proc,
|
||||
gNB_id,
|
||||
pdsch_vars->llr[1],
|
||||
&ue->frame_parms,
|
||||
dlsch1,
|
||||
dlsch1->harq_processes[harq_pid],
|
||||
frame_rx,
|
||||
nb_symb_sch,
|
||||
nr_slot_rx,
|
||||
harq_pid,
|
||||
pdsch==PDSCH?1:0,
|
||||
dlsch1->harq_processes[harq_pid]->TBS>256?1:0);
|
||||
LOG_T(PHY,"CW dlsch decoding is parallelized, ret1 = %d\n", ret1);
|
||||
}
|
||||
else {
|
||||
ret1 = nr_dlsch_decoding(ue,
|
||||
proc,
|
||||
gNB_id,
|
||||
pdsch_vars->llr[1],
|
||||
&ue->frame_parms,
|
||||
dlsch1,
|
||||
dlsch1->harq_processes[harq_pid],
|
||||
frame_rx,
|
||||
nb_symb_sch,
|
||||
nr_slot_rx,
|
||||
harq_pid,
|
||||
pdsch==PDSCH?1:0,//proc->decoder_switch,
|
||||
dlsch1->harq_processes[harq_pid]->TBS>256?1:0);
|
||||
LOG_T(PHY,"CWW sequential dlsch decoding, ret1 = %d\n", ret1);
|
||||
}
|
||||
|
||||
#if UE_TIMING_TRACE
|
||||
stop_meas(&ue->dlsch_decoding_stats[proc->thread_id]);
|
||||
stop_meas(&ue->dlsch_decoding_stats[proc->thread_id]);
|
||||
#if DISABLE_LOG_X
|
||||
printf(" --> Unscrambling for CW1 %5.3f\n",
|
||||
(ue->dlsch_unscrambling_stats.p_time)/(cpuf*1000.0));
|
||||
printf("AbsSubframe %d.%d --> ldpc Decoding for CW1 %5.3f\n",
|
||||
frame_rx%1024, nr_slot_rx,(ue->dlsch_decoding_stats[proc->thread_id].p_time)/(cpuf*1000.0));
|
||||
printf(" --> Unscrambling for CW1 %5.3f\n",
|
||||
(ue->dlsch_unscrambling_stats.p_time)/(cpuf*1000.0));
|
||||
printf("AbsSubframe %d.%d --> ldpc Decoding for CW1 %5.3f\n",
|
||||
frame_rx%1024, nr_slot_rx,(ue->dlsch_decoding_stats[proc->thread_id].p_time)/(cpuf*1000.0));
|
||||
#else
|
||||
LOG_D(PHY, " --> Unscrambling for CW1 %5.3f\n",
|
||||
(ue->dlsch_unscrambling_stats.p_time)/(cpuf*1000.0));
|
||||
LOG_D(PHY, "AbsSubframe %d.%d --> ldpc Decoding for CW1 %5.3f\n",
|
||||
frame_rx%1024, nr_slot_rx,(ue->dlsch_decoding_stats[proc->thread_id].p_time)/(cpuf*1000.0));
|
||||
LOG_D(PHY, " --> Unscrambling for CW1 %5.3f\n",
|
||||
(ue->dlsch_unscrambling_stats.p_time)/(cpuf*1000.0));
|
||||
LOG_D(PHY, "AbsSubframe %d.%d --> ldpc Decoding for CW1 %5.3f\n",
|
||||
frame_rx%1024, nr_slot_rx,(ue->dlsch_decoding_stats[proc->thread_id].p_time)/(cpuf*1000.0));
|
||||
#endif
|
||||
|
||||
#endif
|
||||
LOG_I(PHY,"AbsSubframe %d.%d --> ldpc Decoding for CW1 %5.3f\n",
|
||||
frame_rx%1024, nr_slot_rx,(ue->dlsch_decoding_stats[proc->thread_id].p_time)/(cpuf*1000.0));
|
||||
LOG_D(PHY,"AbsSubframe %d.%d --> ldpc Decoding for CW1 %5.3f\n",
|
||||
frame_rx%1024, nr_slot_rx,(ue->dlsch_decoding_stats[proc->thread_id].p_time)/(cpuf*1000.0));
|
||||
|
||||
LOG_D(PHY, "harq_pid: %d, TBS expected dlsch1: %d \n", harq_pid, dlsch1->harq_processes[harq_pid]->TBS);
|
||||
|
||||
LOG_D(PHY, "harq_pid: %d, TBS expected dlsch1: %d \n", harq_pid, dlsch1->harq_processes[harq_pid]->TBS);
|
||||
}
|
||||
|
||||
LOG_D(PHY," ------ end ldpc decoder for AbsSubframe %d.%d ------ decoded in %d \n", frame_rx, nr_slot_rx, ret);
|
||||
|
||||
// send to mac
|
||||
if (ue->if_inst && ue->if_inst->dl_indication) {
|
||||
ue->if_inst->dl_indication(&dl_indication, ul_time_alignment);
|
||||
}
|
||||
|
||||
if (ue->mac_enabled == 1) { // TODO: move this from PHY to MAC layer!
|
||||
|
||||
/* Time Alignment procedure
|
||||
// - UE processing capability 1
|
||||
// - Setting the TA update to be applied after the reception of the TA command
|
||||
// - Timing adjustment computed according to TS 38.213 section 4.2
|
||||
// - Durations of N1 and N2 symbols corresponding to PDSCH and PUSCH are
|
||||
// computed according to sections 5.3 and 6.4 of TS 38.214 */
|
||||
const int numerology = ue->frame_parms.numerology_index;
|
||||
const int ofdm_symbol_size = ue->frame_parms.ofdm_symbol_size;
|
||||
const int nb_prefix_samples = ue->frame_parms.nb_prefix_samples;
|
||||
const int samples_per_subframe = ue->frame_parms.samples_per_subframe;
|
||||
const int slots_per_frame = ue->frame_parms.slots_per_frame;
|
||||
const int slots_per_subframe = ue->frame_parms.slots_per_subframe;
|
||||
|
||||
const double tc_factor = 1.0 / samples_per_subframe;
|
||||
const uint16_t bw_scaling = get_bw_scaling(ofdm_symbol_size);
|
||||
|
||||
const int Ta_max = 3846; // Max value of 12 bits TA Command
|
||||
const double N_TA_max = Ta_max * bw_scaling * tc_factor;
|
||||
|
||||
NR_UE_MAC_INST_t *mac = get_mac_inst(0);
|
||||
|
||||
NR_PUSCH_TimeDomainResourceAllocationList_t *pusch_TimeDomainAllocationList = NULL;
|
||||
if (mac->ULbwp[0] &&
|
||||
mac->ULbwp[0]->bwp_Dedicated &&
|
||||
mac->ULbwp[0]->bwp_Dedicated->pusch_Config &&
|
||||
mac->ULbwp[0]->bwp_Dedicated->pusch_Config->choice.setup &&
|
||||
mac->ULbwp[0]->bwp_Dedicated->pusch_Config->choice.setup->pusch_TimeDomainAllocationList) {
|
||||
pusch_TimeDomainAllocationList = mac->ULbwp[0]->bwp_Dedicated->pusch_Config->choice.setup->pusch_TimeDomainAllocationList->choice.setup;
|
||||
}
|
||||
|
||||
LOG_D(PHY," ------ end ldpc decoder for AbsSubframe %d.%d ------ decoded in %d \n", frame_rx, nr_slot_rx, ret);
|
||||
LOG_D(PHY, "harq_pid: %d, TBS expected dlsch0: %d \n",harq_pid, dlsch0->harq_processes[harq_pid]->TBS);
|
||||
|
||||
if(ret<dlsch0->max_ldpc_iterations+1){
|
||||
|
||||
switch (pdsch) {
|
||||
case RA_PDSCH:
|
||||
nr_fill_dl_indication(&dl_indication, NULL, &rx_ind, proc, ue, gNB_id);
|
||||
nr_fill_rx_indication(&rx_ind, FAPI_NR_RX_PDU_TYPE_RAR, gNB_id, ue, dlsch0, number_pdus);
|
||||
|
||||
ue->UE_mode[gNB_id] = RA_RESPONSE;
|
||||
break;
|
||||
case PDSCH:
|
||||
nr_fill_dl_indication(&dl_indication, NULL, &rx_ind, proc, ue, gNB_id);
|
||||
nr_fill_rx_indication(&rx_ind, FAPI_NR_RX_PDU_TYPE_DLSCH, gNB_id, ue, dlsch0, number_pdus);
|
||||
break;
|
||||
case SI_PDSCH:
|
||||
nr_fill_dl_indication(&dl_indication, NULL, &rx_ind, proc, ue, gNB_id);
|
||||
nr_fill_rx_indication(&rx_ind, FAPI_NR_RX_PDU_TYPE_SIB, gNB_id, ue, dlsch0, number_pdus);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
LOG_D(PHY, "In %s DL PDU length in bits: %d, in bytes: %d \n", __FUNCTION__, dlsch0->harq_processes[harq_pid]->TBS, dlsch0->harq_processes[harq_pid]->TBS / 8);
|
||||
|
||||
// send to mac
|
||||
if (ue->if_inst && ue->if_inst->dl_indication) {
|
||||
ue->if_inst->dl_indication(&dl_indication, ul_time_alignment);
|
||||
}
|
||||
else if (mac->ULbwp[0] &&
|
||||
mac->ULbwp[0]->bwp_Common &&
|
||||
mac->ULbwp[0]->bwp_Common->pusch_ConfigCommon &&
|
||||
mac->ULbwp[0]->bwp_Common->pusch_ConfigCommon->choice.setup &&
|
||||
mac->ULbwp[0]->bwp_Common->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList) {
|
||||
pusch_TimeDomainAllocationList = mac->ULbwp[0]->bwp_Common->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList;
|
||||
}
|
||||
else if (mac->scc_SIB &&
|
||||
mac->scc_SIB->uplinkConfigCommon &&
|
||||
mac->scc_SIB->uplinkConfigCommon->initialUplinkBWP.pusch_ConfigCommon &&
|
||||
mac->scc_SIB->uplinkConfigCommon->initialUplinkBWP.pusch_ConfigCommon->choice.setup &&
|
||||
mac->scc_SIB->uplinkConfigCommon->initialUplinkBWP.pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList) {
|
||||
pusch_TimeDomainAllocationList = mac->scc_SIB->uplinkConfigCommon->initialUplinkBWP.pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList;
|
||||
}
|
||||
long mapping_type_ul = pusch_TimeDomainAllocationList ? pusch_TimeDomainAllocationList->list.array[0]->mappingType : NR_PUSCH_TimeDomainResourceAllocation__mappingType_typeA;
|
||||
|
||||
if (ue->mac_enabled == 1) { // TODO: move this from PHY to MAC layer!
|
||||
NR_PDSCH_Config_t *pdsch_Config = (mac->DLbwp[0] && mac->DLbwp[0]->bwp_Dedicated->pdsch_Config->choice.setup) ? mac->DLbwp[0]->bwp_Dedicated->pdsch_Config->choice.setup : NULL;
|
||||
NR_PDSCH_TimeDomainResourceAllocationList_t *pdsch_TimeDomainAllocationList = NULL;
|
||||
if (mac->DLbwp[0] && mac->DLbwp[0]->bwp_Dedicated->pdsch_Config->choice.setup->pdsch_TimeDomainAllocationList)
|
||||
pdsch_TimeDomainAllocationList = pdsch_Config->pdsch_TimeDomainAllocationList->choice.setup;
|
||||
else if (mac->DLbwp[0] && mac->DLbwp[0]->bwp_Common->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList)
|
||||
pdsch_TimeDomainAllocationList = mac->DLbwp[0]->bwp_Common->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList;
|
||||
else if (mac->scc_SIB && mac->scc_SIB->downlinkConfigCommon.initialDownlinkBWP.pdsch_ConfigCommon->choice.setup)
|
||||
pdsch_TimeDomainAllocationList = mac->scc_SIB->downlinkConfigCommon.initialDownlinkBWP.pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList;
|
||||
long mapping_type_dl = pdsch_TimeDomainAllocationList ? pdsch_TimeDomainAllocationList->list.array[0]->mappingType : NR_PDSCH_TimeDomainResourceAllocation__mappingType_typeA;
|
||||
|
||||
/* Time Alignment procedure
|
||||
// - UE processing capability 1
|
||||
// - Setting the TA update to be applied after the reception of the TA command
|
||||
// - Timing adjustment computed according to TS 38.213 section 4.2
|
||||
// - Durations of N1 and N2 symbols corresponding to PDSCH and PUSCH are
|
||||
// computed according to sections 5.3 and 6.4 of TS 38.214 */
|
||||
const int numerology = ue->frame_parms.numerology_index;
|
||||
const int ofdm_symbol_size = ue->frame_parms.ofdm_symbol_size;
|
||||
const int nb_prefix_samples = ue->frame_parms.nb_prefix_samples;
|
||||
const int samples_per_subframe = ue->frame_parms.samples_per_subframe;
|
||||
const int slots_per_frame = ue->frame_parms.slots_per_frame;
|
||||
const int slots_per_subframe = ue->frame_parms.slots_per_subframe;
|
||||
|
||||
const double tc_factor = 1.0 / samples_per_subframe;
|
||||
const uint16_t bw_scaling = get_bw_scaling(ofdm_symbol_size);
|
||||
|
||||
const int Ta_max = 3846; // Max value of 12 bits TA Command
|
||||
const double N_TA_max = Ta_max * bw_scaling * tc_factor;
|
||||
|
||||
NR_UE_MAC_INST_t *mac = get_mac_inst(0);
|
||||
|
||||
NR_PUSCH_TimeDomainResourceAllocationList_t *pusch_TimeDomainAllocationList = NULL;
|
||||
if (mac->ULbwp[0] &&
|
||||
mac->ULbwp[0]->bwp_Dedicated &&
|
||||
mac->ULbwp[0]->bwp_Dedicated->pusch_Config &&
|
||||
mac->ULbwp[0]->bwp_Dedicated->pusch_Config->choice.setup &&
|
||||
mac->ULbwp[0]->bwp_Dedicated->pusch_Config->choice.setup->pusch_TimeDomainAllocationList) {
|
||||
pusch_TimeDomainAllocationList = mac->ULbwp[0]->bwp_Dedicated->pusch_Config->choice.setup->pusch_TimeDomainAllocationList->choice.setup;
|
||||
}
|
||||
else if (mac->ULbwp[0] &&
|
||||
mac->ULbwp[0]->bwp_Common &&
|
||||
mac->ULbwp[0]->bwp_Common->pusch_ConfigCommon &&
|
||||
mac->ULbwp[0]->bwp_Common->pusch_ConfigCommon->choice.setup &&
|
||||
mac->ULbwp[0]->bwp_Common->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList) {
|
||||
pusch_TimeDomainAllocationList = mac->ULbwp[0]->bwp_Common->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList;
|
||||
}
|
||||
else if (mac->scc_SIB &&
|
||||
mac->scc_SIB->uplinkConfigCommon &&
|
||||
mac->scc_SIB->uplinkConfigCommon->initialUplinkBWP.pusch_ConfigCommon &&
|
||||
mac->scc_SIB->uplinkConfigCommon->initialUplinkBWP.pusch_ConfigCommon->choice.setup &&
|
||||
mac->scc_SIB->uplinkConfigCommon->initialUplinkBWP.pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList) {
|
||||
pusch_TimeDomainAllocationList = mac->scc_SIB->uplinkConfigCommon->initialUplinkBWP.pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList;
|
||||
}
|
||||
long mapping_type_ul = pusch_TimeDomainAllocationList ? pusch_TimeDomainAllocationList->list.array[0]->mappingType : NR_PUSCH_TimeDomainResourceAllocation__mappingType_typeA;
|
||||
|
||||
NR_PDSCH_Config_t *pdsch_Config = (mac->DLbwp[0] && mac->DLbwp[0]->bwp_Dedicated->pdsch_Config->choice.setup) ? mac->DLbwp[0]->bwp_Dedicated->pdsch_Config->choice.setup : NULL;
|
||||
NR_PDSCH_TimeDomainResourceAllocationList_t *pdsch_TimeDomainAllocationList = NULL;
|
||||
if (mac->DLbwp[0] && mac->DLbwp[0]->bwp_Dedicated->pdsch_Config->choice.setup->pdsch_TimeDomainAllocationList)
|
||||
pdsch_TimeDomainAllocationList = pdsch_Config->pdsch_TimeDomainAllocationList->choice.setup;
|
||||
else if (mac->DLbwp[0] && mac->DLbwp[0]->bwp_Common->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList)
|
||||
pdsch_TimeDomainAllocationList = mac->DLbwp[0]->bwp_Common->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList;
|
||||
else if (mac->scc_SIB && mac->scc_SIB->downlinkConfigCommon.initialDownlinkBWP.pdsch_ConfigCommon->choice.setup)
|
||||
pdsch_TimeDomainAllocationList = mac->scc_SIB->downlinkConfigCommon.initialDownlinkBWP.pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList;
|
||||
long mapping_type_dl = pdsch_TimeDomainAllocationList ? pdsch_TimeDomainAllocationList->list.array[0]->mappingType : NR_PDSCH_TimeDomainResourceAllocation__mappingType_typeA;
|
||||
|
||||
NR_DMRS_DownlinkConfig_t *NR_DMRS_dlconfig = NULL;
|
||||
if (pdsch_Config) {
|
||||
if (mapping_type_dl == NR_PDSCH_TimeDomainResourceAllocation__mappingType_typeA)
|
||||
NR_DMRS_dlconfig = (NR_DMRS_DownlinkConfig_t *)pdsch_Config->dmrs_DownlinkForPDSCH_MappingTypeA->choice.setup;
|
||||
else
|
||||
NR_DMRS_dlconfig = (NR_DMRS_DownlinkConfig_t *)pdsch_Config->dmrs_DownlinkForPDSCH_MappingTypeB->choice.setup;
|
||||
}
|
||||
|
||||
pdsch_dmrs_AdditionalPosition_t add_pos_dl = pdsch_dmrs_pos2;
|
||||
if (NR_DMRS_dlconfig && NR_DMRS_dlconfig->dmrs_AdditionalPosition)
|
||||
add_pos_dl = *NR_DMRS_dlconfig->dmrs_AdditionalPosition;
|
||||
|
||||
/* PDSCH decoding time N_1 for processing capability 1 */
|
||||
int N_1;
|
||||
|
||||
if (add_pos_dl == pdsch_dmrs_pos0)
|
||||
N_1 = pdsch_N_1_capability_1[numerology][1];
|
||||
else if (add_pos_dl == pdsch_dmrs_pos1 || add_pos_dl == pdsch_dmrs_pos2)
|
||||
N_1 = pdsch_N_1_capability_1[numerology][2];
|
||||
else
|
||||
N_1 = pdsch_N_1_capability_1[numerology][3];
|
||||
|
||||
/* PUSCH preapration time N_2 for processing capability 1 */
|
||||
const int N_2 = pusch_N_2_timing_capability_1[numerology][1];
|
||||
|
||||
/* d_1_1 depending on the number of PDSCH symbols allocated */
|
||||
const int d = 0; // TODO number of overlapping symbols of the scheduling PDCCH and the scheduled PDSCH
|
||||
int d_1_1 = 0;
|
||||
NR_DMRS_DownlinkConfig_t *NR_DMRS_dlconfig = NULL;
|
||||
if (pdsch_Config) {
|
||||
if (mapping_type_dl == NR_PDSCH_TimeDomainResourceAllocation__mappingType_typeA)
|
||||
if (nb_symb_sch + start_symbol < 7)
|
||||
d_1_1 = 7 - (nb_symb_sch + start_symbol);
|
||||
else
|
||||
d_1_1 = 0;
|
||||
else // mapping type B
|
||||
switch (nb_symb_sch){
|
||||
case 7: d_1_1 = 0; break;
|
||||
case 4: d_1_1 = 3; break;
|
||||
case 2: d_1_1 = 3 + d; break;
|
||||
default: break;
|
||||
}
|
||||
|
||||
/* d_2_1 */
|
||||
int d_2_1;
|
||||
if (mapping_type_ul == NR_PUSCH_TimeDomainResourceAllocation__mappingType_typeB && start_symbol != 0)
|
||||
d_2_1 = 0;
|
||||
NR_DMRS_dlconfig = (NR_DMRS_DownlinkConfig_t *)pdsch_Config->dmrs_DownlinkForPDSCH_MappingTypeA->choice.setup;
|
||||
else
|
||||
d_2_1 = 1;
|
||||
|
||||
/* d_2_2 */
|
||||
const double d_2_2 = 0.0; // set to 0 because there is only 1 BWP: TODO this should corresponds to the switching time as defined in TS 38.133
|
||||
|
||||
/* N_t_1 time duration in msec of N_1 symbols corresponding to a PDSCH reception time
|
||||
// N_t_2 time duration in msec of N_2 symbols corresponding to a PUSCH preparation time */
|
||||
double N_t_1 = (N_1 + d_1_1) * (ofdm_symbol_size + nb_prefix_samples) * tc_factor;
|
||||
double N_t_2 = (N_2 + d_2_1) * (ofdm_symbol_size + nb_prefix_samples) * tc_factor;
|
||||
if (N_t_2 < d_2_2) N_t_2 = d_2_2;
|
||||
|
||||
/* Time alignment procedure */
|
||||
// N_t_1 + N_t_2 + N_TA_max must be in msec
|
||||
const double t_subframe = 1.0; // subframe duration of 1 msec
|
||||
const int ul_tx_timing_adjustment = 1 + (int)ceil(slots_per_subframe*(N_t_1 + N_t_2 + N_TA_max + 0.5)/t_subframe);
|
||||
|
||||
if (ul_time_alignment->apply_ta == 1){
|
||||
ul_time_alignment->ta_slot = (nr_slot_rx + ul_tx_timing_adjustment) % slots_per_frame;
|
||||
if (nr_slot_rx + ul_tx_timing_adjustment > slots_per_frame){
|
||||
ul_time_alignment->ta_frame = (frame_rx + 1) % 1024;
|
||||
} else {
|
||||
ul_time_alignment->ta_frame = frame_rx;
|
||||
}
|
||||
// reset TA flag
|
||||
ul_time_alignment->apply_ta = 0;
|
||||
LOG_D(PHY,"Frame %d slot %d -- Starting UL time alignment procedures. TA update will be applied at frame %d slot %d\n", frame_rx, nr_slot_rx, ul_time_alignment->ta_frame, ul_time_alignment->ta_slot);
|
||||
}
|
||||
NR_DMRS_dlconfig = (NR_DMRS_DownlinkConfig_t *)pdsch_Config->dmrs_DownlinkForPDSCH_MappingTypeB->choice.setup;
|
||||
}
|
||||
|
||||
pdsch_dmrs_AdditionalPosition_t add_pos_dl = pdsch_dmrs_pos2;
|
||||
if (NR_DMRS_dlconfig && NR_DMRS_dlconfig->dmrs_AdditionalPosition)
|
||||
add_pos_dl = *NR_DMRS_dlconfig->dmrs_AdditionalPosition;
|
||||
|
||||
/* PDSCH decoding time N_1 for processing capability 1 */
|
||||
int N_1;
|
||||
|
||||
if (add_pos_dl == pdsch_dmrs_pos0)
|
||||
N_1 = pdsch_N_1_capability_1[numerology][1];
|
||||
else if (add_pos_dl == pdsch_dmrs_pos1 || add_pos_dl == pdsch_dmrs_pos2)
|
||||
N_1 = pdsch_N_1_capability_1[numerology][2];
|
||||
else
|
||||
N_1 = pdsch_N_1_capability_1[numerology][3];
|
||||
|
||||
/* PUSCH preapration time N_2 for processing capability 1 */
|
||||
const int N_2 = pusch_N_2_timing_capability_1[numerology][1];
|
||||
|
||||
/* d_1_1 depending on the number of PDSCH symbols allocated */
|
||||
const int d = 0; // TODO number of overlapping symbols of the scheduling PDCCH and the scheduled PDSCH
|
||||
int d_1_1 = 0;
|
||||
if (mapping_type_dl == NR_PDSCH_TimeDomainResourceAllocation__mappingType_typeA)
|
||||
if (nb_symb_sch + start_symbol < 7)
|
||||
d_1_1 = 7 - (nb_symb_sch + start_symbol);
|
||||
else
|
||||
d_1_1 = 0;
|
||||
else // mapping type B
|
||||
switch (nb_symb_sch){
|
||||
case 7: d_1_1 = 0; break;
|
||||
case 4: d_1_1 = 3; break;
|
||||
case 2: d_1_1 = 3 + d; break;
|
||||
default: break;
|
||||
}
|
||||
|
||||
/* d_2_1 */
|
||||
int d_2_1;
|
||||
if (mapping_type_ul == NR_PUSCH_TimeDomainResourceAllocation__mappingType_typeB && start_symbol != 0)
|
||||
d_2_1 = 0;
|
||||
else
|
||||
d_2_1 = 1;
|
||||
|
||||
/* d_2_2 */
|
||||
const double d_2_2 = 0.0; // set to 0 because there is only 1 BWP: TODO this should corresponds to the switching time as defined in TS 38.133
|
||||
|
||||
/* N_t_1 time duration in msec of N_1 symbols corresponding to a PDSCH reception time
|
||||
// N_t_2 time duration in msec of N_2 symbols corresponding to a PUSCH preparation time */
|
||||
double N_t_1 = (N_1 + d_1_1) * (ofdm_symbol_size + nb_prefix_samples) * tc_factor;
|
||||
double N_t_2 = (N_2 + d_2_1) * (ofdm_symbol_size + nb_prefix_samples) * tc_factor;
|
||||
if (N_t_2 < d_2_2) N_t_2 = d_2_2;
|
||||
|
||||
/* Time alignment procedure */
|
||||
// N_t_1 + N_t_2 + N_TA_max must be in msec
|
||||
const double t_subframe = 1.0; // subframe duration of 1 msec
|
||||
const int ul_tx_timing_adjustment = 1 + (int)ceil(slots_per_subframe*(N_t_1 + N_t_2 + N_TA_max + 0.5)/t_subframe);
|
||||
|
||||
if (ul_time_alignment->apply_ta == 1){
|
||||
ul_time_alignment->ta_slot = (nr_slot_rx + ul_tx_timing_adjustment) % slots_per_frame;
|
||||
if (nr_slot_rx + ul_tx_timing_adjustment > slots_per_frame){
|
||||
ul_time_alignment->ta_frame = (frame_rx + 1) % 1024;
|
||||
} else {
|
||||
ul_time_alignment->ta_frame = frame_rx;
|
||||
}
|
||||
// reset TA flag
|
||||
ul_time_alignment->apply_ta = 0;
|
||||
LOG_D(PHY,"Frame %d slot %d -- Starting UL time alignment procedures. TA update will be applied at frame %d slot %d\n",
|
||||
frame_rx, nr_slot_rx, ul_time_alignment->ta_frame, ul_time_alignment->ta_slot);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1811,6 +1824,7 @@ int phy_procedures_nrUE_RX(PHY_VARS_NR_UE *ue,
|
||||
nr_rxtx_thread_data_t *curMsg=(nr_rxtx_thread_data_t *)NotifiedFifoData(newElt);
|
||||
curMsg->proc = *proc;
|
||||
curMsg->UE = ue;
|
||||
curMsg->ue_sched_mode = ONLY_PUSCH;
|
||||
pushTpool(&(get_nrUE_params()->Tpool), newElt);
|
||||
|
||||
#if UE_TIMING_TRACE
|
||||
@@ -1819,13 +1833,14 @@ int phy_procedures_nrUE_RX(PHY_VARS_NR_UE *ue,
|
||||
// do procedures for C-RNTI
|
||||
int ret_pdsch = 0;
|
||||
if (ue->dlsch[proc->thread_id][gNB_id][0]->active == 1) {
|
||||
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PDSCH_PROC_C, VCD_FUNCTION_IN);
|
||||
ret_pdsch = nr_ue_pdsch_procedures(ue,
|
||||
proc,
|
||||
gNB_id,
|
||||
PDSCH,
|
||||
ue->dlsch[proc->thread_id][gNB_id][0],
|
||||
NULL);
|
||||
proc,
|
||||
gNB_id,
|
||||
PDSCH,
|
||||
ue->dlsch[proc->thread_id][gNB_id][0],
|
||||
NULL);
|
||||
|
||||
nr_ue_measurement_procedures(2, ue, proc, gNB_id, nr_slot_rx);
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PDSCH_PROC_C, VCD_FUNCTION_OUT);
|
||||
|
||||
@@ -1,220 +0,0 @@
|
||||
/*
|
||||
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The OpenAirInterface Software Alliance licenses this file to You under
|
||||
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
|
||||
* except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.openairinterface.org/?page_id=698
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*-------------------------------------------------------------------------------
|
||||
* For more information about the OpenAirInterface (OAI) Software Alliance:
|
||||
* contact@openairinterface.org
|
||||
*/
|
||||
|
||||
/************************************************************************
|
||||
*
|
||||
* MODULE : PUCCH power control for UE NR
|
||||
*
|
||||
* DESCRIPTION : functions related to PUCCH Transmit power
|
||||
* TS 38.213 7.2.1 UE behaviour
|
||||
*
|
||||
**************************************************************************/
|
||||
|
||||
#include "PHY/NR_REFSIG/ss_pbch_nr.h"
|
||||
#include "PHY/defs_nr_UE.h"
|
||||
#include "SCHED_NR_UE/pucch_uci_ue_nr.h"
|
||||
#include "SCHED_NR_UE/pucch_power_control_ue_nr.h"
|
||||
#include <openair1/PHY/LTE_ESTIMATION/lte_estimation.h>
|
||||
#include <openair1/PHY/NR_UE_ESTIMATION/nr_estimation.h>
|
||||
|
||||
/**************** defines **************************************/
|
||||
|
||||
/**************** variables **************************************/
|
||||
|
||||
|
||||
/**************** functions **************************************/
|
||||
|
||||
|
||||
/*******************************************************************
|
||||
*
|
||||
* NAME : get_pucch_tx_power_ue
|
||||
*
|
||||
* PARAMETERS : ue context
|
||||
* gNB_id identity
|
||||
* slots for rx and tx
|
||||
* pucch_format_nr_t pucch format
|
||||
* nb_of_prbs number of prb allocated to pucch
|
||||
* N_sc_ctrl_RB subcarrier control rb related to current pucch format
|
||||
* N_symb_PUCCH number of pucch symbols excluding those reserved for dmrs
|
||||
* O_UCI number of bits for UCI Uplink Control Information
|
||||
* O_SR number of bits for SR scheduling Request
|
||||
* O_UCI number of bits for CSI Channel State Information
|
||||
* O_ACK number of bits for HARQ-ACK
|
||||
* O_CRC number of bits for CRC
|
||||
* n_HARQ_ACK use for obtaining a PUCCH transmission power
|
||||
*
|
||||
* RETURN : pucch power level in dBm
|
||||
*
|
||||
* DESCRIPTION : determines pucch transmission power in dBm
|
||||
* TS 38.213 7.2.1 UE behaviour
|
||||
*
|
||||
*********************************************************************/
|
||||
|
||||
int16_t get_pucch_tx_power_ue(PHY_VARS_NR_UE *ue,
|
||||
uint8_t gNB_id,
|
||||
UE_nr_rxtx_proc_t *proc,
|
||||
pucch_format_nr_t pucch_format,
|
||||
int nb_of_prbs,
|
||||
int N_sc_ctrl_RB,
|
||||
int N_symb_PUCCH,
|
||||
int O_UCI,
|
||||
int O_SR,
|
||||
int O_CSI,
|
||||
int O_ACK,
|
||||
int O_CRC,
|
||||
int n_HARQ_ACK) {
|
||||
|
||||
int16_t P_O_NOMINAL_PUCCH = ue->pucch_config_common_nr[gNB_id].p0_nominal;
|
||||
PUCCH_PowerControl_t *power_config = &ue->pucch_config_dedicated_nr[gNB_id].pucch_PowerControl;
|
||||
int16_t P_O_UE_PUCCH;
|
||||
int16_t G_b_f_c = 0;
|
||||
|
||||
if (ue->pucch_config_dedicated_nr[gNB_id].spatial_Relation_Info[0] != NULL) { /* FFS TODO NR */
|
||||
LOG_E(PHY,"PUCCH Spatial relation infos are not yet implemented : at line %d in function %s of file %s \n", LINE_FILE , __func__, __FILE__);
|
||||
return (PUCCH_POWER_DEFAULT);
|
||||
}
|
||||
|
||||
if (power_config->p0_Set[0] != NULL) {
|
||||
P_O_UE_PUCCH = power_config->p0_Set[0]->p0_PUCCH_Value; /* get from index 0 if no spatial relation set */
|
||||
G_b_f_c = 0;
|
||||
}
|
||||
else {
|
||||
G_b_f_c = ue->dlsch[proc->thread_id][gNB_id][0]->g_pucch;
|
||||
LOG_D(PHY,"PUCCH Transmit power control command not yet implemented for NR : at line %d in function %s of file %s \n", LINE_FILE , __func__, __FILE__);
|
||||
return (PUCCH_POWER_DEFAULT);
|
||||
}
|
||||
|
||||
int P_O_PUCCH = P_O_NOMINAL_PUCCH + P_O_UE_PUCCH;
|
||||
|
||||
int16_t PL = get_nr_PL(ue->Mod_id, ue->CC_id, gNB_id); /* LTE function because NR path loss not yet implemented FFS TODO NR */
|
||||
|
||||
int16_t delta_F_PUCCH = power_config->deltaF_PUCCH_f[pucch_format];
|
||||
|
||||
int DELTA_TF;
|
||||
uint16_t N_ref_PUCCH;
|
||||
|
||||
/* computing of pucch transmission power adjustment */
|
||||
switch (pucch_format) {
|
||||
case pucch_format0_nr:
|
||||
{
|
||||
N_ref_PUCCH = 2;
|
||||
DELTA_TF = 10 * log10(N_ref_PUCCH/N_symb_PUCCH);
|
||||
break;
|
||||
}
|
||||
case pucch_format1_nr:
|
||||
{
|
||||
N_ref_PUCCH = N_SYMB_SLOT;
|
||||
DELTA_TF = 10 * log10(N_ref_PUCCH/N_symb_PUCCH);
|
||||
break;
|
||||
}
|
||||
case pucch_format2_nr:
|
||||
case pucch_format3_nr:
|
||||
case pucch_format4_nr:
|
||||
{
|
||||
float N_RE = nb_of_prbs * N_sc_ctrl_RB * N_symb_PUCCH;
|
||||
float K1 = 6;
|
||||
/* initial phase so no higher layer parameters */
|
||||
if (ue->UE_mode[gNB_id] != PUSCH) {
|
||||
if (O_ACK == 0) {
|
||||
n_HARQ_ACK = 0;
|
||||
}
|
||||
else {
|
||||
n_HARQ_ACK = 1;
|
||||
}
|
||||
}
|
||||
if (O_UCI < 12) {
|
||||
|
||||
DELTA_TF = 10 * log10((double)(((K1 * (n_HARQ_ACK + O_SR + O_CSI))/N_RE)));
|
||||
}
|
||||
else {
|
||||
float K2 = 2.4;
|
||||
float BPRE = (O_ACK + O_SR + O_CSI + O_CRC)/N_RE;
|
||||
DELTA_TF = 10 * log10((double)(pow(2,(K2*BPRE)) - 1));
|
||||
}
|
||||
break;
|
||||
}
|
||||
default:
|
||||
{
|
||||
LOG_E(PHY,"PUCCH unknown pucch format : at line %d in function %s of file %s \n", LINE_FILE , __func__, __FILE__);
|
||||
return (0);
|
||||
}
|
||||
}
|
||||
|
||||
if (power_config->twoPUCCH_PC_AdjustmentStates > 1) {
|
||||
LOG_E(PHY,"PUCCH power control adjustment states with 2 states not yet implemented : at line %d in function %s of file %s \n", LINE_FILE , __func__, __FILE__);
|
||||
return (PUCCH_POWER_DEFAULT);
|
||||
}
|
||||
|
||||
#if 0
|
||||
int k2;
|
||||
|
||||
/* response to a detection by the UE of a DCI format 1_0 or DCI format 1_1 */
|
||||
//int K_PUCCH = 0;
|
||||
if (O_ACK != 0) {
|
||||
/* it assumes that PDCCH is in the first symbol of receive slot FFS TDDO NR */
|
||||
//int slots_gap = (proc->nr_slot_tx > proc->nr_slot_rx ? (proc->nr_slot_tx - proc->nr_slot_rx - 1) : ((proc->nr_slot_tx + ue->frame_parms.slots_per_subframe) - proc->nr_slot_rx - 1));
|
||||
//K_PUCCH = (slots_gap * (ue->frame_parms.symbols_per_tti)) - 1;
|
||||
}
|
||||
else {
|
||||
/* field k2 is not present - to check k2 of pucch from upper layer FFS TDDO NR */
|
||||
if (ue->pusch_config.pusch_TimeDomainResourceAllocation[0] == NULL) {
|
||||
if (ue->frame_parms.numerology_index == 0) {
|
||||
k2 = 1;
|
||||
}
|
||||
else {
|
||||
k2 = ue->frame_parms.numerology_index;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
/* get minimum value of k2 */
|
||||
int i = 0;
|
||||
int k2_min = 32; /* max value of k2 */
|
||||
do {
|
||||
k2 = ue->pusch_config.pusch_TimeDomainResourceAllocation[i]->k2;
|
||||
if (k2 < k2_min) {
|
||||
k2_min = k2;
|
||||
}
|
||||
i++;
|
||||
if (i >= MAX_NR_OF_UL_ALLOCATIONS) {
|
||||
break;
|
||||
}
|
||||
} while(ue->pusch_config.pusch_TimeDomainResourceAllocation[i] != NULL);
|
||||
k2 = k2_min;
|
||||
}
|
||||
//K_PUCCH = N_SYMB_SLOT * k2; /* the product of a number of symbols per slot and the minimum of the values provided by higher layer parameter k2 */
|
||||
}
|
||||
#endif
|
||||
|
||||
int contributor = (10 * log10((double)(pow(2,(ue->frame_parms.numerology_index)) * nb_of_prbs)));
|
||||
|
||||
int16_t pucch_power = P_O_PUCCH + contributor + PL + delta_F_PUCCH + DELTA_TF + G_b_f_c;
|
||||
|
||||
if (pucch_power > ue->tx_power_max_dBm) {
|
||||
pucch_power = ue->tx_power_max_dBm;
|
||||
}
|
||||
|
||||
NR_TST_PHY_PRINTF("PUCCH ( Tx power : %d dBm ) ( 10Log(...) : %d ) ( from Path Loss : %d ) ( delta_F_PUCCH : %d ) ( DELTA_TF : %d ) ( G_b_f_c : %d ) \n",
|
||||
pucch_power, contributor, PL, delta_F_PUCCH, DELTA_TF, G_b_f_c);
|
||||
|
||||
return (pucch_power);
|
||||
}
|
||||
|
||||
@@ -1,65 +0,0 @@
|
||||
/*
|
||||
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The OpenAirInterface Software Alliance licenses this file to You under
|
||||
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
|
||||
* except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.openairinterface.org/?page_id=698
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*-------------------------------------------------------------------------------
|
||||
* For more information about the OpenAirInterface (OAI) Software Alliance:
|
||||
* contact@openairinterface.org
|
||||
*/
|
||||
|
||||
/************************************************************************
|
||||
*
|
||||
* MODULE : PUCCH power control for UE NR
|
||||
*
|
||||
* DESCRIPTION : functions related to PUCCH Transmit power
|
||||
* TS 38.213 7.2.1 UE behaviour
|
||||
*
|
||||
**************************************************************************/
|
||||
|
||||
#ifndef PUCCH_POWER_CONTROL_H
|
||||
#define PUCCH_POWER_CONTROL_H
|
||||
|
||||
/*************** INCLUDE *******************************************/
|
||||
|
||||
/*************** DEFINE ********************************************/
|
||||
|
||||
#define PUCCH_POWER_DEFAULT (0) /* in dBm */
|
||||
|
||||
/*************** VARIABLES *****************************************/
|
||||
|
||||
/*************** FUNCTIONS *****************************************/
|
||||
|
||||
|
||||
/** \brief This function returns pucch power level in dBm
|
||||
@param ue context
|
||||
@param gNB_id identity
|
||||
@param slots for rx and tx
|
||||
@param pucch_format_nr_t pucch format
|
||||
@param nb_of_prbs number of prb allocated to pucch
|
||||
@param N_sc_ctrl_RB subcarrier control rb related to current pucch format
|
||||
@param N_symb_PUCCH number of pucch symbols excluding those reserved for dmrs
|
||||
@param O_UCI number of bits for UCI Uplink Control Information
|
||||
@param O_SR number of bits for SR scheduling Request
|
||||
@param int O_UCI number of bits for CSI Channel State Information
|
||||
@param O_ACK number of bits for HARQ-ACK
|
||||
@param O_CRC number of bits for CRC
|
||||
@param n_HARQ_ACK use for obtaining a PUCCH transmission power
|
||||
@returns pucch power level in dBm */
|
||||
|
||||
int16_t get_pucch_tx_power_ue(PHY_VARS_NR_UE *ue, uint8_t gNB_id, UE_nr_rxtx_proc_t *proc, pucch_format_nr_t pucch_format,
|
||||
int nb_of_prbs, int N_sc_ctrl_RB, int N_symb_PUCCH, int O_UCI, int O_SR, int O_CSI, int O_ACK,
|
||||
int O_CRC, int n_HARQ_ACK);
|
||||
|
||||
#endif /* PUCCH_POWER_CONTROL_H */
|
||||
File diff suppressed because it is too large
Load Diff
@@ -58,51 +58,12 @@
|
||||
#define BITS_PER_SYMBOL_BPSK (1) /* 1 bit per symbol for bpsk modulation */
|
||||
#define BITS_PER_SYMBOL_QPSK (2) /* 2 bits per symbol for bpsk modulation */
|
||||
|
||||
/************** VARIABLES *****************************************/
|
||||
|
||||
#define NB_SYMBOL_MINUS_FOUR (11)
|
||||
#define I_PUCCH_NO_ADDITIONAL_DMRS (0)
|
||||
#define I_PUCCH_ADDITIONAL_DMRS (1)
|
||||
#define I_PUCCH_NO_HOPPING (0)
|
||||
#define I_PUCCH_HOPING (1)
|
||||
|
||||
|
||||
/*************** FUNCTIONS ****************************************/
|
||||
|
||||
bool pucch_procedures_ue_nr(PHY_VARS_NR_UE *ue, uint8_t gNB_id, UE_nr_rxtx_proc_t *proc, bool reset_harq);
|
||||
|
||||
/** \brief This function return number of downlink acknowledgement and its bitmap
|
||||
@param ue context
|
||||
@param gNB_id identity
|
||||
@param slots for rx and tx
|
||||
@param o_ACK HARQ-ACK information bits
|
||||
@param n_HARQ_ACK use for obtaining a PUCCH transmission power
|
||||
@param do_reset reset downlink HARQ context
|
||||
@returns number of bits of o_ACK */
|
||||
|
||||
uint8_t get_downlink_ack(PHY_VARS_NR_UE *ue, uint8_t gNB_id, UE_nr_rxtx_proc_t *proc, uint32_t *o_ACK,
|
||||
int *n_HARQ_ACK, bool do_reset);
|
||||
|
||||
/** \brief This function selects a pucch resource
|
||||
@param ue context
|
||||
@param gNB_id identity
|
||||
@param uci size number of uci bits
|
||||
@param pucch_resource_indicator is from downlink DCI
|
||||
@param initial_pucch_id pucch resource id for initial phase
|
||||
@param resource_set_id pucch resource set if any
|
||||
@param resource_id pucch resource id if any
|
||||
@returns TRUE a pucch resource has been found FALSE no valid pucch resource */
|
||||
|
||||
boolean_t select_pucch_resource(PHY_VARS_NR_UE *ue, NR_UE_MAC_INST_t *mac, uint8_t gNB_id, int uci_size, int pucch_resource_indicator,
|
||||
int *initial_pucch_id, int *resource_set_id, int *resource_id, NR_UE_HARQ_STATUS_t *harq_status);
|
||||
|
||||
/** \brief This function select a pucch resource set
|
||||
@param ue context
|
||||
@param gNB_id identity
|
||||
@param uci size number of uci bits
|
||||
@returns number of the pucch resource set */
|
||||
|
||||
int find_pucch_resource_set(NR_UE_MAC_INST_t *mac, uint8_t gNB_id, int uci_size);
|
||||
void pucch_procedures_ue_nr(PHY_VARS_NR_UE *ue,
|
||||
uint8_t gNB_id,
|
||||
UE_nr_rxtx_proc_t *proc);
|
||||
|
||||
/** \brief This function check pucch format
|
||||
@param ue context
|
||||
@@ -115,14 +76,6 @@ int find_pucch_resource_set(NR_UE_MAC_INST_t *mac, uint8_t gNB_id, int uci_size)
|
||||
boolean_t check_pucch_format(NR_UE_MAC_INST_t *mac, uint8_t gNB_id, pucch_format_nr_t format_pucch, int nb_symbols_for_tx,
|
||||
int uci_size);
|
||||
|
||||
/** \brief This function selects a pucch resource
|
||||
@param ue context
|
||||
@param gNB_id identity
|
||||
@param slots for rx and tx
|
||||
@returns TRUE a scheduling request is triggered */
|
||||
|
||||
int trigger_periodic_scheduling_request(PHY_VARS_NR_UE *ue, uint8_t gNB_id, UE_nr_rxtx_proc_t *proc);
|
||||
|
||||
/** \brief This function reads current CSI
|
||||
@param ue context
|
||||
@param gNB_id identity
|
||||
|
||||
@@ -758,7 +758,7 @@ int main(int argc, char **argv)
|
||||
|
||||
prepare_scd(scd);
|
||||
|
||||
fill_default_secondaryCellGroup(scc, scd, secondaryCellGroup, 0, 1, n_tx, 0, 0);
|
||||
fill_default_secondaryCellGroup(scc, scd, secondaryCellGroup, 0, 1, n_tx, 0, 0, 0);
|
||||
|
||||
/* RRC parameter validation for secondaryCellGroup */
|
||||
fix_scd(scd);
|
||||
@@ -1003,12 +1003,12 @@ int main(int argc, char **argv)
|
||||
NR_gNB_DLSCH_t *gNB_dlsch = gNB->dlsch[0][0];
|
||||
nfapi_nr_dl_tti_pdsch_pdu_rel15_t *rel15 = &gNB_dlsch->harq_process.pdsch_pdu.pdsch_pdu_rel15;
|
||||
|
||||
UE_harq_process->harq_ack.ack = 0;
|
||||
UE_harq_process->ack = 0;
|
||||
round = 0;
|
||||
UE_harq_process->round = round;
|
||||
UE_harq_process->first_tx = 1;
|
||||
|
||||
while ((round<num_rounds) && (UE_harq_process->harq_ack.ack==0)) {
|
||||
while ((round<num_rounds) && (UE_harq_process->ack==0)) {
|
||||
memset(RC.nrmac[0]->cce_list[1][0],0,MAX_NUM_CCE*sizeof(int));
|
||||
memset(RC.nrmac[0]->cce_list[1][1],0,MAX_NUM_CCE*sizeof(int));
|
||||
clear_nr_nfapi_information(RC.nrmac[0], 0, frame, slot);
|
||||
@@ -1242,7 +1242,7 @@ int main(int argc, char **argv)
|
||||
printf("errors_bit = %u (trial %d)\n", errors_bit, trial);
|
||||
}
|
||||
roundStats[snrRun]+=((float)round);
|
||||
if (UE_harq_process->harq_ack.ack==1) effRate += ((float)TBS)/round;
|
||||
if (UE_harq_process->ack==1) effRate += ((float)TBS)/round;
|
||||
} // noise trials
|
||||
|
||||
blerStats[snrRun] = (float) n_errors / (float) n_trials;
|
||||
|
||||
@@ -27,4 +27,5 @@ void nr_fill_rx_indication(fapi_nr_rx_indication_t *rx_ind,
|
||||
uint8_t gNB_id,
|
||||
PHY_VARS_NR_UE *ue,
|
||||
NR_UE_DLSCH_t *dlsch0,
|
||||
NR_UE_DLSCH_t *dlsch1,
|
||||
uint16_t n_pdus) {}
|
||||
|
||||
@@ -457,32 +457,8 @@ int main(int argc, char **argv)
|
||||
bzero(rxdataF[i],14*frame_parms->ofdm_symbol_size*sizeof(int));
|
||||
}
|
||||
|
||||
|
||||
//configure UE
|
||||
UE = malloc(sizeof(PHY_VARS_NR_UE));
|
||||
memcpy(&UE->frame_parms,frame_parms,sizeof(NR_DL_FRAME_PARMS));
|
||||
UE->pucch_config_common_nr->hoppingId = Nid_cell;
|
||||
//phy_init_nr_top(UE); //called from init_nr_ue_signal
|
||||
|
||||
UE->perfect_ce = 0;
|
||||
|
||||
if(eps!=0.0)
|
||||
UE->UE_fo_compensation = 1; // if a frequency offset is set then perform fo estimation and compensation
|
||||
|
||||
if (init_nr_ue_signal(UE, 1, 0) != 0)
|
||||
{
|
||||
printf("Error at UE NR initialisation\n");
|
||||
exit(-1);
|
||||
}
|
||||
uint8_t mcs=0;
|
||||
startingPRB_intraSlotHopping=N_RB_DL-1;
|
||||
pucch_GroupHopping_t PUCCH_GroupHopping=UE->pucch_config_common_nr->pucch_GroupHopping;
|
||||
uint32_t hopping_id=UE->pucch_config_common_nr->hoppingId;
|
||||
uint32_t dmrs_scrambling_id = 0, data_scrambling_id=0;
|
||||
//t_nrPolar_params *currentPtr;
|
||||
|
||||
int shift = 0;
|
||||
|
||||
if(format==0){
|
||||
if (sr_flag)
|
||||
shift = 1<<nr_bit;
|
||||
@@ -496,6 +472,63 @@ int main(int argc, char **argv)
|
||||
}
|
||||
else if (format == 2 && nr_bit > 11) gNB->uci_polarParams = nr_polar_params(2, nr_bit, nrofPRB, 1, NULL);
|
||||
|
||||
startingPRB_intraSlotHopping=N_RB_DL-1;
|
||||
uint32_t hopping_id=Nid_cell;
|
||||
uint32_t dmrs_scrambling_id = 0, data_scrambling_id=0;
|
||||
|
||||
//configure UE
|
||||
UE = malloc(sizeof(PHY_VARS_NR_UE));
|
||||
memcpy(&UE->frame_parms,frame_parms,sizeof(NR_DL_FRAME_PARMS));
|
||||
|
||||
fapi_nr_ul_config_pucch_pdu pucch_tx_pdu;
|
||||
if (format==0) {
|
||||
pucch_tx_pdu.format_type = 0;
|
||||
pucch_tx_pdu.nr_of_symbols = nrofSymbols;
|
||||
pucch_tx_pdu.start_symbol_index = startingSymbolIndex;
|
||||
pucch_tx_pdu.bwp_start = 0;
|
||||
pucch_tx_pdu.prb_start = startingPRB;
|
||||
pucch_tx_pdu.hopping_id = hopping_id;
|
||||
pucch_tx_pdu.group_hop_flag = 0;
|
||||
pucch_tx_pdu.sequence_hop_flag = 0;
|
||||
pucch_tx_pdu.freq_hop_flag = 0;
|
||||
pucch_tx_pdu.mcs = mcs;
|
||||
pucch_tx_pdu.initial_cyclic_shift = 0;
|
||||
pucch_tx_pdu.second_hop_prb = startingPRB_intraSlotHopping;
|
||||
}
|
||||
if (format==2) {
|
||||
pucch_tx_pdu.format_type = 2;
|
||||
pucch_tx_pdu.rnti = 0x1234;
|
||||
pucch_tx_pdu.n_bit = nr_bit;
|
||||
pucch_tx_pdu.payload = actual_payload;
|
||||
pucch_tx_pdu.nr_of_symbols = nrofSymbols;
|
||||
pucch_tx_pdu.start_symbol_index = startingSymbolIndex;
|
||||
pucch_tx_pdu.bwp_start = 0;
|
||||
pucch_tx_pdu.prb_start = startingPRB;
|
||||
pucch_tx_pdu.prb_size = nrofPRB;
|
||||
pucch_tx_pdu.hopping_id = hopping_id;
|
||||
pucch_tx_pdu.group_hop_flag = 0;
|
||||
pucch_tx_pdu.sequence_hop_flag = 0;
|
||||
pucch_tx_pdu.freq_hop_flag = 0;
|
||||
pucch_tx_pdu.dmrs_scrambling_id = dmrs_scrambling_id;
|
||||
pucch_tx_pdu.data_scrambling_id = data_scrambling_id;
|
||||
pucch_tx_pdu.second_hop_prb = startingPRB_intraSlotHopping;
|
||||
}
|
||||
|
||||
UE->perfect_ce = 0;
|
||||
|
||||
if(eps!=0.0)
|
||||
UE->UE_fo_compensation = 1; // if a frequency offset is set then perform fo estimation and compensation
|
||||
|
||||
if (init_nr_ue_signal(UE, 1, 0) != 0)
|
||||
{
|
||||
printf("Error at UE NR initialisation\n");
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
pucch_GroupHopping_t PUCCH_GroupHopping = pucch_tx_pdu.group_hop_flag + (pucch_tx_pdu.sequence_hop_flag<<1);
|
||||
|
||||
//t_nrPolar_params *currentPtr;
|
||||
|
||||
for(SNR=snr0;SNR<=snr1;SNR=SNR+1){
|
||||
ack_nack_errors=0;
|
||||
sr_errors=0;
|
||||
@@ -503,13 +536,28 @@ int main(int argc, char **argv)
|
||||
for (trial=0; trial<n_trials; trial++) {
|
||||
bzero(txdataF[aa],frame_parms->ofdm_symbol_size*sizeof(int));
|
||||
if(format==0){
|
||||
nr_generate_pucch0(UE,txdataF,frame_parms,PUCCH_GroupHopping,hopping_id,amp,nr_slot_tx,m0,mcs,nrofSymbols,startingSymbolIndex,startingPRB, 0);
|
||||
nr_generate_pucch0(UE,
|
||||
txdataF,
|
||||
frame_parms,
|
||||
amp,
|
||||
nr_slot_tx,
|
||||
&pucch_tx_pdu);
|
||||
}
|
||||
else if (format == 1){
|
||||
nr_generate_pucch1(UE,txdataF,frame_parms,UE->pucch_config_dedicated,actual_payload,amp,nr_slot_tx,m0,nrofSymbols,startingSymbolIndex,startingPRB,startingPRB_intraSlotHopping,0,nr_bit);
|
||||
nr_generate_pucch1(UE,
|
||||
txdataF,
|
||||
frame_parms,
|
||||
amp,
|
||||
nr_slot_tx,
|
||||
&pucch_tx_pdu);
|
||||
}
|
||||
else {
|
||||
nr_generate_pucch2(UE,0x1234,dmrs_scrambling_id,data_scrambling_id,txdataF,frame_parms,UE->pucch_config_dedicated,actual_payload,amp,nr_slot_tx,nrofSymbols,startingSymbolIndex,nrofPRB,startingPRB,nr_bit);
|
||||
nr_generate_pucch2(UE,
|
||||
txdataF,
|
||||
frame_parms,
|
||||
amp,
|
||||
nr_slot_tx,
|
||||
&pucch_tx_pdu);
|
||||
}
|
||||
|
||||
int txlev = signal_energy(&txdataF[aa][startingSymbolIndex*frame_parms->ofdm_symbol_size],
|
||||
|
||||
@@ -309,7 +309,7 @@ int main(int argc, char **argv)
|
||||
uint16_t ptrsSymbPerSlot = 0;
|
||||
uint16_t ptrsRePerSymb = 0;
|
||||
|
||||
uint8_t transform_precoding = transform_precoder_disabled; // 0 - ENABLE, 1 - DISABLE
|
||||
uint8_t transform_precoding = 1; // 0 - ENABLE, 1 - DISABLE
|
||||
uint8_t num_dmrs_cdm_grps_no_data = 1;
|
||||
uint8_t mcs_table = 0;
|
||||
|
||||
@@ -566,7 +566,7 @@ int main(int argc, char **argv)
|
||||
|
||||
case 'Z':
|
||||
|
||||
transform_precoding = transform_precoder_enabled;
|
||||
transform_precoding = 0; // enabled
|
||||
num_dmrs_cdm_grps_no_data = 2;
|
||||
mcs_table = 3;
|
||||
|
||||
@@ -697,7 +697,7 @@ int main(int argc, char **argv)
|
||||
|
||||
prepare_scd(scd);
|
||||
|
||||
fill_default_secondaryCellGroup(scc, scd, secondaryCellGroup, 0, 1, n_tx, 0, 0);
|
||||
fill_default_secondaryCellGroup(scc, scd, secondaryCellGroup, 0, 1, n_tx, 0, 0, 0);
|
||||
|
||||
// xer_fprint(stdout, &asn_DEF_NR_CellGroupConfig, (const void*)secondaryCellGroup);
|
||||
|
||||
@@ -840,7 +840,8 @@ int main(int argc, char **argv)
|
||||
uint16_t number_dmrs_symbols = get_dmrs_symbols_in_slot(l_prime_mask, nb_symb_sch);
|
||||
uint8_t nb_re_dmrs = (dmrs_config_type == pusch_dmrs_type1) ? 6 : 4;
|
||||
|
||||
if (transform_precoding == transform_precoder_enabled) {
|
||||
// if transform precoding is enabled
|
||||
if (transform_precoding == 0) {
|
||||
|
||||
AssertFatal(enable_ptrs == 0, "PTRS NOT SUPPORTED IF TRANSFORM PRECODING IS ENABLED\n");
|
||||
|
||||
@@ -1045,7 +1046,8 @@ int main(int argc, char **argv)
|
||||
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 (transform_precoding == transform_precoder_enabled) {
|
||||
// if transform precoding is enabled
|
||||
if (transform_precoding == 0) {
|
||||
|
||||
pusch_pdu->dfts_ofdm.low_papr_group_number = *scc->physCellId % 30; // U as defined in 38.211 section 6.4.1.1.1.2
|
||||
pusch_pdu->dfts_ofdm.low_papr_sequence_number = 0; // V as defined in 38.211 section 6.4.1.1.1.2
|
||||
@@ -1105,7 +1107,8 @@ int main(int argc, char **argv)
|
||||
|
||||
ul_config.ul_config_list[0].pusch_config_pdu.transform_precoding = transform_precoding;
|
||||
|
||||
if (transform_precoding == transform_precoder_enabled) {
|
||||
// if transform precoding is enabled
|
||||
if (transform_precoding == 0) {
|
||||
|
||||
ul_config.ul_config_list[0].pusch_config_pdu.dfts_ofdm.low_papr_group_number = *scc->physCellId % 30;// U as defined in 38.211 section 6.4.1.1.1.2
|
||||
ul_config.ul_config_list[0].pusch_config_pdu.dfts_ofdm.low_papr_sequence_number = 0;// V as defined in 38.211 section 6.4.1.1.1.2
|
||||
@@ -1215,7 +1218,7 @@ int main(int argc, char **argv)
|
||||
}
|
||||
|
||||
|
||||
if (n_trials == 1 && round==0) {
|
||||
if (n_trials == 1 && round==0) {
|
||||
#ifdef __AVX2__
|
||||
int off = ((nb_rb&1) == 1)? 4:0;
|
||||
#else
|
||||
|
||||
@@ -411,6 +411,7 @@ typedef struct NRRrcConfigurationReq_s {
|
||||
int ssb_SubcarrierOffset;
|
||||
int pdsch_AntennaPorts;
|
||||
int pusch_AntennaPorts;
|
||||
int do_CSIRS;
|
||||
int pusch_TargetSNRx10;
|
||||
int pucch_TargetSNRx10;
|
||||
} gNB_RrcConfigurationReq;
|
||||
|
||||
@@ -1045,6 +1045,8 @@ void RCconfig_NRRRC(MessageDef *msg_p, uint32_t i, gNB_RRC_INST *rrc) {
|
||||
NRRRC_CONFIGURATION_REQ (msg_p).pdsch_AntennaPorts = *GNBParamList.paramarray[i][GNB_PDSCH_ANTENNAPORTS_IDX].iptr;
|
||||
printf("pusch_AntennaPorts %d\n",*GNBParamList.paramarray[i][GNB_PUSCH_ANTENNAPORTS_IDX].iptr);
|
||||
NRRRC_CONFIGURATION_REQ (msg_p).pusch_AntennaPorts = *GNBParamList.paramarray[i][GNB_PUSCH_ANTENNAPORTS_IDX].iptr;
|
||||
printf("Do CSI-RS %d\n",*GNBParamList.paramarray[i][GNB_DO_CSIRS_IDX].iptr);
|
||||
NRRRC_CONFIGURATION_REQ (msg_p).do_CSIRS = *GNBParamList.paramarray[i][GNB_DO_CSIRS_IDX].iptr;
|
||||
NRRRC_CONFIGURATION_REQ (msg_p).scc = scc;
|
||||
NRRRC_CONFIGURATION_REQ (msg_p).scd = scd;
|
||||
|
||||
|
||||
@@ -116,6 +116,7 @@ typedef enum {
|
||||
#define GNB_CONFIG_STRING_SSBSUBCARRIEROFFSET "ssb_SubcarrierOffset"
|
||||
#define GNB_CONFIG_STRING_PDSCHANTENNAPORTS "pdsch_AntennaPorts"
|
||||
#define GNB_CONFIG_STRING_PUSCHANTENNAPORTS "pusch_AntennaPorts"
|
||||
#define GNB_CONFIG_STRING_DOCSIRS "do_CSIRS"
|
||||
#define GNB_CONFIG_STRING_NRCELLID "nr_cellid"
|
||||
|
||||
/*-----------------------------------------------------------------------------------------------------------------------------------------*/
|
||||
@@ -140,7 +141,8 @@ typedef enum {
|
||||
{GNB_CONFIG_STRING_SSBSUBCARRIEROFFSET, NULL, 0, iptr:NULL, defintval:31, TYPE_INT, 0}, \
|
||||
{GNB_CONFIG_STRING_PDSCHANTENNAPORTS, NULL, 0, iptr:NULL, defintval:1, TYPE_INT, 0}, \
|
||||
{GNB_CONFIG_STRING_PUSCHANTENNAPORTS, NULL, 0, iptr:NULL, defintval:1, TYPE_INT, 0}, \
|
||||
{GNB_CONFIG_STRING_NRCELLID , NULL, 0, u64ptr:NULL, defint64val:1, TYPE_UINT64, 0}, \
|
||||
{GNB_CONFIG_STRING_DOCSIRS, NULL, 0, iptr:NULL, defintval:0, TYPE_INT, 0}, \
|
||||
{GNB_CONFIG_STRING_NRCELLID , NULL, 0, u64ptr:NULL, defint64val:1, TYPE_UINT64, 0}, \
|
||||
}
|
||||
|
||||
#define GNB_GNB_ID_IDX 0
|
||||
@@ -160,7 +162,8 @@ typedef enum {
|
||||
#define GNB_SSB_SUBCARRIEROFFSET_IDX 14
|
||||
#define GNB_PDSCH_ANTENNAPORTS_IDX 15
|
||||
#define GNB_PUSCH_ANTENNAPORTS_IDX 16
|
||||
#define GNB_NRCELLID_IDX 17
|
||||
#define GNB_DO_CSIRS_IDX 17
|
||||
#define GNB_NRCELLID_IDX 18
|
||||
|
||||
#define TRACKING_AREA_CODE_OKRANGE {0x0001,0xFFFD}
|
||||
#define GNBPARAMS_CHECK { \
|
||||
|
||||
@@ -36,6 +36,19 @@
|
||||
|
||||
#define reserved 0xffff
|
||||
|
||||
|
||||
void reverse_n_bits(uint8_t *value, uint16_t bitlen) {
|
||||
uint16_t j;
|
||||
uint8_t i;
|
||||
for(j = bitlen - 1,i = 0; j > i; j--, i++) {
|
||||
if(((*value>>j)&1) != ((*value>>i)&1)) {
|
||||
*value ^= (1<<j);
|
||||
*value ^= (1<<i);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// start symbols for SSB types A,B,C,D,E
|
||||
uint16_t symbol_ssb_AC[8]={2,8,16,22,30,36,44,50};
|
||||
uint16_t symbol_ssb_BD[64]={4,8,16,20,32,36,44,48,60,64,72,76,88,92,100,104,144,148,156,160,172,176,184,188,200,204,212,216,228,232,240,244,284,288,
|
||||
@@ -3240,6 +3253,126 @@ uint16_t get_ssb_start_symbol(const long band, NR_SubcarrierSpacing_t scs, int i
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void csi_period_offset(NR_CSI_ReportConfig_t *csirep,
|
||||
NR_NZP_CSI_RS_Resource_t *nzpcsi,
|
||||
int *period, int *offset) {
|
||||
|
||||
if(nzpcsi != NULL) {
|
||||
|
||||
NR_CSI_ResourcePeriodicityAndOffset_PR p_and_o = nzpcsi->periodicityAndOffset->present;
|
||||
|
||||
switch(p_and_o){
|
||||
case NR_CSI_ResourcePeriodicityAndOffset_PR_slots4:
|
||||
*period = 4;
|
||||
*offset = nzpcsi->periodicityAndOffset->choice.slots4;
|
||||
break;
|
||||
case NR_CSI_ResourcePeriodicityAndOffset_PR_slots5:
|
||||
*period = 5;
|
||||
*offset = nzpcsi->periodicityAndOffset->choice.slots5;
|
||||
break;
|
||||
case NR_CSI_ResourcePeriodicityAndOffset_PR_slots8:
|
||||
*period = 8;
|
||||
*offset = nzpcsi->periodicityAndOffset->choice.slots8;
|
||||
break;
|
||||
case NR_CSI_ResourcePeriodicityAndOffset_PR_slots10:
|
||||
*period = 10;
|
||||
*offset = nzpcsi->periodicityAndOffset->choice.slots10;
|
||||
break;
|
||||
case NR_CSI_ResourcePeriodicityAndOffset_PR_slots16:
|
||||
*period = 16;
|
||||
*offset = nzpcsi->periodicityAndOffset->choice.slots16;
|
||||
break;
|
||||
case NR_CSI_ResourcePeriodicityAndOffset_PR_slots20:
|
||||
*period = 20;
|
||||
*offset = nzpcsi->periodicityAndOffset->choice.slots20;
|
||||
break;
|
||||
case NR_CSI_ResourcePeriodicityAndOffset_PR_slots32:
|
||||
*period = 32;
|
||||
*offset = nzpcsi->periodicityAndOffset->choice.slots32;
|
||||
break;
|
||||
case NR_CSI_ResourcePeriodicityAndOffset_PR_slots40:
|
||||
*period = 40;
|
||||
*offset = nzpcsi->periodicityAndOffset->choice.slots40;
|
||||
break;
|
||||
case NR_CSI_ResourcePeriodicityAndOffset_PR_slots64:
|
||||
*period = 64;
|
||||
*offset = nzpcsi->periodicityAndOffset->choice.slots64;
|
||||
break;
|
||||
case NR_CSI_ResourcePeriodicityAndOffset_PR_slots80:
|
||||
*period = 80;
|
||||
*offset = nzpcsi->periodicityAndOffset->choice.slots80;
|
||||
break;
|
||||
case NR_CSI_ResourcePeriodicityAndOffset_PR_slots160:
|
||||
*period = 160;
|
||||
*offset = nzpcsi->periodicityAndOffset->choice.slots160;
|
||||
break;
|
||||
case NR_CSI_ResourcePeriodicityAndOffset_PR_slots320:
|
||||
*period = 320;
|
||||
*offset = nzpcsi->periodicityAndOffset->choice.slots320;
|
||||
break;
|
||||
case NR_CSI_ResourcePeriodicityAndOffset_PR_slots640:
|
||||
*period = 640;
|
||||
*offset = nzpcsi->periodicityAndOffset->choice.slots640;
|
||||
break;
|
||||
default:
|
||||
AssertFatal(1==0,"No periodicity and offset found in CSI resource");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if(csirep != NULL) {
|
||||
|
||||
NR_CSI_ReportPeriodicityAndOffset_PR p_and_o = csirep->reportConfigType.choice.periodic->reportSlotConfig.present;
|
||||
|
||||
switch(p_and_o){
|
||||
case NR_CSI_ReportPeriodicityAndOffset_PR_slots4:
|
||||
*period = 4;
|
||||
*offset = csirep->reportConfigType.choice.periodic->reportSlotConfig.choice.slots4;
|
||||
break;
|
||||
case NR_CSI_ReportPeriodicityAndOffset_PR_slots5:
|
||||
*period = 5;
|
||||
*offset = csirep->reportConfigType.choice.periodic->reportSlotConfig.choice.slots5;
|
||||
break;
|
||||
case NR_CSI_ReportPeriodicityAndOffset_PR_slots8:
|
||||
*period = 8;
|
||||
*offset = csirep->reportConfigType.choice.periodic->reportSlotConfig.choice.slots8;
|
||||
break;
|
||||
case NR_CSI_ReportPeriodicityAndOffset_PR_slots10:
|
||||
*period = 10;
|
||||
*offset = csirep->reportConfigType.choice.periodic->reportSlotConfig.choice.slots10;
|
||||
break;
|
||||
case NR_CSI_ReportPeriodicityAndOffset_PR_slots16:
|
||||
*period = 16;
|
||||
*offset = csirep->reportConfigType.choice.periodic->reportSlotConfig.choice.slots16;
|
||||
break;
|
||||
case NR_CSI_ReportPeriodicityAndOffset_PR_slots20:
|
||||
*period = 20;
|
||||
*offset = csirep->reportConfigType.choice.periodic->reportSlotConfig.choice.slots20;
|
||||
break;
|
||||
case NR_CSI_ReportPeriodicityAndOffset_PR_slots40:
|
||||
*period = 40;
|
||||
*offset = csirep->reportConfigType.choice.periodic->reportSlotConfig.choice.slots40;
|
||||
break;
|
||||
case NR_CSI_ReportPeriodicityAndOffset_PR_slots80:
|
||||
*period = 80;
|
||||
*offset = csirep->reportConfigType.choice.periodic->reportSlotConfig.choice.slots80;
|
||||
break;
|
||||
case NR_CSI_ReportPeriodicityAndOffset_PR_slots160:
|
||||
*period = 160;
|
||||
*offset = csirep->reportConfigType.choice.periodic->reportSlotConfig.choice.slots160;
|
||||
break;
|
||||
case NR_CSI_ReportPeriodicityAndOffset_PR_slots320:
|
||||
*period = 320;
|
||||
*offset = csirep->reportConfigType.choice.periodic->reportSlotConfig.choice.slots320;
|
||||
break;
|
||||
default:
|
||||
AssertFatal(1==0,"No periodicity and offset resource found in CSI report");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void get_type0_PDCCH_CSS_config_parameters(NR_Type0_PDCCH_CSS_config_t *type0_PDCCH_CSS_config,
|
||||
frame_t frameP,
|
||||
NR_MIB_t *mib,
|
||||
@@ -3593,6 +3726,143 @@ void get_type0_PDCCH_CSS_config_parameters(NR_Type0_PDCCH_CSS_config_t *type0_PD
|
||||
|
||||
}
|
||||
|
||||
void find_period_offest_SR (NR_SchedulingRequestResourceConfig_t *SchedulingReqRec, int *period, int *offset) {
|
||||
NR_SchedulingRequestResourceConfig__periodicityAndOffset_PR P_O = SchedulingReqRec->periodicityAndOffset->present;
|
||||
switch (P_O){
|
||||
case NR_SchedulingRequestResourceConfig__periodicityAndOffset_PR_sl1:
|
||||
*period = 1;
|
||||
*offset = SchedulingReqRec->periodicityAndOffset->choice.sl1;
|
||||
break;
|
||||
case NR_SchedulingRequestResourceConfig__periodicityAndOffset_PR_sl2:
|
||||
*period = 2;
|
||||
*offset = SchedulingReqRec->periodicityAndOffset->choice.sl2;
|
||||
break;
|
||||
case NR_SchedulingRequestResourceConfig__periodicityAndOffset_PR_sl4:
|
||||
*period = 4;
|
||||
*offset = SchedulingReqRec->periodicityAndOffset->choice.sl4;
|
||||
break;
|
||||
case NR_SchedulingRequestResourceConfig__periodicityAndOffset_PR_sl5:
|
||||
*period = 5;
|
||||
*offset = SchedulingReqRec->periodicityAndOffset->choice.sl5;
|
||||
break;
|
||||
case NR_SchedulingRequestResourceConfig__periodicityAndOffset_PR_sl8:
|
||||
*period = 8;
|
||||
*offset = SchedulingReqRec->periodicityAndOffset->choice.sl8;
|
||||
break;
|
||||
case NR_SchedulingRequestResourceConfig__periodicityAndOffset_PR_sl10:
|
||||
*period = 10;
|
||||
*offset = SchedulingReqRec->periodicityAndOffset->choice.sl10;
|
||||
break;
|
||||
case NR_SchedulingRequestResourceConfig__periodicityAndOffset_PR_sl16:
|
||||
*period = 16;
|
||||
*offset = SchedulingReqRec->periodicityAndOffset->choice.sl16;
|
||||
break;
|
||||
case NR_SchedulingRequestResourceConfig__periodicityAndOffset_PR_sl20:
|
||||
*period = 20;
|
||||
*offset = SchedulingReqRec->periodicityAndOffset->choice.sl20;
|
||||
break;
|
||||
case NR_SchedulingRequestResourceConfig__periodicityAndOffset_PR_sl40:
|
||||
*period = 40;
|
||||
*offset = SchedulingReqRec->periodicityAndOffset->choice.sl40;
|
||||
break;
|
||||
case NR_SchedulingRequestResourceConfig__periodicityAndOffset_PR_sl80:
|
||||
*period = 80;
|
||||
*offset = SchedulingReqRec->periodicityAndOffset->choice.sl80;
|
||||
break;
|
||||
case NR_SchedulingRequestResourceConfig__periodicityAndOffset_PR_sl160:
|
||||
*period = 160;
|
||||
*offset = SchedulingReqRec->periodicityAndOffset->choice.sl160;
|
||||
break;
|
||||
case NR_SchedulingRequestResourceConfig__periodicityAndOffset_PR_sl320:
|
||||
*period = 320;
|
||||
*offset = SchedulingReqRec->periodicityAndOffset->choice.sl320;
|
||||
break;
|
||||
case NR_SchedulingRequestResourceConfig__periodicityAndOffset_PR_sl640:
|
||||
*period = 640;
|
||||
*offset = SchedulingReqRec->periodicityAndOffset->choice.sl640;
|
||||
break;
|
||||
default:
|
||||
AssertFatal(1==0,"No periodicityAndOffset resources found in schedulingrequestresourceconfig");
|
||||
}
|
||||
}
|
||||
|
||||
uint16_t compute_pucch_prb_size(uint8_t format,
|
||||
uint8_t nr_prbs,
|
||||
uint16_t O_tot,
|
||||
uint16_t O_csi,
|
||||
NR_PUCCH_MaxCodeRate_t *maxCodeRate,
|
||||
uint8_t Qm,
|
||||
uint8_t n_symb,
|
||||
uint8_t n_re_ctrl) {
|
||||
|
||||
uint16_t O_crc;
|
||||
|
||||
if (O_tot<12)
|
||||
O_crc = 0;
|
||||
else{
|
||||
if (O_tot<20)
|
||||
O_crc = 6;
|
||||
else {
|
||||
if (O_tot<360)
|
||||
O_crc = 11;
|
||||
else
|
||||
AssertFatal(1==0,"Case for segmented PUCCH not yet implemented");
|
||||
}
|
||||
}
|
||||
|
||||
int rtimes100;
|
||||
switch(*maxCodeRate){
|
||||
case NR_PUCCH_MaxCodeRate_zeroDot08 :
|
||||
rtimes100 = 8;
|
||||
break;
|
||||
case NR_PUCCH_MaxCodeRate_zeroDot15 :
|
||||
rtimes100 = 15;
|
||||
break;
|
||||
case NR_PUCCH_MaxCodeRate_zeroDot25 :
|
||||
rtimes100 = 25;
|
||||
break;
|
||||
case NR_PUCCH_MaxCodeRate_zeroDot35 :
|
||||
rtimes100 = 35;
|
||||
break;
|
||||
case NR_PUCCH_MaxCodeRate_zeroDot45 :
|
||||
rtimes100 = 45;
|
||||
break;
|
||||
case NR_PUCCH_MaxCodeRate_zeroDot60 :
|
||||
rtimes100 = 60;
|
||||
break;
|
||||
case NR_PUCCH_MaxCodeRate_zeroDot80 :
|
||||
rtimes100 = 80;
|
||||
break;
|
||||
default :
|
||||
AssertFatal(1==0,"Invalid MaxCodeRate");
|
||||
}
|
||||
|
||||
float r = (float)rtimes100/100;
|
||||
|
||||
if (O_csi == O_tot) {
|
||||
if ((O_tot+O_csi)>(nr_prbs*n_re_ctrl*n_symb*Qm*r))
|
||||
AssertFatal(1==0,"MaxCodeRate %.2f can't support %d UCI bits and %d CRC bits with %d PRBs",
|
||||
r,O_tot,O_crc,nr_prbs);
|
||||
else
|
||||
return nr_prbs;
|
||||
}
|
||||
|
||||
if (format==2){
|
||||
// TODO fix this for multiple CSI reports
|
||||
for (int i=1; i<=nr_prbs; i++){
|
||||
if((O_tot+O_crc)<=(i*n_symb*Qm*n_re_ctrl*r) &&
|
||||
(O_tot+O_crc)>((i-1)*n_symb*Qm*n_re_ctrl*r))
|
||||
return i;
|
||||
}
|
||||
AssertFatal(1==0,"MaxCodeRate %.2f can't support %d UCI bits and %d CRC bits with at most %d PRBs",
|
||||
r,O_tot,O_crc,nr_prbs);
|
||||
}
|
||||
else{
|
||||
AssertFatal(1==0,"Not yet implemented");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* extract UL PTRS values from RRC and validate it based upon 38.214 6.2.3 */
|
||||
bool set_ul_ptrs_values(NR_PTRS_UplinkConfig_t *ul_ptrs_config,
|
||||
uint16_t rbSize,uint8_t mcsIndex, uint8_t mcsTable,
|
||||
|
||||
@@ -139,8 +139,25 @@ void get_type0_PDCCH_CSS_config_parameters(NR_Type0_PDCCH_CSS_config_t *type0_PD
|
||||
|
||||
uint16_t get_ssb_start_symbol(const long band, NR_SubcarrierSpacing_t scs, int i_ssb);
|
||||
|
||||
uint16_t compute_pucch_prb_size(uint8_t format,
|
||||
uint8_t nr_prbs,
|
||||
uint16_t O_tot,
|
||||
uint16_t O_csi,
|
||||
NR_PUCCH_MaxCodeRate_t *maxCodeRate,
|
||||
uint8_t Qm,
|
||||
uint8_t n_symb,
|
||||
uint8_t n_re_ctrl);
|
||||
|
||||
int16_t get_N_RA_RB (int delta_f_RA_PRACH,int delta_f_PUSCH);
|
||||
|
||||
void find_period_offest_SR (NR_SchedulingRequestResourceConfig_t *SchedulingReqRec, int *period, int *offset);
|
||||
|
||||
void csi_period_offset(NR_CSI_ReportConfig_t *csirep,
|
||||
NR_NZP_CSI_RS_Resource_t *nzpcsi,
|
||||
int *period, int *offset);
|
||||
|
||||
void reverse_n_bits(uint8_t *value, uint16_t bitlen);
|
||||
|
||||
bool set_dl_ptrs_values(NR_PTRS_DownlinkConfig_t *ptrs_config,
|
||||
uint16_t rbSize, uint8_t mcsIndex, uint8_t mcsTable,
|
||||
uint8_t *K_ptrs, uint8_t *L_ptrs,uint8_t *portIndex,
|
||||
|
||||
@@ -302,6 +302,20 @@ typedef struct {
|
||||
|
||||
} RA_config_t;
|
||||
|
||||
typedef struct {
|
||||
bool active;
|
||||
bool ack_received;
|
||||
uint8_t pucch_resource_indicator;
|
||||
uint16_t feedback_to_ul;
|
||||
frame_t dl_frame;
|
||||
int dl_slot;
|
||||
uint8_t ack;
|
||||
uint8_t dai;
|
||||
int n_CCE;
|
||||
int N_CCE;
|
||||
int8_t delta_pucch;
|
||||
} NR_UE_HARQ_STATUS_t;
|
||||
|
||||
typedef struct {
|
||||
|
||||
uint8_t freq_hopping;
|
||||
@@ -311,6 +325,22 @@ typedef struct {
|
||||
|
||||
} RAR_grant_t;
|
||||
|
||||
typedef struct {
|
||||
int n_HARQ_ACK;
|
||||
uint32_t ack_payload;
|
||||
uint8_t sr_payload;
|
||||
uint32_t csi_part1_payload;
|
||||
uint32_t csi_part2_payload;
|
||||
int resource_indicator;
|
||||
int resource_set_id;
|
||||
int initial_pucch_id;
|
||||
NR_PUCCH_Resource_t *pucch_resource;
|
||||
int n_CCE;
|
||||
int N_CCE;
|
||||
int8_t delta_pucch;
|
||||
} PUCCH_sched_t;
|
||||
|
||||
|
||||
/*!\brief Top level UE MAC structure */
|
||||
typedef struct {
|
||||
|
||||
@@ -362,6 +392,9 @@ typedef struct {
|
||||
RA_config_t ra;
|
||||
/// SSB index from MIB decoding
|
||||
uint8_t mib_ssb;
|
||||
/// measured SSB RSRP in dBm
|
||||
short ssb_rsrp_dBm;
|
||||
|
||||
/// Last NDI of UL HARQ processes
|
||||
uint8_t UL_ndi[NR_MAX_HARQ_PROCESSES];
|
||||
/// first ULTX of UL HARQ processes
|
||||
@@ -388,6 +421,8 @@ typedef struct {
|
||||
|
||||
dci_pdu_rel15_t def_dci_pdu_rel15[8];
|
||||
|
||||
NR_UE_HARQ_STATUS_t dl_harq_info[16];
|
||||
|
||||
} NR_UE_MAC_INST_t;
|
||||
|
||||
typedef enum seach_space_mask_e {
|
||||
|
||||
@@ -37,6 +37,9 @@
|
||||
#include "PHY/defs_nr_UE.h"
|
||||
#include "RRC/NR_UE/rrc_defs.h"
|
||||
|
||||
#define NR_DL_MAX_DAI (4) /* TS 38.213 table 9.1.3-1 Value of counter DAI for DCI format 1_0 and 1_1 */
|
||||
#define NR_DL_MAX_NB_CW (2) /* number of downlink code word */
|
||||
|
||||
/**\brief decode mib pdu in NR_UE, from if_module ul_ind with P7 tx_ind message
|
||||
\param module_id module id
|
||||
\param cc_id component carrier id
|
||||
@@ -65,11 +68,11 @@ int8_t nr_ue_decode_mib(
|
||||
\param pduP pointer to pdu
|
||||
\param pdu_length length of pdu */
|
||||
int8_t nr_ue_decode_BCCH_DL_SCH(module_id_t module_id,
|
||||
int cc_id,
|
||||
unsigned int gNB_index,
|
||||
uint32_t sibs_mask,
|
||||
uint8_t *pduP,
|
||||
uint32_t pdu_len);
|
||||
int cc_id,
|
||||
unsigned int gNB_index,
|
||||
uint8_t ack_nack,
|
||||
uint8_t *pduP,
|
||||
uint32_t pdu_len);
|
||||
|
||||
/**\brief primitive from RRC layer to MAC layer for configuration L1/L2, now supported 4 rrc messages: MIB, cell_group_config for MAC/PHY, spcell_config(serving cell config)
|
||||
\param module_id module id
|
||||
@@ -122,25 +125,35 @@ void fill_scheduled_response(nr_scheduled_response_t *scheduled_response,
|
||||
int slot,
|
||||
int thread_id);
|
||||
|
||||
/* \brief Get SR payload (0,1) from UE MAC
|
||||
@param Mod_id Instance id of UE in machine
|
||||
@param CC_id Component Carrier index
|
||||
@param eNB_id Index of eNB that UE is attached to
|
||||
@param rnti C_RNTI of UE
|
||||
@param subframe subframe number
|
||||
@returns 0 for no SR, 1 for SR
|
||||
*/
|
||||
uint32_t ue_get_SR(module_id_t module_idP, int CC_id, frame_t frameP,
|
||||
uint8_t eNB_id, rnti_t rnti, sub_frame_t subframe);
|
||||
int8_t nr_ue_get_SR(module_id_t module_idP, frame_t frameP, int slotP);
|
||||
|
||||
int8_t nr_ue_get_SR(module_id_t module_idP, int CC_id, frame_t frameP, uint8_t eNB_id, uint16_t rnti, sub_frame_t subframe);
|
||||
|
||||
int8_t nr_ue_process_dci(module_id_t module_id, int cc_id, uint8_t gNB_index, frame_t frame, int slot, dci_pdu_rel15_t *dci, uint16_t rnti, uint8_t dci_format);
|
||||
int8_t nr_ue_process_dci(module_id_t module_id, int cc_id, uint8_t gNB_index, frame_t frame, int slot, dci_pdu_rel15_t *dci, fapi_nr_dci_indication_pdu_t *dci_ind);
|
||||
int nr_ue_process_dci_indication_pdu(module_id_t module_id, int cc_id, int gNB_index, frame_t frame, int slot, fapi_nr_dci_indication_pdu_t *dci);
|
||||
|
||||
uint32_t get_ssb_frame(uint32_t test);
|
||||
|
||||
uint32_t mr_ue_get_SR(module_id_t module_idP, int CC_id, frame_t frameP, uint8_t eNB_id, uint16_t rnti, sub_frame_t subframe);
|
||||
bool trigger_periodic_scheduling_request(NR_UE_MAC_INST_t *mac,
|
||||
PUCCH_sched_t *pucch,
|
||||
frame_t frame,
|
||||
int slot);
|
||||
|
||||
uint8_t nr_get_csi_measurements(NR_UE_MAC_INST_t *mac,
|
||||
frame_t frame,
|
||||
int slot,
|
||||
PUCCH_sched_t *pucch);
|
||||
|
||||
uint8_t get_ssb_rsrp_payload(NR_UE_MAC_INST_t *mac,
|
||||
PUCCH_sched_t *pucch,
|
||||
struct NR_CSI_ReportConfig *csi_reportconfig,
|
||||
NR_CSI_ResourceConfigId_t csi_ResourceConfigId,
|
||||
NR_CSI_MeasConfig_t *csi_MeasConfig);
|
||||
|
||||
uint8_t nr_get_csi_payload(NR_UE_MAC_INST_t *mac,
|
||||
PUCCH_sched_t *pucch,
|
||||
NR_CSI_MeasConfig_t *csi_MeasConfig);
|
||||
|
||||
uint8_t get_rsrp_index(int rsrp);
|
||||
uint8_t get_rsrp_diff_index(int best_rsrp,int current_rsrp);
|
||||
|
||||
/* \brief Get payload (MAC PDU) from UE PHY
|
||||
@param dl_info pointer to dl indication
|
||||
@@ -197,6 +210,58 @@ int set_tdd_config_nr_ue(fapi_nr_config_request_t *cfg, int mu,
|
||||
int nrofDownlinkSlots, int nrofDownlinkSymbols,
|
||||
int nrofUplinkSlots, int nrofUplinkSymbols);
|
||||
|
||||
void set_harq_status(NR_UE_MAC_INST_t *mac,
|
||||
uint8_t pucch_id,
|
||||
uint8_t harq_id,
|
||||
int8_t delta_pucch,
|
||||
uint8_t data_toul_fb,
|
||||
uint8_t dai,
|
||||
int n_CCE,
|
||||
int N_CCE,
|
||||
frame_t frame,
|
||||
int slot);
|
||||
|
||||
void update_harq_status(nr_downlink_indication_t *dl_info,
|
||||
int pdu_id);
|
||||
|
||||
uint8_t get_downlink_ack(NR_UE_MAC_INST_t *mac,
|
||||
frame_t frame,
|
||||
int slot,
|
||||
PUCCH_sched_t *pucch);
|
||||
|
||||
int find_pucch_resource_set(NR_UE_MAC_INST_t *mac, int uci_size);
|
||||
|
||||
void select_pucch_resource(NR_UE_MAC_INST_t *mac,
|
||||
PUCCH_sched_t *pucch);
|
||||
|
||||
int16_t get_pucch_tx_power_ue(NR_UE_MAC_INST_t *mac,
|
||||
NR_PUCCH_Config_t *pucch_Config,
|
||||
PUCCH_sched_t *pucch,
|
||||
uint8_t format_type,
|
||||
uint16_t nb_of_prbs,
|
||||
uint8_t freq_hop_flag,
|
||||
uint8_t add_dmrs_flag,
|
||||
uint8_t N_symb_PUCCH,
|
||||
int subframe_number,
|
||||
int O_ACK, int O_SR,
|
||||
int O_CSI, int O_CRC);
|
||||
|
||||
int get_deltatf(uint16_t nb_of_prbs,
|
||||
uint8_t N_symb_PUCCH,
|
||||
uint8_t freq_hop_flag,
|
||||
uint8_t add_dmrs_flag,
|
||||
int N_sc_ctrl_RB,
|
||||
int n_HARQ_ACK,
|
||||
int O_ACK, int O_SR,
|
||||
int O_CSI, int O_CRC);
|
||||
|
||||
void nr_ue_configure_pucch(NR_UE_MAC_INST_t *mac,
|
||||
int slot,
|
||||
uint16_t rnti,
|
||||
PUCCH_sched_t *pucch,
|
||||
fapi_nr_ul_config_pucch_pdu *pucch_pdu,
|
||||
int O_SR, int O_ACK, int O_CSI);
|
||||
|
||||
/** \brief Function for UE/PHY to compute PUSCH transmit power in power-control procedure.
|
||||
@param Mod_id Module id of UE
|
||||
@returns Po_NOMINAL_PUSCH (PREAMBLE_RECEIVED_TARGET_POWER+DELTA_PREAMBLE
|
||||
@@ -226,6 +291,7 @@ and fills the PRACH PDU per each FD occasion.
|
||||
@returns void
|
||||
*/
|
||||
void nr_ue_prach_scheduler(module_id_t module_idP, frame_t frameP, sub_frame_t slotP, int thread_id);
|
||||
void nr_ue_pucch_scheduler(module_id_t module_idP, frame_t frameP, int slotP, int thread_id);
|
||||
|
||||
/* \brief This function schedules the Msg3 transmission
|
||||
@param
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -703,7 +703,7 @@ int nr_config_pusch_pdu(NR_UE_MAC_INST_t *mac,
|
||||
|
||||
/* TRANSFORM PRECODING ------------------------------------------------------------------------------------------*/
|
||||
|
||||
if (pusch_config_pdu->transform_precoding == transform_precoder_enabled) {
|
||||
if (pusch_config_pdu->transform_precoding == NR_PUSCH_Config__transformPrecoder_enabled) {
|
||||
|
||||
pusch_config_pdu->num_dmrs_cdm_grps_no_data = 2;
|
||||
|
||||
@@ -748,7 +748,7 @@ int nr_config_pusch_pdu(NR_UE_MAC_INST_t *mac,
|
||||
pusch_config_pdu->mcs_index = dci->mcs;
|
||||
|
||||
/* MCS TABLE */
|
||||
if (pusch_config_pdu->transform_precoding == transform_precoder_disabled) {
|
||||
if (pusch_config_pdu->transform_precoding == NR_PUSCH_Config__transformPrecoder_disabled) {
|
||||
pusch_config_pdu->mcs_table = get_pusch_mcs_table(pusch_Config ? pusch_Config->mcs_Table : NULL, 0, *dci_format, rnti_type, target_ss, false);
|
||||
} else {
|
||||
pusch_config_pdu->mcs_table = get_pusch_mcs_table(pusch_Config ? pusch_Config->mcs_TableTransformPrecoder : NULL, 1, *dci_format, rnti_type, target_ss, false);
|
||||
@@ -781,10 +781,13 @@ int nr_config_pusch_pdu(NR_UE_MAC_INST_t *mac,
|
||||
}
|
||||
|
||||
/* DMRS */
|
||||
l_prime_mask = get_l_prime(pusch_config_pdu->nr_of_symbols, mappingtype, add_pos, dmrslength, pusch_config_pdu->start_symbol_index, mac->scc ? mac->scc->dmrs_TypeA_Position : mac->mib->dmrs_TypeA_Position);
|
||||
if ((mac->ULbwp[0] && pusch_config_pdu->transform_precoding == transform_precoder_disabled))
|
||||
l_prime_mask = get_l_prime(pusch_config_pdu->nr_of_symbols,
|
||||
mappingtype, add_pos, dmrslength,
|
||||
pusch_config_pdu->start_symbol_index,
|
||||
mac->scc ? mac->scc->dmrs_TypeA_Position : mac->mib->dmrs_TypeA_Position);
|
||||
if ((mac->ULbwp[0] && pusch_config_pdu->transform_precoding == NR_PUSCH_Config__transformPrecoder_disabled))
|
||||
pusch_config_pdu->num_dmrs_cdm_grps_no_data = 1;
|
||||
else if (*dci_format == NR_UL_DCI_FORMAT_0_0 || (mac->ULbwp[0] && pusch_config_pdu->transform_precoding == transform_precoder_enabled))
|
||||
else if (*dci_format == NR_UL_DCI_FORMAT_0_0 || (mac->ULbwp[0] && pusch_config_pdu->transform_precoding == NR_PUSCH_Config__transformPrecoder_enabled))
|
||||
pusch_config_pdu->num_dmrs_cdm_grps_no_data = 2;
|
||||
|
||||
// Num PRB Overhead from PUSCH-ServingCellConfig
|
||||
@@ -800,12 +803,12 @@ int nr_config_pusch_pdu(NR_UE_MAC_INST_t *mac,
|
||||
|
||||
/* PTRS */
|
||||
if (mac->ULbwp[0] &&
|
||||
mac->ULbwp[0]->bwp_Dedicated &&
|
||||
mac->ULbwp[0]->bwp_Dedicated->pusch_Config &&
|
||||
mac->ULbwp[0]->bwp_Dedicated->pusch_Config->choice.setup &&
|
||||
mac->ULbwp[0]->bwp_Dedicated->pusch_Config->choice.setup->dmrs_UplinkForPUSCH_MappingTypeB &&
|
||||
mac->ULbwp[0]->bwp_Dedicated->pusch_Config->choice.setup->dmrs_UplinkForPUSCH_MappingTypeB->choice.setup->phaseTrackingRS) {
|
||||
if (pusch_config_pdu->transform_precoding == transform_precoder_disabled) {
|
||||
mac->ULbwp[0]->bwp_Dedicated &&
|
||||
mac->ULbwp[0]->bwp_Dedicated->pusch_Config &&
|
||||
mac->ULbwp[0]->bwp_Dedicated->pusch_Config->choice.setup &&
|
||||
mac->ULbwp[0]->bwp_Dedicated->pusch_Config->choice.setup->dmrs_UplinkForPUSCH_MappingTypeB &&
|
||||
mac->ULbwp[0]->bwp_Dedicated->pusch_Config->choice.setup->dmrs_UplinkForPUSCH_MappingTypeB->choice.setup->phaseTrackingRS) {
|
||||
if (pusch_config_pdu->transform_precoding == NR_PUSCH_Config__transformPrecoder_disabled) {
|
||||
nfapi_nr_ue_ptrs_ports_t ptrs_ports_list;
|
||||
pusch_config_pdu->pusch_ptrs.ptrs_ports_list = &ptrs_ports_list;
|
||||
valid_ptrs_setup = set_ul_ptrs_values(mac->ULbwp[0]->bwp_Dedicated->pusch_Config->choice.setup->dmrs_UplinkForPUSCH_MappingTypeB->choice.setup->phaseTrackingRS->choice.setup,
|
||||
@@ -1824,6 +1827,96 @@ void build_ssb_to_ro_map(NR_UE_MAC_INST_t *mac) {
|
||||
LOG_D(NR_MAC,"Map SSB to RO done\n");
|
||||
}
|
||||
|
||||
|
||||
void nr_ue_pucch_scheduler(module_id_t module_idP, frame_t frameP, int slotP, int thread_id) {
|
||||
|
||||
NR_UE_MAC_INST_t *mac = get_mac_inst(module_idP);
|
||||
int O_SR = 0;
|
||||
int O_ACK = 0;
|
||||
int O_CSI = 0;
|
||||
int N_UCI = 0;
|
||||
|
||||
PUCCH_sched_t *pucch = calloc(1,sizeof(*pucch));
|
||||
pucch->resource_indicator = -1;
|
||||
pucch->initial_pucch_id = -1;
|
||||
uint16_t rnti = mac->crnti; //FIXME not sure this is valid for all pucch instances
|
||||
|
||||
// SR
|
||||
if(trigger_periodic_scheduling_request(mac, pucch, frameP, slotP)) {
|
||||
O_SR = 1;
|
||||
/* sr_payload = 1 means that this is a positive SR, sr_payload = 0 means that it is a negative SR */
|
||||
pucch->sr_payload = nr_ue_get_SR(module_idP,
|
||||
frameP,
|
||||
slotP);
|
||||
}
|
||||
|
||||
// CSI
|
||||
if (mac->ra.ra_state == RA_SUCCEEDED)
|
||||
O_CSI = nr_get_csi_measurements(mac, frameP, slotP, pucch);
|
||||
|
||||
// ACKNACK
|
||||
O_ACK = get_downlink_ack(mac, frameP, slotP, pucch);
|
||||
|
||||
NR_BWP_Id_t bwp_id = mac->UL_BWP_Id;
|
||||
NR_PUCCH_Config_t *pucch_Config = NULL;
|
||||
|
||||
if (bwp_id>0 &&
|
||||
mac->ULbwp[bwp_id-1] &&
|
||||
mac->ULbwp[bwp_id-1]->bwp_Dedicated &&
|
||||
mac->ULbwp[bwp_id-1]->bwp_Dedicated->pucch_Config &&
|
||||
mac->ULbwp[bwp_id-1]->bwp_Dedicated->pucch_Config->choice.setup) {
|
||||
pucch_Config = mac->ULbwp[bwp_id-1]->bwp_Dedicated->pucch_Config->choice.setup;
|
||||
}
|
||||
else if (bwp_id==0 &&
|
||||
mac->cg &&
|
||||
mac->cg->spCellConfig &&
|
||||
mac->cg->spCellConfig->spCellConfigDedicated &&
|
||||
mac->cg->spCellConfig->spCellConfigDedicated->uplinkConfig &&
|
||||
mac->cg->spCellConfig->spCellConfigDedicated->uplinkConfig->initialUplinkBWP &&
|
||||
mac->cg->spCellConfig->spCellConfigDedicated->uplinkConfig->initialUplinkBWP->pucch_Config &&
|
||||
mac->cg->spCellConfig->spCellConfigDedicated->uplinkConfig->initialUplinkBWP->pucch_Config->choice.setup) {
|
||||
pucch_Config = mac->cg->spCellConfig->spCellConfigDedicated->uplinkConfig->initialUplinkBWP->pucch_Config->choice.setup;
|
||||
}
|
||||
|
||||
|
||||
// if multiplexing of HARQ and CSI is not possible, transmit only HARQ bits
|
||||
if ((O_ACK != 0) && (O_CSI != 0) &&
|
||||
pucch_Config &&
|
||||
pucch_Config->format2 &&
|
||||
(pucch_Config->format2->choice.setup->simultaneousHARQ_ACK_CSI == NULL)) {
|
||||
O_CSI = 0;
|
||||
pucch->csi_part1_payload = 0;
|
||||
pucch->csi_part2_payload = 0;
|
||||
}
|
||||
|
||||
N_UCI = O_SR + O_ACK + O_CSI;
|
||||
|
||||
// do no transmit pucch if only SR scheduled and it is negative
|
||||
if ((O_ACK + O_CSI) == 0 && pucch->sr_payload == 0)
|
||||
return;
|
||||
|
||||
if (N_UCI > 0) {
|
||||
|
||||
pucch->resource_set_id = find_pucch_resource_set(mac, N_UCI);
|
||||
select_pucch_resource(mac, pucch);
|
||||
fapi_nr_ul_config_request_t *ul_config = get_ul_config_request(mac, slotP);
|
||||
fapi_nr_ul_config_pucch_pdu *pucch_pdu = &ul_config->ul_config_list[ul_config->number_pdus].pucch_config_pdu;
|
||||
nr_ue_configure_pucch(mac,
|
||||
slotP,
|
||||
rnti,
|
||||
pucch,
|
||||
pucch_pdu,
|
||||
O_SR, O_ACK, O_CSI);
|
||||
fill_ul_config(ul_config, frameP, slotP, FAPI_NR_UL_CONFIG_TYPE_PUCCH);
|
||||
nr_scheduled_response_t scheduled_response;
|
||||
fill_scheduled_response(&scheduled_response, NULL, ul_config, NULL, module_idP, 0 /*TBR fix*/, frameP, slotP, thread_id);
|
||||
if(mac->if_module != NULL && mac->if_module->scheduled_response != NULL)
|
||||
mac->if_module->scheduled_response(&scheduled_response);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
// This function schedules the PRACH according to prach_ConfigurationIndex and TS 38.211, tables 6.3.3.2.x
|
||||
// PRACH formats 9, 10, 11 are corresponding to dual PRACH format configurations A1/B1, A2/B2, A3/B3.
|
||||
// - todo:
|
||||
|
||||
@@ -457,7 +457,7 @@ int rrc_mac_config_req_gNB(module_id_t Mod_idP,
|
||||
ssb_SubcarrierOffset,
|
||||
pdsch_AntennaPorts,
|
||||
pusch_AntennaPorts,
|
||||
scc);
|
||||
scc);
|
||||
LOG_D(NR_MAC, "%s() %s:%d RC.nrmac[Mod_idP]->if_inst->NR_PHY_config_req:%p\n", __FUNCTION__, __FILE__, __LINE__, RC.nrmac[Mod_idP]->if_inst->NR_PHY_config_req);
|
||||
|
||||
// if in nFAPI mode
|
||||
|
||||
@@ -812,169 +812,168 @@ void nr_configure_pucch(nfapi_nr_pucch_pdu_t* pucch_pdu,
|
||||
pucch_pdu->cyclic_prefix = (genericParameters->cyclicPrefix==NULL) ? 0 : *genericParameters->cyclicPrefix;
|
||||
if (r_pucch<0 || bwp){
|
||||
// we have either a dedicated BWP or Dedicated PUCCH configuration on InitialBWP
|
||||
pucch_Config = bwp ?
|
||||
bwp->bwp_Dedicated->pucch_Config->choice.setup:
|
||||
CellGroup->spCellConfig->spCellConfigDedicated->uplinkConfig->initialUplinkBWP->pucch_Config->choice.setup;
|
||||
pucch_Config = bwp ?
|
||||
bwp->bwp_Dedicated->pucch_Config->choice.setup:
|
||||
CellGroup->spCellConfig->spCellConfigDedicated->uplinkConfig->initialUplinkBWP->pucch_Config->choice.setup;
|
||||
|
||||
AssertFatal(pucch_Config->resourceSetToAddModList!=NULL,
|
||||
"PUCCH resourceSetToAddModList is null\n");
|
||||
AssertFatal(pucch_Config->resourceSetToAddModList!=NULL,
|
||||
"PUCCH resourceSetToAddModList is null\n");
|
||||
|
||||
n_set = pucch_Config->resourceSetToAddModList->list.count;
|
||||
AssertFatal(n_set>0,"PUCCH resourceSetToAddModList is empty\n");
|
||||
n_set = pucch_Config->resourceSetToAddModList->list.count;
|
||||
AssertFatal(n_set>0,"PUCCH resourceSetToAddModList is empty\n");
|
||||
|
||||
LOG_D(NR_MAC, "UCI n_set= %d\n", n_set);
|
||||
LOG_D(NR_MAC, "UCI n_set= %d\n", n_set);
|
||||
|
||||
N2 = 2;
|
||||
// procedure to select pucch resource id from resource sets according to
|
||||
// number of uci bits and pucch resource indicator pucch_resource
|
||||
// ( see table 9.2.3.2 in 38.213)
|
||||
for (int i=0; i<n_set; i++) {
|
||||
pucchresset = pucch_Config->resourceSetToAddModList->list.array[i];
|
||||
n_list = pucchresset->resourceList.list.count;
|
||||
if (pucchresset->pucch_ResourceSetId == 0 && O_uci<3) {
|
||||
if (pucch_resource < n_list)
|
||||
resource_id = pucchresset->resourceList.list.array[pucch_resource];
|
||||
else
|
||||
AssertFatal(1==0,"Couldn't fine pucch resource indicator %d in PUCCH resource set %d for %d UCI bits",pucch_resource,i,O_uci);
|
||||
}
|
||||
if (pucchresset->pucch_ResourceSetId == 1 && O_uci>2) {
|
||||
N2 = 2;
|
||||
// procedure to select pucch resource id from resource sets according to
|
||||
// number of uci bits and pucch resource indicator pucch_resource
|
||||
// ( see table 9.2.3.2 in 38.213)
|
||||
for (int i=0; i<n_set; i++) {
|
||||
pucchresset = pucch_Config->resourceSetToAddModList->list.array[i];
|
||||
n_list = pucchresset->resourceList.list.count;
|
||||
if (pucchresset->pucch_ResourceSetId == 0 && O_uci<3) {
|
||||
if (pucch_resource < n_list)
|
||||
resource_id = pucchresset->resourceList.list.array[pucch_resource];
|
||||
else
|
||||
AssertFatal(1==0,"Couldn't fine pucch resource indicator %d in PUCCH resource set %d for %d UCI bits",pucch_resource,i,O_uci);
|
||||
}
|
||||
if (pucchresset->pucch_ResourceSetId == 1 && O_uci>2) {
|
||||
#if (NR_RRC_VERSION >= MAKE_VERSION(16, 0, 0))
|
||||
N3 = pucchresset->maxPayloadSize!= NULL ? *pucchresset->maxPayloadSize : 1706;
|
||||
N3 = pucchresset->maxPayloadSize!= NULL ? *pucchresset->maxPayloadSize : 1706;
|
||||
#else
|
||||
N3 = pucchresset->maxPayloadMinus1!= NULL ? *pucchresset->maxPayloadMinus1 : 1706;
|
||||
N3 = pucchresset->maxPayloadMinus1!= NULL ? *pucchresset->maxPayloadMinus1 : 1706;
|
||||
#endif
|
||||
if (N2<O_uci && N3>O_uci) {
|
||||
if (pucch_resource < n_list)
|
||||
resource_id = pucchresset->resourceList.list.array[pucch_resource];
|
||||
else
|
||||
AssertFatal(1==0,"Couldn't fine pucch resource indicator %d in PUCCH resource set %d for %d UCI bits",pucch_resource,i,O_uci);
|
||||
}
|
||||
else N2 = N3;
|
||||
}
|
||||
}
|
||||
|
||||
AssertFatal(resource_id!=NULL,"Couldn-t find any matching PUCCH resource in the PUCCH resource sets");
|
||||
|
||||
AssertFatal(pucch_Config->resourceToAddModList!=NULL,
|
||||
"PUCCH resourceToAddModList is null\n");
|
||||
|
||||
n_list = pucch_Config->resourceToAddModList->list.count;
|
||||
AssertFatal(n_list>0,"PUCCH resourceToAddModList is empty\n");
|
||||
|
||||
// going through the list of PUCCH resources to find the one indexed by resource_id
|
||||
for (int i=0; i<n_list; i++) {
|
||||
pucchres = pucch_Config->resourceToAddModList->list.array[i];
|
||||
if (pucchres->pucch_ResourceId == *resource_id) {
|
||||
res_found = 1;
|
||||
pucch_pdu->prb_start = pucchres->startingPRB;
|
||||
pucch_pdu->rnti = rnti;
|
||||
// FIXME why there is only one frequency hopping flag
|
||||
// what about inter slot frequency hopping?
|
||||
pucch_pdu->freq_hop_flag = pucchres->intraSlotFrequencyHopping!= NULL ? 1 : 0;
|
||||
pucch_pdu->second_hop_prb = pucchres->secondHopPRB!= NULL ? *pucchres->secondHopPRB : 0;
|
||||
switch(pucchres->format.present) {
|
||||
case NR_PUCCH_Resource__format_PR_format0 :
|
||||
pucch_pdu->format_type = 0;
|
||||
pucch_pdu->initial_cyclic_shift = pucchres->format.choice.format0->initialCyclicShift;
|
||||
pucch_pdu->nr_of_symbols = pucchres->format.choice.format0->nrofSymbols;
|
||||
pucch_pdu->start_symbol_index = pucchres->format.choice.format0->startingSymbolIndex;
|
||||
pucch_pdu->sr_flag = O_sr;
|
||||
break;
|
||||
case NR_PUCCH_Resource__format_PR_format1 :
|
||||
pucch_pdu->format_type = 1;
|
||||
pucch_pdu->initial_cyclic_shift = pucchres->format.choice.format1->initialCyclicShift;
|
||||
pucch_pdu->nr_of_symbols = pucchres->format.choice.format1->nrofSymbols;
|
||||
pucch_pdu->start_symbol_index = pucchres->format.choice.format1->startingSymbolIndex;
|
||||
pucch_pdu->time_domain_occ_idx = pucchres->format.choice.format1->timeDomainOCC;
|
||||
pucch_pdu->sr_flag = O_sr;
|
||||
break;
|
||||
case NR_PUCCH_Resource__format_PR_format2 :
|
||||
pucch_pdu->format_type = 2;
|
||||
pucch_pdu->nr_of_symbols = pucchres->format.choice.format2->nrofSymbols;
|
||||
pucch_pdu->start_symbol_index = pucchres->format.choice.format2->startingSymbolIndex;
|
||||
pucch_pdu->data_scrambling_id = pusch_id!= NULL ? *pusch_id : *scc->physCellId;
|
||||
pucch_pdu->dmrs_scrambling_id = id0!= NULL ? *id0 : *scc->physCellId;
|
||||
pucch_pdu->prb_size = compute_pucch_prb_size(2,pucchres->format.choice.format2->nrofPRBs,
|
||||
O_uci+O_sr,O_csi,pucch_Config->format2->choice.setup->maxCodeRate,
|
||||
2,pucchres->format.choice.format2->nrofSymbols,8);
|
||||
pucch_pdu->bit_len_csi_part1 = O_csi;
|
||||
break;
|
||||
case NR_PUCCH_Resource__format_PR_format3 :
|
||||
pucch_pdu->format_type = 3;
|
||||
pucch_pdu->nr_of_symbols = pucchres->format.choice.format3->nrofSymbols;
|
||||
pucch_pdu->start_symbol_index = pucchres->format.choice.format3->startingSymbolIndex;
|
||||
pucch_pdu->data_scrambling_id = pusch_id!= NULL ? *pusch_id : *scc->physCellId;
|
||||
if (pucch_Config->format3 == NULL) {
|
||||
pucch_pdu->pi_2bpsk = 0;
|
||||
pucch_pdu->add_dmrs_flag = 0;
|
||||
}
|
||||
else {
|
||||
pucchfmt = pucch_Config->format3->choice.setup;
|
||||
pucch_pdu->pi_2bpsk = pucchfmt->pi2BPSK!= NULL ? 1 : 0;
|
||||
pucch_pdu->add_dmrs_flag = pucchfmt->additionalDMRS!= NULL ? 1 : 0;
|
||||
}
|
||||
int f3_dmrs_symbols;
|
||||
if (pucchres->format.choice.format3->nrofSymbols==4)
|
||||
f3_dmrs_symbols = 1<<pucch_pdu->freq_hop_flag;
|
||||
else {
|
||||
if(pucchres->format.choice.format3->nrofSymbols<10)
|
||||
f3_dmrs_symbols = 2;
|
||||
else
|
||||
f3_dmrs_symbols = 2<<pucch_pdu->add_dmrs_flag;
|
||||
}
|
||||
pucch_pdu->prb_size = compute_pucch_prb_size(3,pucchres->format.choice.format3->nrofPRBs,
|
||||
O_uci+O_sr,O_csi,pucch_Config->format3->choice.setup->maxCodeRate,
|
||||
2-pucch_pdu->pi_2bpsk,pucchres->format.choice.format3->nrofSymbols-f3_dmrs_symbols,12);
|
||||
pucch_pdu->bit_len_csi_part1 = O_csi;
|
||||
break;
|
||||
case NR_PUCCH_Resource__format_PR_format4 :
|
||||
pucch_pdu->format_type = 4;
|
||||
pucch_pdu->nr_of_symbols = pucchres->format.choice.format4->nrofSymbols;
|
||||
pucch_pdu->start_symbol_index = pucchres->format.choice.format4->startingSymbolIndex;
|
||||
pucch_pdu->pre_dft_occ_len = pucchres->format.choice.format4->occ_Length;
|
||||
pucch_pdu->pre_dft_occ_idx = pucchres->format.choice.format4->occ_Index;
|
||||
pucch_pdu->data_scrambling_id = pusch_id!= NULL ? *pusch_id : *scc->physCellId;
|
||||
if (pucch_Config->format3 == NULL) {
|
||||
pucch_pdu->pi_2bpsk = 0;
|
||||
pucch_pdu->add_dmrs_flag = 0;
|
||||
}
|
||||
else {
|
||||
pucchfmt = pucch_Config->format3->choice.setup;
|
||||
pucch_pdu->pi_2bpsk = pucchfmt->pi2BPSK!= NULL ? 1 : 0;
|
||||
pucch_pdu->add_dmrs_flag = pucchfmt->additionalDMRS!= NULL ? 1 : 0;
|
||||
}
|
||||
pucch_pdu->bit_len_csi_part1 = O_csi;
|
||||
break;
|
||||
default :
|
||||
AssertFatal(1==0,"Undefined PUCCH format \n");
|
||||
}
|
||||
}
|
||||
}
|
||||
AssertFatal(res_found==1,"No PUCCH resource found corresponding to id %ld\n",*resource_id);
|
||||
}
|
||||
else { // this is the default PUCCH configuration, PUCCH format 0 or 1
|
||||
int rsetindex = *scc->uplinkConfigCommon->initialUplinkBWP->pucch_ConfigCommon->choice.setup->pucch_ResourceCommon;
|
||||
int prboffset = r_pucch/default_pucch_csset[rsetindex];
|
||||
int prboffsetm8 = (r_pucch-8)/default_pucch_csset[rsetindex];
|
||||
pucch_pdu->prb_start = (r_pucch>>3)==0 ?
|
||||
default_pucch_prboffset[rsetindex] + prboffset:
|
||||
pucch_pdu->bwp_size-1-default_pucch_prboffset[rsetindex]-prboffsetm8;
|
||||
pucch_pdu->rnti = rnti;
|
||||
pucch_pdu->freq_hop_flag = 1;
|
||||
pucch_pdu->second_hop_prb = (r_pucch>>3)==0?
|
||||
pucch_pdu->bwp_size-1-default_pucch_prboffset[rsetindex]-prboffset:
|
||||
default_pucch_prboffset[rsetindex] + prboffsetm8;
|
||||
pucch_pdu->format_type = default_pucch_fmt[rsetindex];
|
||||
pucch_pdu->initial_cyclic_shift = r_pucch%default_pucch_csset[rsetindex];
|
||||
if (rsetindex==3||rsetindex==7||rsetindex==11) pucch_pdu->initial_cyclic_shift*=6;
|
||||
else if (rsetindex==1||rsetindex==2) pucch_pdu->initial_cyclic_shift*=3;
|
||||
else pucch_pdu->initial_cyclic_shift*=4;
|
||||
pucch_pdu->nr_of_symbols = default_pucch_numbsymb[rsetindex];
|
||||
pucch_pdu->start_symbol_index = default_pucch_firstsymb[rsetindex];
|
||||
if (pucch_pdu->format_type == 1) pucch_pdu->time_domain_occ_idx = 0; // check this!!
|
||||
pucch_pdu->sr_flag = O_sr;
|
||||
if (N2<O_uci && N3>O_uci) {
|
||||
if (pucch_resource < n_list)
|
||||
resource_id = pucchresset->resourceList.list.array[pucch_resource];
|
||||
else
|
||||
AssertFatal(1==0,"Couldn't fine pucch resource indicator %d in PUCCH resource set %d for %d UCI bits",pucch_resource,i,O_uci);
|
||||
}
|
||||
else N2 = N3;
|
||||
}
|
||||
}
|
||||
|
||||
AssertFatal(resource_id!=NULL,"Couldn-t find any matching PUCCH resource in the PUCCH resource sets");
|
||||
|
||||
AssertFatal(pucch_Config->resourceToAddModList!=NULL,
|
||||
"PUCCH resourceToAddModList is null\n");
|
||||
|
||||
n_list = pucch_Config->resourceToAddModList->list.count;
|
||||
AssertFatal(n_list>0,"PUCCH resourceToAddModList is empty\n");
|
||||
|
||||
// going through the list of PUCCH resources to find the one indexed by resource_id
|
||||
for (int i=0; i<n_list; i++) {
|
||||
pucchres = pucch_Config->resourceToAddModList->list.array[i];
|
||||
if (pucchres->pucch_ResourceId == *resource_id) {
|
||||
res_found = 1;
|
||||
pucch_pdu->prb_start = pucchres->startingPRB;
|
||||
pucch_pdu->rnti = rnti;
|
||||
// FIXME why there is only one frequency hopping flag
|
||||
// what about inter slot frequency hopping?
|
||||
pucch_pdu->freq_hop_flag = pucchres->intraSlotFrequencyHopping!= NULL ? 1 : 0;
|
||||
pucch_pdu->second_hop_prb = pucchres->secondHopPRB!= NULL ? *pucchres->secondHopPRB : 0;
|
||||
switch(pucchres->format.present) {
|
||||
case NR_PUCCH_Resource__format_PR_format0 :
|
||||
pucch_pdu->format_type = 0;
|
||||
pucch_pdu->initial_cyclic_shift = pucchres->format.choice.format0->initialCyclicShift;
|
||||
pucch_pdu->nr_of_symbols = pucchres->format.choice.format0->nrofSymbols;
|
||||
pucch_pdu->start_symbol_index = pucchres->format.choice.format0->startingSymbolIndex;
|
||||
pucch_pdu->sr_flag = O_sr;
|
||||
break;
|
||||
case NR_PUCCH_Resource__format_PR_format1 :
|
||||
pucch_pdu->format_type = 1;
|
||||
pucch_pdu->initial_cyclic_shift = pucchres->format.choice.format1->initialCyclicShift;
|
||||
pucch_pdu->nr_of_symbols = pucchres->format.choice.format1->nrofSymbols;
|
||||
pucch_pdu->start_symbol_index = pucchres->format.choice.format1->startingSymbolIndex;
|
||||
pucch_pdu->time_domain_occ_idx = pucchres->format.choice.format1->timeDomainOCC;
|
||||
pucch_pdu->sr_flag = O_sr;
|
||||
break;
|
||||
case NR_PUCCH_Resource__format_PR_format2 :
|
||||
pucch_pdu->format_type = 2;
|
||||
pucch_pdu->nr_of_symbols = pucchres->format.choice.format2->nrofSymbols;
|
||||
pucch_pdu->start_symbol_index = pucchres->format.choice.format2->startingSymbolIndex;
|
||||
pucch_pdu->data_scrambling_id = pusch_id!= NULL ? *pusch_id : *scc->physCellId;
|
||||
pucch_pdu->dmrs_scrambling_id = id0!= NULL ? *id0 : *scc->physCellId;
|
||||
pucch_pdu->prb_size = compute_pucch_prb_size(2,pucchres->format.choice.format2->nrofPRBs,
|
||||
O_uci+O_sr,O_csi,pucch_Config->format2->choice.setup->maxCodeRate,
|
||||
2,pucchres->format.choice.format2->nrofSymbols,8);
|
||||
pucch_pdu->bit_len_csi_part1 = O_csi;
|
||||
break;
|
||||
case NR_PUCCH_Resource__format_PR_format3 :
|
||||
pucch_pdu->format_type = 3;
|
||||
pucch_pdu->nr_of_symbols = pucchres->format.choice.format3->nrofSymbols;
|
||||
pucch_pdu->start_symbol_index = pucchres->format.choice.format3->startingSymbolIndex;
|
||||
pucch_pdu->data_scrambling_id = pusch_id!= NULL ? *pusch_id : *scc->physCellId;
|
||||
if (pucch_Config->format3 == NULL) {
|
||||
pucch_pdu->pi_2bpsk = 0;
|
||||
pucch_pdu->add_dmrs_flag = 0;
|
||||
}
|
||||
else {
|
||||
pucchfmt = pucch_Config->format3->choice.setup;
|
||||
pucch_pdu->pi_2bpsk = pucchfmt->pi2BPSK!= NULL ? 1 : 0;
|
||||
pucch_pdu->add_dmrs_flag = pucchfmt->additionalDMRS!= NULL ? 1 : 0;
|
||||
}
|
||||
int f3_dmrs_symbols;
|
||||
if (pucchres->format.choice.format3->nrofSymbols==4)
|
||||
f3_dmrs_symbols = 1<<pucch_pdu->freq_hop_flag;
|
||||
else {
|
||||
if(pucchres->format.choice.format3->nrofSymbols<10)
|
||||
f3_dmrs_symbols = 2;
|
||||
else
|
||||
f3_dmrs_symbols = 2<<pucch_pdu->add_dmrs_flag;
|
||||
}
|
||||
pucch_pdu->prb_size = compute_pucch_prb_size(3,pucchres->format.choice.format3->nrofPRBs,
|
||||
O_uci+O_sr,O_csi,pucch_Config->format3->choice.setup->maxCodeRate,
|
||||
2-pucch_pdu->pi_2bpsk,pucchres->format.choice.format3->nrofSymbols-f3_dmrs_symbols,12);
|
||||
pucch_pdu->bit_len_csi_part1 = O_csi;
|
||||
break;
|
||||
case NR_PUCCH_Resource__format_PR_format4 :
|
||||
pucch_pdu->format_type = 4;
|
||||
pucch_pdu->nr_of_symbols = pucchres->format.choice.format4->nrofSymbols;
|
||||
pucch_pdu->start_symbol_index = pucchres->format.choice.format4->startingSymbolIndex;
|
||||
pucch_pdu->pre_dft_occ_len = pucchres->format.choice.format4->occ_Length;
|
||||
pucch_pdu->pre_dft_occ_idx = pucchres->format.choice.format4->occ_Index;
|
||||
pucch_pdu->data_scrambling_id = pusch_id!= NULL ? *pusch_id : *scc->physCellId;
|
||||
if (pucch_Config->format3 == NULL) {
|
||||
pucch_pdu->pi_2bpsk = 0;
|
||||
pucch_pdu->add_dmrs_flag = 0;
|
||||
}
|
||||
else {
|
||||
pucchfmt = pucch_Config->format3->choice.setup;
|
||||
pucch_pdu->pi_2bpsk = pucchfmt->pi2BPSK!= NULL ? 1 : 0;
|
||||
pucch_pdu->add_dmrs_flag = pucchfmt->additionalDMRS!= NULL ? 1 : 0;
|
||||
}
|
||||
pucch_pdu->bit_len_csi_part1 = O_csi;
|
||||
break;
|
||||
default :
|
||||
AssertFatal(1==0,"Undefined PUCCH format \n");
|
||||
}
|
||||
}
|
||||
}
|
||||
AssertFatal(res_found==1,"No PUCCH resource found corresponding to id %ld\n",*resource_id);
|
||||
}
|
||||
else { // this is the default PUCCH configuration, PUCCH format 0 or 1
|
||||
int rsetindex = *scc->uplinkConfigCommon->initialUplinkBWP->pucch_ConfigCommon->choice.setup->pucch_ResourceCommon;
|
||||
int prboffset = r_pucch/default_pucch_csset[rsetindex];
|
||||
int prboffsetm8 = (r_pucch-8)/default_pucch_csset[rsetindex];
|
||||
pucch_pdu->prb_start = (r_pucch>>3)==0 ?
|
||||
default_pucch_prboffset[rsetindex] + prboffset:
|
||||
pucch_pdu->bwp_size-1-default_pucch_prboffset[rsetindex]-prboffsetm8;
|
||||
pucch_pdu->rnti = rnti;
|
||||
pucch_pdu->freq_hop_flag = 1;
|
||||
pucch_pdu->second_hop_prb = (r_pucch>>3)==0?
|
||||
pucch_pdu->bwp_size-1-default_pucch_prboffset[rsetindex]-prboffset:
|
||||
default_pucch_prboffset[rsetindex] + prboffsetm8;
|
||||
pucch_pdu->format_type = default_pucch_fmt[rsetindex];
|
||||
pucch_pdu->initial_cyclic_shift = r_pucch%default_pucch_csset[rsetindex];
|
||||
if (rsetindex==3||rsetindex==7||rsetindex==11) pucch_pdu->initial_cyclic_shift*=6;
|
||||
else if (rsetindex==1||rsetindex==2) pucch_pdu->initial_cyclic_shift*=3;
|
||||
else pucch_pdu->initial_cyclic_shift*=4;
|
||||
pucch_pdu->nr_of_symbols = default_pucch_numbsymb[rsetindex];
|
||||
pucch_pdu->start_symbol_index = default_pucch_firstsymb[rsetindex];
|
||||
if (pucch_pdu->format_type == 1) pucch_pdu->time_domain_occ_idx = 0; // check this!!
|
||||
pucch_pdu->sr_flag = O_sr;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -2056,8 +2055,6 @@ void nr_csirs_scheduling(int Mod_idP,
|
||||
|
||||
for (int UE_id = UE_list->head; UE_id >= 0; UE_id = UE_list->next[UE_id]) {
|
||||
|
||||
NR_NZP_CSI_RS_Resource_t *nzpcsi;
|
||||
int period, offset;
|
||||
NR_UE_sched_ctrl_t *sched_ctrl = &UE_info->UE_sched_ctrl[UE_id];
|
||||
NR_CellGroupConfig_t *CellGroup = UE_info->CellGroup[UE_id];
|
||||
|
||||
@@ -2066,182 +2063,185 @@ void nr_csirs_scheduling(int Mod_idP,
|
||||
|
||||
NR_CSI_MeasConfig_t *csi_measconfig = CellGroup->spCellConfig->spCellConfigDedicated->csi_MeasConfig->choice.setup;
|
||||
|
||||
nfapi_nr_dl_tti_request_body_t *dl_req = &gNB_mac->DL_req[CC_id].dl_tti_request_body;
|
||||
NR_BWP_Downlink_t *bwp=CellGroup->spCellConfig->spCellConfigDedicated->downlinkBWP_ToAddModList->list.array[sched_ctrl->active_bwp->bwp_Id-1];
|
||||
if (csi_measconfig->nzp_CSI_RS_ResourceToAddModList != NULL) {
|
||||
|
||||
AssertFatal(csi_measconfig->nzp_CSI_RS_ResourceToAddModList->list.count>0,"NO CSI report configuration available");
|
||||
NR_NZP_CSI_RS_Resource_t *nzpcsi;
|
||||
int period, offset;
|
||||
|
||||
for (int id = 0; id < csi_measconfig->nzp_CSI_RS_ResourceToAddModList->list.count; id++){
|
||||
nzpcsi = csi_measconfig->nzp_CSI_RS_ResourceToAddModList->list.array[id];
|
||||
NR_CSI_RS_ResourceMapping_t resourceMapping = nzpcsi->resourceMapping;
|
||||
csi_period_offset(NULL,nzpcsi,&period,&offset);
|
||||
nfapi_nr_dl_tti_request_body_t *dl_req = &gNB_mac->DL_req[CC_id].dl_tti_request_body;
|
||||
NR_BWP_Downlink_t *bwp=CellGroup->spCellConfig->spCellConfigDedicated->downlinkBWP_ToAddModList->list.array[sched_ctrl->active_bwp->bwp_Id-1];
|
||||
|
||||
if((frame*n_slots_frame+slot-offset)%period == 0) {
|
||||
for (int id = 0; id < csi_measconfig->nzp_CSI_RS_ResourceToAddModList->list.count; id++){
|
||||
nzpcsi = csi_measconfig->nzp_CSI_RS_ResourceToAddModList->list.array[id];
|
||||
NR_CSI_RS_ResourceMapping_t resourceMapping = nzpcsi->resourceMapping;
|
||||
csi_period_offset(NULL,nzpcsi,&period,&offset);
|
||||
|
||||
LOG_I(MAC,"Scheduling CSI-RS in frame %d slot %d\n",frame,slot);
|
||||
if((frame*n_slots_frame+slot-offset)%period == 0) {
|
||||
|
||||
nfapi_nr_dl_tti_request_pdu_t *dl_tti_csirs_pdu = &dl_req->dl_tti_pdu_list[dl_req->nPDUs];
|
||||
memset((void*)dl_tti_csirs_pdu,0,sizeof(nfapi_nr_dl_tti_request_pdu_t));
|
||||
dl_tti_csirs_pdu->PDUType = NFAPI_NR_DL_TTI_CSI_RS_PDU_TYPE;
|
||||
dl_tti_csirs_pdu->PDUSize = (uint8_t)(2+sizeof(nfapi_nr_dl_tti_csi_rs_pdu));
|
||||
LOG_I(MAC,"Scheduling CSI-RS in frame %d slot %d\n",frame,slot);
|
||||
|
||||
nfapi_nr_dl_tti_csi_rs_pdu_rel15_t *csirs_pdu_rel15 = &dl_tti_csirs_pdu->csi_rs_pdu.csi_rs_pdu_rel15;
|
||||
nfapi_nr_dl_tti_request_pdu_t *dl_tti_csirs_pdu = &dl_req->dl_tti_pdu_list[dl_req->nPDUs];
|
||||
memset((void*)dl_tti_csirs_pdu,0,sizeof(nfapi_nr_dl_tti_request_pdu_t));
|
||||
dl_tti_csirs_pdu->PDUType = NFAPI_NR_DL_TTI_CSI_RS_PDU_TYPE;
|
||||
dl_tti_csirs_pdu->PDUSize = (uint8_t)(2+sizeof(nfapi_nr_dl_tti_csi_rs_pdu));
|
||||
|
||||
csirs_pdu_rel15->bwp_size = NRRIV2BW(bwp->bwp_Common->genericParameters.locationAndBandwidth,275);
|
||||
csirs_pdu_rel15->bwp_start = NRRIV2PRBOFFSET(bwp->bwp_Common->genericParameters.locationAndBandwidth,275);
|
||||
csirs_pdu_rel15->subcarrier_spacing = bwp->bwp_Common->genericParameters.subcarrierSpacing;
|
||||
if (bwp->bwp_Common->genericParameters.cyclicPrefix)
|
||||
csirs_pdu_rel15->cyclic_prefix = *bwp->bwp_Common->genericParameters.cyclicPrefix;
|
||||
else
|
||||
csirs_pdu_rel15->cyclic_prefix = 0;
|
||||
nfapi_nr_dl_tti_csi_rs_pdu_rel15_t *csirs_pdu_rel15 = &dl_tti_csirs_pdu->csi_rs_pdu.csi_rs_pdu_rel15;
|
||||
|
||||
csirs_pdu_rel15->start_rb = resourceMapping.freqBand.startingRB;
|
||||
csirs_pdu_rel15->nr_of_rbs = resourceMapping.freqBand.nrofRBs;
|
||||
csirs_pdu_rel15->csi_type = 1; // NZP-CSI-RS
|
||||
csirs_pdu_rel15->symb_l0 = resourceMapping.firstOFDMSymbolInTimeDomain;
|
||||
if (resourceMapping.firstOFDMSymbolInTimeDomain2)
|
||||
csirs_pdu_rel15->symb_l1 = *resourceMapping.firstOFDMSymbolInTimeDomain2;
|
||||
csirs_pdu_rel15->cdm_type = resourceMapping.cdm_Type;
|
||||
csirs_pdu_rel15->freq_density = resourceMapping.density.present;
|
||||
if ((resourceMapping.density.present == NR_CSI_RS_ResourceMapping__density_PR_dot5)
|
||||
&& (resourceMapping.density.choice.dot5 == NR_CSI_RS_ResourceMapping__density__dot5_evenPRBs))
|
||||
csirs_pdu_rel15->freq_density--;
|
||||
csirs_pdu_rel15->scramb_id = nzpcsi->scramblingID;
|
||||
csirs_pdu_rel15->power_control_offset = nzpcsi->powerControlOffset + 8;
|
||||
if (nzpcsi->powerControlOffsetSS)
|
||||
csirs_pdu_rel15->power_control_offset_ss = *nzpcsi->powerControlOffsetSS;
|
||||
else
|
||||
csirs_pdu_rel15->power_control_offset_ss = 1; // 0 dB
|
||||
switch(resourceMapping.frequencyDomainAllocation.present){
|
||||
case NR_CSI_RS_ResourceMapping__frequencyDomainAllocation_PR_row1:
|
||||
csirs_pdu_rel15->row = 1;
|
||||
csirs_pdu_rel15->freq_domain = ((resourceMapping.frequencyDomainAllocation.choice.row1.buf[0])>>4)&0x0f;
|
||||
for (int rb = csirs_pdu_rel15->start_rb; rb < (csirs_pdu_rel15->start_rb + csirs_pdu_rel15->nr_of_rbs); rb++)
|
||||
vrb_map[rb] |= (1 << csirs_pdu_rel15->symb_l0);
|
||||
break;
|
||||
case NR_CSI_RS_ResourceMapping__frequencyDomainAllocation_PR_row2:
|
||||
csirs_pdu_rel15->row = 2;
|
||||
csirs_pdu_rel15->freq_domain = (((resourceMapping.frequencyDomainAllocation.choice.row2.buf[1]>>4)&0x0f) |
|
||||
((resourceMapping.frequencyDomainAllocation.choice.row2.buf[0]<<8)&0xff0));
|
||||
for (int rb = csirs_pdu_rel15->start_rb; rb < (csirs_pdu_rel15->start_rb + csirs_pdu_rel15->nr_of_rbs); rb++)
|
||||
vrb_map[rb] |= (1 << csirs_pdu_rel15->symb_l0);
|
||||
break;
|
||||
case NR_CSI_RS_ResourceMapping__frequencyDomainAllocation_PR_row4:
|
||||
csirs_pdu_rel15->row = 4;
|
||||
csirs_pdu_rel15->freq_domain = ((resourceMapping.frequencyDomainAllocation.choice.row4.buf[0])>>5)&0x07;
|
||||
for (int rb = csirs_pdu_rel15->start_rb; rb < (csirs_pdu_rel15->start_rb + csirs_pdu_rel15->nr_of_rbs); rb++)
|
||||
vrb_map[rb] |= (1 << csirs_pdu_rel15->symb_l0);
|
||||
break;
|
||||
case NR_CSI_RS_ResourceMapping__frequencyDomainAllocation_PR_other:
|
||||
csirs_pdu_rel15->freq_domain = ((resourceMapping.frequencyDomainAllocation.choice.other.buf[0])>>2)&0x3f;
|
||||
// determining the row of table 7.4.1.5.3-1 in 38.211
|
||||
switch(resourceMapping.nrofPorts){
|
||||
case NR_CSI_RS_ResourceMapping__nrofPorts_p1:
|
||||
break;
|
||||
case NR_CSI_RS_ResourceMapping__nrofPorts_p2:
|
||||
csirs_pdu_rel15->row = 3;
|
||||
for (int rb = csirs_pdu_rel15->start_rb; rb < (csirs_pdu_rel15->start_rb + csirs_pdu_rel15->nr_of_rbs); rb++)
|
||||
vrb_map[rb] |= (1 << csirs_pdu_rel15->symb_l0);
|
||||
break;
|
||||
case NR_CSI_RS_ResourceMapping__nrofPorts_p4:
|
||||
csirs_pdu_rel15->row = 5;
|
||||
for (int rb = csirs_pdu_rel15->start_rb; rb < (csirs_pdu_rel15->start_rb + csirs_pdu_rel15->nr_of_rbs); rb++)
|
||||
vrb_map[rb] |= ((1 << csirs_pdu_rel15->symb_l0) | (2 << csirs_pdu_rel15->symb_l0));
|
||||
break;
|
||||
case NR_CSI_RS_ResourceMapping__nrofPorts_p8:
|
||||
if (resourceMapping.cdm_Type == NR_CSI_RS_ResourceMapping__cdm_Type_cdm4_FD2_TD2) {
|
||||
csirs_pdu_rel15->row = 8;
|
||||
csirs_pdu_rel15->bwp_size = NRRIV2BW(bwp->bwp_Common->genericParameters.locationAndBandwidth,275);
|
||||
csirs_pdu_rel15->bwp_start = NRRIV2PRBOFFSET(bwp->bwp_Common->genericParameters.locationAndBandwidth,275);
|
||||
csirs_pdu_rel15->subcarrier_spacing = bwp->bwp_Common->genericParameters.subcarrierSpacing;
|
||||
if (bwp->bwp_Common->genericParameters.cyclicPrefix)
|
||||
csirs_pdu_rel15->cyclic_prefix = *bwp->bwp_Common->genericParameters.cyclicPrefix;
|
||||
else
|
||||
csirs_pdu_rel15->cyclic_prefix = 0;
|
||||
|
||||
csirs_pdu_rel15->start_rb = resourceMapping.freqBand.startingRB;
|
||||
csirs_pdu_rel15->nr_of_rbs = resourceMapping.freqBand.nrofRBs;
|
||||
csirs_pdu_rel15->csi_type = 1; // NZP-CSI-RS
|
||||
csirs_pdu_rel15->symb_l0 = resourceMapping.firstOFDMSymbolInTimeDomain;
|
||||
if (resourceMapping.firstOFDMSymbolInTimeDomain2)
|
||||
csirs_pdu_rel15->symb_l1 = *resourceMapping.firstOFDMSymbolInTimeDomain2;
|
||||
csirs_pdu_rel15->cdm_type = resourceMapping.cdm_Type;
|
||||
csirs_pdu_rel15->freq_density = resourceMapping.density.present;
|
||||
if ((resourceMapping.density.present == NR_CSI_RS_ResourceMapping__density_PR_dot5)
|
||||
&& (resourceMapping.density.choice.dot5 == NR_CSI_RS_ResourceMapping__density__dot5_evenPRBs))
|
||||
csirs_pdu_rel15->freq_density--;
|
||||
csirs_pdu_rel15->scramb_id = nzpcsi->scramblingID;
|
||||
csirs_pdu_rel15->power_control_offset = nzpcsi->powerControlOffset + 8;
|
||||
if (nzpcsi->powerControlOffsetSS)
|
||||
csirs_pdu_rel15->power_control_offset_ss = *nzpcsi->powerControlOffsetSS;
|
||||
else
|
||||
csirs_pdu_rel15->power_control_offset_ss = 1; // 0 dB
|
||||
switch(resourceMapping.frequencyDomainAllocation.present){
|
||||
case NR_CSI_RS_ResourceMapping__frequencyDomainAllocation_PR_row1:
|
||||
csirs_pdu_rel15->row = 1;
|
||||
csirs_pdu_rel15->freq_domain = ((resourceMapping.frequencyDomainAllocation.choice.row1.buf[0])>>4)&0x0f;
|
||||
for (int rb = csirs_pdu_rel15->start_rb; rb < (csirs_pdu_rel15->start_rb + csirs_pdu_rel15->nr_of_rbs); rb++)
|
||||
vrb_map[rb] |= (1 << csirs_pdu_rel15->symb_l0);
|
||||
break;
|
||||
case NR_CSI_RS_ResourceMapping__frequencyDomainAllocation_PR_row2:
|
||||
csirs_pdu_rel15->row = 2;
|
||||
csirs_pdu_rel15->freq_domain = (((resourceMapping.frequencyDomainAllocation.choice.row2.buf[1]>>4)&0x0f) |
|
||||
((resourceMapping.frequencyDomainAllocation.choice.row2.buf[0]<<8)&0xff0));
|
||||
for (int rb = csirs_pdu_rel15->start_rb; rb < (csirs_pdu_rel15->start_rb + csirs_pdu_rel15->nr_of_rbs); rb++)
|
||||
vrb_map[rb] |= (1 << csirs_pdu_rel15->symb_l0);
|
||||
break;
|
||||
case NR_CSI_RS_ResourceMapping__frequencyDomainAllocation_PR_row4:
|
||||
csirs_pdu_rel15->row = 4;
|
||||
csirs_pdu_rel15->freq_domain = ((resourceMapping.frequencyDomainAllocation.choice.row4.buf[0])>>5)&0x07;
|
||||
for (int rb = csirs_pdu_rel15->start_rb; rb < (csirs_pdu_rel15->start_rb + csirs_pdu_rel15->nr_of_rbs); rb++)
|
||||
vrb_map[rb] |= (1 << csirs_pdu_rel15->symb_l0);
|
||||
break;
|
||||
case NR_CSI_RS_ResourceMapping__frequencyDomainAllocation_PR_other:
|
||||
csirs_pdu_rel15->freq_domain = ((resourceMapping.frequencyDomainAllocation.choice.other.buf[0])>>2)&0x3f;
|
||||
// determining the row of table 7.4.1.5.3-1 in 38.211
|
||||
switch(resourceMapping.nrofPorts){
|
||||
case NR_CSI_RS_ResourceMapping__nrofPorts_p1:
|
||||
break;
|
||||
case NR_CSI_RS_ResourceMapping__nrofPorts_p2:
|
||||
csirs_pdu_rel15->row = 3;
|
||||
for (int rb = csirs_pdu_rel15->start_rb; rb < (csirs_pdu_rel15->start_rb + csirs_pdu_rel15->nr_of_rbs); rb++)
|
||||
vrb_map[rb] |= (1 << csirs_pdu_rel15->symb_l0);
|
||||
break;
|
||||
case NR_CSI_RS_ResourceMapping__nrofPorts_p4:
|
||||
csirs_pdu_rel15->row = 5;
|
||||
for (int rb = csirs_pdu_rel15->start_rb; rb < (csirs_pdu_rel15->start_rb + csirs_pdu_rel15->nr_of_rbs); rb++)
|
||||
vrb_map[rb] |= ((1 << csirs_pdu_rel15->symb_l0) | (2 << csirs_pdu_rel15->symb_l0));
|
||||
}
|
||||
else{
|
||||
int num_k = 0;
|
||||
for (int k=0; k<6; k++)
|
||||
num_k+=(((csirs_pdu_rel15->freq_domain)>>k)&0x01);
|
||||
if(num_k==4) {
|
||||
csirs_pdu_rel15->row = 6;
|
||||
for (int rb = csirs_pdu_rel15->start_rb; rb < (csirs_pdu_rel15->start_rb + csirs_pdu_rel15->nr_of_rbs); rb++)
|
||||
vrb_map[rb] |= (1 << csirs_pdu_rel15->symb_l0);
|
||||
}
|
||||
else {
|
||||
csirs_pdu_rel15->row = 7;
|
||||
break;
|
||||
case NR_CSI_RS_ResourceMapping__nrofPorts_p8:
|
||||
if (resourceMapping.cdm_Type == NR_CSI_RS_ResourceMapping__cdm_Type_cdm4_FD2_TD2) {
|
||||
csirs_pdu_rel15->row = 8;
|
||||
for (int rb = csirs_pdu_rel15->start_rb; rb < (csirs_pdu_rel15->start_rb + csirs_pdu_rel15->nr_of_rbs); rb++)
|
||||
vrb_map[rb] |= ((1 << csirs_pdu_rel15->symb_l0) | (2 << csirs_pdu_rel15->symb_l0));
|
||||
}
|
||||
}
|
||||
break;
|
||||
case NR_CSI_RS_ResourceMapping__nrofPorts_p12:
|
||||
if (resourceMapping.cdm_Type == NR_CSI_RS_ResourceMapping__cdm_Type_cdm4_FD2_TD2) {
|
||||
csirs_pdu_rel15->row = 10;
|
||||
else{
|
||||
int num_k = 0;
|
||||
for (int k=0; k<6; k++)
|
||||
num_k+=(((csirs_pdu_rel15->freq_domain)>>k)&0x01);
|
||||
if(num_k==4) {
|
||||
csirs_pdu_rel15->row = 6;
|
||||
for (int rb = csirs_pdu_rel15->start_rb; rb < (csirs_pdu_rel15->start_rb + csirs_pdu_rel15->nr_of_rbs); rb++)
|
||||
vrb_map[rb] |= (1 << csirs_pdu_rel15->symb_l0);
|
||||
}
|
||||
else {
|
||||
csirs_pdu_rel15->row = 7;
|
||||
for (int rb = csirs_pdu_rel15->start_rb; rb < (csirs_pdu_rel15->start_rb + csirs_pdu_rel15->nr_of_rbs); rb++)
|
||||
vrb_map[rb] |= ((1 << csirs_pdu_rel15->symb_l0) | (2 << csirs_pdu_rel15->symb_l0));
|
||||
}
|
||||
}
|
||||
break;
|
||||
case NR_CSI_RS_ResourceMapping__nrofPorts_p12:
|
||||
if (resourceMapping.cdm_Type == NR_CSI_RS_ResourceMapping__cdm_Type_cdm4_FD2_TD2) {
|
||||
csirs_pdu_rel15->row = 10;
|
||||
for (int rb = csirs_pdu_rel15->start_rb; rb < (csirs_pdu_rel15->start_rb + csirs_pdu_rel15->nr_of_rbs); rb++)
|
||||
vrb_map[rb] |= ((1 << csirs_pdu_rel15->symb_l0) | (2 << csirs_pdu_rel15->symb_l0));
|
||||
}
|
||||
else {
|
||||
csirs_pdu_rel15->row = 9;
|
||||
for (int rb = csirs_pdu_rel15->start_rb; rb < (csirs_pdu_rel15->start_rb + csirs_pdu_rel15->nr_of_rbs); rb++)
|
||||
vrb_map[rb] |= (1 << csirs_pdu_rel15->symb_l0);
|
||||
}
|
||||
break;
|
||||
case NR_CSI_RS_ResourceMapping__nrofPorts_p16:
|
||||
if (resourceMapping.cdm_Type == NR_CSI_RS_ResourceMapping__cdm_Type_cdm4_FD2_TD2)
|
||||
csirs_pdu_rel15->row = 12;
|
||||
else
|
||||
csirs_pdu_rel15->row = 11;
|
||||
for (int rb = csirs_pdu_rel15->start_rb; rb < (csirs_pdu_rel15->start_rb + csirs_pdu_rel15->nr_of_rbs); rb++)
|
||||
vrb_map[rb] |= ((1 << csirs_pdu_rel15->symb_l0) | (2 << csirs_pdu_rel15->symb_l0));
|
||||
}
|
||||
else {
|
||||
csirs_pdu_rel15->row = 9;
|
||||
for (int rb = csirs_pdu_rel15->start_rb; rb < (csirs_pdu_rel15->start_rb + csirs_pdu_rel15->nr_of_rbs); rb++)
|
||||
vrb_map[rb] |= (1 << csirs_pdu_rel15->symb_l0);
|
||||
}
|
||||
break;
|
||||
case NR_CSI_RS_ResourceMapping__nrofPorts_p16:
|
||||
if (resourceMapping.cdm_Type == NR_CSI_RS_ResourceMapping__cdm_Type_cdm4_FD2_TD2)
|
||||
csirs_pdu_rel15->row = 12;
|
||||
else
|
||||
csirs_pdu_rel15->row = 11;
|
||||
for (int rb = csirs_pdu_rel15->start_rb; rb < (csirs_pdu_rel15->start_rb + csirs_pdu_rel15->nr_of_rbs); rb++)
|
||||
vrb_map[rb] |= ((1 << csirs_pdu_rel15->symb_l0) | (2 << csirs_pdu_rel15->symb_l0));
|
||||
break;
|
||||
case NR_CSI_RS_ResourceMapping__nrofPorts_p24:
|
||||
if (resourceMapping.cdm_Type == NR_CSI_RS_ResourceMapping__cdm_Type_cdm4_FD2_TD2) {
|
||||
csirs_pdu_rel15->row = 14;
|
||||
for (int rb = csirs_pdu_rel15->start_rb; rb < (csirs_pdu_rel15->start_rb + csirs_pdu_rel15->nr_of_rbs); rb++)
|
||||
vrb_map[rb] |= ((3 << csirs_pdu_rel15->symb_l0) | (3 << csirs_pdu_rel15->symb_l1));
|
||||
}
|
||||
else{
|
||||
if (resourceMapping.cdm_Type == NR_CSI_RS_ResourceMapping__cdm_Type_cdm8_FD2_TD4) {
|
||||
csirs_pdu_rel15->row = 15;
|
||||
for (int rb = csirs_pdu_rel15->start_rb; rb < (csirs_pdu_rel15->start_rb + csirs_pdu_rel15->nr_of_rbs); rb++)
|
||||
vrb_map[rb] |= (7 << csirs_pdu_rel15->symb_l0);
|
||||
}
|
||||
else {
|
||||
csirs_pdu_rel15->row = 13;
|
||||
break;
|
||||
case NR_CSI_RS_ResourceMapping__nrofPorts_p24:
|
||||
if (resourceMapping.cdm_Type == NR_CSI_RS_ResourceMapping__cdm_Type_cdm4_FD2_TD2) {
|
||||
csirs_pdu_rel15->row = 14;
|
||||
for (int rb = csirs_pdu_rel15->start_rb; rb < (csirs_pdu_rel15->start_rb + csirs_pdu_rel15->nr_of_rbs); rb++)
|
||||
vrb_map[rb] |= ((3 << csirs_pdu_rel15->symb_l0) | (3 << csirs_pdu_rel15->symb_l1));
|
||||
}
|
||||
}
|
||||
break;
|
||||
case NR_CSI_RS_ResourceMapping__nrofPorts_p32:
|
||||
if (resourceMapping.cdm_Type == NR_CSI_RS_ResourceMapping__cdm_Type_cdm4_FD2_TD2) {
|
||||
csirs_pdu_rel15->row = 17;
|
||||
for (int rb = csirs_pdu_rel15->start_rb; rb < (csirs_pdu_rel15->start_rb + csirs_pdu_rel15->nr_of_rbs); rb++)
|
||||
vrb_map[rb] |= ((3 << csirs_pdu_rel15->symb_l0) | (3 << csirs_pdu_rel15->symb_l1));
|
||||
}
|
||||
else{
|
||||
if (resourceMapping.cdm_Type == NR_CSI_RS_ResourceMapping__cdm_Type_cdm8_FD2_TD4) {
|
||||
csirs_pdu_rel15->row = 18;
|
||||
for (int rb = csirs_pdu_rel15->start_rb; rb < (csirs_pdu_rel15->start_rb + csirs_pdu_rel15->nr_of_rbs); rb++)
|
||||
vrb_map[rb] |= (7 << csirs_pdu_rel15->symb_l0);
|
||||
else{
|
||||
if (resourceMapping.cdm_Type == NR_CSI_RS_ResourceMapping__cdm_Type_cdm8_FD2_TD4) {
|
||||
csirs_pdu_rel15->row = 15;
|
||||
for (int rb = csirs_pdu_rel15->start_rb; rb < (csirs_pdu_rel15->start_rb + csirs_pdu_rel15->nr_of_rbs); rb++)
|
||||
vrb_map[rb] |= (7 << csirs_pdu_rel15->symb_l0);
|
||||
}
|
||||
else {
|
||||
csirs_pdu_rel15->row = 13;
|
||||
for (int rb = csirs_pdu_rel15->start_rb; rb < (csirs_pdu_rel15->start_rb + csirs_pdu_rel15->nr_of_rbs); rb++)
|
||||
vrb_map[rb] |= ((3 << csirs_pdu_rel15->symb_l0) | (3 << csirs_pdu_rel15->symb_l1));
|
||||
}
|
||||
}
|
||||
else {
|
||||
csirs_pdu_rel15->row = 16;
|
||||
break;
|
||||
case NR_CSI_RS_ResourceMapping__nrofPorts_p32:
|
||||
if (resourceMapping.cdm_Type == NR_CSI_RS_ResourceMapping__cdm_Type_cdm4_FD2_TD2) {
|
||||
csirs_pdu_rel15->row = 17;
|
||||
for (int rb = csirs_pdu_rel15->start_rb; rb < (csirs_pdu_rel15->start_rb + csirs_pdu_rel15->nr_of_rbs); rb++)
|
||||
vrb_map[rb] |= ((3 << csirs_pdu_rel15->symb_l0) | (3 << csirs_pdu_rel15->symb_l1));
|
||||
}
|
||||
}
|
||||
break;
|
||||
default:
|
||||
AssertFatal(1==0,"Invalid number of ports in CSI-RS resource\n");
|
||||
}
|
||||
break;
|
||||
default:
|
||||
AssertFatal(1==0,"Invalid freqency domain allocation in CSI-RS resource\n");
|
||||
else{
|
||||
if (resourceMapping.cdm_Type == NR_CSI_RS_ResourceMapping__cdm_Type_cdm8_FD2_TD4) {
|
||||
csirs_pdu_rel15->row = 18;
|
||||
for (int rb = csirs_pdu_rel15->start_rb; rb < (csirs_pdu_rel15->start_rb + csirs_pdu_rel15->nr_of_rbs); rb++)
|
||||
vrb_map[rb] |= (7 << csirs_pdu_rel15->symb_l0);
|
||||
}
|
||||
else {
|
||||
csirs_pdu_rel15->row = 16;
|
||||
for (int rb = csirs_pdu_rel15->start_rb; rb < (csirs_pdu_rel15->start_rb + csirs_pdu_rel15->nr_of_rbs); rb++)
|
||||
vrb_map[rb] |= ((3 << csirs_pdu_rel15->symb_l0) | (3 << csirs_pdu_rel15->symb_l1));
|
||||
}
|
||||
}
|
||||
break;
|
||||
default:
|
||||
AssertFatal(1==0,"Invalid number of ports in CSI-RS resource\n");
|
||||
}
|
||||
break;
|
||||
default:
|
||||
AssertFatal(1==0,"Invalid freqency domain allocation in CSI-RS resource\n");
|
||||
}
|
||||
dl_req->nPDUs++;
|
||||
}
|
||||
dl_req->nPDUs++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
bool find_free_CCE(module_id_t module_id,
|
||||
sub_frame_t slot,
|
||||
int UE_id){
|
||||
|
||||
@@ -98,17 +98,17 @@ int ssb_rsrp_sorted[MAX_NUM_SSB] = {0};
|
||||
//stored -1 for invalid values
|
||||
int L1_SSB_CSI_RSRP_measReport_mapping_38133_10_1_6_1_1[128] = {
|
||||
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, //0 - 9
|
||||
-1, -1, -1, -1, -1, -1, -140, -139, -138, -137, //10 - 19
|
||||
-136, -135, -134, -133, -132, -131, -130, -129, -128, -127, //20 - 29
|
||||
-126, -125, -124, -123, -122, -121, -120, -119, -118, -117, //30 - 39
|
||||
-116, -115, -114, -113, -112, -111, -110, -109, -108, -107, //40 - 49
|
||||
-106, -105, -104, -103, -102, -101, -100, -99, -98, -97, //50 - 59
|
||||
-96, -95, -94, -93, -92, -91, -90, -89, -88, -87, //60 - 69
|
||||
-86, -85, -84, -83, -82, -81, -80, -79, -78, -77, //70 - 79
|
||||
-76, -75, -74, -73, -72, -71, -70, -69, -68, -67, //80 - 89
|
||||
-66, -65, -64, -63, -62, -61, -60, -59, -58, -57, //90 - 99
|
||||
-56, -55, -54, -53, -52, -51, -50, -49, -48, -47, //100 - 109
|
||||
-46, -45, -44, -44, -1, -1, -1, -1, -1, -1, //110 - 119
|
||||
-1, -1, -1, -1, -1, -1, INT_MIN, -140, -139, -138, //10 - 19
|
||||
-137, -136, -135, -134, -133, -132, -131, -130, -129, -128, //20 - 29
|
||||
-127, -126, -125, -124, -123, -122, -121, -120, -119, -118, //30 - 39
|
||||
-117,-116, -115, -114, -113, -112, -111, -110, -109, -108, //40 - 49
|
||||
-107, -106, -105, -104, -103, -102, -101, -100, -99, -98, //50 - 59
|
||||
-97, -96, -95, -94, -93, -92, -91, -90, -89, -88, //60 - 69
|
||||
-87, -86, -85, -84, -83, -82, -81, -80, -79, -78, //70 - 79
|
||||
-77, -76, -75, -74, -73, -72, -71, -70, -69, -68, //80 - 89
|
||||
-67, -66, -65, -64, -63, -62, -61, -60, -59, -58, //90 - 99
|
||||
-57, -56, -55, -54, -53, -52, -51, -50, -49, -48, //100 - 109
|
||||
-47, -46, -45, -44, INT_MAX, -1, -1, -1, -1, -1, //110 - 119
|
||||
-1, -1, -1, -1, -1, -1, -1, -1//120 - 127
|
||||
};
|
||||
|
||||
@@ -849,6 +849,7 @@ void tci_handling(module_id_t Mod_idP, int UE_id, frame_t frame, slot_t slot) {
|
||||
}//is-triggering_beam_switch
|
||||
}//tci handling
|
||||
|
||||
|
||||
uint8_t pickandreverse_bits(uint8_t *payload, uint16_t bitlen, uint8_t start_bit) {
|
||||
uint8_t rev_bits = 0;
|
||||
for (int i=0; i<bitlen; i++)
|
||||
@@ -1150,7 +1151,6 @@ void handle_nr_uci_pucch_2_3_4(module_id_t mod_id,
|
||||
}
|
||||
|
||||
|
||||
// function to update pucch scheduling parameters in UE list when a USS DL is scheduled
|
||||
// this function returns an index to NR_sched_pucch structure
|
||||
// currently this structure contains PUCCH0 at index 0 and PUCCH2 at index 1
|
||||
// if the function returns -1 it was not possible to schedule acknack
|
||||
@@ -1363,199 +1363,6 @@ int nr_acknack_scheduling(int mod_id,
|
||||
return 0;
|
||||
}
|
||||
|
||||
void csi_period_offset(NR_CSI_ReportConfig_t *csirep,
|
||||
NR_NZP_CSI_RS_Resource_t *nzpcsi,
|
||||
int *period, int *offset) {
|
||||
|
||||
if(nzpcsi != NULL) {
|
||||
|
||||
NR_CSI_ResourcePeriodicityAndOffset_PR p_and_o = nzpcsi->periodicityAndOffset->present;
|
||||
|
||||
switch(p_and_o){
|
||||
case NR_CSI_ResourcePeriodicityAndOffset_PR_slots4:
|
||||
*period = 4;
|
||||
*offset = nzpcsi->periodicityAndOffset->choice.slots4;
|
||||
break;
|
||||
case NR_CSI_ResourcePeriodicityAndOffset_PR_slots5:
|
||||
*period = 5;
|
||||
*offset = nzpcsi->periodicityAndOffset->choice.slots5;
|
||||
break;
|
||||
case NR_CSI_ResourcePeriodicityAndOffset_PR_slots8:
|
||||
*period = 8;
|
||||
*offset = nzpcsi->periodicityAndOffset->choice.slots8;
|
||||
break;
|
||||
case NR_CSI_ResourcePeriodicityAndOffset_PR_slots10:
|
||||
*period = 10;
|
||||
*offset = nzpcsi->periodicityAndOffset->choice.slots10;
|
||||
break;
|
||||
case NR_CSI_ResourcePeriodicityAndOffset_PR_slots16:
|
||||
*period = 16;
|
||||
*offset = nzpcsi->periodicityAndOffset->choice.slots16;
|
||||
break;
|
||||
case NR_CSI_ResourcePeriodicityAndOffset_PR_slots20:
|
||||
*period = 20;
|
||||
*offset = nzpcsi->periodicityAndOffset->choice.slots20;
|
||||
break;
|
||||
case NR_CSI_ResourcePeriodicityAndOffset_PR_slots32:
|
||||
*period = 32;
|
||||
*offset = nzpcsi->periodicityAndOffset->choice.slots32;
|
||||
break;
|
||||
case NR_CSI_ResourcePeriodicityAndOffset_PR_slots40:
|
||||
*period = 40;
|
||||
*offset = nzpcsi->periodicityAndOffset->choice.slots40;
|
||||
break;
|
||||
case NR_CSI_ResourcePeriodicityAndOffset_PR_slots64:
|
||||
*period = 64;
|
||||
*offset = nzpcsi->periodicityAndOffset->choice.slots64;
|
||||
break;
|
||||
case NR_CSI_ResourcePeriodicityAndOffset_PR_slots80:
|
||||
*period = 80;
|
||||
*offset = nzpcsi->periodicityAndOffset->choice.slots80;
|
||||
break;
|
||||
case NR_CSI_ResourcePeriodicityAndOffset_PR_slots160:
|
||||
*period = 160;
|
||||
*offset = nzpcsi->periodicityAndOffset->choice.slots160;
|
||||
break;
|
||||
case NR_CSI_ResourcePeriodicityAndOffset_PR_slots320:
|
||||
*period = 320;
|
||||
*offset = nzpcsi->periodicityAndOffset->choice.slots320;
|
||||
break;
|
||||
case NR_CSI_ResourcePeriodicityAndOffset_PR_slots640:
|
||||
*period = 640;
|
||||
*offset = nzpcsi->periodicityAndOffset->choice.slots640;
|
||||
break;
|
||||
default:
|
||||
AssertFatal(1==0,"No periodicity and offset found in CSI resource");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if(csirep != NULL) {
|
||||
|
||||
NR_CSI_ReportPeriodicityAndOffset_PR p_and_o = csirep->reportConfigType.choice.periodic->reportSlotConfig.present;
|
||||
|
||||
switch(p_and_o){
|
||||
case NR_CSI_ReportPeriodicityAndOffset_PR_slots4:
|
||||
*period = 4;
|
||||
*offset = csirep->reportConfigType.choice.periodic->reportSlotConfig.choice.slots4;
|
||||
break;
|
||||
case NR_CSI_ReportPeriodicityAndOffset_PR_slots5:
|
||||
*period = 5;
|
||||
*offset = csirep->reportConfigType.choice.periodic->reportSlotConfig.choice.slots5;
|
||||
break;
|
||||
case NR_CSI_ReportPeriodicityAndOffset_PR_slots8:
|
||||
*period = 8;
|
||||
*offset = csirep->reportConfigType.choice.periodic->reportSlotConfig.choice.slots8;
|
||||
break;
|
||||
case NR_CSI_ReportPeriodicityAndOffset_PR_slots10:
|
||||
*period = 10;
|
||||
*offset = csirep->reportConfigType.choice.periodic->reportSlotConfig.choice.slots10;
|
||||
break;
|
||||
case NR_CSI_ReportPeriodicityAndOffset_PR_slots16:
|
||||
*period = 16;
|
||||
*offset = csirep->reportConfigType.choice.periodic->reportSlotConfig.choice.slots16;
|
||||
break;
|
||||
case NR_CSI_ReportPeriodicityAndOffset_PR_slots20:
|
||||
*period = 20;
|
||||
*offset = csirep->reportConfigType.choice.periodic->reportSlotConfig.choice.slots20;
|
||||
break;
|
||||
case NR_CSI_ReportPeriodicityAndOffset_PR_slots40:
|
||||
*period = 40;
|
||||
*offset = csirep->reportConfigType.choice.periodic->reportSlotConfig.choice.slots40;
|
||||
break;
|
||||
case NR_CSI_ReportPeriodicityAndOffset_PR_slots80:
|
||||
*period = 80;
|
||||
*offset = csirep->reportConfigType.choice.periodic->reportSlotConfig.choice.slots80;
|
||||
break;
|
||||
case NR_CSI_ReportPeriodicityAndOffset_PR_slots160:
|
||||
*period = 160;
|
||||
*offset = csirep->reportConfigType.choice.periodic->reportSlotConfig.choice.slots160;
|
||||
break;
|
||||
case NR_CSI_ReportPeriodicityAndOffset_PR_slots320:
|
||||
*period = 320;
|
||||
*offset = csirep->reportConfigType.choice.periodic->reportSlotConfig.choice.slots320;
|
||||
break;
|
||||
default:
|
||||
AssertFatal(1==0,"No periodicity and offset resource found in CSI report");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
uint16_t compute_pucch_prb_size(uint8_t format,
|
||||
uint8_t nr_prbs,
|
||||
uint16_t O_tot,
|
||||
uint16_t O_csi,
|
||||
NR_PUCCH_MaxCodeRate_t *maxCodeRate,
|
||||
uint8_t Qm,
|
||||
uint8_t n_symb,
|
||||
uint8_t n_re_ctrl) {
|
||||
|
||||
uint16_t O_crc;
|
||||
|
||||
if (O_tot<12)
|
||||
O_crc = 0;
|
||||
else{
|
||||
if (O_tot<20)
|
||||
O_crc = 6;
|
||||
else {
|
||||
if (O_tot<360)
|
||||
O_crc = 11;
|
||||
else
|
||||
AssertFatal(1==0,"Case for segmented PUCCH not yet implemented");
|
||||
}
|
||||
}
|
||||
|
||||
int rtimes100;
|
||||
switch(*maxCodeRate){
|
||||
case NR_PUCCH_MaxCodeRate_zeroDot08 :
|
||||
rtimes100 = 8;
|
||||
break;
|
||||
case NR_PUCCH_MaxCodeRate_zeroDot15 :
|
||||
rtimes100 = 15;
|
||||
break;
|
||||
case NR_PUCCH_MaxCodeRate_zeroDot25 :
|
||||
rtimes100 = 25;
|
||||
break;
|
||||
case NR_PUCCH_MaxCodeRate_zeroDot35 :
|
||||
rtimes100 = 35;
|
||||
break;
|
||||
case NR_PUCCH_MaxCodeRate_zeroDot45 :
|
||||
rtimes100 = 45;
|
||||
break;
|
||||
case NR_PUCCH_MaxCodeRate_zeroDot60 :
|
||||
rtimes100 = 60;
|
||||
break;
|
||||
case NR_PUCCH_MaxCodeRate_zeroDot80 :
|
||||
rtimes100 = 80;
|
||||
break;
|
||||
default :
|
||||
AssertFatal(1==0,"Invalid MaxCodeRate");
|
||||
}
|
||||
|
||||
float r = (float)rtimes100/100;
|
||||
|
||||
if (O_csi == O_tot) {
|
||||
if ((O_tot+O_csi)>(nr_prbs*n_re_ctrl*n_symb*Qm*r))
|
||||
AssertFatal(1==0,"MaxCodeRate %.2f can't support %d UCI bits and %d CRC bits with %d PRBs",
|
||||
r,O_tot,O_crc,nr_prbs);
|
||||
else
|
||||
return nr_prbs;
|
||||
}
|
||||
|
||||
if (format==2){
|
||||
// TODO fix this for multiple CSI reports
|
||||
for (int i=1; i<=nr_prbs; i++){
|
||||
if((O_tot+O_crc)<=(i*n_symb*Qm*n_re_ctrl*r) &&
|
||||
(O_tot+O_crc)>((i-1)*n_symb*Qm*n_re_ctrl*r))
|
||||
return i;
|
||||
}
|
||||
AssertFatal(1==0,"MaxCodeRate %.2f can't support %d UCI bits and %d CRC bits with at most %d PRBs",
|
||||
r,O_tot,O_crc,nr_prbs);
|
||||
}
|
||||
else{
|
||||
AssertFatal(1==0,"Not yet implemented");
|
||||
}
|
||||
}
|
||||
|
||||
void nr_sr_reporting(int Mod_idP, frame_t SFN, sub_frame_t slot)
|
||||
{
|
||||
@@ -1588,7 +1395,7 @@ void nr_sr_reporting(int Mod_idP, frame_t SFN, sub_frame_t slot)
|
||||
|
||||
int SR_period; int SR_offset;
|
||||
|
||||
periodicity__SRR(SchedulingRequestResourceConfig,&SR_period,&SR_offset);
|
||||
find_period_offest_SR(SchedulingRequestResourceConfig,&SR_period,&SR_offset);
|
||||
// convert to int to avoid underflow of uint
|
||||
int sfn_sf = SFN * n_slots_frame + slot;
|
||||
if ((sfn_sf - SR_offset) % SR_period != 0)
|
||||
@@ -1657,65 +1464,3 @@ void nr_sr_reporting(int Mod_idP, frame_t SFN, sub_frame_t slot)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void periodicity__SRR (NR_SchedulingRequestResourceConfig_t *SchedulingReqRec, int *period, int *offset)
|
||||
{
|
||||
NR_SchedulingRequestResourceConfig__periodicityAndOffset_PR P_O = SchedulingReqRec->periodicityAndOffset->present;
|
||||
switch (P_O){
|
||||
case NR_SchedulingRequestResourceConfig__periodicityAndOffset_PR_sl1:
|
||||
*period = 1;
|
||||
*offset = SchedulingReqRec->periodicityAndOffset->choice.sl1;
|
||||
break;
|
||||
case NR_SchedulingRequestResourceConfig__periodicityAndOffset_PR_sl2:
|
||||
*period = 2;
|
||||
*offset = SchedulingReqRec->periodicityAndOffset->choice.sl2;
|
||||
break;
|
||||
case NR_SchedulingRequestResourceConfig__periodicityAndOffset_PR_sl4:
|
||||
*period = 4;
|
||||
*offset = SchedulingReqRec->periodicityAndOffset->choice.sl4;
|
||||
break;
|
||||
case NR_SchedulingRequestResourceConfig__periodicityAndOffset_PR_sl5:
|
||||
*period = 5;
|
||||
*offset = SchedulingReqRec->periodicityAndOffset->choice.sl5;
|
||||
break;
|
||||
case NR_SchedulingRequestResourceConfig__periodicityAndOffset_PR_sl8:
|
||||
*period = 8;
|
||||
*offset = SchedulingReqRec->periodicityAndOffset->choice.sl8;
|
||||
break;
|
||||
case NR_SchedulingRequestResourceConfig__periodicityAndOffset_PR_sl10:
|
||||
*period = 10;
|
||||
*offset = SchedulingReqRec->periodicityAndOffset->choice.sl10;
|
||||
break;
|
||||
case NR_SchedulingRequestResourceConfig__periodicityAndOffset_PR_sl16:
|
||||
*period = 16;
|
||||
*offset = SchedulingReqRec->periodicityAndOffset->choice.sl16;
|
||||
break;
|
||||
case NR_SchedulingRequestResourceConfig__periodicityAndOffset_PR_sl20:
|
||||
*period = 20;
|
||||
*offset = SchedulingReqRec->periodicityAndOffset->choice.sl20;
|
||||
break;
|
||||
case NR_SchedulingRequestResourceConfig__periodicityAndOffset_PR_sl40:
|
||||
*period = 40;
|
||||
*offset = SchedulingReqRec->periodicityAndOffset->choice.sl40;
|
||||
break;
|
||||
case NR_SchedulingRequestResourceConfig__periodicityAndOffset_PR_sl80:
|
||||
*period = 80;
|
||||
*offset = SchedulingReqRec->periodicityAndOffset->choice.sl80;
|
||||
break;
|
||||
case NR_SchedulingRequestResourceConfig__periodicityAndOffset_PR_sl160:
|
||||
*period = 160;
|
||||
*offset = SchedulingReqRec->periodicityAndOffset->choice.sl160;
|
||||
break;
|
||||
case NR_SchedulingRequestResourceConfig__periodicityAndOffset_PR_sl320:
|
||||
*period = 320;
|
||||
*offset = SchedulingReqRec->periodicityAndOffset->choice.sl320;
|
||||
break;
|
||||
case NR_SchedulingRequestResourceConfig__periodicityAndOffset_PR_sl640:
|
||||
*period = 640;
|
||||
*offset = SchedulingReqRec->periodicityAndOffset->choice.sl640;
|
||||
break;
|
||||
default:
|
||||
AssertFatal(1==0,"No periodicityAndOffset resources found in schedulingrequestresourceconfig");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -183,10 +183,6 @@ void nr_csirs_scheduling(int Mod_idP,
|
||||
sub_frame_t slot,
|
||||
int n_slots_frame);
|
||||
|
||||
void csi_period_offset(NR_CSI_ReportConfig_t *csirep,
|
||||
NR_NZP_CSI_RS_Resource_t *nzpcsi,
|
||||
int *period, int *offset);
|
||||
|
||||
void nr_csi_meas_reporting(int Mod_idP,
|
||||
frame_t frameP,
|
||||
sub_frame_t slotP);
|
||||
@@ -333,15 +329,6 @@ int allocate_nr_CCEs(gNB_MAC_INST *nr_mac,
|
||||
int m,
|
||||
int nr_of_candidates);
|
||||
|
||||
uint16_t compute_pucch_prb_size(uint8_t format,
|
||||
uint8_t nr_prbs,
|
||||
uint16_t O_tot,
|
||||
uint16_t O_csi,
|
||||
NR_PUCCH_MaxCodeRate_t *maxCodeRate,
|
||||
uint8_t Qm,
|
||||
uint8_t n_symb,
|
||||
uint8_t n_re_ctrl);
|
||||
|
||||
int nr_get_default_pucch_res(int pucch_ResourceCommon);
|
||||
|
||||
void compute_csi_bitlen(NR_CSI_MeasConfig_t *csi_MeasConfig, NR_UE_info_t *UE_info, int UE_id, module_id_t Mod_idP);
|
||||
@@ -431,8 +418,4 @@ bool nr_find_nb_rb(uint16_t Qm,
|
||||
|
||||
void nr_sr_reporting(int Mod_idP, frame_t frameP, sub_frame_t slotP);
|
||||
|
||||
void periodicity__SRR (NR_SchedulingRequestResourceConfig_t *SchedulingReqRecconf,
|
||||
int *period,
|
||||
int *offset);
|
||||
|
||||
#endif /*__LAYER2_NR_MAC_PROTO_H__*/
|
||||
|
||||
@@ -66,8 +66,8 @@ int handle_bcch_bch(module_id_t module_id, int cc_id,
|
||||
}
|
||||
|
||||
// L2 Abstraction Layer
|
||||
int handle_bcch_dlsch(module_id_t module_id, int cc_id, unsigned int gNB_index, uint32_t sibs_mask, uint8_t *pduP, uint32_t pdu_len){
|
||||
return nr_ue_decode_BCCH_DL_SCH(module_id, cc_id, gNB_index, sibs_mask, pduP, pdu_len);
|
||||
int handle_bcch_dlsch(module_id_t module_id, int cc_id, unsigned int gNB_index, uint8_t ack_nack, uint8_t *pduP, uint32_t pdu_len){
|
||||
return nr_ue_decode_BCCH_DL_SCH(module_id, cc_id, gNB_index, ack_nack, pduP, pdu_len);
|
||||
}
|
||||
|
||||
// L2 Abstraction Layer
|
||||
@@ -81,6 +81,7 @@ int handle_dci(module_id_t module_id, int cc_id, unsigned int gNB_index, frame_t
|
||||
// Note: sdu should always be processed because data and timing advance updates are transmitted by the UE
|
||||
int8_t handle_dlsch (nr_downlink_indication_t *dl_info, NR_UL_TIME_ALIGNMENT_t *ul_time_alignment, int pdu_id){
|
||||
|
||||
update_harq_status(dl_info, pdu_id);
|
||||
nr_ue_send_sdu(dl_info, ul_time_alignment, pdu_id);
|
||||
|
||||
return 0;
|
||||
@@ -93,13 +94,21 @@ int nr_ue_ul_indication(nr_uplink_indication_t *ul_info){
|
||||
module_id_t module_id = ul_info->module_id;
|
||||
NR_UE_MAC_INST_t *mac = get_mac_inst(module_id);
|
||||
|
||||
ret = nr_ue_scheduler(NULL, ul_info);
|
||||
if (ul_info->ue_sched_mode == ONLY_PUSCH) {
|
||||
ret = nr_ue_scheduler(NULL, ul_info);
|
||||
return 0;
|
||||
}
|
||||
else if (ul_info->ue_sched_mode == SCHED_ALL)
|
||||
ret = nr_ue_scheduler(NULL, ul_info);
|
||||
|
||||
NR_TDD_UL_DL_ConfigCommon_t *tdd_UL_DL_ConfigurationCommon = mac->scc != NULL ? mac->scc->tdd_UL_DL_ConfigurationCommon : mac->scc_SIB->tdd_UL_DL_ConfigurationCommon;
|
||||
|
||||
if (is_nr_UL_slot(tdd_UL_DL_ConfigurationCommon, ul_info->slot_tx, mac->frame_type) && !get_softmodem_params()->phy_test)
|
||||
nr_ue_prach_scheduler(module_id, ul_info->frame_tx, ul_info->slot_tx, ul_info->thread_id);
|
||||
|
||||
if (is_nr_UL_slot(tdd_UL_DL_ConfigurationCommon, ul_info->slot_tx, mac->frame_type))
|
||||
nr_ue_pucch_scheduler(module_id, ul_info->frame_tx, ul_info->slot_tx, ul_info->thread_id);
|
||||
|
||||
switch(ret){
|
||||
case UE_CONNECTION_OK:
|
||||
break;
|
||||
@@ -161,43 +170,32 @@ int nr_ue_dl_indication(nr_downlink_indication_t *dl_info, NR_UL_TIME_ALIGNMENT_
|
||||
dl_info->rx_ind->number_pdus);
|
||||
|
||||
switch(dl_info->rx_ind->rx_indication_body[i].pdu_type){
|
||||
case FAPI_NR_RX_PDU_TYPE_SSB:
|
||||
mac->ssb_rsrp_dBm = (dl_info->rx_ind->rx_indication_body+i)->ssb_pdu.rsrp_dBm;
|
||||
ret_mask |= (handle_bcch_bch(dl_info->module_id, dl_info->cc_id, dl_info->gNB_index,
|
||||
(dl_info->rx_ind->rx_indication_body+i)->ssb_pdu.pdu,
|
||||
(dl_info->rx_ind->rx_indication_body+i)->ssb_pdu.additional_bits,
|
||||
(dl_info->rx_ind->rx_indication_body+i)->ssb_pdu.ssb_index,
|
||||
(dl_info->rx_ind->rx_indication_body+i)->ssb_pdu.ssb_length,
|
||||
(dl_info->rx_ind->rx_indication_body+i)->ssb_pdu.ssb_start_subcarrier,
|
||||
(dl_info->rx_ind->rx_indication_body+i)->ssb_pdu.cell_id)) << FAPI_NR_RX_PDU_TYPE_SSB;
|
||||
|
||||
case FAPI_NR_RX_PDU_TYPE_SSB:
|
||||
|
||||
ret_mask |= (handle_bcch_bch(dl_info->module_id, dl_info->cc_id, dl_info->gNB_index,
|
||||
(dl_info->rx_ind->rx_indication_body+i)->ssb_pdu.pdu,
|
||||
(dl_info->rx_ind->rx_indication_body+i)->ssb_pdu.additional_bits,
|
||||
(dl_info->rx_ind->rx_indication_body+i)->ssb_pdu.ssb_index,
|
||||
(dl_info->rx_ind->rx_indication_body+i)->ssb_pdu.ssb_length,
|
||||
(dl_info->rx_ind->rx_indication_body+i)->ssb_pdu.ssb_start_subcarrier,
|
||||
(dl_info->rx_ind->rx_indication_body+i)->ssb_pdu.cell_id)) << FAPI_NR_RX_PDU_TYPE_SSB;
|
||||
|
||||
break;
|
||||
|
||||
case FAPI_NR_RX_PDU_TYPE_SIB:
|
||||
|
||||
ret_mask |= (handle_bcch_dlsch(dl_info->module_id,
|
||||
dl_info->cc_id, dl_info->gNB_index,
|
||||
(dl_info->rx_ind->rx_indication_body+i)->sib_pdu.sibs_mask,
|
||||
(dl_info->rx_ind->rx_indication_body+i)->sib_pdu.pdu,
|
||||
(dl_info->rx_ind->rx_indication_body+i)->sib_pdu.pdu_length)) << FAPI_NR_RX_PDU_TYPE_SIB;
|
||||
|
||||
break;
|
||||
|
||||
case FAPI_NR_RX_PDU_TYPE_DLSCH:
|
||||
|
||||
ret_mask |= (handle_dlsch(dl_info, ul_time_alignment, i)) << FAPI_NR_RX_PDU_TYPE_DLSCH;
|
||||
|
||||
break;
|
||||
|
||||
case FAPI_NR_RX_PDU_TYPE_RAR:
|
||||
|
||||
ret_mask |= (handle_dlsch(dl_info, ul_time_alignment, i)) << FAPI_NR_RX_PDU_TYPE_RAR;
|
||||
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
break;
|
||||
case FAPI_NR_RX_PDU_TYPE_SIB:
|
||||
ret_mask |= (handle_bcch_dlsch(dl_info->module_id,
|
||||
dl_info->cc_id, dl_info->gNB_index,
|
||||
(dl_info->rx_ind->rx_indication_body+i)->pdsch_pdu.ack_nack,
|
||||
(dl_info->rx_ind->rx_indication_body+i)->pdsch_pdu.pdu,
|
||||
(dl_info->rx_ind->rx_indication_body+i)->pdsch_pdu.pdu_length)) << FAPI_NR_RX_PDU_TYPE_SIB;
|
||||
break;
|
||||
case FAPI_NR_RX_PDU_TYPE_DLSCH:
|
||||
ret_mask |= (handle_dlsch(dl_info, ul_time_alignment, i)) << FAPI_NR_RX_PDU_TYPE_DLSCH;
|
||||
break;
|
||||
case FAPI_NR_RX_PDU_TYPE_RAR:
|
||||
ret_mask |= (handle_dlsch(dl_info, ul_time_alignment, i)) << FAPI_NR_RX_PDU_TYPE_RAR;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -39,6 +39,12 @@
|
||||
|
||||
typedef struct NR_UL_TIME_ALIGNMENT NR_UL_TIME_ALIGNMENT_t;
|
||||
|
||||
typedef enum {
|
||||
ONLY_PUSCH,
|
||||
NOT_PUSCH,
|
||||
SCHED_ALL,
|
||||
} NR_UE_SCHED_MODE_t;
|
||||
|
||||
typedef struct {
|
||||
/// module id
|
||||
module_id_t module_id;
|
||||
@@ -100,6 +106,9 @@ typedef struct {
|
||||
|
||||
/// dci reception indication structure
|
||||
fapi_nr_dci_indication_t *dci_ind;
|
||||
|
||||
NR_UE_SCHED_MODE_t ue_sched_mode;
|
||||
|
||||
} nr_uplink_indication_t;
|
||||
|
||||
// Downlink subframe P7
|
||||
@@ -235,7 +244,7 @@ int handle_bcch_bch(module_id_t module_id,
|
||||
/**\brief handle BCCH-DL-SCH message from dl_indication
|
||||
\param pdu_len length(bytes) of pdu
|
||||
\param pduP pointer to pdu*/
|
||||
int handle_bcch_dlsch(module_id_t module_id, int cc_id, unsigned int gNB_index, uint32_t sibs_mask, uint8_t *pduP, uint32_t pdu_len);
|
||||
int handle_bcch_dlsch(module_id_t module_id, int cc_id, unsigned int gNB_index, uint8_t ack_nack, uint8_t *pduP, uint32_t pdu_len);
|
||||
|
||||
int handle_dci(module_id_t module_id, int cc_id, unsigned int gNB_index, frame_t frame, int slot, fapi_nr_dci_indication_pdu_t *dci);
|
||||
|
||||
|
||||
@@ -448,6 +448,7 @@ typedef struct {
|
||||
int pusch_AntennaPorts;
|
||||
int pusch_TargetSNRx10;
|
||||
int pucch_TargetSNRx10;
|
||||
int do_CSIRS;
|
||||
NR_BCCH_DL_SCH_Message_t *siblock1;
|
||||
NR_ServingCellConfigCommon_t *servingcellconfigcommon;
|
||||
NR_PDCCH_ConfigSIB1_t *pdcch_ConfigSIB1;
|
||||
|
||||
@@ -84,15 +84,19 @@ void fill_default_secondaryCellGroup(NR_ServingCellConfigCommon_t *servingcellco
|
||||
NR_CellGroupConfig_t *secondaryCellGroup,
|
||||
int scg_id,
|
||||
int servCellIndex,
|
||||
int n_physical_antenna_ports,
|
||||
int dl_antenna_ports,
|
||||
int do_csirs,
|
||||
int initial_csi_index,
|
||||
int uid);
|
||||
|
||||
void config_csirs(NR_ServingCellConfigCommon_t *servingcellconfigcommon, NR_CSI_MeasConfig_t *csi_MeasConfig, int dl_antenna_ports, int do_csirs);
|
||||
|
||||
void fill_default_reconfig(NR_ServingCellConfigCommon_t *servingcellconfigcommon,
|
||||
NR_ServingCellConfig_t *servingcellconfigdedicated,
|
||||
NR_RRCReconfiguration_IEs_t *reconfig,
|
||||
NR_CellGroupConfig_t *secondaryCellGroup,
|
||||
int n_physical_antenna_ports,
|
||||
int dl_antenna_ports,
|
||||
int do_csirs,
|
||||
int initial_csi_index,
|
||||
int uid);
|
||||
|
||||
|
||||
@@ -330,6 +330,7 @@ char openair_rrc_gNB_configuration(const module_id_t gnb_mod_idP, gNB_RrcConfigu
|
||||
rrc->carrier.ssb_SubcarrierOffset = configuration->ssb_SubcarrierOffset;
|
||||
rrc->carrier.pdsch_AntennaPorts = configuration->pdsch_AntennaPorts;
|
||||
rrc->carrier.pusch_AntennaPorts = configuration->pusch_AntennaPorts;
|
||||
rrc->carrier.do_CSIRS = configuration->do_CSIRS;
|
||||
/// System Information INIT
|
||||
pthread_mutex_init(&rrc->cell_info_mutex,NULL);
|
||||
rrc->cell_info_configured = 0;
|
||||
|
||||
@@ -245,6 +245,7 @@ void rrc_add_nsa_user(gNB_RRC_INST *rrc,struct rrc_gNB_ue_context_s *ue_context_
|
||||
reconfig_ies,
|
||||
ue_context_p->ue_context.secondaryCellGroup,
|
||||
carrier->pdsch_AntennaPorts,
|
||||
carrier->do_CSIRS,
|
||||
carrier->initial_csi_index[ue_context_p->local_uid + 1],
|
||||
ue_context_p->local_uid);
|
||||
} else {
|
||||
@@ -253,6 +254,7 @@ void rrc_add_nsa_user(gNB_RRC_INST *rrc,struct rrc_gNB_ue_context_s *ue_context_
|
||||
reconfig_ies,
|
||||
ue_context_p->ue_context.secondaryCellGroup,
|
||||
carrier->pdsch_AntennaPorts,
|
||||
carrier->do_CSIRS,
|
||||
carrier->initial_csi_index[ue_context_p->local_uid + 1],
|
||||
ue_context_p->local_uid);
|
||||
}
|
||||
|
||||
+264
-124
@@ -135,7 +135,8 @@ void fill_default_secondaryCellGroup(NR_ServingCellConfigCommon_t *servingcellco
|
||||
NR_CellGroupConfig_t *secondaryCellGroup,
|
||||
int scg_id,
|
||||
int servCellIndex,
|
||||
int n_physical_antenna_ports,
|
||||
int dl_antenna_ports,
|
||||
int do_csirs,
|
||||
int initial_csi_index,
|
||||
int uid) {
|
||||
AssertFatal(servingcellconfigcommon!=NULL,"servingcellconfigcommon is null\n");
|
||||
@@ -631,7 +632,7 @@ void fill_default_secondaryCellGroup(NR_ServingCellConfigCommon_t *servingcellco
|
||||
}
|
||||
bwp->bwp_Dedicated->pdsch_Config->choice.setup->dataScramblingIdentityPDSCH = NULL;
|
||||
|
||||
if (n_physical_antenna_ports > 1)// for MIMO, we use DMRS Config Type 2
|
||||
if (dl_antenna_ports > 1)// for MIMO, we use DMRS Config Type 2
|
||||
bwp->bwp_Dedicated->pdsch_Config->choice.setup->dmrs_DownlinkForPDSCH_MappingTypeA->choice.setup->dmrs_Type=calloc(1,sizeof(*bwp->bwp_Dedicated->pdsch_Config->choice.setup->dmrs_DownlinkForPDSCH_MappingTypeA->choice.setup->dmrs_Type));
|
||||
else
|
||||
bwp->bwp_Dedicated->pdsch_Config->choice.setup->dmrs_DownlinkForPDSCH_MappingTypeA->choice.setup->dmrs_Type=NULL;
|
||||
@@ -1030,8 +1031,14 @@ void fill_default_secondaryCellGroup(NR_ServingCellConfigCommon_t *servingcellco
|
||||
NR_PUCCH_SpatialRelationInfo_t *pucchspatial = calloc(1,sizeof(*pucchspatial));
|
||||
pucchspatial->pucch_SpatialRelationInfoId = 1;
|
||||
pucchspatial->servingCellId = NULL;
|
||||
pucchspatial->referenceSignal.present = NR_PUCCH_SpatialRelationInfo__referenceSignal_PR_csi_RS_Index;
|
||||
pucchspatial->referenceSignal.choice.csi_RS_Index = 0;
|
||||
if(do_csirs) {
|
||||
pucchspatial->referenceSignal.present = NR_PUCCH_SpatialRelationInfo__referenceSignal_PR_csi_RS_Index;
|
||||
pucchspatial->referenceSignal.choice.csi_RS_Index = 0;
|
||||
}
|
||||
else {
|
||||
pucchspatial->referenceSignal.present = NR_PUCCH_SpatialRelationInfo__referenceSignal_PR_ssb_Index;
|
||||
pucchspatial->referenceSignal.choice.ssb_Index = 0;
|
||||
}
|
||||
pucchspatial->pucch_PathlossReferenceRS_Id = 0;
|
||||
pucchspatial->p0_PUCCH_Id = 1;
|
||||
pucchspatial->closedLoopIndex = NR_PUCCH_SpatialRelationInfo__closedLoopIndex_i0;
|
||||
@@ -1114,53 +1121,57 @@ void fill_default_secondaryCellGroup(NR_ServingCellConfigCommon_t *servingcellco
|
||||
NR_CSI_MeasConfig_t *csi_MeasConfig = calloc(1,sizeof(*csi_MeasConfig));
|
||||
secondaryCellGroup->spCellConfig->spCellConfigDedicated->csi_MeasConfig->choice.setup = csi_MeasConfig;
|
||||
|
||||
csi_MeasConfig->csi_IM_ResourceToAddModList = NULL;
|
||||
if (do_csirs && dl_antenna_ports > 1) {
|
||||
csi_MeasConfig->csi_IM_ResourceToAddModList = calloc(1,sizeof(*csi_MeasConfig->csi_IM_ResourceToAddModList));
|
||||
NR_CSI_IM_Resource_t *imres0 = calloc(1,sizeof(*imres0));
|
||||
imres0->csi_IM_ResourceId = 0;
|
||||
imres0->csi_IM_ResourceElementPattern = calloc(1,sizeof(*imres0->csi_IM_ResourceElementPattern));
|
||||
imres0->csi_IM_ResourceElementPattern->present = NR_CSI_IM_Resource__csi_IM_ResourceElementPattern_PR_pattern1;
|
||||
imres0->csi_IM_ResourceElementPattern->choice.pattern1 = calloc(1,sizeof(*imres0->csi_IM_ResourceElementPattern->choice.pattern1));
|
||||
imres0->csi_IM_ResourceElementPattern->choice.pattern1->subcarrierLocation_p1 = NR_CSI_IM_Resource__csi_IM_ResourceElementPattern__pattern1__subcarrierLocation_p1_s4;
|
||||
imres0->csi_IM_ResourceElementPattern->choice.pattern1->symbolLocation_p1 = 6;
|
||||
imres0->freqBand = calloc(1,sizeof(*imres0->freqBand));
|
||||
imres0->freqBand->startingRB = 0;
|
||||
imres0->freqBand->nrofRBs = 108;
|
||||
imres0->periodicityAndOffset = calloc(1,sizeof(*imres0->periodicityAndOffset));
|
||||
imres0->periodicityAndOffset->present = NR_CSI_ResourcePeriodicityAndOffset_PR_slots320;
|
||||
imres0->periodicityAndOffset->choice.slots320 = 0;
|
||||
ASN_SEQUENCE_ADD(&csi_MeasConfig->csi_IM_ResourceToAddModList->list,imres0);
|
||||
csi_MeasConfig->csi_IM_ResourceSetToAddModList = calloc(1,sizeof(*csi_MeasConfig->csi_IM_ResourceSetToAddModList));
|
||||
NR_CSI_IM_ResourceSet_t *imset0 = calloc(1,sizeof(*imset0));
|
||||
imset0->csi_IM_ResourceSetId = 0;
|
||||
NR_CSI_IM_ResourceId_t *res0 = calloc(1,sizeof(*res0));
|
||||
*res0 = 0;
|
||||
ASN_SEQUENCE_ADD(&imset0->csi_IM_Resources,res0);
|
||||
ASN_SEQUENCE_ADD(&csi_MeasConfig->csi_IM_ResourceSetToAddModList->list,imset0);
|
||||
}
|
||||
else {
|
||||
csi_MeasConfig->csi_IM_ResourceToAddModList = NULL;
|
||||
csi_MeasConfig->csi_IM_ResourceSetToAddModList = NULL;
|
||||
}
|
||||
|
||||
csi_MeasConfig->csi_IM_ResourceToReleaseList = NULL;
|
||||
csi_MeasConfig->csi_IM_ResourceSetToAddModList = NULL;
|
||||
csi_MeasConfig->csi_IM_ResourceSetToReleaseList = NULL;
|
||||
|
||||
csi_MeasConfig->nzp_CSI_RS_ResourceSetToAddModList = calloc(1,sizeof(*csi_MeasConfig->nzp_CSI_RS_ResourceSetToAddModList));
|
||||
NR_NZP_CSI_RS_ResourceSet_t *nzpcsirs0 = calloc(1,sizeof(*nzpcsirs0));
|
||||
nzpcsirs0->nzp_CSI_ResourceSetId = 0;
|
||||
NR_NZP_CSI_RS_ResourceId_t *nzpid0 = calloc(1,sizeof(*nzpid0));
|
||||
*nzpid0 = 0;
|
||||
ASN_SEQUENCE_ADD(&nzpcsirs0->nzp_CSI_RS_Resources,nzpid0);
|
||||
nzpcsirs0->repetition = NULL;
|
||||
nzpcsirs0->aperiodicTriggeringOffset = NULL;
|
||||
nzpcsirs0->trs_Info = NULL;
|
||||
ASN_SEQUENCE_ADD(&csi_MeasConfig->nzp_CSI_RS_ResourceSetToAddModList->list,nzpcsirs0);
|
||||
if (do_csirs) {
|
||||
csi_MeasConfig->nzp_CSI_RS_ResourceSetToAddModList = calloc(1,sizeof(*csi_MeasConfig->nzp_CSI_RS_ResourceSetToAddModList));
|
||||
NR_NZP_CSI_RS_ResourceSet_t *nzpcsirs0 = calloc(1,sizeof(*nzpcsirs0));
|
||||
nzpcsirs0->nzp_CSI_ResourceSetId = 0;
|
||||
NR_NZP_CSI_RS_ResourceId_t *nzpid0 = calloc(1,sizeof(*nzpid0));
|
||||
*nzpid0 = 0;
|
||||
ASN_SEQUENCE_ADD(&nzpcsirs0->nzp_CSI_RS_Resources,nzpid0);
|
||||
nzpcsirs0->repetition = NULL;
|
||||
nzpcsirs0->aperiodicTriggeringOffset = NULL;
|
||||
nzpcsirs0->trs_Info = NULL;
|
||||
ASN_SEQUENCE_ADD(&csi_MeasConfig->nzp_CSI_RS_ResourceSetToAddModList->list,nzpcsirs0);
|
||||
}
|
||||
else
|
||||
csi_MeasConfig->nzp_CSI_RS_ResourceSetToAddModList = NULL;
|
||||
|
||||
csi_MeasConfig->nzp_CSI_RS_ResourceSetToReleaseList = NULL;
|
||||
|
||||
csi_MeasConfig->nzp_CSI_RS_ResourceToAddModList = calloc(1,sizeof(*csi_MeasConfig->nzp_CSI_RS_ResourceToAddModList));
|
||||
|
||||
NR_NZP_CSI_RS_Resource_t *nzpcsi0 = calloc(1,sizeof(*nzpcsi0));
|
||||
nzpcsi0->nzp_CSI_RS_ResourceId = 0;
|
||||
NR_CSI_RS_ResourceMapping_t resourceMapping;
|
||||
resourceMapping.frequencyDomainAllocation.present = NR_CSI_RS_ResourceMapping__frequencyDomainAllocation_PR_row2;
|
||||
resourceMapping.frequencyDomainAllocation.choice.row2.buf = calloc(2, sizeof(uint8_t));
|
||||
resourceMapping.frequencyDomainAllocation.choice.row2.size = 2;
|
||||
resourceMapping.frequencyDomainAllocation.choice.row2.bits_unused = 4;
|
||||
resourceMapping.frequencyDomainAllocation.choice.row2.buf[0]=0;
|
||||
resourceMapping.frequencyDomainAllocation.choice.row2.buf[1]=16;
|
||||
resourceMapping.nrofPorts = NR_CSI_RS_ResourceMapping__nrofPorts_p1;
|
||||
resourceMapping.firstOFDMSymbolInTimeDomain = 6;
|
||||
resourceMapping.firstOFDMSymbolInTimeDomain2 = NULL;
|
||||
resourceMapping.cdm_Type = NR_CSI_RS_ResourceMapping__cdm_Type_noCDM;
|
||||
resourceMapping.density.present = NR_CSI_RS_ResourceMapping__density_PR_one;
|
||||
resourceMapping.density.choice.one = (NULL_t)0;
|
||||
resourceMapping.freqBand.startingRB = 0;
|
||||
resourceMapping.freqBand.nrofRBs = 104;
|
||||
nzpcsi0->resourceMapping = resourceMapping;
|
||||
nzpcsi0->powerControlOffset = 0;
|
||||
nzpcsi0->powerControlOffsetSS=calloc(1,sizeof(*nzpcsi0->powerControlOffsetSS));
|
||||
*nzpcsi0->powerControlOffsetSS = NR_NZP_CSI_RS_Resource__powerControlOffsetSS_db0;
|
||||
nzpcsi0->scramblingID = *servingcellconfigcommon->physCellId;
|
||||
nzpcsi0->periodicityAndOffset = calloc(1,sizeof(*nzpcsi0->periodicityAndOffset));
|
||||
nzpcsi0->periodicityAndOffset->present = NR_CSI_ResourcePeriodicityAndOffset_PR_slots320;
|
||||
nzpcsi0->periodicityAndOffset->choice.slots320 = 0;
|
||||
nzpcsi0->qcl_InfoPeriodicCSI_RS = NULL;
|
||||
ASN_SEQUENCE_ADD(&csi_MeasConfig->nzp_CSI_RS_ResourceToAddModList->list,nzpcsi0);
|
||||
config_csirs(servingcellconfigcommon, csi_MeasConfig,dl_antenna_ports,do_csirs);
|
||||
|
||||
csi_MeasConfig->csi_SSB_ResourceSetToAddModList = calloc(1,sizeof(*csi_MeasConfig->csi_SSB_ResourceSetToAddModList));
|
||||
csi_MeasConfig->csi_SSB_ResourceSetToReleaseList = NULL;
|
||||
@@ -1179,18 +1190,21 @@ void fill_default_secondaryCellGroup(NR_ServingCellConfigCommon_t *servingcellco
|
||||
ASN_SEQUENCE_ADD(&csi_MeasConfig->csi_SSB_ResourceSetToAddModList->list,ssbresset0);
|
||||
|
||||
csi_MeasConfig->csi_ResourceConfigToAddModList = calloc(1,sizeof(*csi_MeasConfig->csi_ResourceConfigToAddModList));
|
||||
csi_MeasConfig->csi_ResourceConfigToReleaseList = NULL;
|
||||
NR_CSI_ResourceConfig_t *csires0 = calloc(1,sizeof(*csires0));
|
||||
csires0->csi_ResourceConfigId=0;
|
||||
csires0->csi_RS_ResourceSetList.present = NR_CSI_ResourceConfig__csi_RS_ResourceSetList_PR_nzp_CSI_RS_SSB;
|
||||
csires0->csi_RS_ResourceSetList.choice.nzp_CSI_RS_SSB = calloc(1,sizeof(*csires0->csi_RS_ResourceSetList.choice.nzp_CSI_RS_SSB));
|
||||
csires0->csi_RS_ResourceSetList.choice.nzp_CSI_RS_SSB->nzp_CSI_RS_ResourceSetList = calloc(1,sizeof(*csires0->csi_RS_ResourceSetList.choice.nzp_CSI_RS_SSB->nzp_CSI_RS_ResourceSetList));
|
||||
NR_NZP_CSI_RS_ResourceSetId_t *nzp0 = calloc(1,sizeof(*nzp0));
|
||||
*nzp0 = 0;
|
||||
ASN_SEQUENCE_ADD(&csires0->csi_RS_ResourceSetList.choice.nzp_CSI_RS_SSB->nzp_CSI_RS_ResourceSetList->list,nzp0);
|
||||
csires0->bwp_Id = 1;
|
||||
csires0->resourceType = NR_CSI_ResourceConfig__resourceType_periodic;
|
||||
ASN_SEQUENCE_ADD(&csi_MeasConfig->csi_ResourceConfigToAddModList->list,csires0);
|
||||
|
||||
if (do_csirs) {
|
||||
csi_MeasConfig->csi_ResourceConfigToReleaseList = NULL;
|
||||
NR_CSI_ResourceConfig_t *csires0 = calloc(1,sizeof(*csires0));
|
||||
csires0->csi_ResourceConfigId=0;
|
||||
csires0->csi_RS_ResourceSetList.present = NR_CSI_ResourceConfig__csi_RS_ResourceSetList_PR_nzp_CSI_RS_SSB;
|
||||
csires0->csi_RS_ResourceSetList.choice.nzp_CSI_RS_SSB = calloc(1,sizeof(*csires0->csi_RS_ResourceSetList.choice.nzp_CSI_RS_SSB));
|
||||
csires0->csi_RS_ResourceSetList.choice.nzp_CSI_RS_SSB->nzp_CSI_RS_ResourceSetList = calloc(1,sizeof(*csires0->csi_RS_ResourceSetList.choice.nzp_CSI_RS_SSB->nzp_CSI_RS_ResourceSetList));
|
||||
NR_NZP_CSI_RS_ResourceSetId_t *nzp0 = calloc(1,sizeof(*nzp0));
|
||||
*nzp0 = 0;
|
||||
ASN_SEQUENCE_ADD(&csires0->csi_RS_ResourceSetList.choice.nzp_CSI_RS_SSB->nzp_CSI_RS_ResourceSetList->list,nzp0);
|
||||
csires0->bwp_Id = 1;
|
||||
csires0->resourceType = NR_CSI_ResourceConfig__resourceType_periodic;
|
||||
ASN_SEQUENCE_ADD(&csi_MeasConfig->csi_ResourceConfigToAddModList->list,csires0);
|
||||
}
|
||||
|
||||
NR_CSI_ResourceConfig_t *csires1 = calloc(1,sizeof(*csires1));
|
||||
csires1->csi_ResourceConfigId=1;
|
||||
@@ -1204,77 +1218,147 @@ void fill_default_secondaryCellGroup(NR_ServingCellConfigCommon_t *servingcellco
|
||||
csires1->resourceType = NR_CSI_ResourceConfig__resourceType_periodic;
|
||||
ASN_SEQUENCE_ADD(&csi_MeasConfig->csi_ResourceConfigToAddModList->list,csires1);
|
||||
|
||||
csi_MeasConfig->csi_ReportConfigToAddModList = calloc(1,sizeof(*csi_MeasConfig->csi_ReportConfigToAddModList));
|
||||
csi_MeasConfig->csi_ReportConfigToReleaseList = NULL;
|
||||
NR_CSI_ReportConfig_t *csirep1 = calloc(1,sizeof(*csirep1));
|
||||
csirep1->reportConfigId=0;
|
||||
csirep1->carrier=NULL;
|
||||
csirep1->resourcesForChannelMeasurement=0;
|
||||
csirep1->csi_IM_ResourcesForInterference=NULL;
|
||||
csirep1->nzp_CSI_RS_ResourcesForInterference=NULL;
|
||||
csirep1->reportConfigType.present = NR_CSI_ReportConfig__reportConfigType_PR_periodic;
|
||||
csirep1->reportConfigType.choice.periodic = calloc(1,sizeof(*csirep1->reportConfigType.choice.periodic));
|
||||
csirep1->reportConfigType.choice.periodic->reportSlotConfig.present=NR_CSI_ReportPeriodicityAndOffset_PR_slots320;
|
||||
csirep1->reportConfigType.choice.periodic->reportSlotConfig.choice.slots320 = 9 + (20 * uid) % 320;
|
||||
if (do_csirs && dl_antenna_ports > 1) {
|
||||
NR_CSI_ResourceConfig_t *csires2 = calloc(1,sizeof(*csires2));
|
||||
csires2->csi_ResourceConfigId=2;
|
||||
csires2->csi_RS_ResourceSetList.present = NR_CSI_ResourceConfig__csi_RS_ResourceSetList_PR_csi_IM_ResourceSetList;
|
||||
csires2->csi_RS_ResourceSetList.choice.csi_IM_ResourceSetList = calloc(1,sizeof(*csires2->csi_RS_ResourceSetList.choice.csi_IM_ResourceSetList));
|
||||
NR_CSI_IM_ResourceSetId_t *csiim00 = calloc(1,sizeof(*csiim00));
|
||||
*csiim00 = 0;
|
||||
ASN_SEQUENCE_ADD(&csires2->csi_RS_ResourceSetList.choice.csi_IM_ResourceSetList->list,csiim00);
|
||||
ASN_SEQUENCE_ADD(&csi_MeasConfig->csi_ResourceConfigToAddModList->list,csires2);
|
||||
}
|
||||
|
||||
NR_PUCCH_CSI_Resource_t *pucchcsires1 = calloc(1,sizeof(*pucchcsires1));
|
||||
pucchcsires1->uplinkBandwidthPartId=1;
|
||||
pucchcsires1->pucch_Resource=2;
|
||||
ASN_SEQUENCE_ADD(&csirep1->reportConfigType.choice.periodic->pucch_CSI_ResourceList.list,pucchcsires1);
|
||||
csirep1->reportQuantity.present = NR_CSI_ReportConfig__reportQuantity_PR_cri_RSRP;
|
||||
csirep1->reportQuantity.choice.cri_RSRP=(NULL_t)0;
|
||||
csirep1->reportFreqConfiguration = calloc(1,sizeof(*csirep1->reportFreqConfiguration));
|
||||
csirep1->reportFreqConfiguration->cqi_FormatIndicator = NULL;
|
||||
csirep1->reportFreqConfiguration->pmi_FormatIndicator=NULL;
|
||||
csirep1->reportFreqConfiguration->csi_ReportingBand=NULL;
|
||||
csirep1->timeRestrictionForChannelMeasurements= NR_CSI_ReportConfig__timeRestrictionForChannelMeasurements_configured;
|
||||
csirep1->timeRestrictionForInterferenceMeasurements=NR_CSI_ReportConfig__timeRestrictionForInterferenceMeasurements_configured;
|
||||
csirep1->codebookConfig=NULL;
|
||||
csirep1->dummy = NULL;
|
||||
csirep1->groupBasedBeamReporting.present = NR_CSI_ReportConfig__groupBasedBeamReporting_PR_disabled;
|
||||
csirep1->groupBasedBeamReporting.choice.disabled=calloc(1,sizeof(*csirep1->groupBasedBeamReporting.choice.disabled));
|
||||
csirep1->groupBasedBeamReporting.choice.disabled->nrofReportedRS = calloc(1,sizeof(*csirep1->groupBasedBeamReporting.choice.disabled->nrofReportedRS));
|
||||
*csirep1->groupBasedBeamReporting.choice.disabled->nrofReportedRS=NR_CSI_ReportConfig__groupBasedBeamReporting__disabled__nrofReportedRS_n1;
|
||||
csirep1->cqi_Table = NULL;
|
||||
csirep1->subbandSize = NR_CSI_ReportConfig__subbandSize_value1;
|
||||
csirep1->non_PMI_PortIndication = NULL;
|
||||
csirep1->ext1 = NULL;
|
||||
|
||||
ASN_SEQUENCE_ADD(&csi_MeasConfig->csi_ReportConfigToAddModList->list,csirep1);
|
||||
csi_MeasConfig->csi_ReportConfigToAddModList = calloc(1,sizeof(*csi_MeasConfig->csi_ReportConfigToAddModList));
|
||||
csi_MeasConfig->csi_ReportConfigToReleaseList = NULL;
|
||||
if (do_csirs && dl_antenna_ports > 1) {
|
||||
NR_CSI_ReportConfig_t *csirep1 = calloc(1,sizeof(*csirep1));
|
||||
csirep1->reportConfigId=0;
|
||||
csirep1->carrier=NULL;
|
||||
csirep1->resourcesForChannelMeasurement=0;
|
||||
csirep1->csi_IM_ResourcesForInterference=calloc(1,sizeof(*csirep1->csi_IM_ResourcesForInterference));
|
||||
*csirep1->csi_IM_ResourcesForInterference=2;
|
||||
csirep1->nzp_CSI_RS_ResourcesForInterference=NULL;
|
||||
csirep1->reportConfigType.present = NR_CSI_ReportConfig__reportConfigType_PR_periodic;
|
||||
csirep1->reportConfigType.choice.periodic = calloc(1,sizeof(*csirep1->reportConfigType.choice.periodic));
|
||||
csirep1->reportConfigType.choice.periodic->reportSlotConfig.present=NR_CSI_ReportPeriodicityAndOffset_PR_slots320;
|
||||
csirep1->reportConfigType.choice.periodic->reportSlotConfig.choice.slots320 = 9 + (20 * uid) % 320;
|
||||
ASN_SEQUENCE_ADD(&csirep1->reportConfigType.choice.periodic->pucch_CSI_ResourceList.list,pucchcsires1);
|
||||
csirep1->reportQuantity.present = NR_CSI_ReportConfig__reportQuantity_PR_cri_RI_PMI_CQI;
|
||||
csirep1->reportQuantity.choice.cri_RI_PMI_CQI=(NULL_t)0;
|
||||
csirep1->reportFreqConfiguration = calloc(1,sizeof(*csirep1->reportFreqConfiguration));
|
||||
csirep1->reportFreqConfiguration->cqi_FormatIndicator = calloc(1,sizeof(*csirep1->reportFreqConfiguration->cqi_FormatIndicator));
|
||||
*csirep1->reportFreqConfiguration->cqi_FormatIndicator=NR_CSI_ReportConfig__reportFreqConfiguration__cqi_FormatIndicator_widebandCQI;
|
||||
csirep1->reportFreqConfiguration->pmi_FormatIndicator = calloc(1,sizeof(*csirep1->reportFreqConfiguration->pmi_FormatIndicator));
|
||||
*csirep1->reportFreqConfiguration->pmi_FormatIndicator=NR_CSI_ReportConfig__reportFreqConfiguration__pmi_FormatIndicator_widebandPMI;
|
||||
csirep1->reportFreqConfiguration->csi_ReportingBand = calloc(1,sizeof(*csirep1->reportFreqConfiguration->csi_ReportingBand));
|
||||
csirep1->reportFreqConfiguration->csi_ReportingBand->present = NR_CSI_ReportConfig__reportFreqConfiguration__csi_ReportingBand_PR_subbands7;
|
||||
csirep1->reportFreqConfiguration->csi_ReportingBand->choice.subbands7.size=1;
|
||||
csirep1->reportFreqConfiguration->csi_ReportingBand->choice.subbands7.bits_unused=1;
|
||||
csirep1->reportFreqConfiguration->csi_ReportingBand->choice.subbands7.buf=malloc(1);
|
||||
csirep1->reportFreqConfiguration->csi_ReportingBand->choice.subbands7.buf[0]=254;
|
||||
csirep1->timeRestrictionForChannelMeasurements= NR_CSI_ReportConfig__timeRestrictionForChannelMeasurements_configured;
|
||||
csirep1->timeRestrictionForInterferenceMeasurements=NR_CSI_ReportConfig__timeRestrictionForInterferenceMeasurements_configured;
|
||||
csirep1->codebookConfig=calloc(1,sizeof(*csirep1->codebookConfig));
|
||||
csirep1->codebookConfig->codebookType.present = NR_CodebookConfig__codebookType_PR_type1;
|
||||
csirep1->codebookConfig->codebookType.choice.type1 = calloc(1,sizeof(*csirep1->codebookConfig->codebookType.choice.type1));
|
||||
csirep1->codebookConfig->codebookType.choice.type1->subType.present=NR_CodebookConfig__codebookType__type1__subType_PR_typeI_SinglePanel;
|
||||
csirep1->codebookConfig->codebookType.choice.type1->subType.choice.typeI_SinglePanel=calloc(1,sizeof(*csirep1->codebookConfig->codebookType.choice.type1->subType.choice.typeI_SinglePanel));
|
||||
csirep1->codebookConfig->codebookType.choice.type1->subType.choice.typeI_SinglePanel->nrOfAntennaPorts.present=
|
||||
NR_CodebookConfig__codebookType__type1__subType__typeI_SinglePanel__nrOfAntennaPorts_PR_two;
|
||||
csirep1->codebookConfig->codebookType.choice.type1->subType.choice.typeI_SinglePanel->nrOfAntennaPorts.choice.two=
|
||||
calloc(1,sizeof(*csirep1->codebookConfig->codebookType.choice.type1->subType.choice.typeI_SinglePanel->nrOfAntennaPorts.choice.two));
|
||||
csirep1->codebookConfig->codebookType.choice.type1->subType.choice.typeI_SinglePanel->nrOfAntennaPorts.choice.two->twoTX_CodebookSubsetRestriction.size=1;
|
||||
csirep1->codebookConfig->codebookType.choice.type1->subType.choice.typeI_SinglePanel->nrOfAntennaPorts.choice.two->twoTX_CodebookSubsetRestriction.bits_unused=2;
|
||||
csirep1->codebookConfig->codebookType.choice.type1->subType.choice.typeI_SinglePanel->nrOfAntennaPorts.choice.two->twoTX_CodebookSubsetRestriction.buf=malloc(1);
|
||||
csirep1->codebookConfig->codebookType.choice.type1->subType.choice.typeI_SinglePanel->nrOfAntennaPorts.choice.two->twoTX_CodebookSubsetRestriction.buf[0]=0xfc;
|
||||
csirep1->codebookConfig->codebookType.choice.type1->subType.choice.typeI_SinglePanel->typeI_SinglePanel_ri_Restriction.size=1;
|
||||
csirep1->codebookConfig->codebookType.choice.type1->subType.choice.typeI_SinglePanel->typeI_SinglePanel_ri_Restriction.bits_unused=0;
|
||||
csirep1->codebookConfig->codebookType.choice.type1->subType.choice.typeI_SinglePanel->typeI_SinglePanel_ri_Restriction.buf=malloc(1);
|
||||
csirep1->codebookConfig->codebookType.choice.type1->subType.choice.typeI_SinglePanel->typeI_SinglePanel_ri_Restriction.buf[0]=0x03;
|
||||
csirep1->codebookConfig->codebookType.choice.type1->codebookMode=1;
|
||||
csirep1->dummy = NULL;
|
||||
csirep1->groupBasedBeamReporting.present = NR_CSI_ReportConfig__groupBasedBeamReporting_PR_disabled;
|
||||
csirep1->groupBasedBeamReporting.choice.disabled=calloc(1,sizeof(*csirep1->groupBasedBeamReporting.choice.disabled));
|
||||
//csirep1->groupBasedBeamReporting.choice.disabled->nrofReportedRS = calloc(1,sizeof(*csirep1->groupBasedBeamReporting.choice.disabled->nrofReportedRS));
|
||||
//*csirep1->groupBasedBeamReporting.choice.disabled->nrofReportedRS=NR_CSI_ReportConfig__groupBasedBeamReporting__disabled__nrofReportedRS_n1;
|
||||
csirep1->cqi_Table = calloc(1,sizeof(*csirep1->cqi_Table));
|
||||
*csirep1->cqi_Table = NR_CSI_ReportConfig__cqi_Table_table1;
|
||||
csirep1->subbandSize = NR_CSI_ReportConfig__subbandSize_value2;
|
||||
csirep1->non_PMI_PortIndication = NULL;
|
||||
csirep1->ext1 = NULL;
|
||||
ASN_SEQUENCE_ADD(&csi_MeasConfig->csi_ReportConfigToAddModList->list,csirep1);
|
||||
}
|
||||
|
||||
NR_CSI_ReportConfig_t *csirep2 = calloc(1,sizeof(*csirep2));
|
||||
csirep2->reportConfigId=1;
|
||||
csirep2->carrier=NULL;
|
||||
csirep2->resourcesForChannelMeasurement=1;
|
||||
csirep2->csi_IM_ResourcesForInterference=NULL;
|
||||
csirep2->nzp_CSI_RS_ResourcesForInterference=NULL;
|
||||
csirep2->reportConfigType.present = NR_CSI_ReportConfig__reportConfigType_PR_periodic;
|
||||
csirep2->reportConfigType.choice.periodic = calloc(1,sizeof(*csirep2->reportConfigType.choice.periodic));
|
||||
csirep2->reportConfigType.choice.periodic->reportSlotConfig.present=NR_CSI_ReportPeriodicityAndOffset_PR_slots320;
|
||||
csirep2->reportConfigType.choice.periodic->reportSlotConfig.choice.slots320 = 29 + (20 * uid) % 320;
|
||||
ASN_SEQUENCE_ADD(&csirep2->reportConfigType.choice.periodic->pucch_CSI_ResourceList.list,pucchcsires1);
|
||||
csirep2->reportQuantity.present = NR_CSI_ReportConfig__reportQuantity_PR_ssb_Index_RSRP;
|
||||
csirep2->reportQuantity.choice.ssb_Index_RSRP=(NULL_t)0;
|
||||
csirep2->reportFreqConfiguration = calloc(1,sizeof(*csirep2->reportFreqConfiguration));
|
||||
csirep2->reportFreqConfiguration->cqi_FormatIndicator=NR_CSI_ReportConfig__reportFreqConfiguration__cqi_FormatIndicator_widebandCQI;
|
||||
csirep2->reportFreqConfiguration->pmi_FormatIndicator=NR_CSI_ReportConfig__reportFreqConfiguration__pmi_FormatIndicator_widebandPMI;
|
||||
csirep2->reportFreqConfiguration->csi_ReportingBand=NULL;
|
||||
csirep2->timeRestrictionForChannelMeasurements= NR_CSI_ReportConfig__timeRestrictionForChannelMeasurements_configured;
|
||||
csirep2->timeRestrictionForInterferenceMeasurements=NR_CSI_ReportConfig__timeRestrictionForInterferenceMeasurements_configured;
|
||||
csirep2->codebookConfig= NULL;
|
||||
|
||||
csirep2->dummy = NULL;
|
||||
csirep2->groupBasedBeamReporting.present = NR_CSI_ReportConfig__groupBasedBeamReporting_PR_disabled;
|
||||
csirep2->groupBasedBeamReporting.choice.disabled=calloc(1,sizeof(*csirep2->groupBasedBeamReporting.choice.disabled));
|
||||
csirep2->groupBasedBeamReporting.choice.disabled->nrofReportedRS = calloc(1,sizeof(*csirep2->groupBasedBeamReporting.choice.disabled->nrofReportedRS));
|
||||
*csirep2->groupBasedBeamReporting.choice.disabled->nrofReportedRS=NR_CSI_ReportConfig__groupBasedBeamReporting__disabled__nrofReportedRS_n1;
|
||||
|
||||
csirep2->cqi_Table = calloc(1,sizeof(*csirep2->cqi_Table));
|
||||
*csirep2->cqi_Table = NR_CSI_ReportConfig__cqi_Table_table1;
|
||||
csirep2->subbandSize = NR_CSI_ReportConfig__subbandSize_value1;
|
||||
csirep2->non_PMI_PortIndication = NULL;
|
||||
csirep2->ext1 = NULL;
|
||||
|
||||
ASN_SEQUENCE_ADD(&csi_MeasConfig->csi_ReportConfigToAddModList->list,csirep2);
|
||||
if (do_csirs) {
|
||||
NR_CSI_ReportConfig_t *csirep2 = calloc(1,sizeof(*csirep2));
|
||||
csirep2->reportConfigId=1;
|
||||
csirep2->carrier=NULL;
|
||||
csirep2->resourcesForChannelMeasurement=0;
|
||||
csirep2->csi_IM_ResourcesForInterference=NULL;
|
||||
csirep2->nzp_CSI_RS_ResourcesForInterference=NULL;
|
||||
csirep2->reportConfigType.present = NR_CSI_ReportConfig__reportConfigType_PR_periodic;
|
||||
csirep2->reportConfigType.choice.periodic = calloc(1,sizeof(*csirep2->reportConfigType.choice.periodic));
|
||||
csirep2->reportConfigType.choice.periodic->reportSlotConfig.present=NR_CSI_ReportPeriodicityAndOffset_PR_slots320;
|
||||
csirep2->reportConfigType.choice.periodic->reportSlotConfig.choice.slots320 = 29 + (20 * uid) % 320;
|
||||
ASN_SEQUENCE_ADD(&csirep2->reportConfigType.choice.periodic->pucch_CSI_ResourceList.list,pucchcsires1);
|
||||
csirep2->reportQuantity.present = NR_CSI_ReportConfig__reportQuantity_PR_cri_RSRP;
|
||||
csirep2->reportQuantity.choice.cri_RSRP=(NULL_t)0;
|
||||
csirep2->reportFreqConfiguration = calloc(1,sizeof(*csirep2->reportFreqConfiguration));
|
||||
csirep2->reportFreqConfiguration->cqi_FormatIndicator = NULL;
|
||||
csirep2->reportFreqConfiguration->pmi_FormatIndicator=NULL;
|
||||
csirep2->reportFreqConfiguration->csi_ReportingBand=NULL;
|
||||
csirep2->timeRestrictionForChannelMeasurements= NR_CSI_ReportConfig__timeRestrictionForChannelMeasurements_configured;
|
||||
csirep2->timeRestrictionForInterferenceMeasurements=NR_CSI_ReportConfig__timeRestrictionForInterferenceMeasurements_configured;
|
||||
csirep2->codebookConfig=NULL;
|
||||
csirep2->dummy = NULL;
|
||||
csirep2->groupBasedBeamReporting.present = NR_CSI_ReportConfig__groupBasedBeamReporting_PR_disabled;
|
||||
csirep2->groupBasedBeamReporting.choice.disabled=calloc(1,sizeof(*csirep2->groupBasedBeamReporting.choice.disabled));
|
||||
csirep2->groupBasedBeamReporting.choice.disabled->nrofReportedRS = calloc(1,sizeof(*csirep2->groupBasedBeamReporting.choice.disabled->nrofReportedRS));
|
||||
*csirep2->groupBasedBeamReporting.choice.disabled->nrofReportedRS=NR_CSI_ReportConfig__groupBasedBeamReporting__disabled__nrofReportedRS_n1;
|
||||
csirep2->cqi_Table = NULL;
|
||||
csirep2->subbandSize = NR_CSI_ReportConfig__subbandSize_value1;
|
||||
csirep2->non_PMI_PortIndication = NULL;
|
||||
csirep2->ext1 = NULL;
|
||||
ASN_SEQUENCE_ADD(&csi_MeasConfig->csi_ReportConfigToAddModList->list,csirep2);
|
||||
}
|
||||
else{
|
||||
NR_CSI_ReportConfig_t *csirep2 = calloc(1,sizeof(*csirep2));
|
||||
csirep2->reportConfigId=1;
|
||||
csirep2->carrier=NULL;
|
||||
csirep2->resourcesForChannelMeasurement=1;
|
||||
csirep2->csi_IM_ResourcesForInterference=NULL;
|
||||
csirep2->nzp_CSI_RS_ResourcesForInterference=NULL;
|
||||
csirep2->reportConfigType.present = NR_CSI_ReportConfig__reportConfigType_PR_periodic;
|
||||
csirep2->reportConfigType.choice.periodic = calloc(1,sizeof(*csirep2->reportConfigType.choice.periodic));
|
||||
csirep2->reportConfigType.choice.periodic->reportSlotConfig.present=NR_CSI_ReportPeriodicityAndOffset_PR_slots320;
|
||||
csirep2->reportConfigType.choice.periodic->reportSlotConfig.choice.slots320 = 29 + (20 * uid) % 320;
|
||||
ASN_SEQUENCE_ADD(&csirep2->reportConfigType.choice.periodic->pucch_CSI_ResourceList.list,pucchcsires1);
|
||||
csirep2->reportQuantity.present = NR_CSI_ReportConfig__reportQuantity_PR_ssb_Index_RSRP;
|
||||
csirep2->reportQuantity.choice.ssb_Index_RSRP=(NULL_t)0;
|
||||
csirep2->reportFreqConfiguration = calloc(1,sizeof(*csirep2->reportFreqConfiguration));
|
||||
csirep2->reportFreqConfiguration->cqi_FormatIndicator=NR_CSI_ReportConfig__reportFreqConfiguration__cqi_FormatIndicator_widebandCQI;
|
||||
csirep2->reportFreqConfiguration->pmi_FormatIndicator=NR_CSI_ReportConfig__reportFreqConfiguration__pmi_FormatIndicator_widebandPMI;
|
||||
csirep2->reportFreqConfiguration->csi_ReportingBand=NULL;
|
||||
csirep2->timeRestrictionForChannelMeasurements= NR_CSI_ReportConfig__timeRestrictionForChannelMeasurements_configured;
|
||||
csirep2->timeRestrictionForInterferenceMeasurements=NR_CSI_ReportConfig__timeRestrictionForInterferenceMeasurements_configured;
|
||||
csirep2->codebookConfig= NULL;
|
||||
csirep2->dummy = NULL;
|
||||
csirep2->groupBasedBeamReporting.present = NR_CSI_ReportConfig__groupBasedBeamReporting_PR_disabled;
|
||||
csirep2->groupBasedBeamReporting.choice.disabled=calloc(1,sizeof(*csirep2->groupBasedBeamReporting.choice.disabled));
|
||||
csirep2->groupBasedBeamReporting.choice.disabled->nrofReportedRS = calloc(1,sizeof(*csirep2->groupBasedBeamReporting.choice.disabled->nrofReportedRS));
|
||||
*csirep2->groupBasedBeamReporting.choice.disabled->nrofReportedRS=NR_CSI_ReportConfig__groupBasedBeamReporting__disabled__nrofReportedRS_n1;
|
||||
csirep2->cqi_Table = calloc(1,sizeof(*csirep2->cqi_Table));
|
||||
*csirep2->cqi_Table = NR_CSI_ReportConfig__cqi_Table_table1;
|
||||
csirep2->subbandSize = NR_CSI_ReportConfig__subbandSize_value1;
|
||||
csirep2->non_PMI_PortIndication = NULL;
|
||||
csirep2->ext1 = NULL;
|
||||
ASN_SEQUENCE_ADD(&csi_MeasConfig->csi_ReportConfigToAddModList->list,csirep2);
|
||||
}
|
||||
|
||||
secondaryCellGroup->spCellConfig->spCellConfigDedicated->sCellDeactivationTimer=NULL;
|
||||
secondaryCellGroup->spCellConfig->spCellConfigDedicated->crossCarrierSchedulingConfig=NULL;
|
||||
@@ -1285,11 +1369,65 @@ void fill_default_secondaryCellGroup(NR_ServingCellConfigCommon_t *servingcellco
|
||||
|
||||
}
|
||||
|
||||
|
||||
void config_csirs(NR_ServingCellConfigCommon_t *servingcellconfigcommon, NR_CSI_MeasConfig_t *csi_MeasConfig, int dl_antenna_ports, int do_csirs) {
|
||||
|
||||
if (do_csirs) {
|
||||
csi_MeasConfig->nzp_CSI_RS_ResourceToAddModList = calloc(1,sizeof(*csi_MeasConfig->nzp_CSI_RS_ResourceToAddModList));
|
||||
NR_NZP_CSI_RS_Resource_t *nzpcsi0 = calloc(1,sizeof(*nzpcsi0));
|
||||
nzpcsi0->nzp_CSI_RS_ResourceId = 0;
|
||||
NR_CSI_RS_ResourceMapping_t resourceMapping;
|
||||
switch (dl_antenna_ports) {
|
||||
case 1:
|
||||
resourceMapping.frequencyDomainAllocation.present = NR_CSI_RS_ResourceMapping__frequencyDomainAllocation_PR_row2;
|
||||
resourceMapping.frequencyDomainAllocation.choice.row2.buf = calloc(2, sizeof(uint8_t));
|
||||
resourceMapping.frequencyDomainAllocation.choice.row2.size = 2;
|
||||
resourceMapping.frequencyDomainAllocation.choice.row2.bits_unused = 4;
|
||||
resourceMapping.frequencyDomainAllocation.choice.row2.buf[0]=0;
|
||||
resourceMapping.frequencyDomainAllocation.choice.row2.buf[1]=16;
|
||||
resourceMapping.nrofPorts = NR_CSI_RS_ResourceMapping__nrofPorts_p1;
|
||||
resourceMapping.cdm_Type = NR_CSI_RS_ResourceMapping__cdm_Type_noCDM;
|
||||
break;
|
||||
case 2:
|
||||
resourceMapping.frequencyDomainAllocation.present = NR_CSI_RS_ResourceMapping__frequencyDomainAllocation_PR_other;
|
||||
resourceMapping.frequencyDomainAllocation.choice.row2.buf = calloc(2, sizeof(uint8_t));
|
||||
resourceMapping.frequencyDomainAllocation.choice.row2.size = 1;
|
||||
resourceMapping.frequencyDomainAllocation.choice.row2.bits_unused = 2;
|
||||
resourceMapping.frequencyDomainAllocation.choice.row2.buf[0]=4;
|
||||
resourceMapping.nrofPorts = NR_CSI_RS_ResourceMapping__nrofPorts_p2;
|
||||
resourceMapping.cdm_Type = NR_CSI_RS_ResourceMapping__cdm_Type_fd_CDM2;
|
||||
break;
|
||||
default:
|
||||
AssertFatal(1==0,"Number of ports not yet supported\n");
|
||||
}
|
||||
resourceMapping.firstOFDMSymbolInTimeDomain = 6;
|
||||
resourceMapping.firstOFDMSymbolInTimeDomain2 = NULL;
|
||||
resourceMapping.density.present = NR_CSI_RS_ResourceMapping__density_PR_one;
|
||||
resourceMapping.density.choice.one = (NULL_t)0;
|
||||
resourceMapping.freqBand.startingRB = 0;
|
||||
resourceMapping.freqBand.nrofRBs = 108;
|
||||
nzpcsi0->resourceMapping = resourceMapping;
|
||||
nzpcsi0->powerControlOffset = 0;
|
||||
nzpcsi0->powerControlOffsetSS=calloc(1,sizeof(*nzpcsi0->powerControlOffsetSS));
|
||||
*nzpcsi0->powerControlOffsetSS = NR_NZP_CSI_RS_Resource__powerControlOffsetSS_db0;
|
||||
nzpcsi0->scramblingID = *servingcellconfigcommon->physCellId;
|
||||
nzpcsi0->periodicityAndOffset = calloc(1,sizeof(*nzpcsi0->periodicityAndOffset));
|
||||
nzpcsi0->periodicityAndOffset->present = NR_CSI_ResourcePeriodicityAndOffset_PR_slots320;
|
||||
nzpcsi0->periodicityAndOffset->choice.slots320 = 0;
|
||||
nzpcsi0->qcl_InfoPeriodicCSI_RS = NULL;
|
||||
ASN_SEQUENCE_ADD(&csi_MeasConfig->nzp_CSI_RS_ResourceToAddModList->list,nzpcsi0);
|
||||
}
|
||||
else
|
||||
csi_MeasConfig->nzp_CSI_RS_ResourceToAddModList = NULL;
|
||||
}
|
||||
|
||||
|
||||
void fill_default_reconfig(NR_ServingCellConfigCommon_t *servingcellconfigcommon,
|
||||
NR_ServingCellConfig_t *servingcellconfigdedicated,
|
||||
NR_RRCReconfiguration_IEs_t *reconfig,
|
||||
NR_CellGroupConfig_t *secondaryCellGroup,
|
||||
int n_physical_antenna_ports,
|
||||
int dl_antenna_ports,
|
||||
int do_csirs,
|
||||
int initial_csi_index,
|
||||
int uid) {
|
||||
AssertFatal(servingcellconfigcommon!=NULL,"servingcellconfigcommon is null\n");
|
||||
@@ -1303,9 +1441,11 @@ void fill_default_reconfig(NR_ServingCellConfigCommon_t *servingcellconfigcommon
|
||||
secondaryCellGroup,
|
||||
1,
|
||||
1,
|
||||
n_physical_antenna_ports,
|
||||
dl_antenna_ports,
|
||||
do_csirs,
|
||||
initial_csi_index,
|
||||
uid);
|
||||
|
||||
xer_fprint(stdout, &asn_DEF_NR_CellGroupConfig, (const void*)secondaryCellGroup);
|
||||
|
||||
char scg_buffer[1024];
|
||||
|
||||
@@ -810,6 +810,7 @@ int device_init(openair0_device *device, openair0_config_t *openair0_cfg) {
|
||||
device->trx_read_func = rfsimulator_read;
|
||||
/* let's pretend to be a b2x0 */
|
||||
device->type = RFSIMULATOR;
|
||||
openair0_cfg[0].rx_gain[0] = 0;
|
||||
device->openair0_cfg=&openair0_cfg[0];
|
||||
device->priv = rfsimulator;
|
||||
device->trx_write_init = rfsimulator_write_init;
|
||||
|
||||
Reference in New Issue
Block a user