Skip to content

Commit 0331dcc

Browse files
author
codebot
committed
Update main
# Conflicts: # lib/ran/csi_report/csi_report_wideband_cqi.cpp
2 parents c54bcfe + 2fe529b commit 0331dcc

File tree

18 files changed

+690
-147
lines changed

18 files changed

+690
-147
lines changed

CMakeLists.txt

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -281,33 +281,23 @@ if (AUTO_DETECT_ISA)
281281

282282
if (HAVE_AVX2)
283283
add_definitions(-DHAVE_AVX2)
284-
if (NOT HAVE_MARCH)
285-
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mavx2")
286-
endif(NOT HAVE_MARCH)
284+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mavx2")
287285
endif (HAVE_AVX2)
288286
if (HAVE_AVX)
289287
add_definitions(-DHAVE_AVX)
290-
if (NOT HAVE_MARCH)
291-
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mavx")
292-
endif(NOT HAVE_MARCH)
288+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mavx")
293289
endif (HAVE_AVX)
294290
if (HAVE_SSE)
295291
add_definitions(-DHAVE_SSE)
296-
if (NOT HAVE_MARCH)
297-
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -msse4.2")
298-
endif(NOT HAVE_MARCH)
292+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -msse4.1")
299293
endif (HAVE_SSE)
300294
if (HAVE_FMA)
301295
add_definitions(-DHAVE_FMA)
302-
if (NOT HAVE_MARCH)
303-
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mfma")
304-
endif(NOT HAVE_MARCH)
296+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mfma")
305297
endif (HAVE_FMA)
306298
if (HAVE_AVX512)
307299
add_definitions(-DHAVE_AVX512)
308-
if (NOT HAVE_MARCH)
309-
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mavx512f -mavx512cd -mavx512bw -mavx512dq")
310-
endif(NOT HAVE_MARCH)
300+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mavx512f -mavx512cd -mavx512bw -mavx512dq")
311301
endif (HAVE_AVX512)
312302
else (AUTO_DETECT_ISA)
313303
unset(HAVE_SSE CACHE)

apps/gnb/gnb_worker_manager.h

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ class affinity_mask_manager
4141
public:
4242
/// Creates the tuned affinity mask manager with the given number of threads per core, reserves given amount of CPU
4343
/// cores for non priority tasks.
44-
explicit affinity_mask_manager(unsigned nof_threads_per_core_ = 2U, unsigned nof_cores_for_non_prio_threads_ = 4U) :
44+
explicit affinity_mask_manager(unsigned nof_threads_per_core_, unsigned nof_cores_for_non_prio_threads_) :
4545
nof_threads_per_core(nof_threads_per_core_),
4646
nof_cores_for_non_prio_threads(nof_cores_for_non_prio_threads_),
4747
cpu_bitset(compute_host_nof_hardware_threads())
@@ -56,6 +56,15 @@ class affinity_mask_manager
5656
cpu_bitset.fill(0, nof_cores_for_non_prio_threads, true);
5757
}
5858

59+
/// Default constructor.
60+
affinity_mask_manager() :
61+
nof_threads_per_core(2U),
62+
nof_cores_for_non_prio_threads(compute_host_nof_hardware_threads() / 2),
63+
cpu_bitset(compute_host_nof_hardware_threads())
64+
{
65+
cpu_bitset.fill(0, nof_cores_for_non_prio_threads, true);
66+
}
67+
5968
/// \brief Returns an affinity mask with assigned CPU indexes.
6069
///
6170
/// \param name Name of the task trying to reserve a CPU core.

include/srsran/phy/upper/channel_processors/ulsch_demultiplex.h

Lines changed: 40 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,16 @@
3131

