remove ul_ch_estimates_time that saves 50MB memory to access in RAM, and make better quality scope data passing (no race)
This commit is contained in:
@@ -204,12 +204,10 @@ void phy_init_nr_gNB(PHY_VARS_gNB *gNB)
|
||||
NR_gNB_PUSCH *pusch = &gNB->pusch_vars[ULSCH_id];
|
||||
pusch->ul_ch_estimates = (int32_t **)malloc16(n_buf * sizeof(int32_t *));
|
||||
pusch->ptrs_phase_per_slot = (int32_t **)malloc16(n_buf * sizeof(int32_t *));
|
||||
pusch->ul_ch_estimates_time = (int32_t **)malloc16(n_buf * sizeof(int32_t *));
|
||||
pusch->rxdataF_comp = (int32_t **)malloc16(n_buf * sizeof(int32_t *));
|
||||
pusch->llr_layers = (int16_t **)malloc16(max_ul_mimo_layers * sizeof(int32_t *));
|
||||
for (int i = 0; i < n_buf; i++) {
|
||||
pusch->ul_ch_estimates[i] = (int32_t *)malloc16_clear(sizeof(int32_t) * fp->ofdm_symbol_size * fp->symbols_per_slot);
|
||||
pusch->ul_ch_estimates_time[i] = (int32_t *)malloc16_clear(sizeof(int32_t) * fp->ofdm_symbol_size);
|
||||
pusch->ptrs_phase_per_slot[i] = (int32_t *)malloc16_clear(sizeof(int32_t) * fp->symbols_per_slot); // symbols per slot
|
||||
pusch->rxdataF_comp[i] = (int32_t *)malloc16_clear(sizeof(int32_t) * nb_re_pusch2 * fp->symbols_per_slot);
|
||||
}
|
||||
@@ -279,14 +277,12 @@ void phy_free_nr_gNB(PHY_VARS_gNB *gNB)
|
||||
free_and_zero(pusch_vars->llr_layers[i]);
|
||||
for (int i = 0; i < n_buf; i++) {
|
||||
free_and_zero(pusch_vars->ul_ch_estimates[i]);
|
||||
free_and_zero(pusch_vars->ul_ch_estimates_time[i]);
|
||||
free_and_zero(pusch_vars->ptrs_phase_per_slot[i]);
|
||||
free_and_zero(pusch_vars->rxdataF_comp[i]);
|
||||
}
|
||||
free_and_zero(pusch_vars->llr_layers);
|
||||
free_and_zero(pusch_vars->ul_ch_estimates);
|
||||
free_and_zero(pusch_vars->ptrs_phase_per_slot);
|
||||
free_and_zero(pusch_vars->ul_ch_estimates_time);
|
||||
free_and_zero(pusch_vars->ul_valid_re_per_slot);
|
||||
free_and_zero(pusch_vars->rxdataF_comp);
|
||||
|
||||
|
||||
@@ -33,6 +33,7 @@
|
||||
#include "PHY/NR_REFSIG/ul_ref_seq_nr.h"
|
||||
#include "executables/softmodem-common.h"
|
||||
#include "nr_phy_common.h"
|
||||
#include "openair1/PHY/TOOLS/phy_scope_interface.h"
|
||||
|
||||
//#define DEBUG_CH
|
||||
//#define DEBUG_PUSCH
|
||||
@@ -41,6 +42,29 @@
|
||||
#define NO_INTERP 1
|
||||
#define dBc(x, y) (dB_fixed(((int32_t)(x)) * (x) + ((int32_t)(y)) * (y)))
|
||||
|
||||
typedef struct puschAntennaProc_s {
|
||||
unsigned char Ns;
|
||||
int nl;
|
||||
unsigned short p;
|
||||
unsigned char symbol;
|
||||
unsigned short bwp_start_subcarrier;
|
||||
int aarx;
|
||||
int beam_nb;
|
||||
int numAntennas;
|
||||
nfapi_nr_pusch_pdu_t *pusch_pdu;
|
||||
int *max_ch;
|
||||
c16_t *pilot;
|
||||
int *nest_count;
|
||||
uint64_t *noise_amp2;
|
||||
delay_t *delay;
|
||||
int chest_freq;
|
||||
NR_gNB_PUSCH *pusch_vars;
|
||||
NR_DL_FRAME_PARMS *frame_parms;
|
||||
c16_t ***rxdataF;
|
||||
task_ans_t *ans;
|
||||
scopeData_t *scope;
|
||||
} puschAntennaProc_t;
|
||||
|
||||
__attribute__((always_inline)) inline c16_t c32x16cumulVectVectWithSteps(c16_t *in1,
|
||||
int *offset1,
|
||||
const int step1,
|
||||
@@ -142,8 +166,13 @@ static void nr_pusch_antenna_processing(void *arg)
|
||||
}
|
||||
pilot_cnt += 2;
|
||||
}
|
||||
|
||||
nr_est_delay(frame_parms->ofdm_symbol_size, ul_ls_est, (c16_t *)pusch_vars->ul_ch_estimates_time[antenna], delay);
|
||||
c16_t ch_estimates_time[frame_parms->ofdm_symbol_size] __attribute__((aligned(32)));
|
||||
nr_est_delay(frame_parms->ofdm_symbol_size, ul_ls_est, ch_estimates_time, delay);
|
||||
if (rdata->scope && antenna == 0) {
|
||||
metadata mt = {.slot = -1, .frame = -1};
|
||||
scopeData_t *tmp = rdata->scope;
|
||||
tmp->copyData(tmp, gNBulDelay, ch_estimates_time, sizeof(c16_t), 1, frame_parms->ofdm_symbol_size, 0, &mt);
|
||||
}
|
||||
int delay_idx = get_delay_idx(delay->est_delay, MAX_DELAY_COMP);
|
||||
c16_t *ul_delay_table = frame_parms->delay_table[delay_idx];
|
||||
|
||||
@@ -231,7 +260,13 @@ static void nr_pusch_antenna_processing(void *arg)
|
||||
}
|
||||
|
||||
// Delay compensation
|
||||
nr_est_delay(frame_parms->ofdm_symbol_size, ul_ls_est, (c16_t *)pusch_vars->ul_ch_estimates_time[antenna], delay);
|
||||
c16_t ch_estimates_time[frame_parms->ofdm_symbol_size] __attribute__((aligned(32)));
|
||||
nr_est_delay(frame_parms->ofdm_symbol_size, ul_ls_est, ch_estimates_time, delay);
|
||||
if (rdata->scope && antenna == 0) {
|
||||
metadata mt = {.slot = -1, .frame = -1};
|
||||
scopeData_t *tmp = rdata->scope;
|
||||
tmp->copyData(tmp, gNBulDelay, ch_estimates_time, sizeof(c16_t), 1, frame_parms->ofdm_symbol_size, 0, &mt);
|
||||
}
|
||||
int delay_idx = get_delay_idx(-delay->est_delay, MAX_DELAY_COMP);
|
||||
c16_t *ul_delay_table = frame_parms->delay_table[delay_idx];
|
||||
for (int n = 0; n < nb_rb_pusch * NR_NB_SC_PER_RB; n++) {
|
||||
@@ -531,6 +566,7 @@ int nr_pusch_channel_estimation(PHY_VARS_gNB *gNB,
|
||||
rdata->pusch_vars = &gNB->pusch_vars[ul_id];
|
||||
rdata->chest_freq = gNB->chest_freq;
|
||||
rdata->rxdataF = gNB->common_vars.rxdataF;
|
||||
rdata->scope = gNB->scopeData;
|
||||
rdata->ans = &ans;
|
||||
// Call the nr_pusch_antenna_processing function
|
||||
if (job_id == num_jobs - 1) {
|
||||
|
||||
@@ -1096,7 +1096,7 @@ void nr_decode_pucch2(PHY_VARS_gNB *gNB,
|
||||
*ch_ls_ptr++ = rdmrs_gold[i];
|
||||
}
|
||||
}
|
||||
c16_t ch_temp[128] __attribute__((aligned(32))) = {0};
|
||||
c16_t ch_temp[128] __attribute__((aligned(32)));
|
||||
delay_t delay = {0};
|
||||
nr_est_delay(128, ch_ls, ch_temp, &delay);
|
||||
|
||||
|
||||
@@ -1121,7 +1121,6 @@ void NFAPI_NR_DMRS_TYPE1_linear_interp(NR_DL_FRAME_PARMS *frame_parms,
|
||||
}
|
||||
|
||||
c16_t ch_estimates_time[frame_parms->ofdm_symbol_size] __attribute__((aligned(32)));
|
||||
memset(ch_estimates_time, 0, sizeof(ch_estimates_time));
|
||||
nr_est_delay(frame_parms->ofdm_symbol_size, dl_ls_est, ch_estimates_time, delay);
|
||||
int delay_idx = get_delay_idx(delay->est_delay, MAX_DELAY_COMP);
|
||||
c16_t *dl_delay_table = frame_parms->delay_table[delay_idx];
|
||||
@@ -1282,7 +1281,6 @@ void NFAPI_NR_DMRS_TYPE2_linear_interp(NR_DL_FRAME_PARMS *frame_parms,
|
||||
}
|
||||
|
||||
c16_t ch_estimates_time[frame_parms->ofdm_symbol_size] __attribute__((aligned(32)));
|
||||
memset(ch_estimates_time, 0, sizeof(ch_estimates_time));
|
||||
nr_est_delay(frame_parms->ofdm_symbol_size, dl_ls_est, ch_estimates_time, delay);
|
||||
int delay_idx = get_delay_idx(delay->est_delay, MAX_DELAY_COMP);
|
||||
c16_t *dl_delay_table = frame_parms->delay_table[delay_idx];
|
||||
|
||||
@@ -456,9 +456,8 @@ static void timeSignal (OAIgraph_t *graph, PHY_VARS_gNB *phy_vars_gnb, RU_t *phy
|
||||
*/
|
||||
|
||||
static void timeResponse (OAIgraph_t *graph, scopeData_t *p, int nb_UEs) {
|
||||
const int len = p->gNB->frame_parms.ofdm_symbol_size;
|
||||
if (!len)
|
||||
// gnb not yet initialized, many race conditions in the scope
|
||||
scopeGraphData_t *val = p->liveData[gNBulDelay];
|
||||
if (!val || !val->dataSize)
|
||||
return;
|
||||
#ifdef WEBSRVSCOPE
|
||||
websrv_scopedata_msg_t *msg = NULL;
|
||||
@@ -466,38 +465,25 @@ static void timeResponse (OAIgraph_t *graph, scopeData_t *p, int nb_UEs) {
|
||||
float *values = (float *)msg->data_xy;
|
||||
#else
|
||||
float *values, *time;
|
||||
oai_xygraph_getbuff(graph, &time, &values, len, 0);
|
||||
oai_xygraph_getbuff(graph, &time, &values, val->lineSz, 0);
|
||||
#endif
|
||||
|
||||
const int ant = 0; // display antenna 0 for each UE
|
||||
// We display UEs randomly, with one buffer
|
||||
c16_t *samples = (c16_t *)(val + 1);
|
||||
for (int i = 0; i < val->lineSz; i++) {
|
||||
values[i] = SquaredNorm(samples[i]);
|
||||
}
|
||||
#ifdef WEBSRVSCOPE
|
||||
int uestart = nb_UEs - 1; // web scope shows one UE signal, that can be selected from GUI
|
||||
msg->header.msgtype = SCOPEMSG_TYPE_DATA;
|
||||
msg->header.chartid = graph->chartid;
|
||||
msg->header.datasetid = graph->datasetid;
|
||||
msg->header.msgseg = 0;
|
||||
msg->header.update = 1;
|
||||
websrv_scope_senddata(val->lineSz, 4, msg);
|
||||
#else
|
||||
int uestart = 0; // xforms scope designed to display nb_UEs signals
|
||||
oai_xygraph(graph, time, values, val->lineSz, 0, 10);
|
||||
#endif
|
||||
for (int ue = uestart; ue < nb_UEs; ue++) {
|
||||
if (p->gNB->pusch_vars &&
|
||||
p->gNB->pusch_vars[ue].ul_ch_estimates_time &&
|
||||
p->gNB->pusch_vars[ue].ul_ch_estimates_time[ant] ) {
|
||||
scopeSample_t *data= (scopeSample_t *)p->gNB->pusch_vars[ue].ul_ch_estimates_time[ant];
|
||||
|
||||
if (data != NULL) {
|
||||
for (int i=0; i<len; i++) {
|
||||
values[i] = SquaredNorm(data[i]);
|
||||
}
|
||||
#ifdef WEBSRVSCOPE
|
||||
msg->header.msgtype = SCOPEMSG_TYPE_DATA;
|
||||
msg->header.chartid = graph->chartid;
|
||||
msg->header.datasetid = graph->datasetid;
|
||||
msg->header.msgseg = 0;
|
||||
msg->header.update = 1;
|
||||
websrv_scope_senddata(len, 4, msg);
|
||||
#else
|
||||
oai_xygraph(graph,time,values, len, ue, 10);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void gNBfreqWaterFall (OAIgraph_t *graph, scopeData_t *p, int nb_UEs) {
|
||||
|
||||
@@ -70,6 +70,7 @@ enum scopeDataType {
|
||||
psbchDlChEstimateTime,
|
||||
psbchLlr,
|
||||
psbchRxdataF_comp,
|
||||
gNBulDelay,
|
||||
MAX_SCOPE_TYPES,
|
||||
gNBPuschRxIq = MAX_SCOPE_TYPES,
|
||||
gNBPuschLlr,
|
||||
|
||||
@@ -296,12 +296,7 @@ typedef struct {
|
||||
int32_t debugBuff_sample_offset;
|
||||
} NR_gNB_COMMON;
|
||||
|
||||
|
||||
typedef struct {
|
||||
/// \brief Hold the channel estimates in time domain based on DRS.
|
||||
/// - first index: rx antenna id [0..nb_antennas_rx[
|
||||
/// - second index: ? [0..4*ofdm_symbol_size[
|
||||
int32_t **ul_ch_estimates_time;
|
||||
/// \brief Hold the channel estimates in frequency domain based on DRS.
|
||||
/// - first index: rx antenna id [0..nb_antennas_rx[
|
||||
/// - second index: ? [0..12*N_RB_UL*frame_parms->symbols_per_tti[
|
||||
@@ -577,28 +572,6 @@ union puschSymbolReqUnion {
|
||||
uint64_t p;
|
||||
};
|
||||
|
||||
typedef struct puschAntennaProc_s {
|
||||
unsigned char Ns;
|
||||
int nl;
|
||||
unsigned short p;
|
||||
unsigned char symbol;
|
||||
unsigned short bwp_start_subcarrier;
|
||||
int aarx;
|
||||
int beam_nb;
|
||||
int numAntennas;
|
||||
nfapi_nr_pusch_pdu_t *pusch_pdu;
|
||||
int *max_ch;
|
||||
c16_t *pilot;
|
||||
int *nest_count;
|
||||
uint64_t *noise_amp2;
|
||||
delay_t *delay;
|
||||
int chest_freq;
|
||||
NR_gNB_PUSCH *pusch_vars;
|
||||
NR_DL_FRAME_PARMS *frame_parms;
|
||||
c16_t ***rxdataF;
|
||||
task_ans_t* ans;
|
||||
} puschAntennaProc_t;
|
||||
|
||||
struct puschAntennaReqId {
|
||||
uint16_t ul_id;
|
||||
uint16_t spare;
|
||||
|
||||
@@ -20,7 +20,6 @@
|
||||
*/
|
||||
|
||||
#include "nr_phy_common.h"
|
||||
|
||||
#ifdef __aarch64__
|
||||
#define USE_128BIT
|
||||
#endif
|
||||
@@ -363,7 +362,7 @@ void freq2time(uint16_t ofdm_symbol_size, int16_t *freq_signal, int16_t *time_si
|
||||
|
||||
void nr_est_delay(int ofdm_symbol_size, const c16_t *ls_est, c16_t *ch_estimates_time, delay_t *delay)
|
||||
{
|
||||
freq2time(ofdm_symbol_size, (int16_t *)ls_est, (int16_t *)ch_estimates_time);
|
||||
idft(get_idft(ofdm_symbol_size), (int16_t *)ls_est, (int16_t *)ch_estimates_time, 1);
|
||||
|
||||
int max_pos = delay->delay_max_pos;
|
||||
int max_val = delay->delay_max_val;
|
||||
|
||||
Reference in New Issue
Block a user