fixed incorrect initialization of PUSCH estimator

master
Ismael Gomez 7 years ago
parent 22f194182c
commit b59e4d08ca

@ -157,16 +157,18 @@ SRSLTE_API int srslte_enb_dl_put_pdsch(srslte_enb_dl_t *q,
srslte_ra_dl_grant_t *grant, srslte_ra_dl_grant_t *grant,
srslte_softbuffer_tx_t *softbuffer[SRSLTE_MAX_CODEWORDS], srslte_softbuffer_tx_t *softbuffer[SRSLTE_MAX_CODEWORDS],
uint16_t rnti, uint16_t rnti,
uint32_t rv_idx, int rv_idx[SRSLTE_MAX_CODEWORDS],
uint32_t sf_idx, uint32_t sf_idx,
uint8_t *data[SRSLTE_MAX_CODEWORDS]); uint8_t *data[SRSLTE_MAX_CODEWORDS],
srslte_mimo_type_t mimo_type,
uint32_t pmi);
SRSLTE_API int srslte_enb_dl_put_pdcch_dl(srslte_enb_dl_t *q, SRSLTE_API int srslte_enb_dl_put_pdcch_dl(srslte_enb_dl_t *q,
srslte_ra_dl_dci_t *grant, srslte_ra_dl_dci_t *grant,
srslte_dci_format_t format, srslte_dci_format_t format,
srslte_dci_location_t location, srslte_dci_location_t location,
uint16_t rnti, uint16_t rnti,
uint32_t sf_idx); uint32_t sf_idx);
SRSLTE_API int srslte_enb_dl_put_pdcch_ul(srslte_enb_dl_t *q, SRSLTE_API int srslte_enb_dl_put_pdcch_ul(srslte_enb_dl_t *q,
srslte_ra_ul_dci_t *grant, srslte_ra_ul_dci_t *grant,

@ -45,6 +45,7 @@
#define NOF_REFS_SYM (q->cell.nof_prb*SRSLTE_NRE) #define NOF_REFS_SYM (q->cell.nof_prb*SRSLTE_NRE)
#define NOF_REFS_SF (NOF_REFS_SYM*2) // 2 reference symbols per subframe #define NOF_REFS_SF (NOF_REFS_SYM*2) // 2 reference symbols per subframe
#define MAX_REFS_SYM (max_prb*SRSLTE_NRE)
#define MAX_REFS_SF (max_prb*SRSLTE_NRE*2) // 2 reference symbols per subframe #define MAX_REFS_SF (max_prb*SRSLTE_NRE*2) // 2 reference symbols per subframe
/** 3GPP LTE Downlink channel estimator and equalizer. /** 3GPP LTE Downlink channel estimator and equalizer.
@ -98,7 +99,7 @@ int srslte_chest_ul_init(srslte_chest_ul_t *q, uint32_t max_prb)
goto clean_exit; goto clean_exit;
} }
if (srslte_interp_linear_vector_init(&q->srslte_interp_linvec, MAX_REFS_SF)) { if (srslte_interp_linear_vector_init(&q->srslte_interp_linvec, MAX_REFS_SYM)) {
fprintf(stderr, "Error initializing vector interpolator\n"); fprintf(stderr, "Error initializing vector interpolator\n");
goto clean_exit; goto clean_exit;
} }
@ -165,7 +166,7 @@ int srslte_chest_ul_set_cell(srslte_chest_ul_t *q, srslte_cell_t cell)
return SRSLTE_ERROR; return SRSLTE_ERROR;
} }
if (srslte_interp_linear_vector_resize(&q->srslte_interp_linvec, NOF_REFS_SF)) { if (srslte_interp_linear_vector_resize(&q->srslte_interp_linvec, NOF_REFS_SYM)) {
fprintf(stderr, "Error initializing vector interpolator\n"); fprintf(stderr, "Error initializing vector interpolator\n");
return SRSLTE_ERROR; return SRSLTE_ERROR;
} }

@ -39,14 +39,27 @@
#define FFTW_WISDOM_FILE ".fftw_wisdom" #define FFTW_WISDOM_FILE ".fftw_wisdom"
#ifdef FFTW_WISDOM_FILE
#define FFTW_TYPE FFTW_MEASURE
#else
#define FFTW_TYPE 0
#endif
void srslte_dft_load() { void srslte_dft_load() {
#ifdef FFTW_WISDOM_FILE
fftwf_import_wisdom_from_filename(FFTW_WISDOM_FILE); fftwf_import_wisdom_from_filename(FFTW_WISDOM_FILE);
#else
printf("Warning: FFTW Wisdom file not defined\n");
#endif
} }
void srslte_dft_exit() { void srslte_dft_exit() {
#ifdef FFTW_WISDOM_FILE
if (!fftwf_export_wisdom_to_filename(FFTW_WISDOM_FILE)) { if (!fftwf_export_wisdom_to_filename(FFTW_WISDOM_FILE)) {
fprintf(stderr, "Error saving FFTW wisdom to file %s\n", FFTW_WISDOM_FILE); fprintf(stderr, "Error saving FFTW wisdom to file %s\n", FFTW_WISDOM_FILE);
} }
#endif
} }
int srslte_dft_plan(srslte_dft_plan_t *plan, const int dft_points, srslte_dft_dir_t dir, int srslte_dft_plan(srslte_dft_plan_t *plan, const int dft_points, srslte_dft_dir_t dir,
@ -86,7 +99,7 @@ int srslte_dft_replan_c(srslte_dft_plan_t *plan, const int new_dft_points) {
fftwf_destroy_plan(plan->p); fftwf_destroy_plan(plan->p);
plan->p = NULL; plan->p = NULL;
} }
plan->p = fftwf_plan_dft_1d(new_dft_points, plan->in, plan->out, sign, 0U); plan->p = fftwf_plan_dft_1d(new_dft_points, plan->in, plan->out, sign, FFTW_TYPE);
if (!plan->p) { if (!plan->p) {
return -1; return -1;
} }
@ -97,7 +110,7 @@ int srslte_dft_replan_c(srslte_dft_plan_t *plan, const int new_dft_points) {
int srslte_dft_plan_c(srslte_dft_plan_t *plan, const int dft_points, srslte_dft_dir_t dir) { int srslte_dft_plan_c(srslte_dft_plan_t *plan, const int dft_points, srslte_dft_dir_t dir) {
allocate(plan,sizeof(fftwf_complex),sizeof(fftwf_complex), dft_points); allocate(plan,sizeof(fftwf_complex),sizeof(fftwf_complex), dft_points);
int sign = (dir == SRSLTE_DFT_FORWARD) ? FFTW_FORWARD : FFTW_BACKWARD; int sign = (dir == SRSLTE_DFT_FORWARD) ? FFTW_FORWARD : FFTW_BACKWARD;
plan->p = fftwf_plan_dft_1d(dft_points, plan->in, plan->out, sign, FFTW_MEASURE); plan->p = fftwf_plan_dft_1d(dft_points, plan->in, plan->out, sign, FFTW_TYPE);
if (!plan->p) { if (!plan->p) {
return -1; return -1;
} }
@ -120,7 +133,7 @@ int srslte_dft_replan_r(srslte_dft_plan_t *plan, const int new_dft_points) {
fftwf_destroy_plan(plan->p); fftwf_destroy_plan(plan->p);
plan->p = NULL; plan->p = NULL;
} }
plan->p = fftwf_plan_r2r_1d(new_dft_points, plan->in, plan->out, sign, FFTW_MEASURE); plan->p = fftwf_plan_r2r_1d(new_dft_points, plan->in, plan->out, sign, FFTW_TYPE);
if (!plan->p) { if (!plan->p) {
return -1; return -1;
} }
@ -131,7 +144,7 @@ int srslte_dft_replan_r(srslte_dft_plan_t *plan, const int new_dft_points) {
int srslte_dft_plan_r(srslte_dft_plan_t *plan, const int dft_points, srslte_dft_dir_t dir) { int srslte_dft_plan_r(srslte_dft_plan_t *plan, const int dft_points, srslte_dft_dir_t dir) {
allocate(plan,sizeof(float),sizeof(float), dft_points); allocate(plan,sizeof(float),sizeof(float), dft_points);
int sign = (dir == SRSLTE_DFT_FORWARD) ? FFTW_R2HC : FFTW_HC2R; int sign = (dir == SRSLTE_DFT_FORWARD) ? FFTW_R2HC : FFTW_HC2R;
plan->p = fftwf_plan_r2r_1d(dft_points, plan->in, plan->out, sign, FFTW_MEASURE); plan->p = fftwf_plan_r2r_1d(dft_points, plan->in, plan->out, sign, FFTW_TYPE);
if (!plan->p) { if (!plan->p) {
return -1; return -1;
} }

@ -320,11 +320,11 @@ int srslte_enb_dl_put_pdcch_ul(srslte_enb_dl_t *q, srslte_ra_ul_dci_t *grant,
} }
int srslte_enb_dl_put_pdsch(srslte_enb_dl_t *q, srslte_ra_dl_grant_t *grant, srslte_softbuffer_tx_t *softbuffer[SRSLTE_MAX_CODEWORDS], int srslte_enb_dl_put_pdsch(srslte_enb_dl_t *q, srslte_ra_dl_grant_t *grant, srslte_softbuffer_tx_t *softbuffer[SRSLTE_MAX_CODEWORDS],
uint16_t rnti, uint32_t rv_idx, uint32_t sf_idx, uint16_t rnti, int rv_idx[SRSLTE_MAX_CODEWORDS], uint32_t sf_idx,
uint8_t *data[SRSLTE_MAX_CODEWORDS]) uint8_t *data[SRSLTE_MAX_CODEWORDS], srslte_mimo_type_t mimo_type, uint32_t pmi)
{ {
/* Configure pdsch_cfg parameters */ /* Configure pdsch_cfg parameters */
if (srslte_pdsch_cfg(&q->pdsch_cfg, q->cell, grant, q->cfi, sf_idx, rv_idx)) { if (srslte_pdsch_cfg_mimo(&q->pdsch_cfg, q->cell, grant, q->cfi, sf_idx, rv_idx, mimo_type, pmi)) {
fprintf(stderr, "Error configuring PDSCH\n"); fprintf(stderr, "Error configuring PDSCH\n");
return SRSLTE_ERROR; return SRSLTE_ERROR;
} }

@ -138,7 +138,7 @@ typedef struct {
Main UE class Main UE class
*******************************************************************************/ *******************************************************************************/
#define LOG_STDOUT //#define LOG_STDOUT
class enb class enb
:public enb_metrics_interface { :public enb_metrics_interface {

@ -50,6 +50,9 @@ using namespace std;
#include "srsgui/srsgui.h" #include "srsgui/srsgui.h"
#include <semaphore.h> #include <semaphore.h>
#include <srslte/phy/phch/ra.h> #include <srslte/phy/phch/ra.h>
#include <srslte/srslte.h>
#include <srslte/phy/phch/pdsch.h>
#include <srslte/phy/common/sequence.h>
void init_plots(srsenb::phch_worker *worker); void init_plots(srsenb::phch_worker *worker);
pthread_t plot_thread; pthread_t plot_thread;
@ -267,8 +270,8 @@ void phch_worker::work_imp()
if (!running) { if (!running) {
return; return;
} }
pthread_mutex_lock(&mutex); pthread_mutex_lock(&mutex);
mac_interface_phy::ul_sched_t *ul_grants = phy->ul_grants; mac_interface_phy::ul_sched_t *ul_grants = phy->ul_grants;
mac_interface_phy::dl_sched_t *dl_grants = phy->dl_grants; mac_interface_phy::dl_sched_t *dl_grants = phy->dl_grants;
@ -283,10 +286,10 @@ void phch_worker::work_imp()
ue_db[rnti].has_grant_tti = -1; ue_db[rnti].has_grant_tti = -1;
} }
// Process UL signal // Process UL signal
srslte_enb_ul_fft(&enb_ul, signal_buffer_rx); srslte_enb_ul_fft(&enb_ul, signal_buffer_rx);
// Decode pending UL grants for the tti they were scheduled // Decode pending UL grants for the tti they were scheduled
decode_pusch(ul_grants[sf_rx].sched_grants, ul_grants[sf_rx].nof_grants, sf_rx); decode_pusch(ul_grants[sf_rx].sched_grants, ul_grants[sf_rx].nof_grants, sf_rx);
// Decode remaining PUCCH ACKs not associated with PUSCH transmission and SR signals // Decode remaining PUCCH ACKs not associated with PUSCH transmission and SR signals
@ -355,7 +358,7 @@ void phch_worker::work_imp()
} }
#endif #endif
unlock: unlock:
pthread_mutex_unlock(&mutex); pthread_mutex_unlock(&mutex);
} }
@ -687,8 +690,10 @@ int phch_worker::encode_pdsch(srslte_enb_dl_pdsch_t *grants, uint32_t nof_grants
phy_grant.mcs[0].tbs/8, phy_grant.mcs[0].idx, grants[i].grant.rv_idx, tti_tx); phy_grant.mcs[0].tbs/8, phy_grant.mcs[0].idx, grants[i].grant.rv_idx, tti_tx);
} }
srslte_softbuffer_tx_t *sb[SRSLTE_MAX_CODEWORDS] = {grants[i].softbuffer, NULL}; srslte_softbuffer_tx_t *sb[SRSLTE_MAX_CODEWORDS] = {grants[i].softbuffer, NULL};
uint8_t *d[SRSLTE_MAX_CODEWORDS] = {grants[i].data, NULL}; uint8_t *d[SRSLTE_MAX_CODEWORDS] = {grants[i].data, NULL};
if (srslte_enb_dl_put_pdsch(&enb_dl, &phy_grant, sb, rnti, grants[i].grant.rv_idx, sf_idx, d)) int rv[SRSLTE_MAX_CODEWORDS] = {grants[i].grant.rv_idx, 0};
if (srslte_enb_dl_put_pdsch(&enb_dl, &phy_grant, sb, rnti, rv, sf_idx, d, SRSLTE_MIMO_TYPE_SINGLE_ANTENNA, 0))
{ {
fprintf(stderr, "Error putting PDSCH %d\n",i); fprintf(stderr, "Error putting PDSCH %d\n",i);
return SRSLTE_ERROR; return SRSLTE_ERROR;

Loading…
Cancel
Save