Commit bf86de00 authored by Raphael Defosseux's avatar Raphael Defosseux

Merge remote-tracking branch 'origin/basic-simulator-tdd' into develop_integration_2018_w39

parents 38d09bc7 824f62d8
......@@ -169,6 +169,13 @@ void lte_param_init(PHY_VARS_eNB **eNBp,
}
else ru->N_TA_offset=0;
#if BASIC_SIMULATOR
/* this is required for the basic simulator in TDD mode
* TODO: find a proper cleaner solution
*/
UE->N_TA_offset = 0;
#endif
printf("Done lte_param_init\n");
......
......@@ -44,6 +44,7 @@ typedef struct {
int sock;
int samples_per_subframe;
uint64_t timestamp;
uint64_t next_tx_timestamp;
int is_enb;
} tcp_bridge_state_t;
......@@ -141,11 +142,27 @@ int tcp_bridge_write(openair0_device *device, openair0_timestamp timestamp, void
{
if (cc != 1) { printf("tcp_bridge: only 1 antenna supported\n"); exit(1); }
tcp_bridge_state_t *t = device->priv;
/* deal with discontinuities in output (think: eNB in TDD mode) */
if (t->next_tx_timestamp && timestamp != t->next_tx_timestamp) {
uint32_t b[4096];
uint64_t to_send = timestamp - t->next_tx_timestamp;
memset(b, 0, 4096 * sizeof(uint32_t));
while (to_send) {
int len = to_send > 4096 ? 4096 : to_send;
int n = fullwrite(t->sock, b, len * 4);
if (n != len * 4) {
printf("tcp_bridge: write error ret %d error %s\n", n, strerror(errno));
abort();
}
to_send -= len;
}
}
int n = fullwrite(t->sock, buff[0], nsamps * 4);
if (n != nsamps * 4) {
printf("tcp_bridge: write error ret %d (wanted %d) error %s\n", n, nsamps*4, strerror(errno));
abort();
}
t->next_tx_timestamp = timestamp + nsamps;
return nsamps;
}
......
......@@ -1456,6 +1456,12 @@ int setup_RU_buffers(RU_t *ru) {
if (frame_parms->N_RB_DL == 100) ru->N_TA_offset = 624;
else if (frame_parms->N_RB_DL == 50) ru->N_TA_offset = 624/2;
else if (frame_parms->N_RB_DL == 25) ru->N_TA_offset = 624/4;
#if BASIC_SIMULATOR
/* this is required for the basic simulator in TDD mode
* TODO: find a proper cleaner solution
*/
ru->N_TA_offset = 0;
#endif
}
if (ru->openair0_cfg.mmapped_dma == 1) {
// replace RX signal buffers with mmaped HW versions
......
......@@ -333,6 +333,13 @@ void init_UE(int nb_inst,int eMBMS_active, int uecap_xer_in, int timing_correcti
}
else UE->N_TA_offset = 0;
#if BASIC_SIMULATOR
/* this is required for the basic simulator in TDD mode
* TODO: find a proper cleaner solution
*/
UE->N_TA_offset = 0;
#endif
if (simL1flag == 1) init_ue_devices(UE);
LOG_I(PHY,"Intializing UE Threads for instance %d (%p,%p)...\n",inst,PHY_vars_UE_g[inst],PHY_vars_UE_g[inst][0]);
init_UE_threads(inst);
......
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