Commit 573d6d73 authored by Robert Schmidt's avatar Robert Schmidt

Print UE PUSCH SNR, PUCCH SNR, RSSI, rename variables

parent 79a3fc86
...@@ -82,10 +82,15 @@ void dump_mac_stats(gNB_MAC_INST *gNB) ...@@ -82,10 +82,15 @@ void dump_mac_stats(gNB_MAC_INST *gNB)
stats->num_rsrp_meas = 0; stats->num_rsrp_meas = 0;
stats->cumul_rsrp = 0 ; stats->cumul_rsrp = 0 ;
LOG_I(MAC, "UE %d: dlsch_total_bytes %d\n", UE_id, stats->dlsch_total_bytes); LOG_I(MAC, "UE %d: dlsch_total_bytes %d\n", UE_id, stats->dlsch_total_bytes);
LOG_I(MAC, "UE %d: ulsch_rounds %d/%d/%d/%d, ulsch_errors %d\n", const NR_UE_sched_ctrl_t *sched_ctrl = &UE_info->UE_sched_ctrl[UE_id];
LOG_I(MAC, "UE %d: ulsch_rounds %d/%d/%d/%d, ulsch_errors %d, PUSCH SNR %2.1f dB, PUCCH SNR %2.1f dB, noise rssi %2.1f dB\n",
UE_id, UE_id,
stats->ulsch_rounds[0], stats->ulsch_rounds[1], stats->ulsch_rounds[0], stats->ulsch_rounds[1],
stats->ulsch_rounds[2], stats->ulsch_rounds[3], stats->ulsch_errors); stats->ulsch_rounds[2], stats->ulsch_rounds[3],
stats->ulsch_errors,
(float) sched_ctrl->pusch_snrx10 / 10,
(float) sched_ctrl->pucch_snrx10 / 10,
(float) (sched_ctrl->raw_rssi - 1280) / 10);
LOG_I(MAC, LOG_I(MAC,
"UE %d: ulsch_total_bytes_scheduled %d, ulsch_total_bytes_received %d\n", "UE %d: ulsch_total_bytes_scheduled %d, ulsch_total_bytes_received %d\n",
UE_id, UE_id,
......
...@@ -1644,7 +1644,6 @@ int add_new_nr_ue(module_id_t mod_idP, rnti_t rntiP, NR_CellGroupConfig_t *secon ...@@ -1644,7 +1644,6 @@ int add_new_nr_ue(module_id_t mod_idP, rnti_t rntiP, NR_CellGroupConfig_t *secon
sched_ctrl->ta_frame = 0; sched_ctrl->ta_frame = 0;
sched_ctrl->ta_update = 31; sched_ctrl->ta_update = 31;
sched_ctrl->ta_apply = false; sched_ctrl->ta_apply = false;
sched_ctrl->ul_rssi = 0;
/* set illegal time domain allocation to force recomputation of all fields */ /* set illegal time domain allocation to force recomputation of all fields */
sched_ctrl->pusch_save.time_domain_allocation = -1; sched_ctrl->pusch_save.time_domain_allocation = -1;
const NR_ServingCellConfig_t *servingCellConfig = secondaryCellGroup->spCellConfig->spCellConfigDedicated; const NR_ServingCellConfig_t *servingCellConfig = secondaryCellGroup->spCellConfig->spCellConfigDedicated;
......
...@@ -1011,6 +1011,7 @@ void handle_nr_uci_pucch_0_1(module_id_t mod_id, ...@@ -1011,6 +1011,7 @@ void handle_nr_uci_pucch_0_1(module_id_t mod_id,
sched_ctrl->tpc1 = nr_get_tpc(RC.nrmac[mod_id]->pucch_target_snrx10, sched_ctrl->tpc1 = nr_get_tpc(RC.nrmac[mod_id]->pucch_target_snrx10,
uci_01->ul_cqi, uci_01->ul_cqi,
30); 30);
sched_ctrl->pucch_snrx10 = uci_01->ul_cqi * 5 - 640;
NR_ServingCellConfigCommon_t *scc = RC.nrmac[mod_id]->common_channels->ServingCellConfigCommon; NR_ServingCellConfigCommon_t *scc = RC.nrmac[mod_id]->common_channels->ServingCellConfigCommon;
const int num_slots = nr_slots_per_frame[*scc->ssbSubcarrierSpacing]; const int num_slots = nr_slots_per_frame[*scc->ssbSubcarrierSpacing];
...@@ -1050,6 +1051,7 @@ void handle_nr_uci_pucch_2_3_4(module_id_t mod_id, ...@@ -1050,6 +1051,7 @@ void handle_nr_uci_pucch_2_3_4(module_id_t mod_id,
sched_ctrl->tpc1 = nr_get_tpc(RC.nrmac[mod_id]->pucch_target_snrx10, sched_ctrl->tpc1 = nr_get_tpc(RC.nrmac[mod_id]->pucch_target_snrx10,
uci_234->ul_cqi, uci_234->ul_cqi,
30); 30);
sched_ctrl->pucch_snrx10 = uci_234->ul_cqi * 5 - 640;
NR_ServingCellConfigCommon_t *scc = RC.nrmac[mod_id]->common_channels->ServingCellConfigCommon; NR_ServingCellConfigCommon_t *scc = RC.nrmac[mod_id]->common_channels->ServingCellConfigCommon;
const int num_slots = nr_slots_per_frame[*scc->ssbSubcarrierSpacing]; const int num_slots = nr_slots_per_frame[*scc->ssbSubcarrierSpacing];
......
...@@ -433,11 +433,12 @@ void nr_rx_sdu(const module_id_t gnb_mod_idP, ...@@ -433,11 +433,12 @@ void nr_rx_sdu(const module_id_t gnb_mod_idP,
sduP); sduP);
// if not missed detection (10dB threshold for now) // if not missed detection (10dB threshold for now)
if (UE_scheduling_control->ul_rssi < (100+rssi)) { if (UE_scheduling_control->raw_rssi < 100 + rssi) {
UE_scheduling_control->tpc0 = nr_get_tpc(target_snrx10,ul_cqi,30); UE_scheduling_control->tpc0 = nr_get_tpc(target_snrx10,ul_cqi,30);
if (timing_advance != 0xffff) if (timing_advance != 0xffff)
UE_scheduling_control->ta_update = timing_advance; UE_scheduling_control->ta_update = timing_advance;
UE_scheduling_control->ul_rssi = rssi; UE_scheduling_control->raw_rssi = rssi;
UE_scheduling_control->pusch_snrx10 = ul_cqi * 5 - 640;
LOG_D(NR_MAC, "[UE %d] PUSCH TPC %d and TA %d\n",UE_id,UE_scheduling_control->tpc0,UE_scheduling_control->ta_update); LOG_D(NR_MAC, "[UE %d] PUSCH TPC %d and TA %d\n",UE_id,UE_scheduling_control->tpc0,UE_scheduling_control->ta_update);
} }
else{ else{
......
...@@ -534,8 +534,10 @@ typedef struct { ...@@ -534,8 +534,10 @@ typedef struct {
bool ta_apply; bool ta_apply;
uint8_t tpc0; uint8_t tpc0;
uint8_t tpc1; uint8_t tpc1;
uint16_t ul_rssi; int raw_rssi;
uint8_t current_harq_pid; int pusch_snrx10;
int pucch_snrx10;
struct CSI_Report CSI_report[MAX_CSI_REPORTS]; struct CSI_Report CSI_report[MAX_CSI_REPORTS];
/// information about every HARQ process /// information about every HARQ process
NR_UE_harq_t harq_processes[NR_MAX_NB_HARQ_PROCESSES]; NR_UE_harq_t harq_processes[NR_MAX_NB_HARQ_PROCESSES];
......
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