Commit e4a7eda9 authored by yihongzheng's avatar yihongzheng

base on 2021.w48, diff_1206_2.diff, UL_NR_MIMO 4*4

parent 0ac69fb1
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -67,6 +67,7 @@ ...@@ -67,6 +67,7 @@
#define CONFIG_HLP_ITTIL "Generate ITTI analyzser logs (similar to wireshark logs but with more details)\n" #define CONFIG_HLP_ITTIL "Generate ITTI analyzser logs (similar to wireshark logs but with more details)\n"
#define CONFIG_HLP_DLMCS_PHYTEST "Set the downlink MCS for PHYTEST mode\n" #define CONFIG_HLP_DLMCS_PHYTEST "Set the downlink MCS for PHYTEST mode\n"
#define CONFIG_HLP_DLNL_PHYTEST "Set the downlink nrOfLayers for PHYTEST mode\n" #define CONFIG_HLP_DLNL_PHYTEST "Set the downlink nrOfLayers for PHYTEST mode\n"
#define CONFIG_HLP_ULNL_PHYTEST "Set the uplink nrOfLayers for PHYTEST mode\n"
#define CONFIG_HLP_STMON "Enable processing timing measurement of lte softmodem on per subframe basis \n" #define CONFIG_HLP_STMON "Enable processing timing measurement of lte softmodem on per subframe basis \n"
#define CONFIG_HLP_MSLOTS "Skip the missed slots/subframes \n" #define CONFIG_HLP_MSLOTS "Skip the missed slots/subframes \n"
#define CONFIG_HLP_ULMCS_PHYTEST "Set the uplink MCS for PHYTEST mode\n" #define CONFIG_HLP_ULMCS_PHYTEST "Set the uplink MCS for PHYTEST mode\n"
......
...@@ -23,6 +23,7 @@ ...@@ -23,6 +23,7 @@
{"E" , CONFIG_HLP_TQFS, PARAMFLAG_BOOL, i8ptr:&threequarter_fs, defintval:0, TYPE_INT8, 0}, \ {"E" , CONFIG_HLP_TQFS, PARAMFLAG_BOOL, i8ptr:&threequarter_fs, defintval:0, TYPE_INT8, 0}, \
{"m" , CONFIG_HLP_DLMCS_PHYTEST,0, uptr:&target_dl_mcs, defintval:0, TYPE_UINT, 0}, \ {"m" , CONFIG_HLP_DLMCS_PHYTEST,0, uptr:&target_dl_mcs, defintval:0, TYPE_UINT, 0}, \
{"l" , CONFIG_HLP_DLNL_PHYTEST,0, uptr:&target_dl_Nl, defintval:0, TYPE_UINT, 0}, \ {"l" , CONFIG_HLP_DLNL_PHYTEST,0, uptr:&target_dl_Nl, defintval:0, TYPE_UINT, 0}, \
{"L" , CONFIG_HLP_ULNL_PHYTEST,0, uptr:&target_ul_Nl, defintval:0, TYPE_UINT, 0}, \
{"t" , CONFIG_HLP_ULMCS_PHYTEST,0, uptr:&target_ul_mcs, defintval:0, TYPE_UINT, 0}, \ {"t" , CONFIG_HLP_ULMCS_PHYTEST,0, uptr:&target_ul_mcs, defintval:0, TYPE_UINT, 0}, \
{"M" , CONFIG_HLP_DLBW_PHYTEST,0, uptr:&target_dl_bw, defintval:0, TYPE_UINT, 0}, \ {"M" , CONFIG_HLP_DLBW_PHYTEST,0, uptr:&target_dl_bw, defintval:0, TYPE_UINT, 0}, \
{"T" , CONFIG_HLP_ULBW_PHYTEST,0, uptr:&target_ul_bw, defintval:0, TYPE_UINT, 0}, \ {"T" , CONFIG_HLP_ULBW_PHYTEST,0, uptr:&target_ul_bw, defintval:0, TYPE_UINT, 0}, \
...@@ -36,6 +37,7 @@ ...@@ -36,6 +37,7 @@
extern threads_t threads; extern threads_t threads;
extern uint32_t target_dl_mcs; extern uint32_t target_dl_mcs;
extern uint32_t target_dl_Nl; extern uint32_t target_dl_Nl;
extern uint32_t target_ul_Nl;
extern uint32_t target_ul_mcs; extern uint32_t target_ul_mcs;
extern uint32_t target_dl_bw; extern uint32_t target_dl_bw;
extern uint32_t target_ul_bw; extern uint32_t target_ul_bw;
......
...@@ -278,7 +278,7 @@ void processSlotTX(void *arg) { ...@@ -278,7 +278,7 @@ void processSlotTX(void *arg) {
int tx_slot_type = nr_ue_slot_select(cfg, proc->frame_tx, proc->nr_slot_tx); int tx_slot_type = nr_ue_slot_select(cfg, proc->frame_tx, proc->nr_slot_tx);
uint8_t gNB_id = 0; uint8_t gNB_id = 0;
LOG_D(PHY,"%d.%d => slot type %d\n",proc->frame_tx,proc->nr_slot_tx,tx_slot_type); LOG_D(PHY,"processSlotTX %d.%d => slot type %d\n",proc->frame_tx,proc->nr_slot_tx,tx_slot_type);
if (tx_slot_type == NR_UPLINK_SLOT || tx_slot_type == NR_MIXED_SLOT){ if (tx_slot_type == NR_UPLINK_SLOT || tx_slot_type == NR_MIXED_SLOT){
// trigger L2 to run ue_scheduler thru IF module // trigger L2 to run ue_scheduler thru IF module
...@@ -372,7 +372,8 @@ void processSlotRX(void *arg) { ...@@ -372,7 +372,8 @@ void processSlotRX(void *arg) {
LOG_D(PHY, "Sending Uplink data \n"); LOG_D(PHY, "Sending Uplink data \n");
nr_ue_pusch_common_procedures(UE, nr_ue_pusch_common_procedures(UE,
proc->nr_slot_tx, proc->nr_slot_tx,
&UE->frame_parms,1); &UE->frame_parms,
UE->frame_parms.nb_antennas_tx);
} }
if (UE->UE_mode[gNB_id] > NOT_SYNCHED && UE->UE_mode[gNB_id] < PUSCH) { if (UE->UE_mode[gNB_id] > NOT_SYNCHED && UE->UE_mode[gNB_id] < PUSCH) {
......
...@@ -465,8 +465,11 @@ int main( int argc, char **argv ) { ...@@ -465,8 +465,11 @@ int main( int argc, char **argv ) {
memset(UE[CC_id],0,sizeof(PHY_VARS_NR_UE)); memset(UE[CC_id],0,sizeof(PHY_VARS_NR_UE));
set_options(CC_id, UE[CC_id]); set_options(CC_id, UE[CC_id]);
NR_UE_MAC_INST_t *mac = get_mac_inst(0); NR_DL_FRAME_PARMS *fp = &UE[CC_id]->frame_parms;
NR_UE_MAC_INST_t *mac = get_mac_inst(0);
mac->phy_config.config_req.carrier_config.num_tx_ant = fp->nb_antennas_tx;
if (get_softmodem_params()->sa) { if (get_softmodem_params()->sa) {
uint16_t nr_band = get_band(downlink_frequency[CC_id][0],uplink_frequency_offset[CC_id][0]); uint16_t nr_band = get_band(downlink_frequency[CC_id][0],uplink_frequency_offset[CC_id][0]);
mac->nr_band = nr_band; mac->nr_band = nr_band;
......
...@@ -298,9 +298,10 @@ typedef struct ...@@ -298,9 +298,10 @@ typedef struct
uint8_t qam_mod_order; uint8_t qam_mod_order;
uint8_t mcs_index; uint8_t mcs_index;
uint8_t mcs_table; uint8_t mcs_table;
uint8_t transform_precoding; uint8_t transformPrecoder;
uint16_t data_scrambling_id; uint16_t data_scrambling_id;
uint8_t nrOfLayers; uint8_t nrOfLayers;
uint8_t Tpmi;
//DMRS //DMRS
uint16_t ul_dmrs_symb_pos; uint16_t ul_dmrs_symb_pos;
uint8_t dmrs_config_type; uint8_t dmrs_config_type;
......
...@@ -1208,9 +1208,10 @@ typedef struct ...@@ -1208,9 +1208,10 @@ typedef struct
uint8_t qam_mod_order; uint8_t qam_mod_order;
uint8_t mcs_index; uint8_t mcs_index;
uint8_t mcs_table; uint8_t mcs_table;
uint8_t transform_precoding; uint8_t transformPrecoder;
uint16_t data_scrambling_id; uint16_t data_scrambling_id;
uint8_t nrOfLayers; uint8_t nrOfLayers;
uint8_t Tpmi;
//DMRS //DMRS
uint16_t ul_dmrs_symb_pos; uint16_t ul_dmrs_symb_pos;
uint8_t dmrs_config_type; uint8_t dmrs_config_type;
......
...@@ -941,9 +941,10 @@ static uint8_t pack_ul_tti_request_pusch_pdu(nfapi_nr_pusch_pdu_t *pusch_pdu, ui ...@@ -941,9 +941,10 @@ static uint8_t pack_ul_tti_request_pusch_pdu(nfapi_nr_pusch_pdu_t *pusch_pdu, ui
push8(pusch_pdu->qam_mod_order, ppWritePackedMsg, end) && push8(pusch_pdu->qam_mod_order, ppWritePackedMsg, end) &&
push8(pusch_pdu->mcs_index, ppWritePackedMsg, end) && push8(pusch_pdu->mcs_index, ppWritePackedMsg, end) &&
push8(pusch_pdu->mcs_table, ppWritePackedMsg, end) && push8(pusch_pdu->mcs_table, ppWritePackedMsg, end) &&
push8(pusch_pdu->transform_precoding, ppWritePackedMsg, end) && push8(pusch_pdu->transformPrecoder, ppWritePackedMsg, end) &&
push16(pusch_pdu->data_scrambling_id, ppWritePackedMsg, end) && push16(pusch_pdu->data_scrambling_id, ppWritePackedMsg, end) &&
push8(pusch_pdu->nrOfLayers, ppWritePackedMsg, end) && push8(pusch_pdu->nrOfLayers, ppWritePackedMsg, end) &&
push8(pusch_pdu->Tpmi, ppWritePackedMsg, end) &&
push16(pusch_pdu->ul_dmrs_symb_pos, ppWritePackedMsg, end) && push16(pusch_pdu->ul_dmrs_symb_pos, ppWritePackedMsg, end) &&
push8(pusch_pdu->dmrs_config_type, ppWritePackedMsg, end) && push8(pusch_pdu->dmrs_config_type, ppWritePackedMsg, end) &&
push16(pusch_pdu->ul_dmrs_scrambling_id, ppWritePackedMsg, end) && push16(pusch_pdu->ul_dmrs_scrambling_id, ppWritePackedMsg, end) &&
...@@ -4445,9 +4446,10 @@ static uint8_t unpack_ul_tti_request_pusch_pdu(void *tlv, uint8_t **ppReadPacked ...@@ -4445,9 +4446,10 @@ static uint8_t unpack_ul_tti_request_pusch_pdu(void *tlv, uint8_t **ppReadPacked
pull8(ppReadPackedMsg, &pusch_pdu->qam_mod_order, end) && pull8(ppReadPackedMsg, &pusch_pdu->qam_mod_order, end) &&
pull8(ppReadPackedMsg, &pusch_pdu->mcs_index, end) && pull8(ppReadPackedMsg, &pusch_pdu->mcs_index, end) &&
pull8(ppReadPackedMsg, &pusch_pdu->mcs_table, end) && pull8(ppReadPackedMsg, &pusch_pdu->mcs_table, end) &&
pull8(ppReadPackedMsg, &pusch_pdu->transform_precoding, end) && pull8(ppReadPackedMsg, &pusch_pdu->transformPrecoder, end) &&
pull16(ppReadPackedMsg, &pusch_pdu->data_scrambling_id, end) && pull16(ppReadPackedMsg, &pusch_pdu->data_scrambling_id, end) &&
pull8(ppReadPackedMsg, &pusch_pdu->nrOfLayers, end) && pull8(ppReadPackedMsg, &pusch_pdu->nrOfLayers, end) &&
pull8(ppReadPackedMsg, &pusch_pdu->Tpmi, end) &&
pull16(ppReadPackedMsg, &pusch_pdu->ul_dmrs_symb_pos, end) && pull16(ppReadPackedMsg, &pusch_pdu->ul_dmrs_symb_pos, end) &&
pull8(ppReadPackedMsg, &pusch_pdu->dmrs_config_type, end) && pull8(ppReadPackedMsg, &pusch_pdu->dmrs_config_type, end) &&
pull16(ppReadPackedMsg, &pusch_pdu->ul_dmrs_scrambling_id, end) && pull16(ppReadPackedMsg, &pusch_pdu->ul_dmrs_scrambling_id, end) &&
......
...@@ -276,11 +276,21 @@ int phy_init_nr_gNB(PHY_VARS_gNB *gNB, ...@@ -276,11 +276,21 @@ int phy_init_nr_gNB(PHY_VARS_gNB *gNB,
pusch_vars[ULSCH_id]->ul_ch_magb0 = (int32_t **)malloc16(n_buf*sizeof(int32_t *) ); pusch_vars[ULSCH_id]->ul_ch_magb0 = (int32_t **)malloc16(n_buf*sizeof(int32_t *) );
pusch_vars[ULSCH_id]->ul_ch_mag = (int32_t **)malloc16(n_buf*sizeof(int32_t *) ); pusch_vars[ULSCH_id]->ul_ch_mag = (int32_t **)malloc16(n_buf*sizeof(int32_t *) );
pusch_vars[ULSCH_id]->ul_ch_magb = (int32_t **)malloc16(n_buf*sizeof(int32_t *) ); pusch_vars[ULSCH_id]->ul_ch_magb = (int32_t **)malloc16(n_buf*sizeof(int32_t *) );
pusch_vars[ULSCH_id]->rho = (int32_t **)malloc16_clear(n_buf*sizeof(int32_t*) ); pusch_vars[ULSCH_id]->rho = (int32_t ***)malloc16_clear(Prx*sizeof(int32_t**) );
pusch_vars[ULSCH_id]->llr_layers = (int16_t **)malloc16(max_ul_mimo_layers*sizeof(int32_t *) );
for (i=0; i<Prx; i++) { for (i=0; i<Prx; i++) {
pusch_vars[ULSCH_id]->rxdataF_ext[i] = (int32_t *)malloc16_clear( sizeof(int32_t)*N_RB_UL*12*fp->symbols_per_slot ); pusch_vars[ULSCH_id]->rxdataF_ext[i] = (int32_t *)malloc16_clear( sizeof(int32_t)*N_RB_UL*12*fp->symbols_per_slot );
pusch_vars[ULSCH_id]->rxdataF_ext2[i] = (int32_t *)malloc16_clear( sizeof(int32_t)*N_RB_UL*12*fp->symbols_per_slot ); pusch_vars[ULSCH_id]->rxdataF_ext2[i] = (int32_t *)malloc16_clear( sizeof(int32_t)*N_RB_UL*12*fp->symbols_per_slot );
pusch_vars[ULSCH_id]->rho[i] = (int32_t **)malloc16_clear( NR_MAX_NB_LAYERS*NR_MAX_NB_LAYERS*sizeof(int32_t*));
for (int j=0; j< max_ul_mimo_layers; j++)
{
for (int k=0; k<max_ul_mimo_layers; k++)
{
pusch_vars[ULSCH_id]->rho[i][j*max_ul_mimo_layers+k]=(int32_t *)malloc16_clear( sizeof(int32_t) * fp->N_RB_UL*12*7*2 );
}
}
} }
for (i=0; i<n_buf; i++) { for (i=0; i<n_buf; i++) {
pusch_vars[ULSCH_id]->ul_ch_estimates[i] = (int32_t *)malloc16_clear( sizeof(int32_t)*fp->ofdm_symbol_size*2*fp->symbols_per_slot ); pusch_vars[ULSCH_id]->ul_ch_estimates[i] = (int32_t *)malloc16_clear( sizeof(int32_t)*fp->ofdm_symbol_size*2*fp->symbols_per_slot );
...@@ -293,8 +303,12 @@ int phy_init_nr_gNB(PHY_VARS_gNB *gNB, ...@@ -293,8 +303,12 @@ int phy_init_nr_gNB(PHY_VARS_gNB *gNB,
pusch_vars[ULSCH_id]->ul_ch_mag0[i] = (int32_t *)malloc16_clear( fp->symbols_per_slot*sizeof(int32_t)*N_RB_UL*12 ); pusch_vars[ULSCH_id]->ul_ch_mag0[i] = (int32_t *)malloc16_clear( fp->symbols_per_slot*sizeof(int32_t)*N_RB_UL*12 );
pusch_vars[ULSCH_id]->ul_ch_magb0[i] = (int32_t *)malloc16_clear( fp->symbols_per_slot*sizeof(int32_t)*N_RB_UL*12 ); pusch_vars[ULSCH_id]->ul_ch_magb0[i] = (int32_t *)malloc16_clear( fp->symbols_per_slot*sizeof(int32_t)*N_RB_UL*12 );
pusch_vars[ULSCH_id]->ul_ch_mag[i] = (int32_t *)malloc16_clear( fp->symbols_per_slot*sizeof(int32_t)*N_RB_UL*12 ); pusch_vars[ULSCH_id]->ul_ch_mag[i] = (int32_t *)malloc16_clear( fp->symbols_per_slot*sizeof(int32_t)*N_RB_UL*12 );
pusch_vars[ULSCH_id]->ul_ch_magb[i] = (int32_t *)malloc16_clear( fp->symbols_per_slot*sizeof(int32_t)*N_RB_UL*12 ); pusch_vars[ULSCH_id]->ul_ch_magb[i] = (int32_t *)malloc16_clear( fp->symbols_per_slot*sizeof(int32_t)*N_RB_UL*12 );
pusch_vars[ULSCH_id]->rho[i] = (int32_t *)malloc16_clear( sizeof(int32_t)*(fp->N_RB_UL*12*7*2) ); }
for (i=0; i< max_ul_mimo_layers; i++)
{
pusch_vars[ULSCH_id]->llr_layers[i] = (int16_t *)malloc16_clear( (8*((3*8*6144)+12))*sizeof(int16_t) ); // [hna] 6144 is LTE and (8*((3*8*6144)+12)) is not clear
} }
pusch_vars[ULSCH_id]->llr = (int16_t *)malloc16_clear( (8*((3*8*6144)+12))*sizeof(int16_t) ); // [hna] 6144 is LTE and (8*((3*8*6144)+12)) is not clear pusch_vars[ULSCH_id]->llr = (int16_t *)malloc16_clear( (8*((3*8*6144)+12))*sizeof(int16_t) ); // [hna] 6144 is LTE and (8*((3*8*6144)+12)) is not clear
pusch_vars[ULSCH_id]->ul_valid_re_per_slot = (int16_t *)malloc16_clear( sizeof(int16_t)*fp->symbols_per_slot); pusch_vars[ULSCH_id]->ul_valid_re_per_slot = (int16_t *)malloc16_clear( sizeof(int16_t)*fp->symbols_per_slot);
......
...@@ -41,7 +41,7 @@ int nr_phy_init_RU(RU_t *ru) { ...@@ -41,7 +41,7 @@ int nr_phy_init_RU(RU_t *ru) {
int p; int p;
int re; int re;
LOG_I(PHY,"Initializing RU signal buffers (if_south %s) nb_tx %d\n",ru_if_types[ru->if_south],ru->nb_tx); LOG_I(PHY,"Initializing RU signal buffers (if_south %s) nb_tx %d, nb_rx %d\n",ru_if_types[ru->if_south],ru->nb_tx, ru->nb_rx);
nfapi_nr_config_request_scf_t *cfg; nfapi_nr_config_request_scf_t *cfg;
ru->nb_log_antennas=0; ru->nb_log_antennas=0;
......
...@@ -124,7 +124,8 @@ void phy_init_nr_ue_PUSCH(NR_UE_PUSCH *const pusch, ...@@ -124,7 +124,8 @@ void phy_init_nr_ue_PUSCH(NR_UE_PUSCH *const pusch,
AssertFatal( pusch, "pusch==0" ); AssertFatal( pusch, "pusch==0" );
for (int i=0; i<NR_MAX_NB_LAYERS; i++) { for (int i=0; i<NR_MAX_NB_LAYERS; i++) {
pusch->txdataF_layers[i] = (int32_t *)malloc16_clear(NR_MAX_PUSCH_ENCODED_LENGTH*sizeof(int32_t)); pusch->txdataF_layers[i] = (int32_t *)malloc16_clear((NR_MAX_PUSCH_ENCODED_LENGTH)*sizeof(int32_t *));
pusch->txdataF_precoding[i] = (int32_t *)malloc16_clear((NR_MAX_PUSCH_ENCODED_LENGTH)*sizeof(int32_t *));
} }
} }
...@@ -143,7 +144,7 @@ int init_nr_ue_signal(PHY_VARS_NR_UE *ue, ...@@ -143,7 +144,7 @@ int init_nr_ue_signal(PHY_VARS_NR_UE *ue,
uint16_t N_n_scid[2] = {0,1}; // [HOTFIX] This is a temporary implementation of scramblingID0 and scramblingID1 which are given by DMRS-UplinkConfig uint16_t N_n_scid[2] = {0,1}; // [HOTFIX] This is a temporary implementation of scramblingID0 and scramblingID1 which are given by DMRS-UplinkConfig
int n_scid; int n_scid;
abstraction_flag = 0; abstraction_flag = 0;
LOG_I(PHY, "Initializing UE vars (abstraction %u) for gNB TXant %u, UE RXant %u\n", abstraction_flag, fp->nb_antennas_tx, fp->nb_antennas_rx); LOG_I(PHY, "Initializing UE vars (abstraction %u) for UE TXant %u, UE RXant %u\n", abstraction_flag, fp->nb_antennas_tx, fp->nb_antennas_rx);
//LOG_D(PHY,"[MSC_NEW][FRAME 00000][PHY_UE][MOD %02u][]\n", ue->Mod_id+NB_gNB_INST); //LOG_D(PHY,"[MSC_NEW][FRAME 00000][PHY_UE][MOD %02u][]\n", ue->Mod_id+NB_gNB_INST);
phy_init_nr_top(ue); phy_init_nr_top(ue);
// many memory allocation sizes are hard coded // many memory allocation sizes are hard coded
......
...@@ -110,7 +110,7 @@ int nr_pusch_channel_estimation(PHY_VARS_gNB *gNB, ...@@ -110,7 +110,7 @@ int nr_pusch_channel_estimation(PHY_VARS_gNB *gNB,
fr = filt8_r1; fr = filt8_r1;
fmm = filt8_mm1; fmm = filt8_mm1;
fml = filt8_ml1; fml = filt8_ml1;
fmr = filt8_m1; fmr = filt8_mm1;
fdcl = filt8_dcl1; fdcl = filt8_dcl1;
fdcr = filt8_dcr1; fdcr = filt8_dcr1;
fdclh = filt8_dcl1_h; fdclh = filt8_dcl1_h;
...@@ -129,9 +129,8 @@ int nr_pusch_channel_estimation(PHY_VARS_gNB *gNB, ...@@ -129,9 +129,8 @@ int nr_pusch_channel_estimation(PHY_VARS_gNB *gNB,
//------------------generate DMRS------------------// //------------------generate DMRS------------------//
// transform precoding = 1 means disabled if (pusch_pdu->transformPrecoder == transformPrecoder_disabled) {
if (pusch_pdu->transform_precoding == 1) { nr_pusch_dmrs_rx(gNB, Ns, gNB->nr_gold_pusch_dmrs[pusch_pdu->scid][Ns][symbol], &pilot[0], (1000+p), 0, nb_rb_pusch,
nr_pusch_dmrs_rx(gNB, Ns, gNB->nr_gold_pusch_dmrs[pusch_pdu->scid][Ns][symbol], &pilot[0], 1000, 0, nb_rb_pusch,
(pusch_pdu->bwp_start + pusch_pdu->rb_start)*NR_NB_SC_PER_RB, pusch_pdu->dmrs_config_type); (pusch_pdu->bwp_start + pusch_pdu->rb_start)*NR_NB_SC_PER_RB, pusch_pdu->dmrs_config_type);
} }
else { // if transform precoding or SC-FDMA is enabled in Uplink else { // if transform precoding or SC-FDMA is enabled in Uplink
...@@ -291,7 +290,7 @@ int nr_pusch_channel_estimation(PHY_VARS_gNB *gNB, ...@@ -291,7 +290,7 @@ int nr_pusch_channel_estimation(PHY_VARS_gNB *gNB,
printf("pilot %u : rxF - > (%d,%d) (%d) ch -> (%d,%d) (%d), pil -> (%d,%d) \n",pilot_cnt,rxF[0],rxF[1],dBc(rxF[0],rxF[1]),ch[0],ch[1],dBc(ch[0],ch[1]),pil[0],pil[1]); printf("pilot %u : rxF - > (%d,%d) (%d) ch -> (%d,%d) (%d), pil -> (%d,%d) \n",pilot_cnt,rxF[0],rxF[1],dBc(rxF[0],rxF[1]),ch[0],ch[1],dBc(ch[0],ch[1]),pil[0],pil[1]);
printf("data %u : rxF - > (%d,%d) (%d)\n",pilot_cnt,rxF[2],rxF[3],dBc(rxF[2],rxF[3])); printf("data %u : rxF - > (%d,%d) (%d)\n",pilot_cnt,rxF[2],rxF[3],dBc(rxF[2],rxF[3]));
#endif #endif
multadd_real_vector_complex_scalar(fml, multadd_real_vector_complex_scalar(fm,
ch, ch,
ul_ch, ul_ch,
8); 8);
......
...@@ -137,21 +137,22 @@ int nr_rx_pusch(PHY_VARS_gNB *gNB, ...@@ -137,21 +137,22 @@ int nr_rx_pusch(PHY_VARS_gNB *gNB,
@param nb_rb_pusch The number of RBs allocated (used for Resource Allocation Type 1 in NR) @param nb_rb_pusch The number of RBs allocated (used for Resource Allocation Type 1 in NR)
@param frame_parms, Pointer to frame descriptor structure @param frame_parms, Pointer to frame descriptor structure
*/ */
void nr_ulsch_extract_rbs_single(int32_t **rxdataF, void nr_ulsch_extract_rbs(int32_t **rxdataF,
NR_gNB_PUSCH *pusch_vars, NR_gNB_PUSCH *pusch_vars,
int slot, int slot,
unsigned char symbol, unsigned char symbol,
uint8_t is_dmrs_symbol, uint8_t is_dmrs_symbol,
nfapi_nr_pusch_pdu_t *pusch_pdu, nfapi_nr_pusch_pdu_t *pusch_pdu,
NR_DL_FRAME_PARMS *frame_parms); NR_DL_FRAME_PARMS *frame_parms);
void nr_ulsch_scale_channel(int32_t **ul_ch_estimates_ext, void nr_ulsch_scale_channel(int32_t **ul_ch_estimates_ext,
NR_DL_FRAME_PARMS *frame_parms, NR_DL_FRAME_PARMS *frame_parms,
NR_gNB_ULSCH_t **ulsch_gNB, NR_gNB_ULSCH_t **ulsch_gNB,
uint8_t symbol, uint8_t symbol,
uint8_t start_symbol, uint8_t is_dmrs_symbol,
uint16_t nb_rb, uint32_t len,
pusch_dmrs_type_t pusch_dmrs_type); uint8_t nrOfLayers,
uint16_t nb_rb);
/** \brief This function computes the average channel level over all allocated RBs and antennas (TX/RX) in order to compute output shift for compensated signal /** \brief This function computes the average channel level over all allocated RBs and antennas (TX/RX) in order to compute output shift for compensated signal
@param ul_ch_estimates_ext Channel estimates in allocated RBs @param ul_ch_estimates_ext Channel estimates in allocated RBs
...@@ -185,9 +186,10 @@ void nr_ulsch_channel_compensation(int **rxdataF_ext, ...@@ -185,9 +186,10 @@ void nr_ulsch_channel_compensation(int **rxdataF_ext,
int **ul_ch_mag, int **ul_ch_mag,
int **ul_ch_magb, int **ul_ch_magb,
int **rxdataF_comp, int **rxdataF_comp,
int **rho, int ***rho,
NR_DL_FRAME_PARMS *frame_parms, NR_DL_FRAME_PARMS *frame_parms,
unsigned char symbol, unsigned char symbol,
int length,
uint8_t is_dmrs_symbol, uint8_t is_dmrs_symbol,
unsigned char mod_order, unsigned char mod_order,
uint8_t nrOfLayers, uint8_t nrOfLayers,
...@@ -255,8 +257,8 @@ void nr_ulsch_64qam_llr(int32_t *rxdataF_comp, ...@@ -255,8 +257,8 @@ void nr_ulsch_64qam_llr(int32_t *rxdataF_comp,
@param mod_order modulation order @param mod_order modulation order
*/ */
void nr_ulsch_compute_llr(int32_t *rxdataF_comp, void nr_ulsch_compute_llr(int32_t *rxdataF_comp,
int32_t **ul_ch_mag, int32_t *ul_ch_mag,
int32_t **ul_ch_magb, int32_t *ul_ch_magb,
int16_t *ulsch_llr, int16_t *ulsch_llr,
uint32_t nb_rb, uint32_t nb_rb,
uint32_t nb_re, uint32_t nb_re,
......
...@@ -137,6 +137,38 @@ void nr_ulsch_unscrambling_optim(int16_t* llr, ...@@ -137,6 +137,38 @@ void nr_ulsch_unscrambling_optim(int16_t* llr,
#endif #endif
} }
void nr_ulsch_layer_demapping(int16_t *llr_cw,
uint8_t Nl,
uint8_t mod_order,
uint32_t length,
int16_t **llr_layers)
{
switch (Nl) {
case 1:
memcpy((void*)llr_cw, (void*)llr_layers[0], (length)*sizeof(int16_t));
break;
case 2:
case 3:
case 4:
for (int i=0; i<(length/Nl/mod_order); i++)
{
for (int l=0; l<Nl; l++)
{
for (int m=0; m<mod_order; m++){
llr_cw[i*Nl*mod_order+l*mod_order+m] = llr_layers[l][i*mod_order+m];
}
}
}
break;
default:
AssertFatal(0, "Not supported number of layers %d\n", Nl);
}
}
void dump_pusch_stats(FILE *fd,PHY_VARS_gNB *gNB) { void dump_pusch_stats(FILE *fd,PHY_VARS_gNB *gNB) {
for (int i=0;i<gNB->number_of_nr_ulsch_max;i++) { for (int i=0;i<gNB->number_of_nr_ulsch_max;i++) {
......
...@@ -82,6 +82,12 @@ void nr_ulsch_unscrambling_optim(int16_t* llr, ...@@ -82,6 +82,12 @@ void nr_ulsch_unscrambling_optim(int16_t* llr,
uint32_t Nid, uint32_t Nid,
uint32_t n_RNTI); uint32_t n_RNTI);
void nr_ulsch_layer_demapping(int16_t *llr_cw,
uint8_t Nl,
uint8_t mod_order,
uint32_t length,
int16_t **llr_layers);
void nr_ulsch_procedures(PHY_VARS_gNB *gNB, void nr_ulsch_procedures(PHY_VARS_gNB *gNB,
int frame_rx, int frame_rx,
int slot_rx, int slot_rx,
......
...@@ -64,7 +64,7 @@ void nr_ulsch_qpsk_llr(int32_t *rxdataF_comp, ...@@ -64,7 +64,7 @@ void nr_ulsch_qpsk_llr(int32_t *rxdataF_comp,
//---------------------------------------------------------------------------------------------- //----------------------------------------------------------------------------------------------
void nr_ulsch_16qam_llr(int32_t *rxdataF_comp, void nr_ulsch_16qam_llr(int32_t *rxdataF_comp,
int32_t **ul_ch_mag, int32_t *ul_ch_mag,
int16_t *ulsch_llr, int16_t *ulsch_llr,
uint32_t nb_rb, uint32_t nb_rb,
uint32_t nb_re, uint32_t nb_re,
...@@ -110,12 +110,12 @@ void nr_ulsch_16qam_llr(int32_t *rxdataF_comp, ...@@ -110,12 +110,12 @@ void nr_ulsch_16qam_llr(int32_t *rxdataF_comp,
#if defined(__x86_64__) || defined(__i386__) #if defined(__x86_64__) || defined(__i386__)
#ifdef __AVX2__ #ifdef __AVX2__
ch_mag = (__m256i*)&ul_ch_mag[0][(symbol*(off+(nb_rb*12)))]; ch_mag = (__m256i*)&ul_ch_mag[(symbol*(off+(nb_rb*12)))];
#else #else
ch_mag = (__m128i*)&ul_ch_mag[0][(symbol*(off+(nb_rb*12)))]; ch_mag = (__m128i*)&ul_ch_mag[(symbol*(off+(nb_rb*12)))];
#endif #endif
#elif defined(__arm__) #elif defined(__arm__)
ch_mag = (int16x8_t*)&ul_ch_mag[0][(symbol*nb_rb*12)]; ch_mag = (int16x8_t*)&ul_ch_mag[(symbol*nb_rb*12)];
#endif #endif
#ifdef __AVX2__ #ifdef __AVX2__
...@@ -231,8 +231,8 @@ void nr_ulsch_16qam_llr(int32_t *rxdataF_comp, ...@@ -231,8 +231,8 @@ void nr_ulsch_16qam_llr(int32_t *rxdataF_comp,
//---------------------------------------------------------------------------------------------- //----------------------------------------------------------------------------------------------
void nr_ulsch_64qam_llr(int32_t *rxdataF_comp, void nr_ulsch_64qam_llr(int32_t *rxdataF_comp,
int32_t **ul_ch_mag, int32_t *ul_ch_mag,
int32_t **ul_ch_magb, int32_t *ul_ch_magb,
int16_t *ulsch_llr, int16_t *ulsch_llr,
uint32_t nb_rb, uint32_t nb_rb,
uint32_t nb_re, uint32_t nb_re,
...@@ -265,15 +265,15 @@ void nr_ulsch_64qam_llr(int32_t *rxdataF_comp, ...@@ -265,15 +265,15 @@ void nr_ulsch_64qam_llr(int32_t *rxdataF_comp,
#if defined(__x86_64__) || defined(__i386__) #if defined(__x86_64__) || defined(__i386__)
#ifdef __AVX2__ #ifdef __AVX2__
ch_mag = (__m256i*)&ul_ch_mag[0][(symbol*(off+(nb_rb*12)))]; ch_mag = (__m256i*)&ul_ch_mag[(symbol*(off+(nb_rb*12)))];
ch_magb = (__m256i*)&ul_ch_magb[0][(symbol*(off+(nb_rb*12)))]; ch_magb = (__m256i*)&ul_ch_magb[(symbol*(off+(nb_rb*12)))];
#else #else
ch_mag = (__m128i*)&ul_ch_mag[0][(symbol*nb_rb*12)]; ch_mag = (__m128i*)&ul_ch_mag[(symbol*nb_rb*12)];
ch_magb = (__m128i*)&ul_ch_magb[0][(symbol*nb_rb*12)]; ch_magb = (__m128i*)&ul_ch_magb[(symbol*nb_rb*12)];
#endif #endif
#elif defined(__arm__) #elif defined(__arm__)
ch_mag = (int16x8_t*)&ul_ch_mag[0][(symbol*nb_rb*12)]; ch_mag = (int16x8_t*)&ul_ch_mag[(symbol*nb_rb*12)];
ch_magb = (int16x8_t*)&ul_ch_magb[0][(symbol*nb_rb*12)]; ch_magb = (int16x8_t*)&ul_ch_magb[(symbol*nb_rb*12)];
#endif #endif
#ifdef __AVX2__ #ifdef __AVX2__
...@@ -471,8 +471,8 @@ void nr_ulsch_64qam_llr(int32_t *rxdataF_comp, ...@@ -471,8 +471,8 @@ void nr_ulsch_64qam_llr(int32_t *rxdataF_comp,
void nr_ulsch_compute_llr(int32_t *rxdataF_comp, void nr_ulsch_compute_llr(int32_t *rxdataF_comp,
int32_t **ul_ch_mag, int32_t *ul_ch_mag,
int32_t **ul_ch_magb, int32_t *ul_ch_magb,
int16_t *ulsch_llr, int16_t *ulsch_llr,
uint32_t nb_rb, uint32_t nb_rb,
uint32_t nb_re, uint32_t nb_re,
......
...@@ -148,7 +148,7 @@ short filt8_dcr0_h[8]= { ...@@ -148,7 +148,7 @@ short filt8_dcr0_h[8]= {
0,4096,8192,12288,16384,0,0,0}; 0,4096,8192,12288,16384,0,0,0};
short filt8_l1[8] = { short filt8_l1[8] = {
24576,16384,0,0,0,0,0,0}; 24576,16384,8192,0,0,0,0,0};
short filt8_ml1[8] = { short filt8_ml1[8] = {
-8192,0,8192,16384,8192,0,0,0}; -8192,0,8192,16384,8192,0,0,0};
...@@ -163,10 +163,10 @@ short filt8_mm1[8]= { ...@@ -163,10 +163,10 @@ short filt8_mm1[8]= {
0,0,0,0,8192,16384,8192,0}; 0,0,0,0,8192,16384,8192,0};
short filt8_dcl1[8]= { short filt8_dcl1[8]= {
0,0,0,16384,12288,8192,4096,0}; 0,0,16384,12288,8192,4096,0,0};
short filt8_dcr1[8]= { short filt8_dcr1[8]= {
0,0,0,0,4096,8192,12288,16384}; 0,0,0,4096,8192,12288,16384,0};
short filt8_dcl1_h[8]= { short filt8_dcl1_h[8]= {
0,16384,12288,8192,4096,0,0,0}; 0,16384,12288,8192,4096,0,0,0};
......
...@@ -258,6 +258,15 @@ int nr_ulsch_encoding(PHY_VARS_NR_UE *ue, ...@@ -258,6 +258,15 @@ int nr_ulsch_encoding(PHY_VARS_NR_UE *ue,
Ilbrm = 0; Ilbrm = 0;
Tbslbrm = 950984; //max tbs Tbslbrm = 950984; //max tbs
Coderate = 0.0; Coderate = 0.0;
#if 0
harq_process->a[0] = 0x31;
for (int i = 1; i < harq_process->pusch_pdu.pusch_data.tb_size; i++)
{
harq_process->a[i] = (i&0xff);
}
#endif
trace_NRpdu(DIRECTION_UPLINK, harq_process->a, harq_process->pusch_pdu.pusch_data.tb_size, 0, WS_C_RNTI, 0, 0, 0,0, 0); trace_NRpdu(DIRECTION_UPLINK, harq_process->a, harq_process->pusch_pdu.pusch_data.tb_size, 0, WS_C_RNTI, 0, 0, 0,0, 0);
/////////// ///////////
///////////////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////////////
......
This diff is collapsed.
...@@ -479,7 +479,7 @@ typedef struct { ...@@ -479,7 +479,7 @@ typedef struct {
/// \brief Cross-correlation of two UE signals. /// \brief Cross-correlation of two UE signals.
/// - first index: rx antenna [0..nb_antennas_rx[ /// - first index: rx antenna [0..nb_antennas_rx[
/// - second index: symbol [0..] /// - second index: symbol [0..]
int32_t **rho; int32_t ***rho;
/// \f$\log_2(\max|H_i|^2)\f$ /// \f$\log_2(\max|H_i|^2)\f$
int16_t log2_maxh; int16_t log2_maxh;
/// \brief Magnitude of Uplink Channel first layer (16QAM level/First 64QAM level). /// \brief Magnitude of Uplink Channel first layer (16QAM level/First 64QAM level).
...@@ -509,6 +509,10 @@ typedef struct { ...@@ -509,6 +509,10 @@ typedef struct {
/// \brief llr values. /// \brief llr values.
/// - first index: ? [0..1179743] (hard coded) /// - first index: ? [0..1179743] (hard coded)
int16_t *llr; int16_t *llr;
/// \brief llr values per layer.
/// - first index: ? [0..3] (hard coded)
/// - first index: ? [0..1179743] (hard coded)
int16_t **llr_layers;
/// DMRS symbol index, to be updated every DMRS symbol within a slot. /// DMRS symbol index, to be updated every DMRS symbol within a slot.
uint8_t dmrs_symbol; uint8_t dmrs_symbol;
// PTRS symbol index, to be updated every PTRS symbol within a slot. // PTRS symbol index, to be updated every PTRS symbol within a slot.
......
...@@ -229,6 +229,9 @@ typedef struct { ...@@ -229,6 +229,9 @@ typedef struct {
typedef struct { typedef struct {
/// TX buffers for multiple layers /// TX buffers for multiple layers
int32_t *txdataF_layers[NR_MAX_NB_LAYERS]; int32_t *txdataF_layers[NR_MAX_NB_LAYERS];
/// TX buffers for UE-spec transmission
int32_t *txdataF_precoding[NR_MAX_NB_LAYERS];
} NR_UE_PUSCH; } NR_UE_PUSCH;
typedef struct { typedef struct {
......
...@@ -93,7 +93,7 @@ ...@@ -93,7 +93,7 @@
#define NR_MAX_CSET_DURATION 3 #define NR_MAX_CSET_DURATION 3
#define NR_MAX_NB_RBG 18 #define NR_MAX_NB_RBG 18
#define NR_MAX_NB_LAYERS 2 // 8 // SU-MIMO (3GPP TS 38.211 V15.4.0 section 7.3.1.3) #define NR_MAX_NB_LAYERS 4 // 8 // SU-MIMO (3GPP TS 38.211 V15.4.0 section 7.3.1.3)
#define NR_MAX_NB_CODEWORDS 2 #define NR_MAX_NB_CODEWORDS 2
#define NR_MAX_NB_HARQ_PROCESSES 16 #define NR_MAX_NB_HARQ_PROCESSES 16
#define NR_MAX_PDSCH_ENCODED_LENGTH (NR_MAX_NB_RB*NR_SYMBOLS_PER_SLOT*NR_NB_SC_PER_RB*8*NR_MAX_NB_LAYERS) // 8 is the maximum modulation order (it was 950984 before !!) #define NR_MAX_PDSCH_ENCODED_LENGTH (NR_MAX_NB_RB*NR_SYMBOLS_PER_SLOT*NR_NB_SC_PER_RB*8*NR_MAX_NB_LAYERS) // 8 is the maximum modulation order (it was 950984 before !!)
...@@ -104,11 +104,11 @@ ...@@ -104,11 +104,11 @@
#define MAX_NUM_NR_DLSCH_SEGMENTS (NR_MAX_NB_LAYERS*34) #define MAX_NUM_NR_DLSCH_SEGMENTS (NR_MAX_NB_LAYERS*34)
#define MAX_NR_DLSCH_PAYLOAD_BYTES (MAX_NUM_NR_DLSCH_SEGMENTS*1056) #define MAX_NR_DLSCH_PAYLOAD_BYTES (MAX_NUM_NR_DLSCH_SEGMENTS*1056)
#define MAX_NUM_NR_ULSCH_SEGMENTS 34 #define MAX_NUM_NR_ULSCH_SEGMENTS (NR_MAX_NB_LAYERS*34)
#define MAX_NR_ULSCH_PAYLOAD_BYTES (MAX_NUM_NR_ULSCH_SEGMENTS*1056) #define MAX_NR_ULSCH_PAYLOAD_BYTES (MAX_NUM_NR_ULSCH_SEGMENTS*1056)
#define MAX_NUM_NR_CHANNEL_BITS (14*273*12*8) // 14 symbols, 273 RB #define MAX_NUM_NR_CHANNEL_BITS (4*14*273*12*8) // 14 symbols, 273 RB
#define MAX_NUM_NR_RE (14*273*12) #define MAX_NUM_NR_RE (4*14*273*12)
#define NR_RX_NB_TH 1 #define NR_RX_NB_TH 1
#define NR_NB_TH_SLOT 2 #define NR_NB_TH_SLOT 2
......
...@@ -526,7 +526,8 @@ void nr_fep0(RU_t *ru, int first_half) { ...@@ -526,7 +526,8 @@ void nr_fep0(RU_t *ru, int first_half) {
end_symbol = NR_SYMBOLS_PER_SLOT; end_symbol = NR_SYMBOLS_PER_SLOT;
} }
LOG_D(PHY,"In fep0 for slot = %d, first_half = %d, start_symbol = %d, end_symbol = %d\n", proc->tti_rx, first_half, start_symbol, end_symbol); LOG_D(PHY,"In fep0 for slot = %d, first_half = %d, start_symbol = %d, end_symbol = %d, nb_antennas_rx = %d,N_TA_offset = %d\n",
proc->tti_rx, first_half, start_symbol, end_symbol,fp->nb_antennas_rx,ru->N_TA_offset);
// printf("fep0: slot %d\n",slot); // printf("fep0: slot %d\n",slot);
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPRX+proc->tti_rx, 1); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPRX+proc->tti_rx, 1);
......
...@@ -253,13 +253,13 @@ void nr_postDecode(PHY_VARS_gNB *gNB, notifiedFIFO_elt_t *req) { ...@@ -253,13 +253,13 @@ void nr_postDecode(PHY_VARS_gNB *gNB, notifiedFIFO_elt_t *req) {
// if all segments are done // if all segments are done
if (rdata->nbSegments == ulsch_harq->processedSegments) { if (rdata->nbSegments == ulsch_harq->processedSegments) {
if (decodeSuccess) { if (decodeSuccess) {
LOG_D(PHY,"[gNB %d] ULSCH: Setting ACK for SFN/SF %d.%d (pid %d, ndi %d, status %d, round %d, TBS %d, Max interation (all seg) %d)\n", LOG_I(PHY,"[gNB %d] ULSCH: Setting ACK for SFN/SF %d.%d (pid %d, ndi %d, status %d, round %d, TBS %d, Max interation (all seg) %d)\n",
gNB->Mod_id,ulsch_harq->frame,ulsch_harq->slot,rdata->harq_pid,pusch_pdu->pusch_data.new_data_indicator,ulsch_harq->status,ulsch_harq->round,ulsch_harq->TBS,rdata->decodeIterations); gNB->Mod_id,ulsch_harq->frame,ulsch_harq->slot,rdata->harq_pid,pusch_pdu->pusch_data.new_data_indicator,ulsch_harq->status,ulsch_harq->round,ulsch_harq->TBS,rdata->decodeIterations);
ulsch_harq->status = SCH_IDLE; ulsch_harq->status = SCH_IDLE;
ulsch_harq->round = 0; ulsch_harq->round = 0;
ulsch->harq_mask &= ~(1 << rdata->harq_pid); ulsch->harq_mask &= ~(1 << rdata->harq_pid);
LOG_D(PHY, "ULSCH received ok \n"); LOG_I(PHY, "ULSCH received ok \n");
nr_fill_indication(gNB,ulsch_harq->frame, ulsch_harq->slot, rdata->ulsch_id, rdata->harq_pid, 0,0); nr_fill_indication(gNB,ulsch_harq->frame, ulsch_harq->slot, rdata->ulsch_id, rdata->harq_pid, 0,0);
//dumpsig=1; //dumpsig=1;
} else { } else {
...@@ -281,7 +281,7 @@ void nr_postDecode(PHY_VARS_gNB *gNB, notifiedFIFO_elt_t *req) { ...@@ -281,7 +281,7 @@ void nr_postDecode(PHY_VARS_gNB *gNB, notifiedFIFO_elt_t *req) {
} }
ulsch_harq->handled = 1; ulsch_harq->handled = 1;
LOG_D(PHY, "ULSCH %d in error\n",rdata->ulsch_id); LOG_I(PHY, "ULSCH %d in error\n",rdata->ulsch_id);
nr_fill_indication(gNB,ulsch_harq->frame, ulsch_harq->slot, rdata->ulsch_id, rdata->harq_pid, 1,0); nr_fill_indication(gNB,ulsch_harq->frame, ulsch_harq->slot, rdata->ulsch_id, rdata->harq_pid, 1,0);
} }
/* /*
...@@ -365,6 +365,14 @@ void nr_ulsch_procedures(PHY_VARS_gNB *gNB, int frame_rx, int slot_rx, int ULSCH ...@@ -365,6 +365,14 @@ void nr_ulsch_procedures(PHY_VARS_gNB *gNB, int frame_rx, int slot_rx, int ULSCH
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);
nr_ulsch_layer_demapping(gNB->pusch_vars[ULSCH_id]->llr,
pusch_pdu->nrOfLayers,
pusch_pdu->qam_mod_order,
G,
gNB->pusch_vars[ULSCH_id]->llr_layers);
//---------------------------------------------------------- //----------------------------------------------------------
//------------------- ULSCH unscrambling ------------------- //------------------- ULSCH unscrambling -------------------
//---------------------------------------------------------- //----------------------------------------------------------
...@@ -731,7 +739,7 @@ int phy_procedures_gNB_uespec_RX(PHY_VARS_gNB *gNB, int frame_rx, int slot_rx) { ...@@ -731,7 +739,7 @@ int phy_procedures_gNB_uespec_RX(PHY_VARS_gNB *gNB, int frame_rx, int slot_rx) {
(ulsch_harq->slot == slot_rx) && (ulsch_harq->slot == slot_rx) &&
(ulsch_harq->handled == 0)){ (ulsch_harq->handled == 0)){
LOG_D(PHY, "PUSCH detection started in frame %d slot %d\n", LOG_I(PHY, "PUSCH detection started in frame %d slot %d\n",
frame_rx,slot_rx); frame_rx,slot_rx);
int num_dmrs=0; int num_dmrs=0;
for (int s=0;s<NR_NUMBER_OF_SYMBOLS_PER_SLOT; s++) for (int s=0;s<NR_NUMBER_OF_SYMBOLS_PER_SLOT; s++)
...@@ -767,7 +775,7 @@ int phy_procedures_gNB_uespec_RX(PHY_VARS_gNB *gNB, int frame_rx, int slot_rx) { ...@@ -767,7 +775,7 @@ int phy_procedures_gNB_uespec_RX(PHY_VARS_gNB *gNB, int frame_rx, int slot_rx) {
start_meas(&gNB->rx_pusch_stats); start_meas(&gNB->rx_pusch_stats);
no_sig = nr_rx_pusch(gNB, ULSCH_id, frame_rx, slot_rx, harq_pid); no_sig = nr_rx_pusch(gNB, ULSCH_id, frame_rx, slot_rx, harq_pid);
if (no_sig) { if (no_sig) {
LOG_D(PHY, "PUSCH not detected in frame %d, slot %d\n", frame_rx, slot_rx); LOG_I(PHY, "PUSCH not detected in frame %d, slot %d\n", frame_rx, slot_rx);
nr_fill_indication(gNB, frame_rx, slot_rx, ULSCH_id, harq_pid, 1,1); nr_fill_indication(gNB, frame_rx, slot_rx, ULSCH_id, harq_pid, 1,1);
return 1; return 1;
} }
...@@ -783,7 +791,7 @@ int phy_procedures_gNB_uespec_RX(PHY_VARS_gNB *gNB, int frame_rx, int slot_rx) { ...@@ -783,7 +791,7 @@ int phy_procedures_gNB_uespec_RX(PHY_VARS_gNB *gNB, int frame_rx, int slot_rx) {
dB_fixed_x10(gNB->pusch_vars[ULSCH_id]->ulsch_noise_power_tot) + gNB->pusch_thres) { dB_fixed_x10(gNB->pusch_vars[ULSCH_id]->ulsch_noise_power_tot) + gNB->pusch_thres) {
NR_gNB_SCH_STATS_t *stats=get_ulsch_stats(gNB,ulsch); NR_gNB_SCH_STATS_t *stats=get_ulsch_stats(gNB,ulsch);
LOG_D(PHY, "PUSCH not detected in %d.%d (%d,%d,%d)\n",frame_rx,slot_rx, LOG_I(PHY, "PUSCH not detected in %d.%d (%d,%d,%d)\n",frame_rx,slot_rx,
dB_fixed_x10(gNB->pusch_vars[ULSCH_id]->ulsch_power_tot), dB_fixed_x10(gNB->pusch_vars[ULSCH_id]->ulsch_power_tot),
dB_fixed_x10(gNB->pusch_vars[ULSCH_id]->ulsch_noise_power_tot),gNB->pusch_thres); dB_fixed_x10(gNB->pusch_vars[ULSCH_id]->ulsch_noise_power_tot),gNB->pusch_thres);
gNB->pusch_vars[ULSCH_id]->ulsch_power_tot = gNB->pusch_vars[ULSCH_id]->ulsch_noise_power_tot; gNB->pusch_vars[ULSCH_id]->ulsch_power_tot = gNB->pusch_vars[ULSCH_id]->ulsch_noise_power_tot;
......
...@@ -157,7 +157,7 @@ int8_t nr_ue_scheduled_response(nr_scheduled_response_t *scheduled_response){ ...@@ -157,7 +157,7 @@ int8_t nr_ue_scheduled_response(nr_scheduled_response_t *scheduled_response){
for (i = 0; i < ul_config->number_pdus; ++i){ for (i = 0; i < ul_config->number_pdus; ++i){
AssertFatal(ul_config->ul_config_list[i].pdu_type <= FAPI_NR_UL_CONFIG_TYPES,"pdu_type %d out of bounds\n",ul_config->ul_config_list[i].pdu_type); AssertFatal(ul_config->ul_config_list[i].pdu_type <= FAPI_NR_UL_CONFIG_TYPES,"pdu_type %d out of bounds\n",ul_config->ul_config_list[i].pdu_type);
LOG_D(PHY, "In %s: processing %s PDU of %d total UL PDUs (ul_config %p) \n", __FUNCTION__, ul_pdu_type[ul_config->ul_config_list[i].pdu_type - 1], ul_config->number_pdus, ul_config); LOG_I(PHY, "In %s i %d: processing %s PDU of %d total UL PDUs (ul_config %p) \n", __FUNCTION__, i, ul_pdu_type[ul_config->ul_config_list[i].pdu_type - 1], ul_config->number_pdus, ul_config);
uint8_t pdu_type = ul_config->ul_config_list[i].pdu_type, current_harq_pid, gNB_id = 0; uint8_t pdu_type = ul_config->ul_config_list[i].pdu_type, current_harq_pid, gNB_id = 0;
/* PRACH */ /* PRACH */
...@@ -180,6 +180,8 @@ int8_t nr_ue_scheduled_response(nr_scheduled_response_t *scheduled_response){ ...@@ -180,6 +180,8 @@ int8_t nr_ue_scheduled_response(nr_scheduled_response_t *scheduled_response){
if (harq_process_ul_ue){ if (harq_process_ul_ue){
nfapi_nr_ue_pusch_pdu_t *pusch_pdu = &harq_process_ul_ue->pusch_pdu; nfapi_nr_ue_pusch_pdu_t *pusch_pdu = &harq_process_ul_ue->pusch_pdu;
LOG_I(PHY, "In %s i %d: copy pusch_config_pdu nrOfLayers:%d, num_dmrs_cdm_grps_no_data:%d \n", __FUNCTION__, i, pusch_config_pdu->nrOfLayers,pusch_config_pdu->num_dmrs_cdm_grps_no_data);
memcpy(pusch_pdu, pusch_config_pdu, sizeof(nfapi_nr_ue_pusch_pdu_t)); memcpy(pusch_pdu, pusch_config_pdu, sizeof(nfapi_nr_ue_pusch_pdu_t));
......
...@@ -270,9 +270,12 @@ void phy_procedures_nrUE_TX(PHY_VARS_NR_UE *ue, ...@@ -270,9 +270,12 @@ void phy_procedures_nrUE_TX(PHY_VARS_NR_UE *ue,
AssertFatal(ue->CC_id == 0, "Transmission on secondary CCs is not supported yet\n"); AssertFatal(ue->CC_id == 0, "Transmission on secondary CCs is not supported yet\n");
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_UE_TX,VCD_FUNCTION_IN); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_UE_TX,VCD_FUNCTION_IN);
memset(ue->common_vars.txdataF[0], 0, sizeof(int)*14*ue->frame_parms.ofdm_symbol_size); for(int i=0; i< ue->frame_parms.nb_antennas_tx; ++i)
{
memset(ue->common_vars.txdataF[i], 0, sizeof(int)*14*ue->frame_parms.ofdm_symbol_size);
}
LOG_D(PHY,"****** start TX-Chain for AbsSubframe %d.%d ******\n", frame_tx, slot_tx); LOG_D(PHY,"****** start TX-Chain for AbsSubframe %d.%d ******\n", frame_tx, slot_tx);
......
...@@ -768,7 +768,7 @@ int main(int argc, char **argv) ...@@ -768,7 +768,7 @@ int main(int argc, char **argv)
prepare_scd(scd); prepare_scd(scd);
fill_default_secondaryCellGroup(scc, scd, secondaryCellGroup, 0, 1, n_tx, 0, 0, 0); fill_default_secondaryCellGroup(scc, scd, secondaryCellGroup, 0, 1, n_tx, n_rx, 0, 0, 0);
/* RRC parameter validation for secondaryCellGroup */ /* RRC parameter validation for secondaryCellGroup */
fix_scd(scd); fix_scd(scd);
......
...@@ -137,6 +137,7 @@ int main(int argc, char **argv) ...@@ -137,6 +137,7 @@ int main(int argc, char **argv)
uint16_t nb_symb_sch = 12; uint16_t nb_symb_sch = 12;
uint16_t nb_rb = 50; uint16_t nb_rb = 50;
uint8_t Imcs = 9; uint8_t Imcs = 9;
uint8_t Nl = 1;
double DS_TDL = .03; double DS_TDL = .03;
...@@ -150,7 +151,7 @@ int main(int argc, char **argv) ...@@ -150,7 +151,7 @@ int main(int argc, char **argv)
randominit(0); randominit(0);
//while ((c = getopt(argc, argv, "df:hpg:i:j:n:l:m:r:s:S:y:z:M:N:F:R:P:")) != -1) { //while ((c = getopt(argc, argv, "df:hpg:i:j:n:l:m:r:s:S:y:z:M:N:F:R:P:")) != -1) {
while ((c = getopt(argc, argv, "hg:n:s:S:py:z:M:N:R:F:m:l:r:")) != -1) { while ((c = getopt(argc, argv, "hg:n:s:S:py:z:M:N:R:F:m:l:r:W:")) != -1) {
switch (c) { switch (c) {
/*case 'f': /*case 'f':
write_output_file = 1; write_output_file = 1;
...@@ -251,7 +252,7 @@ int main(int argc, char **argv) ...@@ -251,7 +252,7 @@ int main(int argc, char **argv)
case 'y': case 'y':
n_tx = atoi(optarg); n_tx = atoi(optarg);
if ((n_tx == 0) || (n_tx > 2)) { if ((n_tx == 0) || (n_tx > 4)) {
printf("Unsupported number of TX antennas %d. Exiting.\n", n_tx); printf("Unsupported number of TX antennas %d. Exiting.\n", n_tx);
exit(-1); exit(-1);
} }
...@@ -261,7 +262,7 @@ int main(int argc, char **argv) ...@@ -261,7 +262,7 @@ int main(int argc, char **argv)
case 'z': case 'z':
n_rx = atoi(optarg); n_rx = atoi(optarg);
if ((n_rx == 0) || (n_rx > 2)) { if ((n_rx == 0) || (n_rx > 4)) {
printf("Unsupported number of RX antennas %d. Exiting.\n", n_rx); printf("Unsupported number of RX antennas %d. Exiting.\n", n_rx);
exit(-1); exit(-1);
} }
...@@ -299,6 +300,10 @@ int main(int argc, char **argv) ...@@ -299,6 +300,10 @@ int main(int argc, char **argv)
printf("Illegal PBCH phase (0-3) got %d\n", pbch_phase); printf("Illegal PBCH phase (0-3) got %d\n", pbch_phase);
break;*/ break;*/
case 'W':
Nl = atoi(optarg);
break;
case 'm': case 'm':
Imcs = atoi(optarg); Imcs = atoi(optarg);
#ifdef DEBUG_NR_ULSCHSIM #ifdef DEBUG_NR_ULSCHSIM
...@@ -335,13 +340,14 @@ int main(int argc, char **argv) ...@@ -335,13 +340,14 @@ int main(int argc, char **argv)
printf("-z Number of RX antennas used in UE\n"); printf("-z Number of RX antennas used in UE\n");
//printf("-i Relative strength of first intefering eNB (in dB) - cell_id mod 3 = 1\n"); //printf("-i Relative strength of first intefering eNB (in dB) - cell_id mod 3 = 1\n");
//printf("-j Relative strength of second intefering eNB (in dB) - cell_id mod 3 = 2\n"); //printf("-j Relative strength of second intefering eNB (in dB) - cell_id mod 3 = 2\n");
printf("-W number of layer\n");
printf("-M Multiple SSB positions in burst\n"); printf("-M Multiple SSB positions in burst\n");
printf("-N Nid_cell\n"); printf("-N Nid_cell\n");
printf("-R N_RB_UL\n"); printf("-R N_RB_UL\n");
printf("-F Input filename (.txt format) for RX conformance testing\n"); printf("-F Input filename (.txt format) for RX conformance testing\n");
printf("-m\n"); printf("-m MCS\n");
printf("-l\n"); printf("-l number of symbol\n");
printf("-r\n"); printf("-r number of RB\n");
//printf("-O oversampling factor (1,2,4,8,16)\n"); //printf("-O oversampling factor (1,2,4,8,16)\n");
//printf("-A Interpolation_filname Run with Abstraction to generate Scatter plot using interpolation polynomial in file\n"); //printf("-A Interpolation_filname Run with Abstraction to generate Scatter plot using interpolation polynomial in file\n");
//printf("-C Generate Calibration information for Abstraction (effective SNR adjustment to remove Pe bias w.r.t. AWGN)\n"); //printf("-C Generate Calibration information for Abstraction (effective SNR adjustment to remove Pe bias w.r.t. AWGN)\n");
...@@ -359,8 +365,8 @@ int main(int argc, char **argv) ...@@ -359,8 +365,8 @@ int main(int argc, char **argv)
snr1 = snr0 + 10; snr1 = snr0 + 10;
gNB2UE = new_channel_desc_scm(n_tx, gNB2UE = new_channel_desc_scm(n_tx,
n_rx, n_rx,
channel_model, channel_model,
61.44e6, //N_RB2sampling_rate(N_RB_DL), 61.44e6, //N_RB2sampling_rate(N_RB_DL),
40e6, //N_RB2channel_bandwidth(N_RB_DL), 40e6, //N_RB2channel_bandwidth(N_RB_DL),
DS_TDL, DS_TDL,
...@@ -426,8 +432,7 @@ int main(int argc, char **argv) ...@@ -426,8 +432,7 @@ int main(int argc, char **argv)
uint8_t length_dmrs = 1; uint8_t length_dmrs = 1;
uint8_t N_PRB_oh; uint8_t N_PRB_oh;
uint16_t N_RE_prime,code_rate; uint16_t N_RE_prime,code_rate;
unsigned char mod_order; unsigned char mod_order;
uint8_t Nl = 1;
uint8_t rvidx = 0; uint8_t rvidx = 0;
uint8_t UE_id = 0; uint8_t UE_id = 0;
...@@ -437,9 +442,14 @@ int main(int argc, char **argv) ...@@ -437,9 +442,14 @@ int main(int argc, char **argv)
NR_UE_ULSCH_t *ulsch_ue = UE->ulsch[0][0][0]; NR_UE_ULSCH_t *ulsch_ue = UE->ulsch[0][0][0];
if ((Nl==4)||(Nl==3))
{
nb_re_dmrs = nb_re_dmrs*2;
}
mod_order = nr_get_Qm_ul(Imcs, 0); mod_order = nr_get_Qm_ul(Imcs, 0);
code_rate = nr_get_code_rate_ul(Imcs, 0); code_rate = nr_get_code_rate_ul(Imcs, 0);
available_bits = nr_get_G(nb_rb, nb_symb_sch, nb_re_dmrs, length_dmrs, mod_order, 1); available_bits = nr_get_G(nb_rb, nb_symb_sch, nb_re_dmrs, length_dmrs, mod_order, Nl);
TBS = nr_compute_tbs(mod_order,code_rate, nb_rb, nb_symb_sch, nb_re_dmrs*length_dmrs, 0, 0, Nl); TBS = nr_compute_tbs(mod_order,code_rate, nb_rb, nb_symb_sch, nb_re_dmrs*length_dmrs, 0, 0, Nl);
printf("\nAvailable bits %u TBS %u mod_order %d\n", available_bits, TBS, mod_order); printf("\nAvailable bits %u TBS %u mod_order %d\n", available_bits, TBS, mod_order);
......
This diff is collapsed.
...@@ -2708,6 +2708,9 @@ uint16_t nr_dci_size(const NR_BWP_DownlinkCommon_t *initialDownlinkBWP, ...@@ -2708,6 +2708,9 @@ uint16_t nr_dci_size(const NR_BWP_DownlinkCommon_t *initialDownlinkBWP,
LOG_D(NR_MAC,"dci_pdu->srs_resource_indicator.nbits %d\n",dci_pdu->srs_resource_indicator.nbits); LOG_D(NR_MAC,"dci_pdu->srs_resource_indicator.nbits %d\n",dci_pdu->srs_resource_indicator.nbits);
// Precoding info and number of layers // Precoding info and number of layers
long transformPrecoder = get_transformPrecoding(initialUplinkBWP, pusch_Config, ubwpd, (uint8_t*)&format, rnti_type, 0); long transformPrecoder = get_transformPrecoding(initialUplinkBWP, pusch_Config, ubwpd, (uint8_t*)&format, rnti_type, 0);
pusch_antenna_ports = *pusch_Config->maxRank;
dci_pdu->precoding_information.nbits=0; dci_pdu->precoding_information.nbits=0;
if (pusch_Config && if (pusch_Config &&
pusch_Config->txConfig != NULL){ pusch_Config->txConfig != NULL){
......
This diff is collapsed.
...@@ -388,7 +388,7 @@ void config_common(int Mod_idP, int ssb_SubcarrierOffset, int pdsch_AntennaPorts ...@@ -388,7 +388,7 @@ void config_common(int Mod_idP, int ssb_SubcarrierOffset, int pdsch_AntennaPorts
cfg->carrier_config.num_rx_ant.value = pusch_AntennaPorts; cfg->carrier_config.num_rx_ant.value = pusch_AntennaPorts;
AssertFatal(pusch_AntennaPorts > 0 && pusch_AntennaPorts < 13, "pusch_AntennaPorts in 1...12\n"); AssertFatal(pusch_AntennaPorts > 0 && pusch_AntennaPorts < 13, "pusch_AntennaPorts in 1...12\n");
cfg->carrier_config.num_rx_ant.tl.tag = NFAPI_NR_CONFIG_NUM_RX_ANT_TAG; cfg->carrier_config.num_rx_ant.tl.tag = NFAPI_NR_CONFIG_NUM_RX_ANT_TAG;
LOG_I(NR_MAC,"Set TX/RX antenna number to %d (num ssb %d: %x,%x)\n",cfg->carrier_config.num_tx_ant.value,num_ssb,cfg->ssb_table.ssb_mask_list[0].ssb_mask.value,cfg->ssb_table.ssb_mask_list[1].ssb_mask.value); LOG_I(NR_MAC,"Set RX antenna number to %d, Set TX antenna number to %d (num ssb %d: %x,%x)\n",cfg->carrier_config.num_tx_ant.value,cfg->carrier_config.num_rx_ant.value,num_ssb,cfg->ssb_table.ssb_mask_list[0].ssb_mask.value,cfg->ssb_table.ssb_mask_list[1].ssb_mask.value);
AssertFatal(cfg->carrier_config.num_tx_ant.value > 0,"carrier_config.num_tx_ant.value %d !\n",cfg->carrier_config.num_tx_ant.value ); AssertFatal(cfg->carrier_config.num_tx_ant.value > 0,"carrier_config.num_tx_ant.value %d !\n",cfg->carrier_config.num_tx_ant.value );
cfg->num_tlv++; cfg->num_tlv++;
cfg->num_tlv++; cfg->num_tlv++;
......
...@@ -977,9 +977,9 @@ void fill_msg3_pusch_pdu(nfapi_nr_pusch_pdu_t *pusch_pdu, ...@@ -977,9 +977,9 @@ void fill_msg3_pusch_pdu(nfapi_nr_pusch_pdu_t *pusch_pdu,
pusch_pdu->target_code_rate = nr_get_code_rate_ul(pusch_pdu->mcs_index,pusch_pdu->mcs_table); pusch_pdu->target_code_rate = nr_get_code_rate_ul(pusch_pdu->mcs_index,pusch_pdu->mcs_table);
pusch_pdu->qam_mod_order = nr_get_Qm_ul(pusch_pdu->mcs_index,pusch_pdu->mcs_table); pusch_pdu->qam_mod_order = nr_get_Qm_ul(pusch_pdu->mcs_index,pusch_pdu->mcs_table);
if (scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->msg3_transformPrecoder == NULL) if (scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->msg3_transformPrecoder == NULL)
pusch_pdu->transform_precoding = 1; pusch_pdu->transformPrecoder = 1;
else else
pusch_pdu->transform_precoding = 0; pusch_pdu->transformPrecoder = 0;
pusch_pdu->data_scrambling_id = *scc->physCellId; pusch_pdu->data_scrambling_id = *scc->physCellId;
pusch_pdu->nrOfLayers = 1; pusch_pdu->nrOfLayers = 1;
pusch_pdu->ul_dmrs_symb_pos = get_l_prime(nr_of_symbols,mappingtype,pusch_dmrs_pos2,pusch_len1,start_symbol_index, scc->dmrs_TypeA_Position); pusch_pdu->ul_dmrs_symb_pos = get_l_prime(nr_of_symbols,mappingtype,pusch_dmrs_pos2,pusch_len1,start_symbol_index, scc->dmrs_TypeA_Position);
......
...@@ -1139,13 +1139,14 @@ void nr_schedule_ue_spec(module_id_t module_id, ...@@ -1139,13 +1139,14 @@ void nr_schedule_ue_spec(module_id_t module_id,
dci_payload.dmrs_sequence_initialization.val = pdsch_pdu->SCID; dci_payload.dmrs_sequence_initialization.val = pdsch_pdu->SCID;
LOG_D(NR_MAC, LOG_D(NR_MAC,
"%4d.%2d DCI type 1 payload: freq_alloc %d (%d,%d,%d), " "%4d.%2d DCI type 1 payload: freq_alloc %d (%d,%d,%d), "
"time_alloc %d, vrb to prb %d, mcs %d tb_scaling %d ndi %d rv %d tpc %d ti %d\n", "nrOfLayers %d, time_alloc %d, vrb to prb %d, mcs %d tb_scaling %d ndi %d rv %d tpc %d ti %d\n",
frame, frame,
slot, slot,
dci_payload.frequency_domain_assignment.val, dci_payload.frequency_domain_assignment.val,
pdsch_pdu->rbStart, pdsch_pdu->rbStart,
pdsch_pdu->rbSize, pdsch_pdu->rbSize,
pdsch_pdu->BWPSize, pdsch_pdu->BWPSize,
pdsch_pdu->nrOfLayers,
dci_payload.time_domain_assignment.val, dci_payload.time_domain_assignment.val,
dci_payload.vrb_to_prb_mapping.val, dci_payload.vrb_to_prb_mapping.val,
dci_payload.mcs, dci_payload.mcs,
......
...@@ -405,6 +405,7 @@ void nr_preprocessor_phytest(module_id_t module_id, ...@@ -405,6 +405,7 @@ void nr_preprocessor_phytest(module_id_t module_id,
uint32_t target_ul_mcs = 9; uint32_t target_ul_mcs = 9;
uint32_t target_ul_bw = 50; uint32_t target_ul_bw = 50;
uint32_t target_ul_Nl = 1;
uint64_t ulsch_slot_bitmap = (1 << 8); uint64_t ulsch_slot_bitmap = (1 << 8);
bool nr_ul_preprocessor_phytest(module_id_t module_id, frame_t frame, sub_frame_t slot) bool nr_ul_preprocessor_phytest(module_id_t module_id, frame_t frame, sub_frame_t slot)
{ {
...@@ -446,15 +447,21 @@ bool nr_ul_preprocessor_phytest(module_id_t module_id, frame_t frame, sub_frame_ ...@@ -446,15 +447,21 @@ bool nr_ul_preprocessor_phytest(module_id_t module_id, frame_t frame, sub_frame_
const long f = sched_ctrl->search_space->searchSpaceType->choice.ue_Specific->dci_Formats; const long f = sched_ctrl->search_space->searchSpaceType->choice.ue_Specific->dci_Formats;
const int dci_format = f ? NR_UL_DCI_FORMAT_0_1 : NR_UL_DCI_FORMAT_0_0; const int dci_format = f ? NR_UL_DCI_FORMAT_0_1 : NR_UL_DCI_FORMAT_0_0;
const uint8_t num_dmrs_cdm_grps_no_data = 1; uint8_t num_dmrs_cdm_grps_no_data = 1;
if ((target_ul_Nl==4)||(target_ul_Nl==3))
{
num_dmrs_cdm_grps_no_data = 2;
}
/* we want to avoid a lengthy deduction of DMRS and other parameters in /* we want to avoid a lengthy deduction of DMRS and other parameters in
* every TTI if we can save it, so check whether dci_format, TDA, or * every TTI if we can save it, so check whether dci_format, TDA, or
* num_dmrs_cdm_grps_no_data has changed and only then recompute */ * num_dmrs_cdm_grps_no_data has changed and only then recompute */
NR_pusch_semi_static_t *ps = &sched_ctrl->pusch_semi_static; NR_pusch_semi_static_t *ps = &sched_ctrl->pusch_semi_static;
if (ps->time_domain_allocation != tda if (ps->time_domain_allocation != tda
|| ps->dci_format != dci_format || ps->dci_format != dci_format
|| ps->nrOfLayers != target_ul_Nl
|| ps->num_dmrs_cdm_grps_no_data != num_dmrs_cdm_grps_no_data) || ps->num_dmrs_cdm_grps_no_data != num_dmrs_cdm_grps_no_data)
nr_set_pusch_semi_static(scc, sched_ctrl->active_ubwp, NULL,dci_format, tda, num_dmrs_cdm_grps_no_data, ps); nr_set_pusch_semi_static(scc, sched_ctrl->active_ubwp, NULL,dci_format, tda, num_dmrs_cdm_grps_no_data,target_ul_Nl,ps);
uint16_t rbStart = 0; uint16_t rbStart = 0;
uint16_t rbSize; uint16_t rbSize;
...@@ -525,6 +532,7 @@ bool nr_ul_preprocessor_phytest(module_id_t module_id, frame_t frame, sub_frame_ ...@@ -525,6 +532,7 @@ bool nr_ul_preprocessor_phytest(module_id_t module_id, frame_t frame, sub_frame_
sched_pusch->ul_harq_pid = sched_ctrl->retrans_ul_harq.head; sched_pusch->ul_harq_pid = sched_ctrl->retrans_ul_harq.head;
/* Calculate TBS from MCS */ /* Calculate TBS from MCS */
ps->nrOfLayers = target_ul_Nl;
sched_pusch->R = nr_get_code_rate_ul(mcs, ps->mcs_table); sched_pusch->R = nr_get_code_rate_ul(mcs, ps->mcs_table);
sched_pusch->Qm = nr_get_Qm_ul(mcs, ps->mcs_table); sched_pusch->Qm = nr_get_Qm_ul(mcs, ps->mcs_table);
if (ps->pusch_Config->tp_pi2BPSK if (ps->pusch_Config->tp_pi2BPSK
...@@ -539,7 +547,7 @@ bool nr_ul_preprocessor_phytest(module_id_t module_id, frame_t frame, sub_frame_ ...@@ -539,7 +547,7 @@ bool nr_ul_preprocessor_phytest(module_id_t module_id, frame_t frame, sub_frame_
ps->N_PRB_DMRS * ps->num_dmrs_symb, ps->N_PRB_DMRS * ps->num_dmrs_symb,
0, // nb_rb_oh 0, // nb_rb_oh
0, 0,
1 /* NrOfLayers */) ps->nrOfLayers /* NrOfLayers */)
>> 3; >> 3;
/* mark the corresponding RBs as used */ /* mark the corresponding RBs as used */
......
...@@ -355,6 +355,7 @@ void nr_set_pusch_semi_static(const NR_ServingCellConfigCommon_t *scc, ...@@ -355,6 +355,7 @@ void nr_set_pusch_semi_static(const NR_ServingCellConfigCommon_t *scc,
long dci_format, long dci_format,
int tda, int tda,
uint8_t num_dmrs_cdm_grps_no_data, uint8_t num_dmrs_cdm_grps_no_data,
uint8_t nrOfLayers,
NR_pusch_semi_static_t *ps) NR_pusch_semi_static_t *ps)
{ {
ps->dci_format = dci_format; ps->dci_format = dci_format;
...@@ -371,11 +372,11 @@ void nr_set_pusch_semi_static(const NR_ServingCellConfigCommon_t *scc, ...@@ -371,11 +372,11 @@ void nr_set_pusch_semi_static(const NR_ServingCellConfigCommon_t *scc,
ps->pusch_Config = ubwp?ubwp->bwp_Dedicated->pusch_Config->choice.setup:(ubwpd ? ubwpd->pusch_Config->choice.setup : NULL); ps->pusch_Config = ubwp?ubwp->bwp_Dedicated->pusch_Config->choice.setup:(ubwpd ? ubwpd->pusch_Config->choice.setup : NULL);
if (ps->pusch_Config == NULL || !ps->pusch_Config->transformPrecoder) if (ps->pusch_Config == NULL || !ps->pusch_Config->transformPrecoder)
ps->transform_precoding = !scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->msg3_transformPrecoder; ps->transformPrecoder = !scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->msg3_transformPrecoder;
else else
ps->transform_precoding = *ps->pusch_Config->transformPrecoder; ps->transformPrecoder = *ps->pusch_Config->transformPrecoder;
const int target_ss = NR_SearchSpace__searchSpaceType_PR_ue_Specific; const int target_ss = NR_SearchSpace__searchSpaceType_PR_ue_Specific;
if (ps->transform_precoding) if (ps->transformPrecoder)
ps->mcs_table = get_pusch_mcs_table(ps->pusch_Config ? ps->pusch_Config->mcs_Table : NULL, ps->mcs_table = get_pusch_mcs_table(ps->pusch_Config ? ps->pusch_Config->mcs_Table : NULL,
0, 0,
ps->dci_format, ps->dci_format,
...@@ -392,6 +393,7 @@ void nr_set_pusch_semi_static(const NR_ServingCellConfigCommon_t *scc, ...@@ -392,6 +393,7 @@ void nr_set_pusch_semi_static(const NR_ServingCellConfigCommon_t *scc,
num_dmrs_cdm_grps_no_data = 2; // in case of transform precoding - no Data sent in DMRS symbol num_dmrs_cdm_grps_no_data = 2; // in case of transform precoding - no Data sent in DMRS symbol
} }
ps->nrOfLayers = nrOfLayers;
ps->num_dmrs_cdm_grps_no_data = num_dmrs_cdm_grps_no_data; ps->num_dmrs_cdm_grps_no_data = num_dmrs_cdm_grps_no_data;
/* DMRS calculations */ /* DMRS calculations */
...@@ -689,8 +691,21 @@ void config_uldci(const NR_BWP_Uplink_t *ubwp, ...@@ -689,8 +691,21 @@ void config_uldci(const NR_BWP_Uplink_t *ubwp,
"Non Codebook configuration non supported\n"); "Non Codebook configuration non supported\n");
dci_pdu_rel15->srs_resource_indicator.val = 0; // taking resource 0 for SRS dci_pdu_rel15->srs_resource_indicator.val = 0; // taking resource 0 for SRS
} }
AssertFatal((pusch_pdu->Tpmi==0), "unsupport Tpmi\n");
dci_pdu_rel15->precoding_information.val= 0;
if (pusch_pdu->nrOfLayers == 2)
{
dci_pdu_rel15->precoding_information.val = 4;
}
else if (pusch_pdu->nrOfLayers == 4)
{
dci_pdu_rel15->precoding_information.val = 11;
}
// antenna_ports.val = 0 for transform precoder is disabled, dmrs-Type=1, maxLength=1, Rank=1/2/3/4
// Antenna Ports // Antenna Ports
dci_pdu_rel15->antenna_ports.val = 0; // TODO for now it is hardcoded, it should depends on cdm group no data and rank dci_pdu_rel15->antenna_ports.val = 0;
// DMRS sequence initialization // DMRS sequence initialization
dci_pdu_rel15->dmrs_sequence_initialization.val = pusch_pdu->scid; dci_pdu_rel15->dmrs_sequence_initialization.val = pusch_pdu->scid;
break; break;
...@@ -699,11 +714,14 @@ void config_uldci(const NR_BWP_Uplink_t *ubwp, ...@@ -699,11 +714,14 @@ void config_uldci(const NR_BWP_Uplink_t *ubwp,
} }
LOG_D(NR_MAC, LOG_D(NR_MAC,
"%s() ULDCI type 0 payload: freq_alloc %d, time_alloc %d, freq_hop_flag %d, mcs %d tpc %d ndi %d rv %d\n", "%s() ULDCI type 0 payload: dci_format %d, freq_alloc %d, time_alloc %d, freq_hop_flag %d, precoding_information.val %d antenna_ports.val %d mcs %d tpc %d ndi %d rv %d\n",
__func__, __func__,
dci_format,
dci_pdu_rel15->frequency_domain_assignment.val, dci_pdu_rel15->frequency_domain_assignment.val,
dci_pdu_rel15->time_domain_assignment.val, dci_pdu_rel15->time_domain_assignment.val,
dci_pdu_rel15->frequency_hopping_flag.val, dci_pdu_rel15->frequency_hopping_flag.val,
dci_pdu_rel15->precoding_information.val,
dci_pdu_rel15->antenna_ports.val,
dci_pdu_rel15->mcs, dci_pdu_rel15->mcs,
dci_pdu_rel15->tpc, dci_pdu_rel15->tpc,
dci_pdu_rel15->ndi, dci_pdu_rel15->ndi,
......
...@@ -905,7 +905,7 @@ bool allocate_ul_retransmission(module_id_t module_id, ...@@ -905,7 +905,7 @@ bool allocate_ul_retransmission(module_id_t module_id,
NR_BWP_t *genericParameters = sched_ctrl->active_ubwp ? &sched_ctrl->active_ubwp->bwp_Common->genericParameters : &scc->uplinkConfigCommon->initialUplinkBWP->genericParameters; NR_BWP_t *genericParameters = sched_ctrl->active_ubwp ? &sched_ctrl->active_ubwp->bwp_Common->genericParameters : &scc->uplinkConfigCommon->initialUplinkBWP->genericParameters;
int rbStart = 0; // wrt BWP start int rbStart = 0; // wrt BWP start
const uint16_t bwpSize = NRRIV2BW(genericParameters->locationAndBandwidth, MAX_BWP_SIZE); const uint16_t bwpSize = NRRIV2BW(genericParameters->locationAndBandwidth, MAX_BWP_SIZE);
const uint8_t nrOfLayers = 1;
const uint8_t num_dmrs_cdm_grps_no_data = (sched_ctrl->active_bwp || ubwpd) ? 1 : 2; const uint8_t num_dmrs_cdm_grps_no_data = (sched_ctrl->active_bwp || ubwpd) ? 1 : 2;
const int tda = sched_ctrl->active_ubwp ? RC.nrmac[module_id]->preferred_ul_tda[sched_ctrl->active_ubwp->bwp_Id][slot] : 0; const int tda = sched_ctrl->active_ubwp ? RC.nrmac[module_id]->preferred_ul_tda[sched_ctrl->active_ubwp->bwp_Id][slot] : 0;
LOG_D(NR_MAC,"retInfo->time_domain_allocation = %d, tda = %d\n", retInfo->time_domain_allocation, tda); LOG_D(NR_MAC,"retInfo->time_domain_allocation = %d, tda = %d\n", retInfo->time_domain_allocation, tda);
...@@ -926,8 +926,9 @@ bool allocate_ul_retransmission(module_id_t module_id, ...@@ -926,8 +926,9 @@ bool allocate_ul_retransmission(module_id_t module_id,
if (ps->time_domain_allocation != tda if (ps->time_domain_allocation != tda
|| ps->dci_format != dci_format || ps->dci_format != dci_format
|| ps->nrOfLayers != nrOfLayers
|| ps->num_dmrs_cdm_grps_no_data != num_dmrs_cdm_grps_no_data) || ps->num_dmrs_cdm_grps_no_data != num_dmrs_cdm_grps_no_data)
nr_set_pusch_semi_static(scc, sched_ctrl->active_ubwp, ubwpd, dci_format, tda, num_dmrs_cdm_grps_no_data, ps); nr_set_pusch_semi_static(scc, sched_ctrl->active_ubwp, ubwpd, dci_format, tda, num_dmrs_cdm_grps_no_data, nrOfLayers,ps);
LOG_D(NR_MAC, "%s(): retransmission keeping TDA %d and TBS %d\n", __func__, tda, retInfo->tb_size); LOG_D(NR_MAC, "%s(): retransmission keeping TDA %d and TBS %d\n", __func__, tda, retInfo->tb_size);
} else { } else {
/* the retransmission will use a different time domain allocation, check /* the retransmission will use a different time domain allocation, check
...@@ -939,7 +940,7 @@ bool allocate_ul_retransmission(module_id_t module_id, ...@@ -939,7 +940,7 @@ bool allocate_ul_retransmission(module_id_t module_id,
rbSize++; rbSize++;
NR_pusch_semi_static_t temp_ps; NR_pusch_semi_static_t temp_ps;
int dci_format = get_dci_format(sched_ctrl); int dci_format = get_dci_format(sched_ctrl);
nr_set_pusch_semi_static(scc, sched_ctrl->active_ubwp,ubwpd, dci_format, tda, num_dmrs_cdm_grps_no_data, &temp_ps); nr_set_pusch_semi_static(scc, sched_ctrl->active_ubwp,ubwpd, dci_format, tda, num_dmrs_cdm_grps_no_data, nrOfLayers, &temp_ps);
uint32_t new_tbs; uint32_t new_tbs;
uint16_t new_rbSize; uint16_t new_rbSize;
bool success = nr_find_nb_rb(retInfo->Qm, bool success = nr_find_nb_rb(retInfo->Qm,
...@@ -1094,7 +1095,7 @@ void pf_ul(module_id_t module_id, ...@@ -1094,7 +1095,7 @@ void pf_ul(module_id_t module_id,
if (max_num_ue < 0) if (max_num_ue < 0)
return; return;
LOG_D(NR_MAC,"Looking for min_rb %d RBs, starting at %d\n", min_rb, rbStart); LOG_D(NR_MAC,"Looking for min_rb %d RBs, starting at %d num_dmrs_cdm_grps_no_data %d\n", min_rb, rbStart, ps->num_dmrs_cdm_grps_no_data);
while (rbStart < bwpSize && !rballoc_mask[rbStart]) rbStart++; while (rbStart < bwpSize && !rballoc_mask[rbStart]) rbStart++;
if (rbStart + min_rb >= bwpSize) { if (rbStart + min_rb >= bwpSize) {
LOG_W(NR_MAC, "cannot allocate continuous UL data for UE %d/RNTI %04x: no resources (rbStart %d, min_rb %d, bwpSize %d\n", LOG_W(NR_MAC, "cannot allocate continuous UL data for UE %d/RNTI %04x: no resources (rbStart %d, min_rb %d, bwpSize %d\n",
...@@ -1106,13 +1107,15 @@ void pf_ul(module_id_t module_id, ...@@ -1106,13 +1107,15 @@ void pf_ul(module_id_t module_id,
/* we want to avoid a lengthy deduction of DMRS and other parameters in /* we want to avoid a lengthy deduction of DMRS and other parameters in
* every TTI if we can save it, so check whether dci_format, TDA, or * every TTI if we can save it, so check whether dci_format, TDA, or
* num_dmrs_cdm_grps_no_data has changed and only then recompute */ * num_dmrs_cdm_grps_no_data has changed and only then recompute */
const uint8_t nrOfLayers = 1;
const uint8_t num_dmrs_cdm_grps_no_data = (sched_ctrl->active_ubwp || ubwpd) ? 1 : 2; const uint8_t num_dmrs_cdm_grps_no_data = (sched_ctrl->active_ubwp || ubwpd) ? 1 : 2;
int dci_format = get_dci_format(sched_ctrl); int dci_format = get_dci_format(sched_ctrl);
const int tda = sched_ctrl->active_ubwp ? nrmac->preferred_ul_tda[sched_ctrl->active_ubwp->bwp_Id][slot] : 0; const int tda = sched_ctrl->active_ubwp ? nrmac->preferred_ul_tda[sched_ctrl->active_ubwp->bwp_Id][slot] : 0;
if (ps->time_domain_allocation != tda if (ps->time_domain_allocation != tda
|| ps->dci_format != dci_format || ps->dci_format != dci_format
|| ps->nrOfLayers != nrOfLayers
|| ps->num_dmrs_cdm_grps_no_data != num_dmrs_cdm_grps_no_data) || ps->num_dmrs_cdm_grps_no_data != num_dmrs_cdm_grps_no_data)
nr_set_pusch_semi_static(scc, sched_ctrl->active_ubwp, ubwpd, dci_format, tda, num_dmrs_cdm_grps_no_data, ps); nr_set_pusch_semi_static(scc, sched_ctrl->active_ubwp, ubwpd, dci_format, tda, num_dmrs_cdm_grps_no_data,nrOfLayers, ps);
NR_sched_pusch_t *sched_pusch = &sched_ctrl->sched_pusch; NR_sched_pusch_t *sched_pusch = &sched_ctrl->sched_pusch;
sched_pusch->mcs = 9; sched_pusch->mcs = 9;
update_ul_ue_R_Qm(sched_pusch, ps); update_ul_ue_R_Qm(sched_pusch, ps);
...@@ -1125,7 +1128,7 @@ void pf_ul(module_id_t module_id, ...@@ -1125,7 +1128,7 @@ void pf_ul(module_id_t module_id,
ps->N_PRB_DMRS * ps->num_dmrs_symb, ps->N_PRB_DMRS * ps->num_dmrs_symb,
0, // nb_rb_oh 0, // nb_rb_oh
0, 0,
1 /* NrOfLayers */) ps->nrOfLayers)
>> 3; >> 3;
/* Mark the corresponding RBs as used */ /* Mark the corresponding RBs as used */
...@@ -1205,13 +1208,15 @@ void pf_ul(module_id_t module_id, ...@@ -1205,13 +1208,15 @@ void pf_ul(module_id_t module_id,
/* we want to avoid a lengthy deduction of DMRS and other parameters in /* we want to avoid a lengthy deduction of DMRS and other parameters in
* every TTI if we can save it, so check whether dci_format, TDA, or * every TTI if we can save it, so check whether dci_format, TDA, or
* num_dmrs_cdm_grps_no_data has changed and only then recompute */ * num_dmrs_cdm_grps_no_data has changed and only then recompute */
const uint8_t nrOfLayers = 1;
const uint8_t num_dmrs_cdm_grps_no_data = (sched_ctrl->active_ubwp || ubwpd) ? 1 : 2; const uint8_t num_dmrs_cdm_grps_no_data = (sched_ctrl->active_ubwp || ubwpd) ? 1 : 2;
int dci_format = get_dci_format(sched_ctrl); int dci_format = get_dci_format(sched_ctrl);
const int tda = sched_ctrl->active_ubwp ? nrmac->preferred_ul_tda[sched_ctrl->active_ubwp->bwp_Id][slot] : 0; const int tda = sched_ctrl->active_ubwp ? nrmac->preferred_ul_tda[sched_ctrl->active_ubwp->bwp_Id][slot] : 0;
if (ps->time_domain_allocation != tda if (ps->time_domain_allocation != tda
|| ps->dci_format != dci_format || ps->dci_format != dci_format
|| ps->nrOfLayers != nrOfLayers
|| ps->num_dmrs_cdm_grps_no_data != num_dmrs_cdm_grps_no_data) || ps->num_dmrs_cdm_grps_no_data != num_dmrs_cdm_grps_no_data)
nr_set_pusch_semi_static(scc, sched_ctrl->active_ubwp, ubwpd, dci_format, tda, num_dmrs_cdm_grps_no_data, ps); nr_set_pusch_semi_static(scc, sched_ctrl->active_ubwp, ubwpd, dci_format, tda, num_dmrs_cdm_grps_no_data, nrOfLayers,ps);
update_ul_ue_R_Qm(sched_pusch, ps); update_ul_ue_R_Qm(sched_pusch, ps);
/* Calculate the current scheduling bytes and the necessary RBs */ /* Calculate the current scheduling bytes and the necessary RBs */
...@@ -1473,7 +1478,7 @@ void nr_schedule_ulsch(module_id_t module_id, frame_t frame, sub_frame_t slot) ...@@ -1473,7 +1478,7 @@ void nr_schedule_ulsch(module_id_t module_id, frame_t frame, sub_frame_t slot)
sched_ctrl->last_ul_slot = sched_pusch->slot; sched_ctrl->last_ul_slot = sched_pusch->slot;
LOG_D(NR_MAC, LOG_D(NR_MAC,
"ULSCH/PUSCH: %4d.%2d RNTI %04x UL sched %4d.%2d DCI L %d start %2d RBS %3d startSymbol %2d nb_symbol %2d dmrs_pos %x MCS %2d TBS %4d HARQ PID %2d round %d RV %d NDI %d est %6d sched %6d est BSR %6d TPC %d\n", "ULSCH/PUSCH: %4d.%2d RNTI %04x UL sched %4d.%2d DCI L %d start %2d RBS %3d startSymbol %2d nb_symbol %2d dmrs_pos %x MCS %2d nrOfLayers %2d num_dmrs_cdm_grps_no_data %2d TBS %4d HARQ PID %2d round %d RV %d NDI %d est %6d sched %6d est BSR %6d TPC %d\n",
frame, frame,
slot, slot,
rnti, rnti,
...@@ -1486,6 +1491,8 @@ void nr_schedule_ulsch(module_id_t module_id, frame_t frame, sub_frame_t slot) ...@@ -1486,6 +1491,8 @@ void nr_schedule_ulsch(module_id_t module_id, frame_t frame, sub_frame_t slot)
ps->nrOfSymbols, ps->nrOfSymbols,
ps->ul_dmrs_symb_pos, ps->ul_dmrs_symb_pos,
sched_pusch->mcs, sched_pusch->mcs,
ps->nrOfLayers,
ps->num_dmrs_cdm_grps_no_data,
sched_pusch->tb_size, sched_pusch->tb_size,
harq_id, harq_id,
cur_harq->round, cur_harq->round,
...@@ -1532,17 +1539,18 @@ void nr_schedule_ulsch(module_id_t module_id, frame_t frame, sub_frame_t slot) ...@@ -1532,17 +1539,18 @@ void nr_schedule_ulsch(module_id_t module_id, frame_t frame, sub_frame_t slot)
pusch_pdu->qam_mod_order = sched_pusch->Qm; pusch_pdu->qam_mod_order = sched_pusch->Qm;
pusch_pdu->mcs_index = sched_pusch->mcs; pusch_pdu->mcs_index = sched_pusch->mcs;
pusch_pdu->mcs_table = ps->mcs_table; pusch_pdu->mcs_table = ps->mcs_table;
pusch_pdu->transform_precoding = ps->transform_precoding; pusch_pdu->transformPrecoder = ps->transformPrecoder;
if (ps->pusch_Config && ps->pusch_Config->dataScramblingIdentityPUSCH) if (ps->pusch_Config && ps->pusch_Config->dataScramblingIdentityPUSCH)
pusch_pdu->data_scrambling_id = *ps->pusch_Config->dataScramblingIdentityPUSCH; pusch_pdu->data_scrambling_id = *ps->pusch_Config->dataScramblingIdentityPUSCH;
else else
pusch_pdu->data_scrambling_id = *scc->physCellId; pusch_pdu->data_scrambling_id = *scc->physCellId;
pusch_pdu->nrOfLayers = 1; pusch_pdu->nrOfLayers = ps->nrOfLayers;
pusch_pdu->num_dmrs_cdm_grps_no_data = ps->num_dmrs_cdm_grps_no_data;
/* FAPI: DMRS */ /* FAPI: DMRS */
pusch_pdu->ul_dmrs_symb_pos = ps->ul_dmrs_symb_pos; pusch_pdu->ul_dmrs_symb_pos = ps->ul_dmrs_symb_pos;
pusch_pdu->dmrs_config_type = ps->dmrs_config_type; pusch_pdu->dmrs_config_type = ps->dmrs_config_type;
if (pusch_pdu->transform_precoding) { // transform precoding disabled if (pusch_pdu->transformPrecoder) { // transform precoding disabled
long *scramblingid=NULL; long *scramblingid=NULL;
if (ps->NR_DMRS_UplinkConfig && pusch_pdu->scid == 0) if (ps->NR_DMRS_UplinkConfig && pusch_pdu->scid == 0)
scramblingid = ps->NR_DMRS_UplinkConfig->transformPrecodingDisabled->scramblingID0; scramblingid = ps->NR_DMRS_UplinkConfig->transformPrecodingDisabled->scramblingID0;
...@@ -1562,7 +1570,7 @@ void nr_schedule_ulsch(module_id_t module_id, frame_t frame, sub_frame_t slot) ...@@ -1562,7 +1570,7 @@ void nr_schedule_ulsch(module_id_t module_id, frame_t frame, sub_frame_t slot)
} }
pusch_pdu->scid = 0; // DMRS sequence initialization [TS38.211, sec 6.4.1.1.1] pusch_pdu->scid = 0; // DMRS sequence initialization [TS38.211, sec 6.4.1.1.1]
pusch_pdu->num_dmrs_cdm_grps_no_data = ps->num_dmrs_cdm_grps_no_data; pusch_pdu->num_dmrs_cdm_grps_no_data = ps->num_dmrs_cdm_grps_no_data;
pusch_pdu->dmrs_ports = 1; pusch_pdu->dmrs_ports = ((1<<ps->nrOfLayers) - 1);
/* FAPI: Pusch Allocation in frequency domain */ /* FAPI: Pusch Allocation in frequency domain */
pusch_pdu->resource_alloc = 1; //type 1 pusch_pdu->resource_alloc = 1; //type 1
...@@ -1588,7 +1596,7 @@ void nr_schedule_ulsch(module_id_t module_id, frame_t frame, sub_frame_t slot) ...@@ -1588,7 +1596,7 @@ void nr_schedule_ulsch(module_id_t module_id, frame_t frame, sub_frame_t slot)
LOG_D(NR_MAC,"PUSCH PDU : data_scrambling_identity %x, dmrs_scrambling_id %x\n",pusch_pdu->data_scrambling_id,pusch_pdu->ul_dmrs_scrambling_id); LOG_D(NR_MAC,"PUSCH PDU : data_scrambling_identity %x, dmrs_scrambling_id %x\n",pusch_pdu->data_scrambling_id,pusch_pdu->ul_dmrs_scrambling_id);
/* TRANSFORM PRECODING --------------------------------------------------------*/ /* TRANSFORM PRECODING --------------------------------------------------------*/
if (pusch_pdu->transform_precoding == NR_PUSCH_Config__transformPrecoder_enabled){ if (pusch_pdu->transformPrecoder == NR_PUSCH_Config__transformPrecoder_enabled){
// U as specified in section 6.4.1.1.1.2 in 38.211, if sequence hopping and group hopping are disabled // U as specified in section 6.4.1.1.1.2 in 38.211, if sequence hopping and group hopping are disabled
pusch_pdu->dfts_ofdm.low_papr_group_number = pusch_pdu->pusch_identity % 30; pusch_pdu->dfts_ofdm.low_papr_group_number = pusch_pdu->pusch_identity % 30;
......
...@@ -298,6 +298,7 @@ void nr_set_pusch_semi_static(const NR_ServingCellConfigCommon_t *scc, ...@@ -298,6 +298,7 @@ void nr_set_pusch_semi_static(const NR_ServingCellConfigCommon_t *scc,
long dci_format, long dci_format,
int tda, int tda,
uint8_t num_dmrs_cdm_grps_no_data, uint8_t num_dmrs_cdm_grps_no_data,
uint8_t nrOfLayers,
NR_pusch_semi_static_t *ps); NR_pusch_semi_static_t *ps);
uint8_t nr_get_tpc(int target, uint8_t cqi, int incr); uint8_t nr_get_tpc(int target, uint8_t cqi, int incr);
......
...@@ -318,13 +318,14 @@ typedef struct NR_sched_pucch { ...@@ -318,13 +318,14 @@ typedef struct NR_sched_pucch {
typedef struct NR_pusch_semi_static_t { typedef struct NR_pusch_semi_static_t {
int dci_format; int dci_format;
int time_domain_allocation; int time_domain_allocation;
uint8_t nrOfLayers;
uint8_t num_dmrs_cdm_grps_no_data; uint8_t num_dmrs_cdm_grps_no_data;
int startSymbolIndex; int startSymbolIndex;
int nrOfSymbols; int nrOfSymbols;
NR_PUSCH_Config_t *pusch_Config; NR_PUSCH_Config_t *pusch_Config;
uint8_t transform_precoding; uint8_t transformPrecoder;
uint8_t mcs_table; uint8_t mcs_table;
long mapping_type; long mapping_type;
......
...@@ -1867,6 +1867,7 @@ int16_t do_RRCReconfiguration( ...@@ -1867,6 +1867,7 @@ int16_t do_RRCReconfiguration(
// 1, // 1,
// 1, // 1,
// carrier->pdsch_AntennaPorts, // carrier->pdsch_AntennaPorts,
// carrier->pusch_AntennaPorts,
// carrier->initial_csi_index[ue_context_p->local_uid + 1], // carrier->initial_csi_index[ue_context_p->local_uid + 1],
// ue_context_pP->local_uid); // ue_context_pP->local_uid);
......
...@@ -79,6 +79,7 @@ void fill_default_secondaryCellGroup(NR_ServingCellConfigCommon_t *servingcellco ...@@ -79,6 +79,7 @@ void fill_default_secondaryCellGroup(NR_ServingCellConfigCommon_t *servingcellco
int scg_id, int scg_id,
int servCellIndex, int servCellIndex,
int dl_antenna_ports, int dl_antenna_ports,
int ul_antenna_ports,
int do_csirs, int do_csirs,
int initial_csi_index, int initial_csi_index,
int uid); int uid);
...@@ -90,6 +91,7 @@ void fill_default_reconfig(NR_ServingCellConfigCommon_t *servingcellconfigcommon ...@@ -90,6 +91,7 @@ void fill_default_reconfig(NR_ServingCellConfigCommon_t *servingcellconfigcommon
NR_RRCReconfiguration_IEs_t *reconfig, NR_RRCReconfiguration_IEs_t *reconfig,
NR_CellGroupConfig_t *secondaryCellGroup, NR_CellGroupConfig_t *secondaryCellGroup,
int dl_antenna_ports, int dl_antenna_ports,
int ul_antenna_ports,
int do_csirs, int do_csirs,
int initial_csi_index, int initial_csi_index,
int uid); int uid);
......
...@@ -241,6 +241,7 @@ void rrc_add_nsa_user(gNB_RRC_INST *rrc,struct rrc_gNB_ue_context_s *ue_context_ ...@@ -241,6 +241,7 @@ void rrc_add_nsa_user(gNB_RRC_INST *rrc,struct rrc_gNB_ue_context_s *ue_context_
reconfig_ies, reconfig_ies,
ue_context_p->ue_context.secondaryCellGroup, ue_context_p->ue_context.secondaryCellGroup,
carrier->pdsch_AntennaPorts, carrier->pdsch_AntennaPorts,
carrier->pusch_AntennaPorts,
carrier->do_CSIRS, carrier->do_CSIRS,
carrier->initial_csi_index[ue_context_p->local_uid + 1], carrier->initial_csi_index[ue_context_p->local_uid + 1],
ue_context_p->local_uid); ue_context_p->local_uid);
...@@ -250,6 +251,7 @@ void rrc_add_nsa_user(gNB_RRC_INST *rrc,struct rrc_gNB_ue_context_s *ue_context_ ...@@ -250,6 +251,7 @@ void rrc_add_nsa_user(gNB_RRC_INST *rrc,struct rrc_gNB_ue_context_s *ue_context_
reconfig_ies, reconfig_ies,
ue_context_p->ue_context.secondaryCellGroup, ue_context_p->ue_context.secondaryCellGroup,
carrier->pdsch_AntennaPorts, carrier->pdsch_AntennaPorts,
carrier->pusch_AntennaPorts,
carrier->do_CSIRS, carrier->do_CSIRS,
carrier->initial_csi_index[ue_context_p->local_uid + 1], carrier->initial_csi_index[ue_context_p->local_uid + 1],
ue_context_p->local_uid); ue_context_p->local_uid);
...@@ -348,7 +350,7 @@ void rrc_add_nsa_user(gNB_RRC_INST *rrc,struct rrc_gNB_ue_context_s *ue_context_ ...@@ -348,7 +350,7 @@ void rrc_add_nsa_user(gNB_RRC_INST *rrc,struct rrc_gNB_ue_context_s *ue_context_
rrc_mac_config_req_gNB(rrc->module_id, rrc_mac_config_req_gNB(rrc->module_id,
rrc->carrier.ssb_SubcarrierOffset, rrc->carrier.ssb_SubcarrierOffset,
rrc->carrier.pdsch_AntennaPorts, rrc->carrier.pdsch_AntennaPorts,
rrc->carrier.pusch_AntennaPorts, rrc->carrier.pusch_AntennaPorts,
rrc->carrier.sib1_tda, rrc->carrier.sib1_tda,
rrc->carrier.servingcellconfigcommon, rrc->carrier.servingcellconfigcommon,
&rrc->carrier.mib, &rrc->carrier.mib,
......
...@@ -55,6 +55,7 @@ void fill_default_secondaryCellGroup(NR_ServingCellConfigCommon_t *servingcellco ...@@ -55,6 +55,7 @@ void fill_default_secondaryCellGroup(NR_ServingCellConfigCommon_t *servingcellco
int scg_id, int scg_id,
int servCellIndex, int servCellIndex,
int dl_antenna_ports, int dl_antenna_ports,
int ul_antenna_ports,
int do_csirs, int do_csirs,
int initial_csi_index, int initial_csi_index,
int uid) { int uid) {
...@@ -745,14 +746,14 @@ void fill_default_secondaryCellGroup(NR_ServingCellConfigCommon_t *servingcellco ...@@ -745,14 +746,14 @@ void fill_default_secondaryCellGroup(NR_ServingCellConfigCommon_t *servingcellco
pusch_Config->codebookSubset=calloc(1,sizeof(*pusch_Config->codebookSubset)); pusch_Config->codebookSubset=calloc(1,sizeof(*pusch_Config->codebookSubset));
*pusch_Config->codebookSubset = NR_PUSCH_Config__codebookSubset_nonCoherent; *pusch_Config->codebookSubset = NR_PUSCH_Config__codebookSubset_nonCoherent;
pusch_Config->maxRank=calloc(1,sizeof(*pusch_Config->maxRank)); pusch_Config->maxRank=calloc(1,sizeof(*pusch_Config->maxRank));
*pusch_Config->maxRank= 1; *pusch_Config->maxRank= ul_antenna_ports;
pusch_Config->rbg_Size=NULL; pusch_Config->rbg_Size=NULL;
pusch_Config->uci_OnPUSCH=NULL; pusch_Config->uci_OnPUSCH=NULL;
pusch_Config->tp_pi2BPSK=NULL; pusch_Config->tp_pi2BPSK=NULL;
/*------------------------------TRANSFORM PRECODING- -----------------------------------------------------------------------*/ /*------------------------------TRANSFORM PRECODING- -----------------------------------------------------------------------*/
uint8_t transform_precoding = NR_PUSCH_Config__transformPrecoder_disabled; uint8_t transformPrecoder = NR_PUSCH_Config__transformPrecoder_disabled;
// TBD: configure this from .conf file, Dedicated params cannot yet be configured in .conf file. // TBD: configure this from .conf file, Dedicated params cannot yet be configured in .conf file.
// Enable this to test transform precoding enabled from dedicated config. // Enable this to test transform precoding enabled from dedicated config.
...@@ -764,13 +765,13 @@ void fill_default_secondaryCellGroup(NR_ServingCellConfigCommon_t *servingcellco ...@@ -764,13 +765,13 @@ void fill_default_secondaryCellGroup(NR_ServingCellConfigCommon_t *servingcellco
if (pusch_Config->transformPrecoder == NULL) { if (pusch_Config->transformPrecoder == NULL) {
if (servingcellconfigcommon->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->msg3_transformPrecoder != NULL) if (servingcellconfigcommon->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->msg3_transformPrecoder != NULL)
transform_precoding = NR_PUSCH_Config__transformPrecoder_enabled; transformPrecoder = NR_PUSCH_Config__transformPrecoder_enabled;
} }
else else
transform_precoding = *pusch_Config->transformPrecoder; transformPrecoder = *pusch_Config->transformPrecoder;
if (transform_precoding == NR_PUSCH_Config__transformPrecoder_enabled ) { if (transformPrecoder == NR_PUSCH_Config__transformPrecoder_enabled ) {
/* Enable DMRS uplink config for transform precoding enabled */ /* Enable DMRS uplink config for transform precoding enabled */
NR_DMRS_UplinkConfig->transformPrecodingEnabled = calloc(1,sizeof(*NR_DMRS_UplinkConfig->transformPrecodingEnabled)); NR_DMRS_UplinkConfig->transformPrecodingEnabled = calloc(1,sizeof(*NR_DMRS_UplinkConfig->transformPrecodingEnabled));
NR_DMRS_UplinkConfig->transformPrecodingEnabled->nPUSCH_Identity = NULL; NR_DMRS_UplinkConfig->transformPrecodingEnabled->nPUSCH_Identity = NULL;
...@@ -1348,6 +1349,7 @@ void fill_default_reconfig(NR_ServingCellConfigCommon_t *servingcellconfigcommon ...@@ -1348,6 +1349,7 @@ void fill_default_reconfig(NR_ServingCellConfigCommon_t *servingcellconfigcommon
NR_RRCReconfiguration_IEs_t *reconfig, NR_RRCReconfiguration_IEs_t *reconfig,
NR_CellGroupConfig_t *secondaryCellGroup, NR_CellGroupConfig_t *secondaryCellGroup,
int dl_antenna_ports, int dl_antenna_ports,
int ul_antenna_ports,
int do_csirs, int do_csirs,
int initial_csi_index, int initial_csi_index,
int uid) { int uid) {
...@@ -1363,6 +1365,7 @@ void fill_default_reconfig(NR_ServingCellConfigCommon_t *servingcellconfigcommon ...@@ -1363,6 +1365,7 @@ void fill_default_reconfig(NR_ServingCellConfigCommon_t *servingcellconfigcommon
1, 1,
1, 1,
dl_antenna_ports, dl_antenna_ports,
ul_antenna_ports,
do_csirs, do_csirs,
initial_csi_index, initial_csi_index,
uid); uid);
......
...@@ -429,7 +429,7 @@ static int rfsimulator_write_internal(rfsimulator_state_t *t, openair0_timestamp ...@@ -429,7 +429,7 @@ static int rfsimulator_write_internal(rfsimulator_state_t *t, openair0_timestamp
if (!alreadyLocked) if (!alreadyLocked)
pthread_mutex_lock(&Sockmutex); pthread_mutex_lock(&Sockmutex);
LOG_D(HW,"sending %d samples at time: %ld\n", nsamps, timestamp); LOG_D(HW,"sending %d samples at time: %ld, nbAnt %d\n", nsamps, timestamp, nbAnt);
for (int i=0; i<FD_SETSIZE; i++) { for (int i=0; i<FD_SETSIZE; i++) {
buffer_t *b=&t->buf[i]; buffer_t *b=&t->buf[i];
...@@ -623,7 +623,7 @@ static int rfsimulator_read(openair0_device *device, openair0_timestamp *ptimest ...@@ -623,7 +623,7 @@ static int rfsimulator_read(openair0_device *device, openair0_timestamp *ptimest
} }
rfsimulator_state_t *t = device->priv; rfsimulator_state_t *t = device->priv;
LOG_D(HW, "Enter rfsimulator_read, expect %d samples, will release at TS: %ld\n", nsamps, t->nextTimestamp+nsamps); LOG_D(HW, "Enter rfsimulator_read, expect %d samples, will release at TS: %ld, nbAnt %d\n", nsamps, t->nextTimestamp+nsamps, nbAnt);
// deliver data from received data // deliver data from received data
// check if a UE is connected // check if a UE is connected
int first_sock; int first_sock;
...@@ -728,6 +728,7 @@ static int rfsimulator_read(openair0_device *device, openair0_timestamp *ptimest ...@@ -728,6 +728,7 @@ static int rfsimulator_read(openair0_device *device, openair0_timestamp *ptimest
for (int a=0; a<nbAnt; a++) {//loop over number of Rx antennas for (int a=0; a<nbAnt; a++) {//loop over number of Rx antennas
if ( ptr->channel_model != NULL ) // apply a channel model if ( ptr->channel_model != NULL ) // apply a channel model
{
rxAddInput( ptr->circularBuf, (struct complex16 *) samplesVoid[a], rxAddInput( ptr->circularBuf, (struct complex16 *) samplesVoid[a],
a, a,
ptr->channel_model, ptr->channel_model,
...@@ -735,11 +736,21 @@ static int rfsimulator_read(openair0_device *device, openair0_timestamp *ptimest ...@@ -735,11 +736,21 @@ static int rfsimulator_read(openair0_device *device, openair0_timestamp *ptimest
t->nextTimestamp, t->nextTimestamp,
CirSize CirSize
); );
else { // no channel modeling }
else
{ // no channel modeling
#if 0
double H_awgn_mimo[4][4] ={{1.0, 0.5, 0.25, 0.125},//rx 0 double H_awgn_mimo[4][4] ={{1.0, 0.5, 0.25, 0.125},//rx 0
{0.5, 1.0, 0.5, 0.25}, //rx 1 {0.5, 1.0, 0.5, 0.25}, //rx 1
{0.25, 0.5, 1.0, 0.5}, //rx 2 {0.25, 0.5, 1.0, 0.5}, //rx 2
{0.125, 0.25, 0.5, 1.0}};//rx 3 {0.125, 0.25, 0.5, 1.0}};//rx 3
#else
double H_awgn_mimo[4][4] ={{1.0, 0.0, 0.0, 0.0},//rx 0
{0.0, 1.0, 0.0, 0.0},//rx 1
{0.0, 0.0, 1.0, 0.0},//rx 2
{0.0, 0.0, 0.0, 1.0}};//rx 3
#endif
sample_t *out=(sample_t *)samplesVoid[a]; sample_t *out=(sample_t *)samplesVoid[a];
int nbAnt_tx = ptr->th.nbAnt;//number of Tx antennas int nbAnt_tx = ptr->th.nbAnt;//number of Tx antennas
......
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