Commit 8060ffed authored by Guy De Souza's avatar Guy De Souza

Payload generation fix

parent d3c11bd5
...@@ -305,7 +305,7 @@ typedef struct { ...@@ -305,7 +305,7 @@ typedef struct {
nfapi_tl_t tl; nfapi_tl_t tl;
uint8_t format_indicator; //1 bit uint8_t format_indicator; //1 bit
uint16_t frequency_domain_assignment; //up to 9 bits uint16_t frequency_domain_assignment; //up to 16 bits
uint8_t time_domain_assignment; // 4 bits uint8_t time_domain_assignment; // 4 bits
uint8_t frequency_hopping_flag; //1 bit uint8_t frequency_hopping_flag; //1 bit
......
...@@ -32,8 +32,8 @@ ...@@ -32,8 +32,8 @@
#include "nr_dci.h" #include "nr_dci.h"
#define DEBUG_PDCCH_DMRS //#define DEBUG_PDCCH_DMRS
#define DEBUG_DCI //#define DEBUG_DCI
extern short nr_mod_table[NR_MOD_TABLE_SIZE_SHORT]; extern short nr_mod_table[NR_MOD_TABLE_SIZE_SHORT];
......
...@@ -42,6 +42,7 @@ void nr_fill_dci_and_dlsch(PHY_VARS_gNB *gNB, ...@@ -42,6 +42,7 @@ void nr_fill_dci_and_dlsch(PHY_VARS_gNB *gNB,
{ {
NR_DL_FRAME_PARMS *fp = &gNB->frame_parms; NR_DL_FRAME_PARMS *fp = &gNB->frame_parms;
uint32_t *dci_pdu = dci_alloc->dci_pdu; uint32_t *dci_pdu = dci_alloc->dci_pdu;
memset((void*)dci_pdu,0,4*sizeof(uint32_t));
nfapi_nr_dl_config_dci_dl_pdu_rel15_t *pdu_rel15 = &pdu->dci_dl_pdu.dci_dl_pdu_rel15; nfapi_nr_dl_config_dci_dl_pdu_rel15_t *pdu_rel15 = &pdu->dci_dl_pdu.dci_dl_pdu_rel15;
nfapi_nr_dl_config_pdcch_parameters_rel15_t *params_rel15 = &pdu->dci_dl_pdu.pdcch_params_rel15; nfapi_nr_dl_config_pdcch_parameters_rel15_t *params_rel15 = &pdu->dci_dl_pdu.pdcch_params_rel15;
nfapi_nr_config_request_t *cfg = &gNB->gNB_config; nfapi_nr_config_request_t *cfg = &gNB->gNB_config;
...@@ -58,22 +59,22 @@ void nr_fill_dci_and_dlsch(PHY_VARS_gNB *gNB, ...@@ -58,22 +59,22 @@ void nr_fill_dci_and_dlsch(PHY_VARS_gNB *gNB,
// Freq domain assignment // Freq domain assignment
fsize = (int)ceil( log2( (N_RB*(N_RB+1))>>1 ) ); fsize = (int)ceil( log2( (N_RB*(N_RB+1))>>1 ) );
for (int i=0; i<fsize; i++) for (int i=0; i<fsize; i++)
*dci_pdu |= ((pdu_rel15->frequency_domain_assignment>>(fsize-i))&1)<<i; *dci_pdu |= ((pdu_rel15->frequency_domain_assignment>>(fsize-i-1))&1)<<i;
pos += fsize; pos += fsize;
// VRB to PRB mapping
*dci_pdu |= (pdu_rel15->vrb_to_prb_mapping&1)<<pos;
pos++;
// Time domain assignment // Time domain assignment
for (int i=0; i<4; i++) for (int i=0; i<4; i++)
*dci_pdu |= ((pdu_rel15->time_domain_assignment>>(4-i))&1)<<(pos+i); *dci_pdu |= ((pdu_rel15->time_domain_assignment>>(3-i))&1)<<(pos+i);
pos += 4; pos += 4;
// VRB to PRB mapping
*dci_pdu |= (pdu_rel15->vrb_to_prb_mapping&1)<<pos;
pos++;
//MCS //MCS
for (int i=0; i<5; i++) for (int i=0; i<5; i++)
*dci_pdu |= ((pdu_rel15->mcs>>(5-i))&1)<<(pos+i); *dci_pdu |= ((pdu_rel15->mcs>>(4-i))&1)<<(pos+i);
pos += 5; pos += 5;
// TB scaling // TB scaling
for (int i=0; i<2; i++) for (int i=0; i<2; i++)
*dci_pdu |= ((pdu_rel15->tb_scaling>>(2-i))&1)<<(pos+i); *dci_pdu |= ((pdu_rel15->tb_scaling>>(1-i))&1)<<(pos+i);
break; break;
......
...@@ -73,11 +73,13 @@ void nr_schedule_css_dlsch_phytest(module_id_t module_idP, ...@@ -73,11 +73,13 @@ void nr_schedule_css_dlsch_phytest(module_id_t module_idP,
pdu_rel15->frequency_domain_assignment = 5; pdu_rel15->frequency_domain_assignment = 5;
pdu_rel15->time_domain_assignment = 2; pdu_rel15->time_domain_assignment = 2;
pdu_rel15->vrb_to_prb_mapping = 0; pdu_rel15->vrb_to_prb_mapping = 0;
pdu_rel15->mcs = 12;
pdu_rel15->tb_scaling = 1; pdu_rel15->tb_scaling = 1;
LOG_I(MAC, "[gNB scheduler phytest] DCI type 1 payload: freq_alloc %d, time_alloc %d, vrb to prb %d, tb_scaling %d\n", LOG_I(MAC, "[gNB scheduler phytest] DCI type 1 payload: freq_alloc %d, time_alloc %d, vrb to prb %d, mcs %d tb_scaling %d\n",
pdu_rel15->frequency_domain_assignment, pdu_rel15->frequency_domain_assignment,
pdu_rel15->time_domain_assignment, pdu_rel15->time_domain_assignment,
pdu_rel15->vrb_to_prb_mapping, pdu_rel15->vrb_to_prb_mapping,
pdu_rel15->mcs,
pdu_rel15->tb_scaling); pdu_rel15->tb_scaling);
params_rel15->rnti = 0x03; params_rel15->rnti = 0x03;
......
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