Commit 0515cf98 authored by Jaroslava Fiedlerova's avatar Jaroslava Fiedlerova
Browse files

Merge branch 'integration_2025_w09' into 'develop'

Integration: `2025.w09`

See merge request !3284

* !3088 Support for long PRACH formats
* !3266 Add optional UTC time stamp to the logging module
* !3280 Changes required for UE to work as a rfsim server with channel modelling
* !3279 Fix UL-MCS when UL inactivity and no data
* !3283 Limit amp_dmrs to 16 bit signed max
parents f0fce7c1 302c39fa
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -70,7 +70,7 @@ gNBs =
        initialULBWPsubcarrierSpacing                               = 0;
      #rach-ConfigCommon
        #rach-ConfigGeneric
          prach_ConfigurationIndex                                  = 98;
          prach_ConfigurationIndex                                  = 7;
#prach_msg1_FDM
#0 = one, 1=two, 2=four, 3=eight
          prach_msg1_FDM                                            = 0;
@@ -96,11 +96,11 @@ gNBs =
        rsrp_ThresholdSSB                                           = 19;
#prach-RootSequenceIndex_PR
#1 = 839, 2 = 139
        prach_RootSequenceIndex_PR                                  = 2;
        prach_RootSequenceIndex_PR                                  = 1;
        prach_RootSequenceIndex                                     = 1;
        # SCS for msg1, can only be 15 for 30 kHz < 6 GHz, takes precendence over the one derived from prach-ConfigIndex
        #
        msg1_SubcarrierSpacing                                      = 0;
        # not allowed when format < 4
        # msg1_SubcarrierSpacing                                      = 0;
# restrictedSetConfig
# 0=unrestricted, 1=restricted type A, 2=restricted type B
        restrictedSetConfig                                         = 0;
+5 −2
Original line number Diff line number Diff line
@@ -19,8 +19,11 @@ The following options can be specified to trigger the information added in the h
- `thread_id`: add the thread ID
- `function`: add the function name
- `line_num`: adds the (source code) line number
- `time`: add the time since process started
- `wall_clock`: add the system-wide clock time that measures real (i.e., wall-clock) time (`time` and `wall_clock` are mutually exclusive)
- `time`: add the time since the system started in format `ss.ssssss` (seconds and microseconds sourced from `CLOCK_MONOTONIC`)
- `wall_clock`: add the system-wide clock time that measures real (i.e., wall-clock) time in format `ss.ssssss` (seconds and microseconds since 1970-01-01 00:00:00 Coordinated Universal Time (UTC))
- `utc_time`: add the UTC (Coordinated Universal Time) time in format `YYYY-MM-DD hh:mm:ss.ssssss UTC`. Note that this time is independent of the current time zone (it shows GMT). Also, printing this time has additional overhead compared to other time methods (due to time conversion and formatting).

Note: `time`, `utc_time` and `wall_clock` are mutually exclusive and cannot be used together.

### Component specific parameters
| name | type | default | description |
+19 −8
Original line number Diff line number Diff line
@@ -103,7 +103,8 @@ static const unsigned int FLAG_FILE_LINE = 1 << 4;
static const unsigned int FLAG_TIME = 1 << 5;
static const unsigned int FLAG_THREAD_ID = 1 << 6;
static const unsigned int FLAG_REAL_TIME = 1 << 7;
static const unsigned int FLAG_INITIALIZED = 1 << 8;
static const unsigned int FLAG_UTC_TIME = 1 << 8;
static const unsigned int FLAG_INITIALIZED = 1 << 9;

