Merge remote-tracking branch 'origin/relax-ue-k1k2-assert' into integration_2025_w23 (!3389)
Relax NR_UE_CAPABILITY_SLOT_RX_TO_TX asserts Relax the UEs requirements on k1/k2 value.
This commit is contained in:
@@ -43,6 +43,7 @@
|
|||||||
#include "position_interface.h"
|
#include "position_interface.h"
|
||||||
#include "nr_phy_common.h"
|
#include "nr_phy_common.h"
|
||||||
#include "common/utils/time_manager/time_manager.h"
|
#include "common/utils/time_manager/time_manager.h"
|
||||||
|
#include "log.h"
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* NR SLOT PROCESSING SEQUENCE
|
* NR SLOT PROCESSING SEQUENCE
|
||||||
@@ -545,6 +546,28 @@ static void RU_write(nr_rxtx_thread_data_t *rxtxD, bool sl_tx_action, c16_t **tx
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!IS_SOFTMODEM_RFSIM) {
|
||||||
|
uint64_t deadline_us = rxtxD->absolute_deadline_us;
|
||||||
|
struct timespec current_time;
|
||||||
|
if (clock_gettime(CLOCK_REALTIME, ¤t_time)) {
|
||||||
|
LOG_E(PHY, "clock_gettime failed\n");
|
||||||
|
}
|
||||||
|
uint64_t current_time_us = current_time.tv_sec * 1e6 + current_time.tv_nsec / 1e3;
|
||||||
|
if (current_time_us > deadline_us) {
|
||||||
|
static unsigned int deadline_warning_rate_limit = 0;
|
||||||
|
if (deadline_warning_rate_limit % 1000 == 0) {
|
||||||
|
LOG_W(PHY,
|
||||||
|
"Deadline missed for tx slot %d.%d (current time %lu us, deadline %lu us, missed by %lu)\n",
|
||||||
|
proc->frame_tx,
|
||||||
|
proc->nr_slot_tx,
|
||||||
|
current_time_us,
|
||||||
|
deadline_us,
|
||||||
|
current_time_us - deadline_us);
|
||||||
|
}
|
||||||
|
deadline_warning_rate_limit++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
openair0_timestamp writeTimestamp = proc->timestamp_tx;
|
openair0_timestamp writeTimestamp = proc->timestamp_tx;
|
||||||
int writeBlockSize = rxtxD->writeBlockSize;
|
int writeBlockSize = rxtxD->writeBlockSize;
|
||||||
// if writeBlockSize gets longer that slot size, fill with dummy
|
// if writeBlockSize gets longer that slot size, fill with dummy
|
||||||
@@ -1140,6 +1163,10 @@ void *UE_thread(void *arg)
|
|||||||
int tmp = UE->rfdevice.trx_read_func(&UE->rfdevice, &rx_timestamp, rxp, readBlockSize, fp->nb_antennas_rx);
|
int tmp = UE->rfdevice.trx_read_func(&UE->rfdevice, &rx_timestamp, rxp, readBlockSize, fp->nb_antennas_rx);
|
||||||
UEscopeCopy(UE, ueTimeDomainSamples, rxp[0], sizeof(c16_t), 1, readBlockSize, 0);
|
UEscopeCopy(UE, ueTimeDomainSamples, rxp[0], sizeof(c16_t), 1, readBlockSize, 0);
|
||||||
AssertFatal(readBlockSize == tmp, "");
|
AssertFatal(readBlockSize == tmp, "");
|
||||||
|
struct timespec current_time;
|
||||||
|
if (clock_gettime(CLOCK_REALTIME, ¤t_time)) {
|
||||||
|
LOG_E(PHY, "clock_gettime failed\n");
|
||||||
|
}
|
||||||
|
|
||||||
if(slot_nr == (nb_slot_frame - 1)) {
|
if(slot_nr == (nb_slot_frame - 1)) {
|
||||||
// read in first symbol of next frame and adjust for timing drift
|
// read in first symbol of next frame and adjust for timing drift
|
||||||
@@ -1162,6 +1189,11 @@ void *UE_thread(void *arg)
|
|||||||
const openair0_timestamp writeTimestamp = rx_timestamp + fp->get_samples_slot_timestamp(slot_nr, fp, duration_rx_to_tx)
|
const openair0_timestamp writeTimestamp = rx_timestamp + fp->get_samples_slot_timestamp(slot_nr, fp, duration_rx_to_tx)
|
||||||
- firstSymSamp - UE->N_TA_offset - timing_advance;
|
- firstSymSamp - UE->N_TA_offset - timing_advance;
|
||||||
|
|
||||||
|
// Calculate TX deadline, approximately 1 symbol before the first sample should be written
|
||||||
|
const uint64_t samples_diff = writeTimestamp - rx_timestamp - fp->ofdm_symbol_size;
|
||||||
|
const float deadline_us = samples_diff / UE->rfdevice.openair0_cfg->sample_rate * 1e6;
|
||||||
|
const uint64_t absolute_deadline_us = current_time.tv_sec * 1e6 + current_time.tv_nsec / 1e3 + deadline_us;
|
||||||
|
|
||||||
// but use current UE->timing_advance value to compute writeBlockSize
|
// but use current UE->timing_advance value to compute writeBlockSize
|
||||||
int writeBlockSize = fp->get_samples_per_slot((slot_nr + duration_rx_to_tx) % nb_slot_frame, fp) - iq_shift_to_apply;
|
int writeBlockSize = fp->get_samples_per_slot((slot_nr + duration_rx_to_tx) % nb_slot_frame, fp) - iq_shift_to_apply;
|
||||||
int new_timing_advance = UE->timing_advance;
|
int new_timing_advance = UE->timing_advance;
|
||||||
@@ -1204,6 +1236,7 @@ void *UE_thread(void *arg)
|
|||||||
curMsgTx->writeBlockSize = writeBlockSize;
|
curMsgTx->writeBlockSize = writeBlockSize;
|
||||||
curMsgTx->proc.timestamp_tx = writeTimestamp;
|
curMsgTx->proc.timestamp_tx = writeTimestamp;
|
||||||
curMsgTx->UE = UE;
|
curMsgTx->UE = UE;
|
||||||
|
curMsgTx->absolute_deadline_us = absolute_deadline_us;
|
||||||
|
|
||||||
int slot = curMsgTx->proc.nr_slot_tx;
|
int slot = curMsgTx->proc.nr_slot_tx;
|
||||||
int slot_and_frame = slot + curMsgTx->proc.frame_tx * UE->frame_parms.slots_per_frame;
|
int slot_and_frame = slot + curMsgTx->proc.frame_tx * UE->frame_parms.slots_per_frame;
|
||||||
|
|||||||
@@ -598,6 +598,7 @@ typedef struct nr_rxtx_thread_data_s {
|
|||||||
int writeBlockSize;
|
int writeBlockSize;
|
||||||
nr_phy_data_t phy_data;
|
nr_phy_data_t phy_data;
|
||||||
dynamic_barrier_t* next_barrier;
|
dynamic_barrier_t* next_barrier;
|
||||||
|
uint64_t absolute_deadline_us;
|
||||||
} nr_rxtx_thread_data_t;
|
} nr_rxtx_thread_data_t;
|
||||||
|
|
||||||
typedef struct LDPCDecode_ue_s {
|
typedef struct LDPCDecode_ue_s {
|
||||||
|
|||||||
@@ -936,7 +936,7 @@ static int nr_ue_process_dci_dl_10(NR_UE_MAC_INST_t *mac,
|
|||||||
if (rnti_type != TYPE_RA_RNTI_ && rnti_type != TYPE_SI_RNTI_) {
|
if (rnti_type != TYPE_RA_RNTI_ && rnti_type != TYPE_SI_RNTI_) {
|
||||||
if (!get_FeedbackDisabled(mac->sc_info.downlinkHARQ_FeedbackDisabled_r17, dci->harq_pid.val)) {
|
if (!get_FeedbackDisabled(mac->sc_info.downlinkHARQ_FeedbackDisabled_r17, dci->harq_pid.val)) {
|
||||||
feedback_ti = 1 + dci->pdsch_to_harq_feedback_timing_indicator.val + ntn_ue_koffset;
|
feedback_ti = 1 + dci->pdsch_to_harq_feedback_timing_indicator.val + ntn_ue_koffset;
|
||||||
AssertFatal(feedback_ti > GET_DURATION_RX_TO_TX(&mac->ntn_ta, dlsch_pdu->SubcarrierSpacing),
|
AssertFatal(feedback_ti >= GET_DURATION_RX_TO_TX(&mac->ntn_ta, dlsch_pdu->SubcarrierSpacing),
|
||||||
"PDSCH to HARQ feedback time (%d) needs to be higher than DURATION_RX_TO_TX (%ld).\n",
|
"PDSCH to HARQ feedback time (%d) needs to be higher than DURATION_RX_TO_TX (%ld).\n",
|
||||||
feedback_ti,
|
feedback_ti,
|
||||||
GET_DURATION_RX_TO_TX(&mac->ntn_ta, dlsch_pdu->SubcarrierSpacing));
|
GET_DURATION_RX_TO_TX(&mac->ntn_ta, dlsch_pdu->SubcarrierSpacing));
|
||||||
@@ -1232,7 +1232,7 @@ static int nr_ue_process_dci_dl_11(NR_UE_MAC_INST_t *mac,
|
|||||||
|
|
||||||
if (!get_FeedbackDisabled(mac->sc_info.downlinkHARQ_FeedbackDisabled_r17, dci->harq_pid.val)) {
|
if (!get_FeedbackDisabled(mac->sc_info.downlinkHARQ_FeedbackDisabled_r17, dci->harq_pid.val)) {
|
||||||
feedback_ti = pucch_Config->dl_DataToUL_ACK->list.array[dci->pdsch_to_harq_feedback_timing_indicator.val][0] + ntn_ue_koffset;
|
feedback_ti = pucch_Config->dl_DataToUL_ACK->list.array[dci->pdsch_to_harq_feedback_timing_indicator.val][0] + ntn_ue_koffset;
|
||||||
AssertFatal(feedback_ti > GET_DURATION_RX_TO_TX(&mac->ntn_ta, dlsch_pdu->SubcarrierSpacing),
|
AssertFatal(feedback_ti >= GET_DURATION_RX_TO_TX(&mac->ntn_ta, dlsch_pdu->SubcarrierSpacing),
|
||||||
"PDSCH to HARQ feedback time (%d) needs to be higher than DURATION_RX_TO_TX (%ld). Min feedback time set in config "
|
"PDSCH to HARQ feedback time (%d) needs to be higher than DURATION_RX_TO_TX (%ld). Min feedback time set in config "
|
||||||
"file (min_rxtxtime).\n",
|
"file (min_rxtxtime).\n",
|
||||||
feedback_ti,
|
feedback_ti,
|
||||||
|
|||||||
@@ -1575,7 +1575,7 @@ int nr_ue_pusch_scheduler(const NR_UE_MAC_INST_t *mac,
|
|||||||
*slot_tx = (current_slot + k2 + delta) % slots_per_frame;
|
*slot_tx = (current_slot + k2 + delta) % slots_per_frame;
|
||||||
*frame_tx = (current_frame + (current_slot + k2 + delta) / slots_per_frame) % MAX_FRAME_NUMBER;
|
*frame_tx = (current_frame + (current_slot + k2 + delta) / slots_per_frame) % MAX_FRAME_NUMBER;
|
||||||
} else {
|
} else {
|
||||||
AssertFatal(k2 > GET_DURATION_RX_TO_TX(&mac->ntn_ta, mu),
|
AssertFatal(k2 >= GET_DURATION_RX_TO_TX(&mac->ntn_ta, mu),
|
||||||
"Slot offset K2 (%ld) needs to be higher than DURATION_RX_TO_TX (%ld). Please set min_rxtxtime at least to %ld in "
|
"Slot offset K2 (%ld) needs to be higher than DURATION_RX_TO_TX (%ld). Please set min_rxtxtime at least to %ld in "
|
||||||
"gNB config file or gNBs.[0].min_rxtxtime=%ld via command line.\n",
|
"gNB config file or gNBs.[0].min_rxtxtime=%ld via command line.\n",
|
||||||
k2,
|
k2,
|
||||||
|
|||||||
Reference in New Issue
Block a user