Number of mod symbols addition in fapi
This commit is contained in:
@@ -508,7 +508,7 @@ typedef struct{
|
|||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
nfapi_tl_t tl;
|
nfapi_tl_t tl;
|
||||||
uint8_t rnti;
|
uint16_t rnti;
|
||||||
uint8_t rnti_type;
|
uint8_t rnti_type;
|
||||||
uint8_t dci_format;
|
uint8_t dci_format;
|
||||||
uint8_t config_type;
|
uint8_t config_type;
|
||||||
@@ -550,6 +550,7 @@ typedef struct {
|
|||||||
uint16_t length;
|
uint16_t length;
|
||||||
uint8_t pdu_index;
|
uint8_t pdu_index;
|
||||||
uint16_t rnti;
|
uint16_t rnti;
|
||||||
|
uint16_t nb_mod_symbols;
|
||||||
uint8_t time_allocation_type;
|
uint8_t time_allocation_type;
|
||||||
uint8_t freq_allocation_type;
|
uint8_t freq_allocation_type;
|
||||||
uint8_t start_prb;
|
uint8_t start_prb;
|
||||||
|
|||||||
@@ -197,10 +197,11 @@ uint8_t nr_generate_pdsch(NR_gNB_DLSCH_t dlsch,
|
|||||||
uint32_t scrambled_output[NR_MAX_NB_CODEWORDS][NR_MAX_PDSCH_ENCODED_LENGTH>>5];
|
uint32_t scrambled_output[NR_MAX_NB_CODEWORDS][NR_MAX_PDSCH_ENCODED_LENGTH>>5];
|
||||||
int16_t **mod_symbs = (int16_t**)dlsch.mod_symbs;
|
int16_t **mod_symbs = (int16_t**)dlsch.mod_symbs;
|
||||||
int16_t **tx_layers = (int16_t**)dlsch.txdataF;
|
int16_t **tx_layers = (int16_t**)dlsch.txdataF;
|
||||||
uint16_t n_symbs;
|
int8_t Wf[2], Wt[2], l0, l_prime[2], delta;
|
||||||
int8_t Wf[2], Wt[2], l0, l_prime, delta;
|
|
||||||
uint16_t TBS = rel15->transport_block_size;
|
uint16_t TBS = rel15->transport_block_size;
|
||||||
|
uint16_t nb_symbols = rel15->nb_mod_symbols;
|
||||||
uint8_t Qm = rel15->modulation_order;
|
uint8_t Qm = rel15->modulation_order;
|
||||||
|
uint16_t encoded_length = nb_symbols*Qm;
|
||||||
|
|
||||||
/// CRC, coding, interleaving and rate matching
|
/// CRC, coding, interleaving and rate matching
|
||||||
nr_dlsch_encoding(harq->pdu, subframe, &dlsch, &frame_parms);
|
nr_dlsch_encoding(harq->pdu, subframe, &dlsch, &frame_parms);
|
||||||
@@ -212,7 +213,7 @@ for (int i=0; i<MAX_NR_DLSCH_PAYLOAD_BYTES>>4; i++) {
|
|||||||
printf("\n");
|
printf("\n");
|
||||||
}
|
}
|
||||||
printf("\nEncoded payload:\n");
|
printf("\nEncoded payload:\n");
|
||||||
for (int i=0; i<TBS>>4; i++) {
|
for (int i=0; i<encoded_length>>4; i++) {
|
||||||
for (int j=0; j<16; j++)
|
for (int j=0; j<16; j++)
|
||||||
printf("0x%02x\t", harq->f[(i<<4)+j]);
|
printf("0x%02x\t", harq->f[(i<<4)+j]);
|
||||||
printf("\n");
|
printf("\n");
|
||||||
@@ -226,14 +227,14 @@ for (int i=0; i<TBS>>4; i++) {
|
|||||||
pdcch_params.scrambling_id : config.sch_config.physical_cell_id.value;
|
pdcch_params.scrambling_id : config.sch_config.physical_cell_id.value;
|
||||||
for (int q=0; q<rel15->nb_codewords; q++)
|
for (int q=0; q<rel15->nb_codewords; q++)
|
||||||
nr_pdsch_codeword_scrambling(harq->f,
|
nr_pdsch_codeword_scrambling(harq->f,
|
||||||
TBS,
|
encoded_length,
|
||||||
q,
|
q,
|
||||||
Nid,
|
Nid,
|
||||||
n_RNTI,
|
n_RNTI,
|
||||||
scrambled_output[q]);
|
scrambled_output[q]);
|
||||||
#ifdef DEBUG_DLSCH
|
#ifdef DEBUG_DLSCH
|
||||||
printf("PDSCH scrambling:\n");
|
printf("PDSCH scrambling:\n");
|
||||||
for (int i=0; i<TBS>>7; i++) {
|
for (int i=0; i<encoded_length>>7; i++) {
|
||||||
for (int j=0; j<8; j++)
|
for (int j=0; j<8; j++)
|
||||||
printf("0x%08x\t", scrambled_output[0][(i<<3)+j]);
|
printf("0x%08x\t", scrambled_output[0][(i<<3)+j]);
|
||||||
printf("\n");
|
printf("\n");
|
||||||
@@ -241,15 +242,14 @@ for (int i=0; i<TBS>>7; i++) {
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
/// Modulation
|
/// Modulation
|
||||||
n_symbs = TBS/Qm;
|
|
||||||
for (int q=0; q<rel15->nb_codewords; q++)
|
for (int q=0; q<rel15->nb_codewords; q++)
|
||||||
nr_pdsch_codeword_modulation(scrambled_output[q],
|
nr_pdsch_codeword_modulation(scrambled_output[q],
|
||||||
Qm,
|
Qm,
|
||||||
TBS,
|
encoded_length,
|
||||||
mod_symbs[q]);
|
mod_symbs[q]);
|
||||||
#ifdef DEBUG_DLSCH
|
#ifdef DEBUG_DLSCH
|
||||||
printf("PDSCH Modulation: Qm %d(%d)\n", Qm, n_symbs);
|
printf("PDSCH Modulation: Qm %d(%d)\n", Qm, n_symbs);
|
||||||
for (int i=0; i<n_symbs>>3; i++) {
|
for (int i=0; i<nb_symbols>>3; i++) {
|
||||||
for (int j=0; j<8; j++) {
|
for (int j=0; j<8; j++) {
|
||||||
printf("%d %d\t", mod_symbs[0][((i<<3)+j)<<1], mod_symbs[0][(((i<<3)+j)<<1)+1]);
|
printf("%d %d\t", mod_symbs[0][((i<<3)+j)<<1], mod_symbs[0][(((i<<3)+j)<<1)+1]);
|
||||||
}
|
}
|
||||||
@@ -261,12 +261,12 @@ for (int i=0; i<n_symbs>>3; i++) {
|
|||||||
/// Layer mapping
|
/// Layer mapping
|
||||||
nr_pdsch_layer_mapping(mod_symbs,
|
nr_pdsch_layer_mapping(mod_symbs,
|
||||||
rel15->nb_layers,
|
rel15->nb_layers,
|
||||||
n_symbs,
|
nb_symbols,
|
||||||
tx_layers);
|
tx_layers);
|
||||||
#ifdef DEBUG_DLSCH
|
#ifdef DEBUG_DLSCH
|
||||||
printf("Layer mapping (%d layers):\n", rel15->nb_layers);
|
printf("Layer mapping (%d layers):\n", rel15->nb_layers);
|
||||||
for (int l=0; l<rel15->nb_layers; l++)
|
for (int l=0; l<rel15->nb_layers; l++)
|
||||||
for (int i=0; i<n_symbs>>3; i++) {
|
for (int i=0; i<(nb_symbs/rel15->nb_layers)>>3; i++) {
|
||||||
for (int j=0; j<8; j++) {
|
for (int j=0; j<8; j++) {
|
||||||
printf("%d %d\t", tx_layers[l][((i<<3)+j)<<1], tx_layers[l][(((i<<3)+j)<<1)+1]);
|
printf("%d %d\t", tx_layers[l][((i<<3)+j)<<1], tx_layers[l][(((i<<3)+j)<<1)+1]);
|
||||||
}
|
}
|
||||||
@@ -308,6 +308,7 @@ for (int i=0; i<n_dmrs>>3; i++) {
|
|||||||
get_Wt(Wt, ap, dmrs_type);
|
get_Wt(Wt, ap, dmrs_type);
|
||||||
get_Wf(Wf, ap, dmrs_type);
|
get_Wf(Wf, ap, dmrs_type);
|
||||||
delta = get_delta(ap, dmrs_type);
|
delta = get_delta(ap, dmrs_type);
|
||||||
|
l_prime[0] = 0; // single symbol ap 0
|
||||||
#ifdef DEBUG_DLSCH_MAPPING
|
#ifdef DEBUG_DLSCH_MAPPING
|
||||||
printf("DMRS params for ap %d: Wt %d %d \t Wf %d %d\n", ap, Wt[0], Wt[1], Wf[0], Wf[1]);
|
printf("DMRS params for ap %d: Wt %d %d \t Wf %d %d\n", ap, Wt[0], Wt[1], Wf[0], Wf[1]);
|
||||||
#endif
|
#endif
|
||||||
@@ -319,9 +320,9 @@ printf("DMRS params for ap %d: Wt %d %d \t Wf %d %d\n", ap, Wt[0], Wt[1], Wf[0],
|
|||||||
if (k >= frame_parms.ofdm_symbol_size)
|
if (k >= frame_parms.ofdm_symbol_size)
|
||||||
k -= frame_parms.ofdm_symbol_size;
|
k -= frame_parms.ofdm_symbol_size;
|
||||||
|
|
||||||
if ((l==l0) && (k == ((dmrs_type)? (6*n+k_prime+delta):((n<<2)+(k_prime<<1)+delta)))) {
|
if ((l==(l0+l_prime[0])) && (k == ((dmrs_type)? (6*n+k_prime+delta):((n<<2)+(k_prime<<1)+delta)))) {
|
||||||
((int16_t*)txdataF[ap])[(l*frame_parms.ofdm_symbol_size + k)<<1] = (Wt[k_prime]*Wf[k_prime]*amp/2*mod_dmrs[dmrs_idx<<1]) >> 15;
|
((int16_t*)txdataF[ap])[(l*frame_parms.ofdm_symbol_size + k)<<1] = (Wt[l_prime[0]]*Wf[k_prime]*amp/2*mod_dmrs[dmrs_idx<<1]) >> 15;
|
||||||
((int16_t*)txdataF[ap])[((l*frame_parms.ofdm_symbol_size + k)<<1) + 1] = (Wt[k_prime]*Wf[k_prime]*amp/2*mod_dmrs[(dmrs_idx<<1) + 1]) >> 15;
|
((int16_t*)txdataF[ap])[((l*frame_parms.ofdm_symbol_size + k)<<1) + 1] = (Wt[l_prime[0]]*Wf[k_prime]*amp/2*mod_dmrs[(dmrs_idx<<1) + 1]) >> 15;
|
||||||
#ifdef DEBUG_DLSCH_MAPPING
|
#ifdef DEBUG_DLSCH_MAPPING
|
||||||
printf("dmrs_idx %d\t l %d \t k %d \t k_prime %d \t n %d \t txdataF: %d %d\n",
|
printf("dmrs_idx %d\t l %d \t k %d \t k_prime %d \t n %d \t txdataF: %d %d\n",
|
||||||
dmrs_idx, l, k, k_prime, n, ((int16_t*)txdataF[ap])[(l*frame_parms.ofdm_symbol_size + k)<<1], ((int16_t*)txdataF[ap])[((l*frame_parms.ofdm_symbol_size + k)<<1) + 1]);
|
dmrs_idx, l, k, k_prime, n, ((int16_t*)txdataF[ap])[(l*frame_parms.ofdm_symbol_size + k)<<1], ((int16_t*)txdataF[ap])[((l*frame_parms.ofdm_symbol_size + k)<<1) + 1]);
|
||||||
|
|||||||
@@ -107,6 +107,8 @@ void nr_get_tbs(nfapi_nr_dl_config_dlsch_pdu *dlsch_pdu,
|
|||||||
nfapi_nr_dl_config_dci_dl_pdu dci_pdu,
|
nfapi_nr_dl_config_dci_dl_pdu dci_pdu,
|
||||||
nfapi_nr_config_request_t config) {
|
nfapi_nr_config_request_t config) {
|
||||||
|
|
||||||
|
LOG_I(MAC, "TBS calculation\n");
|
||||||
|
|
||||||
nfapi_nr_dl_config_pdcch_parameters_rel15_t params_rel15 = dci_pdu.pdcch_params_rel15;
|
nfapi_nr_dl_config_pdcch_parameters_rel15_t params_rel15 = dci_pdu.pdcch_params_rel15;
|
||||||
nfapi_nr_dl_config_dlsch_pdu_rel15_t *dlsch_rel15 = &dlsch_pdu->dlsch_pdu_rel15;
|
nfapi_nr_dl_config_dlsch_pdu_rel15_t *dlsch_rel15 = &dlsch_pdu->dlsch_pdu_rel15;
|
||||||
uint8_t rnti_type = params_rel15.rnti_type;
|
uint8_t rnti_type = params_rel15.rnti_type;
|
||||||
@@ -125,7 +127,7 @@ void nr_get_tbs(nfapi_nr_dl_config_dlsch_pdu *dlsch_pdu,
|
|||||||
uint8_t table_idx, Qm, n, scale;
|
uint8_t table_idx, Qm, n, scale;
|
||||||
|
|
||||||
table_idx = get_table_idx(mcs_table, dci_format, rnti_type, ss_type);
|
table_idx = get_table_idx(mcs_table, dci_format, rnti_type, ss_type);
|
||||||
scale = 10 + (((table_idx==2)&&((Imcs==20)||(Imcs==26)))?1:0);
|
scale = ((table_idx==2)&&((Imcs==20)||(Imcs==26)))?11:10;
|
||||||
|
|
||||||
N_RE = min(156, N_RE_prime)*dlsch_rel15->n_prb;
|
N_RE = min(156, N_RE_prime)*dlsch_rel15->n_prb;
|
||||||
R = nr_get_code_rate(Imcs, table_idx);
|
R = nr_get_code_rate(Imcs, table_idx);
|
||||||
@@ -165,6 +167,7 @@ void nr_get_tbs(nfapi_nr_dl_config_dlsch_pdu *dlsch_pdu,
|
|||||||
dlsch_rel15->modulation_order = Qm;
|
dlsch_rel15->modulation_order = Qm;
|
||||||
dlsch_rel15->transport_block_size = TBS;
|
dlsch_rel15->transport_block_size = TBS;
|
||||||
dlsch_rel15->nb_re_dmrs = N_PRB_DMRS;
|
dlsch_rel15->nb_re_dmrs = N_PRB_DMRS;
|
||||||
|
dlsch_rel15->nb_mod_symbols = N_RE_prime*dlsch_rel15->n_prb*dlsch_rel15->nb_codewords;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -76,8 +76,8 @@ void nr_schedule_css_dlsch_phytest(module_id_t module_idP,
|
|||||||
|
|
||||||
dlsch_pdu_rel15->start_prb = 0;
|
dlsch_pdu_rel15->start_prb = 0;
|
||||||
dlsch_pdu_rel15->n_prb = 106;
|
dlsch_pdu_rel15->n_prb = 106;
|
||||||
dlsch_pdu_rel15->start_symbol = 8;
|
dlsch_pdu_rel15->start_symbol = 2;
|
||||||
dlsch_pdu_rel15->nb_symbols = 6;
|
dlsch_pdu_rel15->nb_symbols = 8;
|
||||||
dlsch_pdu_rel15->rnti = rnti;
|
dlsch_pdu_rel15->rnti = rnti;
|
||||||
dlsch_pdu_rel15->nb_layers =1;
|
dlsch_pdu_rel15->nb_layers =1;
|
||||||
dlsch_pdu_rel15->nb_codewords = 1;
|
dlsch_pdu_rel15->nb_codewords = 1;
|
||||||
|
|||||||
Reference in New Issue
Block a user