Commit 707aab3a authored by Robert Schmidt's avatar Robert Schmidt

Merge branch 'integration_2024_w25' into 'develop'

Integration: `2024.w25`

See merge request oai/openairinterface5g!2811

* !2795 NR UE NL assertion
* !2802 Fix regression in ue-scan-carrier option
* !2806 Minor fixes to wireshark documentation
* !2807 Add assertion for known segfault during teardown of gNB
* !2809 Inversion in flags name
* !2697 SIDELINK PSBCH: MAC->PHY cfg, Scheduler + supporting functions, enable system testing & scope
* !2808 NR UE DLSCH MCS table selection improvements
parents 69962ef9 88ca3828
...@@ -1412,6 +1412,7 @@ set (MAC_NR_SRC_UE ...@@ -1412,6 +1412,7 @@ set (MAC_NR_SRC_UE
${NR_UE_MAC_DIR}/nr_ue_procedures.c ${NR_UE_MAC_DIR}/nr_ue_procedures.c
${NR_UE_MAC_DIR}/nr_ue_procedures_sl.c ${NR_UE_MAC_DIR}/nr_ue_procedures_sl.c
${NR_UE_MAC_DIR}/nr_ue_scheduler.c ${NR_UE_MAC_DIR}/nr_ue_scheduler.c
${NR_UE_MAC_DIR}/nr_ue_scheduler_sl.c
${NR_UE_MAC_DIR}/nr_ue_dci_configuration.c ${NR_UE_MAC_DIR}/nr_ue_dci_configuration.c
${NR_UE_MAC_DIR}/nr_ra_procedures.c ${NR_UE_MAC_DIR}/nr_ra_procedures.c
) )
......
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
*/ */
#ifndef __LOG_H__ #ifndef __LOG_H__
# define __LOG_H__ #define __LOG_H__
/*--- INCLUDES ---------------------------------------------------------------*/ /*--- INCLUDES ---------------------------------------------------------------*/
#include <unistd.h> #include <unistd.h>
...@@ -526,8 +526,8 @@ int32_t write_file_matlab(const char *fname, const char *vname, void *data, int ...@@ -526,8 +526,8 @@ int32_t write_file_matlab(const char *fname, const char *vname, void *data, int
} while (0) } while (0)
#define nfapi_log(FILE, FNC, LN, COMP, LVL, FMT...) #define nfapi_log(FILE, FNC, LN, COMP, LVL, FMT...)
#define LOG_DEBUGFLAG(D) (g_log->dump_mask & D) #define LOG_DEBUGFLAG(D) (g_log->debug_mask & D)
#define LOG_DUMPFLAG(D) (g_log->debug_mask & D) #define LOG_DUMPFLAG(D) (g_log->dump_mask & D)
#define LOG_DUMPMSG(c, f, b, s, x...) \ #define LOG_DUMPMSG(c, f, b, s, x...) \
do { \ do { \
if (g_log->dump_mask & f) \ if (g_log->dump_mask & f) \
......
...@@ -99,46 +99,52 @@ Use a recent version of wireshark. The steps below were done using ...@@ -99,46 +99,52 @@ Use a recent version of wireshark. The steps below were done using
version 3.3.2. Maybe some options are different for your version version 3.3.2. Maybe some options are different for your version
of wireshark. Adapt as necessary. of wireshark. Adapt as necessary.
First, do the previous steps for LTE. 1) First, do the previous steps for LTE.
2) Then, in the menu, choose `Edit->Preferences`.
3) In the preference window, unroll `Protocols` and configure the following:
Then, in the menu, choose `Edit->Preferences`. **MAC**
In the preference window, unroll `Protocols`. Go to `MAC-NR`. Select:
Go to `MAC-NR`. Select both options (`Attempt to decode BCCH, PCCH and CCCH data using NR RRC dissector`
and `Attempt to dissect LCID 1-3 as srb1-3`).
For `Source of LCID -> drb channel settings` choose option `From static table`. * `Attempt to decode BCCH, PCCH and CCCH data using NR RRC dissector`
Then click the `Edit...` button of `LCID -> DRB Mappings Table`. * `Attempt to dissect LCID 1-3 as srb1-3`
In the new window, click on `+`. Choose LCID `4`, DRBID `1`, UL RLC Bearer For `Source of LCID -> drb channel settings`:
* choose option `From static table`.
* click the `Edit...` button of `LCID -> DRB Mappings Table`.
* In the new window, click on `+`. Choose LCID `4`, DRBID `1`, UL RLC Bearer
Type `AM, SN Len=18`, same thing for DL RLC Bearer Type. Type `AM, SN Len=18`, same thing for DL RLC Bearer Type.
* Click OK.
Then click OK. **RLC**
Now, go to `RLC-NR`. Select `Call PDCP dissector for SRB PDUs`.
For `Call PDCP dissector for UL DRB PDUs` choose `18-bit SN`. Same Now, go to `RLC-NR`. Select:
for DL.
Select `Call RRC dissector for CCCH PDUs`. * `Call PDCP dissector for SRB PDUs`.
* `Call PDCP dissector for UL DRB PDUs` choose `18-bit SN`. Same for DL.
* `Call RRC dissector for CCCH PDUs`.
* `Try to reassemble AM frames`.
You don't need to select `May see RLC headers only` and You don't need to select `May see RLC headers only` and
`Try to reassemble UM frames`. `Try to reassemble UM frames`.
Now, go to `PDCP-NR`. Select what you want in there. It's good **PDCP**
to select `Show uncompressed User-Plane data as IP`. Also good
to select `Show unciphered Signalling-Plane data as RRC`. Now, go to `PDCP-NR`. Select what you need in there.
For `Do sequence number analysis` it can be good to use
`Only-RLC-frames` but anything will do. We don't use ROHC so you It's good to select:
don't need to select `Attempt to decode ROHC data`. And the * `Show uncompressed User-Plane data as IP`
layer info to show depends on what you want to analyse. * `Show unciphered Signalling-Plane data as RRC`.
`Traffic Info` is a good choice. * `Only-RLC-frames` in `Do sequence number analysis`, but anything will do.
* `Traffic Info` as layer info to show, depending on what you want to analyse.
We don't use ROHC so you don't need to select `Attempt to decode ROHC data`.
You are done with the preferences. You can click OK. You are done with the preferences. You can click OK.
Then, in the menu `Analyze`, choose `Enabled Protocols...`. In the new window 4) Then, in the menu `Analyze`, choose `Enabled Protocols...`.
search for `nr` and select `mac_nr_udp` to have `MAC-NR over UDP`. 5) In the new window search for `nr` and select `mac_nr_udp` to have `MAC-NR over UDP`.
And that's it. Maybe other settings can be changed, but those steps should be And that's it. Maybe other settings can be changed, but those steps should be
enough for a start. enough for a start.
......
...@@ -389,7 +389,10 @@ uint16_t get_band(uint64_t downlink_frequency, int32_t delta_duplex) ...@@ -389,7 +389,10 @@ uint16_t get_band(uint64_t downlink_frequency, int32_t delta_duplex)
printf("DL frequency %"PRIu64": band %d, UL frequency %"PRIu64"\n", printf("DL frequency %"PRIu64": band %d, UL frequency %"PRIu64"\n",
downlink_frequency, current_band, downlink_frequency+delta_duplex); downlink_frequency, current_band, downlink_frequency+delta_duplex);
AssertFatal(current_band != 0, "Can't find EUTRA band for frequency %"PRIu64" and duplex_spacing %u\n", downlink_frequency, delta_duplex); AssertFatal(current_band != 0,
"Can't find EUTRA band for frequency %" PRIu64 " and duplex_spacing %d\n",
downlink_frequency,
delta_duplex);
return current_band; return current_band;
} }
...@@ -1030,13 +1033,13 @@ uint32_t get_ssb_offset_to_pointA(uint32_t absoluteFrequencySSB, ...@@ -1030,13 +1033,13 @@ uint32_t get_ssb_offset_to_pointA(uint32_t absoluteFrequencySSB,
static double get_start_freq(const double fc, const int nbRB, const int mu) static double get_start_freq(const double fc, const int nbRB, const int mu)
{ {
const int scs = MU_SCS(mu) * 1000; const int scs = MU_SCS(mu) * 1000;
return fc - (nbRB / 2 * NR_NB_SC_PER_RB * scs); return fc - ((double)nbRB / 2 * NR_NB_SC_PER_RB * scs);
} }
static double get_stop_freq(const double fc, const int nbRB, const int mu) static double get_stop_freq(const double fc, const int nbRB, const int mu)
{ {
int scs = MU_SCS(mu) * 1000; int scs = MU_SCS(mu) * 1000;
return fc + (nbRB / 2 * NR_NB_SC_PER_RB * scs); return fc + ((double)nbRB / 2 * NR_NB_SC_PER_RB * scs);
} }
static void compute_M_and_N(const int gscn, int *rM, int *rN) static void compute_M_and_N(const int gscn, int *rM, int *rN)
...@@ -1101,6 +1104,7 @@ static void find_gscn_to_scan(const double startFreq, ...@@ -1101,6 +1104,7 @@ static void find_gscn_to_scan(const double startFreq,
*scanGscnStart = g; *scanGscnStart = g;
break; break;
} }
*scanGscnStop = *scanGscnStart;
for (int g = gscn.last_gscn; g > gscn.first_gscn; g -= gscn.step_gscn) { for (int g = gscn.last_gscn; g > gscn.first_gscn; g -= gscn.step_gscn) {
const double centerSSBFreq = get_ssref_from_gscn(g); const double centerSSBFreq = get_ssref_from_gscn(g);
...@@ -1140,7 +1144,7 @@ int get_scan_ssb_first_sc(const double fc, const int nbRB, const int nrBand, con ...@@ -1140,7 +1144,7 @@ int get_scan_ssb_first_sc(const double fc, const int nbRB, const int nrBand, con
find_gscn_to_scan(startFreq, stopFreq, *tmpRaster, &scanGscnStart, &scanGscnStop); find_gscn_to_scan(startFreq, stopFreq, *tmpRaster, &scanGscnStart, &scanGscnStop);
const double scs = MU_SCS(mu) * 1e3; const double scs = MU_SCS(mu) * 1e3;
const double pointA = fc - (nbRB / 2 * scs * NR_NB_SC_PER_RB); const double pointA = fc - ((double)nbRB / 2 * scs * NR_NB_SC_PER_RB);
int numGscn = 0; int numGscn = 0;
for (int g = scanGscnStart; (g <= scanGscnStop) && (numGscn < MAX_GSCN_BAND); g += tmpRaster->step_gscn) { for (int g = scanGscnStart; (g <= scanGscnStop) && (numGscn < MAX_GSCN_BAND); g += tmpRaster->step_gscn) {
ssbInfo[numGscn].ssRef = get_ssref_from_gscn(g); ssbInfo[numGscn].ssRef = get_ssref_from_gscn(g);
......
This diff is collapsed.
...@@ -315,13 +315,17 @@ void set_options(int CC_id, PHY_VARS_NR_UE *UE){ ...@@ -315,13 +315,17 @@ void set_options(int CC_id, PHY_VARS_NR_UE *UE){
} }
void init_openair0(void) { void init_openair0()
{
int card; int card;
int freq_off = 0; int freq_off = 0;
NR_DL_FRAME_PARMS *frame_parms = &PHY_vars_UE_g[0][0]->frame_parms; NR_DL_FRAME_PARMS *frame_parms = &PHY_vars_UE_g[0][0]->frame_parms;
bool is_sidelink = (get_softmodem_params()->sl_mode) ? true : false;
if (is_sidelink)
frame_parms = &PHY_vars_UE_g[0][0]->SL_UE_PHY_PARAMS.sl_frame_params;
for (card=0; card<MAX_CARDS; card++) { for (card=0; card<MAX_CARDS; card++) {
uint64_t dl_carrier, ul_carrier, sl_carrier; uint64_t dl_carrier, ul_carrier;
openair0_cfg[card].configFilename = NULL; openair0_cfg[card].configFilename = NULL;
openair0_cfg[card].threequarter_fs = frame_parms->threequarter_fs; openair0_cfg[card].threequarter_fs = frame_parms->threequarter_fs;
openair0_cfg[card].sample_rate = frame_parms->samples_per_subframe * 1e3; openair0_cfg[card].sample_rate = frame_parms->samples_per_subframe * 1e3;
...@@ -347,15 +351,14 @@ void init_openair0(void) { ...@@ -347,15 +351,14 @@ void init_openair0(void) {
openair0_cfg[card].rx_num_channels, openair0_cfg[card].rx_num_channels,
duplex_mode[openair0_cfg[card].duplex_mode]); duplex_mode[openair0_cfg[card].duplex_mode]);
nr_get_carrier_frequencies(PHY_vars_UE_g[0][0], &dl_carrier, &ul_carrier); if (is_sidelink) {
dl_carrier = frame_parms->dl_CarrierFreq;
ul_carrier = frame_parms->ul_CarrierFreq;
} else
nr_get_carrier_frequencies(PHY_vars_UE_g[0][0], &dl_carrier, &ul_carrier);
nr_rf_card_config_freq(&openair0_cfg[card], ul_carrier, dl_carrier, freq_off); nr_rf_card_config_freq(&openair0_cfg[card], ul_carrier, dl_carrier, freq_off);
if (get_softmodem_params()->sl_mode == 2) {
nr_get_carrier_frequencies_sl(PHY_vars_UE_g[0][0], &sl_carrier);
nr_rf_card_config_freq(&openair0_cfg[card], sl_carrier, sl_carrier, freq_off);
}
nr_rf_card_config_gain(&openair0_cfg[card], rx_gain_off); nr_rf_card_config_gain(&openair0_cfg[card], rx_gain_off);
openair0_cfg[card].configFilename = get_softmodem_params()->rf_config_file; openair0_cfg[card].configFilename = get_softmodem_params()->rf_config_file;
...@@ -511,7 +514,7 @@ int main(int argc, char **argv) ...@@ -511,7 +514,7 @@ int main(int argc, char **argv)
ue_id_g = (node_number == 0) ? 0 : node_number - 2; ue_id_g = (node_number == 0) ? 0 : node_number - 2;
AssertFatal(ue_id_g >= 0, "UE id is expected to be nonnegative.\n"); AssertFatal(ue_id_g >= 0, "UE id is expected to be nonnegative.\n");
if(node_number == 0) if (node_number == 0)
init_pdcp(0); init_pdcp(0);
else else
init_pdcp(mode_offset + ue_id_g); init_pdcp(mode_offset + ue_id_g);
...@@ -540,7 +543,8 @@ int main(int argc, char **argv) ...@@ -540,7 +543,8 @@ int main(int argc, char **argv)
set_options(CC_id, UE[CC_id]); set_options(CC_id, UE[CC_id]);
NR_UE_MAC_INST_t *mac = get_mac_inst(0); NR_UE_MAC_INST_t *mac = get_mac_inst(0);
if (get_softmodem_params()->sa) { // set frame config to initial values from command line and assume that the SSB is centered on the grid if (get_softmodem_params()->sa || get_softmodem_params()->sl_mode) { // set frame config to initial values from command line
// and assume that the SSB is centered on the grid
uint16_t nr_band = get_softmodem_params()->band; uint16_t nr_band = get_softmodem_params()->band;
mac->nr_band = nr_band; mac->nr_band = nr_band;
mac->ssb_start_subcarrier = UE[CC_id]->frame_parms.ssb_start_subcarrier; mac->ssb_start_subcarrier = UE[CC_id]->frame_parms.ssb_start_subcarrier;
...@@ -549,8 +553,7 @@ int main(int argc, char **argv) ...@@ -549,8 +553,7 @@ int main(int argc, char **argv)
uplink_frequency_offset[CC_id][0], uplink_frequency_offset[CC_id][0],
get_softmodem_params()->numerology, get_softmodem_params()->numerology,
nr_band); nr_band);
} } else {
else{
DevAssert(mac->if_module != NULL && mac->if_module->phy_config_request != NULL); DevAssert(mac->if_module != NULL && mac->if_module->phy_config_request != NULL);
mac->if_module->phy_config_request(&mac->phy_config); mac->if_module->phy_config_request(&mac->phy_config);
mac->phy_config_request_sent = true; mac->phy_config_request_sent = true;
...@@ -559,7 +562,24 @@ int main(int argc, char **argv) ...@@ -559,7 +562,24 @@ int main(int argc, char **argv)
nr_init_frame_parms_ue(&UE[CC_id]->frame_parms, nrUE_config, mac->nr_band); nr_init_frame_parms_ue(&UE[CC_id]->frame_parms, nrUE_config, mac->nr_band);
} }
UE[CC_id]->sl_mode = get_softmodem_params()->sl_mode;
init_nr_ue_vars(UE[CC_id], 0, abstraction_flag); init_nr_ue_vars(UE[CC_id], 0, abstraction_flag);
if (UE[CC_id]->sl_mode) {
AssertFatal(UE[CC_id]->sl_mode == 2, "Only Sidelink mode 2 supported. Mode 1 not yet supported\n");
DevAssert(mac->if_module != NULL && mac->if_module->sl_phy_config_request != NULL);
nr_sl_phy_config_t *phycfg = &mac->SL_MAC_PARAMS->sl_phy_config;
phycfg->sl_config_req.sl_carrier_config.sl_num_rx_ant = get_nrUE_params()->nb_antennas_rx;
phycfg->sl_config_req.sl_carrier_config.sl_num_tx_ant = get_nrUE_params()->nb_antennas_tx;
mac->if_module->sl_phy_config_request(phycfg);
mac->phy_config_request_sent = true;
sl_nr_ue_phy_params_t *sl_phy = &UE[CC_id]->SL_UE_PHY_PARAMS;
nr_init_frame_parms_ue_sl(&sl_phy->sl_frame_params,
&sl_phy->sl_config,
get_softmodem_params()->threequarter_fs,
get_nrUE_params()->ofdm_offset_divisor);
sl_ue_phy_init(UE[CC_id]);
}
} }
init_openair0(); init_openair0();
......
...@@ -12,6 +12,7 @@ ...@@ -12,6 +12,7 @@
#define CONFIG_HLP_DLSCH_PARA "number of threads for dlsch processing 0 for no parallelization\n" #define CONFIG_HLP_DLSCH_PARA "number of threads for dlsch processing 0 for no parallelization\n"
#define CONFIG_HLP_OFFSET_DIV "Divisor for computing OFDM symbol offset in Rx chain (num samples in CP/<the value>). Default value is 8. To set the sample offset to 0, set this value ~ 10e6\n" #define CONFIG_HLP_OFFSET_DIV "Divisor for computing OFDM symbol offset in Rx chain (num samples in CP/<the value>). Default value is 8. To set the sample offset to 0, set this value ~ 10e6\n"
#define CONFIG_HLP_MAX_LDPC_ITERATIONS "Maximum LDPC decoder iterations\n" #define CONFIG_HLP_MAX_LDPC_ITERATIONS "Maximum LDPC decoder iterations\n"
/***************************************************************************************************************************************/ /***************************************************************************************************************************************/
/* command line options definitions, CMDLINE_XXXX_DESC macros are used to initialize paramdef_t arrays which are then used as argument /* command line options definitions, CMDLINE_XXXX_DESC macros are used to initialize paramdef_t arrays which are then used as argument
when calling config_get or config_getlist functions */ when calling config_get or config_getlist functions */
......
...@@ -29,6 +29,7 @@ typedef enum sl_nr_rx_config_type_enum { ...@@ -29,6 +29,7 @@ typedef enum sl_nr_rx_config_type_enum {
SL_NR_CONFIG_TYPE_RX_PSCCH, SL_NR_CONFIG_TYPE_RX_PSCCH,
SL_NR_CONFIG_TYPE_RX_PSSCH_SCI, SL_NR_CONFIG_TYPE_RX_PSSCH_SCI,
SL_NR_CONFIG_TYPE_RX_PSSCH_SLSCH, SL_NR_CONFIG_TYPE_RX_PSSCH_SLSCH,
SL_NR_CONFIG_TYPE_RX_PSFCH,
SL_NR_CONFIG_TYPE_RX_MAXIMUM SL_NR_CONFIG_TYPE_RX_MAXIMUM
} sl_nr_rx_config_type_enum_t; } sl_nr_rx_config_type_enum_t;
......
...@@ -296,8 +296,12 @@ int init_nr_ue_signal(PHY_VARS_NR_UE *ue, int nb_connected_gNB) ...@@ -296,8 +296,12 @@ int init_nr_ue_signal(PHY_VARS_NR_UE *ue, int nb_connected_gNB)
// init RX buffers // init RX buffers
common_vars->rxdata = malloc16(fp->nb_antennas_rx * sizeof(c16_t *)); common_vars->rxdata = malloc16(fp->nb_antennas_rx * sizeof(c16_t *));
int num_samples = 2 * fp->samples_per_frame + fp->ofdm_symbol_size;
if (ue->sl_mode == 2)
num_samples = (SL_NR_PSBCH_REPETITION_IN_FRAMES * fp->samples_per_frame) + fp->ofdm_symbol_size;
for (i=0; i<fp->nb_antennas_rx; i++) { for (i=0; i<fp->nb_antennas_rx; i++) {
common_vars->rxdata[i] = malloc16_clear((2 * (fp->samples_per_frame) + fp->ofdm_symbol_size) * sizeof(c16_t)); common_vars->rxdata[i] = malloc16_clear(num_samples * sizeof(c16_t));
} }
// ceil(((NB_RB<<1)*3)/32) // 3 RE *2(QPSK) // ceil(((NB_RB<<1)*3)/32) // 3 RE *2(QPSK)
...@@ -655,7 +659,8 @@ void init_N_TA_offset(PHY_VARS_NR_UE *ue){ ...@@ -655,7 +659,8 @@ void init_N_TA_offset(PHY_VARS_NR_UE *ue){
NR_DL_FRAME_PARMS *fp = &ue->frame_parms; NR_DL_FRAME_PARMS *fp = &ue->frame_parms;
if (fp->frame_type == FDD) { // No timing offset for Sidelink, refer to 3GPP 38.211 Section 8.5
if (fp->frame_type == FDD || ue->sl_mode == 2) {
ue->N_TA_offset = 0; ue->N_TA_offset = 0;
} else { } else {
int N_TA_offset = fp->ul_CarrierFreq < 6e9 ? 400 : 431; // reference samples for 25600Tc @ 30.72 Ms/s for FR1, same @ 61.44 Ms/s for FR2 int N_TA_offset = fp->ul_CarrierFreq < 6e9 ? 400 : 431; // reference samples for 25600Tc @ 30.72 Ms/s for FR1, same @ 61.44 Ms/s for FR2
...@@ -771,6 +776,4 @@ void sl_ue_phy_init(PHY_VARS_NR_UE *UE) ...@@ -771,6 +776,4 @@ void sl_ue_phy_init(PHY_VARS_NR_UE *UE)
// Generate PSS time domain samples used for correlation during SLSS reception. // Generate PSS time domain samples used for correlation during SLSS reception.
sl_generate_pss_ifft_samples(&UE->SL_UE_PHY_PARAMS, &UE->SL_UE_PHY_PARAMS.init_params); sl_generate_pss_ifft_samples(&UE->SL_UE_PHY_PARAMS, &UE->SL_UE_PHY_PARAMS.init_params);
init_symbol_rotation(sl_fp);
init_timeshift_rotation(sl_fp);
} }
This diff is collapsed.
...@@ -29,7 +29,10 @@ int nr_get_ssb_start_symbol(const NR_DL_FRAME_PARMS *fp, uint8_t i_ssb); ...@@ -29,7 +29,10 @@ int nr_get_ssb_start_symbol(const NR_DL_FRAME_PARMS *fp, uint8_t i_ssb);
void nr_init_frame_parms(nfapi_nr_config_request_scf_t *config, NR_DL_FRAME_PARMS *frame_parms); void nr_init_frame_parms(nfapi_nr_config_request_scf_t *config, NR_DL_FRAME_PARMS *frame_parms);
int nr_init_frame_parms_ue(NR_DL_FRAME_PARMS *frame_parms, fapi_nr_config_request_t *config, uint16_t nr_band); int nr_init_frame_parms_ue(NR_DL_FRAME_PARMS *frame_parms, fapi_nr_config_request_t *config, uint16_t nr_band);
void nr_init_frame_parms_ue_sa(NR_DL_FRAME_PARMS *frame_parms, uint64_t downlink_frequency, int32_t uplink_frequency_offset, uint8_t mu, uint16_t nr_band); void nr_init_frame_parms_ue_sa(NR_DL_FRAME_PARMS *frame_parms, uint64_t downlink_frequency, int32_t uplink_frequency_offset, uint8_t mu, uint16_t nr_band);
void nr_init_frame_parms_ue_sl(NR_DL_FRAME_PARMS *frame_parms, uint64_t sidelink_frequency, uint16_t nr_band); int nr_init_frame_parms_ue_sl(NR_DL_FRAME_PARMS *fp,
sl_nr_phy_config_request_t *config,
int threequarter_fs,
uint32_t ofdm_offset_divisor);
int init_nr_ue_signal(PHY_VARS_NR_UE *ue,int nb_connected_eNB); int init_nr_ue_signal(PHY_VARS_NR_UE *ue,int nb_connected_eNB);
void term_nr_ue_signal(PHY_VARS_NR_UE *ue, int nb_connected_gNB); void term_nr_ue_signal(PHY_VARS_NR_UE *ue, int nb_connected_gNB);
void init_nr_ue_transport(PHY_VARS_NR_UE *ue); void init_nr_ue_transport(PHY_VARS_NR_UE *ue);
......
...@@ -578,61 +578,59 @@ void nr_dft(c16_t *z, c16_t *d, uint32_t Msc_PUSCH) ...@@ -578,61 +578,59 @@ void nr_dft(c16_t *z, c16_t *d, uint32_t Msc_PUSCH)
} }
void perform_symbol_rotation(NR_DL_FRAME_PARMS *fp, double f0, c16_t *symbol_rotation)
void init_symbol_rotation(NR_DL_FRAME_PARMS *fp) { {
uint64_t dl_CarrierFreq = fp->dl_CarrierFreq;
uint64_t ul_CarrierFreq = fp->ul_CarrierFreq;
uint64_t sl_CarrierFreq = fp->sl_CarrierFreq;
double f[2] = {(double)dl_CarrierFreq, (double)ul_CarrierFreq};
const int nsymb = fp->symbols_per_slot * fp->slots_per_frame/10; const int nsymb = fp->symbols_per_slot * fp->slots_per_frame/10;
const double Tc=(1/480e3/4096); const double Tc=(1/480e3/4096);
const double Nu=2048*64*(1/(float)(1<<fp->numerology_index)); const double Nu=2048*64*(1/(float)(1<<fp->numerology_index));
const double Ncp0=16*64 + (144*64*(1/(float)(1<<fp->numerology_index))); const double Ncp0=16*64 + (144*64*(1/(float)(1<<fp->numerology_index)));
const double Ncp1=(144*64*(1/(float)(1<<fp->numerology_index))); const double Ncp1=(144*64*(1/(float)(1<<fp->numerology_index)));
for (uint8_t ll = 0; ll < 2; ll++){ LOG_I(PHY, "Doing symbol rotation calculation for TX/RX, f0 %f Hz, Nsymb %d\n", f0, nsymb);
double f0 = f[ll];
LOG_D(PHY, "Doing symbol rotation calculation for gNB TX/RX, f0 %f Hz, Nsymb %d\n", f0, nsymb);
c16_t *symbol_rotation = fp->symbol_rotation[ll];
if (get_softmodem_params()->sl_mode == 2) {
f0 = (double)sl_CarrierFreq;
symbol_rotation = fp->symbol_rotation[link_type_sl];
}
double tl = 0.0;
double poff = 0.0;
double exp_re = 0.0;
double exp_im = 0.0;
for (int l = 0; l < nsymb; l++) { double tl = 0.0;
double poff = 0.0;
double exp_re = 0.0;
double exp_im = 0.0;
double Ncp; for (int l = 0; l < nsymb; l++) {
if (l == 0 || l == (7 * (1 << fp->numerology_index))) { double Ncp;
Ncp = Ncp0; if (l == 0 || l == (7 * (1 << fp->numerology_index))) {
} else { Ncp = Ncp0;
Ncp = Ncp1; } else {
} Ncp = Ncp1;
}
poff = 2 * M_PI * (tl + (Ncp * Tc)) * f0; poff = 2 * M_PI * (tl + (Ncp * Tc)) * f0;
exp_re = cos(poff); exp_re = cos(poff);
exp_im = sin(-poff); exp_im = sin(-poff);
symbol_rotation[l].r = (int16_t)floor(exp_re * 32767); symbol_rotation[l].r = (int16_t)floor(exp_re * 32767);
symbol_rotation[l].i = (int16_t)floor(exp_im * 32767); symbol_rotation[l].i = (int16_t)floor(exp_im * 32767);
LOG_D(PHY,
"Symbol rotation %d/%d => tl %f (%d,%d) (%f)\n",
l,
nsymb,
tl,
symbol_rotation[l].r,
symbol_rotation[l].i,
(poff / 2 / M_PI) - floor(poff / 2 / M_PI));
tl += (Nu + Ncp) * Tc;
}
}
LOG_D(PHY, "Symbol rotation %d/%d => tl %f (%d,%d) (%f)\n", void init_symbol_rotation(NR_DL_FRAME_PARMS *fp)
l, {
nsymb, double f[2] = {(double)fp->dl_CarrierFreq, (double)fp->ul_CarrierFreq};
tl,
symbol_rotation[l].r,
symbol_rotation[l].i,
(poff / 2 / M_PI) - floor(poff / 2 / M_PI));
tl += (Nu + Ncp) * Tc; for (int ll = 0; ll < 2; ll++) {
double f0 = f[ll];
if (f0 == 0)
continue;
c16_t *rot = fp->symbol_rotation[ll];
} perform_symbol_rotation(fp, f0, rot);
} }
} }
......
...@@ -114,6 +114,8 @@ void apply_nr_rotation_TX(const NR_DL_FRAME_PARMS *fp, ...@@ -114,6 +114,8 @@ void apply_nr_rotation_TX(const NR_DL_FRAME_PARMS *fp,
int first_symbol, int first_symbol,
int nsymb); int nsymb);
void perform_symbol_rotation(NR_DL_FRAME_PARMS *fp, double f0, c16_t *symbol_rotation);
void init_symbol_rotation(NR_DL_FRAME_PARMS *fp); void init_symbol_rotation(NR_DL_FRAME_PARMS *fp);
void init_timeshift_rotation(NR_DL_FRAME_PARMS *fp); void init_timeshift_rotation(NR_DL_FRAME_PARMS *fp);
......
...@@ -94,7 +94,7 @@ int sl_nr_slot_fep(PHY_VARS_NR_UE *ue, ...@@ -94,7 +94,7 @@ int sl_nr_slot_fep(PHY_VARS_NR_UE *ue,
dft(dftsize, rxdata_ptr, (int16_t *)&rxdataF[aa][frame_params->ofdm_symbol_size * symbol], 1); dft(dftsize, rxdata_ptr, (int16_t *)&rxdataF[aa][frame_params->ofdm_symbol_size * symbol], 1);
int symb_offset = (Ns % frame_params->slots_per_subframe) * frame_params->symbols_per_slot; int symb_offset = (Ns % frame_params->slots_per_subframe) * frame_params->symbols_per_slot;
int32_t rot2 = ((uint32_t *)frame_params->symbol_rotation[1])[symbol + symb_offset]; int32_t rot2 = ((uint32_t *)frame_params->symbol_rotation[2])[symbol + symb_offset];
((int16_t *)&rot2)[1] = -((int16_t *)&rot2)[1]; ((int16_t *)&rot2)[1] = -((int16_t *)&rot2)[1];
#ifdef SL_DEBUG_SLOT_FEP #ifdef SL_DEBUG_SLOT_FEP
......
...@@ -47,16 +47,17 @@ uint32_t nr_get_G(uint16_t nb_rb, ...@@ -47,16 +47,17 @@ uint32_t nr_get_G(uint16_t nb_rb,
return(G); return(G);
} }
uint32_t nr_get_E(uint32_t G, uint8_t C, uint8_t Qm, uint8_t Nl, uint8_t r) { uint32_t nr_get_E(uint32_t G, uint8_t C, uint8_t Qm, uint8_t Nl, uint8_t r)
{
uint32_t E; uint32_t E;
uint8_t Cprime = C; //assume CBGTI not present uint8_t Cprime = C; //assume CBGTI not present
AssertFatal(Nl>0,"Nl is 0\n"); AssertFatal(Nl > 0, "Nl is 0\n");
AssertFatal(Qm>0,"Qm is 0\n"); AssertFatal(Qm > 0, "Qm is 0\n");
if (r <= Cprime - ((G/(Nl*Qm))%Cprime) - 1) if (r <= Cprime - ((G / (Nl * Qm)) % Cprime) - 1)
E = Nl*Qm*(G/(Nl*Qm*Cprime)); E = Nl * Qm * (G / (Nl * Qm * Cprime));
else else
E = Nl*Qm*((G/(Nl*Qm*Cprime))+1); E = Nl * Qm * ((G / (Nl * Qm * Cprime)) + 1);
LOG_D(PHY,"nr_get_E : (G %d, C %d, Qm %d, Nl %d, r %d), E %d\n",G, C, Qm, Nl, r, E); LOG_D(PHY,"nr_get_E : (G %d, C %d, Qm %d, Nl %d, r %d), E %d\n",G, C, Qm, Nl, r, E);
return E; return E;
......
...@@ -351,7 +351,7 @@ void nr_sl_psbch_rsrp_measurements(sl_nr_ue_phy_params_t *sl_phy_params, ...@@ -351,7 +351,7 @@ void nr_sl_psbch_rsrp_measurements(sl_nr_ue_phy_params_t *sl_phy_params,
- ((int)openair0_cfg[0].rx_gain[0] - (int)openair0_cfg[0].rx_gain_offset[0]) - ((int)openair0_cfg[0].rx_gain[0] - (int)openair0_cfg[0].rx_gain_offset[0])
- dB_fixed(fp->ofdm_symbol_size); - dB_fixed(fp->ofdm_symbol_size);
LOG_I(PHY, LOG_D(PHY,
"PSBCH RSRP (DMRS REs): numREs:%d RSRP :%d dB/RE ,RSRP:%d dBm/RE\n", "PSBCH RSRP (DMRS REs): numREs:%d RSRP :%d dB/RE ,RSRP:%d dBm/RE\n",
num_re, num_re,
psbch_rx->rsrp_dB_per_RE, psbch_rx->rsrp_dB_per_RE,
......
...@@ -375,7 +375,7 @@ uint32_t nr_dlsch_decoding(PHY_VARS_NR_UE *phy_vars_ue, ...@@ -375,7 +375,7 @@ uint32_t nr_dlsch_decoding(PHY_VARS_NR_UE *phy_vars_ue,
&harq_process->F, &harq_process->F,
decParams.BG); decParams.BG);
if (harq_process->C>MAX_NUM_NR_DLSCH_SEGMENTS_PER_LAYER*dlsch->Nl) { if (harq_process->C > MAX_NUM_NR_DLSCH_SEGMENTS_PER_LAYER * dlsch->Nl) {
LOG_E(PHY, "nr_segmentation.c: too many segments %d, A %d\n", harq_process->C, A); LOG_E(PHY, "nr_segmentation.c: too many segments %d, A %d\n", harq_process->C, A);
return(-1); return(-1);
} }
...@@ -392,7 +392,7 @@ uint32_t nr_dlsch_decoding(PHY_VARS_NR_UE *phy_vars_ue, ...@@ -392,7 +392,7 @@ uint32_t nr_dlsch_decoding(PHY_VARS_NR_UE *phy_vars_ue,
decParams.numMaxIter = dlsch->max_ldpc_iterations; decParams.numMaxIter = dlsch->max_ldpc_iterations;
decParams.outMode = 0; decParams.outMode = 0;
r_offset = 0; r_offset = 0;
uint16_t a_segments = MAX_NUM_NR_DLSCH_SEGMENTS_PER_LAYER*dlsch->Nl; //number of segments to be allocated uint16_t a_segments = MAX_NUM_NR_DLSCH_SEGMENTS_PER_LAYER * dlsch->Nl; //number of segments to be allocated
if (nb_rb != 273) { if (nb_rb != 273) {
a_segments = a_segments*nb_rb; a_segments = a_segments*nb_rb;
......
...@@ -24,6 +24,7 @@ ...@@ -24,6 +24,7 @@
#include "PHY/CODING/nrPolar_tools/nr_polar_defs.h" #include "PHY/CODING/nrPolar_tools/nr_polar_defs.h"
#include "common/utils/LOG/log.h" #include "common/utils/LOG/log.h"
#include "PHY/NR_UE_TRANSPORT/nr_transport_proto_ue.h" #include "PHY/NR_UE_TRANSPORT/nr_transport_proto_ue.h"
#include "PHY/TOOLS/phy_scope_interface.h"
// #define DEBUG_PSBCH // #define DEBUG_PSBCH
...@@ -109,7 +110,7 @@ static void nr_psbch_extract(uint32_t rxdataF_sz, ...@@ -109,7 +110,7 @@ static void nr_psbch_extract(uint32_t rxdataF_sz,
} }
int nr_rx_psbch(PHY_VARS_NR_UE *ue, int nr_rx_psbch(PHY_VARS_NR_UE *ue,
UE_nr_rxtx_proc_t *proc, const UE_nr_rxtx_proc_t *proc,
int estimateSz, int estimateSz,
struct complex16 dl_ch_estimates[][estimateSz], struct complex16 dl_ch_estimates[][estimateSz],
NR_DL_FRAME_PARMS *frame_parms, NR_DL_FRAME_PARMS *frame_parms,
...@@ -122,6 +123,7 @@ int nr_rx_psbch(PHY_VARS_NR_UE *ue, ...@@ -122,6 +123,7 @@ int nr_rx_psbch(PHY_VARS_NR_UE *ue,
// Extra 2 bits needed as polar decoder expects a multiple of 4 as encoder length // Extra 2 bits needed as polar decoder expects a multiple of 4 as encoder length
// If these 2 bits are not added, runs compiled with --sanitize will fail. // If these 2 bits are not added, runs compiled with --sanitize will fail.
int16_t psbch_e_rx[SL_NR_POLAR_PSBCH_E_NORMAL_CP + 2] = {0}; int16_t psbch_e_rx[SL_NR_POLAR_PSBCH_E_NORMAL_CP + 2] = {0};
int16_t psbch_unClipped[SL_NR_POLAR_PSBCH_E_NORMAL_CP + 2] = {0};
#ifdef DEBUG_PSBCH #ifdef DEBUG_PSBCH
write_output("psbch_rxdataF.m", write_output("psbch_rxdataF.m",
...@@ -174,6 +176,9 @@ int nr_rx_psbch(PHY_VARS_NR_UE *ue, ...@@ -174,6 +176,9 @@ int nr_rx_psbch(PHY_VARS_NR_UE *ue,
nr_pbch_quantize(psbch_e_rx + psbch_e_rx_idx, (short *)rxdataF_comp[0], SL_NR_NUM_PSBCH_DATA_BITS_IN_ONE_SYMBOL); nr_pbch_quantize(psbch_e_rx + psbch_e_rx_idx, (short *)rxdataF_comp[0], SL_NR_NUM_PSBCH_DATA_BITS_IN_ONE_SYMBOL);
if (ue->scopeData)
memcpy(psbch_unClipped + psbch_e_rx_idx, rxdataF_comp[0], SL_NR_NUM_PSBCH_DATA_BITS_IN_ONE_SYMBOL * sizeof(int16_t));
psbch_e_rx_idx += SL_NR_NUM_PSBCH_DATA_BITS_IN_ONE_SYMBOL; psbch_e_rx_idx += SL_NR_NUM_PSBCH_DATA_BITS_IN_ONE_SYMBOL;
// SKIP 2 SL-PSS AND 2 SL-SSS symbols // SKIP 2 SL-PSS AND 2 SL-SSS symbols
...@@ -181,10 +186,8 @@ int nr_rx_psbch(PHY_VARS_NR_UE *ue, ...@@ -181,10 +186,8 @@ int nr_rx_psbch(PHY_VARS_NR_UE *ue,
symbol = (symbol == 0) ? 5 : symbol + 1; symbol = (symbol == 0) ? 5 : symbol + 1;
} }
#if 0 // ENABLE SCOPE LATER UEscopeCopy(ue, psbchRxdataF_comp, psbch_unClipped, sizeof(c16_t), frame_parms->nb_antennas_rx, psbch_e_rx_idx / 2, 0);
UEscopeCopy(ue, psbchRxdataF_comp, psbch_unClipped, sizeof(struct complex16), frame_parms->nb_antennas_rx, psbch_e_rx_idx/2); UEscopeCopy(ue, psbchLlr, psbch_e_rx, sizeof(int16_t), frame_parms->nb_antennas_rx, psbch_e_rx_idx, 0);
UEscopeCopy(ue, psbchLlr, psbch_e_rx, sizeof(int16_t), frame_parms->nb_antennas_rx, psbch_e_rx_idx);
#endif
#ifdef DEBUG_PSBCH #ifdef DEBUG_PSBCH
write_output("psbch_rxdataFcomp.m", "psbch_rxFcomp", psbch_unClipped, SL_NR_NUM_PSBCH_DATA_RE_IN_ALL_SYMBOLS, 1, 1); write_output("psbch_rxdataFcomp.m", "psbch_rxFcomp", psbch_unClipped, SL_NR_NUM_PSBCH_DATA_RE_IN_ALL_SYMBOLS, 1, 1);
......
...@@ -257,7 +257,8 @@ uint8_t nr_ue_pusch_common_procedures(PHY_VARS_NR_UE *UE, ...@@ -257,7 +257,8 @@ uint8_t nr_ue_pusch_common_procedures(PHY_VARS_NR_UE *UE,
const uint8_t slot, const uint8_t slot,
const NR_DL_FRAME_PARMS *frame_parms, const NR_DL_FRAME_PARMS *frame_parms,
const uint8_t n_antenna_ports, const uint8_t n_antenna_ports,
c16_t **txdataF); c16_t **txdataF,
uint32_t linktype);
void clean_UE_harq(PHY_VARS_NR_UE *UE); void clean_UE_harq(PHY_VARS_NR_UE *UE);
...@@ -429,7 +430,7 @@ void dump_nrdlsch(PHY_VARS_NR_UE *ue,uint8_t gNB_id,uint8_t nr_slot_rx,unsigned ...@@ -429,7 +430,7 @@ void dump_nrdlsch(PHY_VARS_NR_UE *ue,uint8_t gNB_id,uint8_t nr_slot_rx,unsigned
void nr_a_sum_b(c16_t *input_x, c16_t *input_y, unsigned short nb_rb); void nr_a_sum_b(c16_t *input_x, c16_t *input_y, unsigned short nb_rb);
int nr_rx_psbch(PHY_VARS_NR_UE *ue, int nr_rx_psbch(PHY_VARS_NR_UE *ue,
UE_nr_rxtx_proc_t *proc, const UE_nr_rxtx_proc_t *proc,
int estimateSz, int estimateSz,
struct complex16 dl_ch_estimates[][estimateSz], struct complex16 dl_ch_estimates[][estimateSz],
NR_DL_FRAME_PARMS *frame_parms, NR_DL_FRAME_PARMS *frame_parms,
......
...@@ -47,15 +47,7 @@ void nr_get_carrier_frequencies(PHY_VARS_NR_UE *ue, uint64_t *dl_carrier, uint64 ...@@ -47,15 +47,7 @@ void nr_get_carrier_frequencies(PHY_VARS_NR_UE *ue, uint64_t *dl_carrier, uint64
} }
void nr_get_carrier_frequencies_sl(PHY_VARS_NR_UE *ue, uint64_t *sl_carrier) {
NR_DL_FRAME_PARMS *fp = &ue->frame_parms;
if (ue->if_freq!=0) {
*sl_carrier = ue->if_freq;
} else {
*sl_carrier = fp->sl_CarrierFreq;
}
}
void nr_rf_card_config_gain(openair0_config_t *openair0_cfg, void nr_rf_card_config_gain(openair0_config_t *openair0_cfg,
double rx_gain_off){ double rx_gain_off){
......
...@@ -571,17 +571,20 @@ uint8_t nr_ue_pusch_common_procedures(PHY_VARS_NR_UE *UE, ...@@ -571,17 +571,20 @@ uint8_t nr_ue_pusch_common_procedures(PHY_VARS_NR_UE *UE,
const uint8_t slot, const uint8_t slot,
const NR_DL_FRAME_PARMS *frame_parms, const NR_DL_FRAME_PARMS *frame_parms,
const uint8_t n_antenna_ports, const uint8_t n_antenna_ports,
c16_t **txdataF) c16_t **txdataF,
uint32_t linktype)
{ {
const int tx_offset = frame_parms->get_samples_slot_timestamp(slot, frame_parms, 0); const int tx_offset = frame_parms->get_samples_slot_timestamp(slot, frame_parms, 0);
int N_RB = (linktype == link_type_sl) ? frame_parms->N_RB_SL : frame_parms->N_RB_UL;
c16_t **txdata = UE->common_vars.txData; c16_t **txdata = UE->common_vars.txData;
for(int ap = 0; ap < n_antenna_ports; ap++) { for(int ap = 0; ap < n_antenna_ports; ap++) {
apply_nr_rotation_TX(frame_parms, apply_nr_rotation_TX(frame_parms,
txdataF[ap], txdataF[ap],
frame_parms->symbol_rotation[1], frame_parms->symbol_rotation[linktype],
slot, slot,
frame_parms->N_RB_UL, N_RB,
0, 0,
NR_NUMBER_OF_SYMBOLS_PER_SLOT); NR_NUMBER_OF_SYMBOLS_PER_SLOT);
} }
......
...@@ -64,10 +64,11 @@ float Limits_KPI_gNB[4][2] = { ...@@ -64,10 +64,11 @@ float Limits_KPI_gNB[4][2] = {
@UE: These are the (default) lower and upper threshold values for BLER and Throughput at the UE side. @UE: These are the (default) lower and upper threshold values for BLER and Throughput at the UE side.
These threshold values can be further updated in run-time through the option 'Configs' in the drop-down list These threshold values can be further updated in run-time through the option 'Configs' in the drop-down list
*/ */
float Limits_KPI_ue[2][2] = { float Limits_KPI_ue[3][2] = {
// {lower Limit, Upper Limit} // {lower Limit, Upper Limit}
{0.0, 0.8}, // DL BLER {0.0, 0.8}, // DL BLER
{0.2, 10} // Throughput in Mbs {0.2, 10}, // Throughput in Mbs
{0, 60} // psbch RSRP db/RE
}; };
// Plot updater // Plot updater
...@@ -192,6 +193,9 @@ KPIListSelectUE::KPIListSelectUE(QWidget *parent) : QComboBox(parent) ...@@ -192,6 +193,9 @@ KPIListSelectUE::KPIListSelectUE(QWidget *parent) : QComboBox(parent)
this->addItem("Time Adv.", static_cast<int>(PlotTypeUE::timingAdvance)); this->addItem("Time Adv.", static_cast<int>(PlotTypeUE::timingAdvance));
this->addItem("Configs", static_cast<int>(PlotTypeUE::config)); this->addItem("Configs", static_cast<int>(PlotTypeUE::config));
this->addItem("LLR PSBCH", static_cast<int>(PlotTypeUE::psbchLLR));
this->addItem("I/Q PSBCH", static_cast<int>(PlotTypeUE::psbchIQ));
this->addItem("PSBCH RSRP dB/RE", static_cast<int>(PlotTypeUE::psbchRSRP));
} }
WaterFall::WaterFall(complex16 *values, NR_DL_FRAME_PARMS *frame_parms, QWidget *parent) WaterFall::WaterFall(complex16 *values, NR_DL_FRAME_PARMS *frame_parms, QWidget *parent)
...@@ -951,6 +955,9 @@ float PainterWidgetUE::getValue() ...@@ -951,6 +955,9 @@ float PainterWidgetUE::getValue()
case PlotTypeUE::timingAdvance: case PlotTypeUE::timingAdvance:
return (float)this->ue->timing_advance; return (float)this->ue->timing_advance;
case PlotTypeUE::psbchRSRP:
return (float)this->ue->SL_UE_PHY_PARAMS.psbch.rsrp_dB_per_RE;
default: default:
return 0; return 0;
} }
...@@ -960,15 +967,22 @@ scopeGraphData_t *PainterWidgetUE::getPlotValue() ...@@ -960,15 +967,22 @@ scopeGraphData_t *PainterWidgetUE::getPlotValue()
{ {
scopeData_t *scope = (scopeData_t *)this->ue->scopeData; scopeData_t *scope = (scopeData_t *)this->ue->scopeData;
scopeGraphData_t **data = (scopeGraphData_t **)scope->liveData; scopeGraphData_t **data = (scopeGraphData_t **)scope->liveData;
bool is_sl = this->ue->sl_mode;
switch (this->plotType) { switch (this->plotType) {
case PlotTypeUE::CIR: case PlotTypeUE::CIR:
return data[pbchDlChEstimateTime]; return (is_sl ? data[psbchDlChEstimateTime] : data[pbchDlChEstimateTime]);
case PlotTypeUE::pbchLLR: case PlotTypeUE::pbchLLR:
return data[pbchLlr]; return data[pbchLlr];
case PlotTypeUE::pbchIQ: case PlotTypeUE::pbchIQ:
return data[pbchRxdataF_comp]; return data[pbchRxdataF_comp];
case PlotTypeUE::psbchLLR:
return data[psbchLlr];
case PlotTypeUE::psbchIQ:
return data[psbchRxdataF_comp];
case PlotTypeUE::pdcchLLR: case PlotTypeUE::pdcchLLR:
return data[pdcchLlr]; return data[pdcchLlr];
...@@ -1039,13 +1053,14 @@ void PainterWidgetUE::makeConnections(int type) ...@@ -1039,13 +1053,14 @@ void PainterWidgetUE::makeConnections(int type)
break; break;
} }
case PlotTypeUE::CIR: { case PlotTypeUE::CIR: {
if (!data[pbchDlChEstimateTime]) { enum scopeDataType typ = (this->ue->sl_mode) ? psbchDlChEstimateTime : pbchDlChEstimateTime;
if (!data[typ]) {
newChart = new QChart(); newChart = new QChart();
this->plotType = PlotTypeUE::empty; this->plotType = PlotTypeUE::empty;
this->comboBox->setCurrentIndex(static_cast<int>(PlotTypeUE::empty)); this->comboBox->setCurrentIndex(static_cast<int>(PlotTypeUE::empty));
break; break;
} }
newChart = new CIRPlot((complex16 *)(data[pbchDlChEstimateTime] + 1), data[pbchDlChEstimateTime]->lineSz); newChart = new CIRPlot((complex16 *)(data[typ] + 1), data[typ]->lineSz);
break; break;
} }
...@@ -1069,6 +1084,26 @@ void PainterWidgetUE::makeConnections(int type) ...@@ -1069,6 +1084,26 @@ void PainterWidgetUE::makeConnections(int type)
newChart = new IQPlotUE((complex16 *)(data[pbchRxdataF_comp] + 1), data[pbchRxdataF_comp]->lineSz, this); newChart = new IQPlotUE((complex16 *)(data[pbchRxdataF_comp] + 1), data[pbchRxdataF_comp]->lineSz, this);
break; break;
} }
case PlotTypeUE::psbchLLR: {
if (!data[psbchLlr]) {
newChart = new QChart();
this->plotType = PlotTypeUE::empty;
this->comboBox->setCurrentIndex(static_cast<int>(PlotTypeUE::empty));
break;
}
newChart = new LLRPlotUE((int16_t *)(data[psbchLlr] + 1), data[psbchLlr]->lineSz, this);
break;
}
case PlotTypeUE::psbchIQ: {
if (!data[psbchRxdataF_comp]) {
newChart = new QChart();
this->plotType = PlotTypeUE::empty;
this->comboBox->setCurrentIndex(static_cast<int>(PlotTypeUE::empty));
break;
}
newChart = new IQPlotUE((complex16 *)(data[psbchRxdataF_comp] + 1), data[psbchRxdataF_comp]->lineSz, this);
break;
}
case PlotTypeUE::pdcchLLR: { case PlotTypeUE::pdcchLLR: {
if (!data[pdcchLlr]) { if (!data[pdcchLlr]) {
newChart = new QChart(); newChart = new QChart();
...@@ -1138,7 +1173,10 @@ void PainterWidgetUE::makeConnections(int type) ...@@ -1138,7 +1173,10 @@ void PainterWidgetUE::makeConnections(int type)
newChart = new KPIPlot(this); newChart = new KPIPlot(this);
break; break;
} }
case PlotTypeUE::psbchRSRP: {
newChart = new KPIPlot(this, Limits_KPI_ue[2]);
break;
}
default: default:
break; break;
} }
...@@ -1223,6 +1261,7 @@ void *nrgNBQtscopeThread(void *arg) ...@@ -1223,6 +1261,7 @@ void *nrgNBQtscopeThread(void *arg)
void *nrUEQtscopeThread(void *arg) void *nrUEQtscopeThread(void *arg)
{ {
PHY_VARS_NR_UE *ue = (PHY_VARS_NR_UE *)arg; PHY_VARS_NR_UE *ue = (PHY_VARS_NR_UE *)arg;
bool is_sl = ue->sl_mode;
sleep(1); sleep(1);
...@@ -1256,14 +1295,20 @@ void *nrUEQtscopeThread(void *arg) ...@@ -1256,14 +1295,20 @@ void *nrUEQtscopeThread(void *arg)
mainLayout.addWidget(&pwidgetueCombo2, 1, 1); mainLayout.addWidget(&pwidgetueCombo2, 1, 1);
KPIListSelectUE combo3; KPIListSelectUE combo3;
combo3.setCurrentIndex(static_cast<int>(PlotTypeUE::pbchLLR)); if (is_sl)
combo3.setCurrentIndex(static_cast<int>(PlotTypeUE::psbchLLR));
else
combo3.setCurrentIndex(static_cast<int>(PlotTypeUE::psbchLLR));
PainterWidgetUE pwidgetueCombo3(&config, &combo3, ue); PainterWidgetUE pwidgetueCombo3(&config, &combo3, ue);
mainLayout.addWidget(&combo3, 2, 0); mainLayout.addWidget(&combo3, 2, 0);
mainLayout.addWidget(&pwidgetueCombo3, 3, 0); mainLayout.addWidget(&pwidgetueCombo3, 3, 0);
KPIListSelectUE combo4; KPIListSelectUE combo4;
combo4.setCurrentIndex(static_cast<int>(PlotTypeUE::pbchIQ)); if (is_sl)
combo4.setCurrentIndex(static_cast<int>(PlotTypeUE::psbchIQ));
else
combo4.setCurrentIndex(static_cast<int>(PlotTypeUE::psbchIQ));
PainterWidgetUE pwidgetueCombo4(&config, &combo4, ue); PainterWidgetUE pwidgetueCombo4(&config, &combo4, ue);
mainLayout.addWidget(&combo4, 2, 1); mainLayout.addWidget(&combo4, 2, 1);
......
...@@ -81,7 +81,10 @@ enum class PlotTypeUE { ...@@ -81,7 +81,10 @@ enum class PlotTypeUE {
pdschRBs, pdschRBs,
frequencyOffset, frequencyOffset,
timingAdvance, timingAdvance,
config config,
psbchLLR,
psbchIQ,
psbchRSRP,
}; };
/// This abstract class defines an interface how the KPIPlot class can access values for the different KPI plot types /// This abstract class defines an interface how the KPIPlot class can access values for the different KPI plot types
......
...@@ -786,14 +786,14 @@ static void ueTimeResponse (OAIgraph_t *graph, PHY_VARS_NR_UE *phy_vars_ue, int ...@@ -786,14 +786,14 @@ static void ueTimeResponse (OAIgraph_t *graph, PHY_VARS_NR_UE *phy_vars_ue, int
*/ */
static void ueChannelResponse (scopeGraphData_t **data, OAIgraph_t *graph, PHY_VARS_NR_UE *phy_vars_ue, int eNB_id, int UE_id) { static void ueChannelResponse (scopeGraphData_t **data, OAIgraph_t *graph, PHY_VARS_NR_UE *phy_vars_ue, int eNB_id, int UE_id) {
enum scopeDataType typ = (phy_vars_ue->sl_mode) ? psbchDlChEstimateTime : pbchDlChEstimateTime;
// Channel Impulse Response // Channel Impulse Response
if (!data[pbchDlChEstimateTime]) if (!data[typ])
return; return;
const scopeSample_t *tmp=(scopeSample_t *)(data[pbchDlChEstimateTime]+1); const scopeSample_t *tmp = (scopeSample_t *)(data[typ] + 1);
genericPowerPerAntena(graph, data[pbchDlChEstimateTime]->colSz, genericPowerPerAntena(graph, data[typ]->colSz, &tmp, data[typ]->lineSz);
&tmp,
data[pbchDlChEstimateTime]->lineSz);
} }
static void ueFreqWaterFall (scopeGraphData_t **data, OAIgraph_t *graph,PHY_VARS_NR_UE *phy_vars_ue, int eNB_id, int UE_id ) { static void ueFreqWaterFall (scopeGraphData_t **data, OAIgraph_t *graph,PHY_VARS_NR_UE *phy_vars_ue, int eNB_id, int UE_id ) {
...@@ -847,14 +847,16 @@ static void uePbchFrequencyResp (OAIgraph_t *graph, PHY_VARS_NR_UE *phy_vars_ue ...@@ -847,14 +847,16 @@ static void uePbchFrequencyResp (OAIgraph_t *graph, PHY_VARS_NR_UE *phy_vars_ue
} }
*/ */
static void uePbchLLR (scopeGraphData_t **data, OAIgraph_t *graph, PHY_VARS_NR_UE *phy_vars_ue, int eNB_id, int UE_id) { static void uePbchLLR (scopeGraphData_t **data, OAIgraph_t *graph, PHY_VARS_NR_UE *phy_vars_ue, int eNB_id, int UE_id) {
enum scopeDataType typ = (phy_vars_ue->sl_mode) ? psbchLlr : pbchLlr;
// PBCH LLRs // PBCH LLRs
if ( !data[pbchLlr]) if (!data[typ])
return; return;
const int sz=data[pbchLlr]->lineSz; const int sz = data[typ]->lineSz;
//const int antennas=data[pbchLlr]->colSz; // const int antennas=data[typ]->colSz;
// We take the first antenna only for now // We take the first antenna only for now
int16_t *llrs = (int16_t *) (data[pbchLlr]+1); int16_t *llrs = (int16_t *)(data[typ] + 1);
float *llr_pbch=NULL, *bit_pbch=NULL; float *llr_pbch=NULL, *bit_pbch=NULL;
int nx = sz; int nx = sz;
#ifdef WEBSRVSCOPE #ifdef WEBSRVSCOPE
...@@ -870,12 +872,14 @@ static void uePbchLLR (scopeGraphData_t **data, OAIgraph_t *graph, PHY_VARS_NR_ ...@@ -870,12 +872,14 @@ static void uePbchLLR (scopeGraphData_t **data, OAIgraph_t *graph, PHY_VARS_NR_
} }
static void uePbchIQ (scopeGraphData_t **data, OAIgraph_t *graph, PHY_VARS_NR_UE *phy_vars_ue, int eNB_id, int UE_id) { static void uePbchIQ (scopeGraphData_t **data, OAIgraph_t *graph, PHY_VARS_NR_UE *phy_vars_ue, int eNB_id, int UE_id) {
enum scopeDataType typ = (phy_vars_ue->sl_mode) ? psbchRxdataF_comp : pbchRxdataF_comp;
// PBCH I/Q of MF Output // PBCH I/Q of MF Output
if (!data[pbchRxdataF_comp]) if (!data[typ])
return; return;
scopeSample_t *pbch_comp = (scopeSample_t *) (data[pbchRxdataF_comp]+1); scopeSample_t *pbch_comp = (scopeSample_t *)(data[typ] + 1);
const int sz=data[pbchRxdataF_comp]->lineSz; const int sz = data[typ]->lineSz;
int newsz = sz; int newsz = sz;
float *I=NULL, *Q=NULL; float *I=NULL, *Q=NULL;
#ifdef WEBSRVSCOPE #ifdef WEBSRVSCOPE
......
...@@ -67,6 +67,9 @@ enum scopeDataType { ...@@ -67,6 +67,9 @@ enum scopeDataType {
pdschRxdataF_comp, pdschRxdataF_comp,
commonRxdataF, commonRxdataF,
gNBRxdataF, gNBRxdataF,
psbchDlChEstimateTime,
psbchLlr,
psbchRxdataF_comp,
MAX_SCOPE_TYPES MAX_SCOPE_TYPES
}; };
......
...@@ -70,6 +70,7 @@ ...@@ -70,6 +70,7 @@
#define SL_NR_NUM_IDs_IN_PSS 2 #define SL_NR_NUM_IDs_IN_PSS 2
#define SL_NR_NUM_IDs_IN_SSS 336 #define SL_NR_NUM_IDs_IN_SSS 336
#define SL_NR_NUM_SLSS_IDs 672 #define SL_NR_NUM_SLSS_IDs 672
#define SL_NR_PSBCH_REPETITION_IN_FRAMES 16
typedef enum sl_nr_sidelink_mode { SL_NOT_SUPPORTED = 0, SL_MODE1_SUPPORTED, SL_MODE2_SUPPORTED } sl_nr_sidelink_mode_t; typedef enum sl_nr_sidelink_mode { SL_NOT_SUPPORTED = 0, SL_MODE1_SUPPORTED, SL_MODE2_SUPPORTED } sl_nr_sidelink_mode_t;
......
...@@ -85,6 +85,7 @@ SystemInformationBlockType1_nr_t; ...@@ -85,6 +85,7 @@ SystemInformationBlockType1_nr_t;
#define NR_DOWNLINK_SLOT (0x01) #define NR_DOWNLINK_SLOT (0x01)
#define NR_UPLINK_SLOT (0x02) #define NR_UPLINK_SLOT (0x02)
#define NR_MIXED_SLOT (0x03) #define NR_MIXED_SLOT (0x03)
#define NR_SIDELINK_SLOT NR_UPLINK_SLOT
#define FRAME_DURATION_MICRO_SEC (10000) /* frame duration in microsecond */ #define FRAME_DURATION_MICRO_SEC (10000) /* frame duration in microsecond */
......
...@@ -157,21 +157,21 @@ void nr_ue_csi_rs_procedures(PHY_VARS_NR_UE *ue, ...@@ -157,21 +157,21 @@ void nr_ue_csi_rs_procedures(PHY_VARS_NR_UE *ue,
const UE_nr_rxtx_proc_t *proc, const UE_nr_rxtx_proc_t *proc,
c16_t rxdataF[][ue->frame_parms.samples_per_slot_wCP]); c16_t rxdataF[][ue->frame_parms.samples_per_slot_wCP]);
int psbch_pscch_processing(PHY_VARS_NR_UE *ue, UE_nr_rxtx_proc_t *proc, nr_phy_data_t *phy_data); int psbch_pscch_processing(PHY_VARS_NR_UE *ue, const UE_nr_rxtx_proc_t *proc, nr_phy_data_t *phy_data);
int phy_procedures_nrUE_SL_TX(PHY_VARS_NR_UE *ue, UE_nr_rxtx_proc_t *proc, nr_phy_data_tx_t *phy_data); void phy_procedures_nrUE_SL_TX(PHY_VARS_NR_UE *ue, const UE_nr_rxtx_proc_t *proc, nr_phy_data_tx_t *phy_data);
/*! \brief This function prepares the sl indication to pass to the MAC /*! \brief This function prepares the sl indication to pass to the MAC
*/ */
void nr_fill_sl_indication(nr_sidelink_indication_t *sl_ind, void nr_fill_sl_indication(nr_sidelink_indication_t *sl_ind,
sl_nr_rx_indication_t *rx_ind, sl_nr_rx_indication_t *rx_ind,
sl_nr_sci_indication_t *sci_ind, sl_nr_sci_indication_t *sci_ind,
UE_nr_rxtx_proc_t *proc, const UE_nr_rxtx_proc_t *proc,
PHY_VARS_NR_UE *ue, PHY_VARS_NR_UE *ue,
void *phy_data); void *phy_data);
void nr_fill_sl_rx_indication(sl_nr_rx_indication_t *rx_ind, void nr_fill_sl_rx_indication(sl_nr_rx_indication_t *rx_ind,
uint8_t pdu_type, uint8_t pdu_type,
PHY_VARS_NR_UE *ue, PHY_VARS_NR_UE *ue,
uint16_t n_pdus, uint16_t n_pdus,
UE_nr_rxtx_proc_t *proc, const UE_nr_rxtx_proc_t *proc,
void *typeSpecific, void *typeSpecific,
uint16_t rx_slss_id); uint16_t rx_slss_id);
......
...@@ -298,7 +298,15 @@ static void configure_dlsch(NR_UE_DLSCH_t *dlsch0, ...@@ -298,7 +298,15 @@ static void configure_dlsch(NR_UE_DLSCH_t *dlsch0,
//get nrOfLayers from DCI info //get nrOfLayers from DCI info
uint8_t Nl = 0; uint8_t Nl = 0;
for (int i = 0; i < 12; i++) { // max 12 ports for (int i = 0; i < 12; i++) { // max 12 ports
if ((dlsch_config_pdu->dmrs_ports>>i)&0x01) Nl += 1; if ((dlsch_config_pdu->dmrs_ports >> i) & 0x01)
Nl += 1;
}
if (Nl == 0) {
LOG_E(PHY, "Invalid number of layers %d for DLSCH\n", Nl);
// setting NACK for this TB
dlsch0->active = false;
update_harq_status(mac, current_harq_pid, 0);
return;
} }
dlsch0->Nl = Nl; dlsch0->Nl = Nl;
if (dlsch_config_pdu->new_data_indicator) { if (dlsch_config_pdu->new_data_indicator) {
...@@ -456,7 +464,7 @@ static void nr_ue_scheduled_response_ul(PHY_VARS_NR_UE *phy, fapi_nr_ul_config_r ...@@ -456,7 +464,7 @@ static void nr_ue_scheduled_response_ul(PHY_VARS_NR_UE *phy, fapi_nr_ul_config_r
NR_UL_UE_HARQ_t *harq_process_ul_ue = &phy->ul_harq_processes[current_harq_pid]; NR_UL_UE_HARQ_t *harq_process_ul_ue = &phy->ul_harq_processes[current_harq_pid];
nfapi_nr_ue_pusch_pdu_t *pusch_pdu = &phy_data->ulsch.pusch_pdu; nfapi_nr_ue_pusch_pdu_t *pusch_pdu = &phy_data->ulsch.pusch_pdu;
LOG_D(PHY, LOG_D(PHY,
"copy pusch_config_pdu nrOfLayers:%d, num_dmrs_cdm_grps_no_data:%d \n", "copy pusch_config_pdu nrOfLayers: %d, num_dmrs_cdm_grps_no_data: %d\n",
pdu->pusch_config_pdu.nrOfLayers, pdu->pusch_config_pdu.nrOfLayers,
pdu->pusch_config_pdu.num_dmrs_cdm_grps_no_data); pdu->pusch_config_pdu.num_dmrs_cdm_grps_no_data);
...@@ -523,7 +531,8 @@ static void nr_ue_scheduled_response_ul(PHY_VARS_NR_UE *phy, fapi_nr_ul_config_r ...@@ -523,7 +531,8 @@ static void nr_ue_scheduled_response_ul(PHY_VARS_NR_UE *phy, fapi_nr_ul_config_r
int8_t nr_ue_scheduled_response(nr_scheduled_response_t *scheduled_response) int8_t nr_ue_scheduled_response(nr_scheduled_response_t *scheduled_response)
{ {
PHY_VARS_NR_UE *phy = PHY_vars_UE_g[scheduled_response->module_id][scheduled_response->CC_id]; PHY_VARS_NR_UE *phy = PHY_vars_UE_g[scheduled_response->module_id][scheduled_response->CC_id];
AssertFatal(!scheduled_response->dl_config || !scheduled_response->ul_config, AssertFatal(!scheduled_response->dl_config || !scheduled_response->ul_config || !scheduled_response->sl_rx_config
|| !scheduled_response->sl_tx_config,
"phy_data parameter will be cast to two different types!\n"); "phy_data parameter will be cast to two different types!\n");
if (scheduled_response->dl_config) if (scheduled_response->dl_config)
...@@ -533,6 +542,11 @@ int8_t nr_ue_scheduled_response(nr_scheduled_response_t *scheduled_response) ...@@ -533,6 +542,11 @@ int8_t nr_ue_scheduled_response(nr_scheduled_response_t *scheduled_response)
(nr_phy_data_t *)scheduled_response->phy_data); (nr_phy_data_t *)scheduled_response->phy_data);
if (scheduled_response->ul_config) if (scheduled_response->ul_config)
nr_ue_scheduled_response_ul(phy, scheduled_response->ul_config, (nr_phy_data_tx_t *)scheduled_response->phy_data); nr_ue_scheduled_response_ul(phy, scheduled_response->ul_config, (nr_phy_data_tx_t *)scheduled_response->phy_data);
if (scheduled_response->sl_rx_config || scheduled_response->sl_tx_config) {
sl_handle_scheduled_response(scheduled_response);
}
return 0; return 0;
} }
...@@ -552,3 +566,78 @@ void nr_ue_synch_request(nr_synch_request_t *synch_request) ...@@ -552,3 +566,78 @@ void nr_ue_synch_request(nr_synch_request_t *synch_request)
PHY_vars_UE_g[synch_request->Mod_id][synch_request->CC_id]->synch_request.received_synch_request = 1; PHY_vars_UE_g[synch_request->Mod_id][synch_request->CC_id]->synch_request.received_synch_request = 1;
} }
void nr_ue_sl_phy_config_request(nr_sl_phy_config_t *phy_config)
{
sl_nr_phy_config_request_t *sl_config = &PHY_vars_UE_g[phy_config->Mod_id][phy_config->CC_id]->SL_UE_PHY_PARAMS.sl_config;
if (phy_config != NULL) {
memcpy(sl_config, &phy_config->sl_config_req, sizeof(sl_nr_phy_config_request_t));
}
}
/*
* MAC sends the scheduled response with either TX configrequest for Sidelink Transmission requests
* or RX config request for Sidelink Reception requests.
* This procedure handles these TX/RX config requests received in this slot and configures PHY
* with a TTI action to be performed in this slot(TTI)
*/
void sl_handle_scheduled_response(nr_scheduled_response_t *scheduled_response)
{
module_id_t module_id = scheduled_response->module_id;
const char *sl_rx_action[] = {"NONE", "RX_PSBCH", "RX_PSCCH", "RX_SCI2_ON_PSSCH", "RX_SLSCH_ON_PSSCH"};
const char *sl_tx_action[] = {"TX_PSBCH", "TX_PSCCH_PSSCH", "TX_PSFCH"};
if (scheduled_response->sl_rx_config != NULL) {
sl_nr_rx_config_request_t *sl_rx_config = scheduled_response->sl_rx_config;
nr_phy_data_t *phy_data = (nr_phy_data_t *)scheduled_response->phy_data;
AssertFatal(sl_rx_config->number_pdus == SL_NR_RX_CONFIG_LIST_NUM, "sl_rx_config->number_pdus incorrect\n");
switch (sl_rx_config->sl_rx_config_list[0].pdu_type) {
case SL_NR_CONFIG_TYPE_RX_PSBCH:
phy_data->sl_rx_action = SL_NR_CONFIG_TYPE_RX_PSBCH;
LOG_D(PHY, "Recvd CONFIG_TYPE_RX_PSBCH\n");
break;
default:
AssertFatal(0, "Incorrect sl_rx config req pdutype \n");
break;
}
LOG_D(PHY,
"[UE%d] TTI %d:%d, SL-RX action:%s\n",
module_id,
sl_rx_config->sfn,
sl_rx_config->slot,
sl_rx_action[phy_data->sl_rx_action]);
} else if (scheduled_response->sl_tx_config != NULL) {
sl_nr_tx_config_request_t *sl_tx_config = scheduled_response->sl_tx_config;
nr_phy_data_tx_t *phy_data_tx = (nr_phy_data_tx_t *)scheduled_response->phy_data;
AssertFatal(sl_tx_config->number_pdus == SL_NR_TX_CONFIG_LIST_NUM, "sl_tx_config->number_pdus incorrect \n");
switch (sl_tx_config->tx_config_list[0].pdu_type) {
case SL_NR_CONFIG_TYPE_TX_PSBCH:
phy_data_tx->sl_tx_action = SL_NR_CONFIG_TYPE_TX_PSBCH;
LOG_D(PHY, "Recvd CONFIG_TYPE_TX_PSBCH\n");
*((uint32_t *)phy_data_tx->psbch_vars.psbch_payload) =
*((uint32_t *)sl_tx_config->tx_config_list[0].tx_psbch_config_pdu.psbch_payload);
phy_data_tx->psbch_vars.psbch_tx_power = sl_tx_config->tx_config_list[0].tx_psbch_config_pdu.psbch_tx_power;
phy_data_tx->psbch_vars.tx_slss_id = sl_tx_config->tx_config_list[0].tx_psbch_config_pdu.tx_slss_id;
break;
default:
AssertFatal(0, "Incorrect sl_tx config req pdutype \n");
break;
}
LOG_D(PHY,
"[UE%d] TTI %d:%d, SL-TX action:%s slss_id:%d, sl-mib:%x, psbch pwr:%d\n",
module_id,
sl_tx_config->sfn,
sl_tx_config->slot,
sl_tx_action[phy_data_tx->sl_tx_action - 6],
phy_data_tx->psbch_vars.tx_slss_id,
*((uint32_t *)phy_data_tx->psbch_vars.psbch_payload),
phy_data_tx->psbch_vars.psbch_tx_power);
}
}
...@@ -40,12 +40,14 @@ ...@@ -40,12 +40,14 @@
/**\brief NR UE FAPI-like P7 messages, scheduled response from L2 indicating L1 /**\brief NR UE FAPI-like P7 messages, scheduled response from L2 indicating L1
\param scheduled_response including transmission config(dl_config, ul_config) and data transmission (tx_req)*/ \param scheduled_response including transmission config(dl_config, ul_config) and data transmission (tx_req)*/
int8_t nr_ue_scheduled_response(nr_scheduled_response_t *scheduled_response); int8_t nr_ue_scheduled_response(nr_scheduled_response_t *scheduled_response);
void sl_handle_scheduled_response(nr_scheduled_response_t *scheduled_response);
int8_t nr_ue_scheduled_response_stub(nr_scheduled_response_t *scheduled_response); int8_t nr_ue_scheduled_response_stub(nr_scheduled_response_t *scheduled_response);
/**\brief NR UE FAPI-like P5 message, physical configuration from L2 to configure L1 /**\brief NR UE FAPI-like P5 message, physical configuration from L2 to configure L1
\param scheduled_response including transmission config(dl_config, ul_config) and data transmission (tx_req)*/ \param scheduled_response including transmission config(dl_config, ul_config) and data transmission (tx_req)*/
int8_t nr_ue_phy_config_request(nr_phy_config_t *phy_config); int8_t nr_ue_phy_config_request(nr_phy_config_t *phy_config);
void nr_ue_sl_phy_config_request(nr_sl_phy_config_t *phy_config);
/**\brief NR UE FAPI message to schedule a synchronization with target gNB /**\brief NR UE FAPI message to schedule a synchronization with target gNB
\param synch_request including target_Nid_cell*/ \param synch_request including target_Nid_cell*/
......
...@@ -76,3 +76,67 @@ int nr_ue_slot_select(fapi_nr_config_request_t *cfg, int nr_slot) ...@@ -76,3 +76,67 @@ int nr_ue_slot_select(fapi_nr_config_request_t *cfg, int nr_slot)
// if here, all the symbols where DL // if here, all the symbols where DL
return NR_DOWNLINK_SLOT; return NR_DOWNLINK_SLOT;
} }
/*
* This function determines if the mixed slot is a Sidelink slot
*/
uint8_t sl_determine_if_sidelink_slot(uint8_t sl_startsym, uint8_t sl_lensym, uint8_t num_ulsym)
{
uint8_t ul_startsym = NR_NUMBER_OF_SYMBOLS_PER_SLOT - num_ulsym;
if ((sl_startsym >= ul_startsym) && (sl_lensym <= NR_NUMBER_OF_SYMBOLS_PER_SLOT)) {
LOG_D(MAC,
"MIXED SLOT is a SIDELINK SLOT. Sidelink Symbols: %d-%d, Uplink Symbols: %d-%d\n",
sl_startsym,
sl_lensym - 1,
ul_startsym,
ul_startsym + num_ulsym - 1);
return NR_SIDELINK_SLOT;
} else {
LOG_D(MAC,
"MIXED SLOT is NOT SIDELINK SLOT. Sidelink Symbols: %d-%d, Uplink Symbols: %d-%d\n",
sl_startsym,
sl_lensym - 1,
ul_startsym,
ul_startsym + num_ulsym - 1);
return 0;
}
}
/*
* This function determines if the Slot is a SIDELINK SLOT
* Every Uplink Slot is a Sidelink slot
* Mixed Slot is a sidelink slot if the uplink symbols in Mixed slot
* overlaps with Sidelink start symbol and number of symbols.
*/
int sl_nr_ue_slot_select(sl_nr_phy_config_request_t *cfg, int slot, uint8_t frame_duplex_type)
{
int ul_sym = 0, slot_type = 0;
// All PC5 bands are TDD bands , hence handling only TDD in this function.
AssertFatal(frame_duplex_type == TDD, "No Sidelink operation defined for FDD in 3GPP rel16\n");
if (cfg->tdd_table.max_tdd_periodicity_list == NULL) { // this happens before receiving TDD configuration
return slot_type;
}
int period = cfg->tdd_table.tdd_period_in_slots;
int rel_slot = slot % period;
fapi_nr_tdd_table_t *tdd_table = &cfg->tdd_table;
fapi_nr_max_tdd_periodicity_t *current_slot = &tdd_table->max_tdd_periodicity_list[rel_slot];
for (int symbol_count = 0; symbol_count < NR_NUMBER_OF_SYMBOLS_PER_SLOT; symbol_count++) {
if (current_slot->max_num_of_symbol_per_slot_list[symbol_count].slot_config == 1) {
ul_sym++;
}
}
if (ul_sym == NR_NUMBER_OF_SYMBOLS_PER_SLOT) {
slot_type = NR_SIDELINK_SLOT;
} else if (ul_sym) {
slot_type = sl_determine_if_sidelink_slot(cfg->sl_bwp_config.sl_start_symbol, cfg->sl_bwp_config.sl_num_symbols, ul_sym);
}
return slot_type;
}
\ No newline at end of file
...@@ -288,7 +288,12 @@ void phy_procedures_nrUE_TX(PHY_VARS_NR_UE *ue, const UE_nr_rxtx_proc_t *proc, n ...@@ -288,7 +288,12 @@ void phy_procedures_nrUE_TX(PHY_VARS_NR_UE *ue, const UE_nr_rxtx_proc_t *proc, n
pucch_procedures_ue_nr(ue, proc, phy_data, (c16_t **)&txdataF); pucch_procedures_ue_nr(ue, proc, phy_data, (c16_t **)&txdataF);
LOG_D(PHY, "Sending Uplink data \n"); LOG_D(PHY, "Sending Uplink data \n");
nr_ue_pusch_common_procedures(ue, proc->nr_slot_tx, &ue->frame_parms, ue->frame_parms.nb_antennas_tx, (c16_t **)txdataF); nr_ue_pusch_common_procedures(ue,
proc->nr_slot_tx,
&ue->frame_parms,
ue->frame_parms.nb_antennas_tx,
(c16_t **)txdataF,
link_type_ul);
nr_ue_prach_procedures(ue, proc); nr_ue_prach_procedures(ue, proc);
......
...@@ -35,7 +35,7 @@ ...@@ -35,7 +35,7 @@
void nr_fill_sl_indication(nr_sidelink_indication_t *sl_ind, void nr_fill_sl_indication(nr_sidelink_indication_t *sl_ind,
sl_nr_rx_indication_t *rx_ind, sl_nr_rx_indication_t *rx_ind,
sl_nr_sci_indication_t *sci_ind, sl_nr_sci_indication_t *sci_ind,
UE_nr_rxtx_proc_t *proc, const UE_nr_rxtx_proc_t *proc,
PHY_VARS_NR_UE *ue, PHY_VARS_NR_UE *ue,
void *phy_data) void *phy_data)
{ {
...@@ -49,6 +49,7 @@ void nr_fill_sl_indication(nr_sidelink_indication_t *sl_ind, ...@@ -49,6 +49,7 @@ void nr_fill_sl_indication(nr_sidelink_indication_t *sl_ind,
sl_ind->frame_tx = proc->frame_tx; sl_ind->frame_tx = proc->frame_tx;
sl_ind->slot_tx = proc->nr_slot_tx; sl_ind->slot_tx = proc->nr_slot_tx;
sl_ind->phy_data = phy_data; sl_ind->phy_data = phy_data;
sl_ind->slot_type = SIDELINK_SLOT_TYPE_RX;
if (rx_ind) { if (rx_ind) {
sl_ind->rx_ind = rx_ind; // hang on rx_ind instance sl_ind->rx_ind = rx_ind; // hang on rx_ind instance
...@@ -64,12 +65,12 @@ void nr_fill_sl_rx_indication(sl_nr_rx_indication_t *rx_ind, ...@@ -64,12 +65,12 @@ void nr_fill_sl_rx_indication(sl_nr_rx_indication_t *rx_ind,
uint8_t pdu_type, uint8_t pdu_type,
PHY_VARS_NR_UE *ue, PHY_VARS_NR_UE *ue,
uint16_t n_pdus, uint16_t n_pdus,
UE_nr_rxtx_proc_t *proc, const UE_nr_rxtx_proc_t *proc,
void *typeSpecific, void *typeSpecific,
uint16_t rx_slss_id) uint16_t rx_slss_id)
{ {
if (n_pdus > 1) { if (n_pdus > 1) {
LOG_E(PHY, "In %s: multiple number of SL PDUs not supported yet...\n", __FUNCTION__); LOG_E(NR_PHY, "In %s: multiple number of SL PDUs not supported yet...\n", __FUNCTION__);
} }
sl_nr_ue_phy_params_t *sl_phy_params = &ue->SL_UE_PHY_PARAMS; sl_nr_ue_phy_params_t *sl_phy_params = &ue->SL_UE_PHY_PARAMS;
...@@ -85,7 +86,7 @@ void nr_fill_sl_rx_indication(sl_nr_rx_indication_t *rx_ind, ...@@ -85,7 +86,7 @@ void nr_fill_sl_rx_indication(sl_nr_rx_indication_t *rx_ind,
ssb_pdu->rsrp_dbm = sl_phy_params->psbch.rsrp_dBm_per_RE; ssb_pdu->rsrp_dbm = sl_phy_params->psbch.rsrp_dBm_per_RE;
ssb_pdu->rx_slss_id = rx_slss_id; ssb_pdu->rx_slss_id = rx_slss_id;
ssb_pdu->decode_status = true; ssb_pdu->decode_status = true;
LOG_D(PHY, LOG_D(NR_PHY,
"SL-IND: SSB to MAC. rsrp:%d, slssid:%d, payload:%x\n", "SL-IND: SSB to MAC. rsrp:%d, slssid:%d, payload:%x\n",
ssb_pdu->rsrp_dbm, ssb_pdu->rsrp_dbm,
ssb_pdu->rx_slss_id, ssb_pdu->rx_slss_id,
...@@ -103,7 +104,7 @@ void nr_fill_sl_rx_indication(sl_nr_rx_indication_t *rx_ind, ...@@ -103,7 +104,7 @@ void nr_fill_sl_rx_indication(sl_nr_rx_indication_t *rx_ind,
static int nr_ue_psbch_procedures(PHY_VARS_NR_UE *ue, static int nr_ue_psbch_procedures(PHY_VARS_NR_UE *ue,
NR_DL_FRAME_PARMS *fp, NR_DL_FRAME_PARMS *fp,
UE_nr_rxtx_proc_t *proc, const UE_nr_rxtx_proc_t *proc,
int estimateSz, int estimateSz,
struct complex16 dl_ch_estimates[][estimateSz], struct complex16 dl_ch_estimates[][estimateSz],
nr_phy_data_t *phy_data, nr_phy_data_t *phy_data,
...@@ -120,7 +121,7 @@ static int nr_ue_psbch_procedures(PHY_VARS_NR_UE *ue, ...@@ -120,7 +121,7 @@ static int nr_ue_psbch_procedures(PHY_VARS_NR_UE *ue,
// VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_PSBCH_PROCEDURES, VCD_FUNCTION_IN); // VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_PSBCH_PROCEDURES, VCD_FUNCTION_IN);
LOG_D(PHY, LOG_D(NR_PHY,
"[UE %d] Frame %d Slot %d, Trying PSBCH (SLSS ID %d)\n", "[UE %d] Frame %d Slot %d, Trying PSBCH (SLSS ID %d)\n",
ue->Mod_id, ue->Mod_id,
frame_rx, frame_rx,
...@@ -144,11 +145,11 @@ static int nr_ue_psbch_procedures(PHY_VARS_NR_UE *ue, ...@@ -144,11 +145,11 @@ static int nr_ue_psbch_procedures(PHY_VARS_NR_UE *ue,
uint8_t *result = NULL; uint8_t *result = NULL;
if (ret) { if (ret) {
sl_phy_params->psbch.rx_errors++; sl_phy_params->psbch.rx_errors++;
LOG_E(PHY, "%d:%d PSBCH RX: NOK \n", proc->frame_rx, proc->nr_slot_rx); LOG_E(NR_PHY, "%d:%d PSBCH RX: NOK \n", proc->frame_rx, proc->nr_slot_rx);
} else { } else {
result = decoded_pdu; result = decoded_pdu;
sl_phy_params->psbch.rx_ok++; sl_phy_params->psbch.rx_ok++;
LOG_D(PHY, "%d:%d PSBCH RX: OK \n", proc->frame_rx, proc->nr_slot_rx); LOG_I(NR_PHY, "%d:%d PSBCH RX:OK. RSRP: %d dB/RE\n", proc->frame_rx, proc->nr_slot_rx, sl_phy_params->psbch.rsrp_dB_per_RE);
} }
nr_fill_sl_indication(&sl_indication, &rx_ind, NULL, proc, ue, phy_data); nr_fill_sl_indication(&sl_indication, &rx_ind, NULL, proc, ue, phy_data);
...@@ -161,7 +162,7 @@ static int nr_ue_psbch_procedures(PHY_VARS_NR_UE *ue, ...@@ -161,7 +162,7 @@ static int nr_ue_psbch_procedures(PHY_VARS_NR_UE *ue,
return ret; return ret;
} }
int psbch_pscch_processing(PHY_VARS_NR_UE *ue, UE_nr_rxtx_proc_t *proc, nr_phy_data_t *phy_data) int psbch_pscch_processing(PHY_VARS_NR_UE *ue, const UE_nr_rxtx_proc_t *proc, nr_phy_data_t *phy_data)
{ {
int frame_rx = proc->frame_rx; int frame_rx = proc->frame_rx;
int nr_slot_rx = proc->nr_slot_rx; int nr_slot_rx = proc->nr_slot_rx;
...@@ -172,7 +173,7 @@ int psbch_pscch_processing(PHY_VARS_NR_UE *ue, UE_nr_rxtx_proc_t *proc, nr_phy_d ...@@ -172,7 +173,7 @@ int psbch_pscch_processing(PHY_VARS_NR_UE *ue, UE_nr_rxtx_proc_t *proc, nr_phy_d
// VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_UE_RX_SL, VCD_FUNCTION_IN); // VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_UE_RX_SL, VCD_FUNCTION_IN);
start_meas(&sl_phy_params->phy_proc_sl_rx); start_meas(&sl_phy_params->phy_proc_sl_rx);
LOG_D(PHY, " ****** Sidelink RX-Chain for Frame.Slot %d.%d ****** \n", frame_rx % 1024, nr_slot_rx); LOG_D(NR_PHY, " ****** Sidelink RX-Chain for Frame.Slot %d.%d ****** \n", frame_rx % 1024, nr_slot_rx);
const uint32_t rxdataF_sz = fp->samples_per_slot_wCP; const uint32_t rxdataF_sz = fp->samples_per_slot_wCP;
__attribute__((aligned(32))) c16_t rxdataF[fp->nb_antennas_rx][rxdataF_sz]; __attribute__((aligned(32))) c16_t rxdataF[fp->nb_antennas_rx][rxdataF_sz];
...@@ -181,7 +182,7 @@ int psbch_pscch_processing(PHY_VARS_NR_UE *ue, UE_nr_rxtx_proc_t *proc, nr_phy_d ...@@ -181,7 +182,7 @@ int psbch_pscch_processing(PHY_VARS_NR_UE *ue, UE_nr_rxtx_proc_t *proc, nr_phy_d
const int estimateSz = fp->symbols_per_slot * fp->ofdm_symbol_size; const int estimateSz = fp->symbols_per_slot * fp->ofdm_symbol_size;
// VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_SLOT_FEP_PSBCH, VCD_FUNCTION_IN); // VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_SLOT_FEP_PSBCH, VCD_FUNCTION_IN);
LOG_D(PHY, " ----- PSBCH RX TTI: frame.slot %d.%d ------ \n", frame_rx % 1024, nr_slot_rx); LOG_D(NR_PHY, " ----- PSBCH RX TTI: frame.slot %d.%d ------ \n", frame_rx % 1024, nr_slot_rx);
__attribute__((aligned(32))) struct complex16 dl_ch_estimates[fp->nb_antennas_rx][estimateSz]; __attribute__((aligned(32))) struct complex16 dl_ch_estimates[fp->nb_antennas_rx][estimateSz];
__attribute__((aligned(32))) struct complex16 dl_ch_estimates_time[fp->nb_antennas_rx][fp->ofdm_symbol_size]; __attribute__((aligned(32))) struct complex16 dl_ch_estimates_time[fp->nb_antennas_rx][fp->ofdm_symbol_size];
...@@ -190,7 +191,7 @@ int psbch_pscch_processing(PHY_VARS_NR_UE *ue, UE_nr_rxtx_proc_t *proc, nr_phy_d ...@@ -190,7 +191,7 @@ int psbch_pscch_processing(PHY_VARS_NR_UE *ue, UE_nr_rxtx_proc_t *proc, nr_phy_d
const int numsym = (fp->Ncp) ? SL_NR_NUM_SYMBOLS_SSB_EXT_CP : SL_NR_NUM_SYMBOLS_SSB_NORMAL_CP; const int numsym = (fp->Ncp) ? SL_NR_NUM_SYMBOLS_SSB_EXT_CP : SL_NR_NUM_SYMBOLS_SSB_NORMAL_CP;
for (int sym = 0; sym < numsym;) { for (int sym = 0; sym < numsym;) {
nr_slot_fep(ue, fp, proc, sym, rxdataF, link_type_ul); nr_slot_fep(ue, fp, proc, sym, rxdataF, link_type_sl);
start_meas(&sl_phy_params->channel_estimation_stats); start_meas(&sl_phy_params->channel_estimation_stats);
nr_pbch_channel_estimation(fp, nr_pbch_channel_estimation(fp,
...@@ -211,7 +212,7 @@ int psbch_pscch_processing(PHY_VARS_NR_UE *ue, UE_nr_rxtx_proc_t *proc, nr_phy_d ...@@ -211,7 +212,7 @@ int psbch_pscch_processing(PHY_VARS_NR_UE *ue, UE_nr_rxtx_proc_t *proc, nr_phy_d
stop_meas(&sl_phy_params->channel_estimation_stats); stop_meas(&sl_phy_params->channel_estimation_stats);
if (sym == 12) if (sym == 12)
UEscopeCopy(ue, UEscopeCopy(ue,
pbchDlChEstimateTime, psbchDlChEstimateTime,
(void *)dl_ch_estimates_time, (void *)dl_ch_estimates_time,
sizeof(c16_t), sizeof(c16_t),
fp->nb_antennas_rx, fp->nb_antennas_rx,
...@@ -224,17 +225,17 @@ int psbch_pscch_processing(PHY_VARS_NR_UE *ue, UE_nr_rxtx_proc_t *proc, nr_phy_d ...@@ -224,17 +225,17 @@ int psbch_pscch_processing(PHY_VARS_NR_UE *ue, UE_nr_rxtx_proc_t *proc, nr_phy_d
nr_sl_psbch_rsrp_measurements(sl_phy_params, fp, rxdataF, false); nr_sl_psbch_rsrp_measurements(sl_phy_params, fp, rxdataF, false);
LOG_D(PHY, " ------ Decode SL-MIB: frame.slot %d.%d ------ \n", frame_rx % 1024, nr_slot_rx); LOG_D(NR_PHY, " ------ Decode SL-MIB: frame.slot %d.%d ------ \n", frame_rx % 1024, nr_slot_rx);
const int psbchSuccess = nr_ue_psbch_procedures(ue, fp, proc, estimateSz, dl_ch_estimates, phy_data, rxdataF); const int psbchSuccess = nr_ue_psbch_procedures(ue, fp, proc, estimateSz, dl_ch_estimates, phy_data, rxdataF);
if (ue->no_timing_correction == 0 && psbchSuccess == 0) { if (ue->no_timing_correction == 0 && psbchSuccess == 0) {
LOG_D(PHY, "start adjust sync slot = %d no timing %d\n", nr_slot_rx, ue->no_timing_correction); LOG_D(NR_PHY, "start adjust sync slot = %d no timing %d\n", nr_slot_rx, ue->no_timing_correction);
sampleShift = sampleShift =
nr_adjust_synch_ue(fp, ue, proc->gNB_id, fp->ofdm_symbol_size, dl_ch_estimates_time, frame_rx, nr_slot_rx, 16384); nr_adjust_synch_ue(fp, ue, proc->gNB_id, fp->ofdm_symbol_size, dl_ch_estimates_time, frame_rx, nr_slot_rx, 16384);
} }
LOG_D(PHY, "Doing N0 measurements in %s\n", __FUNCTION__); LOG_D(NR_PHY, "Doing N0 measurements in %s\n", __FUNCTION__);
// nr_ue_rrc_measurements(ue, proc, rxdataF); // nr_ue_rrc_measurements(ue, proc, rxdataF);
// VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_SLOT_FEP_PSBCH, VCD_FUNCTION_OUT); // VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_SLOT_FEP_PSBCH, VCD_FUNCTION_OUT);
...@@ -254,10 +255,12 @@ int psbch_pscch_processing(PHY_VARS_NR_UE *ue, UE_nr_rxtx_proc_t *proc, nr_phy_d ...@@ -254,10 +255,12 @@ int psbch_pscch_processing(PHY_VARS_NR_UE *ue, UE_nr_rxtx_proc_t *proc, nr_phy_d
} }
} }
UEscopeCopy(ue, commonRxdataF, rxdataF, sizeof(int32_t), fp->nb_antennas_rx, rxdataF_sz, 0);
return sampleShift; return sampleShift;
} }
int phy_procedures_nrUE_SL_TX(PHY_VARS_NR_UE *ue, UE_nr_rxtx_proc_t *proc, nr_phy_data_tx_t *phy_data) void phy_procedures_nrUE_SL_TX(PHY_VARS_NR_UE *ue, const UE_nr_rxtx_proc_t *proc, nr_phy_data_tx_t *phy_data)
{ {
int slot_tx = proc->nr_slot_tx; int slot_tx = proc->nr_slot_tx;
int frame_tx = proc->frame_tx; int frame_tx = proc->frame_tx;
...@@ -275,7 +278,7 @@ int phy_procedures_nrUE_SL_TX(PHY_VARS_NR_UE *ue, UE_nr_rxtx_proc_t *proc, nr_ph ...@@ -275,7 +278,7 @@ int phy_procedures_nrUE_SL_TX(PHY_VARS_NR_UE *ue, UE_nr_rxtx_proc_t *proc, nr_ph
for (int i = 0; i < fp->nb_antennas_tx; ++i) for (int i = 0; i < fp->nb_antennas_tx; ++i)
txdataF[i] = &txdataF_buf[i * samplesF_per_slot]; txdataF[i] = &txdataF_buf[i * samplesF_per_slot];
LOG_D(PHY, "****** start Sidelink TX-Chain for AbsSubframe %d.%d ******\n", frame_tx, slot_tx); LOG_D(NR_PHY, "****** start Sidelink TX-Chain for AbsSubframe %d.%d ******\n", frame_tx, slot_tx);
start_meas(&sl_phy_params->phy_proc_sl_tx); start_meas(&sl_phy_params->phy_proc_sl_tx);
...@@ -302,14 +305,13 @@ int phy_procedures_nrUE_SL_TX(PHY_VARS_NR_UE *ue, UE_nr_rxtx_proc_t *proc, nr_ph ...@@ -302,14 +305,13 @@ int phy_procedures_nrUE_SL_TX(PHY_VARS_NR_UE *ue, UE_nr_rxtx_proc_t *proc, nr_ph
} }
if (tx_action) { if (tx_action) {
LOG_D(PHY, "Sending Uplink data \n"); LOG_D(NR_PHY, "Sending Uplink data \n");
nr_ue_pusch_common_procedures(ue, proc->nr_slot_tx, fp, fp->nb_antennas_tx, txdataF); nr_ue_pusch_common_procedures(ue, proc->nr_slot_tx, fp, fp->nb_antennas_tx, txdataF, link_type_sl);
} }
LOG_D(PHY, "****** end Sidelink TX-Chain for AbsSubframe %d.%d ******\n", frame_tx, slot_tx); LOG_D(NR_PHY, "****** end Sidelink TX-Chain for AbsSubframe %d.%d ******\n", frame_tx, slot_tx);
// VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_UE_TX_SL, VCD_FUNCTION_OUT); // VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_UE_TX_SL, VCD_FUNCTION_OUT);
stop_meas(&sl_phy_params->phy_proc_sl_tx); stop_meas(&sl_phy_params->phy_proc_sl_tx);
return tx_action;
} }
...@@ -57,3 +57,15 @@ void *rrc_nrue(void *notUsed) ...@@ -57,3 +57,15 @@ void *rrc_nrue(void *notUsed)
{ {
return NULL; return NULL;
} }
int8_t nr_mac_rrc_sl_mib_ind(const module_id_t module_id,
const int CC_id,
const uint8_t gNB_index,
const frame_t frame,
const int slot,
const int channel,
const uint8_t *pduP,
const sdu_size_t pdu_len,
const uint16_t rx_slss_id)
{
return 1;
}
...@@ -89,6 +89,12 @@ uint8_t check_if_ue_is_sl_syncsource() ...@@ -89,6 +89,12 @@ uint8_t check_if_ue_is_sl_syncsource()
{ {
return 0; return 0;
} }
void nr_rrc_mac_config_req_sl_mib(module_id_t module_id,
NR_SL_SSB_TimeAllocation_r16_t *ssb_ta,
uint16_t rx_slss_id,
uint8_t *sl_mib)
{
}
////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////
static void prepare_mib_bits(uint8_t *buf, uint32_t frame_tx, uint32_t slot_tx) static void prepare_mib_bits(uint8_t *buf, uint32_t frame_tx, uint32_t slot_tx)
{ {
...@@ -178,7 +184,8 @@ static void sl_init_frame_parameters(PHY_VARS_NR_UE *UE) ...@@ -178,7 +184,8 @@ static void sl_init_frame_parameters(PHY_VARS_NR_UE *UE)
sl_fp->att_tx = 1; sl_fp->att_tx = 1;
sl_fp->att_rx = 1; sl_fp->att_rx = 1;
// band47 //UL freq will be set to Sidelink freq // band47 //UL freq will be set to Sidelink freq
sl_fp->ul_CarrierFreq = 5880000000; sl_fp->sl_CarrierFreq = 5880000000;
sl_fp->N_RB_SL = sl_fp->N_RB_DL;
sl_fp->ssb_start_subcarrier = UE->SL_UE_PHY_PARAMS.sl_config.sl_bwp_config.sl_ssb_offset_point_a; sl_fp->ssb_start_subcarrier = UE->SL_UE_PHY_PARAMS.sl_config.sl_bwp_config.sl_ssb_offset_point_a;
sl_fp->Nid_cell = UE->SL_UE_PHY_PARAMS.sl_config.sl_sync_source.rx_slss_id; sl_fp->Nid_cell = UE->SL_UE_PHY_PARAMS.sl_config.sl_sync_source.rx_slss_id;
...@@ -202,7 +209,7 @@ static void configure_SL_UE(PHY_VARS_NR_UE *UE, int mu, int N_RB, int ssb_offset ...@@ -202,7 +209,7 @@ static void configure_SL_UE(PHY_VARS_NR_UE *UE, int mu, int N_RB, int ssb_offset
sl_init_frame_parameters(UE); sl_init_frame_parameters(UE);
sl_ue_phy_init(UE); sl_ue_phy_init(UE);
init_symbol_rotation(fp); perform_symbol_rotation(fp, fp->sl_CarrierFreq, fp->symbol_rotation[link_type_sl]);
init_timeshift_rotation(fp); init_timeshift_rotation(fp);
LOG_I(PHY, "Dumping Sidelink Frame Parameters\n"); LOG_I(PHY, "Dumping Sidelink Frame Parameters\n");
nr_dump_frame_parms(fp); nr_dump_frame_parms(fp);
......
...@@ -1306,6 +1306,7 @@ static void configure_dedicated_BWP_dl(NR_UE_MAC_INST_t *mac, int bwp_id, NR_BWP ...@@ -1306,6 +1306,7 @@ static void configure_dedicated_BWP_dl(NR_UE_MAC_INST_t *mac, int bwp_id, NR_BWP
if (dl_dedicated->pdcch_Config->present == NR_SetupRelease_PDCCH_Config_PR_setup) if (dl_dedicated->pdcch_Config->present == NR_SetupRelease_PDCCH_Config_PR_setup)
configure_ss_coreset(pdcch, dl_dedicated->pdcch_Config->choice.setup); configure_ss_coreset(pdcch, dl_dedicated->pdcch_Config->choice.setup);
} }
AssertFatal(!dl_dedicated->sps_Config, "SPS handling not implemented\n");
} }
} }
...@@ -1548,17 +1549,13 @@ static void configure_physicalcellgroup(NR_UE_MAC_INST_t *mac, ...@@ -1548,17 +1549,13 @@ static void configure_physicalcellgroup(NR_UE_MAC_INST_t *mac,
mac->pdsch_HARQ_ACK_Codebook = phyConfig->pdsch_HARQ_ACK_Codebook; mac->pdsch_HARQ_ACK_Codebook = phyConfig->pdsch_HARQ_ACK_Codebook;
mac->harq_ACK_SpatialBundlingPUCCH = phyConfig->harq_ACK_SpatialBundlingPUCCH ? true : false; mac->harq_ACK_SpatialBundlingPUCCH = phyConfig->harq_ACK_SpatialBundlingPUCCH ? true : false;
mac->harq_ACK_SpatialBundlingPUSCH = phyConfig->harq_ACK_SpatialBundlingPUSCH ? true : false; mac->harq_ACK_SpatialBundlingPUSCH = phyConfig->harq_ACK_SpatialBundlingPUSCH ? true : false;
AssertFatal(!phyConfig->ext1 || !phyConfig->ext1->mcs_C_RNTI, "Handling of mcs-C-RNTI not implemented\n");
NR_P_Max_t *p_NR_FR1 = phyConfig->p_NR_FR1; NR_P_Max_t *p_NR_FR1 = phyConfig->p_NR_FR1;
NR_P_Max_t *p_UE_FR1 = phyConfig->ext1 ? NR_P_Max_t *p_UE_FR1 = phyConfig->ext1 ? phyConfig->ext1->p_UE_FR1 : NULL;
phyConfig->ext1->p_UE_FR1 :
NULL;
if (p_NR_FR1 == NULL) if (p_NR_FR1 == NULL)
mac->p_Max_alt = p_UE_FR1 == NULL ? INT_MIN : *p_UE_FR1; mac->p_Max_alt = p_UE_FR1 == NULL ? INT_MIN : *p_UE_FR1;
else else
mac->p_Max_alt = p_UE_FR1 == NULL ? *p_NR_FR1 : mac->p_Max_alt = p_UE_FR1 == NULL ? *p_NR_FR1 : (*p_UE_FR1 < *p_NR_FR1 ? *p_UE_FR1 : *p_NR_FR1);
(*p_UE_FR1 < *p_NR_FR1 ?
*p_UE_FR1 : *p_NR_FR1);
} }
static uint32_t get_sr_DelayTimer(long logicalChannelSR_DelayTimer) static uint32_t get_sr_DelayTimer(long logicalChannelSR_DelayTimer)
......
...@@ -23,11 +23,9 @@ ...@@ -23,11 +23,9 @@
#include "NR_SidelinkPreconfigNR-r16.h" #include "NR_SidelinkPreconfigNR-r16.h"
#include "mac_proto.h" #include "mac_proto.h"
void sl_ue_mac_free(uint8_t module_id) void sl_ue_mac_free(NR_UE_MAC_INST_t *mac)
{ {
NR_UE_MAC_INST_t *mac = get_mac_inst(module_id);
sl_nr_phy_config_request_t *sl_config = sl_nr_phy_config_request_t *sl_config =
&mac->SL_MAC_PARAMS->sl_phy_config.sl_config_req; &mac->SL_MAC_PARAMS->sl_phy_config.sl_config_req;
...@@ -372,6 +370,9 @@ int nr_rrc_mac_config_req_sl_preconfig(module_id_t module_id, ...@@ -372,6 +370,9 @@ int nr_rrc_mac_config_req_sl_preconfig(module_id_t module_id,
AssertFatal((tdd_uldl_config->pattern2 == NULL), "Sidelink MAC CFG: pattern2 not yet supported"); AssertFatal((tdd_uldl_config->pattern2 == NULL), "Sidelink MAC CFG: pattern2 not yet supported");
sl_mac->sl_TDD_config = sl_preconfig->sl_PreconfigGeneral_r16->sl_TDD_Configuration_r16; sl_mac->sl_TDD_config = sl_preconfig->sl_PreconfigGeneral_r16->sl_TDD_Configuration_r16;
// Sync source is identified, timing needs to be adjusted.
sl_mac->timing_acquired = true;
} }
//Do not copy TDD config yet as SYNC source is not yet found //Do not copy TDD config yet as SYNC source is not yet found
...@@ -474,12 +475,13 @@ void nr_rrc_mac_config_req_sl_mib(module_id_t module_id, ...@@ -474,12 +475,13 @@ void nr_rrc_mac_config_req_sl_mib(module_id_t module_id,
sl_nr_phy_config_request_t *sl_config = &sl_mac->sl_phy_config.sl_config_req; sl_nr_phy_config_request_t *sl_config = &sl_mac->sl_phy_config.sl_config_req;
//Update configs if Sync source is not set else nothing to be done //Update configs if Sync source is not set else nothing to be done
if ( sl_config->sl_sync_source.sync_source == SL_SYNC_SOURCE_NONE) { if (sl_config->sl_sync_source.sync_source == SL_SYNC_SOURCE_NONE) {
//Set SYNC source as SYNC REF UE and send the remaining config to PHY //Set SYNC source as SYNC REF UE and send the remaining config to PHY
sl_config->config_mask = 0xF;//all configs done. sl_config->config_mask = 0xF;//all configs done.
sl_config->sl_sync_source.sync_source = SL_SYNC_SOURCE_SYNC_REF_UE; sl_config->sl_sync_source.sync_source = SL_SYNC_SOURCE_SYNC_REF_UE;
sl_config->sl_sync_source.rx_slss_id = rx_slss_id; sl_config->sl_sync_source.rx_slss_id = rx_slss_id;
sl_mac->timing_acquired = true;
sl_mac->rx_sl_bch.status = 1; sl_mac->rx_sl_bch.status = 1;
sl_mac->rx_sl_bch.slss_id = rx_slss_id; sl_mac->rx_sl_bch.slss_id = rx_slss_id;
...@@ -524,7 +526,8 @@ void nr_rrc_mac_config_req_sl_mib(module_id_t module_id, ...@@ -524,7 +526,8 @@ void nr_rrc_mac_config_req_sl_mib(module_id_t module_id,
sl_mac->sl_TDD_config->pattern1.nrofDownlinkSlots, sl_mac->sl_TDD_config->pattern1.nrofUplinkSlots, sl_mac->sl_TDD_config->pattern1.nrofDownlinkSlots, sl_mac->sl_TDD_config->pattern1.nrofUplinkSlots,
sl_mac->sl_TDD_config->pattern1.nrofDownlinkSymbols,sl_mac->sl_TDD_config->pattern1.nrofUplinkSymbols); sl_mac->sl_TDD_config->pattern1.nrofDownlinkSymbols,sl_mac->sl_TDD_config->pattern1.nrofUplinkSymbols);
DevAssert(mac->if_module != NULL && mac->if_module->sl_phy_config_request != NULL);
mac->if_module->sl_phy_config_request(&sl_mac->sl_phy_config);
} }
} }
...@@ -32,6 +32,10 @@ ...@@ -32,6 +32,10 @@
#define SL_NR_MAC_NUM_TX_RESOURCE_POOLS 1 #define SL_NR_MAC_NUM_TX_RESOURCE_POOLS 1
#define SL_NUM_BYTES_TIMERESOURCEBITMAP 20 #define SL_NUM_BYTES_TIMERESOURCEBITMAP 20
// every 16 frames, SSB is repeated.
#define SL_NR_SSB_REPETITION_IN_FRAMES 16
#define SL_FRAME_NUMBER_CYCLE 1024
// Size of Fixed fields prio (3), sci_2ndstage(2), // Size of Fixed fields prio (3), sci_2ndstage(2),
// betaoffsetindicator(2), num dmrs ports (1), mcs (5bits) // betaoffsetindicator(2), num dmrs ports (1), mcs (5bits)
#define SL_SCI_FORMAT_1A_LEN_IN_BITS_FIXED_FIELDS 13 #define SL_SCI_FORMAT_1A_LEN_IN_BITS_FIXED_FIELDS 13
...@@ -127,6 +131,13 @@ typedef struct sl_bch_params { ...@@ -127,6 +131,13 @@ typedef struct sl_bch_params {
} sl_bch_params_t; } sl_bch_params_t;
typedef struct sl_stored_tti_req {
uint32_t sl_action;
int frame;
int slot;
} sl_stored_tti_req_t;
typedef struct sl_nr_ue_mac_params { typedef struct sl_nr_ue_mac_params {
//Holds the RX resource pool from RRC and its related parameters //Holds the RX resource pool from RRC and its related parameters
...@@ -151,6 +162,27 @@ typedef struct sl_nr_ue_mac_params { ...@@ -151,6 +162,27 @@ typedef struct sl_nr_ue_mac_params {
//Holds Broadcast params incase UE receives SL-SSB //Holds Broadcast params incase UE receives SL-SSB
sl_bch_params_t rx_sl_bch; sl_bch_params_t rx_sl_bch;
// SSB RSRP in dBm
int16_t ssb_rsrp_dBm;
// Bitmap indicating which slots belong to sidelink
// Right now supports 30Khz and 15Khz
uint32_t sl_slot_bitmap;
// adjust timing after new timing from sync is acquired.
bool timing_acquired;
// Sidelink slots per frame
uint16_t N_SL_SLOTS_perframe;
uint16_t decoded_DFN;
uint16_t decoded_slot;
uint32_t N_SL_SLOTS;
uint16_t N_SSB_16frames;
sl_stored_tti_req_t *future_ttis;
} sl_nr_ue_mac_params_t; } sl_nr_ue_mac_params_t;
......
...@@ -391,6 +391,7 @@ void nr_rrc_mac_config_req_sl_mib(module_id_t module_id, ...@@ -391,6 +391,7 @@ void nr_rrc_mac_config_req_sl_mib(module_id_t module_id,
NR_SL_SSB_TimeAllocation_r16_t *ssb_ta, NR_SL_SSB_TimeAllocation_r16_t *ssb_ta,
uint16_t rx_slss_id, uint16_t rx_slss_id,
uint8_t *sl_mib); uint8_t *sl_mib);
void sl_prepare_psbch_payload(NR_TDD_UL_DL_ConfigCommon_t *TDD_UL_DL_Config, void sl_prepare_psbch_payload(NR_TDD_UL_DL_ConfigCommon_t *TDD_UL_DL_Config,
uint8_t *bits_0_to_7, uint8_t *bits_8_to_11, uint8_t *bits_0_to_7, uint8_t *bits_8_to_11,
uint8_t mu, uint8_t L, uint8_t Y); uint8_t mu, uint8_t L, uint8_t Y);
...@@ -402,4 +403,24 @@ uint8_t sl_decode_sl_TDD_Config(NR_TDD_UL_DL_ConfigCommon_t *TDD_UL_DL_Config, ...@@ -402,4 +403,24 @@ uint8_t sl_decode_sl_TDD_Config(NR_TDD_UL_DL_ConfigCommon_t *TDD_UL_DL_Config,
uint8_t sl_determine_sci_1a_len(uint16_t *num_subchannels, uint8_t sl_determine_sci_1a_len(uint16_t *num_subchannels,
NR_SL_ResourcePool_r16_t *rpool, NR_SL_ResourcePool_r16_t *rpool,
sidelink_sci_format_1a_fields_t *sci_1a); sidelink_sci_format_1a_fields_t *sci_1a);
/** \brief This function checks nr UE slot for Sidelink direction : Sidelink
* @param cfg : Sidelink config request
* @param nr_frame : frame number
* @param nr_slot : slot number
* @param frame duplex type : Frame type
@returns int : 0 or Sidelink slot type */
int sl_nr_ue_slot_select(sl_nr_phy_config_request_t *cfg, int nr_slot, uint8_t frame_duplex_type);
void nr_ue_sidelink_scheduler(nr_sidelink_indication_t *sl_ind, NR_UE_MAC_INST_t *mac);
void nr_mac_rrc_sl_mib_ind(const module_id_t module_id,
const int CC_id,
const uint8_t gNB_index,
const frame_t frame,
const int slot,
const channel_t channel,
uint8_t *pduP,
const sdu_size_t pdu_len,
const uint16_t rx_slss_id);
#endif #endif
...@@ -260,6 +260,38 @@ static inline int writeBit(uint8_t *bitmap, int offset, int value, int size) ...@@ -260,6 +260,38 @@ static inline int writeBit(uint8_t *bitmap, int offset, int value, int size)
return size; return size;
} }
// 38.214 Section 5.1.3.1
static uint8_t get_dlsch_mcs_table(nr_dci_format_t format,
nr_rnti_type_t rnti_type,
int ss_type,
long *mcs_Table,
long *sps_mcs_Table,
bool sps_transmission,
long *mcs_C_RNTI)
{
// TODO procedures for SPS-Config (semi-persistent scheduling) not implemented
if (mcs_Table && *mcs_Table == NR_PDSCH_Config__mcs_Table_qam256 && format == NR_DL_DCI_FORMAT_1_1 && rnti_type == TYPE_C_RNTI_)
return 1; // Table 5.1.3.1-2: MCS index table 2 for PDSCH
else if (!mcs_C_RNTI
&& mcs_Table
&& *mcs_Table == NR_PDSCH_Config__mcs_Table_qam64LowSE
&& ss_type == NR_SearchSpace__searchSpaceType_PR_ue_Specific
&& rnti_type == TYPE_C_RNTI_)
return 2; // Table 5.1.3.1-3: MCS index table 3 for PDSCH
else if (mcs_C_RNTI && rnti_type == TYPE_MCS_C_RNTI_)
return 2; // Table 5.1.3.1-3: MCS index table 3 for PDSCH
else if (!sps_mcs_Table && mcs_Table && *mcs_Table == NR_PDSCH_Config__mcs_Table_qam256) {
if ((format == NR_DL_DCI_FORMAT_1_1 && rnti_type == TYPE_CS_RNTI_) || sps_transmission)
return 1; // Table 5.1.3.1-2: MCS index table 2 for PDSCH
}
else if (sps_mcs_Table) {
if (rnti_type == TYPE_CS_RNTI_ || sps_transmission)
return 2; // Table 5.1.3.1-3: MCS index table 3 for PDSCH
}
// otherwise
return 0; // Table 5.1.3.1-1: MCS index table 1 for PDSCH
}
int8_t nr_ue_process_dci_freq_dom_resource_assignment(nfapi_nr_ue_pusch_pdu_t *pusch_config_pdu, int8_t nr_ue_process_dci_freq_dom_resource_assignment(nfapi_nr_ue_pusch_pdu_t *pusch_config_pdu,
fapi_nr_dl_config_dlsch_pdu_rel15_t *dlsch_config_pdu, fapi_nr_dl_config_dlsch_pdu_rel15_t *dlsch_config_pdu,
NR_PDSCH_Config_t *pdsch_Config, NR_PDSCH_Config_t *pdsch_Config,
...@@ -638,12 +670,13 @@ static int nr_ue_process_dci_dl_10(NR_UE_MAC_INST_t *mac, ...@@ -638,12 +670,13 @@ static int nr_ue_process_dci_dl_10(NR_UE_MAC_INST_t *mac,
int dmrs_typeA_pos = mac->dmrs_TypeA_Position; int dmrs_typeA_pos = mac->dmrs_TypeA_Position;
const int coreset_type = dci_ind->coreset_type == NFAPI_NR_CSET_CONFIG_PDCCH_CONFIG; // 0 for coreset0, 1 otherwise; const int coreset_type = dci_ind->coreset_type == NFAPI_NR_CSET_CONFIG_PDCCH_CONFIG; // 0 for coreset0, 1 otherwise;
nr_rnti_type_t rnti_type = get_rnti_type(mac, dci_ind->rnti);
NR_tda_info_t tda_info = get_dl_tda_info(current_DL_BWP, NR_tda_info_t tda_info = get_dl_tda_info(current_DL_BWP,
dci_ind->ss_type, dci_ind->ss_type,
dci->time_domain_assignment.val, dci->time_domain_assignment.val,
dmrs_typeA_pos, dmrs_typeA_pos,
mux_pattern, mux_pattern,
get_rnti_type(mac, dci_ind->rnti), rnti_type,
coreset_type, coreset_type,
mac->get_sib1); mac->get_sib1);
...@@ -661,7 +694,7 @@ static int nr_ue_process_dci_dl_10(NR_UE_MAC_INST_t *mac, ...@@ -661,7 +694,7 @@ static int nr_ue_process_dci_dl_10(NR_UE_MAC_INST_t *mac,
else else
dlsch_pdu->dlDmrsScramblingId = mac->physCellId; dlsch_pdu->dlDmrsScramblingId = mac->physCellId;
if (get_rnti_type(mac, dci_ind->rnti) == TYPE_C_RNTI_ if (rnti_type == TYPE_C_RNTI_
&& dci_ind->ss_type != NR_SearchSpace__searchSpaceType_PR_common && dci_ind->ss_type != NR_SearchSpace__searchSpaceType_PR_common
&& pdsch_config->dataScramblingIdentityPDSCH) && pdsch_config->dataScramblingIdentityPDSCH)
dlsch_pdu->dlDataScramblingId = *pdsch_config->dataScramblingIdentityPDSCH; dlsch_pdu->dlDataScramblingId = *pdsch_config->dataScramblingIdentityPDSCH;
...@@ -689,7 +722,13 @@ static int nr_ue_process_dci_dl_10(NR_UE_MAC_INST_t *mac, ...@@ -689,7 +722,13 @@ static int nr_ue_process_dci_dl_10(NR_UE_MAC_INST_t *mac,
dlsch_pdu->vrb_to_prb_mapping = dlsch_pdu->vrb_to_prb_mapping =
(dci->vrb_to_prb_mapping.val == 0) ? vrb_to_prb_mapping_non_interleaved : vrb_to_prb_mapping_interleaved; (dci->vrb_to_prb_mapping.val == 0) ? vrb_to_prb_mapping_non_interleaved : vrb_to_prb_mapping_interleaved;
/* MCS TABLE INDEX */ /* MCS TABLE INDEX */
dlsch_pdu->mcs_table = (pdsch_config) ? ((pdsch_config->mcs_Table) ? (*pdsch_config->mcs_Table + 1) : 0) : 0; dlsch_pdu->mcs_table = get_dlsch_mcs_table(NR_DL_DCI_FORMAT_1_0,
rnti_type,
dci_ind->ss_type,
pdsch_config ? pdsch_config->mcs_Table : NULL,
NULL, // SPS not implemented,
false, // as above
NULL); // MCS-C-RNTI not implemented
/* MCS */ /* MCS */
dlsch_pdu->mcs = dci->mcs; dlsch_pdu->mcs = dci->mcs;
...@@ -942,12 +981,13 @@ static int nr_ue_process_dci_dl_11(NR_UE_MAC_INST_t *mac, ...@@ -942,12 +981,13 @@ static int nr_ue_process_dci_dl_11(NR_UE_MAC_INST_t *mac,
int dmrs_typeA_pos = mac->dmrs_TypeA_Position; int dmrs_typeA_pos = mac->dmrs_TypeA_Position;
int mux_pattern = 1; int mux_pattern = 1;
const int coreset_type = dci_ind->coreset_type == NFAPI_NR_CSET_CONFIG_PDCCH_CONFIG; // 0 for coreset0, 1 otherwise; const int coreset_type = dci_ind->coreset_type == NFAPI_NR_CSET_CONFIG_PDCCH_CONFIG; // 0 for coreset0, 1 otherwise;
nr_rnti_type_t rnti_type = get_rnti_type(mac, dci_ind->rnti);
NR_tda_info_t tda_info = get_dl_tda_info(current_DL_BWP, NR_tda_info_t tda_info = get_dl_tda_info(current_DL_BWP,
dci_ind->ss_type, dci_ind->ss_type,
dci->time_domain_assignment.val, dci->time_domain_assignment.val,
dmrs_typeA_pos, dmrs_typeA_pos,
mux_pattern, mux_pattern,
get_rnti_type(mac, dci_ind->rnti), rnti_type,
coreset_type, coreset_type,
false); false);
...@@ -1152,8 +1192,13 @@ static int nr_ue_process_dci_dl_11(NR_UE_MAC_INST_t *mac, ...@@ -1152,8 +1192,13 @@ static int nr_ue_process_dci_dl_11(NR_UE_MAC_INST_t *mac,
// send the ack/nack slot number to phy to indicate tx thread to wait for DLSCH decoding // send the ack/nack slot number to phy to indicate tx thread to wait for DLSCH decoding
dlsch_pdu->k1_feedback = feedback_ti; dlsch_pdu->k1_feedback = feedback_ti;
/* TODO same calculation for MCS table as done in UL */ dlsch_pdu->mcs_table = get_dlsch_mcs_table(NR_DL_DCI_FORMAT_1_1,
dlsch_pdu->mcs_table = (pdsch_Config->mcs_Table) ? (*pdsch_Config->mcs_Table + 1) : 0; rnti_type,
dci_ind->ss_type,
pdsch_Config ? pdsch_Config->mcs_Table : NULL,
NULL, // SPS not implemented,
false, // as above
NULL); // MCS-C-RNTI not implemented
dlsch_pdu->qamModOrder = nr_get_Qm_dl(dlsch_pdu->mcs, dlsch_pdu->mcs_table); dlsch_pdu->qamModOrder = nr_get_Qm_dl(dlsch_pdu->mcs, dlsch_pdu->mcs_table);
if (dlsch_pdu->qamModOrder == 0) { if (dlsch_pdu->qamModOrder == 0) {
LOG_W(MAC, "Invalid code rate or Mod order, likely due to unexpected DL DCI.\n"); LOG_W(MAC, "Invalid code rate or Mod order, likely due to unexpected DL DCI.\n");
......
...@@ -19,7 +19,8 @@ ...@@ -19,7 +19,8 @@
* contact@openairinterface.org * contact@openairinterface.org
*/ */
#include "mac_defs_sl.h" #include "mac_defs.h"
#include "mac_proto.h"
#define SL_DEBUG #define SL_DEBUG
...@@ -348,35 +349,37 @@ uint32_t sl_prepare_MIB(NR_TDD_UL_DL_ConfigCommon_t *TDD_UL_DL_Config, ...@@ -348,35 +349,37 @@ uint32_t sl_prepare_MIB(NR_TDD_UL_DL_ConfigCommon_t *TDD_UL_DL_Config,
return sl_mib; return sl_mib;
} }
uint16_t sl_get_subchannel_size(NR_SL_ResourcePool_r16_t *rpool) uint16_t sl_get_num_subch(NR_SL_ResourcePool_r16_t *rpool)
{ {
uint16_t subch_size = 0; //sl-NumSubchannel - Indicates the number of subchannels in the corresponding resource pool
const uint8_t subchsizes[8] = {10, 12, 15, 20, 25, 50, 75, 100}; //which consists of contiguous PRBs only.
uint16_t num_subch = (rpool->sl_NumSubchannel_r16) ? *rpool->sl_NumSubchannel_r16 : 0;
subch_size = (rpool->sl_SubchannelSize_r16)
? subchsizes[*rpool->sl_SubchannelSize_r16] : 0;
AssertFatal(subch_size,"Subch Size cannot be 0.Resource Pool Configuration Error\n"); AssertFatal(num_subch,"NUM Subchannels cannot be 0. Resource Pool Configuration Error\n");
return subch_size; return num_subch;
} }
uint16_t sl_get_num_subch(NR_SL_ResourcePool_r16_t *rpool) uint16_t sl_get_subchannel_size(NR_SL_ResourcePool_r16_t *rpool)
{ {
uint16_t num_subch = 0; uint16_t num_subch = sl_get_num_subch(rpool);
uint16_t subch_size = sl_get_subchannel_size(rpool);
//sl-RB-Number - Indicates the number of PRBs in the corresponding resource pool.
//which consists of contiguous PRBs only.The remaining RB cannot be used
uint16_t num_rbs = (rpool->sl_RB_Number_r16) ? *rpool->sl_RB_Number_r16 : 0; uint16_t num_rbs = (rpool->sl_RB_Number_r16) ? *rpool->sl_RB_Number_r16 : 0;
AssertFatal(num_rbs,"NumRbs in rpool cannot be 0.Resource Pool Configuration Error\n"); AssertFatal(num_rbs,"NumRbs in rpool cannot be 0.Resource Pool Configuration Error\n");
num_subch = num_rbs/subch_size; uint16_t subch_size = 0;
subch_size = num_rbs/num_subch;
LOG_I(NR_MAC, "Subch_size:%d, numRBS:%d, num_subch:%d\n", LOG_I(NR_MAC, "Subch_size:%d, numRBS:%d, num_subch:%d\n",
subch_size,num_rbs,num_subch); subch_size,num_rbs,num_subch);
return (num_subch); return (subch_size);
} }
//This function determines SCI 1A Len in bits based on the configuration in the resource pool. //This function determines SCI 1A Len in bits based on the configuration in the resource pool.
...@@ -474,10 +477,11 @@ uint8_t sl_determine_sci_1a_len(uint16_t *num_subchannels, ...@@ -474,10 +477,11 @@ uint8_t sl_determine_sci_1a_len(uint16_t *num_subchannels,
AssertFatal(*rpool->sl_Additional_MCS_Table_r16<=2, "additional table value cannot be > 2. Resource Pool Configuration Error.\n"); AssertFatal(*rpool->sl_Additional_MCS_Table_r16<=2, "additional table value cannot be > 2. Resource Pool Configuration Error.\n");
} }
LOG_D(NR_MAC,"sci 1A - additional_table:%ld, sci 1a len:%d, additional table nbits:%d\n", LOG_D(NR_MAC,
*rpool->sl_Additional_MCS_Table_r16, "sci 1A - additional_table:%ld, sci 1a len:%d, additional table nbits:%d\n",
sci_1a_len, rpool->sl_Additional_MCS_Table_r16 ? *rpool->sl_Additional_MCS_Table_r16 : 0,
sci_1a->additional_mcs_table_indicator.nbits); sci_1a_len,
sci_1a->additional_mcs_table_indicator.nbits);
uint8_t psfch_period = 0; uint8_t psfch_period = 0;
if (rpool->sl_PSFCH_Config_r16 && if (rpool->sl_PSFCH_Config_r16 &&
......
...@@ -682,7 +682,12 @@ int nr_config_pusch_pdu(NR_UE_MAC_INST_t *mac, ...@@ -682,7 +682,12 @@ int nr_config_pusch_pdu(NR_UE_MAC_INST_t *mac,
ul_layers_config(mac, pusch_config_pdu, dci, dci_format); ul_layers_config(mac, pusch_config_pdu, dci, dci_format);
ul_ports_config(mac, &dmrslength, pusch_config_pdu, dci, dci_format); ul_ports_config(mac, &dmrslength, pusch_config_pdu, dci, dci_format);
} else { } else {
LOG_E(NR_MAC, "In %s: UL grant from DCI format %d is not handled...\n", __FUNCTION__, dci_format); LOG_E(NR_MAC, "UL grant from DCI format %d is not handled...\n", dci_format);
return -1;
}
if (pusch_config_pdu->nrOfLayers < 1) {
LOG_E(NR_MAC, "Invalid UL number of layers %d from DCI\n", pusch_config_pdu->nrOfLayers);
return -1; return -1;
} }
......
This diff is collapsed.
...@@ -196,6 +196,12 @@ void gNB_dlsch_ulsch_scheduler(module_id_t module_idP, frame_t frame, sub_frame_ ...@@ -196,6 +196,12 @@ void gNB_dlsch_ulsch_scheduler(module_id_t module_idP, frame_t frame, sub_frame_
gNB_MAC_INST *gNB = RC.nrmac[module_idP]; gNB_MAC_INST *gNB = RC.nrmac[module_idP];
NR_COMMON_channels_t *cc = gNB->common_channels; NR_COMMON_channels_t *cc = gNB->common_channels;
NR_ServingCellConfigCommon_t *scc = cc->ServingCellConfigCommon; NR_ServingCellConfigCommon_t *scc = cc->ServingCellConfigCommon;
// Assert to detect segfault during gNB teardown. scc->ssbSubcarrierSpacing pointer is most likely overwritten
AssertFatal(
*scc->ssbSubcarrierSpacing >= 0 && *scc->ssbSubcarrierSpacing < sizeofArray(nr_slots_per_frame),
"ssbSubcarrierSpacing %ld is out of range, ssbSubcarrierSpacing pointer (%p) might be overwritten, known segfault condition",
*scc->ssbSubcarrierSpacing,
scc->ssbSubcarrierSpacing);
NR_SCHED_LOCK(&gNB->sched_lock); NR_SCHED_LOCK(&gNB->sched_lock);
......
...@@ -1296,6 +1296,10 @@ nr_ue_if_module_t *nr_ue_if_module_init(uint32_t module_id) ...@@ -1296,6 +1296,10 @@ nr_ue_if_module_t *nr_ue_if_module_init(uint32_t module_id)
nr_ue_if_module_inst[module_id]->current_slot = 0; nr_ue_if_module_inst[module_id]->current_slot = 0;
nr_ue_if_module_inst[module_id]->phy_config_request = nr_ue_phy_config_request; nr_ue_if_module_inst[module_id]->phy_config_request = nr_ue_phy_config_request;
nr_ue_if_module_inst[module_id]->synch_request = nr_ue_synch_request; nr_ue_if_module_inst[module_id]->synch_request = nr_ue_synch_request;
if (get_softmodem_params()->sl_mode) {
nr_ue_if_module_inst[module_id]->sl_phy_config_request = nr_ue_sl_phy_config_request;
nr_ue_if_module_inst[module_id]->sl_indication = nr_ue_sl_indication;
}
if (get_softmodem_params()->emulate_l1) if (get_softmodem_params()->emulate_l1)
nr_ue_if_module_inst[module_id]->scheduled_response = nr_ue_scheduled_response_stub; nr_ue_if_module_inst[module_id]->scheduled_response = nr_ue_scheduled_response_stub;
else else
...@@ -1335,3 +1339,117 @@ void RCconfig_nr_ue_macrlc(void) { ...@@ -1335,3 +1339,117 @@ void RCconfig_nr_ue_macrlc(void) {
} }
} }
} }
static void handle_sl_bch(int ue_id,
sl_nr_ue_mac_params_t *sl_mac,
uint8_t *const sl_mib,
const uint8_t len,
uint16_t frame_rx,
uint16_t slot_rx,
uint16_t rx_slss_id)
{
LOG_D(NR_MAC, " decode SL-MIB %d\n", rx_slss_id);
uint8_t sl_tdd_config[2] = {0, 0};
sl_tdd_config[0] = sl_mib[0];
sl_tdd_config[1] = sl_mib[1] & 0xF0;
uint8_t incov = sl_mib[1] & 0x08;
uint16_t frame_0 = (sl_mib[2] & 0xFE) >> 1;
uint16_t frame_1 = sl_mib[1] & 0x07;
frame_0 |= (frame_1 & 0x01) << 7;
frame_1 = ((frame_1 & 0x06) >> 1) << 8;
uint16_t frame = frame_1 | frame_0;
uint8_t slot = ((sl_mib[2] & 0x01) << 6) | ((sl_mib[3] & 0xFC) >> 2);
LOG_D(NR_MAC,
"[UE%d]In %d:%d Received SL-MIB:%x .Contents- SL-TDD config:%x, Incov:%d, FN:%d, Slot:%d\n",
ue_id,
frame_rx,
slot_rx,
*((uint32_t *)sl_mib),
*((uint16_t *)sl_tdd_config),
incov,
frame,
slot);
sl_mac->decoded_DFN = frame;
sl_mac->decoded_slot = slot;
nr_mac_rrc_data_ind_ue(ue_id, 0, 0, frame_rx, slot_rx, 0, rx_slss_id, 0, NR_SBCCH_SL_BCH, (uint8_t *)sl_mib, len);
return;
}
/*
if PSBCH rx - handle_psbch()
- Extract FN, Slot
- Extract TDD configuration from the 12 bits
- SEND THE SL-MIB to RRC
if PSSCH DATa rx - handle slsch()
*/
void sl_nr_process_rx_ind(int ue_id,
uint32_t frame,
uint32_t slot,
sl_nr_ue_mac_params_t *sl_mac,
sl_nr_rx_indication_t *rx_ind)
{
uint8_t num_pdus = rx_ind->number_pdus;
uint8_t pdu_type = rx_ind->rx_indication_body[num_pdus - 1].pdu_type;
switch (pdu_type) {
case SL_NR_RX_PDU_TYPE_SSB:
if (rx_ind->rx_indication_body[num_pdus - 1].ssb_pdu.decode_status) {
LOG_D(NR_MAC,
"[UE%d]SL-MAC Received SL-SSB: RSRP:%d dBm/RE, rx_psbch_payload:%x, rx_slss_id:%d\n",
ue_id,
rx_ind->rx_indication_body[num_pdus - 1].ssb_pdu.rsrp_dbm,
*((uint32_t *)rx_ind->rx_indication_body[num_pdus - 1].ssb_pdu.psbch_payload),
rx_ind->rx_indication_body[num_pdus - 1].ssb_pdu.rx_slss_id);
handle_sl_bch(ue_id,
sl_mac,
rx_ind->rx_indication_body[num_pdus - 1].ssb_pdu.psbch_payload,
4,
frame,
slot,
rx_ind->rx_indication_body[num_pdus - 1].ssb_pdu.rx_slss_id);
sl_mac->ssb_rsrp_dBm = rx_ind->rx_indication_body[num_pdus - 1].ssb_pdu.rsrp_dbm;
} else {
LOG_I(NR_MAC, "[UE%d]SL-MAC - NO SL-SSB Received\n", ue_id);
}
break;
case SL_NR_RX_PDU_TYPE_SLSCH:
break;
default:
AssertFatal(1 == 0, "Incorrect type received. %s\n", __FUNCTION__);
break;
}
}
/*
* Sidelink indication is sent from PHY->MAC.
* This interface function handles these
* - rx_ind (SSB on PSBCH/SLSCH on PSSCH).
* - sci_ind (received scis during rxpool reception/txpool sensing)
*/
void nr_ue_sl_indication(nr_sidelink_indication_t *sl_indication)
{
// NR_UE_L2_STATE_t ret;
int ue_id = sl_indication->module_id;
NR_UE_MAC_INST_t *mac = get_mac_inst(ue_id);
uint16_t slot = sl_indication->slot_rx;
uint16_t frame = sl_indication->frame_rx;
sl_nr_ue_mac_params_t *sl_mac = mac->SL_MAC_PARAMS;
if (sl_indication->rx_ind) {
sl_nr_process_rx_ind(ue_id, frame, slot, sl_mac, sl_indication->rx_ind);
} else {
nr_ue_sidelink_scheduler(sl_indication, mac);
}
}
...@@ -42,6 +42,15 @@ ...@@ -42,6 +42,15 @@
#include "NR_Packet_Drop.h" #include "NR_Packet_Drop.h"
#include "nfapi/open-nFAPI/nfapi/public_inc/sidelink_nr_ue_interface.h" #include "nfapi/open-nFAPI/nfapi/public_inc/sidelink_nr_ue_interface.h"
typedef enum sl_sidelink_slot_type {
SIDELINK_SLOT_TYPE_NONE = 0,
SIDELINK_SLOT_TYPE_RX,
SIDELINK_SLOT_TYPE_TX,
SIDELINK_SLOT_TYPE_BOTH
} sl_sidelink_slot_type_t;
extern slot_rnti_mcs_s slot_rnti_mcs[NUM_NFAPI_SLOT]; extern slot_rnti_mcs_s slot_rnti_mcs[NUM_NFAPI_SLOT];
typedef struct NR_UL_TIME_ALIGNMENT NR_UL_TIME_ALIGNMENT_t; typedef struct NR_UL_TIME_ALIGNMENT NR_UL_TIME_ALIGNMENT_t;
...@@ -106,6 +115,8 @@ typedef struct { ...@@ -106,6 +115,8 @@ typedef struct {
frame_t frame_tx; frame_t frame_tx;
/// slot tx /// slot tx
uint32_t slot_tx; uint32_t slot_tx;
// slot type rx or tx
sl_sidelink_slot_type_t slot_type;
/// NR UE FAPI-like P7 message, direction: L1 to L2 /// NR UE FAPI-like P7 message, direction: L1 to L2
/// data reception indication structure /// data reception indication structure
...@@ -199,7 +210,7 @@ typedef int8_t (nr_ue_scheduled_response_f)(nr_scheduled_response_t *scheduled_r ...@@ -199,7 +210,7 @@ typedef int8_t (nr_ue_scheduled_response_f)(nr_scheduled_response_t *scheduled_r
* -1: Failed to consume bytes. Abort the mission. * -1: Failed to consume bytes. Abort the mission.
* Non-negative return values indicate success, and ignored. * Non-negative return values indicate success, and ignored.
*/ */
typedef int8_t (nr_sl_ue_scheduled_response_f)(nr_scheduled_response_t *sl_scheduled_response); typedef void (nr_sl_ue_scheduled_response_f)(nr_scheduled_response_t *sl_scheduled_response);
/* /*
...@@ -218,7 +229,7 @@ typedef int8_t (nr_ue_phy_config_request_f)(nr_phy_config_t *phy_config); ...@@ -218,7 +229,7 @@ typedef int8_t (nr_ue_phy_config_request_f)(nr_phy_config_t *phy_config);
* -1: Failed to consume bytes. Abort the mission. * -1: Failed to consume bytes. Abort the mission.
* Non-negative return values indicate success, and ignored. * Non-negative return values indicate success, and ignored.
*/ */
typedef int8_t (nr_sl_ue_phy_config_request_f)(nr_sl_phy_config_t *sl_phy_config); typedef void(nr_ue_sl_phy_config_request_f)(nr_sl_phy_config_t *sl_phy_config);
/* /*
* Generic type of an application-defined callback to return various * Generic type of an application-defined callback to return various
...@@ -254,12 +265,13 @@ typedef void (nr_ue_slot_indication_f)(uint8_t mod_id); ...@@ -254,12 +265,13 @@ typedef void (nr_ue_slot_indication_f)(uint8_t mod_id);
* -1: Failed to consume bytes. Abort the mission. * -1: Failed to consume bytes. Abort the mission.
* Non-negative return values indicate success, and ignored. * Non-negative return values indicate success, and ignored.
*/ */
typedef int (nr_ue_sl_indication_f)(nr_sidelink_indication_t *sl_info); typedef void (nr_ue_sl_indication_f)(nr_sidelink_indication_t *sl_info);
// TODO check this stuff can be reuse of need modification // TODO check this stuff can be reuse of need modification
typedef struct nr_ue_if_module_s { typedef struct nr_ue_if_module_s {
nr_ue_scheduled_response_f *scheduled_response; nr_ue_scheduled_response_f *scheduled_response;
nr_ue_phy_config_request_f *phy_config_request; nr_ue_phy_config_request_f *phy_config_request;
nr_ue_sl_phy_config_request_f *sl_phy_config_request;
nr_ue_synch_request_f *synch_request; nr_ue_synch_request_f *synch_request;
nr_ue_dl_indication_f *dl_indication; nr_ue_dl_indication_f *dl_indication;
nr_ue_ul_indication_f *ul_indication; nr_ue_ul_indication_f *ul_indication;
...@@ -304,5 +316,7 @@ int nr_ue_dl_indication(nr_downlink_indication_t *dl_info); ...@@ -304,5 +316,7 @@ int nr_ue_dl_indication(nr_downlink_indication_t *dl_info);
int nr_ue_ul_indication(nr_uplink_indication_t *ul_info); int nr_ue_ul_indication(nr_uplink_indication_t *ul_info);
void nr_ue_sl_indication(nr_sidelink_indication_t *sl_indication);
#endif #endif
...@@ -113,8 +113,7 @@ int8_t nr_mac_rrc_data_ind_ue(const module_id_t module_id, ...@@ -113,8 +113,7 @@ int8_t nr_mac_rrc_data_ind_ue(const module_id_t module_id,
NR_RRC_MAC_SBCCH_DATA_IND (message_p).frame = frame; //frameP NR_RRC_MAC_SBCCH_DATA_IND (message_p).frame = frame; //frameP
NR_RRC_MAC_SBCCH_DATA_IND (message_p).slot = slot; NR_RRC_MAC_SBCCH_DATA_IND (message_p).slot = slot;
NR_RRC_MAC_SBCCH_DATA_IND (message_p).sdu_size = sdu_size; NR_RRC_MAC_SBCCH_DATA_IND (message_p).sdu_size = sdu_size;
NR_RRC_MAC_SBCCH_DATA_IND (message_p).gnb_index = gNB_index; NR_RRC_MAC_SBCCH_DATA_IND(message_p).rx_slss_id = cellid; // cellid is rx slss id
NR_RRC_MAC_SBCCH_DATA_IND (message_p).rx_slss_id = rnti;//rx_slss_id is rnti
itti_send_msg_to_task(TASK_RRC_NRUE, GNB_MODULE_ID_TO_INSTANCE(module_id), message_p); itti_send_msg_to_task(TASK_RRC_NRUE, GNB_MODULE_ID_TO_INSTANCE(module_id), message_p);
} }
break; break;
......
...@@ -462,9 +462,7 @@ static int8_t nr_sl_rrc_ue_decode_SL_MIB(const uint8_t gNB_index, ...@@ -462,9 +462,7 @@ static int8_t nr_sl_rrc_ue_decode_SL_MIB(const uint8_t gNB_index,
uint8_t val_slot = sl_mib->slotIndex_r16.buf[0]; uint8_t val_slot = sl_mib->slotIndex_r16.buf[0];
LOG_D(NR_RRC, "SL-RRC - Received MIB\n"); LOG_D(NR_RRC, "%d:%d SL-RRC - Received MIB.\n", val_fn, val_slot >> 1);
LOG_D(NR_RRC, "SL-MIB Contents - DFN:%d\n" , val_fn);
LOG_D(NR_RRC, "SL-MIB Contents - SLOT:%d\n" , val_slot >> 1);
LOG_D(NR_RRC, "SL-MIB Contents - Incoverage:%d\n", sl_mib->inCoverage_r16); LOG_D(NR_RRC, "SL-MIB Contents - Incoverage:%d\n", sl_mib->inCoverage_r16);
LOG_D(NR_RRC, "SL-MIB Contents - sl-TDD-Config:%x\n" , *((uint16_t *)(sl_mib->sl_TDD_Config_r16.buf))); LOG_D(NR_RRC, "SL-MIB Contents - sl-TDD-Config:%x\n" , *((uint16_t *)(sl_mib->sl_TDD_Config_r16.buf)));
......
...@@ -4,10 +4,10 @@ SIDELINK_PRECONFIGURATION = ( ...@@ -4,10 +4,10 @@ SIDELINK_PRECONFIGURATION = (
{ {
# TDD ULDL CONFIG used for sidelink # TDD ULDL CONFIG used for sidelink
sl_dl_UL_TransmissionPeriodicity = 6; sl_dl_UL_TransmissionPeriodicity = 6;
sl_nrofDownlinkSlots = 7; sl_nrofDownlinkSlots = 0;
sl_nrofDownlinkSymbols = 10; sl_nrofDownlinkSymbols = 0;
sl_nrofUplinkSlots = 2; sl_nrofUplinkSlots = 10;
sl_nrofUplinkSymbols = 4; sl_nrofUplinkSymbols = 0;
sl_FrequencyCommonConfig = ( sl_FrequencyCommonConfig = (
{ {
...@@ -39,11 +39,13 @@ SIDELINK_PRECONFIGURATION = ( ...@@ -39,11 +39,13 @@ SIDELINK_PRECONFIGURATION = (
sl_syncCfg = ( sl_syncCfg = (
{ {
#NUM SL-SSB within 16 frames #NUM SL-SSB within 16 frames
#values are [1,2,4,8,16,32,64], 0 means 1 so on
#Current value set to 4 SSBs within 16 frame period
sl_NumSSB_WithinPeriod_0 = 2; sl_NumSSB_WithinPeriod_0 = 2;
#Slot Offset for the first txn in the 16 frame period #Slot Offset for the first txn in the 16 frame period
sl_TimeOffsetSSB_0 = 8; sl_TimeOffsetSSB_0 = 8;
#interval in slots for repetition of SL-SSB #interval in slots for repetition of SL-SSB
sl_TimeInterval_0 = 120; sl_TimeInterval_0 = 60;
} }
); );
......
...@@ -39,11 +39,13 @@ SIDELINK_PRECONFIGURATION = ( ...@@ -39,11 +39,13 @@ SIDELINK_PRECONFIGURATION = (
sl_syncCfg = ( sl_syncCfg = (
{ {
#NUM SL-SSB within 16 frames #NUM SL-SSB within 16 frames
#values are [1,2,4,8,16,32,64], 0 means 1 so on
#Current value set to 4 SSBs within 16 frame period
sl_NumSSB_WithinPeriod_0 = 2; sl_NumSSB_WithinPeriod_0 = 2;
#Slot Offset for the first txn in the 16 frame period #Slot Offset for the first txn in the 16 frame period
sl_TimeOffsetSSB_0 = 8; sl_TimeOffsetSSB_0 = 8;
#interval in slots for repetition of SL-SSB #interval in slots for repetition of SL-SSB
sl_TimeInterval_0 = 120; sl_TimeInterval_0 = 60;
} }
); );
......
...@@ -4,10 +4,10 @@ SIDELINK_PRECONFIGURATION = ( ...@@ -4,10 +4,10 @@ SIDELINK_PRECONFIGURATION = (
{ {
# TDD ULDL CONFIG used for sidelink # TDD ULDL CONFIG used for sidelink
sl_dl_UL_TransmissionPeriodicity = 6; sl_dl_UL_TransmissionPeriodicity = 6;
sl_nrofDownlinkSlots = 7; sl_nrofDownlinkSlots = 0;
sl_nrofDownlinkSymbols = 10; sl_nrofDownlinkSymbols = 0;
sl_nrofUplinkSlots = 2; sl_nrofUplinkSlots = 10;
sl_nrofUplinkSymbols = 4; sl_nrofUplinkSymbols = 0;
sl_FrequencyCommonConfig = ( sl_FrequencyCommonConfig = (
{ {
...@@ -39,11 +39,13 @@ SIDELINK_PRECONFIGURATION = ( ...@@ -39,11 +39,13 @@ SIDELINK_PRECONFIGURATION = (
sl_syncCfg = ( sl_syncCfg = (
{ {
#NUM SL-SSB within 16 frames #NUM SL-SSB within 16 frames
#values are [1,2,4,8,16,32,64], 0 means 1 so on
#Current value set to 4 SSBs within 16 frame period
sl_NumSSB_WithinPeriod_0 = 2; sl_NumSSB_WithinPeriod_0 = 2;
#Slot Offset for the first txn in the 16 frame period #Slot Offset for the first txn in the 16 frame period
sl_TimeOffsetSSB_0 = 8; sl_TimeOffsetSSB_0 = 8;
#interval in slots for repetition of SL-SSB #interval in slots for repetition of SL-SSB
sl_TimeInterval_0 = 120; sl_TimeInterval_0 = 60;
} }
); );
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment