Commit ab56138b authored by Romain Beurdouche's avatar Romain Beurdouche

feat(ldpc-decoding-module-interface-rework): enables reworked decoding module...

feat(ldpc-decoding-module-interface-rework): enables reworked decoding module interface in nr-softmodem, fixes ulsch enable tests
parent 5ff30569
...@@ -456,6 +456,7 @@ void init_eNB_afterRU(void) { ...@@ -456,6 +456,7 @@ void init_eNB_afterRU(void) {
gNB = RC.gNB[inst]; gNB = RC.gNB[inst];
gNB->ldpc_offload_flag = get_softmodem_params()->ldpc_offload_flag; gNB->ldpc_offload_flag = get_softmodem_params()->ldpc_offload_flag;
gNB->nr_ulsch_decoding_interface_flag = get_softmodem_params()->nr_ulsch_decoding_interface_flag;
phy_init_nr_gNB(gNB); phy_init_nr_gNB(gNB);
......
...@@ -107,6 +107,7 @@ extern "C" ...@@ -107,6 +107,7 @@ extern "C"
#define CONFIG_HLP_STATS_DISABLE "disable globally the stats generation and persistence" #define CONFIG_HLP_STATS_DISABLE "disable globally the stats generation and persistence"
#define CONFIG_HLP_NOITTI "Do not start itti threads, call queue processing in place, inside the caller thread" #define CONFIG_HLP_NOITTI "Do not start itti threads, call queue processing in place, inside the caller thread"
#define CONFIG_HLP_LDPC_OFFLOAD "Enable LDPC offload to AMD Xilinx T2 telco card\n" #define CONFIG_HLP_LDPC_OFFLOAD "Enable LDPC offload to AMD Xilinx T2 telco card\n"
#define CONFIG_HLP_ULSCH_DECODE "Enable slot decoding module\n"
#define CONFIG_HLP_SYNC_REF "UE acts a Sync Reference in Sidelink. 0-none 1-GNB 2-GNSS 4-localtiming\n" #define CONFIG_HLP_SYNC_REF "UE acts a Sync Reference in Sidelink. 0-none 1-GNB 2-GNSS 4-localtiming\n"
/*-----------------------------------------------------------------------------------------------------------------------------------------------------*/ /*-----------------------------------------------------------------------------------------------------------------------------------------------------*/
...@@ -141,6 +142,7 @@ extern "C" ...@@ -141,6 +142,7 @@ extern "C"
#define CONTINUOUS_TX softmodem_params.continuous_tx #define CONTINUOUS_TX softmodem_params.continuous_tx
#define SYNC_REF softmodem_params.sync_ref #define SYNC_REF softmodem_params.sync_ref
#define LDPC_OFFLOAD_FLAG softmodem_params.ldpc_offload_flag #define LDPC_OFFLOAD_FLAG softmodem_params.ldpc_offload_flag
#define ULSCH_DECODE_FLAG softmodem_params.nr_ulsch_decoding_interface_flag
#define DEFAULT_RFCONFIG_FILE "/usr/local/etc/syriq/ue.band7.tm1.PRB100.NR40.dat"; #define DEFAULT_RFCONFIG_FILE "/usr/local/etc/syriq/ue.band7.tm1.PRB100.NR40.dat";
...@@ -186,7 +188,7 @@ extern int usrp_tx_thread; ...@@ -186,7 +188,7 @@ extern int usrp_tx_thread;
{"disable-stats", CONFIG_HLP_STATS_DISABLE, PARAMFLAG_BOOL, .iptr=&stats_disabled, .defintval=0, TYPE_INT, 0}, \ {"disable-stats", CONFIG_HLP_STATS_DISABLE, PARAMFLAG_BOOL, .iptr=&stats_disabled, .defintval=0, TYPE_INT, 0}, \
{"no-itti-threads", CONFIG_HLP_NOITTI, PARAMFLAG_BOOL, .iptr=&softmodem_params.no_itti, .defintval=0, TYPE_INT, 0}, \ {"no-itti-threads", CONFIG_HLP_NOITTI, PARAMFLAG_BOOL, .iptr=&softmodem_params.no_itti, .defintval=0, TYPE_INT, 0}, \
{"ldpc-offload-enable", CONFIG_HLP_LDPC_OFFLOAD, PARAMFLAG_BOOL, .iptr=&LDPC_OFFLOAD_FLAG, .defstrval=0, TYPE_INT, 0}, \ {"ldpc-offload-enable", CONFIG_HLP_LDPC_OFFLOAD, PARAMFLAG_BOOL, .iptr=&LDPC_OFFLOAD_FLAG, .defstrval=0, TYPE_INT, 0}, \
{"sync-ref", CONFIG_HLP_SYNC_REF, 0, .uptr=&SYNC_REF, .defintval=0, TYPE_UINT, 0}, \ {"ulsch-decode-enable", CONFIG_HLP_ULSCH_DECODE, PARAMFLAG_BOOL, .iptr=&ULSCH_DECODE_FLAG, .defintval=0, TYPE_INT, 0}, \
} }
// clang-format on // clang-format on
...@@ -236,6 +238,7 @@ extern int usrp_tx_thread; ...@@ -236,6 +238,7 @@ extern int usrp_tx_thread;
{ .s5 = { NULL } }, \ { .s5 = { NULL } }, \
{ .s5 = { NULL } }, \ { .s5 = { NULL } }, \
{ .s5 = { NULL } }, \ { .s5 = { NULL } }, \
{ .s5 = { NULL } }, \
} }
// clang-format on // clang-format on
...@@ -346,6 +349,7 @@ typedef struct { ...@@ -346,6 +349,7 @@ typedef struct {
uint32_t sync_ref; uint32_t sync_ref;
int no_itti; int no_itti;
int ldpc_offload_flag; int ldpc_offload_flag;
int nr_ulsch_decoding_interface_flag;
} softmodem_params_t; } softmodem_params_t;
extern uint64_t get_softmodem_optmask(void); extern uint64_t get_softmodem_optmask(void);
......
...@@ -363,9 +363,11 @@ int32_t nr_ulsch_decoding_decoder(PHY_VARS_gNB *gNB, NR_DL_FRAME_PARMS *frame_pa ...@@ -363,9 +363,11 @@ int32_t nr_ulsch_decoding_decoder(PHY_VARS_gNB *gNB, NR_DL_FRAME_PARMS *frame_pa
int nbDecode = 0; int nbDecode = 0;
for (int ULSCH_id = 0; ULSCH_id < gNB->max_nb_pusch; ULSCH_id++) { for (int ULSCH_id = 0; ULSCH_id < gNB->max_nb_pusch; ULSCH_id++) {
NR_gNB_ULSCH_t *ulsch = &gNB->ulsch[ULSCH_id]; NR_gNB_ULSCH_t *ulsch = &gNB->ulsch[ULSCH_id];
uint8_t harq_pid = ulsch->harq_pid; if ((ulsch->active == true) && (ulsch->frame == frame_rx) && (ulsch->slot == slot_rx) && (ulsch->handled == 0)) {
nfapi_nr_pusch_pdu_t *pusch_pdu = &gNB->ulsch[ULSCH_id].harq_process->ulsch_pdu; uint8_t harq_pid = ulsch->harq_pid;
nbDecode += nr_ulsch_decoding_demo(gNB, ULSCH_id, gNB->pusch_vars[ULSCH_id].llr, frame_parms, pusch_pdu, frame_rx, slot_rx, harq_pid, G[ULSCH_id]); nfapi_nr_pusch_pdu_t *pusch_pdu = &gNB->ulsch[ULSCH_id].harq_process->ulsch_pdu;
nbDecode += nr_ulsch_decoding_demo(gNB, ULSCH_id, gNB->pusch_vars[ULSCH_id].llr, frame_parms, pusch_pdu, frame_rx, slot_rx, harq_pid, G[ULSCH_id]);
}
} }
return nbDecode; return nbDecode;
......
...@@ -361,43 +361,48 @@ static int nr_ulsch_procedures_slot(PHY_VARS_gNB *gNB, int frame_rx, int slot_rx ...@@ -361,43 +361,48 @@ static int nr_ulsch_procedures_slot(PHY_VARS_gNB *gNB, int frame_rx, int slot_rx
NR_DL_FRAME_PARMS *frame_parms = &gNB->frame_parms; NR_DL_FRAME_PARMS *frame_parms = &gNB->frame_parms;
uint32_t *G = malloc(gNB->max_nb_pusch*sizeof(uint32_t)); uint32_t *G = malloc(gNB->max_nb_pusch*sizeof(uint32_t));
for (int ULSCH_id = 0; ULSCH_id < gNB->max_nb_pusch; ULSCH_id++) { for (int ULSCH_id = 0; ULSCH_id < gNB->max_nb_pusch; ULSCH_id++) {
nfapi_nr_pusch_pdu_t *pusch_pdu = &gNB->ulsch[ULSCH_id].harq_process->ulsch_pdu;
NR_gNB_ULSCH_t *ulsch = &gNB->ulsch[ULSCH_id];
uint16_t nb_re_dmrs; if ((ulsch->active == true) && (ulsch->frame == frame_rx) && (ulsch->slot == slot_rx) && (ulsch->handled == 0)) {
uint16_t start_symbol = pusch_pdu->start_symbol_index;
uint16_t number_symbols = pusch_pdu->nr_of_symbols; nfapi_nr_pusch_pdu_t *pusch_pdu = &gNB->ulsch[ULSCH_id].harq_process->ulsch_pdu;
uint8_t number_dmrs_symbols = 0; uint16_t nb_re_dmrs;
for (int l = start_symbol; l < start_symbol + number_symbols; l++) uint16_t start_symbol = pusch_pdu->start_symbol_index;
number_dmrs_symbols += ((pusch_pdu->ul_dmrs_symb_pos)>>l)&0x01; uint16_t number_symbols = pusch_pdu->nr_of_symbols;
if (pusch_pdu->dmrs_config_type==pusch_dmrs_type1) uint8_t number_dmrs_symbols = 0;
nb_re_dmrs = 6*pusch_pdu->num_dmrs_cdm_grps_no_data; for (int l = start_symbol; l < start_symbol + number_symbols; l++)
else number_dmrs_symbols += ((pusch_pdu->ul_dmrs_symb_pos)>>l)&0x01;
nb_re_dmrs = 4*pusch_pdu->num_dmrs_cdm_grps_no_data;
if (pusch_pdu->dmrs_config_type==pusch_dmrs_type1)
G[ULSCH_id] = nr_get_G(pusch_pdu->rb_size, nb_re_dmrs = 6*pusch_pdu->num_dmrs_cdm_grps_no_data;
number_symbols, else
nb_re_dmrs, nb_re_dmrs = 4*pusch_pdu->num_dmrs_cdm_grps_no_data;
number_dmrs_symbols, // number of dmrs symbols irrespective of single or double symbol dmrs
gNB->ulsch[ULSCH_id].unav_res, G[ULSCH_id] = nr_get_G(pusch_pdu->rb_size,
pusch_pdu->qam_mod_order, number_symbols,
pusch_pdu->nrOfLayers); nb_re_dmrs,
AssertFatal(G[ULSCH_id]>0,"G is 0 : rb_size %u, number_symbols %d, nb_re_dmrs %d, number_dmrs_symbols %d, qam_mod_order %u, nrOfLayer %u\n", number_dmrs_symbols, // number of dmrs symbols irrespective of single or double symbol dmrs
pusch_pdu->rb_size, gNB->ulsch[ULSCH_id].unav_res,
number_symbols, pusch_pdu->qam_mod_order,
nb_re_dmrs, pusch_pdu->nrOfLayers);
number_dmrs_symbols, // number of dmrs symbols irrespective of single or double symbol dmrs AssertFatal(G[ULSCH_id]>0,"G is 0 : rb_size %u, number_symbols %d, nb_re_dmrs %d, number_dmrs_symbols %d, qam_mod_order %u, nrOfLayer %u\n",
pusch_pdu->qam_mod_order, pusch_pdu->rb_size,
pusch_pdu->nrOfLayers); number_symbols,
LOG_D(PHY,"rb_size %d, number_symbols %d, nb_re_dmrs %d, dmrs symbol positions %d, number_dmrs_symbols %d, qam_mod_order %d, nrOfLayer %d\n", nb_re_dmrs,
pusch_pdu->rb_size, number_dmrs_symbols, // number of dmrs symbols irrespective of single or double symbol dmrs
number_symbols, pusch_pdu->qam_mod_order,
nb_re_dmrs, pusch_pdu->nrOfLayers);
pusch_pdu->ul_dmrs_symb_pos, LOG_D(PHY,"rb_size %d, number_symbols %d, nb_re_dmrs %d, dmrs symbol positions %d, number_dmrs_symbols %d, qam_mod_order %d, nrOfLayer %d\n",
number_dmrs_symbols, // number of dmrs symbols irrespective of single or double symbol dmrs pusch_pdu->rb_size,
pusch_pdu->qam_mod_order, number_symbols,
pusch_pdu->nrOfLayers); nb_re_dmrs,
pusch_pdu->ul_dmrs_symb_pos,
number_dmrs_symbols, // number of dmrs symbols irrespective of single or double symbol dmrs
pusch_pdu->qam_mod_order,
pusch_pdu->nrOfLayers);
}
} }
//---------------------------------------------------------- //----------------------------------------------------------
......
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