@@ -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