added printfs

master
Ismael Gomez 8 years ago
parent f61448e4ea
commit 3941589cc5

@ -512,12 +512,13 @@ int main(int argc, char **argv) {
srslte_ue_sync_get_sfidx(&ue_sync), srslte_ue_sync_get_sfidx(&ue_sync),
SRSLTE_SIRNTI, rv); SRSLTE_SIRNTI, rv);
/*
if (n>0) { if (n>0) {
printf("Saving signal...\n"); printf("Saving signal...\n");
srslte_ue_dl_save_signal(&ue_dl, &ue_dl.softbuffer, sfn*10+srslte_ue_sync_get_sfidx(&ue_sync), rv, prog_args.rnti); srslte_ue_dl_save_signal(&ue_dl, &ue_dl.softbuffer, sfn*10+srslte_ue_sync_get_sfidx(&ue_sync), rv, prog_args.rnti);
exit(-1); exit(-1);
} }
*/
} }
if (n < 0) { if (n < 0) {
// fprintf(stderr, "Error decoding UE DL\n");fflush(stdout); // fprintf(stderr, "Error decoding UE DL\n");fflush(stdout);

@ -304,23 +304,27 @@ static int dci_blind_search(srslte_ue_dl_t *q, dci_blind_search_t *search_space,
ret = 0; ret = 0;
int i=0; int i=0;
do { do {
printf("Searching format %s in %d,%d\n",
srslte_dci_format_string(search_space->format), search_space->loc[i].ncce, search_space->loc[i].L);
if (srslte_pdcch_decode_msg(&q->pdcch, dci_msg, &search_space->loc[i], search_space->format, &crc_rem)) { if (srslte_pdcch_decode_msg(&q->pdcch, dci_msg, &search_space->loc[i], search_space->format, &crc_rem)) {
fprintf(stderr, "Error decoding DCI msg\n"); fprintf(stderr, "Error decoding DCI msg\n");
return SRSLTE_ERROR; return SRSLTE_ERROR;
} }
if (crc_rem == rnti) { if (crc_rem == rnti) {
printf("Found crc_rem=0x%x, format=%d\n", rnti, dci_msg->format);
// If searching for Format1A but found Format0 save it for later // If searching for Format1A but found Format0 save it for later
if (dci_msg->format == SRSLTE_DCI_FORMAT0 && search_space->format == SRSLTE_DCI_FORMAT1A) if (dci_msg->format == SRSLTE_DCI_FORMAT0 && search_space->format == SRSLTE_DCI_FORMAT1A)
{ {
q->pending_ul_dci_rnti = crc_rem; q->pending_ul_dci_rnti = crc_rem;
memcpy(&q->pending_ul_dci_msg, dci_msg, sizeof(srslte_dci_msg_t)); memcpy(&q->pending_ul_dci_msg, dci_msg, sizeof(srslte_dci_msg_t));
printf("Saved UL for later\n");
// Else if we found it, save location and leave // Else if we found it, save location and leave
} else if (dci_msg->format != search_space->format) } else if (dci_msg->format == search_space->format)
{ {
ret = 1; ret = 1;
memcpy(&q->last_location, &search_space->loc[i], sizeof(srslte_dci_location_t)); memcpy(&q->last_location, &search_space->loc[i], sizeof(srslte_dci_location_t));
} else {
printf("msg_format=%d, search_format=%d\n", dci_msg->format, search_space->format);
} }
} }
i++; i++;
@ -343,8 +347,8 @@ int srslte_ue_dl_find_ul_dci(srslte_ue_dl_t *q, uint32_t cfi, uint32_t sf_idx, u
dci_blind_search_t search_space; dci_blind_search_t search_space;
search_space.format = SRSLTE_DCI_FORMAT0; search_space.format = SRSLTE_DCI_FORMAT0;
search_space.nof_locations = srslte_pdcch_ue_locations(&q->pdcch, search_space.loc, MAX_CANDIDATES_UE, sf_idx, cfi, rnti); search_space.nof_locations = srslte_pdcch_ue_locations(&q->pdcch, search_space.loc, MAX_CANDIDATES_UE, sf_idx, cfi, rnti);
printf("Searching UL C-RNTI in %d ue locations\n", search_space.nof_locations);
return dci_blind_search(q, &search_space, rnti, dci_msg); return dci_blind_search(q, &search_space, rnti, dci_msg);
} else { } else {
return 0; return 0;
} }
@ -372,6 +376,7 @@ static int find_dl_dci_type_siprarnti(srslte_ue_dl_t *q, uint32_t cfi, uint16_t
// Configure and run DCI blind search // Configure and run DCI blind search
dci_blind_search_t search_space; dci_blind_search_t search_space;
search_space.nof_locations = srslte_pdcch_common_locations(&q->pdcch, search_space.loc, MAX_CANDIDATES_COM, q->cfi); search_space.nof_locations = srslte_pdcch_common_locations(&q->pdcch, search_space.loc, MAX_CANDIDATES_COM, q->cfi);
printf("Searching SI/P/RA-RNTI in %d common locations, %d formats\n", search_space.nof_locations, nof_common_formats);
for (int f=0;f<nof_common_formats;f++) { for (int f=0;f<nof_common_formats;f++) {
search_space.format = common_formats[f]; search_space.format = common_formats[f];
if ((ret = dci_blind_search(q, &search_space, rnti, dci_msg))) { if ((ret = dci_blind_search(q, &search_space, rnti, dci_msg))) {
@ -388,6 +393,7 @@ static int find_dl_dci_type_crnti(srslte_ue_dl_t *q, uint32_t cfi, uint32_t sf_i
// Search UE-specific search space // Search UE-specific search space
dci_blind_search_t search_space; dci_blind_search_t search_space;
search_space.nof_locations = srslte_pdcch_ue_locations(&q->pdcch, search_space.loc, MAX_CANDIDATES_UE, sf_idx, q->cfi, rnti); search_space.nof_locations = srslte_pdcch_ue_locations(&q->pdcch, search_space.loc, MAX_CANDIDATES_UE, sf_idx, q->cfi, rnti);
printf("Searching DL C-RNTI in %d ue locations, %d formats\n", search_space.nof_locations, nof_ue_formats);
for (int f=0;f<nof_ue_formats;f++) { for (int f=0;f<nof_ue_formats;f++) {
search_space.format = ue_formats[f]; search_space.format = ue_formats[f];
if ((ret = dci_blind_search(q, &search_space, rnti, dci_msg))) { if ((ret = dci_blind_search(q, &search_space, rnti, dci_msg))) {
@ -397,6 +403,7 @@ static int find_dl_dci_type_crnti(srslte_ue_dl_t *q, uint32_t cfi, uint32_t sf_i
// Search Common search space for Format 1A // Search Common search space for Format 1A
search_space.format = SRSLTE_DCI_FORMAT1A; search_space.format = SRSLTE_DCI_FORMAT1A;
search_space.nof_locations = srslte_pdcch_common_locations(&q->pdcch, search_space.loc, MAX_CANDIDATES_COM, q->cfi); search_space.nof_locations = srslte_pdcch_common_locations(&q->pdcch, search_space.loc, MAX_CANDIDATES_COM, q->cfi);
printf("Searching DL C-RNTI in %d ue locations, format 1A\n", search_space.nof_locations, nof_ue_formats);
return dci_blind_search(q, &search_space, rnti, dci_msg); return dci_blind_search(q, &search_space, rnti, dci_msg);
} }

@ -395,11 +395,12 @@ static int track_peak_ok(srslte_ue_sync_t *q, uint32_t track_idx) {
} }
q->mean_sfo = SRSLTE_VEC_EMA(q->mean_sample_offset, q->mean_sfo, q->sfo_ema); q->mean_sfo = SRSLTE_VEC_EMA(q->mean_sample_offset, q->mean_sfo, q->sfo_ema);
if (q->next_rf_sample_offset) {
INFO("Time offset adjustment: %d samples (%.2f), mean SFO: %.2f Hz, %.5f samples/5-sf, ema=%f, length=%d\n", INFO("Time offset adjustment: %d samples (%.2f), mean SFO: %.2f Hz, %.5f samples/5-sf, ema=%f, length=%d\n",
q->next_rf_sample_offset, q->mean_sample_offset, q->next_rf_sample_offset, q->mean_sample_offset,
srslte_ue_sync_get_sfo(q), srslte_ue_sync_get_sfo(q),
q->mean_sfo, q->sfo_ema, q->sample_offset_correct_period); q->mean_sfo, q->sfo_ema, q->sample_offset_correct_period);
}
q->mean_sample_offset = 0; q->mean_sample_offset = 0;
} }

Loading…
Cancel
Save