Skip to content

Commit 3bf4d72

Browse files
committed
phy: fix prach iq dump
The printer was always dumping the entire PRACH buffer instead of dumping only the samples used by the configured PRACH format.
1 parent abb5ff8 commit 3bf4d72

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

lib/phy/upper/upper_phy_rx_symbol_handler_printer_decorator.h

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,15 @@
1010

1111
#pragma once
1212

13+
#include "srsran/phy/support/prach_buffer.h"
14+
#include "srsran/phy/support/prach_buffer_context.h"
1315
#include "srsran/phy/support/resource_grid_reader.h"
1416
#include "srsran/phy/support/shared_resource_grid.h"
17+
#include "srsran/phy/upper/upper_phy_rx_symbol_handler.h"
18+
#include "srsran/ran/cyclic_prefix.h"
19+
#include "srsran/ran/prach/prach_constants.h"
20+
#include "srsran/ran/prach/prach_preamble_information.h"
1521
#include "srsran/srsvec/conversion.h"
16-
#include "srsran/support/error_handling.h"
1722
#include "srsran/support/executors/task_worker.h"
1823
#include <fstream>
1924

@@ -101,7 +106,15 @@ class upper_phy_rx_symbol_handler_printer_decorator : public upper_phy_rx_symbol
101106

102107
// Queue write request.
103108
if (print_prach && !worker.push_task([this, context, &buffer]() {
104-
unsigned nof_replicas = buffer.get_max_nof_symbols();
109+
// Retrieve preamble information.
110+
prach_preamble_information prach_info;
111+
if (is_long_preamble(context.format)) {
112+
prach_info = get_prach_preamble_long_info(context.format);
113+
} else {
114+
prach_info = get_prach_preamble_short_info(
115+
context.format, to_ra_subcarrier_spacing(context.pusch_scs), /*last_occasion=*/false);
116+
}
117+
unsigned nof_replicas = prach_info.nof_symbols;
105118
unsigned prach_start = 0;
106119
unsigned prach_stop = buffer.get_max_nof_ports();
107120
for (unsigned i_port = prach_start; i_port != prach_stop; ++i_port) {

0 commit comments

Comments
 (0)