• Robert Schmidt's avatar
    Avoid use of FAPI message buffers in msgDataTx · 2bea71a8
    Robert Schmidt authored
    Note: after this commit, monolithic works but nFAPI operation is broken
    and fixed in the next commit, to keep the changes small(er). All
    simulators work.
    
    This commit removes the use of msgDataTx's intermediate buffers for FAPI
    messages and the call of the "Schedule response". The latter incurs an
    additional copy of FAPI messages for the TX chain (for the RX chain, it
    is and will remain there) which we can avoid.
    
    Instead, it uses an NR_Sched_Rsp_t-typed variable sched_response to
    store the results of the scheduler when called from tx_func(). Thus, the
    scheduler remains unchanged (it gets a pointer to where to put FAPI
    messages), but we don't call nr_schedule_response() to then copy FAPI
    messages into the L1, but have them in a local variable sched_response.
    sched_response on on the data segment, as it is big and would overflow
    the stack; at the same time, this is ok because only one tx_func() runs
    at a time.
    
    Since we don't use allocate_sched_response() anymore, we don't need
    deref_sched_response().
    
    clear_slot_beamid() is moved to tx_func(), as it was called in
    nr_schedule_response().
    
    Since the "intermediate" NR_gNB_DLSCH_t structure groups both the
    DL_tti_pdsch and TX_data.req structures, a pointer has been created to
    point to pdsch_pdu. This affects a number of simulators, as they have to
    put some messages on the stack:
    
    - nr_dlschsim: put the corresponding variable on the stack
    - nr_pbchsim: a new array for the SSB PDUs has been introduced
    
    Further, these changes are now necessary:
    
    - nr_dlsim:  there were variables "rel15" and "pdsch_pdu_rel15" that
      point to the same PDSCH PDU. At least "rel15" would not exist, as the
      corresponding pointer is now populated in phy_procedures_gNB_TX(), and
      we therefore refer to the single PDSCH PDU variable with
      "pdsch_pdu_rel15", but at the place where "rel15" used to be
      initialized.
    - nr_ulsim: use nr_save_ul_tti_req() to load PDUs into the RX chain
      instead of nr_schedule_response(), which does not exist anymore.
    2bea71a8
dlschsim.c 20.3 KB