Skip to content

Commit 9cd59ab

Browse files
xavierarteagacodebot
authored andcommitted
phy: review memory related
phy: fix compilation
1 parent 0ecf050 commit 9cd59ab

File tree

4 files changed

+7
-5
lines changed

4 files changed

+7
-5
lines changed

lib/phy/upper/channel_modulation/evm_calculator_generic_impl.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,9 @@ float evm_calculator_generic_impl::calculate(span<const log_likelihood_ratio> so
3434
float avg_power = 0.0;
3535

3636
while (!soft_bits.empty()) {
37-
unsigned block_nof_symbols = std::min(static_cast<unsigned>(symbols.size()), MAX_NOF_SYMBOLS);
38-
unsigned block_nof_bits = block_nof_symbols * bits_per_symbol;
37+
unsigned block_nof_symbols =
38+
std::min(static_cast<unsigned>(symbols.size()), static_cast<unsigned>(MAX_NOF_SYMBOLS));
39+
unsigned block_nof_bits = block_nof_symbols * bits_per_symbol;
3940

4041
// Perform hard-decision.
4142
bit_buffer hard_bits = temp_hard_bits.first(block_nof_bits);

lib/phy/upper/channel_modulation/evm_calculator_generic_impl.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,9 @@ class evm_calculator_generic_impl : public evm_calculator
3333
modulation_scheme modulation) override;
3434

3535
private:
36-
/// Maximum number of symbols assuming 156 RE/RB, 275 RB and 4 layers.
36+
/// Maximum processing block size in number of symbols.
3737
static constexpr unsigned MAX_NOF_SYMBOLS = 4096;
38-
/// Maximum number of bits.
38+
/// Maximum processing block size in number of bits.
3939
static constexpr unsigned MAX_NOF_BITS = MAX_NOF_SYMBOLS * 8;
4040
/// Internal modulator.
4141
std::unique_ptr<modulation_mapper> modulator;

lib/phy/upper/channel_processors/channel_processor_factories.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -321,6 +321,7 @@ class pdsch_processor_concurrent_factory_sw : public pdsch_processor_factory
321321
srsran_assert(rate_matcher_factory, "Invalid rate matcher factory.");
322322
srsran_assert(prg_factory, "Invalid PRG factory.");
323323
srsran_assert(modulator_factory, "Invalid modulator factory.");
324+
srsran_assert(dmrs_factory, "Invalid DM-RS factory.");
324325
srsran_assert(nof_concurrent_threads > 1, "Number of concurrent threads must be greater than one.");
325326

326327
// Create vector of codeblock processors.

lib/phy/upper/upper_phy_rx_symbol_handler_impl.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ class rx_payload_buffer_pool
3434
/// Returns the next available buffer from the pool.
3535
span<uint8_t> acquire_payload_buffer(units::bytes size)
3636
{
37-
srsran_assert(size.to_bits() <= static_cast<units::bits>(MAX_BUFFER_SIZE),
37+
srsran_assert(size.to_bits().value() <= pool[index].size(),
3838
"Buffer size (i.e., {}) exceeds maximum {}.",
3939
size,
4040
pool[index].size());

0 commit comments

Comments
 (0)