Commit c898a9f2 authored by francescomani's avatar francescomani

function to get RV replacing extern vector

parent 59d28094
...@@ -1021,7 +1021,7 @@ int main(int argc, char *argv[]) ...@@ -1021,7 +1021,7 @@ int main(int argc, char *argv[])
while (round < max_rounds && crc_status) { while (round < max_rounds && crc_status) {
round_trials[round]++; round_trials[round]++;
rv_index = nr_rv_round_map[round % 4]; rv_index = nr_get_rv(round % 4);
/// gNB UL PDUs /// gNB UL PDUs
......
...@@ -52,7 +52,12 @@ ...@@ -52,7 +52,12 @@
#include <errno.h> #include <errno.h>
#include <string.h> #include <string.h>
const uint8_t nr_rv_round_map[4] = {0, 2, 3, 1}; uint8_t nr_get_rv(int rel_round)
{
const uint8_t nr_rv_round_map[4] = {0, 2, 3, 1};
AssertFatal(rel_round < 4, "Invalid index %d for rv\n", rel_round);
return nr_rv_round_map[rel_round];
}
void clear_nr_nfapi_information(gNB_MAC_INST *gNB, void clear_nr_nfapi_information(gNB_MAC_INST *gNB,
int CC_idP, int CC_idP,
......
...@@ -1131,7 +1131,7 @@ static void fill_msg3_pusch_pdu(nfapi_nr_pusch_pdu_t *pusch_pdu, ...@@ -1131,7 +1131,7 @@ static void fill_msg3_pusch_pdu(nfapi_nr_pusch_pdu_t *pusch_pdu,
pusch_pdu->start_symbol_index = start_symbol_index; pusch_pdu->start_symbol_index = start_symbol_index;
pusch_pdu->nr_of_symbols = nr_of_symbols; pusch_pdu->nr_of_symbols = nr_of_symbols;
//Optional Data only included if indicated in pduBitmap //Optional Data only included if indicated in pduBitmap
pusch_pdu->pusch_data.rv_index = nr_rv_round_map[ra->msg3_round % 4]; pusch_pdu->pusch_data.rv_index = nr_get_rv(ra->msg3_round % 4);
pusch_pdu->pusch_data.harq_process_id = 0; pusch_pdu->pusch_data.harq_process_id = 0;
pusch_pdu->pusch_data.new_data_indicator = (ra->msg3_round == 0) ? 1 : 0;; pusch_pdu->pusch_data.new_data_indicator = (ra->msg3_round == 0) ? 1 : 0;;
pusch_pdu->pusch_data.num_cb = 0; pusch_pdu->pusch_data.num_cb = 0;
...@@ -1811,7 +1811,7 @@ static void prepare_dl_pdus(gNB_MAC_INST *nr_mac, ...@@ -1811,7 +1811,7 @@ static void prepare_dl_pdus(gNB_MAC_INST *nr_mac,
pdsch_pdu_rel15->qamModOrder[0] = Qm; pdsch_pdu_rel15->qamModOrder[0] = Qm;
pdsch_pdu_rel15->mcsIndex[0] = mcsIndex; pdsch_pdu_rel15->mcsIndex[0] = mcsIndex;
pdsch_pdu_rel15->mcsTable[0] = mcsTableIdx; pdsch_pdu_rel15->mcsTable[0] = mcsTableIdx;
pdsch_pdu_rel15->rvIndex[0] = nr_rv_round_map[round % 4]; pdsch_pdu_rel15->rvIndex[0] = nr_get_rv(round % 4);
pdsch_pdu_rel15->dataScramblingId = *scc->physCellId; pdsch_pdu_rel15->dataScramblingId = *scc->physCellId;
pdsch_pdu_rel15->nrOfLayers = 1; pdsch_pdu_rel15->nrOfLayers = 1;
pdsch_pdu_rel15->transmissionScheme = 0; pdsch_pdu_rel15->transmissionScheme = 0;
......
...@@ -548,7 +548,7 @@ static void nr_fill_nfapi_dl_SIB_pdu(int Mod_idP, ...@@ -548,7 +548,7 @@ static void nr_fill_nfapi_dl_SIB_pdu(int Mod_idP,
pdsch_pdu_rel15->qamModOrder[0] = nr_get_Qm_dl(pdsch->mcs, mcsTableIdx); pdsch_pdu_rel15->qamModOrder[0] = nr_get_Qm_dl(pdsch->mcs, mcsTableIdx);
pdsch_pdu_rel15->mcsIndex[0] = pdsch->mcs; pdsch_pdu_rel15->mcsIndex[0] = pdsch->mcs;
pdsch_pdu_rel15->mcsTable[0] = mcsTableIdx; pdsch_pdu_rel15->mcsTable[0] = mcsTableIdx;
pdsch_pdu_rel15->rvIndex[0] = nr_rv_round_map[0]; pdsch_pdu_rel15->rvIndex[0] = nr_get_rv(0);
pdsch_pdu_rel15->dataScramblingId = *scc->physCellId; pdsch_pdu_rel15->dataScramblingId = *scc->physCellId;
pdsch_pdu_rel15->nrOfLayers = 1; pdsch_pdu_rel15->nrOfLayers = 1;
pdsch_pdu_rel15->transmissionScheme = 0; pdsch_pdu_rel15->transmissionScheme = 0;
......
...@@ -1030,7 +1030,7 @@ void nr_schedule_ue_spec(module_id_t module_id, ...@@ -1030,7 +1030,7 @@ void nr_schedule_ue_spec(module_id_t module_id,
TBS, TBS,
current_harq_pid, current_harq_pid,
harq->round, harq->round,
nr_rv_round_map[harq->round%4], nr_get_rv(harq->round % 4),
harq->ndi, harq->ndi,
pucch->timing_indicator, pucch->timing_indicator,
pucch->frame, pucch->frame,
...@@ -1090,7 +1090,7 @@ void nr_schedule_ue_spec(module_id_t module_id, ...@@ -1090,7 +1090,7 @@ void nr_schedule_ue_spec(module_id_t module_id,
pdsch_pdu->mcsTable[0] = 0; pdsch_pdu->mcsTable[0] = 0;
} }
AssertFatal(harq->round < gNB_mac->dl_bler.harq_round_max,"%d", harq->round); AssertFatal(harq->round < gNB_mac->dl_bler.harq_round_max,"%d", harq->round);
pdsch_pdu->rvIndex[0] = nr_rv_round_map[harq->round % 4]; pdsch_pdu->rvIndex[0] = nr_get_rv(harq->round % 4);
pdsch_pdu->TBSize[0] = TBS; pdsch_pdu->TBSize[0] = TBS;
pdsch_pdu->dataScramblingId = *scc->physCellId; pdsch_pdu->dataScramblingId = *scc->physCellId;
pdsch_pdu->nrOfLayers = nrOfLayers; pdsch_pdu->nrOfLayers = nrOfLayers;
......
...@@ -2501,7 +2501,7 @@ void nr_schedule_ulsch(module_id_t module_id, frame_t frame, sub_frame_t slot, n ...@@ -2501,7 +2501,7 @@ void nr_schedule_ulsch(module_id_t module_id, frame_t frame, sub_frame_t slot, n
sched_pusch->tb_size, sched_pusch->tb_size,
harq_id, harq_id,
cur_harq->round, cur_harq->round,
nr_rv_round_map[cur_harq->round%4], nr_get_rv(cur_harq->round % 4),
cur_harq->ndi, cur_harq->ndi,
sched_ctrl->estimated_ul_buffer, sched_ctrl->estimated_ul_buffer,
sched_ctrl->sched_ul_bytes, sched_ctrl->sched_ul_bytes,
...@@ -2615,8 +2615,10 @@ void nr_schedule_ulsch(module_id_t module_id, frame_t frame, sub_frame_t slot, n ...@@ -2615,8 +2615,10 @@ void nr_schedule_ulsch(module_id_t module_id, frame_t frame, sub_frame_t slot, n
pusch_pdu->nr_of_symbols = sched_pusch->tda_info.nrOfSymbols; pusch_pdu->nr_of_symbols = sched_pusch->tda_info.nrOfSymbols;
/* PUSCH PDU */ /* PUSCH PDU */
AssertFatal(cur_harq->round < nr_mac->ul_bler.harq_round_max, "Indexing nr_rv_round_map[%d] is out of bounds\n", cur_harq->round%4); AssertFatal(cur_harq->round < nr_mac->ul_bler.harq_round_max,
pusch_pdu->pusch_data.rv_index = nr_rv_round_map[cur_harq->round%4]; "RV index %d is out of bounds\n",
cur_harq->round % 4);
pusch_pdu->pusch_data.rv_index = nr_get_rv(cur_harq->round % 4);
pusch_pdu->pusch_data.harq_process_id = harq_id; pusch_pdu->pusch_data.harq_process_id = harq_id;
pusch_pdu->pusch_data.new_data_indicator = (cur_harq->round == 0) ? 1 : 0; // not NDI but indicator for new transmission pusch_pdu->pusch_data.new_data_indicator = (cur_harq->round == 0) ? 1 : 0; // not NDI but indicator for new transmission
pusch_pdu->pusch_data.tb_size = sched_pusch->tb_size; pusch_pdu->pusch_data.tb_size = sched_pusch->tb_size;
......
...@@ -102,7 +102,7 @@ ...@@ -102,7 +102,7 @@
#define MAX_NUM_NR_PRACH_PREAMBLES 64 #define MAX_NUM_NR_PRACH_PREAMBLES 64
#define MIN_NUM_PRBS_TO_SCHEDULE 5 #define MIN_NUM_PRBS_TO_SCHEDULE 5
extern const uint8_t nr_rv_round_map[4]; uint8_t nr_get_rv(int rel_round);
/*! \brief NR_list_t is a "list" (of users, HARQ processes, slices, ...). /*! \brief NR_list_t is a "list" (of users, HARQ processes, slices, ...).
* Especially useful in the scheduler and to keep "classes" of users. */ * Especially useful in the scheduler and to keep "classes" of users. */
......
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