rewrite synchronisation in oaisim/channel simulation
The idea is as follows. oaisim waits for all tasks to be done for a TTI. To do so it waits for last_rx_timestamp == current_rx_timestamp, for all UEs and eNBs. When it's done, it increases current_rx_timestamp by samples_per_tti, to inform UEs and eNBs that a new TTI is ready. In the functions [UE|eNB]_trx_read, we wait for a new TTI to be ready, that is we wait for current_rx_timestamp != last_rx_timestamp. The UE has also to wait for processing threads to be done. In the eNB it's not necessary because the processing is all done in one thread, that is: read subframe, process this subframe, emit subframe+4, and then back to read subframe. The code is not clean. We should not use usleep but semaphores. Also, do_[DL|UL]_sig should not read from rxdata and write to txdata, but use internal buffers. The functions [UE|eNB]_trx_read should call do_[DL|UL]_sig and then copy from the internal buffers of the channel simulator into rxdata. The functions [UE|eNB]_trx_write should write data passed into the internal buffers of the channel simulator.
Showing
Please register or sign in to comment