Commit 4accc464 authored by brobert's avatar brobert

Commenting

parent 6040fe0b
......@@ -65,7 +65,9 @@ __attribute__((always_inline)) inline c16_t c32x16cumulVectVectWithSteps(c16_t *
}
int inner_channel_estimation(puschAntennaProc_t *rdata) {
static void inner_channel_estimation(void *arg) {
puschAntennaProc_t *rdata=(puschAntennaProc_t*)arg;
PHY_VARS_gNB *gNB = rdata->gNB;
int aarx = rdata->aarx;
const int symbol_offset = rdata->symbol_offset;
......@@ -484,6 +486,8 @@ int nr_pusch_channel_estimation(PHY_VARS_gNB *gNB,
#endif
gNB->nbAarx = 0;
int nest_count = 0;
uint64_t noise_amp2 = 0;
c16_t ul_ls_est[symbolSize] __attribute__((aligned(32)));
......@@ -495,19 +499,12 @@ int nr_pusch_channel_estimation(PHY_VARS_gNB *gNB,
// max_ch array size of rx antennas
// noise_amp2 size of rx antennas
//Initializing the structure before going through the loop
puschAntennaProc_t *rdata = (puschAntennaProc_t *)malloc(
sizeof(puschAntennaProc_t) + symbolSize * sizeof(c16_t)
);
if (!rdata) {
perror("Failed to allocate memory");
return -1;
}
for (int aarx=0; aarx<gNB->frame_parms.nb_antennas_rx; aarx++) {
notifiedFIFO_elt_t *req = newNotifiedFIFO_elt(sizeof(puschAntennaProc_t), aarx, &gNB->respPuschAarx, &inner_channel_estimation); // create a job for Tpool
puschSymbolProc_t *rdata = (puschSymbolProc_t*)NotifiedFifoData(req); // data for the job
puschAntennaProc_t *rdata = malloc(sizeof(puschAntennaProc_t));
// Local init in the current loop
rdata->aarx = aarx;
......@@ -518,7 +515,6 @@ int nr_pusch_channel_estimation(PHY_VARS_gNB *gNB,
rdata->ul_ls_est = ul_ls_est;
rdata->delay = delay;
rdata->gNB = gNB;
rdata->symbol_offset = symbol_offset;
rdata->ul_ch_estimates = ul_ch_estimates;
......@@ -536,13 +532,23 @@ int nr_pusch_channel_estimation(PHY_VARS_gNB *gNB,
rdata->nushift = nushift;
// Call the inner_channel_estimation function
inner_channel_estimation(rdata);
// inner_channel_estimation(rdata);
pushTpool(&gNB->threadPool, req);
gNB->nbAarx++;
LOG_D(PHY,"Added Antenna (count %d) to process, in pipe\n",gNB->nbAarx);
// value update of rdata to be passed to the next inner call
max_ch = rdata->max_ch; // Placeholder for max channel value update
noise_amp2 = rdata->noise_amp2; // Placeholder for noise amplitude squared update
delay->est_delay = rdata->delay->est_delay; // Placeholder for estimated delay update
nest_count = rdata->nest_count; // Placeholder for nested count update
} // Antenna Loop
while (gNB->nbAarx > 0) {
notifiedFIFO_elt_t *req = pullTpool(&gNB->respPuschAarx, &gNB->threadPool);
gNB->nbAarx--;
delNotifiedFIFO_elt(req);
}
// Free the allocated memory
......
......@@ -707,6 +707,7 @@ typedef struct PHY_VARS_gNB_s {
time_stats_t rx_dft_stats;
time_stats_t ulsch_freq_offset_estimation_stats;
*/
notifiedFIFO_t respPuschAarx;
notifiedFIFO_t respPuschSymb;
notifiedFIFO_t respDecode;
notifiedFIFO_t resp_L1;
......@@ -717,6 +718,7 @@ typedef struct PHY_VARS_gNB_s {
notifiedFIFO_t resp_RU_tx;
tpool_t threadPool;
int nbSymb;
int nbAarx;
int num_pusch_symbols_per_thread;
int dmrs_num_antennas_per_thread;
pthread_t L1_rx_thread;
......
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