Merge remote-tracking branch 'origin/develop' into NR_MAC_SSB
This commit is contained in:
@@ -142,6 +142,8 @@ int phy_init_nr_gNB(PHY_VARS_gNB *gNB,
|
||||
uint32_t ***pdcch_dmrs = gNB->nr_gold_pdcch_dmrs;
|
||||
AssertFatal(pdcch_dmrs!=NULL, "NR init: pdcch_dmrs malloc failed\n");
|
||||
|
||||
gNB->bad_pucch = 0;
|
||||
|
||||
for (int slot=0; slot<fp->slots_per_frame; slot++) {
|
||||
pdcch_dmrs[slot] = (uint32_t **)malloc16(fp->symbols_per_slot*sizeof(uint32_t *));
|
||||
AssertFatal(pdcch_dmrs[slot]!=NULL, "NR init: pdcch_dmrs for slot %d - malloc failed\n", slot);
|
||||
@@ -231,13 +233,15 @@ int phy_init_nr_gNB(PHY_VARS_gNB *gNB,
|
||||
common_vars->rxdata = (int32_t **)malloc16(Prx*sizeof(int32_t*));
|
||||
common_vars->txdataF = (int32_t **)malloc16(Ptx*sizeof(int32_t*));
|
||||
common_vars->rxdataF = (int32_t **)malloc16(Prx*sizeof(int32_t*));
|
||||
common_vars->beam_id = (uint8_t **)malloc16(Ptx*sizeof(uint8_t*));
|
||||
|
||||
for (i=0;i<Ptx;i++){
|
||||
common_vars->txdataF[i] = (int32_t*)malloc16_clear(fp->samples_per_frame_wCP*sizeof(int32_t)); // [hna] samples_per_frame without CP
|
||||
LOG_D(PHY,"[INIT] common_vars->txdataF[%d] = %p (%lu bytes)\n",
|
||||
i,common_vars->txdataF[i],
|
||||
fp->samples_per_frame_wCP*sizeof(int32_t));
|
||||
|
||||
common_vars->beam_id[i] = (uint8_t*)malloc16_clear(fp->symbols_per_slot*fp->slots_per_frame*sizeof(uint8_t));
|
||||
memset(common_vars->beam_id[i],255,fp->symbols_per_slot*fp->slots_per_frame);
|
||||
}
|
||||
for (i=0;i<Prx;i++){
|
||||
common_vars->rxdataF[i] = (int32_t*)malloc16_clear(fp->samples_per_frame_wCP*sizeof(int32_t));
|
||||
@@ -474,7 +478,8 @@ void nr_phy_config_request_sim(PHY_VARS_gNB *gNB,
|
||||
fp->nr_band = 261;
|
||||
// fp->threequarter_fs= 0;
|
||||
}
|
||||
|
||||
|
||||
fp->threequarter_fs = 0;
|
||||
gNB_config->carrier_config.dl_bandwidth.value = config_bandwidth(mu, N_RB_DL, fp->nr_band);
|
||||
|
||||
nr_init_frame_parms(gNB_config, fp);
|
||||
|
||||
@@ -138,7 +138,7 @@ int nr_phy_init_RU(RU_t *ru) {
|
||||
for (j=0; j<ru->nb_tx; j++) {
|
||||
ru->beam_weights[i][p][j] = (int32_t *)malloc16_clear(fp->ofdm_symbol_size*sizeof(int32_t));
|
||||
for (re=0; re<fp->ofdm_symbol_size; re++)
|
||||
ru->beam_weights[i][p][j][re] = ru->bw_list[i][l_ind];
|
||||
ru->beam_weights[i][p][j][re] = ru->bw_list[j][l_ind];
|
||||
//printf("Beam Weight %08x for beam %d and tx %d\n",ru->bw_list[i][l_ind],p,j);
|
||||
l_ind++;
|
||||
} // for j
|
||||
@@ -146,6 +146,12 @@ int nr_phy_init_RU(RU_t *ru) {
|
||||
} // for p
|
||||
} //for i
|
||||
}
|
||||
|
||||
ru->common.beam_id = (uint8_t**)malloc16_clear(ru->nb_tx*sizeof(uint8_t*));
|
||||
for(i=0; i< ru->nb_tx; ++i) {
|
||||
ru->common.beam_id[i] = (uint8_t*)malloc16_clear(fp->symbols_per_slot*fp->slots_per_frame*sizeof(uint8_t));
|
||||
memset(ru->common.beam_id[i],255,fp->symbols_per_slot*fp->slots_per_frame);
|
||||
}
|
||||
} // !=IF5
|
||||
|
||||
ru->common.sync_corr = (uint32_t*)malloc16_clear( LTE_NUMBER_OF_SUBFRAMES_PER_FRAME*sizeof(uint32_t)*fp->samples_per_subframe_wCP );
|
||||
|
||||
@@ -292,7 +292,10 @@ int init_nr_ue_signal(PHY_VARS_NR_UE *ue,
|
||||
}
|
||||
}
|
||||
|
||||
//PDSCH DMRS init (gNB offset = 0)
|
||||
ue->scramblingID_pdcch = fp->Nid_cell;
|
||||
nr_gold_pdcch(ue,fp->Nid_cell);
|
||||
|
||||
//PDSCH DMRS init (eNB offset = 0)
|
||||
ue->nr_gold_pdsch[0] = (uint32_t ****)malloc16(fp->slots_per_frame*sizeof(uint32_t ***));
|
||||
uint32_t ****pdsch_dmrs = ue->nr_gold_pdsch[0];
|
||||
|
||||
@@ -311,6 +314,12 @@ int init_nr_ue_signal(PHY_VARS_NR_UE *ue,
|
||||
}
|
||||
}
|
||||
|
||||
// initializing the scrambling IDs for PDSCH DMRS
|
||||
for (int i=0; i<2; i++)
|
||||
ue->scramblingID[i]=fp->Nid_cell;
|
||||
|
||||
nr_gold_pdsch(ue,ue->scramblingID);
|
||||
|
||||
// DLSCH
|
||||
for (gNB_id = 0; gNB_id < ue->n_connected_gNB; gNB_id++) {
|
||||
for (th_id=0; th_id<RX_NB_TH_MAX; th_id++) {
|
||||
|
||||
@@ -52,22 +52,15 @@ void nr_gold_pbch(PHY_VARS_NR_UE* ue)
|
||||
}
|
||||
|
||||
void nr_gold_pdcch(PHY_VARS_NR_UE* ue,
|
||||
unsigned short n_idDMRS,
|
||||
unsigned short length_dmrs)
|
||||
unsigned short nid)
|
||||
{
|
||||
unsigned char ns,l;
|
||||
unsigned int n,x1,x2,x2tmp0;
|
||||
unsigned int nid;
|
||||
uint8_t reset;
|
||||
|
||||
if (n_idDMRS)
|
||||
nid = n_idDMRS;
|
||||
else
|
||||
nid = ue->frame_parms.Nid_cell;
|
||||
|
||||
for (ns=0; ns<ue->frame_parms.slots_per_frame; ns++) {
|
||||
|
||||
for (l=0; l<length_dmrs; l++) {
|
||||
for (l=0; l<ue->frame_parms.symbols_per_slot; l++) {
|
||||
|
||||
reset = 1;
|
||||
x2tmp0 = ((ue->frame_parms.symbols_per_slot*ns+l+1)*((nid<<1)+1))<<17;
|
||||
@@ -82,11 +75,10 @@ void nr_gold_pdcch(PHY_VARS_NR_UE* ue,
|
||||
}
|
||||
|
||||
void nr_gold_pdsch(PHY_VARS_NR_UE* ue,
|
||||
unsigned char ns,
|
||||
unsigned short *n_idDMRS)
|
||||
{
|
||||
unsigned char l;
|
||||
unsigned int n,x1,x2,x2tmp0;
|
||||
unsigned int n,x1,x2,x2tmp0,ns;
|
||||
int nscid;
|
||||
unsigned int nid;
|
||||
uint8_t reset;
|
||||
@@ -95,23 +87,21 @@ void nr_gold_pdsch(PHY_VARS_NR_UE* ue,
|
||||
//unsigned short lbar = 0;
|
||||
|
||||
for (nscid=0; nscid<2; nscid++) {
|
||||
if (n_idDMRS)
|
||||
for (ns=0; ns<ue->frame_parms.slots_per_frame; ns++) {
|
||||
|
||||
nid = n_idDMRS[nscid];
|
||||
else
|
||||
nid = ue->frame_parms.Nid_cell;
|
||||
|
||||
//printf("gold pdsch nid %d lbar %d\n",nid,lbar);
|
||||
for (l=0; l<ue->frame_parms.symbols_per_slot; l++) {
|
||||
|
||||
for (l=0; l<ue->frame_parms.symbols_per_slot; l++) {
|
||||
reset = 1;
|
||||
x2tmp0 = ((ue->frame_parms.symbols_per_slot*ns+l+1)*((nid<<1)+1))<<17;
|
||||
x2 = (x2tmp0+(nid<<1)+nscid)%(1<<31); //cinit
|
||||
LOG_D(PHY,"UE DMRS slot %d, symb %d, x2 %x, nscid %d\n",ns,l,x2,nscid);
|
||||
|
||||
reset = 1;
|
||||
x2tmp0 = ((ue->frame_parms.symbols_per_slot*ns+l+1)*((nid<<1)+1))<<17;
|
||||
x2 = (x2tmp0+(nid<<1)+nscid)%(1<<31); //cinit
|
||||
LOG_D(PHY,"UE DMRS slot %d, symb %d, x2 %x, nscid %d\n",ns,l,x2,nscid);
|
||||
|
||||
for (n=0; n<NR_MAX_PDSCH_DMRS_INIT_LENGTH_DWORD; n++) {
|
||||
ue->nr_gold_pdsch[0][ns][l][nscid][n] = lte_gold_generic(&x1, &x2, reset);
|
||||
reset = 0;
|
||||
for (n=0; n<NR_MAX_PDSCH_DMRS_INIT_LENGTH_DWORD; n++) {
|
||||
ue->nr_gold_pdsch[0][ns][l][nscid][n] = lte_gold_generic(&x1, &x2, reset);
|
||||
reset = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -57,11 +57,9 @@ int nr_pdsch_dmrs_rx(PHY_VARS_NR_UE *ue,
|
||||
void nr_gold_pbch(PHY_VARS_NR_UE* ue);
|
||||
|
||||
void nr_gold_pdcch(PHY_VARS_NR_UE* ue,
|
||||
unsigned short n_idDMRS,
|
||||
unsigned short length_dmrs);
|
||||
unsigned short n_idDMRS);
|
||||
|
||||
void nr_gold_pdsch(PHY_VARS_NR_UE* ue,
|
||||
unsigned char ns,
|
||||
unsigned short *n_idDMRS);
|
||||
|
||||
void nr_init_pusch_dmrs(PHY_VARS_NR_UE* ue,
|
||||
|
||||
@@ -225,6 +225,7 @@ void nr_generate_dci(PHY_VARS_gNB *gNB,
|
||||
printf("PDCCH: l %d position %d => (%d,%d)\n",l,k,((int16_t *)txdataF)[(l*frame_parms.ofdm_symbol_size + k)<<1],
|
||||
((int16_t *)txdataF)[((l*frame_parms.ofdm_symbol_size + k)<<1)+1]);
|
||||
#endif
|
||||
|
||||
dci_idx++;
|
||||
}
|
||||
|
||||
|
||||
@@ -412,9 +412,9 @@ uint8_t nr_generate_pdsch(PHY_VARS_gNB *gNB,
|
||||
|
||||
///Layer Precoding and Antenna port mapping
|
||||
// tx_layers 1-8 are mapped on antenna ports 1000-1007
|
||||
// The precoding info is supported by nfapi such as numPRGs, prgSize, and PMIdx
|
||||
// The same precoding matrix is applied on prgSize RBs, Thus
|
||||
// pmi = PMIdx[rbidx/prgSize], rbidx =0,...,rbSize-1
|
||||
// The precoding info is supported by nfapi such as num_prgs, prg_size, prgs_list and pm_idx
|
||||
// The same precoding matrix is applied on prg_size RBs, Thus
|
||||
// pmi = prgs_list[rbidx/prg_size].pm_idx, rbidx =0,...,rbSize-1
|
||||
// The Precoding matrix:
|
||||
// The Codebook Type I and Type II are not supported yet.
|
||||
// We adopt the precoding matrices of PUSCH for 4 layers.
|
||||
@@ -426,8 +426,8 @@ uint8_t nr_generate_pdsch(PHY_VARS_gNB *gNB,
|
||||
for (int rb=0; rb<rel15->rbSize; rb++) {
|
||||
//get pmi info
|
||||
uint8_t pmi;
|
||||
if (rel15->precodingAndBeamforming.prgSize > 0)
|
||||
pmi = rel15->precodingAndBeamforming.PMIdx[(int)rb/rel15->precodingAndBeamforming.prgSize];
|
||||
if (rel15->precodingAndBeamforming.prg_size > 0)
|
||||
pmi = rel15->precodingAndBeamforming.prgs_list[(int)rb/rel15->precodingAndBeamforming.prg_size].pm_idx;
|
||||
else
|
||||
pmi = 0;//no precoding
|
||||
|
||||
@@ -493,7 +493,25 @@ uint8_t nr_generate_pdsch(PHY_VARS_gNB *gNB,
|
||||
}// port loop
|
||||
|
||||
dlsch->slot_tx[slot]=0;
|
||||
|
||||
// TODO: handle precoding
|
||||
// this maps the layers onto antenna ports
|
||||
|
||||
// handle beamforming ID
|
||||
// each antenna port is assigned a beam_index
|
||||
// since PHY can only handle BF on slot basis we set the whole slot
|
||||
|
||||
// first check if this slot has not already been allocated to another beam
|
||||
if (gNB->common_vars.beam_id[0][slot*frame_parms->symbols_per_slot]==255) {
|
||||
for (int j=0;j<frame_parms->symbols_per_slot;j++)
|
||||
gNB->common_vars.beam_id[0][slot*frame_parms->symbols_per_slot+j] = rel15->precodingAndBeamforming.prgs_list[0].dig_bf_interface_list[0].beam_idx;
|
||||
}
|
||||
else {
|
||||
LOG_W(PHY,"beam index for PDSCH allocation already taken\n");
|
||||
}
|
||||
}// dlsch loop
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -108,8 +108,6 @@ void free_gNB_dlsch(NR_gNB_DLSCH_t **dlschptr, uint16_t N_RB)
|
||||
harq->d[r] = NULL;
|
||||
}
|
||||
}
|
||||
free16(harq, sizeof(NR_DL_gNB_HARQ_t));
|
||||
harq = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -390,6 +390,7 @@ void nr_decode_pucch0(PHY_VARS_gNB *gNB,
|
||||
if ((xrtmag_dB<(11+dB_fixed(no_corr))) || (dB_fixed(av_corr)<(13+gNB->measurements.n0_power_tot_dB))) //TODO these are temporary threshold based on measurments with the phone
|
||||
no_conf=true;
|
||||
}
|
||||
gNB->bad_pucch += no_conf;
|
||||
// first bit of bitmap for sr presence and second bit for acknack presence
|
||||
uci_pdu->pduBitmap = pucch_pdu->sr_flag | ((pucch_pdu->bit_len_harq>0)<<1);
|
||||
uci_pdu->pucch_format = 0; // format 0
|
||||
|
||||
@@ -512,6 +512,13 @@ int nr_pdcch_channel_estimation(PHY_VARS_NR_UE *ue,
|
||||
fr = filt16a_r1;
|
||||
|
||||
|
||||
// checking if re-initialization of scrambling IDs is needed (should be done here but scrambling ID for PDCCH is not taken from RRC)
|
||||
/* if (( != ue->scramblingID_pdcch){
|
||||
ue->scramblingID_pdcch=;
|
||||
nr_gold_pdsch(ue,ue->scramblingID_pdcch);
|
||||
}*/
|
||||
|
||||
|
||||
// generate pilot
|
||||
int pilot[nb_rb_coreset * 3] __attribute__((aligned(16)));
|
||||
nr_pdcch_dmrs_rx(ue,eNB_offset,Ns,ue->nr_gold_pdcch[eNB_offset][Ns][symbol], &pilot[0],2000,nb_rb_coreset);
|
||||
@@ -690,6 +697,14 @@ int nr_pdsch_channel_estimation(PHY_VARS_NR_UE *ue,
|
||||
uint16_t 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);
|
||||
|
||||
// checking if re-initialization of scrambling IDs is needed
|
||||
if ((ue->dmrs_DownlinkConfig.scramblingID0 != ue->scramblingID[0]) || (ue->dmrs_DownlinkConfig.scramblingID1 != ue->scramblingID[1])){
|
||||
ue->scramblingID[0]=ue->dmrs_DownlinkConfig.scramblingID0;
|
||||
ue->scramblingID[1]=ue->dmrs_DownlinkConfig.scramblingID1;
|
||||
nr_gold_pdsch(ue,ue->scramblingID);
|
||||
}
|
||||
|
||||
nr_pdsch_dmrs_rx(ue,Ns,ue->nr_gold_pdsch[eNB_offset][Ns][symbol][0], &pilot[0],1000+p,0,nb_rb_pdsch+rb_offset);
|
||||
|
||||
if (config_type == pdsch_dmrs_type1){
|
||||
|
||||
@@ -316,7 +316,6 @@ int nr_initial_sync(UE_nr_rxtx_proc_t *proc, PHY_VARS_NR_UE *ue, int n_frames)
|
||||
ue->init_sync_frame = is;
|
||||
}
|
||||
|
||||
nr_gold_pdcch(ue,0, 2);
|
||||
/*
|
||||
int nb_prefix_samples0 = fp->nb_prefix_samples0;
|
||||
fp->nb_prefix_samples0 = fp->nb_prefix_samples;
|
||||
|
||||
@@ -213,7 +213,7 @@ void generate_pss_nr(NR_DL_FRAME_PARMS *fp,int N_ID_2)
|
||||
}
|
||||
|
||||
for (int n=0; n < LENGTH_PSS_NR; n++) {
|
||||
int m = (n + 43*N_ID_2)%(LENGTH_PSS_NR);
|
||||
int m = (n + 43*N_ID_2)%(LENGTH_PSS_NR);
|
||||
d_pss[n] = 1 - 2*x[m];
|
||||
}
|
||||
|
||||
|
||||
+11
-7
@@ -92,17 +92,17 @@ typedef enum {
|
||||
|
||||
|
||||
typedef struct {
|
||||
/// \brief Holds the transmit data in the frequency domain.
|
||||
/// \brief Holds the transmit data in the frequency domain (1 frame).
|
||||
/// - first index: rx antenna [0..nb_antennas_rx[
|
||||
/// - second index: ? [0..2*ofdm_symbol_size*frame_parms->symbols_per_tti[
|
||||
/// - second index: ? [0..samples_per_frame[
|
||||
int32_t **txdata;
|
||||
/// \brief holds the transmit data after beamforming in the frequency domain.
|
||||
/// \brief holds the transmit data after beamforming in the frequency domain (1 slot).
|
||||
/// - first index: tx antenna [0..nb_antennas_tx[
|
||||
/// - second index: sample [0..]
|
||||
/// - second index: sample [0..samples_per_slot_woCP]
|
||||
int32_t **txdataF_BF;
|
||||
/// \brief holds the transmit data before beamforming in the frequency domain.
|
||||
/// - first index: tx antenna [0..nb_antennas_tx[
|
||||
/// - second index: sample [0..]
|
||||
/// \brief holds the transmit data before beamforming in the frequency domain (1 frame).
|
||||
/// - first index: tx antenna [0..nb_antenna_ports[
|
||||
/// - second index: sample [0..samples_per_frame_woCP]
|
||||
int32_t **txdataF;
|
||||
/// \brief holds the transmit data before beamforming for epdcch/mpdcch
|
||||
/// - first index : tx antenna [0..nb_epdcch_antenna_ports[
|
||||
@@ -128,6 +128,10 @@ typedef struct {
|
||||
/// - second index: tx antenna [0..nb_antennas_tx[
|
||||
/// - third index: frequency [0..]
|
||||
int32_t **tdd_calib_coeffs;
|
||||
/// \brief Anaglogue beam ID for each OFDM symbol (used when beamforming not done in RU)
|
||||
/// - first index: antenna port
|
||||
/// - second index: beam_id [0.. symbols_per_frame[
|
||||
uint8_t **beam_id;
|
||||
} RU_COMMON;
|
||||
|
||||
|
||||
|
||||
@@ -390,8 +390,12 @@ typedef struct {
|
||||
/// For IFFT_FPGA this points to the same memory as PHY_vars->rx_vars[a].RX_DMA_BUFFER. //?
|
||||
/// - first index: eNB id [0..2] (hard coded)
|
||||
/// - second index: tx antenna [0..14[ where 14 is the total supported antenna ports.
|
||||
/// - third index: sample [0..]
|
||||
/// - third index: sample [0..samples_per_frame_woCP]
|
||||
int32_t **txdataF;
|
||||
/// \brief Anaglogue beam ID for each OFDM symbol (used when beamforming not done in RU)
|
||||
/// - first index: antenna port
|
||||
/// - second index: beam_id [0.. symbols_per_frame[
|
||||
uint8_t **beam_id;
|
||||
int32_t *debugBuff;
|
||||
int32_t debugBuff_sample_offset;
|
||||
} NR_gNB_COMMON;
|
||||
@@ -796,6 +800,7 @@ typedef struct PHY_VARS_gNB_s {
|
||||
int prach_energy_counter;
|
||||
|
||||
int pucch0_thres;
|
||||
uint64_t bad_pucch;
|
||||
/*
|
||||
time_stats_t phy_proc;
|
||||
*/
|
||||
|
||||
@@ -840,9 +840,15 @@ typedef struct {
|
||||
/// PDSCH DMRS
|
||||
uint32_t ****nr_gold_pdsch[NUMBER_OF_CONNECTED_eNB_MAX];
|
||||
|
||||
// Scrambling IDs used in PDSCH DMRS
|
||||
uint16_t scramblingID[2];
|
||||
|
||||
/// PDCCH DMRS
|
||||
uint32_t ***nr_gold_pdcch[NUMBER_OF_CONNECTED_eNB_MAX];
|
||||
|
||||
// Scrambling IDs used in PDCCH DMRS
|
||||
uint16_t scramblingID_pdcch;
|
||||
|
||||
/// PUSCH DMRS sequence
|
||||
uint32_t ****nr_gold_pusch_dmrs;
|
||||
|
||||
|
||||
@@ -275,6 +275,12 @@
|
||||
#define NR_UE_CAPABILITY_SLOT_RX_TO_TX (6) /* FFS_NR_TODO it defines ue capability which is the number of slots */
|
||||
/* - between reception of pdsch and tarnsmission of its acknowlegment */
|
||||
/* - between reception of un uplink grant and its related transmission */
|
||||
#ifndef NO_RAT_NR
|
||||
#define DURATION_RX_TO_TX (NR_UE_CAPABILITY_SLOT_RX_TO_TX) /* for NR this will certainly depends to such UE capability which is not yet defined */
|
||||
#else
|
||||
#define DURATION_RX_TO_TX (6) /* For LTE, this duration is fixed to 4 and it is linked to LTE standard for both modes FDD/TDD */
|
||||
#endif
|
||||
|
||||
|
||||
#define NR_MAX_HARQ_PROCESSES (16)
|
||||
#define NR_MAX_ULSCH_HARQ_PROCESSES (NR_MAX_HARQ_PROCESSES) /* cf 38.214 6.1 UE procedure for receiving the physical uplink shared channel */
|
||||
|
||||
@@ -208,6 +208,7 @@ void nr_feptx_ofdm_2thread(RU_t *ru,int frame_tx,int tti_tx) {
|
||||
memcpy((void*)&ru->common.txdataF[i][j*fp->ofdm_symbol_size],
|
||||
(void*)&gNB->common_vars.txdataF[i][j*fp->ofdm_symbol_size + txdataF_offset],
|
||||
fp->ofdm_symbol_size*sizeof(int32_t));
|
||||
|
||||
}
|
||||
|
||||
}//num_gNB == 1
|
||||
@@ -304,11 +305,20 @@ static void *nr_feptx_thread(void *param) {
|
||||
txdataF_offset = ((slot%2)*fp->samples_per_slot_wCP);
|
||||
////////////precoding////////////
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPTX_PREC+feptx->index+1 , 1);
|
||||
|
||||
start_meas(&ru->precoding_stats);
|
||||
|
||||
for(i=0; i<ru->nb_log_antennas; ++i) {
|
||||
memcpy((void*) &ru->common.beam_id[i][slot*fp->symbols_per_slot+l],
|
||||
(void*) &ru->gNB_list[0]->common_vars.beam_id[i][slot*fp->symbols_per_slot+l],
|
||||
(fp->symbols_per_slot>>1)*sizeof(uint8_t));
|
||||
}
|
||||
|
||||
|
||||
if (ru->nb_tx == 1 && ru->nb_log_antennas == 1) {
|
||||
memcpy((void*)&ru->common.txdataF_BF[0][l*fp->ofdm_symbol_size],
|
||||
(void*)&ru->gNB_list[0]->common_vars.txdataF[0][txdataF_offset + l*fp->ofdm_symbol_size],
|
||||
(fp->samples_per_slot_wCP>>1)*sizeof(int32_t));
|
||||
memcpy((void*)&ru->common.txdataF_BF[0][l*fp->ofdm_symbol_size],
|
||||
(void*)&ru->gNB_list[0]->common_vars.txdataF[0][txdataF_offset + l*fp->ofdm_symbol_size],
|
||||
(fp->samples_per_slot_wCP>>1)*sizeof(int32_t));
|
||||
}
|
||||
else {
|
||||
bw = ru->beam_weights[0];
|
||||
@@ -458,10 +468,14 @@ void nr_feptx_prec(RU_t *ru,int frame_tx,int tti_tx) {
|
||||
|
||||
if (nr_slot_select(cfg,frame_tx,slot_tx) == NR_UPLINK_SLOT) return;
|
||||
|
||||
for(i=0; i<ru->nb_log_antennas; ++i)
|
||||
for(i=0; i<ru->nb_log_antennas; ++i) {
|
||||
memcpy((void*)ru->common.txdataF[i],
|
||||
(void*)&gNB->common_vars.txdataF[i][txdataF_offset],
|
||||
fp->samples_per_slot_wCP*sizeof(int32_t));
|
||||
memcpy((void*)&ru->common.beam_id[i][slot_tx*fp->symbols_per_slot],
|
||||
(void*)&gNB->common_vars.beam_id[i][slot_tx*fp->symbols_per_slot],
|
||||
fp->symbols_per_slot*sizeof(uint8_t));
|
||||
}
|
||||
|
||||
if (ru->nb_tx == 1 && ru->nb_log_antennas == 1) {
|
||||
|
||||
|
||||
@@ -41,7 +41,7 @@
|
||||
*
|
||||
* OUTPUT: table of uplink symbol for each slot for 2 frames
|
||||
*
|
||||
* RETURN : 0 if tdd has been properly configurated
|
||||
* RETURN : nb_periods_per_frame if tdd has been properly configurated
|
||||
* -1 tdd configuration can not be done
|
||||
*
|
||||
* DESCRIPTION : generate bit map for uplink symbol for each slot for several frames
|
||||
@@ -179,7 +179,7 @@ int set_tdd_config_nr( nfapi_nr_config_request_scf_t *cfg,
|
||||
LOG_E(PHY,"set_tdd_configuration_nr: additionnal tdd configuration 2 is not supported for tdd configuration \n");
|
||||
return (-1);
|
||||
}*/
|
||||
return (0);
|
||||
return (nb_periods_per_frame);
|
||||
}
|
||||
|
||||
/*******************************************************************
|
||||
|
||||
@@ -93,7 +93,7 @@ void nr_common_signal_procedures (PHY_VARS_gNB *gNB,int frame,int slot,nfapi_nr_
|
||||
LOG_D(PHY,"SS TX: frame %d, slot %d, start_symbol %d\n",frame,slot, ssb_start_symbol);
|
||||
nr_generate_pss(gNB->d_pss, &txdataF[0][txdataF_offset], AMP, ssb_start_symbol, cfg, fp);
|
||||
nr_generate_sss(gNB->d_sss, &txdataF[0][txdataF_offset], AMP, ssb_start_symbol, cfg, fp);
|
||||
|
||||
|
||||
if (cfg->carrier_config.num_tx_ant.value <= 4)
|
||||
nr_generate_pbch_dmrs(gNB->nr_gold_pbch_dmrs[n_hf][ssb_index&7],&txdataF[0][txdataF_offset], AMP, ssb_start_symbol, cfg, fp);
|
||||
else
|
||||
@@ -107,6 +107,13 @@ void nr_common_signal_procedures (PHY_VARS_gNB *gNB,int frame,int slot,nfapi_nr_
|
||||
T(T_GNB_PHY_MIB, T_INT(0) /* module ID */, T_INT(frame), T_INT(slot), T_BUFFER(bch, 3));
|
||||
}
|
||||
|
||||
// Beam_id is currently used only for FR2
|
||||
if (fp->freq_range==nr_FR2){
|
||||
LOG_D(PHY,"slot %d, ssb_index %d, beam %d\n",slot,ssb_index,cfg->ssb_table.ssb_beam_id_list[ssb_index].beam_id.value);
|
||||
for (int j=0;j<fp->symbols_per_slot;j++)
|
||||
gNB->common_vars.beam_id[0][slot*fp->symbols_per_slot+j] = cfg->ssb_table.ssb_beam_id_list[ssb_index].beam_id.value;
|
||||
}
|
||||
|
||||
nr_generate_pbch(&gNB->pbch,
|
||||
&ssb_pdu,
|
||||
gNB->nr_pbch_interleaver,
|
||||
@@ -133,9 +140,10 @@ void phy_procedures_gNB_TX(PHY_VARS_gNB *gNB,
|
||||
|
||||
if (do_meas==1) start_meas(&gNB->phy_proc_tx);
|
||||
|
||||
// clear the transmit data array for the current subframe
|
||||
// clear the transmit data array and beam index for the current slot
|
||||
for (aa=0; aa<cfg->carrier_config.num_tx_ant.value; aa++) {
|
||||
memset(&gNB->common_vars.txdataF[aa][txdataF_offset],0,fp->samples_per_slot_wCP*sizeof(int32_t));
|
||||
memset(&gNB->common_vars.beam_id[aa][slot*fp->symbols_per_slot],255,fp->symbols_per_slot*sizeof(uint8_t));
|
||||
}
|
||||
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_gNB_COMMON_TX,1);
|
||||
@@ -655,7 +663,10 @@ void phy_procedures_gNB_uespec_RX(PHY_VARS_gNB *gNB, int frame_rx, int slot_rx)
|
||||
}
|
||||
}
|
||||
// figure out a better way to choose slot_rx, 19 is ok for a particular TDD configuration with 30kHz SCS
|
||||
if ((frame_rx&127) == 0 && slot_rx==19) dump_pusch_stats(gNB);
|
||||
if ((frame_rx&127) == 0 && slot_rx==19) {
|
||||
dump_pusch_stats(gNB);
|
||||
LOG_I(PHY, "Number of bad PUCCH received: %lu\n", gNB->bad_pucch);
|
||||
}
|
||||
|
||||
if (pucch_decode_done || pusch_decode_done) {
|
||||
T(T_GNB_PHY_PUCCH_PUSCH_IQ, T_INT(frame_rx), T_INT(slot_rx), T_BUFFER(&gNB->common_vars.rxdataF[0][0], gNB->frame_parms.symbols_per_slot * gNB->frame_parms.ofdm_symbol_size * 4));
|
||||
|
||||
@@ -1696,7 +1696,6 @@ int phy_procedures_nrUE_RX(PHY_VARS_NR_UE *ue,
|
||||
}
|
||||
|
||||
#ifdef NR_PDCCH_SCHED
|
||||
nr_gold_pdcch(ue, 0, 2);
|
||||
|
||||
LOG_D(PHY," ------ --> PDCCH ChannelComp/LLR Frame.slot %d.%d ------ \n", frame_rx%1024, nr_slot_rx);
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_SLOT_FEP_PDCCH, VCD_FUNCTION_IN);
|
||||
@@ -1754,16 +1753,10 @@ int phy_procedures_nrUE_RX(PHY_VARS_NR_UE *ue,
|
||||
NR_DL_UE_HARQ_t *dlsch0_harq = dlsch->harq_processes[harq_pid];
|
||||
uint16_t nb_symb_sch = dlsch0_harq->nb_symbols;
|
||||
uint16_t start_symb_sch = dlsch0_harq->start_symbol;
|
||||
int symb_dmrs = -1;
|
||||
|
||||
LOG_D(PHY," ------ --> PDSCH ChannelComp/LLR Frame.slot %d.%d ------ \n", frame_rx%1024, nr_slot_rx);
|
||||
//to update from pdsch config
|
||||
|
||||
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");
|
||||
LOG_D(PHY,"Initializing dmrs for slot %d DMRS mask %x\n", nr_slot_rx, dlsch0_harq->dlDmrsSymbPos);
|
||||
nr_gold_pdsch(ue, nr_slot_rx, 0);
|
||||
|
||||
for (uint16_t m=start_symb_sch;m<(nb_symb_sch+start_symb_sch) ; m++){
|
||||
nr_slot_fep(ue,
|
||||
proc,
|
||||
|
||||
@@ -832,7 +832,7 @@ int main(int argc, char **argv)
|
||||
init_nr_ue_transport(UE,0);
|
||||
|
||||
nr_gold_pbch(UE);
|
||||
nr_gold_pdcch(UE,0,2);
|
||||
nr_gold_pdcch(UE,0);
|
||||
|
||||
nr_l2_init_ue(NULL);
|
||||
UE_mac = get_mac_inst(0);
|
||||
|
||||
@@ -149,13 +149,13 @@ void fill_scc(NR_ServingCellConfigCommon_t *scc,uint64_t *ssb_bitmap,int N_RB_DL
|
||||
scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->prach_RootSequenceIndex.present=NR_RACH_ConfigCommon__prach_RootSequenceIndex_PR_l139;
|
||||
scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->prach_RootSequenceIndex.choice.l139=0;
|
||||
scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->restrictedSetConfig=NR_RACH_ConfigCommon__restrictedSetConfig_unrestrictedSet;
|
||||
*scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[0]->k2=2;
|
||||
*scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[0]->k2=6;
|
||||
scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[0]->mappingType=NR_PUSCH_TimeDomainResourceAllocation__mappingType_typeB;
|
||||
scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[0]->startSymbolAndLength=55;
|
||||
*scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[1]->k2=2;
|
||||
*scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[1]->k2=6;
|
||||
scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[1]->mappingType=NR_PUSCH_TimeDomainResourceAllocation__mappingType_typeB;
|
||||
scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[1]->startSymbolAndLength=69;
|
||||
*scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[2]->k2=2;
|
||||
*scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[2]->k2=6;
|
||||
scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[2]->mappingType=NR_PUSCH_TimeDomainResourceAllocation__mappingType_typeB;
|
||||
scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[2]->startSymbolAndLength=55;
|
||||
*scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[3]->k2=33;
|
||||
|
||||
Reference in New Issue
Block a user