Commit 331fb1ce authored by Robert Schmidt's avatar Robert Schmidt

Merge remote-tracking branch 'origin/better-dci-decoding' into integration_2024_w09

parents 64e58c1d 56c4a6ec
...@@ -497,6 +497,8 @@ int logInit (void) ...@@ -497,6 +497,8 @@ int logInit (void)
register_log_component("GNB_APP","log",GNB_APP); register_log_component("GNB_APP","log",GNB_APP);
register_log_component("NR_RRC","log",NR_RRC); register_log_component("NR_RRC","log",NR_RRC);
register_log_component("NR_MAC","log",NR_MAC); register_log_component("NR_MAC","log",NR_MAC);
register_log_component("NR_MAC_DCI", "log", NR_MAC_DCI);
register_log_component("NR_PHY_DCI", "log", NR_PHY_DCI);
register_log_component("NR_PHY","log",NR_PHY); register_log_component("NR_PHY","log",NR_PHY);
register_log_component("NGAP","",NGAP); register_log_component("NGAP","",NGAP);
register_log_component("ITTI","log",ITTI); register_log_component("ITTI","log",ITTI);
......
...@@ -215,6 +215,8 @@ typedef enum { ...@@ -215,6 +215,8 @@ typedef enum {
GNB_APP, GNB_APP,
NR_RRC, NR_RRC,
NR_MAC, NR_MAC,
NR_MAC_DCI,
NR_PHY_DCI,
NR_PHY, NR_PHY,
LOADER, LOADER,
ASN1, ASN1,
...@@ -223,8 +225,7 @@ typedef enum { ...@@ -223,8 +225,7 @@ typedef enum {
ITTI, ITTI,
UTIL, UTIL,
MAX_LOG_PREDEF_COMPONENTS, MAX_LOG_PREDEF_COMPONENTS,
} } comp_name_t;
comp_name_t;
#define MAX_LOG_DYNALLOC_COMPONENTS 20 #define MAX_LOG_DYNALLOC_COMPONENTS 20
#define MAX_LOG_COMPONENTS (MAX_LOG_PREDEF_COMPONENTS + MAX_LOG_DYNALLOC_COMPONENTS) #define MAX_LOG_COMPONENTS (MAX_LOG_PREDEF_COMPONENTS + MAX_LOG_DYNALLOC_COMPONENTS)
...@@ -247,7 +248,7 @@ typedef struct { ...@@ -247,7 +248,7 @@ typedef struct {
log_vprint_func_t vprint; log_vprint_func_t vprint;
log_print_func_t print; log_print_func_t print;
/* SR: make the log buffer component relative */ /* SR: make the log buffer component relative */
char log_buffer[MAX_LOG_TOTAL]; // char log_buffer[MAX_LOG_TOTAL];
} log_component_t; } log_component_t;
......
...@@ -361,6 +361,48 @@ ID = LEGACY_NR_MAC_TRACE ...@@ -361,6 +361,48 @@ ID = LEGACY_NR_MAC_TRACE
GROUP = ALL:LEGACY_NR_MAC:LEGACY_GROUP_TRACE:LEGACY GROUP = ALL:LEGACY_NR_MAC:LEGACY_GROUP_TRACE:LEGACY
FORMAT = string,log FORMAT = string,log
ID = LEGACY_NR_PHY_DCI_INFO
DESC = NR_PHY_DCI legacy logs - info level
GROUP = ALL:LEGACY_NR_PHY_DCI:LEGACY_GROUP_INFO:LEGACY
FORMAT = string,log
ID = LEGACY_NR_PHY_DCI_ERROR
DESC = NR_PHY_DCI legacy logs - error level
GROUP = ALL:LEGACY_NR_PHY_DCI:LEGACY_GROUP_ERROR:LEGACY
FORMAT = string,log
ID = LEGACY_NR_PHY_DCI_WARNING
DESC = NR_PHY_DCI legacy logs - warning level
GROUP = ALL:LEGACY_NR_PHY_DCI:LEGACY_GROUP_WARNING:LEGACY
FORMAT = string,log
ID = LEGACY_NR_PHY_DCI_DEBUG
DESC = NR_PHY_DCI legacy logs - debug level
GROUP = ALL:LEGACY_NR_PHY_DCI:LEGACY_GROUP_DEBUG:LEGACY
FORMAT = string,log
ID = LEGACY_NR_PHY_DCI_TRACE
DESC = NR_PHY_DCI legacy logs - trace level
GROUP = ALL:LEGACY_NR_PHY_DCI:LEGACY_GROUP_TRACE:LEGACY
FORMAT = string,log
ID = LEGACY_NR_MAC_DCI_INFO
DESC = NR_MAC_DCI legacy logs - info level
GROUP = ALL:LEGACY_NR_MAC_DCI:LEGACY_GROUP_INFO:LEGACY
FORMAT = string,log
ID = LEGACY_NR_MAC_DCI_ERROR
DESC = NR_MAC_DCI legacy logs - error level
GROUP = ALL:LEGACY_NR_MAC_DCI:LEGACY_GROUP_ERROR:LEGACY
FORMAT = string,log
ID = LEGACY_NR_MAC_DCI_WARNING
DESC = NR_MAC_DCI legacy logs - warning level
GROUP = ALL:LEGACY_NR_MAC_DCI:LEGACY_GROUP_WARNING:LEGACY
FORMAT = string,log
ID = LEGACY_NR_MAC_DCI_DEBUG
DESC = NR_MAC_DCI legacy logs - debug level
GROUP = ALL:LEGACY_NR_MAC_DCI:LEGACY_GROUP_DEBUG:LEGACY
FORMAT = string,log
ID = LEGACY_NR_MAC_DCI_TRACE
DESC = NR_MAC_DCI legacy logs - trace level
GROUP = ALL:LEGACY_NR_MAC_DCI:LEGACY_GROUP_TRACE:LEGACY
FORMAT = string,log
ID = LEGACY_PHY_INFO ID = LEGACY_PHY_INFO
DESC = PHY legacy logs - info level DESC = PHY legacy logs - info level
GROUP = ALL:LEGACY_PHY:LEGACY_GROUP_INFO:LEGACY GROUP = ALL:LEGACY_PHY:LEGACY_GROUP_INFO:LEGACY
......
...@@ -50,7 +50,7 @@ void nr_pdcch_scrambling(uint32_t *in, ...@@ -50,7 +50,7 @@ void nr_pdcch_scrambling(uint32_t *in,
uint32_t x1 = 0, x2 = 0, s = 0; uint32_t x1 = 0, x2 = 0, s = 0;
reset = 1; reset = 1;
x2 = (scrambling_RNTI<<16) + Nid; x2 = (scrambling_RNTI<<16) + Nid;
LOG_D(PHY,"PDCCH Scrambling x2 %x : scrambling_RNTI %x \n", x2, scrambling_RNTI); LOG_D(NR_PHY_DCI, "PDCCH Scrambling x2 %x : scrambling_RNTI %x \n", x2, scrambling_RNTI);
for (int i=0; i<size; i++) { for (int i=0; i<size; i++) {
if ((i&0x1f)==0) { if ((i&0x1f)==0) {
s = lte_gold_generic(&x1, &x2, reset); s = lte_gold_generic(&x1, &x2, reset);
...@@ -105,15 +105,28 @@ void nr_generate_dci(PHY_VARS_gNB *gNB, ...@@ -105,15 +105,28 @@ void nr_generate_dci(PHY_VARS_gNB *gNB,
cset_start_symb = pdcch_pdu_rel15->StartSymbolIndex; cset_start_symb = pdcch_pdu_rel15->StartSymbolIndex;
cset_nsymb = pdcch_pdu_rel15->DurationSymbols; cset_nsymb = pdcch_pdu_rel15->DurationSymbols;
dci_idx = 0; dci_idx = 0;
LOG_D(PHY, "pdcch: Coreset rb_offset %d, nb_rb %d BWP Start %d\n",rb_offset,n_rb,pdcch_pdu_rel15->BWPStart); LOG_D(NR_PHY_DCI, "pdcch: Coreset rb_offset %d, nb_rb %d BWP Start %d\n", rb_offset, n_rb, pdcch_pdu_rel15->BWPStart);
LOG_D(PHY, "pdcch: Coreset starting subcarrier %d on symbol %d (%d symbols)\n", cset_start_sc, cset_start_symb, cset_nsymb); LOG_D(NR_PHY_DCI,
"pdcch: Coreset starting subcarrier %d on symbol %d (%d symbols)\n",
cset_start_sc,
cset_start_symb,
cset_nsymb);
// DMRS length is per OFDM symbol // DMRS length is per OFDM symbol
uint32_t dmrs_length = (n_rb+pdcch_pdu_rel15->BWPStart)*6; //2(QPSK)*3(per RB)*6(REG per CCE) uint32_t dmrs_length = (n_rb+pdcch_pdu_rel15->BWPStart)*6; //2(QPSK)*3(per RB)*6(REG per CCE)
uint32_t encoded_length = dci_pdu->AggregationLevel*108; //2(QPSK)*9(per RB)*6(REG per CCE) uint32_t encoded_length = dci_pdu->AggregationLevel*108; //2(QPSK)*9(per RB)*6(REG per CCE)
if (dci_pdu->RNTI != 0xFFFF) if (dci_pdu->RNTI != 0xFFFF)
LOG_D(PHY, "DL_DCI : rb_offset %d, nb_rb %d, DMRS length per symbol %d\t DCI encoded length %d (precoder_granularity %d, reg_mapping %d), Scrambling_Id %d, ScramblingRNTI %x, PayloadSizeBits %d\n", LOG_D(NR_PHY_DCI,
rb_offset, n_rb,dmrs_length, encoded_length,pdcch_pdu_rel15->precoderGranularity,pdcch_pdu_rel15->CceRegMappingType, "DL_DCI : rb_offset %d, nb_rb %d, DMRS length per symbol %d\t DCI encoded length %d (precoder_granularity %d, "
dci_pdu->ScramblingId,dci_pdu->ScramblingRNTI,dci_pdu->PayloadSizeBits); "reg_mapping %d), Scrambling_Id %d, ScramblingRNTI %x, PayloadSizeBits %d\n",
rb_offset,
n_rb,
dmrs_length,
encoded_length,
pdcch_pdu_rel15->precoderGranularity,
pdcch_pdu_rel15->CceRegMappingType,
dci_pdu->ScramblingId,
dci_pdu->ScramblingRNTI,
dci_pdu->PayloadSizeBits);
dmrs_length += rb_offset*6; // To accommodate more DMRS symbols in case of rb offset dmrs_length += rb_offset*6; // To accommodate more DMRS symbols in case of rb offset
/// DMRS QPSK modulation /// DMRS QPSK modulation
...@@ -182,7 +195,7 @@ void nr_generate_dci(PHY_VARS_gNB *gNB, ...@@ -182,7 +195,7 @@ void nr_generate_dci(PHY_VARS_gNB *gNB,
// allocating rbs per symbol // allocating rbs per symbol
for (int reg_count = 0; reg_count < num_regs; reg_count++) { for (int reg_count = 0; reg_count < num_regs; reg_count++) {
k = cset_start_sc + reg_list[d][reg_count] * NR_NB_SC_PER_RB; k = cset_start_sc + reg_list[d][reg_count] * NR_NB_SC_PER_RB;
LOG_D(PHY, "REG %d k %d\n", reg_list[d][reg_count], k); LOG_D(NR_PHY_DCI, "REG %d k %d\n", reg_list[d][reg_count], k);
if (k >= frame_parms->ofdm_symbol_size) if (k >= frame_parms->ofdm_symbol_size)
k -= frame_parms->ofdm_symbol_size; k -= frame_parms->ofdm_symbol_size;
...@@ -202,7 +215,7 @@ void nr_generate_dci(PHY_VARS_gNB *gNB, ...@@ -202,7 +215,7 @@ void nr_generate_dci(PHY_VARS_gNB *gNB,
((int16_t *)txdataF)[((l * frame_parms->ofdm_symbol_size + k) << 1) + 1] = (amp * mod_dmrs[l][(dmrs_idx << 1) + 1]) >> 15; ((int16_t *)txdataF)[((l * frame_parms->ofdm_symbol_size + k) << 1) + 1] = (amp * mod_dmrs[l][(dmrs_idx << 1) + 1]) >> 15;
#ifdef DEBUG_PDCCH_DMRS #ifdef DEBUG_PDCCH_DMRS
LOG_I(PHY, LOG_I(NR_PHY_DCI,
"PDCCH DMRS %d: l %d position %d => (%d,%d)\n", "PDCCH DMRS %d: l %d position %d => (%d,%d)\n",
dmrs_idx, dmrs_idx,
l, l,
...@@ -218,7 +231,7 @@ void nr_generate_dci(PHY_VARS_gNB *gNB, ...@@ -218,7 +231,7 @@ void nr_generate_dci(PHY_VARS_gNB *gNB,
((int16_t *)txdataF)[(l * frame_parms->ofdm_symbol_size + k) << 1] = (amp * mod_dci[dci_idx << 1]) >> 15; ((int16_t *)txdataF)[(l * frame_parms->ofdm_symbol_size + k) << 1] = (amp * mod_dci[dci_idx << 1]) >> 15;
((int16_t *)txdataF)[((l * frame_parms->ofdm_symbol_size + k) << 1) + 1] = (amp * mod_dci[(dci_idx << 1) + 1]) >> 15; ((int16_t *)txdataF)[((l * frame_parms->ofdm_symbol_size + k) << 1) + 1] = (amp * mod_dci[(dci_idx << 1) + 1]) >> 15;
#ifdef DEBUG_DCI #ifdef DEBUG_DCI
LOG_I(PHY, LOG_I(NR_PHY_DCI,
"PDCCH: l %d position %d => (%d,%d)\n", "PDCCH: l %d position %d => (%d,%d)\n",
l, l,
k, k,
...@@ -237,7 +250,7 @@ void nr_generate_dci(PHY_VARS_gNB *gNB, ...@@ -237,7 +250,7 @@ void nr_generate_dci(PHY_VARS_gNB *gNB,
} // reg_count } // reg_count
} // symbol_idx } // symbol_idx
LOG_D(PHY, LOG_D(NR_PHY_DCI,
"DCI: payloadSize = %d | payload = %llx\n", "DCI: payloadSize = %d | payload = %llx\n",
dci_pdu->PayloadSizeBits, dci_pdu->PayloadSizeBits,
*(unsigned long long *)dci_pdu->Payload); *(unsigned long long *)dci_pdu->Payload);
......
...@@ -73,21 +73,30 @@ void nr_fill_reg_list(int reg_list[MAX_DCI_CORESET][NR_MAX_PDCCH_AGG_LEVEL * NR_ ...@@ -73,21 +73,30 @@ void nr_fill_reg_list(int reg_list[MAX_DCI_CORESET][NR_MAX_PDCCH_AGG_LEVEL * NR_
} }
if (pdcch_pdu_rel15->dci_pdu[d].RNTI != 0xFFFF) if (pdcch_pdu_rel15->dci_pdu[d].RNTI != 0xFFFF)
LOG_D(PHY, "CCE list generation for candidate %d: bundle size %d ilv size %d CceIndex %d\n", d, bsize, R, pdcch_pdu_rel15->dci_pdu[d].CceIndex); LOG_D(NR_PHY_DCI,
"CCE list generation for candidate %d: bundle size %d ilv size %d CceIndex %d\n",
d,
bsize,
R,
pdcch_pdu_rel15->dci_pdu[d].CceIndex);
int list_idx = 0; int list_idx = 0;
for (uint8_t cce_idx=0; cce_idx<L; cce_idx++) { for (uint8_t cce_idx=0; cce_idx<L; cce_idx++) {
int cce = pdcch_pdu_rel15->dci_pdu[d].CceIndex + cce_idx; int cce = pdcch_pdu_rel15->dci_pdu[d].CceIndex + cce_idx;
LOG_D(PHY, "cce_idx %d\n", cce); LOG_D(NR_PHY_DCI, "cce_idx %d\n", cce);
for (uint8_t bundle_idx=0; bundle_idx<NR_NB_REG_PER_CCE/bsize; bundle_idx++) { for (uint8_t bundle_idx=0; bundle_idx<NR_NB_REG_PER_CCE/bsize; bundle_idx++) {
uint8_t k = 6 * cce / bsize + bundle_idx; uint8_t k = 6 * cce / bsize + bundle_idx;
int f = cce_to_reg_interleaving(R, k, n_shift, C, bsize, N_regs); int f = cce_to_reg_interleaving(R, k, n_shift, C, bsize, N_regs);
LOG_D(PHY, "Bundle index %d: f(%d) = %d\n", bundle_idx, k, f); LOG_D(NR_PHY_DCI, "Bundle index %d: f(%d) = %d\n", bundle_idx, k, f);
// reg_list contains the regs to be allocated per symbol // reg_list contains the regs to be allocated per symbol
// the same rbs are allocated in each symbol // the same rbs are allocated in each symbol
for (uint8_t reg_idx = 0; reg_idx < bsize / dur; reg_idx++) { for (uint8_t reg_idx = 0; reg_idx < bsize / dur; reg_idx++) {
reg_list[d][list_idx] = f * bsize / dur + reg_idx; reg_list[d][list_idx] = f * bsize / dur + reg_idx;
LOG_D(PHY, "rb %d nb of symbols per rb %d start subcarrier %d\n", reg_list[d][list_idx], dur, reg_list[d][list_idx] * NR_NB_SC_PER_RB); LOG_D(NR_PHY_DCI,
"rb %d nb of symbols per rb %d start subcarrier %d\n",
reg_list[d][list_idx],
dur,
reg_list[d][list_idx] * NR_NB_SC_PER_RB);
list_idx++; list_idx++;
} }
} }
......
...@@ -1060,7 +1060,7 @@ void nr_pdcch_channel_estimation(PHY_VARS_NR_UE *ue, ...@@ -1060,7 +1060,7 @@ void nr_pdcch_channel_estimation(PHY_VARS_NR_UE *ue,
uint16_t first_carrier_offset, uint16_t first_carrier_offset,
uint16_t BWPStart, uint16_t BWPStart,
int32_t pdcch_est_size, int32_t pdcch_est_size,
int32_t pdcch_dl_ch_estimates[][pdcch_est_size], c16_t pdcch_dl_ch_estimates[][pdcch_est_size],
c16_t rxdataF[][ue->frame_parms.samples_per_slot_wCP]) c16_t rxdataF[][ue->frame_parms.samples_per_slot_wCP])
{ {
......
...@@ -54,7 +54,7 @@ void nr_pdcch_channel_estimation(PHY_VARS_NR_UE *ue, ...@@ -54,7 +54,7 @@ void nr_pdcch_channel_estimation(PHY_VARS_NR_UE *ue,
uint16_t first_carrier_offset, uint16_t first_carrier_offset,
uint16_t BWPStart, uint16_t BWPStart,
int32_t pdcch_est_size, int32_t pdcch_est_size,
int32_t pdcch_dl_ch_estimates[][pdcch_est_size], c16_t pdcch_dl_ch_estimates[][pdcch_est_size],
c16_t rxdataF[][ue->frame_parms.samples_per_slot_wCP]); c16_t rxdataF[][ue->frame_parms.samples_per_slot_wCP]);
int nr_pbch_dmrs_correlation(PHY_VARS_NR_UE *ue, int nr_pbch_dmrs_correlation(PHY_VARS_NR_UE *ue,
......
This diff is collapsed.
...@@ -266,13 +266,13 @@ void nr_dlsch_unscrambling(int16_t* llr, ...@@ -266,13 +266,13 @@ void nr_dlsch_unscrambling(int16_t* llr,
uint32_t Nid, uint32_t Nid,
uint32_t n_RNTI); uint32_t n_RNTI);
int32_t nr_rx_pdcch(PHY_VARS_NR_UE *ue, void nr_rx_pdcch(PHY_VARS_NR_UE *ue,
const UE_nr_rxtx_proc_t *proc, const UE_nr_rxtx_proc_t *proc,
int32_t pdcch_est_size, int32_t pdcch_est_size,
int32_t pdcch_dl_ch_estimates[][pdcch_est_size], c16_t pdcch_dl_ch_estimates[][pdcch_est_size],
int16_t *pdcch_e_rx, c16_t *pdcch_e_rx,
fapi_nr_dl_config_dci_dl_pdu_rel15_t *rel15, fapi_nr_dl_config_dci_dl_pdu_rel15_t *rel15,
c16_t rxdataF[][ue->frame_parms.samples_per_slot_wCP]); c16_t rxdataF[][ue->frame_parms.samples_per_slot_wCP]);
/*! \brief Performs detection of SSS to find cell ID and other framing parameters (FDD/TDD, normal/extended prefix) /*! \brief Performs detection of SSS to find cell ID and other framing parameters (FDD/TDD, normal/extended prefix)
@param phy_vars_ue Pointer to UE variables @param phy_vars_ue Pointer to UE variables
...@@ -361,17 +361,11 @@ void nr_sl_rf_card_config_freq(PHY_VARS_NR_UE *ue, ...@@ -361,17 +361,11 @@ void nr_sl_rf_card_config_freq(PHY_VARS_NR_UE *ue,
openair0_config_t *openair0_cfg, openair0_config_t *openair0_cfg,
int freq_offset); int freq_offset);
void nr_pdcch_unscrambling(int16_t *z, void nr_dci_decoding_procedure(PHY_VARS_NR_UE *ue,
uint16_t scrambling_RNTI, const UE_nr_rxtx_proc_t *proc,
uint32_t length, c16_t *pdcch_e_rx,
uint16_t pdcch_DMRS_scrambling_id, fapi_nr_dci_indication_t *dci_ind,
int16_t *z2); fapi_nr_dl_config_dci_dl_pdu_rel15_t *rel15);
uint8_t nr_dci_decoding_procedure(PHY_VARS_NR_UE *ue,
const UE_nr_rxtx_proc_t *proc,
int16_t *pdcch_e_rx,
fapi_nr_dci_indication_t *dci_ind,
fapi_nr_dl_config_dci_dl_pdu_rel15_t *rel15);
/** \brief This function is the top-level entry point to PDSCH demodulation, after frequency-domain transformation and channel /** \brief This function is the top-level entry point to PDSCH demodulation, after frequency-domain transformation and channel
estimation. It performs estimation. It performs
......
...@@ -152,7 +152,7 @@ void nr_fill_rx_indication(fapi_nr_rx_indication_t *rx_ind, ...@@ -152,7 +152,7 @@ void nr_fill_rx_indication(fapi_nr_rx_indication_t *rx_ind,
int nr_ue_pdcch_procedures(PHY_VARS_NR_UE *ue, int nr_ue_pdcch_procedures(PHY_VARS_NR_UE *ue,
const UE_nr_rxtx_proc_t *proc, const UE_nr_rxtx_proc_t *proc,
int32_t pdcch_est_size, int32_t pdcch_est_size,
int32_t pdcch_dl_ch_estimates[][pdcch_est_size], c16_t pdcch_dl_ch_estimates[][pdcch_est_size],
nr_phy_data_t *phy_data, nr_phy_data_t *phy_data,
int n_ss, int n_ss,
c16_t rxdataF[][ue->frame_parms.samples_per_slot_wCP]); c16_t rxdataF[][ue->frame_parms.samples_per_slot_wCP]);
......
...@@ -426,16 +426,13 @@ unsigned int nr_get_tx_amp(int power_dBm, int power_max_dBm, int N_RB_UL, int nb ...@@ -426,16 +426,13 @@ unsigned int nr_get_tx_amp(int power_dBm, int power_max_dBm, int N_RB_UL, int nb
int nr_ue_pdcch_procedures(PHY_VARS_NR_UE *ue, int nr_ue_pdcch_procedures(PHY_VARS_NR_UE *ue,
const UE_nr_rxtx_proc_t *proc, const UE_nr_rxtx_proc_t *proc,
int32_t pdcch_est_size, int32_t pdcch_est_size,
int32_t pdcch_dl_ch_estimates[][pdcch_est_size], c16_t pdcch_dl_ch_estimates[][pdcch_est_size],
nr_phy_data_t *phy_data, nr_phy_data_t *phy_data,
int n_ss, int n_ss,
c16_t rxdataF[][ue->frame_parms.samples_per_slot_wCP]) c16_t rxdataF[][ue->frame_parms.samples_per_slot_wCP])
{ {
int frame_rx = proc->frame_rx; int frame_rx = proc->frame_rx;
int nr_slot_rx = proc->nr_slot_rx; int nr_slot_rx = proc->nr_slot_rx;
unsigned int dci_cnt=0;
fapi_nr_dci_indication_t dci_ind = {0};
nr_downlink_indication_t dl_indication;
NR_UE_PDCCH_CONFIG *phy_pdcch_config = &phy_data->phy_pdcch_config; NR_UE_PDCCH_CONFIG *phy_pdcch_config = &phy_data->phy_pdcch_config;
fapi_nr_dl_config_dci_dl_pdu_rel15_t *rel15 = &phy_pdcch_config->pdcch_config[n_ss]; fapi_nr_dl_config_dci_dl_pdu_rel15_t *rel15 = &phy_pdcch_config->pdcch_config[n_ss];
...@@ -444,39 +441,26 @@ int nr_ue_pdcch_procedures(PHY_VARS_NR_UE *ue, ...@@ -444,39 +441,26 @@ int nr_ue_pdcch_procedures(PHY_VARS_NR_UE *ue,
/// PDCCH/DCI e-sequence (input to rate matching). /// PDCCH/DCI e-sequence (input to rate matching).
int32_t pdcch_e_rx_size = NR_MAX_PDCCH_SIZE; int32_t pdcch_e_rx_size = NR_MAX_PDCCH_SIZE;
int16_t pdcch_e_rx[pdcch_e_rx_size]; c16_t pdcch_e_rx[pdcch_e_rx_size];
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_RX_PDCCH, VCD_FUNCTION_IN);
nr_rx_pdcch(ue, proc, pdcch_est_size, pdcch_dl_ch_estimates, pdcch_e_rx, rel15, rxdataF); nr_rx_pdcch(ue, proc, pdcch_est_size, pdcch_dl_ch_estimates, pdcch_e_rx, rel15, rxdataF);
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_RX_PDCCH, VCD_FUNCTION_OUT);
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_DCI_DECODING, VCD_FUNCTION_IN);
#ifdef NR_PDCCH_SCHED_DEBUG
printf("<-NR_PDCCH_PHY_PROCEDURES_LTE_UE (nr_ue_pdcch_procedures)-> Entering function nr_dci_decoding_procedure for search space %d)\n",
n_ss);
#endif
dci_cnt = nr_dci_decoding_procedure(ue, proc, pdcch_e_rx, &dci_ind, rel15);
#ifdef NR_PDCCH_SCHED_DEBUG
LOG_I(PHY,"<-NR_PDCCH_PHY_PROCEDURES_LTE_UE (nr_ue_pdcch_procedures)-> Ending function nr_dci_decoding_procedure() -> dci_cnt=%u\n",dci_cnt);
#endif
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_DCI_DECODING, VCD_FUNCTION_OUT); fapi_nr_dci_indication_t dci_ind;
nr_dci_decoding_procedure(ue, proc, pdcch_e_rx, &dci_ind, rel15);
for (int i=0; i<dci_cnt; i++) { for (int i = 0; i < dci_ind.number_of_dcis; i++) {
LOG_D(PHY,"[UE %d] AbsSubFrame %d.%d: DCI %i of %d total DCIs found --> rnti %x : format %d\n", LOG_D(PHY,
ue->Mod_id,frame_rx%1024,nr_slot_rx, "[UE %d] AbsSubFrame %d.%d: DCI %i of %d total DCIs found --> rnti %x : format %d\n",
ue->Mod_id,
frame_rx % 1024,
nr_slot_rx,
i + 1, i + 1,
dci_cnt, dci_ind.number_of_dcis,
dci_ind.dci_list[i].rnti, dci_ind.dci_list[i].rnti,
dci_ind.dci_list[i].dci_format); dci_ind.dci_list[i].dci_format);
} }
dci_ind.number_of_dcis = dci_cnt; nr_downlink_indication_t dl_indication;
// fill dl_indication message // fill dl_indication message
nr_fill_dl_indication(&dl_indication, &dci_ind, NULL, proc, ue, phy_data); nr_fill_dl_indication(&dl_indication, &dci_ind, NULL, proc, ue, phy_data);
// send to mac // send to mac
...@@ -485,7 +469,7 @@ int nr_ue_pdcch_procedures(PHY_VARS_NR_UE *ue, ...@@ -485,7 +469,7 @@ int nr_ue_pdcch_procedures(PHY_VARS_NR_UE *ue,
stop_meas(&ue->dlsch_rx_pdcch_stats); stop_meas(&ue->dlsch_rx_pdcch_stats);
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_PDCCH_PROCEDURES, VCD_FUNCTION_OUT); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_PDCCH_PROCEDURES, VCD_FUNCTION_OUT);
return(dci_cnt); return (dci_ind.number_of_dcis);
} }
static int nr_ue_pdsch_procedures(PHY_VARS_NR_UE *ue, static int nr_ue_pdsch_procedures(PHY_VARS_NR_UE *ue,
...@@ -861,9 +845,7 @@ void pbch_pdcch_processing(PHY_VARS_NR_UE *ue, const UE_nr_rxtx_proc_t *proc, nr ...@@ -861,9 +845,7 @@ void pbch_pdcch_processing(PHY_VARS_NR_UE *ue, const UE_nr_rxtx_proc_t *proc, nr
const uint32_t rxdataF_sz = ue->frame_parms.samples_per_slot_wCP; const uint32_t rxdataF_sz = ue->frame_parms.samples_per_slot_wCP;
__attribute__ ((aligned(32))) c16_t rxdataF[ue->frame_parms.nb_antennas_rx][rxdataF_sz]; __attribute__ ((aligned(32))) c16_t rxdataF[ue->frame_parms.nb_antennas_rx][rxdataF_sz];
// checking if current frame is compatible with SSB periodicity // checking if current frame is compatible with SSB periodicity
if (cfg->ssb_table.ssb_period == 0 || if (cfg->ssb_table.ssb_period == 0 || !(frame_rx % (1 << (cfg->ssb_table.ssb_period - 1)))) {
!(frame_rx%(1<<(cfg->ssb_table.ssb_period-1)))){
const int estimateSz = fp->symbols_per_slot * fp->ofdm_symbol_size; const int estimateSz = fp->symbols_per_slot * fp->ofdm_symbol_size;
// loop over SSB blocks // loop over SSB blocks
for(int ssb_index=0; ssb_index<fp->Lmax; ssb_index++) { for(int ssb_index=0; ssb_index<fp->Lmax; ssb_index++) {
...@@ -874,9 +856,7 @@ void pbch_pdcch_processing(PHY_VARS_NR_UE *ue, const UE_nr_rxtx_proc_t *proc, nr ...@@ -874,9 +856,7 @@ void pbch_pdcch_processing(PHY_VARS_NR_UE *ue, const UE_nr_rxtx_proc_t *proc, nr
int ssb_slot = ssb_start_symbol/fp->symbols_per_slot; int ssb_slot = ssb_start_symbol/fp->symbols_per_slot;
int ssb_slot_2 = (cfg->ssb_table.ssb_period == 0) ? ssb_slot+(fp->slots_per_frame>>1) : -1; int ssb_slot_2 = (cfg->ssb_table.ssb_period == 0) ? ssb_slot+(fp->slots_per_frame>>1) : -1;
if (ssb_slot == nr_slot_rx || if (ssb_slot == nr_slot_rx || ssb_slot_2 == nr_slot_rx) {
ssb_slot_2 == nr_slot_rx) {
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_SLOT_FEP_PBCH, VCD_FUNCTION_IN); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_SLOT_FEP_PBCH, VCD_FUNCTION_IN);
LOG_D(PHY," ------ PBCH ChannelComp/LLR: frame.slot %d.%d ------ \n", frame_rx%1024, nr_slot_rx); LOG_D(PHY," ------ PBCH ChannelComp/LLR: frame.slot %d.%d ------ \n", frame_rx%1024, nr_slot_rx);
...@@ -990,7 +970,7 @@ void pbch_pdcch_processing(PHY_VARS_NR_UE *ue, const UE_nr_rxtx_proc_t *proc, nr ...@@ -990,7 +970,7 @@ void pbch_pdcch_processing(PHY_VARS_NR_UE *ue, const UE_nr_rxtx_proc_t *proc, nr
// Hold the channel estimates in frequency domain. // Hold the channel estimates in frequency domain.
int32_t pdcch_est_size = ((((fp->symbols_per_slot*(fp->ofdm_symbol_size+LTE_CE_FILTER_LENGTH))+15)/16)*16); int32_t pdcch_est_size = ((((fp->symbols_per_slot*(fp->ofdm_symbol_size+LTE_CE_FILTER_LENGTH))+15)/16)*16);
__attribute__ ((aligned(16))) int32_t pdcch_dl_ch_estimates[4*fp->nb_antennas_rx][pdcch_est_size]; __attribute__((aligned(16))) c16_t pdcch_dl_ch_estimates[4 * fp->nb_antennas_rx][pdcch_est_size];
uint8_t dci_cnt = 0; uint8_t dci_cnt = 0;
for(int n_ss = 0; n_ss<phy_pdcch_config->nb_search_space; n_ss++) { for(int n_ss = 0; n_ss<phy_pdcch_config->nb_search_space; n_ss++) {
......
...@@ -117,7 +117,7 @@ void nr_fill_rx_indication(fapi_nr_rx_indication_t *rx_ind, ...@@ -117,7 +117,7 @@ void nr_fill_rx_indication(fapi_nr_rx_indication_t *rx_ind,
int nr_ue_pdcch_procedures(PHY_VARS_NR_UE *ue, int nr_ue_pdcch_procedures(PHY_VARS_NR_UE *ue,
const UE_nr_rxtx_proc_t *proc, const UE_nr_rxtx_proc_t *proc,
int32_t pdcch_est_size, int32_t pdcch_est_size,
int32_t pdcch_dl_ch_estimates[][pdcch_est_size], c16_t pdcch_dl_ch_estimates[][pdcch_est_size],
nr_phy_data_t *phy_data, nr_phy_data_t *phy_data,
int n_ss, int n_ss,
c16_t rxdataF[][ue->frame_parms.samples_per_slot_wCP]) c16_t rxdataF[][ue->frame_parms.samples_per_slot_wCP])
......
...@@ -497,7 +497,7 @@ int nr_ue_pusch_scheduler(const NR_UE_MAC_INST_t *mac, ...@@ -497,7 +497,7 @@ int nr_ue_pusch_scheduler(const NR_UE_MAC_INST_t *mac,
int *slot_tx, int *slot_tx,
const long k2); const long k2);
int get_rnti_type(NR_UE_MAC_INST_t *mac, uint16_t rnti); int get_rnti_type(const NR_UE_MAC_INST_t *mac, const uint16_t rnti);
// Configuration of Msg3 PDU according to clauses: // Configuration of Msg3 PDU according to clauses:
// - 8.3 of 3GPP TS 38.213 version 16.3.0 Release 16 // - 8.3 of 3GPP TS 38.213 version 16.3.0 Release 16
......
...@@ -44,7 +44,7 @@ void fill_dci_search_candidates(const NR_SearchSpace_t *ss, ...@@ -44,7 +44,7 @@ void fill_dci_search_candidates(const NR_SearchSpace_t *ss,
fapi_nr_dl_config_dci_dl_pdu_rel15_t *rel15, fapi_nr_dl_config_dci_dl_pdu_rel15_t *rel15,
const uint32_t Y) const uint32_t Y)
{ {
LOG_D(NR_MAC,"Filling search candidates for DCI\n"); LOG_D(NR_MAC_DCI, "Filling search candidates for DCI\n");
int i = 0; int i = 0;
for (int maxL = 16; maxL > 0; maxL >>= 1) { for (int maxL = 16; maxL > 0; maxL >>= 1) {
...@@ -55,7 +55,7 @@ void fill_dci_search_candidates(const NR_SearchSpace_t *ss, ...@@ -55,7 +55,7 @@ void fill_dci_search_candidates(const NR_SearchSpace_t *ss,
maxL); maxL);
if (max_number_of_candidates == 0) if (max_number_of_candidates == 0)
continue; continue;
LOG_D(NR_MAC,"L %d, max number of candidates %d, aggregation %d\n", maxL, max_number_of_candidates, aggregation); LOG_D(NR_MAC_DCI, "L %d, max number of candidates %d, aggregation %d\n", maxL, max_number_of_candidates, aggregation);
int N_cce_sym = 0; // nb of rbs of coreset per symbol int N_cce_sym = 0; // nb of rbs of coreset per symbol
for (int f = 0; f < 6; f++) { for (int f = 0; f < 6; f++) {
for (int t = 0; t < 8; t++) { for (int t = 0; t < 8; t++) {
...@@ -67,13 +67,20 @@ void fill_dci_search_candidates(const NR_SearchSpace_t *ss, ...@@ -67,13 +67,20 @@ void fill_dci_search_candidates(const NR_SearchSpace_t *ss,
continue; continue;
for (int j = 0; j < max_number_of_candidates; j++) { for (int j = 0; j < max_number_of_candidates; j++) {
int first_cce = aggregation * ((Y + ((j * N_cces) / (aggregation * max_number_of_candidates)) + 0) % (N_cces / aggregation)); int first_cce = aggregation * ((Y + ((j * N_cces) / (aggregation * max_number_of_candidates)) + 0) % (N_cces / aggregation));
LOG_D(NR_MAC,"Candidate %d of %d first_cce %d (L %d N_cces %d Y %d)\n", j, max_number_of_candidates, first_cce, aggregation, N_cces, Y); LOG_D(NR_MAC_DCI,
"Candidate %d of %d first_cce %d (L %d N_cces %d Y %d)\n",
j,
max_number_of_candidates,
first_cce,
aggregation,
N_cces,
Y);
// to avoid storing more than one candidate with the same aggregation and starting CCE (duplicated candidate) // to avoid storing more than one candidate with the same aggregation and starting CCE (duplicated candidate)
bool duplicated = false; bool duplicated = false;
for (int k = 0; k < i; k++) { for (int k = 0; k < i; k++) {
if (rel15->CCE[k] == first_cce && rel15->L[k] == aggregation) { if (rel15->CCE[k] == first_cce && rel15->L[k] == aggregation) {
duplicated = true; duplicated = true;
LOG_D(NR_MAC, "Candidate %d of %d is duplicated\n", j, max_number_of_candidates); LOG_D(NR_MAC_DCI, "Candidate %d of %d is duplicated\n", j, max_number_of_candidates);
} }
} }
if (!duplicated) { if (!duplicated) {
...@@ -296,7 +303,9 @@ void config_dci_pdu(NR_UE_MAC_INST_t *mac, ...@@ -296,7 +303,9 @@ void config_dci_pdu(NR_UE_MAC_INST_t *mac,
#ifdef DEBUG_DCI #ifdef DEBUG_DCI
for (int i = 0; i < rel15->num_dci_options; i++) { for (int i = 0; i < rel15->num_dci_options; i++) {
LOG_D(MAC, "[DCI_CONFIG] Configure DCI PDU: rnti_type %d BWPSize %d BWPStart %d rel15->SubcarrierSpacing %d rel15->dci_format %d rel15->dci_length %d sps %d monitoringSymbolsWithinSlot %d \n", LOG_D(NR_MAC_DCI,
"[DCI_CONFIG] Configure DCI PDU: rnti_type %d BWPSize %d BWPStart %d rel15->SubcarrierSpacing %d rel15->dci_format %d "
"rel15->dci_length %d sps %d monitoringSymbolsWithinSlot %d \n",
rnti_type, rnti_type,
rel15->BWPSize, rel15->BWPSize,
rel15->BWPStart, rel15->BWPStart,
...@@ -490,7 +499,7 @@ void ue_dci_configuration(NR_UE_MAC_INST_t *mac, fapi_nr_dl_config_request_t *dl ...@@ -490,7 +499,7 @@ void ue_dci_configuration(NR_UE_MAC_INST_t *mac, fapi_nr_dl_config_request_t *dl
fill_coresetZero(mac->coreset0, &mac->type0_PDCCH_CSS_config); fill_coresetZero(mac->coreset0, &mac->type0_PDCCH_CSS_config);
fill_searchSpaceZero(mac->search_space_zero, slots_per_frame, &mac->type0_PDCCH_CSS_config); fill_searchSpaceZero(mac->search_space_zero, slots_per_frame, &mac->type0_PDCCH_CSS_config);
if (is_ss_monitor_occasion(frame, slot, slots_per_frame, mac->search_space_zero)) { if (is_ss_monitor_occasion(frame, slot, slots_per_frame, mac->search_space_zero)) {
LOG_D(NR_MAC, "Monitoring DCI for SIB1 in frame %d slot %d\n", frame, slot); LOG_D(NR_MAC_DCI, "Monitoring DCI for SIB1 in frame %d slot %d\n", frame, slot);
config_dci_pdu(mac, dl_config, TYPE_SI_RNTI_, slot, mac->search_space_zero); config_dci_pdu(mac, dl_config, TYPE_SI_RNTI_, slot, mac->search_space_zero);
} }
} }
...@@ -501,7 +510,7 @@ void ue_dci_configuration(NR_UE_MAC_INST_t *mac, fapi_nr_dl_config_request_t *dl ...@@ -501,7 +510,7 @@ void ue_dci_configuration(NR_UE_MAC_INST_t *mac, fapi_nr_dl_config_request_t *dl
const NR_SearchSpace_t *ss = pdcch_config->otherSI_SS ? pdcch_config->otherSI_SS : mac->search_space_zero; const NR_SearchSpace_t *ss = pdcch_config->otherSI_SS ? pdcch_config->otherSI_SS : mac->search_space_zero;
// TODO configure SI-window // TODO configure SI-window
if (monitior_dci_for_other_SI(mac, ss, slots_per_frame, frame, slot)) { if (monitior_dci_for_other_SI(mac, ss, slots_per_frame, frame, slot)) {
LOG_D(NR_MAC, "Monitoring DCI for other SIs in frame %d slot %d\n", frame, slot); LOG_D(NR_MAC_DCI, "Monitoring DCI for other SIs in frame %d slot %d\n", frame, slot);
config_dci_pdu(mac, dl_config, TYPE_SI_RNTI_, slot, ss); config_dci_pdu(mac, dl_config, TYPE_SI_RNTI_, slot, ss);
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment