Commit c11a7bac 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 82a835f9
...@@ -450,6 +450,7 @@ void init_eNB_afterRU(void) { ...@@ -450,6 +450,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);
......
...@@ -109,6 +109,7 @@ extern "C" ...@@ -109,6 +109,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"
#define CONFIG_HLP_TADV \ #define CONFIG_HLP_TADV \
"Set RF board timing_advance to compensate fix delay inside the RF board between Rx and Tx timestamps (RF board internal " \ "Set RF board timing_advance to compensate fix delay inside the RF board between Rx and Tx timestamps (RF board internal " \
...@@ -146,6 +147,7 @@ extern "C" ...@@ -146,6 +147,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";
...@@ -191,6 +193,7 @@ extern int usrp_tx_thread; ...@@ -191,6 +193,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}, \
{"ulsch-decode-enable", CONFIG_HLP_ULSCH_DECODE, PARAMFLAG_BOOL, .iptr=&ULSCH_DECODE_FLAG, .defintval=0, TYPE_INT, 0}, \
{"sync-ref", CONFIG_HLP_SYNC_REF, 0, .uptr=&SYNC_REF, .defintval=0, TYPE_UINT, 0}, \ {"sync-ref", CONFIG_HLP_SYNC_REF, 0, .uptr=&SYNC_REF, .defintval=0, TYPE_UINT, 0}, \
{"A" , CONFIG_HLP_TADV, 0, .iptr=&softmodem_params.command_line_sample_advance,.defintval=0, TYPE_INT, 0}, \ {"A" , CONFIG_HLP_TADV, 0, .iptr=&softmodem_params.command_line_sample_advance,.defintval=0, TYPE_INT, 0}, \
{"E" , CONFIG_HLP_TQFS, PARAMFLAG_BOOL, .iptr=&softmodem_params.threequarter_fs, .defintval=0, TYPE_INT, 0}, \ {"E" , CONFIG_HLP_TQFS, PARAMFLAG_BOOL, .iptr=&softmodem_params.threequarter_fs, .defintval=0, TYPE_INT, 0}, \
...@@ -244,6 +247,7 @@ extern int usrp_tx_thread; ...@@ -244,6 +247,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
...@@ -353,6 +357,7 @@ typedef struct { ...@@ -353,6 +357,7 @@ typedef struct {
int continuous_tx; int continuous_tx;
uint32_t sync_ref; uint32_t sync_ref;
int no_itti; int no_itti;
int nr_ulsch_decoding_interface_flag;
int ldpc_offload_flag; int ldpc_offload_flag;
int threequarter_fs; int threequarter_fs;
} softmodem_params_t; } softmodem_params_t;
......
...@@ -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;
......
...@@ -387,43 +387,48 @@ static int nr_ulsch_procedures_slot(PHY_VARS_gNB *gNB, int frame_rx, int slot_rx ...@@ -387,43 +387,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;
uint16_t nb_re_dmrs; NR_gNB_ULSCH_t *ulsch = &gNB->ulsch[ULSCH_id];
uint16_t start_symbol = pusch_pdu->start_symbol_index; if ((ulsch->active == true) && (ulsch->frame == frame_rx) && (ulsch->slot == slot_rx) && (ulsch->handled == 0)) {
uint16_t number_symbols = pusch_pdu->nr_of_symbols;
uint8_t number_dmrs_symbols = 0; nfapi_nr_pusch_pdu_t *pusch_pdu = &gNB->ulsch[ULSCH_id].harq_process->ulsch_pdu;
for (int l = start_symbol; l < start_symbol + number_symbols; l++)
number_dmrs_symbols += ((pusch_pdu->ul_dmrs_symb_pos)>>l)&0x01;
if (pusch_pdu->dmrs_config_type==pusch_dmrs_type1) uint16_t nb_re_dmrs;
nb_re_dmrs = 6*pusch_pdu->num_dmrs_cdm_grps_no_data; uint16_t start_symbol = pusch_pdu->start_symbol_index;
else uint16_t number_symbols = pusch_pdu->nr_of_symbols;
nb_re_dmrs = 4*pusch_pdu->num_dmrs_cdm_grps_no_data;
uint8_t number_dmrs_symbols = 0;
G[ULSCH_id] = nr_get_G(pusch_pdu->rb_size, for (int l = start_symbol; l < start_symbol + number_symbols; l++)
number_symbols, number_dmrs_symbols += ((pusch_pdu->ul_dmrs_symb_pos)>>l)&0x01;
nb_re_dmrs,
number_dmrs_symbols, // number of dmrs symbols irrespective of single or double symbol dmrs if (pusch_pdu->dmrs_config_type==pusch_dmrs_type1)
gNB->ulsch[ULSCH_id].unav_res, nb_re_dmrs = 6*pusch_pdu->num_dmrs_cdm_grps_no_data;
pusch_pdu->qam_mod_order, else
pusch_pdu->nrOfLayers); nb_re_dmrs = 4*pusch_pdu->num_dmrs_cdm_grps_no_data;
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->rb_size, G[ULSCH_id] = nr_get_G(pusch_pdu->rb_size,
number_symbols, number_symbols,
nb_re_dmrs, nb_re_dmrs,
number_dmrs_symbols, // number of dmrs symbols irrespective of single or double symbol dmrs number_dmrs_symbols, // number of dmrs symbols irrespective of single or double symbol dmrs
pusch_pdu->qam_mod_order, gNB->ulsch[ULSCH_id].unav_res,
pusch_pdu->nrOfLayers); pusch_pdu->qam_mod_order,
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", pusch_pdu->nrOfLayers);
pusch_pdu->rb_size, 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_symbols, pusch_pdu->rb_size,
nb_re_dmrs, number_symbols,
pusch_pdu->ul_dmrs_symb_pos, nb_re_dmrs,
number_dmrs_symbols, // number of dmrs symbols irrespective of single or double symbol dmrs number_dmrs_symbols, // number of dmrs symbols irrespective of single or double symbol dmrs
pusch_pdu->qam_mod_order, pusch_pdu->qam_mod_order,
pusch_pdu->nrOfLayers); pusch_pdu->nrOfLayers);
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",
pusch_pdu->rb_size,
number_symbols,
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