|
|
@ -12,10 +12,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
#include "srsenb/hdr/stack/mac/nr/sched_nr_signalling.h"
|
|
|
|
#include "srsenb/hdr/stack/mac/nr/sched_nr_signalling.h"
|
|
|
|
|
|
|
|
|
|
|
|
#define POS_IN_BURST_FIRST_BIT_IDX 0
|
|
|
|
#define POS_IN_BURST_FIRST_BIT_IDX 0
|
|
|
|
#define POS_IN_BURST_SECOND_BIT_IDX 1
|
|
|
|
#define POS_IN_BURST_SECOND_BIT_IDX 1
|
|
|
|
#define POS_IN_BURST_THIRD_BIT_IDX 2
|
|
|
|
#define POS_IN_BURST_THIRD_BIT_IDX 2
|
|
|
|
#define POS_IN_BURST_FOURTH_BIT_IDX 3
|
|
|
|
#define POS_IN_BURST_FOURTH_BIT_IDX 3
|
|
|
|
|
|
|
|
|
|
|
|
#define DEFAULT_SSB_PERIODICITY 5
|
|
|
|
#define DEFAULT_SSB_PERIODICITY 5
|
|
|
|
|
|
|
|
|
|
|
@ -40,85 +40,31 @@ void sched_nzp_csi_rs(srsran::const_span<srsran_csi_rs_nzp_set_t> nzp_csi_rs_set
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void sched_ssb_basic(const slot_point& sl_point, uint32_t ssb_periodicity, ssb_list& ssb_list)
|
|
|
|
void sched_ssb_basic(const slot_point& sl_point, uint32_t ssb_periodicity, ssb_list& ssb_list)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
/* This function is extremely simplified.
|
|
|
|
// If the periodicity is 0, it means that the parameter was not passed by the upper layers.
|
|
|
|
* It works based on the following assumptions (hard-coded parameters)
|
|
|
|
// In that case, we use default value of 5ms (see Clause 4.1, TS 38.213)
|
|
|
|
* 1) 15kHz subcarrier spacing
|
|
|
|
|
|
|
|
* 2) Below 3GHz
|
|
|
|
|
|
|
|
* 3) Position in Burst 1000
|
|
|
|
|
|
|
|
* */
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (ssb_periodicity == 0)
|
|
|
|
if (ssb_periodicity == 0)
|
|
|
|
ssb_periodicity = DEFAULT_SSB_PERIODICITY;
|
|
|
|
ssb_periodicity = DEFAULT_SSB_PERIODICITY;
|
|
|
|
|
|
|
|
|
|
|
|
uint32_t sl_idx = sl_point.to_uint();
|
|
|
|
uint32_t sl_idx = sl_point.to_uint();
|
|
|
|
uint32_t ssb_sf_idx = sl_point.to_uint() % ssb_periodicity;
|
|
|
|
// mod operation of slot index by ssb_periodicity. With current subcarrier spacing, 1 slot = 1ms
|
|
|
|
|
|
|
|
uint32_t sl_point_mod = sl_point.to_uint() % ssb_periodicity;
|
|
|
|
|
|
|
|
|
|
|
|
// code below is simplified
|
|
|
|
// code below is simplified
|
|
|
|
if (ssb_sf_idx == 0)
|
|
|
|
if (sl_point_mod == 0) {
|
|
|
|
{
|
|
|
|
ssb_t ssb_msg = {};
|
|
|
|
ssb_t ssb_msg = {};
|
|
|
|
srsran_mib_nr_t mib_msg = {};
|
|
|
|
srsran_mib_nr_t mib_msg = {};
|
|
|
|
mib_msg.sfn = sl_point.sfn();
|
|
|
|
mib_msg.sfn = sl_point.sfn();
|
|
|
|
mib_msg.hrf = (sl_idx % SRSRAN_NSLOTS_PER_FRAME_NR(srsran_subcarrier_spacing_15kHz) <
|
|
|
|
mib_msg.hrf = (sl_idx % SRSRAN_NSLOTS_PER_FRAME_NR(srsran_subcarrier_spacing_15kHz) < SRSRAN_NSLOTS_PER_FRAME_NR(srsran_subcarrier_spacing_15kHz) / 2);
|
|
|
|
SRSRAN_NSLOTS_PER_FRAME_NR(srsran_subcarrier_spacing_15kHz) / 2);
|
|
|
|
mib_msg.ssb_idx = 0; // This corresponds to "Position in Burst" = 1000
|
|
|
|
// This corresponds to "Position in Burst" = 1000
|
|
|
|
|
|
|
|
mib_msg.ssb_idx = 0;
|
|
|
|
|
|
|
|
// Pack mib message to be sent to PHY
|
|
|
|
srsran_pbch_msg_nr_mib_pack(&mib_msg, &ssb_msg.pbch_msg);
|
|
|
|
srsran_pbch_msg_nr_mib_pack(&mib_msg, &ssb_msg.pbch_msg);
|
|
|
|
ssb_list.push_back(ssb_msg);
|
|
|
|
ssb_list.push_back(ssb_msg);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#if 0
|
|
|
|
|
|
|
|
void sched_ssb(int slot_idx, int ssb_periodicity, srsran::bounded_bitset<4>& pos_in_burst)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
/* Input needed:
|
|
|
|
|
|
|
|
* - slot_idx: slot index
|
|
|
|
|
|
|
|
* - ssb_periodicity: Periodicity of SSB in ms
|
|
|
|
|
|
|
|
* - pos_in_burst: position in Burst (bit map indicating in which SSB opportunities gNB needs to tx
|
|
|
|
|
|
|
|
*
|
|
|
|
|
|
|
|
* Parameters that could be passed but are currently hard-coded
|
|
|
|
|
|
|
|
* - Subcarrier spacing: 15kHz
|
|
|
|
|
|
|
|
* - Frequency (info on whether carrier is above or below 3GHz)
|
|
|
|
|
|
|
|
*
|
|
|
|
|
|
|
|
* NOTE: this function is hard coded for frequency < 3GHz,
|
|
|
|
|
|
|
|
* and SubCarrierSpacing 15kHz. Therefore, we assume
|
|
|
|
|
|
|
|
* 1 slot = 1ms
|
|
|
|
|
|
|
|
* */
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// NOTE: This
|
|
|
|
|
|
|
|
// This function only implements SSB for frequency < 3GHz, and SubCarrierSpacing 15kHz
|
|
|
|
|
|
|
|
// In this case, 1 slot = 1ms
|
|
|
|
|
|
|
|
int ssb_sf_idx = slot_idx % ssb_periodicity;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// if slot falls into the correct periodicity, continue with further checks
|
|
|
|
|
|
|
|
// check if slot is
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// code below will be simplified, depending on struct used
|
|
|
|
|
|
|
|
if (ssb_sf_idx == 0)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
// check first two bit in bitmap (position in burst)
|
|
|
|
|
|
|
|
// and pack corresponding SSB for slot 0
|
|
|
|
|
|
|
|
if ( pos_in_burst.test(POS_IN_BURST_FIRST_BIT_IDX) )
|
|
|
|
|
|
|
|
printf("Pack first SSB in slot 0 ");
|
|
|
|
|
|
|
|
if ( pos_in_burst.test(POS_IN_BURST_SECOND_BIT_IDX) )
|
|
|
|
|
|
|
|
printf("Pack second SSB in slot 0 ");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else if (ssb_sf_idx == 1)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
// check second two bit in bitmap (position in burst)
|
|
|
|
|
|
|
|
// and pack corresponding SSB for slot 1
|
|
|
|
|
|
|
|
if ( pos_in_burst.test(POS_IN_BURST_FIRST_BIT_IDX) )
|
|
|
|
|
|
|
|
printf("Pack first SSB in slot 1 ");
|
|
|
|
|
|
|
|
if ( pos_in_burst.test(POS_IN_BURST_SECOND_BIT_IDX) )
|
|
|
|
|
|
|
|
printf("Pack second SSB in slot 1 ");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
// nothing to do here
|
|
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void sched_dl_signalling(const bwp_params& bwp_params,
|
|
|
|
void sched_dl_signalling(const bwp_params& bwp_params,
|
|
|
|
slot_point sl_pdcch,
|
|
|
|
slot_point sl_pdcch,
|
|
|
|