Commit a269ad84 authored by Thomas Schlichter's avatar Thomas Schlichter

NR UE: modify nr_gold_pdsch() to only generate gold sequence for current slot

parent 4f98a626
...@@ -107,9 +107,10 @@ void nr_gold_pdcch(PHY_VARS_NR_UE* ue, ...@@ -107,9 +107,10 @@ void nr_gold_pdcch(PHY_VARS_NR_UE* ue,
} }
void nr_gold_pdsch(PHY_VARS_NR_UE* ue, void nr_gold_pdsch(PHY_VARS_NR_UE* ue,
unsigned char ns,
unsigned short *n_idDMRS) unsigned short *n_idDMRS)
{ {
unsigned char ns,l; unsigned char l;
unsigned int n,x1,x2,x2tmp0; unsigned int n,x1,x2,x2tmp0;
int nscid; int nscid;
unsigned int nid; unsigned int nid;
...@@ -122,40 +123,35 @@ void nr_gold_pdsch(PHY_VARS_NR_UE* ue, ...@@ -122,40 +123,35 @@ void nr_gold_pdsch(PHY_VARS_NR_UE* ue,
nid = n_idDMRS[nscid]; nid = n_idDMRS[nscid];
else else
nid = ue->frame_parms.Nid_cell; nid = ue->frame_parms.Nid_cell;
//printf("gold pdsch nid %d lbar %d\n",nid,lbar);
for (ns=0; ns<20; ns++) {
for (l=0; l<14; l++) { //printf("gold pdsch nid %d lbar %d\n",nid,lbar);
x2tmp0 = ((14*ns+l+1)*((nid<<1)+1))<<17; for (l=0; l<14; l++) {
x2 = (x2tmp0+(nid<<1)+nscid)%(1<<31); //cinit x2tmp0 = ((14*ns+l+1)*((nid<<1)+1))<<17;
LOG_D(PHY,"UE DMRS slot %d, symb %d, x2 %x, nscid %d\n",ns,l,x2,nscid); x2 = (x2tmp0+(nid<<1)+nscid)%(1<<31); //cinit
//printf("ns %d gold pdsch x2 %d\n",ns,x2); LOG_D(PHY,"UE DMRS slot %d, symb %d, x2 %x, nscid %d\n",ns,l,x2,nscid);
//printf("ns %d gold pdsch x2 %d\n",ns,x2);
x1 = 1+ (1<<31); x1 = 1+ (1<<31);
x2=x2 ^ ((x2 ^ (x2>>1) ^ (x2>>2) ^ (x2>>3))<<31); x2=x2 ^ ((x2 ^ (x2>>1) ^ (x2>>2) ^ (x2>>3))<<31);
// skip first 50 double words (1600 bits)
for (n=1; n<50; n++) {
x1 = (x1>>1) ^ (x1>>4);
x1 = x1 ^ (x1<<31) ^ (x1<<28);
x2 = (x2>>1) ^ (x2>>2) ^ (x2>>3) ^ (x2>>4);
x2 = x2 ^ (x2<<31) ^ (x2<<30) ^ (x2<<29) ^ (x2<<28);
//printf("x1 : %x, x2 : %x\n",x1,x2);
}
for (n=0; n<NR_MAX_PDSCH_DMRS_INIT_LENGTH_DWORD; n++) { // skip first 50 double words (1600 bits)
x1 = (x1>>1) ^ (x1>>4); for (n=1; n<50; n++) {
x1 = x1 ^ (x1<<31) ^ (x1<<28); x1 = (x1>>1) ^ (x1>>4);
x2 = (x2>>1) ^ (x2>>2) ^ (x2>>3) ^ (x2>>4); x1 = x1 ^ (x1<<31) ^ (x1<<28);
x2 = x2 ^ (x2<<31) ^ (x2<<30) ^ (x2<<29) ^ (x2<<28); x2 = (x2>>1) ^ (x2>>2) ^ (x2>>3) ^ (x2>>4);
ue->nr_gold_pdsch[nscid][ns][l][n] = x1^x2; x2 = x2 ^ (x2<<31) ^ (x2<<30) ^ (x2<<29) ^ (x2<<28);
// if ((ns==2)&&(l==0)) //printf("x1 : %x, x2 : %x\n",x1,x2);
//printf("n=%d : c %x\n",n,x1^x2); }
}
for (n=0; n<NR_MAX_PDSCH_DMRS_INIT_LENGTH_DWORD; n++) {
x1 = (x1>>1) ^ (x1>>4);
x1 = x1 ^ (x1<<31) ^ (x1<<28);
x2 = (x2>>1) ^ (x2>>2) ^ (x2>>3) ^ (x2>>4);
x2 = x2 ^ (x2<<31) ^ (x2<<30) ^ (x2<<29) ^ (x2<<28);
ue->nr_gold_pdsch[nscid][ns][l][n] = x1^x2;
// if ((ns==2)&&(l==0))
//printf("n=%d : c %x\n",n,x1^x2);
} }
} }
} }
......
...@@ -61,6 +61,7 @@ void nr_gold_pdcch(PHY_VARS_NR_UE* ue, ...@@ -61,6 +61,7 @@ void nr_gold_pdcch(PHY_VARS_NR_UE* ue,
unsigned short length_dmrs); unsigned short length_dmrs);
void nr_gold_pdsch(PHY_VARS_NR_UE* ue, void nr_gold_pdsch(PHY_VARS_NR_UE* ue,
unsigned char ns,
unsigned short *n_idDMRS); unsigned short *n_idDMRS);
void nr_init_pusch_dmrs(PHY_VARS_NR_UE* ue, void nr_init_pusch_dmrs(PHY_VARS_NR_UE* ue,
......
...@@ -1847,8 +1847,8 @@ int phy_procedures_nrUE_RX(PHY_VARS_NR_UE *ue, ...@@ -1847,8 +1847,8 @@ int phy_procedures_nrUE_RX(PHY_VARS_NR_UE *ue,
for (int i=0;i<4;i++) if (((1<<i)&dlsch0_harq->dlDmrsSymbPos) > 0) {symb_dmrs=i;break;} for (int i=0;i<4;i++) if (((1<<i)&dlsch0_harq->dlDmrsSymbPos) > 0) {symb_dmrs=i;break;}
AssertFatal(symb_dmrs>=0,"no dmrs in 0..3\n"); AssertFatal(symb_dmrs>=0,"no dmrs in 0..3\n");
LOG_D(PHY,"Initializing dmrs for symb %d DMRS mask %x\n",symb_dmrs,dlsch0_harq->dlDmrsSymbPos); LOG_D(PHY,"Initializing dmrs for slot %d DMRS mask %x\n", nr_slot_rx, dlsch0_harq->dlDmrsSymbPos);
nr_gold_pdsch(ue,0); nr_gold_pdsch(ue, nr_slot_rx, 0);
for (uint16_t m=start_symb_sch;m<(nb_symb_sch+start_symb_sch) ; m++){ for (uint16_t m=start_symb_sch;m<(nb_symb_sch+start_symb_sch) ; m++){
nr_slot_fep(ue, nr_slot_fep(ue,
......
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