Skip to content

Commit c46230a

Browse files
saukacodebot
authored andcommitted
ofh: remove 1 port limitation in OFH PRACH handler
1 parent d3c0d7c commit c46230a

File tree

4 files changed

+17
-9
lines changed

4 files changed

+17
-9
lines changed

lib/ofh/receiver/ofh_uplane_uplink_symbol_manager.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,9 +78,10 @@ void uplane_uplink_symbol_manager::handle_prach_prbs(const message_decoder_resul
7878

7979
// Find resource grid port with eAxC.
8080
unsigned port = std::distance(prach_eaxc.begin(), std::find(prach_eaxc.begin(), prach_eaxc.end(), results.eaxc));
81-
if (port > 0) {
82-
logger.debug("Skipping port {} as PRACH buffer currently supports only 1 port", results.eaxc);
83-
81+
if (port >= prach_context.get_max_nof_ports()) {
82+
logger.debug("Skipping port {} as stored PRACH buffer supports up to {} ports",
83+
results.eaxc,
84+
prach_context.get_max_nof_ports());
8485
return;
8586
}
8687
logger.debug("Handling PRACH in slot {}: port={}, symbol={}", slot, port, uplane_results.params.symbol_id);

lib/ofh/support/uplink_context_repository.h

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,8 @@ class ul_prach_context
5353
ul_prach_context() = default;
5454

5555
/// Constructs an uplink PRACH context with the given PRACH buffer and PRACH buffer context.
56-
ul_prach_context(const prach_buffer_context& context_, prach_buffer& buffer_) :
57-
context(context_), buffer(&buffer_), nof_symbols(get_preamble_duration(context.format))
56+
ul_prach_context(const prach_buffer_context& context_, prach_buffer& buffer_, unsigned nof_ports_) :
57+
context(context_), buffer(&buffer_), nof_symbols(get_preamble_duration(context.format)), nof_ports(nof_ports_)
5858
{
5959
srsran_assert(context.nof_fd_occasions == 1, "Only supporting one frequency domain occasion");
6060
srsran_assert(context.nof_td_occasions == 1, "Only supporting one time domain occasion");
@@ -72,7 +72,7 @@ class ul_prach_context
7272
}
7373
// Initialize statistic.
7474
buffer_stats.buffer_nof_re = (preamble_info.sequence_length * nof_symbols);
75-
buffer_stats.re_written = static_vector<unsigned, MAX_NOF_SUPPORTED_EAXC>(buffer->get_max_nof_ports(), 0);
75+
buffer_stats.re_written = static_vector<unsigned, MAX_NOF_SUPPORTED_EAXC>(nof_ports, 0);
7676
}
7777

7878
/// Returns true if this context is empty, otherwise false.
@@ -84,6 +84,9 @@ class ul_prach_context
8484
/// Returns the number of symbols used by the PRACH associated with the stored context.
8585
unsigned get_prach_nof_symbols() const { return empty() ? 0U : nof_symbols; }
8686

87+
/// Gets the maximum number of ports supported in PRACH buffer.
88+
unsigned get_max_nof_ports() const { return empty() ? 0U : nof_ports; }
89+
8790
/// Writes the given IQ buffer corresponding to the given symbol and port and notifies that an uplink PRACH buffer is
8891
/// ready when all the PRBs for all the symbols and ports have been written in the buffer.
8992
bool update_buffer_and_notify(unsigned port,
@@ -133,6 +136,8 @@ class ul_prach_context
133136
prach_frequency_mapping_information freq_mapping_info;
134137
/// Number of OFDM symbols used by the stored PRACH.
135138
unsigned nof_symbols;
139+
/// Number of PRACH ports.
140+
unsigned nof_ports;
136141
};
137142

138143
/// Uplink slot context.

lib/ofh/transmitter/ofh_uplink_request_handler_impl.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,8 @@ void uplink_request_handler_impl::handle_prach_occasion(const prach_buffer_conte
6161
? get_prach_preamble_long_info(context.format)
6262
: get_prach_preamble_short_info(context.format, to_ra_subcarrier_spacing(context.pusch_scs), true);
6363

64-
ul_prach_context repo_context(context, buffer);
64+
unsigned nof_prach_ports = std::min(size_t(buffer.get_max_nof_ports()), prach_eaxc.size());
65+
ul_prach_context repo_context(context, buffer, nof_prach_ports);
6566

6667
// Store the context in the repository, use correct slot index for long format accounting for PRACH duration.
6768
if (is_short_preamble(context.format)) {

lib/phy/upper/upper_phy_factories.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -587,9 +587,10 @@ static std::unique_ptr<prach_buffer_pool> create_prach_pool(const upper_phy_conf
587587
std::unique_ptr<prach_buffer> buffer;
588588

589589
if (config.is_prach_long_format) {
590-
buffer = create_prach_buffer_long(1, config.max_nof_fd_prach_occasions);
590+
buffer = create_prach_buffer_long(config.nof_rx_ports, config.max_nof_fd_prach_occasions);
591591
} else {
592-
buffer = create_prach_buffer_short(1, config.max_nof_td_prach_occasions, config.max_nof_fd_prach_occasions);
592+
buffer = create_prach_buffer_short(
593+
config.nof_rx_ports, config.max_nof_td_prach_occasions, config.max_nof_fd_prach_occasions);
593594
}
594595

595596
report_fatal_error_if_not(buffer, "Invalid PRACH buffer.");

0 commit comments

Comments
 (0)