Commit 4a6e8b72 authored by Guy De Souza's avatar Guy De Souza

PRB bundling

parent 83503489
......@@ -323,6 +323,17 @@ typedef enum {
NFAPI_NR_PDSCH_RBG_CONFIG_TYPE2
} nfapi_nr_pdsch_rbg_config_type_e;
typedef enum {
NFAPI_NR_PRG_GRANULARITY_2=2,
NFAPI_NR_PRG_GRANULARITY_4=4,
NFAPI_NR_PRG_GRANULARITY_WIDEBAND
} nfapi_nr_prg_granularity_e;
typedef enum {
NFAPI_NR_PRB_BUNDLING_TYPE_STATIC=0,
NFAPI_NR_PRB_BUNDLING_TYPE_DYNAMIC
} nfapi_nr_prb_bundling_type_e;
// P7 Sub Structures
typedef struct {
......
......@@ -29,3 +29,5 @@
* \note
* \warning
*/
......@@ -44,3 +44,5 @@ uint8_t nr_get_S(uint8_t row_idx, uint8_t CP, uint8_t time_alloc_type, uint8_t d
void nr_get_rbg_parms(NR_BWP_PARMS* bwp, uint8_t config_type);
void nr_get_rbg_list(uint32_t bitmap, uint8_t n_rbg, uint8_t* rbg_list);
void nr_get_PRG_parms(NR_BWP_PARMS* bwp, NR_gNB_DCI_ALLOC_t dci_alloc, uint8_t prb_bundling_type);
......@@ -191,7 +191,7 @@ void nr_get_rbg_parms(NR_BWP_PARMS* bwp, uint8_t config_type) {
rbg_parms->P = get_RBG_size_P(bwp->N_RB, config_type);
rbg_parms->start_size = rbg_parms->P - bwp->location%rbg_parms->P;
rbg_parms->end_size = ((bwp->location + bwp->N_RB)%rbg_parms->P)? ((bwp->location + bwp->N_RB)%rbg_parms->P) : rbg_parms->P;
rbg_parms->N_RBG = (uint8_t)ceil( (bwp->N_RB + (bwp->location%rbg_parms->P))/rbg_parms->P);
rbg_parms->N_RBG = (uint8_t)ceil( (bwp->N_RB + (bwp->location%rbg_parms->P))/(float)rbg_parms->P);
LOG_I(PHY, "RBG parameters for BWP %d location %d N_RB %d:\n", bwp->bwp_id, bwp->location, bwp->N_RB);
LOG_I(PHY, "P %d\t start size %d\t endsize %d\t N_RBG %d\n", rbg_parms->P, rbg_parms->start_size, rbg_parms->end_size, rbg_parms->N_RBG);
}
......@@ -211,3 +211,26 @@ static inline uint16_t get_RIV(uint16_t rb_start, uint16_t L, uint16_t N_RB) {
else
return (N_RB*(N_RB-L+1) + (N_RB-1-rb_start));
}
/// PRB bundling routines
// Precoding granularity
static inline uint8_t nr_get_P_prime(uint8_t rnti_type, uint8_t dci_format, uint8_t prb_bundling_type) {
if (dci_format == NFAPI_NR_DL_DCI_FORMAT_1_0)
return (NFAPI_NR_PRG_GRANULARITY_2);
else // NFAPI_NR_DL_DCI_FORMAT_1_1
return ((prb_bundling_type)?0:2);// incomplete for 1_1
}
void nr_get_PRG_parms(NR_BWP_PARMS* bwp, NR_gNB_DCI_ALLOC_t dci_alloc, uint8_t prb_bundling_type) {
nr_prg_parms_t* prg_parms = &bwp->prg_parms;
prg_parms->P_prime = nr_get_P_prime(dci_alloc.pdcch_params.rnti_type, dci_alloc.pdcch_params.dci_format, prb_bundling_type);
prg_parms->start_size = prg_parms->P_prime - bwp->location%prg_parms->P_prime;
prg_parms->end_size = (bwp->location + bwp->N_RB)%prg_parms->P_prime;
if (!prg_parms->end_size)
prg_parms->end_size = prg_parms->P_prime;
prg_parms->N_PRG = ceil((float)bwp->N_RB/prg_parms->P_prime);
LOG_I(PHY, "PRG parameters for BWP %d location %d N_RB %d:\n", bwp->bwp_id, bwp->location, bwp->N_RB);
LOG_I(PHY, "P_prime %d\t start size %d\t endsize %d\t N_PRG %d\n", prg_parms->P_prime, prg_parms->start_size, prg_parms->end_size, prg_parms->N_PRG);
}
......@@ -123,6 +123,17 @@ typedef struct {
uint8_t N_RBG;
}nr_rbg_parms_t;
typedef struct {
/// Size of first PRG
uint8_t start_size;
/// Nominal size
uint8_t P_prime;
/// Size of last PRG
uint8_t end_size;
/// Number of PRG
uint8_t N_PRG;
} nr_prg_parms_t;
typedef struct NR_BWP_PARMS {
/// BWP ID
uint8_t bwp_id;
......@@ -138,6 +149,8 @@ typedef struct NR_BWP_PARMS {
uint8_t cyclic_prefix;
/// RBG params
nr_rbg_parms_t rbg_parms;
/// PRG params
nr_prg_parms_t prg_parms;
} NR_BWP_PARMS;
typedef struct {
......
......@@ -100,9 +100,8 @@ void nr_feptx_ofdm_2thread(RU_t *ru) {
// this copy should be done in the precoding thread (currently inactive)
for (int aa=0;aa<ru->nb_tx;aa++)
memcpy((void*)ru->common.txdataF_BF[aa],
(void*)&ru->gNB_list[0]->common_vars.txdataF[aa][subframe*fp->samples_per_subframe_wCP],
fp->samples_per_subframe_wCP*sizeof(int32_t));
memcpy((void*)ru->common.txdataF_BF[aa],
(void*)ru->gNB_list[0]->common_vars.txdataF[aa],fp->samples_per_subframe_wCP*sizeof(int32_t));
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPTX_OFDM , 1 );
......
......@@ -170,10 +170,8 @@ void phy_procedures_gNB_TX(PHY_VARS_gNB *gNB,
if (do_meas==1) start_meas(&gNB->phy_proc_tx);
// clear the transmit data array for the current subframe
for (aa=0; aa<cfg->rf_config.tx_antenna_ports.value; aa++) {
memset(&gNB->common_vars.txdataF[aa][subframe*fp->samples_per_subframe_wCP],
0,fp->samples_per_subframe_wCP*sizeof(int32_t));
}
for (aa=0; aa<cfg->rf_config.tx_antenna_ports.value; aa++)
memset(&gNB->common_vars.txdataF[aa],0,fp->samples_per_subframe_wCP*sizeof(int32_t));
if (nfapi_mode == 0 || nfapi_mode == 1) {
nr_common_signal_procedures(gNB,frame, subframe);
......
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