mirror of https://github.com/PentHertz/srsLTE.git
Merge branch 'next' into raa
This commit is contained in:
commit
9dc6024483
|
@ -371,7 +371,7 @@ if(RF_FOUND)
|
||||||
message(STATUS "Building with srsENB")
|
message(STATUS "Building with srsENB")
|
||||||
add_subdirectory(srsenb)
|
add_subdirectory(srsenb)
|
||||||
else(ENABLE_SRSENB)
|
else(ENABLE_SRSENB)
|
||||||
message(STATUS "srsUE build disabled")
|
message(STATUS "srsENB build disabled")
|
||||||
endif(ENABLE_SRSENB)
|
endif(ENABLE_SRSENB)
|
||||||
else(RF_FOUND)
|
else(RF_FOUND)
|
||||||
message(STATUS "srsUE and srsENB builds disabled due to missing RF driver")
|
message(STATUS "srsUE and srsENB builds disabled due to missing RF driver")
|
||||||
|
|
|
@ -101,6 +101,7 @@ namespace srslte {
|
||||||
void set_tx_freq(double freq);
|
void set_tx_freq(double freq);
|
||||||
void set_rx_freq(double freq);
|
void set_rx_freq(double freq);
|
||||||
|
|
||||||
|
double get_freq_offset();
|
||||||
double get_tx_freq();
|
double get_tx_freq();
|
||||||
double get_rx_freq();
|
double get_rx_freq();
|
||||||
|
|
||||||
|
|
|
@ -176,7 +176,7 @@ void print_uint8x16_t(char *s, uint8x16_t val) {
|
||||||
printf("\n");
|
printf("\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
int movemask_neon(uint8x16_t movemask_low_in)
|
static inline int movemask_neon(uint8x16_t movemask_low_in)
|
||||||
{
|
{
|
||||||
uint8x8_t lo = vget_low_u8(movemask_low_in);
|
uint8x8_t lo = vget_low_u8(movemask_low_in);
|
||||||
uint8x8_t hi = vget_high_u8(movemask_low_in);
|
uint8x8_t hi = vget_high_u8(movemask_low_in);
|
||||||
|
|
|
@ -175,6 +175,10 @@ int main(int argc, char **argv) {
|
||||||
}
|
}
|
||||||
|
|
||||||
uint8_t *data[] = {malloc(100000)};
|
uint8_t *data[] = {malloc(100000)};
|
||||||
|
if (!data[0]) {
|
||||||
|
perror("malloc");
|
||||||
|
exit(-1);
|
||||||
|
}
|
||||||
|
|
||||||
ret = -1;
|
ret = -1;
|
||||||
nof_frames = 0;
|
nof_frames = 0;
|
||||||
|
@ -195,7 +199,8 @@ int main(int argc, char **argv) {
|
||||||
} while (nof_frames <= max_frames && ret == 0);
|
} while (nof_frames <= max_frames && ret == 0);
|
||||||
|
|
||||||
base_free();
|
base_free();
|
||||||
free(data[0]);
|
if (data[0])
|
||||||
|
free(data[0]);
|
||||||
if (ret > 0) {
|
if (ret > 0) {
|
||||||
exit(0);
|
exit(0);
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -181,13 +181,17 @@ int main(int argc, char **argv) {
|
||||||
exit(-1);
|
exit(-1);
|
||||||
}
|
}
|
||||||
|
|
||||||
uint8_t *data[] = {malloc(100000)};
|
uint8_t *data = malloc(100000);
|
||||||
|
if (!data) {
|
||||||
|
perror("malloc");
|
||||||
|
exit(-1);
|
||||||
|
}
|
||||||
|
|
||||||
ret = -1;
|
ret = -1;
|
||||||
|
|
||||||
srslte_filesource_read(&fsrc, input_buffer[0], flen);
|
srslte_filesource_read(&fsrc, input_buffer[0], flen);
|
||||||
INFO("Reading %d samples sub-frame %d\n", flen, sf_idx);
|
INFO("Reading %d samples sub-frame %d\n", flen, sf_idx);
|
||||||
ret = srslte_ue_dl_decode_mbsfn(&ue_dl, data[0], sf_idx);
|
ret = srslte_ue_dl_decode_mbsfn(&ue_dl, data, sf_idx);
|
||||||
if(ret > 0) {
|
if(ret > 0) {
|
||||||
printf("PMCH Decoded OK!\n");
|
printf("PMCH Decoded OK!\n");
|
||||||
} else if (ret < 0) {
|
} else if (ret < 0) {
|
||||||
|
@ -195,7 +199,9 @@ int main(int argc, char **argv) {
|
||||||
}
|
}
|
||||||
|
|
||||||
base_free();
|
base_free();
|
||||||
free(data[0]);
|
if (data != NULL) {
|
||||||
|
free(data);
|
||||||
|
}
|
||||||
if (ret > 0) {
|
if (ret > 0) {
|
||||||
exit(0);
|
exit(0);
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -626,13 +626,12 @@ int srslte_ue_ul_sr_send_tti(uint32_t I_sr, uint32_t current_tti) {
|
||||||
} else {
|
} else {
|
||||||
return SRSLTE_ERROR;
|
return SRSLTE_ERROR;
|
||||||
}
|
}
|
||||||
uint32_t sfn = current_tti/10;
|
if (current_tti >= sr_N_offset) {
|
||||||
uint32_t subf = current_tti%10;
|
if ((current_tti - sr_N_offset) % sr_periodicity == 0) {
|
||||||
if ((10*sfn+subf-sr_N_offset)%sr_periodicity==0) {
|
return 1;
|
||||||
return 1;
|
}
|
||||||
} else {
|
|
||||||
return SRSLTE_SUCCESS;
|
|
||||||
}
|
}
|
||||||
|
return SRSLTE_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -313,6 +313,11 @@ double radio::get_rx_freq()
|
||||||
return rx_freq;
|
return rx_freq;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
double radio::get_freq_offset()
|
||||||
|
{
|
||||||
|
return freq_offset;
|
||||||
|
}
|
||||||
|
|
||||||
double radio::get_tx_freq()
|
double radio::get_tx_freq()
|
||||||
{
|
{
|
||||||
return tx_freq;
|
return tx_freq;
|
||||||
|
|
|
@ -864,15 +864,6 @@ int sched::ul_sched(uint32_t tti, srsenb::sched_interface::ul_sched_res_t* sched
|
||||||
printf("SCHED: Could not schedule UL DCI rnti=0x%x, pid=%d, L=%d, sf_idx=%d\n",
|
printf("SCHED: Could not schedule UL DCI rnti=0x%x, pid=%d, L=%d, sf_idx=%d\n",
|
||||||
rnti, h->get_id(), aggr_level, sf_idx);
|
rnti, h->get_id(), aggr_level, sf_idx);
|
||||||
|
|
||||||
sched_ue::sched_dci_cce_t *loc=user->get_locations(current_cfi, sf_idx);
|
|
||||||
for (int i=0;i<loc->nof_loc[aggr_level];i++) {
|
|
||||||
printf("n=%d\n", loc->cce_start[aggr_level][i]);
|
|
||||||
}
|
|
||||||
printf("used=[");
|
|
||||||
for (int i=0;i<MAX_CCE;i++) {
|
|
||||||
printf("%d,", used_cce[i]);
|
|
||||||
}
|
|
||||||
printf("\n");
|
|
||||||
sched_result->pusch[nof_dci_elems].needs_pdcch = false;
|
sched_result->pusch[nof_dci_elems].needs_pdcch = false;
|
||||||
} else {
|
} else {
|
||||||
sched_result->pusch[nof_dci_elems].needs_pdcch = true;
|
sched_result->pusch[nof_dci_elems].needs_pdcch = true;
|
||||||
|
|
|
@ -10,4 +10,4 @@
|
||||||
#
|
#
|
||||||
# Note: Lines starting by '#' are ignored
|
# Note: Lines starting by '#' are ignored
|
||||||
ue1,001010123456789,00112233445566778899aabbccddeeff,63BFA50EE6523365FF14C1F45F88737D,9001
|
ue1,001010123456789,00112233445566778899aabbccddeeff,63BFA50EE6523365FF14C1F45F88737D,9001
|
||||||
ue2,001010123456780,00112233445566778899aabbccddeeaa,63BFA50EE6523365FF14C1F45F88737D,2000
|
ue2,001010123456780,00112233445566778899aabbccddeeaa,63BFA50EE6523365FF14C1F45F88737D,8000
|
||||||
|
|
|
@ -206,7 +206,7 @@ private:
|
||||||
{
|
{
|
||||||
if (ack) {
|
if (ack) {
|
||||||
if (grant) {
|
if (grant) {
|
||||||
if (grant->ndi[0] == get_ndi()) {
|
if (grant->ndi[0] == get_ndi() && grant->phy_grant.ul.mcs.tbs != 0) {
|
||||||
*ack = false;
|
*ack = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -215,7 +215,7 @@ private:
|
||||||
|
|
||||||
// Reset HARQ process if TB has changed
|
// Reset HARQ process if TB has changed
|
||||||
if (harq_feedback && has_grant() && grant) {
|
if (harq_feedback && has_grant() && grant) {
|
||||||
if (grant->n_bytes[0] != cur_grant.n_bytes[0] && cur_grant.n_bytes[0] > 0) {
|
if (grant->n_bytes[0] != cur_grant.n_bytes[0] && cur_grant.n_bytes[0] > 0 && grant->n_bytes[0] > 0) {
|
||||||
Debug("UL %d: Reset due to change of grant size last_grant=%d, new_grant=%d\n",
|
Debug("UL %d: Reset due to change of grant size last_grant=%d, new_grant=%d\n",
|
||||||
pid, cur_grant.n_bytes[0], grant->n_bytes[0]);
|
pid, cur_grant.n_bytes[0], grant->n_bytes[0]);
|
||||||
reset();
|
reset();
|
||||||
|
|
|
@ -70,6 +70,8 @@ public:
|
||||||
void start_plot();
|
void start_plot();
|
||||||
|
|
||||||
float get_ref_cfo();
|
float get_ref_cfo();
|
||||||
|
float get_cfo();
|
||||||
|
float get_ul_cfo();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
/* Inherited from thread_pool::worker. Function called every subframe to run the DL/UL processing */
|
/* Inherited from thread_pool::worker. Function called every subframe to run the DL/UL processing */
|
||||||
|
|
|
@ -203,6 +203,25 @@ float phch_worker::get_ref_cfo()
|
||||||
return srslte_chest_dl_get_cfo(&ue_dl.chest);
|
return srslte_chest_dl_get_cfo(&ue_dl.chest);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
float phch_worker::get_cfo()
|
||||||
|
{
|
||||||
|
return cfo;
|
||||||
|
}
|
||||||
|
|
||||||
|
float phch_worker::get_ul_cfo() {
|
||||||
|
srslte::radio *radio = phy->get_radio();
|
||||||
|
|
||||||
|
if (radio->get_freq_offset() != 0.0f) {
|
||||||
|
/* Compensates the radio frequency offset applied equally to DL and UL */
|
||||||
|
const float ul_dl_ratio = (float) radio->get_tx_freq() / (float) radio->get_rx_freq();
|
||||||
|
const float offset_hz = (float) radio->get_freq_offset() * (1.0f - ul_dl_ratio);
|
||||||
|
return cfo - offset_hz / (15000);
|
||||||
|
} else {
|
||||||
|
return cfo;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
void phch_worker::work_imp()
|
void phch_worker::work_imp()
|
||||||
{
|
{
|
||||||
if (!cell_initiated) {
|
if (!cell_initiated) {
|
||||||
|
@ -324,7 +343,7 @@ void phch_worker::work_imp()
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Set UL CFO before transmission */
|
/* Set UL CFO before transmission */
|
||||||
srslte_ue_ul_set_cfo(&ue_ul, cfo);
|
srslte_ue_ul_set_cfo(&ue_ul, get_ul_cfo());
|
||||||
|
|
||||||
/* Transmit PUSCH, PUCCH or SRS */
|
/* Transmit PUSCH, PUCCH or SRS */
|
||||||
bool signal_ready = false;
|
bool signal_ready = false;
|
||||||
|
@ -367,7 +386,7 @@ void phch_worker::work_imp()
|
||||||
update_measurements();
|
update_measurements();
|
||||||
|
|
||||||
if (chest_ok) {
|
if (chest_ok) {
|
||||||
if (phy->avg_rsrp_dbm > -130.0 && 10*log10(srslte_chest_dl_get_snr(&ue_dl.chest)) > -30.0) {
|
if (phy->avg_rsrp_dbm > -130.0 && phy->avg_snr_db > -30.0) {
|
||||||
log_h->debug("SNR=%.1f dB, RSRP=%.1f dBm sync=in-sync from channel estimator\n",
|
log_h->debug("SNR=%.1f dB, RSRP=%.1f dBm sync=in-sync from channel estimator\n",
|
||||||
10*log10(srslte_chest_dl_get_snr(&ue_dl.chest)), phy->avg_rsrp_dbm);
|
10*log10(srslte_chest_dl_get_snr(&ue_dl.chest)), phy->avg_rsrp_dbm);
|
||||||
chest_loop->in_sync();
|
chest_loop->in_sync();
|
||||||
|
@ -931,7 +950,7 @@ void phch_worker::set_uci_aperiodic_cqi()
|
||||||
|
|
||||||
int cqi_len = srslte_cqi_value_pack(&cqi_report, uci_data.uci_cqi);
|
int cqi_len = srslte_cqi_value_pack(&cqi_report, uci_data.uci_cqi);
|
||||||
if (cqi_len < 0) {
|
if (cqi_len < 0) {
|
||||||
Error("Error packing CQI value (Aperiodic reporting mode RM31).");
|
Error("Error packing CQI value (Aperiodic reporting mode RM30).");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
uci_data.uci_cqi_len = (uint32_t) cqi_len;
|
uci_data.uci_cqi_len = (uint32_t) cqi_len;
|
||||||
|
@ -940,11 +959,16 @@ void phch_worker::set_uci_aperiodic_cqi()
|
||||||
srslte_cqi_to_str(uci_data.uci_cqi, uci_data.uci_cqi_len, cqi_str, SRSLTE_CQI_STR_MAX_CHAR);
|
srslte_cqi_to_str(uci_data.uci_cqi, uci_data.uci_cqi_len, cqi_str, SRSLTE_CQI_STR_MAX_CHAR);
|
||||||
|
|
||||||
/* Set RI = 1 */
|
/* Set RI = 1 */
|
||||||
uci_data.uci_ri = ri;
|
if (phy->config->dedicated.antenna_info_explicit_value.tx_mode == LIBLTE_RRC_TRANSMISSION_MODE_3 ||
|
||||||
uci_data.uci_ri_len = 1;
|
phy->config->dedicated.antenna_info_explicit_value.tx_mode == LIBLTE_RRC_TRANSMISSION_MODE_4) {
|
||||||
|
uci_data.uci_ri = ri;
|
||||||
|
uci_data.uci_ri_len = 1;
|
||||||
|
} else {
|
||||||
|
uci_data.uci_ri_len = 0;
|
||||||
|
}
|
||||||
|
|
||||||
Info("PUSCH: Aperiodic RM30 ri%s, CQI=%s, SNR=%.1f dB, for %d subbands\n",
|
Info("PUSCH: Aperiodic RM30 CQI=%s, %sSNR=%.1f dB, for %d subbands\n",
|
||||||
(uci_data.uci_ri == 0)?"=1":"~1", cqi_str, phy->avg_snr_db, cqi_report.subband_hl.N);
|
cqi_str, (uci_data.uci_ri_len)?((uci_data.uci_ri == 0)?"ri=0, ":"ri=1, "):"", phy->avg_snr_db, cqi_report.subband_hl.N);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case LIBLTE_RRC_CQI_REPORT_MODE_APERIODIC_RM31:
|
case LIBLTE_RRC_CQI_REPORT_MODE_APERIODIC_RM31:
|
||||||
|
@ -1471,6 +1495,13 @@ plot_scatter_t pconst;
|
||||||
float tmp_plot[SCATTER_PDSCH_BUFFER_LEN];
|
float tmp_plot[SCATTER_PDSCH_BUFFER_LEN];
|
||||||
cf_t tmp_plot2[SRSLTE_SF_LEN_RE(SRSLTE_MAX_PRB, SRSLTE_CP_NORM)];
|
cf_t tmp_plot2[SRSLTE_SF_LEN_RE(SRSLTE_MAX_PRB, SRSLTE_CP_NORM)];
|
||||||
|
|
||||||
|
#define CFO_PLOT_LEN 0 /* Set to non zero for enabling CFO plot */
|
||||||
|
#if CFO_PLOT_LEN > 0
|
||||||
|
static plot_real_t pcfo;
|
||||||
|
static uint32_t icfo = 0;
|
||||||
|
static float cfo_buffer[CFO_PLOT_LEN];
|
||||||
|
#endif /* CFO_PLOT_LEN > 0 */
|
||||||
|
|
||||||
void *plot_thread_run(void *arg) {
|
void *plot_thread_run(void *arg) {
|
||||||
srsue::phch_worker *worker = (srsue::phch_worker*) arg;
|
srsue::phch_worker *worker = (srsue::phch_worker*) arg;
|
||||||
|
|
||||||
|
@ -1495,10 +1526,14 @@ void *plot_thread_run(void *arg) {
|
||||||
|
|
||||||
plot_scatter_addToWindowGrid(&pconst, (char*)"srsue", 0, worker->get_rx_nof_antennas());
|
plot_scatter_addToWindowGrid(&pconst, (char*)"srsue", 0, worker->get_rx_nof_antennas());
|
||||||
|
|
||||||
|
#if CFO_PLOT_LEN > 0
|
||||||
|
plot_real_init(&pcfo);
|
||||||
|
plot_real_setTitle(&pcfo, (char*) "CFO (Hz)");
|
||||||
|
plot_real_setLabels(&pcfo, (char *) "Time", (char *) "Hz");
|
||||||
|
plot_real_setYAxisScale(&pcfo, -4000, 4000);
|
||||||
|
|
||||||
|
plot_scatter_addToWindowGrid(&pcfo, (char*)"srsue", 1, worker->get_rx_nof_antennas());
|
||||||
|
#endif /* CFO_PLOT_LEN > 0 */
|
||||||
|
|
||||||
|
|
||||||
int n;
|
int n;
|
||||||
int readed_pdsch_re=0;
|
int readed_pdsch_re=0;
|
||||||
|
@ -1522,6 +1557,13 @@ void *plot_thread_run(void *arg) {
|
||||||
}
|
}
|
||||||
readed_pdsch_re = 0;
|
readed_pdsch_re = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if CFO_PLOT_LEN > 0
|
||||||
|
cfo_buffer[icfo] = worker->get_cfo() * 15000.0f;
|
||||||
|
icfo = (icfo + 1)%CFO_PLOT_LEN;
|
||||||
|
plot_real_setNewData(&pcfo, cfo_buffer, CFO_PLOT_LEN);
|
||||||
|
#endif /* CFO_PLOT_LEN > 0 */
|
||||||
|
|
||||||
}
|
}
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue