Merge remote-tracking branch 'origin/develop' into NR_2port_CSIRS
This commit is contained in:
@@ -38,7 +38,7 @@
|
||||
|
||||
#include "coding_defs.h"
|
||||
#include "assertions.h"
|
||||
#if USE_INTEL_CRC
|
||||
#if USE_INTEL_CRC
|
||||
#include "crc.h"
|
||||
#endif
|
||||
/*ref 36-212 v8.6.0 , pp 8-9 */
|
||||
@@ -159,7 +159,7 @@ unsigned int crc24a (unsigned char * inptr,
|
||||
if ( bitlen % 8 || !USE_INTEL_CRC ) {
|
||||
unsigned int crc = 0;
|
||||
int resbit= (bitlen % 8);
|
||||
|
||||
|
||||
while (octetlen-- > 0) {
|
||||
// printf("crc24a: in %x => crc %x\n",crc,*inptr);
|
||||
crc = (crc << 8) ^ crc24aTable[(*inptr++) ^ (crc >> 24)];
|
||||
@@ -192,7 +192,7 @@ unsigned int crc24b (unsigned char * inptr,
|
||||
int bitlen)
|
||||
{
|
||||
int octetlen = bitlen / 8; /* Change in octets */
|
||||
|
||||
|
||||
if ( bitlen % 8 || !USE_INTEL_CRC ) {
|
||||
unsigned int crc = 0;
|
||||
int resbit = (bitlen % 8);
|
||||
|
||||
@@ -20,28 +20,19 @@
|
||||
*/
|
||||
|
||||
#include "phy_init.h"
|
||||
#include "SCHED_UE/sched_UE.h"
|
||||
#include "PHY/phy_extern_nr_ue.h"
|
||||
//#include "SIMULATION/TOOLS/sim.h"
|
||||
/*#include "RadioResourceConfigCommonSIB.h"
|
||||
#include "RadioResourceConfigDedicated.h"
|
||||
#include "TDD-Config.h"
|
||||
#include "MBSFN-SubframeConfigList.h"*/
|
||||
#include "openair1/PHY/defs_RU.h"
|
||||
#include "openair1/PHY/impl_defs_nr.h"
|
||||
#include "common/utils/LOG/vcd_signal_dumper.h"
|
||||
#include "assertions.h"
|
||||
#include <math.h>
|
||||
#include "PHY/MODULATION/nr_modulation.h"
|
||||
#include "PHY/NR_UE_TRANSPORT/nr_transport_ue.h"
|
||||
#include "PHY/NR_UE_TRANSPORT/nr_transport_proto_ue.h"
|
||||
//#include "PHY/LTE_REFSIG/lte_refsig.h"
|
||||
#include "PHY/CODING/nrPolar_tools/nr_polar_pbch_defs.h"
|
||||
#include "PHY/INIT/phy_init.h"
|
||||
#include "PHY/NR_REFSIG/pss_nr.h"
|
||||
#include "PHY/NR_REFSIG/ul_ref_seq_nr.h"
|
||||
#include "PHY/NR_REFSIG/refsig_defs_ue.h"
|
||||
#include "PHY/NR_REFSIG/nr_refsig.h"
|
||||
#include <openair1/PHY/MODULATION/nr_modulation.h>
|
||||
#include "PHY/MODULATION/nr_modulation.h"
|
||||
|
||||
#if 0
|
||||
void phy_config_harq_ue(module_id_t Mod_id,
|
||||
|
||||
@@ -250,20 +250,16 @@ void nr_generate_dci(nfapi_nr_dl_tti_pdcch_pdu_rel15_t *pdcch_pdu_rel15,
|
||||
} // for (int d=0;d<pdcch_pdu_rel15->numDlDci;d++)
|
||||
}
|
||||
|
||||
void nr_generate_dci_top(nfapi_nr_dl_tti_pdcch_pdu *pdcch_pdu,
|
||||
nfapi_nr_dl_tti_pdcch_pdu *ul_dci_pdu,
|
||||
void nr_generate_dci_top(processingData_L1tx_t *msgTx,
|
||||
uint32_t **gold_pdcch_dmrs,
|
||||
int32_t *txdataF,
|
||||
int16_t amp,
|
||||
NR_DL_FRAME_PARMS *frame_parms) {
|
||||
|
||||
AssertFatal(pdcch_pdu!=NULL || ul_dci_pdu!=NULL,"At least one pointer has to be !NULL\n");
|
||||
for (int i=0; i<msgTx->num_ul_pdcch; i++)
|
||||
nr_generate_dci(&msgTx->ul_pdcch_pdu[i].pdcch_pdu.pdcch_pdu_rel15,gold_pdcch_dmrs,txdataF,amp,frame_parms);
|
||||
for (int i=0; i<msgTx->num_dl_pdcch; i++)
|
||||
nr_generate_dci(&msgTx->pdcch_pdu[i].pdcch_pdu_rel15,gold_pdcch_dmrs,txdataF,amp,frame_parms);
|
||||
|
||||
if (pdcch_pdu) {
|
||||
nr_generate_dci(&pdcch_pdu->pdcch_pdu_rel15,gold_pdcch_dmrs,txdataF,amp,frame_parms);
|
||||
}
|
||||
if (ul_dci_pdu) {
|
||||
nr_generate_dci(&ul_dci_pdu->pdcch_pdu_rel15,gold_pdcch_dmrs,txdataF,amp,frame_parms);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -29,13 +29,11 @@ uint16_t nr_get_dci_size(nfapi_nr_dci_format_e format,
|
||||
nfapi_nr_rnti_type_e rnti_type,
|
||||
uint16_t N_RB);
|
||||
|
||||
void nr_generate_dci_top(
|
||||
nfapi_nr_dl_tti_pdcch_pdu *pdcch_pdu,
|
||||
nfapi_nr_dl_tti_pdcch_pdu *ul_pdcch_pdu,
|
||||
uint32_t **gold_pdcch_dmrs,
|
||||
int32_t *txdataF,
|
||||
int16_t amp,
|
||||
NR_DL_FRAME_PARMS *frame_parms);
|
||||
void nr_generate_dci_top(processingData_L1tx_t *msgTx,
|
||||
uint32_t **gold_pdcch_dmrs,
|
||||
int32_t *txdataF,
|
||||
int16_t amp,
|
||||
NR_DL_FRAME_PARMS *frame_parms);
|
||||
|
||||
void nr_pdcch_scrambling(uint32_t *in,
|
||||
uint32_t size,
|
||||
|
||||
@@ -183,12 +183,13 @@ void nr_generate_pdsch(processingData_L1tx_t *msgTx,
|
||||
unsigned char output[rel15->rbSize * NR_SYMBOLS_PER_SLOT * NR_NB_SC_PER_RB * 8 * NR_MAX_NB_LAYERS] __attribute__((aligned(32)));
|
||||
bzero(output,rel15->rbSize * NR_SYMBOLS_PER_SLOT * NR_NB_SC_PER_RB * 8 * NR_MAX_NB_LAYERS);
|
||||
start_meas(dlsch_encoding_stats);
|
||||
nr_dlsch_encoding(gNB,
|
||||
harq->pdu, frame, slot, dlsch, frame_parms, output,
|
||||
tinput,tprep,tparity,toutput,
|
||||
dlsch_rate_matching_stats,
|
||||
dlsch_interleaving_stats,
|
||||
dlsch_segmentation_stats);
|
||||
|
||||
if (nr_dlsch_encoding(gNB,
|
||||
harq->pdu, frame, slot, dlsch, frame_parms,output,tinput,tprep,tparity,toutput,
|
||||
dlsch_rate_matching_stats,
|
||||
dlsch_interleaving_stats,
|
||||
dlsch_segmentation_stats) == -1)
|
||||
return;
|
||||
stop_meas(dlsch_encoding_stats);
|
||||
#ifdef DEBUG_DLSCH
|
||||
printf("PDSCH encoding:\nPayload:\n");
|
||||
|
||||
@@ -254,7 +254,7 @@ void ldpc8blocks( void *p) {
|
||||
#ifdef DEBUG_DLSCH_CODING
|
||||
|
||||
for (int i =0; i<16; i++)
|
||||
printf("output ratematching e[%d]= %d r_offset %u\n", i,harq->e[i+r_offset], r_offset);
|
||||
printf("output ratematching e[%d]= %d r_offset %u\n", i,e[i], r_offset);
|
||||
|
||||
#endif
|
||||
nr_interleaving_ldpc(E,
|
||||
@@ -370,11 +370,11 @@ int nr_dlsch_encoding(PHY_VARS_gNB *gNB,
|
||||
//d_tmp[r] = &harq->d[r][0];
|
||||
//channel_input[r] = &harq->d[r][0];
|
||||
#ifdef DEBUG_DLSCH_CODING
|
||||
LOG_D(PHY,"Encoder: B %d F %d \n",harq->B, impp->F);
|
||||
LOG_D(PHY,"Encoder: B %d F %d \n",harq->B, impp.F);
|
||||
LOG_D(PHY,"start ldpc encoder segment %d/%d\n",r,impp.n_segments);
|
||||
LOG_D(PHY,"input %d %d %d %d %d \n", harq->c[r][0], harq->c[r][1], harq->c[r][2],harq->c[r][3], harq->c[r][4]);
|
||||
|
||||
for (int cnt =0 ; cnt < 22*(*Zc)/8; cnt ++) {
|
||||
for (int cnt =0 ; cnt < 22*(*impp.Zc)/8; cnt ++) {
|
||||
LOG_D(PHY,"%d ", harq->c[r][cnt]);
|
||||
}
|
||||
|
||||
@@ -405,6 +405,7 @@ int nr_dlsch_encoding(PHY_VARS_gNB *gNB,
|
||||
notifiedFIFO_elt_t *req=pullTpool(&nf, gNB->threadPool);
|
||||
delNotifiedFIFO_elt(req);
|
||||
nbJobs--;
|
||||
|
||||
}
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_gNB_DLSCH_ENCODING, VCD_FUNCTION_OUT);
|
||||
return 0;
|
||||
|
||||
@@ -30,49 +30,41 @@ int nr_generate_pss( int32_t *txdataF,
|
||||
nfapi_nr_config_request_scf_t* config,
|
||||
NR_DL_FRAME_PARMS *frame_parms)
|
||||
{
|
||||
int i,k,l,m;
|
||||
int16_t a;
|
||||
int16_t d_pss[NR_PSS_LENGTH];
|
||||
int16_t x[NR_PSS_LENGTH];
|
||||
const int x_initial[7] = {0, 1, 1 , 0, 1, 1, 1};
|
||||
|
||||
uint8_t Nid2 = config->cell_config.phy_cell_id.value % 3;
|
||||
|
||||
/// Sequence generation
|
||||
for (i=0; i < 7; i++)
|
||||
for (int i=0; i < 7; i++)
|
||||
x[i] = x_initial[i];
|
||||
|
||||
for (i=0; i < (NR_PSS_LENGTH - 7); i++) {
|
||||
for (int i=0; i < (NR_PSS_LENGTH - 7); i++) {
|
||||
x[i+7] = (x[i + 4] + x[i]) %2;
|
||||
}
|
||||
|
||||
for (i=0; i < NR_PSS_LENGTH; i++) {
|
||||
m = (i + 43*Nid2)%(NR_PSS_LENGTH);
|
||||
d_pss[i] = (1 - 2*x[m]) * 23170;
|
||||
}
|
||||
|
||||
#ifdef NR_PSS_DEBUG
|
||||
write_output("d_pss.m", "d_pss", (void*)d_pss, NR_PSS_LENGTH, 1, 0);
|
||||
printf("PSS: ofdm_symbol_size %d, first_carrier_offset %d\n",frame_parms->ofdm_symbol_size,frame_parms->first_carrier_offset);
|
||||
#endif
|
||||
|
||||
/// Resource mapping
|
||||
a = amp;
|
||||
|
||||
// PSS occupies a predefined position (subcarriers 56-182, symbol 0) within the SSB block starting from
|
||||
k = frame_parms->first_carrier_offset + frame_parms->ssb_start_subcarrier + 56; //and
|
||||
if (k>= frame_parms->ofdm_symbol_size) k-=frame_parms->ofdm_symbol_size;
|
||||
// PSS occupies a predefined position (subcarriers 56-182, symbol 0) within the SSB block starting from
|
||||
int k = frame_parms->first_carrier_offset + frame_parms->ssb_start_subcarrier + 56; //and
|
||||
if (k>= frame_parms->ofdm_symbol_size) k-=frame_parms->ofdm_symbol_size;
|
||||
|
||||
l = ssb_start_symbol;
|
||||
int l = ssb_start_symbol;
|
||||
|
||||
for (m = 0; m < NR_PSS_LENGTH; m++) {
|
||||
// printf("pss: writing position k %d / %d\n",k,frame_parms->ofdm_symbol_size);
|
||||
((int16_t*)txdataF)[2*(l*frame_parms->ofdm_symbol_size + k)] = (a * d_pss[m]) >> 15;
|
||||
k++;
|
||||
uint8_t Nid2 = config->cell_config.phy_cell_id.value % 3;
|
||||
for (int i = 0; i < NR_PSS_LENGTH; i++) {
|
||||
int m = (i + 43*Nid2)%(NR_PSS_LENGTH);
|
||||
int16_t d_pss = (1 - 2*x[m]) * 23170;
|
||||
// printf("pss: writing position k %d / %d\n",k,frame_parms->ofdm_symbol_size);
|
||||
((int16_t*)txdataF)[2*(l*frame_parms->ofdm_symbol_size + k)] = (((int16_t)amp) * d_pss) >> 15;
|
||||
k++;
|
||||
|
||||
if (k >= frame_parms->ofdm_symbol_size)
|
||||
k-=frame_parms->ofdm_symbol_size;
|
||||
}
|
||||
if (k >= frame_parms->ofdm_symbol_size)
|
||||
k-=frame_parms->ofdm_symbol_size;
|
||||
}
|
||||
|
||||
#ifdef NR_PSS_DEBUG
|
||||
LOG_M("pss_0.m", "pss_0",
|
||||
|
||||
@@ -29,36 +29,28 @@ int nr_generate_sss( int32_t *txdataF,
|
||||
nfapi_nr_config_request_scf_t* config,
|
||||
NR_DL_FRAME_PARMS *frame_parms)
|
||||
{
|
||||
int i,k,l;
|
||||
int m0, m1;
|
||||
int Nid, Nid1, Nid2;
|
||||
//int16_t a;
|
||||
int16_t d_sss[NR_SSS_LENGTH];
|
||||
int16_t x0[NR_SSS_LENGTH], x1[NR_SSS_LENGTH];
|
||||
int16_t x0[NR_SSS_LENGTH];
|
||||
int16_t x1[NR_SSS_LENGTH];
|
||||
const int x0_initial[7] = { 1, 0, 0, 0, 0, 0, 0 };
|
||||
const int x1_initial[7] = { 1, 0, 0, 0, 0, 0, 0 };
|
||||
|
||||
/// Sequence generation
|
||||
Nid = config->cell_config.phy_cell_id.value;
|
||||
Nid2 = Nid % 3;
|
||||
Nid1 = (Nid - Nid2)/3;
|
||||
int Nid = config->cell_config.phy_cell_id.value;
|
||||
int Nid2 = Nid % 3;
|
||||
int Nid1 = (Nid - Nid2)/3;
|
||||
|
||||
for ( i=0 ; i < 7 ; i++) {
|
||||
for (int i=0; i < 7; i++) {
|
||||
x0[i] = x0_initial[i];
|
||||
x1[i] = x1_initial[i];
|
||||
}
|
||||
|
||||
for ( i=0 ; i < NR_SSS_LENGTH - 7 ; i++) {
|
||||
for (int i=0; i < NR_SSS_LENGTH - 7; i++) {
|
||||
x0[i+7] = (x0[i + 4] + x0[i]) % 2;
|
||||
x1[i+7] = (x1[i + 1] + x1[i]) % 2;
|
||||
}
|
||||
|
||||
m0 = 15*(Nid1/112) + (5*Nid2);
|
||||
m1 = Nid1 % 112;
|
||||
|
||||
for (i = 0; i < NR_SSS_LENGTH ; i++) {
|
||||
d_sss[i] = (1 - 2*x0[(i + m0) % NR_SSS_LENGTH] ) * (1 - 2*x1[(i + m1) % NR_SSS_LENGTH] ) * 23170;
|
||||
}
|
||||
int m0 = 15*(Nid1/112) + (5*Nid2);
|
||||
int m1 = Nid1 % 112;
|
||||
|
||||
#ifdef NR_SSS_DEBUG
|
||||
write_output("d_sss.m", "d_sss", (void*)d_sss, NR_SSS_LENGTH, 1, 1);
|
||||
@@ -66,17 +58,18 @@ int nr_generate_sss( int32_t *txdataF,
|
||||
|
||||
/// Resource mapping
|
||||
|
||||
// SSS occupies a predefined position (subcarriers 56-182, symbol 2) within the SSB block starting from
|
||||
k = frame_parms->first_carrier_offset + frame_parms->ssb_start_subcarrier + 56; //and
|
||||
l = ssb_start_symbol + 2;
|
||||
// SSS occupies a predefined position (subcarriers 56-182, symbol 2) within the SSB block starting from
|
||||
int k = frame_parms->first_carrier_offset + frame_parms->ssb_start_subcarrier + 56; //and
|
||||
int l = ssb_start_symbol + 2;
|
||||
|
||||
for (int m = 0; m < NR_SSS_LENGTH; m++) {
|
||||
((int16_t*)txdataF)[2*(l*frame_parms->ofdm_symbol_size + k)] = (amp * d_sss[m]) >> 15;
|
||||
k++;
|
||||
for (int i = 0; i < NR_SSS_LENGTH; i++) {
|
||||
int16_t d_sss = (1 - 2*x0[(i + m0) % NR_SSS_LENGTH] ) * (1 - 2*x1[(i + m1) % NR_SSS_LENGTH] ) * 23170;
|
||||
((int16_t*)txdataF)[2*(l*frame_parms->ofdm_symbol_size + k)] = (((int16_t)amp) * d_sss) >> 15;
|
||||
k++;
|
||||
|
||||
if (k >= frame_parms->ofdm_symbol_size)
|
||||
k-=frame_parms->ofdm_symbol_size;
|
||||
}
|
||||
if (k >= frame_parms->ofdm_symbol_size)
|
||||
k-=frame_parms->ofdm_symbol_size;
|
||||
}
|
||||
#ifdef NR_SSS_DEBUG
|
||||
// write_output("sss_0.m", "sss_0", (void*)txdataF[0][l*frame_parms->ofdm_symbol_size], frame_parms->ofdm_symbol_size, 1, 1);
|
||||
#endif
|
||||
|
||||
@@ -328,7 +328,7 @@ void nr_decode_pucch0(PHY_VARS_gNB *gNB,
|
||||
LOG_D(PHY,"PUCCH IDFT[%d/%d] = (%d,%d)=>%f\n",
|
||||
mcs[i],seq_index,corr_re[0][0],corr_im[0][0],
|
||||
10*log10((double)corr_re[0][0]*corr_re[0][0] + (double)corr_im[0][0]*corr_im[0][0]));
|
||||
if (pucch_pdu->nr_of_symbols==2)
|
||||
if (pucch_pdu->nr_of_symbols==2)
|
||||
LOG_D(PHY,"PUCCH 2nd symbol IDFT[%d/%d] = (%d,%d)=>%f\n",
|
||||
mcs[i],seq_index,corr_re[0][1],corr_im[0][1],
|
||||
10*log10((double)corr_re[0][1]*corr_re[0][1] + (double)corr_im[0][1]*corr_im[0][1]));
|
||||
@@ -431,9 +431,11 @@ void nr_decode_pucch0(PHY_VARS_gNB *gNB,
|
||||
uci_pdu->harq->num_harq = 1;
|
||||
uci_pdu->harq->harq_confidence_level = no_conf ? 1 : 0;
|
||||
uci_pdu->harq->harq_list = (nfapi_nr_harq_t*)malloc(1);
|
||||
|
||||
uci_pdu->harq->harq_list[0].harq_value = !(index&0x01);
|
||||
LOG_D(PHY, "[DLSCH/PDSCH/PUCCH] %d.%d HARQ value %d (0 pass, 1 fail) with confidence level %d (0 is good, 1 is bad) xrt_mag %d xrt_mag_next %d n0 %d (%d,%d) pucch0_thres %d, cqi %d, SNRtimes10 %d, energy %f, sync_pos %d\n",
|
||||
frame,slot,uci_pdu->harq->harq_list[0].harq_value,uci_pdu->harq->harq_confidence_level,xrtmag_dBtimes10,xrtmag_next_dBtimes10,max_n0,uci_stats->pucch0_n00,uci_stats->pucch0_n01,uci_stats->pucch0_thres,cqi,SNRtimes10,10*log10((double)sigenergy),gNB->ulsch_stats[0].sync_pos);
|
||||
|
||||
if (pucch_pdu->sr_flag == 1) {
|
||||
uci_pdu->sr = calloc(1,sizeof(*uci_pdu->sr));
|
||||
uci_pdu->sr->sr_indication = (index>1) ? 1 : 0;
|
||||
@@ -447,6 +449,7 @@ void nr_decode_pucch0(PHY_VARS_gNB *gNB,
|
||||
uci_pdu->harq->num_harq = 2;
|
||||
uci_pdu->harq->harq_confidence_level = (no_conf) ? 1 : 0;
|
||||
uci_pdu->harq->harq_list = (nfapi_nr_harq_t*)malloc(2);
|
||||
|
||||
uci_pdu->harq->harq_list[1].harq_value = !(index&0x01);
|
||||
uci_pdu->harq->harq_list[0].harq_value = !((index>>1)&0x01);
|
||||
LOG_D(PHY, "[DLSCH/PDSCH/PUCCH] %d.%d HARQ values %d (0 pass, 1 fail) and %d with confidence level %d (0 is good, 1 is bad), xrt_mag %d xrt_mag_next %d n0 %d (%d,%d) pucch0_thres %d, cqi %d, SNRtimes10 %d,sync_pos %d\n",
|
||||
|
||||
@@ -142,6 +142,7 @@ static inline void start_meas(time_stats_t *ts) {
|
||||
} else {
|
||||
ts->in = rdtsc_oai();
|
||||
}
|
||||
if ((ts->trials&16383)<10) ts->max=0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -865,6 +865,7 @@ typedef struct PHY_VARS_gNB_s {
|
||||
|
||||
time_stats_t rx_pusch_stats;
|
||||
time_stats_t ul_indication_stats;
|
||||
time_stats_t schedule_response_stats;
|
||||
time_stats_t ulsch_decoding_stats;
|
||||
time_stats_t ulsch_rate_unmatching_stats;
|
||||
time_stats_t ulsch_ldpc_decoding_stats;
|
||||
@@ -889,7 +890,7 @@ typedef struct PHY_VARS_gNB_s {
|
||||
notifiedFIFO_t *resp_RU_tx;
|
||||
tpool_t *threadPool;
|
||||
int nbDecode;
|
||||
uint8_t pusch_proc_threads;
|
||||
uint8_t thread_pool_size;
|
||||
int number_of_nr_dlsch_max;
|
||||
int number_of_nr_ulsch_max;
|
||||
void * scopeData;
|
||||
@@ -950,12 +951,14 @@ typedef struct processingData_L1tx {
|
||||
int slot;
|
||||
openair0_timestamp timestamp_tx;
|
||||
PHY_VARS_gNB *gNB;
|
||||
nfapi_nr_dl_tti_pdcch_pdu pdcch_pdu;
|
||||
nfapi_nr_ul_dci_request_pdus_t ul_pdcch_pdu;
|
||||
nfapi_nr_dl_tti_pdcch_pdu pdcch_pdu[NFAPI_NR_MAX_NB_CORESETS];
|
||||
nfapi_nr_ul_dci_request_pdus_t ul_pdcch_pdu[NFAPI_NR_MAX_NB_CORESETS];
|
||||
NR_gNB_CSIRS_t csirs_pdu[NUMBER_OF_NR_CSIRS_MAX];
|
||||
NR_gNB_DLSCH_t *dlsch[NUMBER_OF_NR_DLSCH_MAX][2];
|
||||
NR_gNB_SSB_t ssb[64];
|
||||
uint16_t num_pdsch_slot;
|
||||
int num_dl_pdcch;
|
||||
int num_ul_pdcch;
|
||||
time_stats_t phy_proc_tx;
|
||||
} processingData_L1tx_t;
|
||||
|
||||
|
||||
@@ -148,6 +148,8 @@ void nr_schedule_response(NR_Sched_Rsp_t *Sched_INFO){
|
||||
AssertFatal(RC.gNB[Mod_id]!=NULL,"RC.gNB[%d] is null\n",Mod_id);
|
||||
|
||||
gNB = RC.gNB[Mod_id];
|
||||
start_meas(&gNB->schedule_response_stats);
|
||||
|
||||
nfapi_nr_config_request_scf_t *cfg = &gNB->gNB_config;
|
||||
|
||||
int slot_type = nr_slot_select(cfg,frame,slot);
|
||||
@@ -164,10 +166,9 @@ void nr_schedule_response(NR_Sched_Rsp_t *Sched_INFO){
|
||||
res = pullTpool(gNB->L1_tx_free, gNB->threadPool);
|
||||
processingData_L1tx_t *msgTx = (processingData_L1tx_t *)NotifiedFifoData(res);
|
||||
|
||||
int pdcch_received=0;
|
||||
msgTx->num_pdsch_slot=0;
|
||||
msgTx->pdcch_pdu.pdcch_pdu_rel15.numDlDci = 0;
|
||||
msgTx->ul_pdcch_pdu.pdcch_pdu.pdcch_pdu_rel15.numDlDci = 0;
|
||||
msgTx->num_dl_pdcch=0;
|
||||
msgTx->num_ul_pdcch=number_ul_dci_pdu;
|
||||
msgTx->slot = slot;
|
||||
msgTx->frame = frame;
|
||||
|
||||
@@ -181,16 +182,14 @@ void nr_schedule_response(NR_Sched_Rsp_t *Sched_INFO){
|
||||
break;
|
||||
|
||||
case NFAPI_NR_DL_TTI_PDCCH_PDU_TYPE:
|
||||
AssertFatal(pdcch_received == 0, "pdcch_received is not 0, we can only handle one PDCCH PDU per slot\n");
|
||||
msgTx->pdcch_pdu = dl_tti_pdu->pdcch_pdu;
|
||||
|
||||
pdcch_received = 1;
|
||||
LOG_D(PHY,"frame %d, slot %d, Got NFAPI_NR_DL_TTI_PDCCH_PDU_TYPE for %d.%d\n",frame,slot,DL_req->SFN,DL_req->Slot);
|
||||
msgTx->pdcch_pdu[msgTx->num_dl_pdcch] = dl_tti_pdu->pdcch_pdu;
|
||||
msgTx->num_dl_pdcch++;
|
||||
break;
|
||||
|
||||
case NFAPI_NR_DL_TTI_CSI_RS_PDU_TYPE:
|
||||
LOG_D(PHY,"frame %d, slot %d, Got NFAPI_NR_DL_TTI_CSI_RS_PDU_TYPE for %d.%d\n",frame,slot,DL_req->SFN,DL_req->Slot);
|
||||
handle_nfapi_nr_csirs_pdu(msgTx,frame,slot,
|
||||
&dl_tti_pdu->csi_rs_pdu);
|
||||
handle_nfapi_nr_csirs_pdu(msgTx,frame,slot,&dl_tti_pdu->csi_rs_pdu);
|
||||
break;
|
||||
|
||||
case NFAPI_NR_DL_TTI_PDSCH_PDU_TYPE:
|
||||
@@ -201,13 +200,13 @@ void nr_schedule_response(NR_Sched_Rsp_t *Sched_INFO){
|
||||
pduIndex,TX_req->pdu_list[pduIndex].num_TLV);
|
||||
uint8_t *sdu = (uint8_t *)TX_req->pdu_list[pduIndex].TLVs[0].value.direct;
|
||||
AssertFatal(msgTx->num_pdsch_slot < gNB->number_of_nr_dlsch_max,"Number of PDSCH PDUs %d exceeded the limit %d\n",
|
||||
msgTx->num_pdsch_slot,gNB->number_of_nr_dlsch_max);
|
||||
msgTx->num_pdsch_slot,gNB->number_of_nr_dlsch_max);
|
||||
handle_nr_nfapi_pdsch_pdu(msgTx,&dl_tti_pdu->pdsch_pdu, sdu);
|
||||
}
|
||||
}
|
||||
|
||||
if (number_ul_dci_pdu > 0)
|
||||
msgTx->ul_pdcch_pdu = UL_dci_req->ul_dci_pdu_list[number_ul_dci_pdu-1]; // copy the last pdu
|
||||
for (int i=0; i<number_ul_dci_pdu; i++)
|
||||
msgTx->ul_pdcch_pdu[i] = UL_dci_req->ul_dci_pdu_list[i];
|
||||
|
||||
pushNotifiedFIFO(gNB->L1_tx_filled,res);
|
||||
}
|
||||
@@ -246,6 +245,6 @@ void nr_schedule_response(NR_Sched_Rsp_t *Sched_INFO){
|
||||
if (number_dl_pdu>0)
|
||||
oai_nfapi_dl_tti_req(DL_req);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
stop_meas(&gNB->schedule_response_stats);
|
||||
}
|
||||
|
||||
@@ -158,18 +158,15 @@ void phy_procedures_gNB_TX(processingData_L1tx_t *msgTx,
|
||||
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_gNB_COMMON_TX,0);
|
||||
|
||||
int num_dl_dci = msgTx->pdcch_pdu.pdcch_pdu_rel15.numDlDci;
|
||||
int num_ul_dci = msgTx->ul_pdcch_pdu.pdcch_pdu.pdcch_pdu_rel15.numDlDci;
|
||||
int num_pdcch_pdus = msgTx->num_ul_pdcch + msgTx->num_dl_pdcch;
|
||||
|
||||
if (num_dl_dci > 0 || num_ul_dci > 0) {
|
||||
LOG_D(PHY, "[gNB %d] Frame %d slot %d Calling nr_generate_dci_top (number of UL/DL DCI %d/%d)\n",
|
||||
gNB->Mod_id, frame, slot, num_ul_dci, num_dl_dci);
|
||||
if (num_pdcch_pdus > 0) {
|
||||
LOG_D(PHY, "[gNB %d] Frame %d slot %d Calling nr_generate_dci_top (number of UL/DL PDCCH PDUs %d/%d)\n",
|
||||
gNB->Mod_id, frame, slot, msgTx->num_ul_pdcch, msgTx->num_dl_pdcch);
|
||||
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_gNB_PDCCH_TX,1);
|
||||
|
||||
nr_generate_dci_top(
|
||||
num_dl_dci > 0 ? &msgTx->pdcch_pdu : NULL,
|
||||
num_ul_dci > 0 ? &msgTx->ul_pdcch_pdu.pdcch_pdu : NULL,
|
||||
nr_generate_dci_top(msgTx,
|
||||
gNB->nr_gold_pdcch_dmrs[slot],
|
||||
&gNB->common_vars.txdataF[0][txdataF_offset],
|
||||
AMP, fp);
|
||||
|
||||
@@ -118,7 +118,7 @@ int main(int argc, char **argv)
|
||||
double DS_TDL = .03;
|
||||
cpuf = get_cpu_freq_GHz();
|
||||
char gNBthreads[128]="n";
|
||||
|
||||
|
||||
if (load_configmodule(argc, argv, CONFIG_ENABLECMDLINEONLY) == 0) {
|
||||
exit_fun("[NR_DLSCHSIM] Error, configuration module init failed\n");
|
||||
}
|
||||
@@ -531,12 +531,12 @@ int main(int argc, char **argv)
|
||||
|
||||
//if (i<16)
|
||||
// printf("encoder output f[%d] = %d\n",i,dlsch->harq_processes[0]->f[i]);
|
||||
|
||||
|
||||
if (output[i] == 0)
|
||||
modulated_input[i] = 1.0; ///sqrt(2); //QPSK
|
||||
else
|
||||
modulated_input[i] = -1.0; ///sqrt(2);
|
||||
|
||||
|
||||
//if (i<16) printf("modulated_input[%d] = %d\n",i,modulated_input[i]);
|
||||
//SNR =10;
|
||||
SNR_lin = pow(10, SNR / 10.0);
|
||||
|
||||
@@ -1049,8 +1049,6 @@ int main(int argc, char **argv)
|
||||
|
||||
while ((round<num_rounds) && (UE_harq_process->ack==0)) {
|
||||
|
||||
memset(RC.nrmac[0]->cce_list[1][0],0,MAX_NUM_CCE*sizeof(int));
|
||||
memset(RC.nrmac[0]->cce_list[1][1],0,MAX_NUM_CCE*sizeof(int));
|
||||
clear_nr_nfapi_information(RC.nrmac[0], 0, frame, slot);
|
||||
|
||||
UE_info->UE_sched_ctrl[0].harq_processes[harq_pid].ndi = !(trial&1);
|
||||
@@ -1058,7 +1056,7 @@ int main(int argc, char **argv)
|
||||
|
||||
UE_info->UE_sched_ctrl[0].harq_processes[harq_pid].round = round;
|
||||
for (int i=0; i<MAX_NUM_CORESET; i++)
|
||||
gNB_mac->UE_info.num_pdcch_cand[0][i] = 0;
|
||||
gNB_mac->pdcch_cand[i] = 0;
|
||||
|
||||
if (css_flag == 0) {
|
||||
nr_schedule_ue_spec(0, frame, slot);
|
||||
|
||||
Reference in New Issue
Block a user