diff --git a/cmake_targets/CMakeLists.txt b/cmake_targets/CMakeLists.txt index 1f5109e49e..a263db793c 100644 --- a/cmake_targets/CMakeLists.txt +++ b/cmake_targets/CMakeLists.txt @@ -1300,6 +1300,7 @@ set(PHY_SRC_UE ${OPENAIR1_DIR}/PHY/NR_TRANSPORT/nr_dlsch_tools.c ${OPENAIR1_DIR}/PHY/NR_TRANSPORT/nr_dlsch_coding.c ${OPENAIR1_DIR}/PHY/NR_TRANSPORT/nr_tbs_tools.c + ${OPENAIR1_DIR}/PHY/NR_TRANSPORT/nr_sch_dmrs.c ${OPENAIR1_DIR}/PHY/NR_REFSIG/nr_gold.c ${OPENAIR1_DIR}/PHY/TOOLS/file_output.c ${OPENAIR1_DIR}/PHY/TOOLS/cadd_vv.c diff --git a/nfapi/open-nFAPI/nfapi/public_inc/nfapi_nr_interface.h b/nfapi/open-nFAPI/nfapi/public_inc/nfapi_nr_interface.h index bd3076c68b..3d39fbb10a 100644 --- a/nfapi/open-nFAPI/nfapi/public_inc/nfapi_nr_interface.h +++ b/nfapi/open-nFAPI/nfapi/public_inc/nfapi_nr_interface.h @@ -554,26 +554,24 @@ typedef struct { uint8_t freq_allocation_type; uint8_t start_prb; uint8_t n_prb; - uint8_t S; - uint8_t L; - uint8_t Imcs; + uint8_t start_symbol; + uint8_t nb_symbols; + uint8_t mcs_idx; uint8_t nb_codewords; uint8_t nb_layers; - /*uint8_t R; - uint8_t Qm; - uint16_t TBS; - uint8_t nb_layers;*/ + uint16_t coding_rate; + uint8_t modulation; + uint8_t modulation_order; + uint16_t transport_block_size; + uint8_t nb_re_dmrs; uint8_t time_alloc_list_flag; uint8_t time_alloc_list; uint8_t rbg_list; uint8_t virtual_resource_block_assignment_flag; uint32_t resource_block_coding; - uint8_t modulation; uint8_t redundancy_version; uint8_t transport_blocks; - //uint8_t transport_block_to_codeword_swap_flag; uint8_t transmission_scheme; - uint8_t number_of_layers; uint8_t number_of_subbands; uint8_t codebook_index[NFAPI_MAX_NUM_SUBBANDS]; uint8_t ue_category_capacity; diff --git a/openair1/PHY/NR_TRANSPORT/nr_dci.h b/openair1/PHY/NR_TRANSPORT/nr_dci.h index f7c885b499..572aee653c 100644 --- a/openair1/PHY/NR_TRANSPORT/nr_dci.h +++ b/openair1/PHY/NR_TRANSPORT/nr_dci.h @@ -51,7 +51,8 @@ void nr_fill_dci_and_dlsch(PHY_VARS_gNB *gNB, int subframe, gNB_rxtx_proc_t *proc, NR_gNB_DCI_ALLOC_t *dci_alloc, - nfapi_nr_dl_config_request_pdu_t *pdu); + nfapi_nr_dl_config_dci_dl_pdu *pdu, + nfapi_nr_dl_config_dlsch_pdu *dlsch_pdu); void nr_fill_cce_list(NR_gNB_DCI_ALLOC_t* dci_alloc, uint16_t n_shift, uint8_t m); diff --git a/openair1/PHY/NR_TRANSPORT/nr_dci_tools.c b/openair1/PHY/NR_TRANSPORT/nr_dci_tools.c index fa729704a5..f346ebf051 100644 --- a/openair1/PHY/NR_TRANSPORT/nr_dci_tools.c +++ b/openair1/PHY/NR_TRANSPORT/nr_dci_tools.c @@ -31,6 +31,7 @@ */ #include "nr_dci.h" +#include "nr_dlsch.h" void nr_fill_cce_list(NR_gNB_DCI_ALLOC_t* dci_alloc, uint16_t n_shift, uint8_t m) { @@ -110,14 +111,15 @@ void nr_fill_dci_and_dlsch(PHY_VARS_gNB *gNB, int subframe, gNB_rxtx_proc_t *proc, NR_gNB_DCI_ALLOC_t *dci_alloc, - nfapi_nr_dl_config_request_pdu_t *pdu) + nfapi_nr_dl_config_dci_dl_pdu *pdcch_pdu, + nfapi_nr_dl_config_dlsch_pdu *dlsch_pdu) { NR_DL_FRAME_PARMS *fp = &gNB->frame_parms; uint8_t n_shift; 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_pdcch_parameters_rel15_t *params_rel15 = &pdu->dci_dl_pdu.pdcch_params_rel15; + nfapi_nr_dl_config_dci_dl_pdu_rel15_t *pdu_rel15 = &pdcch_pdu->dci_dl_pdu_rel15; + nfapi_nr_dl_config_pdcch_parameters_rel15_t *params_rel15 = &pdcch_pdu->pdcch_params_rel15; nfapi_nr_config_request_t *cfg = &gNB->gNB_config; NR_gNB_DLSCH_t *dlsch = &gNB->dlsch; NR_DL_gNB_HARQ_t **harq = dlsch->harq_processes; @@ -532,4 +534,11 @@ void nr_fill_dci_and_dlsch(PHY_VARS_gNB *gNB, nr_fill_cce_list(dci_alloc, n_shift, cand_idx); LOG_I(PHY, "DCI type %d payload (size %d) generated on candidate %d\n", dci_alloc->pdcch_params.dci_format, dci_alloc->size, cand_idx); + /// DLSCH struct + memcpy((void*)&dlsch->harq_processes[dci_alloc->harq_pid]->dlsch_pdu, (void*)dlsch_pdu, sizeof(nfapi_nr_dl_config_dlsch_pdu)); + nfapi_nr_dl_config_dlsch_pdu_rel15_t *dlsch_rel15 = &dlsch_pdu->dlsch_pdu_rel15; + nr_get_tbs(dlsch, *pdcch_pdu, *cfg, dci_alloc->harq_pid); + dlsch_rel15->nb_layers =1; + dlsch_rel15->nb_codewords = 1; + } diff --git a/openair1/PHY/NR_TRANSPORT/nr_dlsch.c b/openair1/PHY/NR_TRANSPORT/nr_dlsch.c index 77886beb1b..56e100b04f 100644 --- a/openair1/PHY/NR_TRANSPORT/nr_dlsch.c +++ b/openair1/PHY/NR_TRANSPORT/nr_dlsch.c @@ -32,6 +32,7 @@ #include "nr_dlsch.h" #include "nr_dci.h" +#include "nr_sch_dmrs.h" #define DEBUG_DLSCH @@ -207,7 +208,7 @@ uint8_t nr_generate_pdsch(NR_gNB_DLSCH_t dlsch, pdcch_params.scrambling_id : config.sch_config.physical_cell_id.value; for (int q=0; qnb_codewords; q++) nr_pdsch_codeword_scrambling(harq->f, - harq->TBS, + rel15->transport_block_size, q, Nid, n_RNTI, @@ -216,8 +217,8 @@ uint8_t nr_generate_pdsch(NR_gNB_DLSCH_t dlsch, /// Modulation for (int q=0; qnb_codewords; q++) nr_pdsch_codeword_modulation(scrambled_output[q], - harq->Qm, - harq->TBS, + rel15->modulation_order, + rel15->transport_block_size, mod_symbs[q]); /// Layer mapping @@ -231,14 +232,14 @@ uint8_t nr_generate_pdsch(NR_gNB_DLSCH_t dlsch, //to be moved to init phase potentially, for now tx_layers 1-8 are mapped on antenna ports 1000-1007 /// DMRS QPSK modulation - uint16_t n_dmrs = rel15->n_prb<<1; + uint16_t n_dmrs = rel15->n_prb*rel15->nb_re_dmrs; int16_t mod_dmrs[n_dmrs<<1]; uint8_t dmrs_type = config.pdsch_config.dmrs_type.value; nr_modulation(pdsch_dmrs, n_dmrs, MOD_QPSK, mod_dmrs); /// Resource mapping - AssertFatal(harq->Nl<=config.rf_config.tx_antenna_ports.value, "Not enough Tx antennas (%d) for %d layers\n",\ - config.rf_config.tx_antenna_ports.value, harq->Nl); + AssertFatal(rel15->nb_layers<=config.rf_config.tx_antenna_ports.value, "Not enough Tx antennas (%d) for %d layers\n",\ + config.rf_config.tx_antenna_ports.value, rel15->nb_layers); // Non interleaved VRB to PRB mapping uint8_t start_sc = frame_parms.first_carrier_offset + rel15->start_prb*NR_NB_SC_PER_RB +\ @@ -255,7 +256,7 @@ uint8_t nr_generate_pdsch(NR_gNB_DLSCH_t dlsch, uint8_t k_prime=0, n=0, dmrs_idx=0; uint16_t m = 0; - for (int l=rel15->S; lL; l++) + for (int l=rel15->start_symbol; lnb_symbols; l++) for (int k=start_sc; kn_prb*NR_NB_SC_PER_RB; k++) { if (k >= frame_parms.ofdm_symbol_size) k -= frame_parms.ofdm_symbol_size; diff --git a/openair1/PHY/NR_TRANSPORT/nr_dlsch.h b/openair1/PHY/NR_TRANSPORT/nr_dlsch.h index ff84be68e0..a08a393ab7 100644 --- a/openair1/PHY/NR_TRANSPORT/nr_dlsch.h +++ b/openair1/PHY/NR_TRANSPORT/nr_dlsch.h @@ -84,12 +84,11 @@ void nr_pdsch_layer_mapping(uint16_t **mod_symbs, uint32_t nr_get_G(uint16_t nb_rb, uint16_t nb_symb_sch,uint8_t nb_re_dmrs,uint16_t length_dmrs,uint8_t Qm, uint8_t Nl); int nr_dlsch_encoding(PHY_VARS_gNB *gNB, - unsigned char *a, - uint16_t nb_symb_sch, - NR_gNB_DLSCH_t *dlsch, - int frame, - uint8_t subframe, - time_stats_t *rm_stats, - time_stats_t *te_stats, - time_stats_t *i_stats); + unsigned char *a, + NR_gNB_DLSCH_t *dlsch, + uint16_t frame, + uint8_t subframe, + time_stats_t *rm_stats, + time_stats_t *te_stats, + time_stats_t *i_stats); diff --git a/openair1/PHY/NR_TRANSPORT/nr_dlsch_coding.c b/openair1/PHY/NR_TRANSPORT/nr_dlsch_coding.c index c2f51388bd..70ea39a792 100644 --- a/openair1/PHY/NR_TRANSPORT/nr_dlsch_coding.c +++ b/openair1/PHY/NR_TRANSPORT/nr_dlsch_coding.c @@ -244,53 +244,46 @@ void clean_gNB_dlsch(NR_gNB_DLSCH_t *dlsch) } int nr_dlsch_encoding(PHY_VARS_gNB *gNB, - unsigned char *a, - uint16_t nb_symb_sch, - NR_gNB_DLSCH_t *dlsch, - int frame, - uint8_t subframe, - time_stats_t *rm_stats, - time_stats_t *te_stats, - time_stats_t *i_stats) + unsigned char *a, + NR_gNB_DLSCH_t *dlsch, + uint16_t frame, + uint8_t subframe, + time_stats_t *rm_stats, + time_stats_t *te_stats, + time_stats_t *i_stats) { unsigned int G; unsigned int crc=1; NR_DL_FRAME_PARMS *frame_parms = &gNB->frame_parms; - unsigned char harq_pid = dlsch->harq_ids[subframe]; - unsigned short nb_rb = dlsch->harq_processes[harq_pid]->nb_rb; - unsigned int A, Z; - unsigned *pz = &Z; - unsigned char mod_order; - unsigned int Kr=0,r,r_offset=0;//Kr_bytes - //unsigned short m=dlsch->harq_processes[harq_pid]->mcs; - //uint8_t beamforming_mode=0; + uint8_t harq_pid = dlsch->harq_ids[subframe]; + nfapi_nr_dl_config_dlsch_pdu_rel15_t rel15 = dlsch->harq_processes[harq_pid]->dlsch_pdu.dlsch_pdu_rel15; + uint16_t nb_rb = rel15.n_prb; + uint8_t nb_symb_sch = rel15.nb_symbols; + uint16_t A, Z; + uint16_t *pz = &Z; + uint8_t mod_order = rel15.modulation_order; + uint16_t Kr=0,r,r_offset=0;//Kr_bytes uint8_t *d_tmp[MAX_NUM_DLSCH_SEGMENTS]; //double rate = 0.33; uint8_t kb,BG=1; uint32_t E; uint8_t Ilbrm = 0; uint32_t Tbslbrm = 950984; //max tbs - //uint16_t nb_symb_sch =12; - uint8_t nb_re_dmrs = 6; + uint8_t nb_re_dmrs = rel15.nb_re_dmrs; uint16_t length_dmrs = 1; uint8_t *channel_input[MAX_NUM_DLSCH_SEGMENTS]; //unsigned char VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_ENB_DLSCH_ENCODING, VCD_FUNCTION_IN); - dlsch->harq_processes[harq_pid]->TBS= nr_compute_tbs(dlsch->harq_processes[harq_pid]->mcs, - nb_rb,nb_symb_sch,nb_re_dmrs,length_dmrs, - dlsch->harq_processes[harq_pid]->Nl); - - A = dlsch->harq_processes[harq_pid]->TBS; + A = rel15.transport_block_size; //printf("Encoder: A: %d frame.subframe %d.%d \n",A, frame,subframe); - mod_order = nr_get_Qm(dlsch->harq_processes[harq_pid]->mcs,1); - G = nr_get_G(nb_rb, nb_symb_sch, nb_re_dmrs, length_dmrs,mod_order,dlsch->harq_processes[harq_pid]->Nl); + G = nr_get_G(nb_rb, nb_symb_sch, nb_re_dmrs, length_dmrs,mod_order,rel15.nb_layers); printf("dlsch coding A %d G %d mod_order %d\n", A,G, mod_order); - Tbslbrm = nr_compute_tbs(28,nb_rb,frame_parms->symbols_per_slot,0,0, dlsch->harq_processes[harq_pid]->Nl); + Tbslbrm = nr_compute_tbs(28,nb_rb,frame_parms->symbols_per_slot,0,0, rel15.nb_layers); // if (dlsch->harq_processes[harq_pid]->Ndi == 1) { // this is a new packet if (dlsch->harq_processes[harq_pid]->round == 0) { // this is a new packet @@ -400,9 +393,9 @@ int nr_dlsch_encoding(PHY_VARS_gNB *gNB, dlsch->harq_processes[harq_pid]->d[r], dlsch->harq_processes[harq_pid]->e+r_offset, dlsch->harq_processes[harq_pid]->C, - dlsch->harq_processes[harq_pid]->rvidx, + rel15.redundancy_version, mod_order, - dlsch->harq_processes[harq_pid]->Nl, + rel15.nb_layers, r); #ifdef DEBUG_DLSCH_CODING diff --git a/openair1/PHY/NR_TRANSPORT/nr_sch_dmrs.c b/openair1/PHY/NR_TRANSPORT/nr_sch_dmrs.c index df4f9716fb..4ec1083cfc 100644 --- a/openair1/PHY/NR_TRANSPORT/nr_sch_dmrs.c +++ b/openair1/PHY/NR_TRANSPORT/nr_sch_dmrs.c @@ -36,7 +36,7 @@ /*Table 7.4.1.1.2-1 and 7.4.1.1.2-2 38211 Columns: ap - CDM group - Delta - Wf(0) - Wf(1) - Wt(0) - Wt(1)*/ int8_t pdsch_dmrs_1[8][7] = {{0,0,0,1,1,1,1}, {1,0,0,1,-1,1,1}, - {2,1,1,1,1,,1,1}, + {2,1,1,1,1,1,1}, {3,1,1,1,-1,1,1}, {4,0,0,1,1,1,-1}, {5,0,0,1,-1,1,-1}, @@ -56,22 +56,18 @@ int8_t pdsch_dmrs_2[12][7] = {{0,0,0,1,1,1,1}, {10,2,4,1,1,1,-1}, {11,2,4,1,-1,1,-1}}; -static inline void *get_l_prime(uint8_t n_symbs) { - uint8_t *l_prime; - for (int i=0; iL; - uint8_t Imcs = dlsch_rel15->Imcs; + uint8_t N_sh_symb = dlsch_rel15->nb_symbols; + uint8_t Imcs = dlsch_rel15->mcs_idx; uint16_t N_prime_RE = NR_NB_SC_PER_RB*N_sh_symb - N_PRB_DMRS - N_PRB_oh; LOG_I(MAC, "N_prime_RE %d for %d symbols %d DMRS per PRB and %d overhead\n", N_prime_RE, N_sh_symb, N_PRB_DMRS, N_PRB_oh); - uint16_t N_RE, Ninfo, Ninfo_prime, C; + uint16_t N_RE, Ninfo, Ninfo_prime, C, TBS; uint8_t table_idx, R, Qm, n, scale; table_idx = get_table_idx(mcs_table, dci_format, rnti_type, ss_type); @@ -132,14 +132,14 @@ void nr_get_tbs(NR_gNB_DLSCH_t *dlsch, N_RE = min(156, N_RE)*dlsch_rel15->n_prb; R = nr_get_code_rate(Imcs, table_idx); Qm = nr_get_Qm(Imcs, table_idx); - Ninfo = (N_RE*R*Qm*harq->Nl)>>scale; + Ninfo = (N_RE*R*Qm*dlsch_rel15->nb_layers)>>scale; if (Ninfo <= 3824) { n = max(3, (log2(Ninfo)-6)); Ninfo_prime = max(24, (Ninfo>>n)<= Ninfo_prime) { - harq->TBS = nr_tbs_table[i]; + TBS = nr_tbs_table[i]; break; } } @@ -149,24 +149,29 @@ void nr_get_tbs(NR_gNB_DLSCH_t *dlsch, if (R<256) { C = CEILIDIV((Ninfo_prime+24),3816); - harq->TBS = (C*CEILIDIV((Ninfo_prime+24),(C<<3)))<<3; + TBS = (C*CEILIDIV((Ninfo_prime+24),(C<<3)))<<3; } else { if (Ninfo_prime>8424) { C = CEILIDIV((Ninfo_prime+24),8424); - harq->TBS = (C*CEILIDIV((Ninfo_prime+24),(C<<3)))<<3; + TBS = (C*CEILIDIV((Ninfo_prime+24),(C<<3)))<<3; } else - harq->TBS = (CEILIDIV((Ninfo_prime+24),8) - 24)<<3; + TBS = (CEILIDIV((Ninfo_prime+24),8) - 24)<<3; } } LOG_I(MAC, "TBS %d : N_RE %d N_PRB_DMRS %d N_sh_symb %d N_PRB_oh %d Ninfo %d Ninfo_prime %d R %d Qm %d table %d scale %d\n", - harq->TBS, N_RE, N_PRB_DMRS, N_sh_symb, N_PRB_oh, Ninfo, Ninfo_prime, R, Qm, table_idx, scale); + TBS, N_RE, N_PRB_DMRS, N_sh_symb, N_PRB_oh, Ninfo, Ninfo_prime, R, Qm, table_idx, scale); + + dlsch_rel15->coding_rate = R; + dlsch_rel15->modulation_order = Qm; + dlsch_rel15->transport_block_size = TBS; + dlsch_rel15->nb_re_dmrs = N_PRB_DMRS; } uint32_t nr_get_G(uint16_t nb_rb, uint16_t nb_symb_sch,uint8_t nb_re_dmrs,uint16_t length_dmrs, uint8_t Qm, uint8_t Nl) { uint32_t G; - G = ((12*nb_symb_sch)-(nb_re_dmrs*length_dmrs))*nb_rb*Qm*Nl; + G = ((NR_NB_SC_PER_RB*nb_symb_sch)-(nb_re_dmrs*length_dmrs))*nb_rb*Qm*Nl; return(G); } diff --git a/openair1/PHY/defs_gNB.h b/openair1/PHY/defs_gNB.h index f62756bc68..da9d4443f9 100644 --- a/openair1/PHY/defs_gNB.h +++ b/openair1/PHY/defs_gNB.h @@ -70,8 +70,6 @@ typedef struct { typedef struct { /// Nfapi DLSCH PDU nfapi_nr_dl_config_dlsch_pdu dlsch_pdu; - /// Transport block size - uint32_t TBS; /// pointer to pdu from MAC interface (this is "a" in 36.212) uint8_t *pdu; /// The payload + CRC size in bits, "B" from 36-212 @@ -86,34 +84,8 @@ typedef struct { uint32_t subframe; /// Index of current HARQ round for this DLSCH uint8_t round; - /// Modulation order - uint8_t Qm; - /// MCS - uint8_t mcs; - /// Redundancy-version of the current sub-frame - uint8_t rvidx; /// MIMO mode for this DLSCH MIMO_mode_t mimo_mode; - /// Current RB allocation - uint32_t rb_alloc[4]; - /// distributed/localized flag - vrb_t vrb_type; - /// Current subband PMI allocation - uint16_t pmi_alloc; - /// Current subband RI allocation - uint32_t ri_alloc; - /// Current subband CQI1 allocation - uint32_t cqi_alloc1; - /// Current subband CQI2 allocation - uint32_t cqi_alloc2; - /// Current Number of RBs - uint16_t nb_rb; - /// Current NDI - uint8_t ndi; - /// downlink power offset field - uint8_t dl_power_off; - /// start symbold of pdsch - uint8_t pdsch_start; /// Concatenated sequences uint8_t e[MAX_NUM_NR_CHANNEL_BITS] __attribute__((aligned(32))); /// LDPC-code outputs @@ -126,15 +98,6 @@ typedef struct { uint32_t K; /// Number of "Filler" bits uint32_t F; - /// Number of MIMO layers (streams) - uint8_t Nl; - /// Number of layers for this PDSCH transmission (TM8-10) - uint8_t Nlayers; - /// First layer for this PSCH transmission - uint8_t first_layer; - /// codeword this transport block is mapped to - uint8_t codeword; - /// Number of codewords } NR_DL_gNB_HARQ_t; diff --git a/openair1/SCHED_NR/fapi_nr_l1.c b/openair1/SCHED_NR/fapi_nr_l1.c index e6fda71d39..1bf6286013 100644 --- a/openair1/SCHED_NR/fapi_nr_l1.c +++ b/openair1/SCHED_NR/fapi_nr_l1.c @@ -65,7 +65,7 @@ void handle_nfapi_nr_dci_dl_pdu(PHY_VARS_gNB *gNB, LOG_D(PHY,"Frame %d, Subframe %d: DCI processing - populating pdcch_vars->dci_alloc[%d] proc:subframe_tx:%d idx:%d pdcch_vars->num_dci:%d\n",frame,subframe, pdcch_vars->num_dci, proc->subframe_tx, idx, pdcch_vars->num_dci); // copy dci configuration into gNB structure - nr_fill_dci_and_dlsch(gNB,frame,subframe,proc,&pdcch_vars->dci_alloc[pdcch_vars->num_dci],dl_config_pdu); + nr_fill_dci_and_dlsch(gNB,frame,subframe,proc,&pdcch_vars->dci_alloc[pdcch_vars->num_dci],&dl_config_pdu->dci_dl_pdu, &dl_config_pdu->dlsch_pdu); LOG_D(PHY,"Frame %d, Subframe %d: DCI processing - populated pdcch_vars->dci_alloc[%d] proc:subframe_tx:%d idx:%d pdcch_vars->num_dci:%d\n",proc->frame_tx,proc->subframe_tx, pdcch_vars->num_dci, proc->subframe_tx, idx, pdcch_vars->num_dci); } diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_phytest.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_phytest.c index e562106d13..331a7fc5ce 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_phytest.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_phytest.c @@ -49,6 +49,7 @@ void nr_schedule_css_dlsch_phytest(module_id_t module_idP, nfapi_nr_dl_config_request_pdu_t *dl_config_pdu; nfapi_tx_request_pdu_t *TX_req; uint16_t sfn_sf = frameP << 4 | subframeP; + uint16_t rnti = 0x1234; for (CC_id=0; CC_idstart_prb = 0; dlsch_pdu_rel15->n_prb = 40; - dlsch_pdu_rel15->S = 8; - dlsch_pdu_rel15->L = 6; + dlsch_pdu_rel15->start_symbol = 8; + dlsch_pdu_rel15->nb_symbols = 6; + dlsch_pdu_rel15->rnti = rnti; nr_configure_css_dci_from_mib(&gNB->pdcch_type0_params, kHz30, kHz30, nr_FR1, 0, 0, @@ -79,36 +81,31 @@ void nr_schedule_css_dlsch_phytest(module_id_t module_idP, memcpy((void*)params_rel15, (void*)&gNB->pdcch_type0_params, sizeof(nfapi_nr_dl_config_pdcch_parameters_rel15_t)); pdu_rel15->frequency_domain_assignment = get_RIV(dlsch_pdu_rel15->start_prb, dlsch_pdu_rel15->n_prb, cfg->rf_config.dl_carrier_bandwidth.value); - pdu_rel15->time_domain_assignment = get_SLIV(dlsch_pdu_rel15->S, dlsch_pdu_rel15->L); + pdu_rel15->time_domain_assignment = get_SLIV(dlsch_pdu_rel15->start_symbol, dlsch_pdu_rel15->nb_symbols); pdu_rel15->vrb_to_prb_mapping = 1; pdu_rel15->mcs = 12; pdu_rel15->tb_scaling = 1; pdu_rel15->ra_preamble_index = 25; pdu_rel15->format_indicator = 1; - pdu_rel15->ul_sul_indicator = 1; - - pdu_rel15->ss_pbch_index = 21; - pdu_rel15->prach_mask_index = 3; pdu_rel15->ndi = 1; - pdu_rel15->rv = 2; - pdu_rel15->harq_pid = 7; + pdu_rel15->rv = 0; + pdu_rel15->harq_pid = 0; pdu_rel15->dai = 2; pdu_rel15->tpc = 2; pdu_rel15->pucch_resource_indicator = 7; pdu_rel15->pdsch_to_harq_feedback_timing_indicator = 7; - - - 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, mcs %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 ndi %d rv %d\n", pdu_rel15->frequency_domain_assignment, pdu_rel15->time_domain_assignment, pdu_rel15->vrb_to_prb_mapping, pdu_rel15->mcs, - pdu_rel15->tb_scaling); + pdu_rel15->tb_scaling, + pdu_rel15->ndi, + pdu_rel15->rv); - params_rel15->rnti = 0x03; + params_rel15->rnti = rnti; params_rel15->rnti_type = NFAPI_NR_RNTI_C; params_rel15->dci_format = NFAPI_NR_DL_DCI_FORMAT_1_0; //params_rel15->aggregation_level = 1; @@ -129,7 +126,8 @@ void nr_schedule_css_dlsch_phytest(module_id_t module_idP, params_rel15->sfn_mod2, params_rel15->first_slot); dl_req->number_dci++; - dl_req->number_pdu++; + dl_req->number_pdsch_rnti++; + dl_req->number_pdu+=2; TX_req = &nr_mac->TX_req[CC_id].tx_request_body.tx_pdu_list[nr_mac->TX_req[CC_id].tx_request_body.number_of_pdus]; TX_req->pdu_length = 6;