Commit 45b86847 authored by luis_pereira87's avatar luis_pereira87

Fix DMRS sequence generation for BWPStart>0 (Msg2 and Msg4)

parent 6ecf50bc
......@@ -151,7 +151,7 @@ uint8_t nr_generate_pdsch(PHY_VARS_gNB *gNB,
else {
nb_re_dmrs = 4*rel15->numDmrsCdmGrpsNoData;
}
n_dmrs = (rel15->rbSize+rel15->rbStart)*nb_re_dmrs;
n_dmrs = (rel15->BWPStart+rel15->rbStart+rel15->rbSize)*nb_re_dmrs;
uint16_t dmrs_symbol_map = rel15->dlDmrsSymbPos;//single DMRS: 010000100 Double DMRS 110001100
uint8_t dmrs_len = get_num_dmrs(rel15->dlDmrsSymbPos);
......@@ -320,12 +320,25 @@ uint8_t nr_generate_pdsch(PHY_VARS_gNB *gNB,
/// DMRS QPSK modulation
uint8_t k_prime=0;
uint16_t n=0;
if ((dmrs_symbol_map & (1 << l))){ //DMRS time occasion
if (dmrs_Type == NFAPI_NR_DMRS_TYPE1) // another if condition to be included to check pdsch config type (reference of k)
if ((dmrs_symbol_map & (1 << l))){ // DMRS time occasion
// The reference point for is subcarrier 0 of the lowest-numbered resource block in CORESET 0 if the corresponding
// PDCCH is associated with CORESET 0 and Type0-PDCCH common search space and is addressed to SI-RNTI
// 3GPP TS 38.211 V15.8.0 Section 7.4.1.1.2 Mapping to physical resources
if (rel15->rnti==SI_RNTI) {
if (dmrs_Type==NFAPI_NR_DMRS_TYPE1) {
dmrs_idx = rel15->rbStart*6;
else
} else {
dmrs_idx = rel15->rbStart*4;
}
} else {
if (dmrs_Type == NFAPI_NR_DMRS_TYPE1) {
dmrs_idx = (rel15->rbStart+rel15->BWPStart)*6;
} else {
dmrs_idx = (rel15->rbStart+rel15->BWPStart)*4;
}
}
}
// Update l_prime in the case of double DMRS config
if ((dmrs_symbol_map & (1 << l))){ //DMRS time occasion
......
......@@ -687,7 +687,10 @@ int nr_pdsch_channel_estimation(PHY_VARS_NR_UE *ue,
#endif
// generate pilot for gNB port number 1000+p
uint16_t rb_offset = (bwp_start_subcarrier - ue->frame_parms.first_carrier_offset) / 12 - BWPStart;
uint16_t rb_offset = (bwp_start_subcarrier - ue->frame_parms.first_carrier_offset) / 12;
if (Ns % 20 == 0) { // FIXME: temporary fix for SIB1
rb_offset = (bwp_start_subcarrier - ue->frame_parms.first_carrier_offset) / 12 - BWPStart;
}
uint8_t config_type = ue->dmrs_DownlinkConfig.pdsch_dmrs_type;
int8_t delta = get_delta(p, config_type);
nr_pdsch_dmrs_rx(ue,Ns,ue->nr_gold_pdsch[eNB_offset][Ns][symbol][0], &pilot[0],1000,0,nb_rb_pdsch+rb_offset);
......
......@@ -832,7 +832,7 @@ void nr_generate_Msg2(module_id_t module_idP, int CC_id, frame_t frameP, sub_fra
if ((ra->Msg2_frame == frameP) && (ra->Msg2_slot == slotP)) {
uint8_t time_domain_assignment = 0;
uint8_t time_domain_assignment = 3;
uint8_t mcsIndex = 0;
int rbStart = 0;
int rbSize = 6;
......
......@@ -106,7 +106,7 @@ gNBs =
prach_msg1_FDM = 0;
prach_msg1_FrequencyStart = 0;
zeroCorrelationZoneConfig = 13;
preambleReceivedTargetPower = -100;
preambleReceivedTargetPower = -96;
#preamblTransMax (0...10) = (3,4,5,6,7,8,10,20,50,100,200)
preambleTransMax = 6;
#powerRampingStep
......
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