3232
namespace srsran {
3333

34-
/// \brief Uplink Shared Channel demultiplexer interface.
34+
/// \brief User interface of the Uplink Shared Channel (UL-SCH) demultiplexer.
3535
///
36-
/// User interface of the Uplink Shared Channel (UL-SCH) demultiplexer.
36+
/// Note that, for calculating the CSI Part 2 report size, it is necessary to decode the CSI Part 1. Consequently, the
37+
/// CSI Part 1 report soft bits can be demultiplexed with a dedicated method (see \ref
38+
/// ulsch_demultiplex::demultiplex_csi_part1). After decoding the CSI Part 1 report, all the remaining UL-SCH fields can
39+
/// be demultiplexed at once (see \ref ulsch_demultiplex::demultiplex_sch_harq_ack_and_csi_part2).
40+
41+
///
42+
/// All fields can be demultiplexed simultaneously if CSI Part 2 is not present (see \ref
43+
/// ulsch_demultiplex::demultiplex).
3744
class ulsch_demultiplex
3845
{
3946
public:
@@ -78,14 +85,41 @@ class ulsch_demultiplex
7885
/// Default destructor.
7986
virtual ~ulsch_demultiplex() = default;
8087

88+
/// \brief Demultiplexes the CSI Part 1 report from the UL-SCH transmission.
89+
/// \param[out] csi_part1 CSI Part 1 report soft bits.
90+
/// \param[in] input Input soft bits to demultiplex.
91+
/// \param[in] nof_enc_harq_ack_bits Number of HARQ-ACK information bits multiplexed in the PUSCH message. Parameter
92+
/// \f$O_\textup{HARQ-ACK}\f$.
93+
/// \param[in] config UL-SCH demultiplexing parameters.
94+
virtual void demultiplex_csi_part1(span<log_likelihood_ratio> csi_part1,
95+
span<const log_likelihood_ratio> input,
96+
unsigned nof_enc_harq_ack_bits,
97+
const configuration& config) = 0;
98+
99+
/// \brief Demultiplexes the Shared Channel (SCH) data, the HARQ-ACK information bits and the CSI Part 2 report from
100+
/// the UL-SCH transmission.
101+
/// \param[out] sch_data Shared channel data soft bits.
102+
/// \param[out] harq_ack HARQ-ACK information soft bits.
103+
/// \param[out] csi_part2 CSI Part 2 report soft bits.
104+
/// \param[in] input Input soft bits to demultiplex.
105+
/// \param[in] nof_enc_csi_part1_bits Number of HARQ-ACK information bits multiplexed in the PUSCH message. Parameter
106+
/// \f$O_\textup{CSI-1}\f$.
107+
/// \param[in] config UL-SCH demultiplexing parameters.
108+
virtual void demultiplex_sch_harq_ack_and_csi_part2(span<log_likelihood_ratio> sch_data,
109+
span<log_likelihood_ratio> harq_ack,
110+
span<log_likelihood_ratio> csi_part2,
111+
span<const log_likelihood_ratio> input,
112+
unsigned nof_enc_csi_part1_bits,
113+
const configuration& config) = 0;
114+
81115
/// \brief Demultiplexes Uplink Shared Channel (UL-SCH).
82116
///
83117
/// Demultiplexes the different information fields from the UL-SCH transmission.
84118
///
85-
/// \param[out] sch_data Destination of the resultant shared channel data soft bits.
86-
/// \param[out] harq_ack Destination of HARQ-ACK information soft bits.
87-
/// \param[out] csi_part1 Destination CSI Part 1 report soft bits.
88-
/// \param[out] csi_part2 Destination CSI Part 2 report soft bits.
119+
/// \param[out] sch_data Shared channel data soft bits.
120+
/// \param[out] harq_ack HARQ-ACK information soft bits.
121+
/// \param[out] csi_part1 CSI Part 1 report soft bits.
122+
/// \param[out] csi_part2 CSI Part 2 report soft bits.
89123
/// \param[in] input Input soft bits to demultiplex.
90124
/// \param[in] config UL-SCH demultiplexing parameters.
91125
virtual void demultiplex(span<log_likelihood_ratio> sch_data,

include/srsran/ran/csi_report/csi_report_configuration.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -91,13 +91,10 @@ inline const char* to_string(csi_report_quantities quantities)
9191
switch (quantities) {
9292
case srsran::csi_report_quantities::cri_ri_pmi_cqi:
9393
return "cri-ri-pmi-cqi";
94-
break;
9594
case srsran::csi_report_quantities::cri_ri_cqi:
9695
return "cri-ri-cqi";
97-
break;
9896
case srsran::csi_report_quantities::cri_ri_li_pmi_cqi:
9997
return "cri-ri-li-pmi-cqi";
100-
break;
10198
case srsran::csi_report_quantities::other:
10299
default:
103100
return "other";
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
/*
2+
*
3+
* Copyright 2021-2023 Software Radio Systems Limited
4+
*
5+
* This file is part of srsRAN.
6+
*
7+
* srsRAN is free software: you can redistribute it and/or modify
8+
* it under the terms of the GNU Affero General Public License as
9+
* published by the Free Software Foundation, either version 3 of
10+
* the License, or (at your option) any later version.
11+
*
12+
* srsRAN is distributed in the hope that it will be useful,
13+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
14+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15+
* GNU Affero General Public License for more details.
16+
*
17+
* A copy of the GNU Affero General Public License can be found in
18+
* the LICENSE file in the top-level directory of this distribution
19+
* and at http://www.gnu.org/licenses/.
20+
*
21+
*/
22+
23+
#pragma once
24+
#include "srsran/adt/span.h"
25+
#include "srsran/ran/uci/uci_part2_size_description.h"
26+
27+
namespace srsran {
28+
29+
/// \brief Calculates the UCI part 2 from UCI part 1.
30+
/// \param[in] part1 UCI part 1 decoded data.
31+
/// \param[in] descr UCI part 1 parameters correspondence to UCI part 2 size.
32+
/// \return The size of UCI part 2 payload.
33+
unsigned uci_part2_get_size(span<const uint8_t> part1, const uci_part2_size_description& descr);
34+
35+
} // namespace srsran
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
/*
2+
*
3+
* Copyright 2021-2023 Software Radio Systems Limited
4+
*
5+
* This file is part of srsRAN.
6+
*
7+
* srsRAN is free software: you can redistribute it and/or modify
8+
* it under the terms of the GNU Affero General Public License as
9+
* published by the Free Software Foundation, either version 3 of
10+
* the License, or (at your option) any later version.
11+
*
12+
* srsRAN is distributed in the hope that it will be useful,
13+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
14+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15+
* GNU Affero General Public License for more details.
16+
*
17+
* A copy of the GNU Affero General Public License can be found in
18+
* the LICENSE file in the top-level directory of this distribution
19+
* and at http://www.gnu.org/licenses/.
20+
*
21+
*/
22+
23+
#pragma once
24+
#include "srsran/adt/static_vector.h"
25+
26+
namespace srsran {
27+
28+
/// Collects the parameters that describe the UCI Part 1 correspondence to Part 2 sizes.
29+
struct uci_part2_size_description {
30+
/// Maximum number of parameters.
31+
static constexpr unsigned max_nof_parameters = 2;
32+
/// Maximum number of Part 2 entries.
33+
static constexpr unsigned max_nof_entries = 2;
34+
/// Maximum number of aggregated bits per entry.
35+
static constexpr unsigned max_nof_entry_bits = 4;
36+
/// Maximum number of Part 2 sizes per entry.
37+
static constexpr unsigned max_size_table = 1U << max_nof_entry_bits;
38+
39+
/// Collects parameter attributes.
40+
struct parameter {
41+
/// Bit offset of the parameter from the beginning of the Part 1.
42+
uint16_t offset;
43+
/// CSI Part 1 parameter bit width.
44+
uint8_t width;
45+
};
46+
47+
/// Collects the parameters to determine a single CSI Part 2 report.
48+
struct entry {
49+
/// \brief Part 1 parameters that influence the size of this part 2.
50+
/// \remark The total accumulated width of the parameters must not exceed \ref max_nof_entry_bits bits.
51+
static_vector<parameter, max_nof_parameters> parameters;
52+
/// \brief Maps the concatenation of the parameters to Part 2 size.
53+
static_vector<uint16_t, max_size_table> map;
54+
};
55+
56+
/// CSI Part 2 entries.
57+
static_vector<entry, max_nof_entries> entries;
58+
};
59+
60+
} // namespace srsran

include/srsran/srsvec/bit.h

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,16 @@ void bit_unpack(span<uint8_t> unpacked, const bit_buffer& packed);
6565
/// \remark After execution, \c bits will contain only the unused bits.
6666
unsigned bit_pack(span<const uint8_t>& bits, unsigned nof_bits);
6767

68+
/// \brief Packs the input bits into an integer value.
69+
///
70+
/// The first bit in the sequence corresponds to the bit of index <tt> bits.size() - 1 </tt> of the returned value. The
71+
/// last value in the sequence corresponds to LSB of the returned value.
72+
///
73+
/// \param[in] bits View of unpacked bits.
74+
/// \return An integer containing the packed bits.
75+
/// \remark The number of elements must not exceed 32 bits.
76+
unsigned bit_pack(span<const uint8_t> bits);
77+
6878
/// \brief Packs a number of bits into bytes.
6979
/// \param[out] packed View of packed bits.
7080
/// \param[in] unpacked View of unpacked bits.

lib/phy/upper/channel_processors/pusch_processor_impl.cpp

Lines changed: 42 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -246,24 +246,23 @@ void pusch_processor_impl::process(span<uint8_t> data,
246246

247247
// Prepare buffers.
248248
span<log_likelihood_ratio> sch_llr = span<log_likelihood_ratio>(temp_sch_llr).first(info.nof_ul_sch_bits.value());
249-
span<log_likelihood_ratio> harq_ack_llr =
250-
span<log_likelihood_ratio>(temp_harq_ack_llr).first(info.nof_harq_ack_bits.value());
251-
span<log_likelihood_ratio> csi_part1_llr =
252-
span<log_likelihood_ratio>(temp_csi_part1_llr).first(info.nof_csi_part1_bits.value());
253-
span<log_likelihood_ratio> csi_part2_llr =
254-
span<log_likelihood_ratio>(temp_csi_part2_llr).first(info.nof_csi_part2_bits.value());
255-
256-
// Demultiplex UL-SCH if any of UCI field is present.
257-
if ((pdu.uci.nof_harq_ack > 0) || (pdu.uci.nof_csi_part1 > 0) || (pdu.uci.nof_csi_part2 > 0)) {
258-
// Demultiplexes UL-SCH codeword.
259-
demultiplex->demultiplex(sch_llr, harq_ack_llr, csi_part1_llr, csi_part2_llr, codeword_llr, demux_config);
260-
} else {
261-
// Overwrite the view of the codeword.
262-
sch_llr = codeword_llr;
263-
}
264249

265-
// Process UCI.
266-
if (pdu.uci.nof_harq_ack || pdu.uci.nof_csi_part1 || pdu.uci.nof_csi_part2) {
250+
// Process UCI if HARQ-ACK or CSI reports are present.
251+
if ((pdu.uci.nof_harq_ack > 0) || (pdu.uci.nof_csi_part1 > 0)) {
252+
span<log_likelihood_ratio> harq_ack_llr =
253+
span<log_likelihood_ratio>(temp_harq_ack_llr).first(info.nof_harq_ack_bits.value());
254+
span<log_likelihood_ratio> csi_part1_llr =
255+
span<log_likelihood_ratio>(temp_csi_part1_llr).first(info.nof_csi_part1_bits.value());
256+
257+
// Depending on CSI Part 2 report.
258+
if (pdu.uci.nof_csi_part2 > 0) {
259+
// Demultiplex HARQ-ACK and CSI Part 1.
260+
demultiplex->demultiplex_csi_part1(csi_part1_llr, codeword_llr, info.nof_harq_ack_bits.value(), demux_config);
261+
} else {
262+
// Demultiplex SCH data, HARQ-ACK and CSI Part 1.
263+
demultiplex->demultiplex(sch_llr, harq_ack_llr, csi_part1_llr, {}, codeword_llr, demux_config);
264+
}
265+
267266
// Prepare UCI decoder configuration.
268267
uci_decoder::configuration uci_dec_config;
269268
uci_dec_config.modulation = pdu.mcs_descr.modulation;
@@ -278,11 +277,35 @@ void pusch_processor_impl::process(span<uint8_t> data,
278277
// Decode CSI Part 1.
279278
result_uci.csi_part1 = decode_uci_field(csi_part1_llr, pdu.uci.nof_csi_part1, uci_dec_config);
280279

281-
// Decode HARQ-ACK.
282-
result_uci.csi_part2 = decode_uci_field(csi_part2_llr, pdu.uci.nof_csi_part2, uci_dec_config);
280+
// If CSI Part 2 is enabled.
281+
if (pdu.uci.nof_csi_part2 > 0) {
282+
// Calculate the number of CSI Part 2 payload bits.
283+
unsigned nof_csi_part2 = pdu.uci.nof_csi_part2;
284+
285+
// Calculate the number of CSI Part 2 encoded bits.
286+
unsigned nof_enc_csi_part2 = info.nof_csi_part2_bits.value();
287+
288+
// Prepare view of CSI Part 2 report LLRs.
289+
span<log_likelihood_ratio> csi_part2_llr =
290+
span<log_likelihood_ratio>(temp_csi_part2_llr).first(nof_enc_csi_part2);
291+
292+
// Demultiplex SCH data and CSI Part 2 bits.
293+
demultiplex->demultiplex_sch_harq_ack_and_csi_part2(
294+
sch_llr, harq_ack_llr, csi_part2_llr, codeword_llr, csi_part1_llr.size(), demux_config);
295+
296+
// Decode CSI Part 2.
297+
result_uci.csi_part2 = decode_uci_field(csi_part2_llr, nof_csi_part2, uci_dec_config);
298+
} else {
299+
// Otherwise, clear CSI Part 2 result.
300+
result_uci.csi_part2.status = uci_status::unknown;
301+
result_uci.csi_part2.payload.clear();
302+
}
283303

284304
// Report UCI if at least one field is present.
285305
notifier.on_uci(result_uci);
306+
} else {
307+
// Overwrite the view of the codeword to avoid copying SCH data.
308+
sch_llr = codeword_llr;
286309
}
287310

288311
// Decode codeword if present.

0 commit comments

Comments
 (0)