Prior to this commit, the following command failed to build dlsim:
./build_oai --phy_simulators -c
Choice has been made to define it in a .h file as a static inline
function.
The compilation line was:
./build_oai --eNB -w USRP
The file openairinterface5g/cmake_targets/log/lte-softmodem.Rel10.txt
has been checked and all LOG_X (and 'msg') warnings have been fixed.
- some cleanup
- thread names to include UE Mod_id
- arg of UE_thread_rxn_txnp4 to be struct rx_tx_thread_data again
- sync in UE_thread_rxn_txnp4 to use instance_cnt_rxtx again
- UE_thread to call itti_send_msg_to_task with UE->Mod_id + NB_eNB_INST
instead of INSTANCE_DEFAULT again
This may break the softmodem UE, to be tested.
The most problematic thing may be the synchronization.
I don't think it will impact the processing at all,
but I won't bet my shirt on it.
For whatever reason, lte-softmodem.c was totally messed up...
We took the version from the branch develop and added
abstraction_flag, which is needed in openair2/LAYER2/MAC/main.c
(this is not clean, previous commit added a comment for this).
This has to be cleaned at some point.
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.
Not sure if this is the right thing to do, but it seems to be.
"start_eNB = 1;" is also necessary when the l2l1 task gets INITIALIZE_MESSAGE
otherwise the eNB does not start.
As it is today, I don't think oaisim will work with more than one eNB.
It was probably the result of a bad merge.
At this point eNB_inst is not valid. Plus the T_ENB_MASTER_TICK
is now handled in lte-enb.c, even for oaisim.
We should use ENABLE_USE_MME, not USE_MME.
This code is useless anyway (I think, not sure, that's why I
leave it here), because the other threads wait for 'sync_var'
to become >=0.