Commit 8314a264 authored by Panos Matzakos's avatar Panos Matzakos

Merge remote-tracking branch 'main/RU-RAU-split'

parents 2d50ccaf 2516216d
When running lsusb, if you have:
Bus 001 Device 002: ID 12d1:14fe Huawei Technologies Co., Ltd. Modem (Mass Storage Mode)
You need to run:
usb_modeswitch -v 12d1 -p 14fe -M '55534243123456780000000000000011062000000100000000000000000000'
After what, running lsusb should give:
Bus 001 Device 004: ID 12d1:1506 Huawei Technologies Co., Ltd. Modem/Networkcard
Values of 'Bus' and 'Device' may differ of course.
...@@ -13,6 +13,16 @@ containing lines: ...@@ -13,6 +13,16 @@ containing lines:
SUBSYSTEM=="tty", ENV{ID_VENDOR_ID}=="1a8d", ENV{ID_MODEL_ID}=="100d", ENV{ID_SERIAL_SHORT}=="357473040068155", ENV{ID_USB_INTERFACE_NUM}=="00", SYMLINK+="bandrich.data", MODE="0666" SUBSYSTEM=="tty", ENV{ID_VENDOR_ID}=="1a8d", ENV{ID_MODEL_ID}=="100d", ENV{ID_SERIAL_SHORT}=="357473040068155", ENV{ID_USB_INTERFACE_NUM}=="00", SYMLINK+="bandrich.data", MODE="0666"
SUBSYSTEM=="tty", ENV{ID_VENDOR_ID}=="1a8d", ENV{ID_MODEL_ID}=="100d", ENV{ID_SERIAL_SHORT}=="357473040068155", ENV{ID_USB_INTERFACE_NUM}=="02", SYMLINK+="bandrich.control", MODE="0666" SUBSYSTEM=="tty", ENV{ID_VENDOR_ID}=="1a8d", ENV{ID_MODEL_ID}=="100d", ENV{ID_SERIAL_SHORT}=="357473040068155", ENV{ID_USB_INTERFACE_NUM}=="02", SYMLINK+="bandrich.control", MODE="0666"
To avoid NetworkManager to play with the bandrich, add also the line:
ENV{ID_VENDOR_ID}=="1a8d", ENV{ID_MM_DEVICE_IGNORE}="1"
Maybe also add; , ENV{ID_MM_DEVICE_IGNORE}="1"
to the two other lines.
Then run: udevadm control --reload-rules
And: service network-manager restart
Change vendor_id/model_id/serial/interface num to match yours. Change vendor_id/model_id/serial/interface num to match yours.
Use lsusb -v to find values. Use lsusb -v to find values.
......
...@@ -31,7 +31,10 @@ void reset_ue_ids(void) ...@@ -31,7 +31,10 @@ void reset_ue_ids(void)
int i; int i;
printf("resetting known UEs\n"); printf("resetting known UEs\n");
for (i = 0; i < 65536; i++) ue_id[i] = -1; for (i = 0; i < 65536; i++) ue_id[i] = -1;
next_ue_id = 0; ue_id[65535] = 0;
ue_id[65534] = 1; /* HACK: to be removed */
ue_id[2] = 2; /* this supposes RA RNTI = 2, very openair specific */
next_ue_id = 3;
} }
int ue_id_from_rnti(void *_priv, int rnti) int ue_id_from_rnti(void *_priv, int rnti)
...@@ -94,6 +97,7 @@ typedef struct { ...@@ -94,6 +97,7 @@ typedef struct {
enb_gui *e; enb_gui *e;
int ue; /* what UE is displayed in the UE specific views */ int ue; /* what UE is displayed in the UE specific views */
void *database; void *database;
int nb_rb;
} enb_data; } enb_data;
void is_on_changed(void *_d) void is_on_changed(void *_d)
...@@ -121,27 +125,6 @@ connection_dies: ...@@ -121,27 +125,6 @@ connection_dies:
if (pthread_mutex_unlock(&d->lock)) abort(); if (pthread_mutex_unlock(&d->lock)) abort();
} }
void usage(void)
{
printf(
"options:\n"
" -d <database file> this option is mandatory\n"
" -on <GROUP or ID> turn log ON for given GROUP or ID\n"
" -off <GROUP or ID> turn log OFF for given GROUP or ID\n"
" -ON turn all logs ON\n"
" -OFF turn all logs OFF\n"
" note: you may pass several -on/-off/-ON/-OFF,\n"
" they will be processed in order\n"
" by default, all is off\n"
" -ip <host> connect to given IP address (default %s)\n"
" -p <port> connect to given port (default %d)\n"
" -debug-gui activate GUI debug logs\n",
DEFAULT_REMOTE_IP,
DEFAULT_REMOTE_PORT
);
exit(1);
}
static void *gui_thread(void *_g) static void *gui_thread(void *_g)
{ {
gui *g = _g; gui *g = _g;
...@@ -248,13 +231,15 @@ static void click(void *private, gui *g, ...@@ -248,13 +231,15 @@ static void click(void *private, gui *g,
enb_data *ed = private; enb_data *ed = private;
enb_gui *e = ed->e; enb_gui *e = ed->e;
int ue = ed->ue; int ue = ed->ue;
int do_reset = 0;
if (button != 1) return; if (button != 1) return;
if (w == e->prev_ue_button) { ue--; if (ue < 0) ue = 0; } if (w == e->prev_ue_button) { ue--; if (ue < 0) ue = 0; }
if (w == e->next_ue_button) ue++; if (w == e->next_ue_button) ue++;
if (w == e->current_ue_button) reset_ue_ids(); if (w == e->current_ue_button) do_reset = 1;
if (pthread_mutex_lock(&ed->lock)) abort(); if (pthread_mutex_lock(&ed->lock)) abort();
if (do_reset) reset_ue_ids();
if (ue != ed->ue) { if (ue != ed->ue) {
set_current_ue(g, ed, ue); set_current_ue(g, ed, ue);
ed->ue = ue; ed->ue = ue;
...@@ -314,14 +299,14 @@ static void enb_main_gui(enb_gui *e, gui *g, event_handler *h, void *database, ...@@ -314,14 +299,14 @@ static void enb_main_gui(enb_gui *e, gui *g, event_handler *h, void *database,
input_signal_plot = new_xy_plot(g, 256, 55, "input signal", 20); input_signal_plot = new_xy_plot(g, 256, 55, "input signal", 20);
widget_add_child(g, line, input_signal_plot, -1); widget_add_child(g, line, input_signal_plot, -1);
xy_plot_set_range(g, input_signal_plot, 0, 7680*10, 20, 70); xy_plot_set_range(g, input_signal_plot, 0, 7680*10 * ed->nb_rb/25, 20, 70);
input_signal_log = new_framelog(h, database, input_signal_log = new_framelog(h, database,
"ENB_PHY_INPUT_SIGNAL", "subframe", "rxdata"); "ENB_PHY_INPUT_SIGNAL", "subframe", "rxdata");
/* a skip value of 10 means to process 1 frame over 10, that is /* a skip value of 10 means to process 1 frame over 10, that is
* more or less 10 frames per second * more or less 10 frames per second
*/ */
framelog_set_skip(input_signal_log, 10); framelog_set_skip(input_signal_log, 10);
input_signal_view = new_view_xy(7680*10, 10, input_signal_view = new_view_xy(7680*10 * ed->nb_rb/25, 10,
g, input_signal_plot, new_color(g, "#0c0c72"), XY_LOOP_MODE); g, input_signal_plot, new_color(g, "#0c0c72"), XY_LOOP_MODE);
logger_add_view(input_signal_log, input_signal_view); logger_add_view(input_signal_log, input_signal_view);
...@@ -639,7 +624,7 @@ static void enb_main_gui(enb_gui *e, gui *g, event_handler *h, void *database, ...@@ -639,7 +624,7 @@ static void enb_main_gui(enb_gui *e, gui *g, event_handler *h, void *database,
container_set_child_growable(g, top_container, text, 1); container_set_child_growable(g, top_container, text, 1);
e->legacy = new_view_textlist(10000, 10, g, text); e->legacy = new_view_textlist(10000, 10, g, text);
set_current_ue(g, ed, 0); set_current_ue(g, ed, ed->ue);
register_notifier(g, "click", e->current_ue_button, click, ed); register_notifier(g, "click", e->current_ue_button, click, ed);
register_notifier(g, "click", e->prev_ue_button, click, ed); register_notifier(g, "click", e->prev_ue_button, click, ed);
register_notifier(g, "click", e->next_ue_button, click, ed); register_notifier(g, "click", e->next_ue_button, click, ed);
...@@ -661,6 +646,28 @@ void view_add_log(view *v, char *log, event_handler *h, void *database, ...@@ -661,6 +646,28 @@ void view_add_log(view *v, char *log, event_handler *h, void *database,
on_off(database, log, is_on, 1); on_off(database, log, is_on, 1);
} }
void usage(void)
{
printf(
"options:\n"
" -d <database file> this option is mandatory\n"
" -rb <RBs> setup for this number of RBs (default 25)\n"
" -on <GROUP or ID> turn log ON for given GROUP or ID\n"
" -off <GROUP or ID> turn log OFF for given GROUP or ID\n"
" -ON turn all logs ON\n"
" -OFF turn all logs OFF\n"
" note: you may pass several -on/-off/-ON/-OFF,\n"
" they will be processed in order\n"
" by default, all is off\n"
" -ip <host> connect to given IP address (default %s)\n"
" -p <port> connect to given port (default %d)\n"
" -debug-gui activate GUI debug logs\n",
DEFAULT_REMOTE_IP,
DEFAULT_REMOTE_PORT
);
exit(1);
}
int main(int n, char **v) int main(int n, char **v)
{ {
extern int volatile gui_logd; extern int volatile gui_logd;
...@@ -681,6 +688,8 @@ int main(int n, char **v) ...@@ -681,6 +688,8 @@ int main(int n, char **v)
reset_ue_ids(); reset_ue_ids();
enb_data.nb_rb = 25;
/* write on a socket fails if the other end is closed and we get SIGPIPE */ /* write on a socket fails if the other end is closed and we get SIGPIPE */
if (signal(SIGPIPE, SIG_IGN) == SIG_ERR) abort(); if (signal(SIGPIPE, SIG_IGN) == SIG_ERR) abort();
...@@ -691,6 +700,8 @@ int main(int n, char **v) ...@@ -691,6 +700,8 @@ int main(int n, char **v)
if (!strcmp(v[i], "-h") || !strcmp(v[i], "--help")) usage(); if (!strcmp(v[i], "-h") || !strcmp(v[i], "--help")) usage();
if (!strcmp(v[i], "-d")) if (!strcmp(v[i], "-d"))
{ if (i > n-2) usage(); database_filename = v[++i]; continue; } { if (i > n-2) usage(); database_filename = v[++i]; continue; }
if (!strcmp(v[i], "-rb"))
{ if (i > n-2) usage(); enb_data.nb_rb = atoi(v[++i]); continue; }
if (!strcmp(v[i], "-ip")) { if (i > n-2) usage(); ip = v[++i]; continue; } if (!strcmp(v[i], "-ip")) { if (i > n-2) usage(); ip = v[++i]; continue; }
if (!strcmp(v[i], "-p")) if (!strcmp(v[i], "-p"))
{ if (i > n-2) usage(); port = atoi(v[++i]); continue; } { if (i > n-2) usage(); port = atoi(v[++i]); continue; }
...@@ -706,6 +717,11 @@ int main(int n, char **v) ...@@ -706,6 +717,11 @@ int main(int n, char **v)
usage(); usage();
} }
switch (enb_data.nb_rb) {
case 25: case 50: case 100: break;
default: printf("ERROR, bad value for -rb (%d)\n", enb_data.nb_rb); exit(1);
}
if (database_filename == NULL) { if (database_filename == NULL) {
printf("ERROR: provide a database file (-d)\n"); printf("ERROR: provide a database file (-d)\n");
exit(1); exit(1);
...@@ -724,7 +740,7 @@ int main(int n, char **v) ...@@ -724,7 +740,7 @@ int main(int n, char **v)
g = gui_init(); g = gui_init();
new_thread(gui_thread, g); new_thread(gui_thread, g);
enb_data.ue = 0; enb_data.ue = 3;
enb_data.e = &eg; enb_data.e = &eg;
enb_data.database = database; enb_data.database = database;
......
...@@ -1868,6 +1868,8 @@ int phy_init_lte_eNB(PHY_VARS_eNB *eNB, ...@@ -1868,6 +1868,8 @@ int phy_init_lte_eNB(PHY_VARS_eNB *eNB,
generate_ul_ref_sigs_rx(); generate_ul_ref_sigs_rx();
init_ulsch_power_LUT();
// SRS // SRS
for (UE_id=0; UE_id<NUMBER_OF_UE_MAX; UE_id++) { for (UE_id=0; UE_id<NUMBER_OF_UE_MAX; UE_id++) {
srs_vars[UE_id].srs = (int32_t*)malloc16_clear(2*fp->ofdm_symbol_size*sizeof(int32_t)); srs_vars[UE_id].srs = (int32_t*)malloc16_clear(2*fp->ofdm_symbol_size*sizeof(int32_t));
......
...@@ -267,33 +267,28 @@ int32_t temp_in_ifft_0[2048*2] __attribute__((aligned(32))); ...@@ -267,33 +267,28 @@ int32_t temp_in_ifft_0[2048*2] __attribute__((aligned(32)));
#endif #endif
} }
// Convert to time domain for visualization // Convert to time domain for visualization
memset(temp_in_ifft_0,0,frame_parms->ofdm_symbol_size*sizeof(int32_t));
for(i=0; i<Msc_RS; i++) for(i=0; i<Msc_RS; i++)
((int32_t*)temp_in_ifft_0)[i] = ul_ch_estimates[aa][symbol_offset+i]; ((int32_t*)temp_in_ifft_0)[i] = ul_ch_estimates[aa][symbol_offset+i];
switch(frame_parms->N_RB_DL) { switch(frame_parms->N_RB_DL) {
case 6: case 6:
idft128((int16_t*) temp_in_ifft_0, idft128((int16_t*) temp_in_ifft_0,
(int16_t*) ul_ch_estimates_time[aa], (int16_t*) ul_ch_estimates_time[aa],
1); 1);
break; break;
case 25: case 25:
idft512((int16_t*) temp_in_ifft_0, idft512((int16_t*) temp_in_ifft_0,
(int16_t*) ul_ch_estimates_time[aa], (int16_t*) ul_ch_estimates_time[aa],
1); 1);
break; break;
case 50: case 50:
idft1024((int16_t*) temp_in_ifft_0, idft1024((int16_t*) temp_in_ifft_0,
(int16_t*) ul_ch_estimates_time[aa], (int16_t*) ul_ch_estimates_time[aa],
1); 1);
break; break;
case 100: case 100:
idft2048((int16_t*) temp_in_ifft_0, idft2048((int16_t*) temp_in_ifft_0,
(int16_t*) ul_ch_estimates_time[aa], (int16_t*) ul_ch_estimates_time[aa],
1); 1);
......
...@@ -2257,11 +2257,18 @@ uint8_t generate_dci_top(uint8_t num_pdcch_symbols, ...@@ -2257,11 +2257,18 @@ uint8_t generate_dci_top(uint8_t num_pdcch_symbols,
y[0] = &yseq0[0]; y[0] = &yseq0[0];
y[1] = &yseq1[0]; y[1] = &yseq1[0];
#if 0
// reset all bits to <NIL>, here we set <NIL> elements as 2 // reset all bits to <NIL>, here we set <NIL> elements as 2
// memset(e, 2, DCI_BITS_MAX); // memset(e, 2, DCI_BITS_MAX);
// here we interpret NIL as a random QPSK sequence. That makes power estimation easier. // here we interpret NIL as a random QPSK sequence. That makes power estimation easier.
for (i=0; i<DCI_BITS_MAX; i++) for (i=0; i<DCI_BITS_MAX; i++)
e[i]=taus()&1; e[i]=taus()&1;
#endif
/* clear all bits, the above code may generate too much false detections
* (not sure about this, to be checked somehow)
*/
memset(e, 0, DCI_BITS_MAX);
e_ptr = e; e_ptr = e;
......
...@@ -6394,12 +6394,11 @@ uint8_t ul_subframe2pdcch_alloc_subframe(LTE_DL_FRAME_PARMS *frame_parms,uint8_t ...@@ -6394,12 +6394,11 @@ uint8_t ul_subframe2pdcch_alloc_subframe(LTE_DL_FRAME_PARMS *frame_parms,uint8_t
return(9); return(9);
else else
return((n+6)%10); return((n+6)%10);
} }
uint32_t pdcch_alloc2ul_frame(LTE_DL_FRAME_PARMS *frame_parms,uint32_t frame, uint8_t n) uint32_t pdcch_alloc2ul_frame(LTE_DL_FRAME_PARMS *frame_parms,uint32_t frame, uint8_t n)
{ {
uint32_t ul_frame = 255; uint32_t ul_frame;
if ((frame_parms->frame_type == TDD) && if ((frame_parms->frame_type == TDD) &&
(frame_parms->tdd_config == 1) && (frame_parms->tdd_config == 1) &&
...@@ -6417,8 +6416,7 @@ uint32_t pdcch_alloc2ul_frame(LTE_DL_FRAME_PARMS *frame_parms,uint32_t frame, ui ...@@ -6417,8 +6416,7 @@ uint32_t pdcch_alloc2ul_frame(LTE_DL_FRAME_PARMS *frame_parms,uint32_t frame, ui
ul_frame = (frame+(n>=6 ? 1 : 0)); ul_frame = (frame+(n>=6 ? 1 : 0));
LOG_D(PHY, "frame %d subframe %d: PUSCH frame = %d\n", frame, n, ul_frame); LOG_D(PHY, "frame %d subframe %d: PUSCH frame = %d\n", frame, n, ul_frame);
return ul_frame; return ul_frame % 1024;
} }
int32_t pmi_convert_rank1_from_rank2(uint16_t pmi_alloc, int tpmi, int nb_rb) int32_t pmi_convert_rank1_from_rank2(uint16_t pmi_alloc, int tpmi, int nb_rb)
......
...@@ -151,18 +151,19 @@ unsigned char subframe2_ul_harq(LTE_DL_FRAME_PARMS *frame_parms,unsigned char su ...@@ -151,18 +151,19 @@ unsigned char subframe2_ul_harq(LTE_DL_FRAME_PARMS *frame_parms,unsigned char su
return(0); return(0);
} }
uint8_t phich_frame2_pusch_frame(LTE_DL_FRAME_PARMS *frame_parms,frame_t frame,uint8_t subframe) int phich_frame2_pusch_frame(LTE_DL_FRAME_PARMS *frame_parms, int frame, int subframe)
{ {
uint8_t pusch_frame = 255; int pusch_frame;
if (frame_parms->frame_type == FDD) { if (frame_parms->frame_type == FDD) {
pusch_frame = ((subframe<4) ? (frame - 1) : frame); pusch_frame = subframe<4 ? frame + 1024 - 1 : frame;
} else { } else {
// Note this is not true, but it doesn't matter, the frame number is irrelevant for TDD! // Note this is not true, but it doesn't matter, the frame number is irrelevant for TDD!
pusch_frame = (frame); pusch_frame = (frame);
} }
LOG_D(PHY, "frame %d subframe %d: PUSCH frame = %d\n", frame, subframe, pusch_frame); LOG_D(PHY, "frame %d subframe %d: PUSCH frame = %d\n", frame, subframe, pusch_frame);
return pusch_frame; return pusch_frame % 1024;
} }
uint8_t phich_subframe2_pusch_subframe(LTE_DL_FRAME_PARMS *frame_parms,uint8_t subframe) uint8_t phich_subframe2_pusch_subframe(LTE_DL_FRAME_PARMS *frame_parms,uint8_t subframe)
......
...@@ -1950,7 +1950,7 @@ uint8_t phich_subframe2_pusch_subframe(LTE_DL_FRAME_PARMS *frame_parms,uint8_t s ...@@ -1950,7 +1950,7 @@ uint8_t phich_subframe2_pusch_subframe(LTE_DL_FRAME_PARMS *frame_parms,uint8_t s
@param subframe Subframe of received/transmitted PHICH @param subframe Subframe of received/transmitted PHICH
@returns frame of PUSCH transmission @returns frame of PUSCH transmission
*/ */
uint8_t phich_frame2_pusch_frame(LTE_DL_FRAME_PARMS *frame_parms,frame_t frame,uint8_t subframe); int phich_frame2_pusch_frame(LTE_DL_FRAME_PARMS *frame_parms, int frame, int subframe);
void print_CQI(void *o,UCI_format_t uci_format,uint8_t eNB_id,int N_RB_DL); void print_CQI(void *o,UCI_format_t uci_format,uint8_t eNB_id,int N_RB_DL);
...@@ -2109,6 +2109,8 @@ int32_t rx_pucch_emul(PHY_VARS_eNB *phy_vars_eNB, ...@@ -2109,6 +2109,8 @@ int32_t rx_pucch_emul(PHY_VARS_eNB *phy_vars_eNB,
uint8_t *payload); uint8_t *payload);
void init_ulsch_power_LUT(void);
/*! /*!
\brief Check for PRACH TXop in subframe \brief Check for PRACH TXop in subframe
@param frame_parms Pointer to LTE_DL_FRAME_PARMS @param frame_parms Pointer to LTE_DL_FRAME_PARMS
......
...@@ -2420,7 +2420,7 @@ uint32_t rx_pucch(PHY_VARS_eNB *eNB, ...@@ -2420,7 +2420,7 @@ uint32_t rx_pucch(PHY_VARS_eNB *eNB,
if (fmt==pucch_format1b) if (fmt==pucch_format1b)
*(1+payload) = (stat_im<0) ? 1 : 2; *(1+payload) = (stat_im<0) ? 1 : 2;
} else { // insufficient energy on PUCCH so NAK } else { // insufficient energy on PUCCH so NAK
LOG_D(PHY,"PUCCH 1a/b: subframe %d : sigma2_dB %d, stat_max %d, pucch1_thres %d\n",subframe,sigma2_dB,dB_fixed(stat_max),pucch1_thres); LOG_I(PHY,"PUCCH 1a/b: subframe %d : sigma2_dB %d, stat_max %d, pucch1_thres %d\n",subframe,sigma2_dB,dB_fixed(stat_max),pucch1_thres);
*payload = 4; // DTX *payload = 4; // DTX
((int16_t*)&eNB->pucch1ab_stats[UE_id][(subframe<<10) + (eNB->pucch1ab_stats_cnt[UE_id][subframe])])[0] = (int16_t)(stat_re); ((int16_t*)&eNB->pucch1ab_stats[UE_id][(subframe<<10) + (eNB->pucch1ab_stats_cnt[UE_id][subframe])])[0] = (int16_t)(stat_re);
((int16_t*)&eNB->pucch1ab_stats[UE_id][(subframe<<10) + (eNB->pucch1ab_stats_cnt[UE_id][subframe])])[1] = (int16_t)(stat_im); ((int16_t*)&eNB->pucch1ab_stats[UE_id][(subframe<<10) + (eNB->pucch1ab_stats_cnt[UE_id][subframe])])[1] = (int16_t)(stat_im);
......
...@@ -1102,7 +1102,15 @@ void ulsch_channel_level(int32_t **drs_ch_estimates_ext, ...@@ -1102,7 +1102,15 @@ void ulsch_channel_level(int32_t **drs_ch_estimates_ext,
#endif #endif
} }
int ulsch_power_LUT[750];
void init_ulsch_power_LUT() {
int i;
for (i=0;i<750;i++) ulsch_power_LUT[i] = (int)ceil((pow(2.0,(double)i/100) - 1.0));
}
void rx_ulsch(PHY_VARS_eNB *eNB, void rx_ulsch(PHY_VARS_eNB *eNB,
eNB_rxtx_proc_t *proc, eNB_rxtx_proc_t *proc,
...@@ -1164,16 +1172,28 @@ void rx_ulsch(PHY_VARS_eNB *eNB, ...@@ -1164,16 +1172,28 @@ void rx_ulsch(PHY_VARS_eNB *eNB,
l/(frame_parms->symbols_per_tti/2)); l/(frame_parms->symbols_per_tti/2));
} }
int correction_factor = 1;
int deltaMCS=1;
int MPR_times_100Ks;
if (deltaMCS==1) {
// Note we're using TBS instead of sumKr, since didn't run segmentation yet!
MPR_times_100Ks = 500*ulsch[UE_id]->harq_processes[harq_pid]->TBS/(ulsch[UE_id]->harq_processes[harq_pid]->nb_rb*12*4*ulsch[UE_id]->harq_processes[harq_pid]->Nsymb_pusch);
AssertFatal(MPR_times_100Ks < 750 && MPR_times_100Ks >= 0,"Impossible value for MPR_times_100Ks %d (TBS %d,Nre %d)\n",
MPR_times_100Ks,ulsch[UE_id]->harq_processes[harq_pid]->TBS,
(ulsch[UE_id]->harq_processes[harq_pid]->nb_rb*12*4*ulsch[UE_id]->harq_processes[harq_pid]->Nsymb_pusch));
if (MPR_times_100Ks > 0) correction_factor = ulsch_power_LUT[MPR_times_100Ks];
}
for (i=0; i<frame_parms->nb_antennas_rx; i++) { for (i=0; i<frame_parms->nb_antennas_rx; i++) {
pusch_vars->ulsch_power[i] = signal_energy_nodc(pusch_vars->drs_ch_estimates[i], pusch_vars->ulsch_power[i] = signal_energy_nodc(pusch_vars->drs_ch_estimates[i],
ulsch[UE_id]->harq_processes[harq_pid]->nb_rb*12); ulsch[UE_id]->harq_processes[harq_pid]->nb_rb*12)/correction_factor;
/* printf("%4.4d.%d power harq_pid %d rb %2.2d TBS %2.2d (MPR_times_Ks %d correction %d) power %d dBtimes10\n", proc->frame_rx, proc->subframe_rx, harq_pid, ulsch[UE_id]->harq_processes[harq_pid]->nb_rb, ulsch[UE_id]->harq_processes[harq_pid]->TBS,MPR_times_100Ks,correction_factor,dB_fixed_times10(pusch_vars->ulsch_power[i]));
#ifdef LOCALIZATION */
pusch_vars->subcarrier_power = (int32_t *)malloc(ulsch[UE_id]->harq_processes[harq_pid]->nb_rb*12*sizeof(int32_t));
pusch_vars->active_subcarrier = subcarrier_energy(pusch_vars->drs_ch_estimates[i],
ulsch[UE_id]->harq_processes[harq_pid]->nb_rb*12, pusch_vars->subcarrier_power, rx_power_correction);
#endif
} }
......
...@@ -33,47 +33,29 @@ This section deals with basic functions for OFDM Modulation. ...@@ -33,47 +33,29 @@ This section deals with basic functions for OFDM Modulation.
#include "UTIL/LOG/log.h" #include "UTIL/LOG/log.h"
#include "UTIL/LOG/vcd_signal_dumper.h" #include "UTIL/LOG/vcd_signal_dumper.h"
//static short temp2[2048*4] __attribute__((aligned(16)));
//#define DEBUG_OFDM_MOD //#define DEBUG_OFDM_MOD
void normal_prefix_mod(int32_t *txdataF,int32_t *txdata,uint8_t nsymb,LTE_DL_FRAME_PARMS *frame_parms) void normal_prefix_mod(int32_t *txdataF,int32_t *txdata,uint8_t nsymb,LTE_DL_FRAME_PARMS *frame_parms)
{ {
uint8_t i;
int short_offset=0;
if ((2*nsymb) < frame_parms->symbols_per_tti)
short_offset = 1;
// printf("nsymb %d\n",nsymb);
for (i=0; i<((short_offset)+2*nsymb/frame_parms->symbols_per_tti); i++) {
#ifdef DEBUG_OFDM_MOD
printf("slot i %d (txdata offset %d, txoutput %p)\n",i,(i*(frame_parms->samples_per_tti>>1)),
txdata+(i*(frame_parms->samples_per_tti>>1)));
#endif
PHY_ofdm_mod(txdataF+(i*frame_parms->ofdm_symbol_size*frame_parms->symbols_per_tti>>1), // input
txdata+(i*frame_parms->samples_per_tti>>1), // output
frame_parms->ofdm_symbol_size,
1, // number of symbols
frame_parms->nb_prefix_samples0, // number of prefix samples
CYCLIC_PREFIX);
#ifdef DEBUG_OFDM_MOD
printf("slot i %d (txdata offset %d)\n",i,OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES0+(i*frame_parms->samples_per_tti>>1));
#endif
PHY_ofdm_mod(txdataF+frame_parms->ofdm_symbol_size+(i*frame_parms->ofdm_symbol_size*(frame_parms->symbols_per_tti>>1)), // input
txdata+OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES0+(i*(frame_parms->samples_per_tti>>1)), // output
frame_parms->ofdm_symbol_size,
(short_offset==1) ? 1 :(frame_parms->symbols_per_tti>>1)-1,//6, // number of symbols
frame_parms->nb_prefix_samples, // number of prefix samples
CYCLIC_PREFIX);
PHY_ofdm_mod(txdataF, // input
txdata, // output
frame_parms->ofdm_symbol_size,
1, // number of symbols
frame_parms->nb_prefix_samples0, // number of prefix samples
CYCLIC_PREFIX);
PHY_ofdm_mod(txdataF+frame_parms->ofdm_symbol_size, // input
txdata+OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES0, // output
frame_parms->ofdm_symbol_size,
nsymb-1,
frame_parms->nb_prefix_samples, // number of prefix samples
CYCLIC_PREFIX);
}
} }
void PHY_ofdm_mod(int *input, /// pointer to complex input void PHY_ofdm_mod(int *input, /// pointer to complex input
...@@ -85,7 +67,7 @@ void PHY_ofdm_mod(int *input, /// pointer to complex input ...@@ -85,7 +67,7 @@ void PHY_ofdm_mod(int *input, /// pointer to complex input
) )
{ {
static short temp[2048*4] __attribute__((aligned(32))); short temp[2048*4] __attribute__((aligned(32)));
unsigned short i,j; unsigned short i,j;
short k; short k;
...@@ -165,9 +147,10 @@ void PHY_ofdm_mod(int *input, /// pointer to complex input ...@@ -165,9 +147,10 @@ void PHY_ofdm_mod(int *input, /// pointer to complex input
if (fftsize==128) if (fftsize==128)
#endif #endif
{ {
for (j=0; j<fftsize ; j++) { /*for (j=0; j<fftsize ; j++) {
output_ptr[j] = temp_ptr[j]; output_ptr[j] = temp_ptr[j];
} }*/
memcpy((void*)output_ptr,(void*)temp_ptr,fftsize<<2);
} }
j=fftsize; j=fftsize;
......
...@@ -83,9 +83,8 @@ void print_meas(time_stats_t *ts, const char* name, time_stats_t * total_exec_ti ...@@ -83,9 +83,8 @@ void print_meas(time_stats_t *ts, const char* name, time_stats_t * total_exec_ti
//printf("%20s: total: %10.3f ms, average: %10.3f us (%10d trials)\n", name, ts->diff/cpu_freq_GHz/1000000.0, ts->diff/ts->trials/cpu_freq_GHz/1000.0, ts->trials); //printf("%20s: total: %10.3f ms, average: %10.3f us (%10d trials)\n", name, ts->diff/cpu_freq_GHz/1000000.0, ts->diff/ts->trials/cpu_freq_GHz/1000.0, ts->trials);
if ((total_exec_time == NULL) || (sf_exec_time== NULL)) { if ((total_exec_time == NULL) || (sf_exec_time== NULL)) {
fprintf(stderr, "%25s: %15.3f ms ; %15.3f us; %15d;\n", fprintf(stderr, "%25s: %15.3f us; %15d;\n",
name, name,
(ts->diff/cpu_freq_GHz/1000000.0),
(ts->diff/ts->trials/cpu_freq_GHz/1000.0), (ts->diff/ts->trials/cpu_freq_GHz/1000.0),
ts->trials); ts->trials);
} else { } else {
......
...@@ -331,6 +331,8 @@ typedef struct RU_proc_t_s { ...@@ -331,6 +331,8 @@ typedef struct RU_proc_t_s {
int instance_cnt_asynch_rxtx; int instance_cnt_asynch_rxtx;
/// \internal This variable is protected by \ref mutex_fep /// \internal This variable is protected by \ref mutex_fep
int instance_cnt_fep; int instance_cnt_fep;
/// \internal This variable is protected by \ref mutex_fep
int instance_cnt_feptx;
/// pthread structure for RU FH processing thread /// pthread structure for RU FH processing thread
pthread_t pthread_FH; pthread_t pthread_FH;
/// pthread structure for RU prach processing thread /// pthread structure for RU prach processing thread
...@@ -341,8 +343,10 @@ typedef struct RU_proc_t_s { ...@@ -341,8 +343,10 @@ typedef struct RU_proc_t_s {
#endif #endif
/// pthread struct for RU synch thread /// pthread struct for RU synch thread
pthread_t pthread_synch; pthread_t pthread_synch;
/// pthread struct for RU RX FEP thread /// pthread struct for RU RX FEP worker thread
pthread_t pthread_fep; pthread_t pthread_fep;
/// pthread struct for RU RX FEPTX worker thread
pthread_t pthread_feptx;
/// pthread structure for asychronous RX/TX processing thread /// pthread structure for asychronous RX/TX processing thread
pthread_t pthread_asynch_rxtx; pthread_t pthread_asynch_rxtx;
/// flag to indicate first RX acquisition /// flag to indicate first RX acquisition
...@@ -361,8 +365,10 @@ typedef struct RU_proc_t_s { ...@@ -361,8 +365,10 @@ typedef struct RU_proc_t_s {
pthread_attr_t attr_synch; pthread_attr_t attr_synch;
/// pthread attributes for asynchronous RX thread /// pthread attributes for asynchronous RX thread