From 4454627ba364d348269131a050f3bef6ce53707f Mon Sep 17 00:00:00 2001 From: Mahesh Date: Wed, 17 Mar 2021 14:43:05 +0530 Subject: [PATCH] Uplink constellation + CRC OK --- executables/nr-gnb.c | 6 +++++- openair1/PHY/NR_TRANSPORT/nr_ulsch_decoding.c | 3 +++ openair1/PHY/NR_UE_TRANSPORT/nr_ulsch_coding.c | 14 +++++++------- .../LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c | 7 +++++++ 4 files changed, 22 insertions(+), 8 deletions(-) diff --git a/executables/nr-gnb.c b/executables/nr-gnb.c index 5e63c54ab8..2f7944e313 100644 --- a/executables/nr-gnb.c +++ b/executables/nr-gnb.c @@ -428,7 +428,11 @@ static void *gNB_L1_thread( void *param ) { VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_gNB_PROC_RXTX0, 0 ); int frame_rx = L1_proc->frame_rx; - int slot_rx = L1_proc->slot_rx; + int slot_rx; + if (NFAPI_MODE == NFAPI_MODE_PNF) + slot_rx = (L1_proc->slot_rx) + 1; + else + slot_rx = L1_proc->slot_rx; int frame_tx = L1_proc->frame_tx; int slot_tx = L1_proc->slot_tx; uint64_t timestamp_tx = L1_proc->timestamp_tx; diff --git a/openair1/PHY/NR_TRANSPORT/nr_ulsch_decoding.c b/openair1/PHY/NR_TRANSPORT/nr_ulsch_decoding.c index 0b0851dddb..91f72922e2 100644 --- a/openair1/PHY/NR_TRANSPORT/nr_ulsch_decoding.c +++ b/openair1/PHY/NR_TRANSPORT/nr_ulsch_decoding.c @@ -443,7 +443,9 @@ void nr_processULSegment(void* arg) { for (int m=0; m < Kr>>3; m ++) { ulsch_harq->c[r][m]= (uint8_t) llrProcBuf[m]; + //printf("%x ", ulsch_harq->c[r][m]); } + //printf("\n"); //stop_meas(&phy_vars_gNB->ulsch_ldpc_decoding_stats); } @@ -510,6 +512,7 @@ uint32_t nr_ulsch_decoding(PHY_VARS_gNB *phy_vars_gNB, A = (harq_process->TBS)<<3; LOG_D(PHY,"ULSCH Decoding, harq_pid %d TBS %d G %d mcs %d Nl %d nb_rb %d, Qm %d, n_layers %d\n",harq_pid,A,G, mcs, n_layers, nb_rb, Qm, n_layers); + //printf("ULSCH in %d.%d \n", frame, nr_tti_rx); if (R<1024) Coderate = (float) R /(float) 1024; diff --git a/openair1/PHY/NR_UE_TRANSPORT/nr_ulsch_coding.c b/openair1/PHY/NR_UE_TRANSPORT/nr_ulsch_coding.c index d9bea8a3ac..f6a346aee9 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/nr_ulsch_coding.c +++ b/openair1/PHY/NR_UE_TRANSPORT/nr_ulsch_coding.c @@ -275,13 +275,13 @@ int nr_ulsch_encoding(NR_UE_ULSCH_t *ulsch, ///////////////////////// a---->| add CRC |---->b ///////////////////////// /////////// - /* - int i; - printf("ulsch (tx): \n"); - for (i=0;i<(A>>3);i++) - printf("%02x.",a[i]); - printf("\n"); - */ + + // int i; + // printf("ulsch (tx): \n"); + // for (i=0;i<(A>>3);i++) + // printf("%x ",harq_process->a[i]); + // printf("\n"); + if (A > 3824) { // Add 24-bit crc (polynomial A) to payload diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c index e7149c5d65..00e53dd21e 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c @@ -62,6 +62,7 @@ #include "common/ran_context.h" extern RAN_CONTEXT_t RC; +uint8_t count = 0; uint8_t harq_pid_ul = -1; int flag = 0; // Note the 2 scs values in the table names represent resp. scs_common and pdcch_scs /// LUT for the number of symbols in the coreset indexed by coreset index (4 MSB rmsi_pdcch_config) @@ -1248,6 +1249,11 @@ void fill_dci_pdu_rel15(const NR_ServingCellConfigCommon_t *scc, case NR_UL_DCI_FORMAT_0_1: switch (rnti_type) { case NR_RNTI_C: + harq_pid_ul = (harq_pid_ul + 1) % 16; + if (harq_pid_ul == 0) + flag = !flag; + dci_pdu_rel15->ndi = flag; + // Indicating a DL DCI format 1bit pos = 1; *dci_pdu |= ((uint64_t)dci_pdu_rel15->format_indicator & 0x1) << (dci_size - pos); @@ -1280,6 +1286,7 @@ void fill_dci_pdu_rel15(const NR_ServingCellConfigCommon_t *scc, *dci_pdu |= ((uint64_t)dci_pdu_rel15->rv & 0x3) << (dci_size - pos); // HARQ process number 4bit pos += 4; + dci_pdu_rel15->harq_pid = harq_pid_ul; *dci_pdu |= ((uint64_t)dci_pdu_rel15->harq_pid & 0xf) << (dci_size - pos); // 1st Downlink assignment index pos += dci_pdu_rel15->dai[0].nbits;