Commit 39c555e9 authored by Raymond Knopp's avatar Raymond Knopp

changes in radio/fhi_72 for FR2 support. Mostly related to frame

parameters and numerologies which were hard-coded for 100 MHz FR1 30kHz
parent 79606190
...@@ -358,8 +358,12 @@ static uint32_t schedule_control_sib1(module_id_t module_id, ...@@ -358,8 +358,12 @@ static uint32_t schedule_control_sib1(module_id_t module_id,
rbSize, tda_info->nrOfSymbols, N_PRB_DMRS * dmrs_length,0, 0,1) >> 3; rbSize, tda_info->nrOfSymbols, N_PRB_DMRS * dmrs_length,0, 0,1) >> 3;
} while (TBS < gNB_mac->sched_ctrlCommon->num_total_bytes); } while (TBS < gNB_mac->sched_ctrlCommon->num_total_bytes);
AssertFatal(TBS>=gNB_mac->sched_ctrlCommon->num_total_bytes,"Couldn't allocate enough resources for %d bytes in SIB1 PDSCH\n", if (TBS<gNB_mac->sched_ctrlCommon->num_total_bytes) {
gNB_mac->sched_ctrlCommon->num_total_bytes); for (int rb=0;rb<bwpSize;rb++) LOG_I(NR_MAC,"vrb_map[%d] %x\n",rbStart+rb,vrb_map[rbStart+rb]);
}
AssertFatal(TBS>=gNB_mac->sched_ctrlCommon->num_total_bytes,"Couldn't allocate enough resources for %d bytes in SIB1 PDSCH (rbStart %d, rbSize %d, bwpSize %d SLmask %x - [%d,%d])\n",
gNB_mac->sched_ctrlCommon->num_total_bytes,
rbStart,rbSize,bwpSize,SL_to_bitmap(tda_info->startSymbolIndex,tda_info->nrOfSymbols),tda_info->startSymbolIndex,tda_info->nrOfSymbols);
pdsch->rbSize = rbSize; pdsch->rbSize = rbSize;
pdsch->rbStart = 0; pdsch->rbStart = 0;
......
...@@ -81,12 +81,17 @@ void oai_xran_fh_rx_callback(void *pCallbackTag, xran_status_t status) ...@@ -81,12 +81,17 @@ void oai_xran_fh_rx_callback(void *pCallbackTag, xran_status_t status)
struct xran_device_ctx *xran_ctx = xran_dev_get_ctx(); struct xran_device_ctx *xran_ctx = xran_dev_get_ctx();
const struct xran_fh_init *fh_init = &xran_ctx->fh_init; const struct xran_fh_init *fh_init = &xran_ctx->fh_init;
int num_ports = fh_init->xran_ports; int num_ports = fh_init->xran_ports;
static int rx_RU[XRAN_PORTS_NUM][20] = {0};
const struct xran_fh_config *fh_config = &xran_ctx->fh_cfg;
const int slots_per_subframe = 1<<fh_config->frame_conf.nNumerology;
static int rx_RU[XRAN_PORTS_NUM][160] = {0};
uint32_t rx_tti = callback_tag->slotiId; uint32_t rx_tti = callback_tag->slotiId;
tti = xran_get_slot_idx_from_tti(rx_tti, &frame, &subframe, &slot, &second); tti = xran_get_slot_idx_from_tti(rx_tti, &frame, &subframe, &slot, &second);
rx_sym = callback_tag->symbol; rx_sym = callback_tag->symbol;
uint32_t ru_id = callback_tag->oXuId; uint32_t ru_id = callback_tag->oXuId;
if (rx_sym == 7) { if (rx_sym == 7) {
if (first_call_set) { if (first_call_set) {
...@@ -95,7 +100,7 @@ void oai_xran_fh_rx_callback(void *pCallbackTag, xran_status_t status) ...@@ -95,7 +100,7 @@ void oai_xran_fh_rx_callback(void *pCallbackTag, xran_status_t status)
} }
first_rx_set = 1; first_rx_set = 1;
if (first_read_set == 1) { if (first_read_set == 1) {
slot2 = slot + (subframe << 1); slot2 = slot + (subframe * slots_per_subframe);
rx_RU[ru_id][slot2] = 1; rx_RU[ru_id][slot2] = 1;
if (last_frame > 0 && frame > 0 if (last_frame > 0 && frame > 0
&& ((slot2 > 0 && last_frame != frame) || (slot2 == 0 && last_frame != ((1024 + frame - 1) & 1023)))) && ((slot2 > 0 && last_frame != frame) || (slot2 == 0 && last_frame != ((1024 + frame - 1) & 1023))))
...@@ -164,14 +169,17 @@ int oai_physide_ul_full_slot_call_back(void *param) ...@@ -164,14 +169,17 @@ int oai_physide_ul_full_slot_call_back(void *param)
int read_prach_data(ru_info_t *ru, int frame, int slot) int read_prach_data(ru_info_t *ru, int frame, int slot)
{ {
/* calculate tti and subframe_id from frame, slot num */ /* calculate tti and subframe_id from frame, slot num */
int tti = 20 * (frame) + (slot);
uint32_t subframe = XranGetSubFrameNum(tti, 2, 10);
uint32_t is_prach_slot = xran_is_prach_slot(0, subframe, (slot % 2));
int sym_idx = 0; int sym_idx = 0;
struct xran_device_ctx *xran_ctx = xran_dev_get_ctx(); struct xran_device_ctx *xran_ctx = xran_dev_get_ctx();
struct xran_prach_cp_config *pPrachCPConfig = &(xran_ctx->PrachCPConfig); struct xran_prach_cp_config *pPrachCPConfig = &(xran_ctx->PrachCPConfig);
struct xran_ru_config *ru_conf = &(xran_ctx->fh_cfg.ru_conf); struct xran_ru_config *ru_conf = &(xran_ctx->fh_cfg.ru_conf);
int slots_per_frame = 10<<xran_ctx->fh_cfg.frame_conf.nNumerology;
int slots_per_subframe = 1<<xran_ctx->fh_cfg.frame_conf.nNumerology;
int tti = slots_per_frame * (frame) + (slot);
uint32_t subframe = slot/slots_per_subframe;
uint32_t is_prach_slot = xran_is_prach_slot(0, subframe, (slot % slots_per_subframe));
int nb_rx_per_ru = ru->nb_rx / xran_ctx->fh_init.xran_ports; int nb_rx_per_ru = ru->nb_rx / xran_ctx->fh_init.xran_ports;
/* If it is PRACH slot, copy prach IQ from XRAN PRACH buffer to OAI PRACH buffer */ /* If it is PRACH slot, copy prach IQ from XRAN PRACH buffer to OAI PRACH buffer */
...@@ -275,17 +283,19 @@ int xran_fh_rx_read_slot(ru_info_t *ru, int *frame, int *slot) ...@@ -275,17 +283,19 @@ int xran_fh_rx_read_slot(ru_info_t *ru, int *frame, int *slot)
#endif #endif
// return(0); // return(0);
int tti = (*frame * 20) + *slot; struct xran_device_ctx *xran_ctx = xran_dev_get_ctx();
int slots_per_frame = 10<<xran_ctx->fh_cfg.frame_conf.nNumerology;
int tti = slots_per_frame * (*frame) + (*slot);
read_prach_data(ru, *frame, *slot); read_prach_data(ru, *frame, *slot);
struct xran_device_ctx *xran_ctx = xran_dev_get_ctx();
const struct xran_fh_init *fh_init = &xran_ctx->fh_init; const struct xran_fh_init *fh_init = &xran_ctx->fh_init;
int nPRBs = xran_ctx->fh_cfg.nULRBs; int nPRBs = xran_ctx->fh_cfg.nULRBs;
int fftsize = 1 << xran_ctx->fh_cfg.ru_conf.fftSize; int fftsize = 1 << xran_ctx->fh_cfg.ru_conf.fftSize;
int slot_offset_rxdata = 3 & (*slot); int slot_offset_rxdata = 3 & (*slot);
uint32_t slot_size = 4 * 14 * 4096; uint32_t slot_size = 4 * 14 * fftsize;
uint8_t *rx_data = (uint8_t *)ru->rxdataF[0]; uint8_t *rx_data = (uint8_t *)ru->rxdataF[0];
uint8_t *start_ptr = NULL; uint8_t *start_ptr = NULL;
int nb_rx_per_ru = ru->nb_rx / fh_init->xran_ports; int nb_rx_per_ru = ru->nb_rx / fh_init->xran_ports;
...@@ -324,11 +334,11 @@ int xran_fh_rx_read_slot(ru_info_t *ru, int *frame, int *slot) ...@@ -324,11 +334,11 @@ int xran_fh_rx_read_slot(ru_info_t *ru, int *frame, int *slot)
else else
pData = p_sec_desc->pData; pData = p_sec_desc->pData;
ptr = pData; ptr = pData;
pos = (int32_t *)(start_ptr + (4 * sym_idx * 4096)); pos = (int32_t *)(start_ptr + (4 * sym_idx * fftsize));
uint8_t *u8dptr; uint8_t *u8dptr;
struct xran_prb_map *pRbMap = pPrbMap; struct xran_prb_map *pRbMap = pPrbMap;
AssertFatal(ptr != NULL, "ptr NULL\n"); if (ptr == NULL) continue;
AssertFatal(pos != NULL, "pos NULL\n"); AssertFatal(pos != NULL, "pos NULL\n");
if (1) { if (1) {
uint32_t idxElm = 0; uint32_t idxElm = 0;
...@@ -458,7 +468,7 @@ int xran_fh_tx_send_slot(ru_info_t *ru, int frame, int slot, uint64_t timestamp) ...@@ -458,7 +468,7 @@ int xran_fh_tx_send_slot(ru_info_t *ru, int frame, int slot, uint64_t timestamp)
struct xran_prb_map *pPrbMap = (struct xran_prb_map *)pPrbMapData; struct xran_prb_map *pPrbMap = (struct xran_prb_map *)pPrbMapData;
ptr = pData; ptr = pData;
pos = pos =
&ru->txdataF_BF[ant_id][sym_idx * 4096 /*fp->ofdm_symbol_size*/]; // We had to use a different ru structure than benetel &ru->txdataF_BF[ant_id][sym_idx * fftsize /*fp->ofdm_symbol_size*/]; // We had to use a different ru structure than benetel
// so the access to the buffer is not the same. // so the access to the buffer is not the same.
uint8_t *u8dptr; uint8_t *u8dptr;
......
...@@ -670,6 +670,8 @@ static enum xran_cp_filterindex get_prach_filterindex_fr1(duplex_mode_t mode, in ...@@ -670,6 +670,8 @@ static enum xran_cp_filterindex get_prach_filterindex_fr1(duplex_mode_t mode, in
return XRAN_FILTERINDEX_STANDARD; return XRAN_FILTERINDEX_STANDARD;
} }
// PRACH guard interval. Raymond: "[it] is not in the configuration, (i.e. it // PRACH guard interval. Raymond: "[it] is not in the configuration, (i.e. it
// is deterministic depending on others). LiteON must hard-code this in the // is deterministic depending on others). LiteON must hard-code this in the
// O-RU itself, benetel doesn't (as O-RAN specifies). So we will need to tell // O-RU itself, benetel doesn't (as O-RAN specifies). So we will need to tell
...@@ -684,9 +686,6 @@ static bool set_fh_prach_config(const openair0_config_t *oai0, ...@@ -684,9 +686,6 @@ static bool set_fh_prach_config(const openair0_config_t *oai0,
{ {
const split7_config_t *s7cfg = &oai0->split7; const split7_config_t *s7cfg = &oai0->split7;
// for FR2, need at least to update nPrachFilterIdx
AssertFatal(oai0->nr_band < 100, "can only handle FR1!\n");
prach_config->nPrachConfIdx = s7cfg->prach_index; prach_config->nPrachConfIdx = s7cfg->prach_index;
prach_config->nPrachSubcSpacing = oai0->nr_scs_for_raster; prach_config->nPrachSubcSpacing = oai0->nr_scs_for_raster;
prach_config->nPrachZeroCorrConf = 0; prach_config->nPrachZeroCorrConf = 0;
...@@ -694,7 +693,10 @@ static bool set_fh_prach_config(const openair0_config_t *oai0, ...@@ -694,7 +693,10 @@ static bool set_fh_prach_config(const openair0_config_t *oai0,
prach_config->nPrachRootSeqIdx = 0; prach_config->nPrachRootSeqIdx = 0;
prach_config->nPrachFreqStart = s7cfg->prach_freq_start; prach_config->nPrachFreqStart = s7cfg->prach_freq_start;
prach_config->nPrachFreqOffset = (s7cfg->prach_freq_start * 12 - oai0->num_rb_dl * 6) * 2; prach_config->nPrachFreqOffset = (s7cfg->prach_freq_start * 12 - oai0->num_rb_dl * 6) * 2;
if (oai0->nr_band < 100)
prach_config->nPrachFilterIdx = get_prach_filterindex_fr1(oai0->duplex_mode, s7cfg->prach_index); prach_config->nPrachFilterIdx = get_prach_filterindex_fr1(oai0->duplex_mode, s7cfg->prach_index);
else
prach_config->nPrachFilterIdx = XRAN_FILTERINDEX_PRACH_ABC;
prach_config->startSymId = 0; prach_config->startSymId = 0;
prach_config->lastSymId = 0; prach_config->lastSymId = 0;
prach_config->startPrbc = 0; prach_config->startPrbc = 0;
......
...@@ -209,10 +209,11 @@ void oran_fh_if4p5_south_in(RU_t *ru, int *frame, int *slot) ...@@ -209,10 +209,11 @@ void oran_fh_if4p5_south_in(RU_t *ru, int *frame, int *slot)
printf("ORAN: %d.%d ORAN_fh_if4p5_south_in ERROR in RX function \n", f, sl); printf("ORAN: %d.%d ORAN_fh_if4p5_south_in ERROR in RX function \n", f, sl);
} }
int slots_per_frame = 10<<(ru->openair0_cfg.nr_scs_for_raster);
proc->tti_rx = sl; proc->tti_rx = sl;
proc->frame_rx = f; proc->frame_rx = f;
proc->tti_tx = (sl + sl_ahead) % 20; proc->tti_tx = (sl + sl_ahead) % slots_per_frame;
proc->frame_tx = (sl > (19 - sl_ahead)) ? (f + 1) & 1023 : f; proc->frame_tx = (sl > (slots_per_frame-1 - sl_ahead)) ? (f + 1) & 1023 : f;
if (proc->first_rx == 0) { if (proc->first_rx == 0) {
if (proc->tti_rx != *slot) { if (proc->tti_rx != *slot) {
......
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