• Raymond Knopp's avatar
    Introduce separate thread to handle gNB TX processing · d52b8179
    Raymond Knopp authored
    This commit introduces a separate thread (l1_tx_thread) that processes
    gNB DL/TX slots. It receives a message from the ru_thread when a new
    slot started, and starts processing.
    
    The DL part of the scheduler is run in the l1_tx_thread.  Therefore,
    only call UL indication (for scheduler) in UL slots.  The UL indication
    previously triggered the DL scheduler -- hence, it had to be called in
    every slot. Now, since the DL scheduler is moved into the DL thread, we
    don't have to call the scheduler in every slot anymore.
    
    The reorder thread is removed, as reordering with this scheme is not
    necessary anymore.
    
    The main advantage of this version is that the TX can be scheduled
    earlier (sl_ahead). Further, there can no longer be race conditions in
    the TX path, since the scheduler/L2, TX L1 processing and the RU tx
    function are all execute in the same thread (L1_tX_thread).
    
    Also, the scheduler prepares PRACH/PUSCH/PUCCH FAPI PDUs. As of this
    commit, the scheduler runs in the TX processing chain, whereas these
    PDUs are destined for RX processing.  Thus, too avoid data races,
    instead of triggering the RX processing at the same time as TX
    processing in the RU thread, this commit changes the code to trigger RX
    processing after the scheduler has been run in TX processing to avoid
    data races.
    
    Finally, we synchronize RU and L1 threads. This is important for
    rfsimulator, since unlike most radios, rfsimulator can run slower or
    faster, depending on I/O and CPU (it does not have a stable "tick").
    Co-authored-by: default avatarkiran <saikiran@iitj.ac.in>
    d52b8179
ulsim.c 62.4 KB