/** @}*/
static mapping log_options[] = {{"nocolor", FLAG_NOCOLOR},
@@ -114,6 +115,7 @@ static mapping log_options[] = {{"nocolor", FLAG_NOCOLOR},
                                      {"time", FLAG_TIME},
                                      {"thread_id", FLAG_THREAD_ID},
                                      {"wall_clock", FLAG_REAL_TIME},
                                      {"utc_time", FLAG_UTC_TIME},
                                      {NULL, -1}};
mapping * log_option_names_ptr(void)
{
@@ -500,8 +502,8 @@ int logInit (void)
    memset(&(g_log->log_component[i]),0,sizeof(log_component_t));
  }

  AssertFatal(!((g_log->flag & FLAG_TIME) && (g_log->flag & FLAG_REAL_TIME)),
		   "Invalid log options: time and wall_clock both set but are mutually exclusive\n");
  AssertFatal(__builtin_popcount(g_log->flag & (FLAG_TIME | FLAG_REAL_TIME | FLAG_UTC_TIME)) <= 1,
          "Invalid log options: time, wall_clock and utc_time are mutually exclusive\n");

  g_log->flag =  g_log->flag | FLAG_INITIALIZED;
  return 0;
@@ -545,15 +547,24 @@ static inline int log_header(log_component_t *c,
    l[0] = 0;

  // output time information
  char timeString[32];
  if ((flag & FLAG_TIME) || (flag & FLAG_REAL_TIME)) {
  char timeString[64];
  if ((flag & FLAG_TIME) || (flag & FLAG_REAL_TIME) || (flag & FLAG_UTC_TIME)) {
    struct timespec t;
    const clockid_t clock = flag & FLAG_TIME ? CLOCK_MONOTONIC : CLOCK_REALTIME;
    if (clock_gettime(clock, &t) == -1)
       abort();
    if (flag & FLAG_UTC_TIME) {
      struct tm utc_time;
      if (gmtime_r(&t.tv_sec, &utc_time) == NULL)
        abort();
      snprintf(timeString, sizeof(timeString), "%04d-%02d-%02d %02d:%02d:%02d.%06lu UTC ",
               utc_time.tm_year + 1900, utc_time.tm_mon + 1, utc_time.tm_mday,
               utc_time.tm_hour, utc_time.tm_min, utc_time.tm_sec, t.tv_nsec / 1000);
    } else {
      snprintf(timeString, sizeof(timeString), "%lu.%06lu ",
               t.tv_sec,
               t.tv_nsec / 1000);
    }
  } else {
    timeString[0] = 0;
  }
+52 −0
Original line number Diff line number Diff line
@@ -1287,6 +1287,58 @@ int get_scan_ssb_first_sc(const double fc, const int nbRB, const int nrBand, con
  return numGscn;
}

// Table 38.211 6.3.3.1-1
static uint8_t long_prach_dur[4] = {1, 3, 4, 1}; // 0.9, 2.28, 3.35, 0.9 ms

uint8_t get_long_prach_dur(unsigned int format, unsigned int mu)
{
  AssertFatal(format < 4, "Invalid long PRACH format %d\n", format);
  const int num_slots_subframe = (1 << mu);
  const int prach_dur_subframes = long_prach_dur[format];
  return (prach_dur_subframes * num_slots_subframe);
}

// Table 38.211 6.3.3.2-1
uint8_t get_PRACH_k_bar(unsigned int delta_f_RA_PRACH, unsigned int delta_f_PUSCH)
{
  uint8_t k_bar = 0;
  if (delta_f_RA_PRACH > 3) { // Rel 15 max PRACH SCS is 120 kHz, 4 and 5 are 1.25 and 5 kHz
    // long formats
    DevAssert(delta_f_PUSCH < 3);
    DevAssert(delta_f_RA_PRACH < 6);
    const uint8_t k_bar_table[3][2] = {{7, 12},
                                       {1, 10},
                                       {133, 7}};

    k_bar = k_bar_table[delta_f_PUSCH][delta_f_RA_PRACH - 4];
  } else {
    if (delta_f_RA_PRACH == 3 && delta_f_PUSCH == 4) // \delta f_RA == 120 kHz AND \delta f == 480 kHz
      k_bar = 1;
    else if (delta_f_RA_PRACH == 3 && delta_f_PUSCH == 5) // \delta f_RA == 120 kHz AND \delta f == 960 kHz
      k_bar = 23;
    else
      k_bar = 2;
  }
  return k_bar;
}

// K according to 38.211 5.3.2
unsigned int get_prach_K(int prach_sequence_length, int prach_fmt_id, int pusch_mu, int prach_mu)
{
  unsigned int K = 1;
  if (prach_sequence_length == 0) {
    if (prach_fmt_id == 3)
      K = (15 << pusch_mu) / 5;
    else
      K = (15 << pusch_mu) / 1.25;
  } else if (prach_sequence_length == 1) {
    K = (15 << pusch_mu) / (15 << prach_mu);
  } else {
    AssertFatal(0, "Invalid PRACH sequence length %d\n", prach_sequence_length);
  }
  return K;
}

int get_delay_idx(int delay, int max_delay_comp)
{
  int delay_idx = max_delay_comp + delay;
+3 −0
Original line number Diff line number Diff line
@@ -287,6 +287,9 @@ void check_ssb_raster(uint64_t freq, int band, int scs);
int get_smallest_supported_bandwidth_index(int scs, frequency_range_t frequency_range, int n_rbs);
unsigned short get_m_srs(int c_srs, int b_srs);
unsigned short get_N_b_srs(int c_srs, int b_srs);
uint8_t get_long_prach_dur(unsigned int format, unsigned int num_slots_subframe);
uint8_t get_PRACH_k_bar(unsigned int delta_f_RA_PRACH, unsigned int delta_f_PUSCH);
unsigned int get_prach_K(int prach_sequence_length, int prach_fmt_id, int pusch_mu, int prach_mu);

int get_slot_idx_in_period(const int slot, const frame_structure_t *fs);

Loading