1818#include " srsran/phy/upper/channel_processors/pusch/pusch_processor_result_notifier.h"
1919#include " srsran/phy/upper/rx_buffer_pool.h"
2020#include " srsran/phy/upper/unique_rx_buffer.h"
21- #include " srsran/ran/pdsch/dlsch_info.h"
2221#include " srsran/ran/precoding/precoding_codebooks.h"
2322#include " srsran/ran/pusch/pusch_mcs.h"
2423#include " srsran/ran/sch/sch_dmrs_power.h"
2524#include " srsran/ran/sch/sch_mcs.h"
2625#include " srsran/ran/sch/tbs_calculator.h"
2726#include " srsran/support/executors/task_worker_pool.h"
28- #include " fmt/ostream.h"
2927#include < condition_variable>
3028#include < getopt.h>
3129#include < mutex>
3230#include < random>
3331#include < thread>
34- #include < tuple>
3532
3633using namespace srsran ;
3734
3835static constexpr subcarrier_spacing scs = subcarrier_spacing::kHz30 ;
3936static constexpr uint16_t rnti = 0x1234 ;
40- static constexpr unsigned bwp_size_rb = 273 ;
4137static constexpr unsigned bwp_start_rb = 0 ;
4238static constexpr unsigned nof_layers = 1 ;
4339static constexpr unsigned nof_ofdm_symbols = 14 ;
@@ -59,9 +55,9 @@ static std::string channel_fading_distribution = "uniform-
5955static float sinr_dB = 60 .0F ;
6056static unsigned nof_corrupted_re_per_ofdm_symbol = 0 ;
6157static unsigned nof_rx_ports = 2 ;
58+ static unsigned bwp_size_rb = 273 ;
6259static pusch_mcs_table mcs_table = pusch_mcs_table::qam64;
6360static sch_mcs_index mcs_index = 20 ;
64- static prb_interval freq_allocation = {bwp_start_rb, bwp_size_rb};
6561static bool enable_dc_position = false ;
6662
6763namespace {
@@ -177,6 +173,9 @@ class pxsch_bler_test
177173 // Compute modulation and code scheme.
178174 sch_mcs_description mcs_descr = pusch_mcs_get_config (mcs_table, mcs_index, false );
179175
176+ // Frequency allocation equal to bandwidth part.
177+ static prb_interval freq_allocation = {bwp_start_rb, bwp_size_rb};
178+
180179 // Calculate transport block size.
181180 tbs_calculator_configuration tbs_config = {};
182181 tbs_config.mcs_descr = mcs_descr;
@@ -414,27 +413,25 @@ class pxsch_bler_test
414413 double mean_iterations = static_cast <double >(count_iterations) / static_cast <double >(count * nof_codeblocks);
415414
416415 // Print results.
417- if (show_stats) {
418- fmt::print (" Iterations={{{:<2} {:<2} {:<3.1f}}}; "
419- " BLER={:.10f}/{:.10f}; "
420- " SINR={{{:+.2f} {:+.2f} {:+.2f}}}; "
421- " EVM={{{:.3f} {:.3f} {:.3f}}}; "
422- " TA={{{:.2f} {:.2f} {:.2f}}}us;\n " ,
423- min_iterations,
424- max_iterations,
425- mean_iterations,
426- crc_bler,
427- data_bler,
428- sinr_stats.get_min (),
429- sinr_stats.get_max (),
430- sinr_stats.get_mean (),
431- evm_stats.get_min (),
432- evm_stats.get_max (),
433- evm_stats.get_mean (),
434- ta_stats_us.get_min (),
435- ta_stats_us.get_max (),
436- ta_stats_us.get_mean ());
437- }
416+ fmt::print (" Iterations={{{:<2} {:<2} {:<3.1f}}}; "
417+ " BLER={:.10f}/{:.10f}; "
418+ " SINR={{{:+.2f} {:+.2f} {:+.2f}}}; "
419+ " EVM={{{:.3f} {:.3f} {:.3f}}}; "
420+ " TA={{{:.2f} {:.2f} {:.2f}}}us;\n " ,
421+ min_iterations,
422+ max_iterations,
423+ mean_iterations,
424+ crc_bler,
425+ data_bler,
426+ sinr_stats.get_min (),
427+ sinr_stats.get_max (),
428+ sinr_stats.get_mean (),
429+ evm_stats.get_min (),
430+ evm_stats.get_max (),
431+ evm_stats.get_mean (),
432+ ta_stats_us.get_min (),
433+ ta_stats_us.get_max (),
434+ ta_stats_us.get_mean ());
438435 }
439436
440437 unsigned nof_codeblocks;
@@ -468,6 +465,7 @@ static void usage(std::string_view prog)
468465 fmt::print (" \t -S SINR. [Default {}]\n " , sinr_dB);
469466 fmt::print (" \t -N Number of corrupted RE per OFDM symbol. [Default {}]\n " , nof_corrupted_re_per_ofdm_symbol);
470467 fmt::print (" \t -P Number of receive ports. [Default {}]\n " , nof_rx_ports);
468+ fmt::print (" \t -B Number of allocated PRBs (same as BWP size). [Default {}]\n " , bwp_size_rb);
471469 fmt::print (" \t -M MCS table. [Default {}]\n " , mcs_table);
472470 fmt::print (" \t -m MCS index. [Default {}]\n " , mcs_index);
473471 fmt::print (" \t -R Number of slots to process. [Default {}]\n " , nof_repetitions);
@@ -478,7 +476,7 @@ static void usage(std::string_view prog)
478476static void parse_args (int argc, char ** argv)
479477{
480478 int opt = 0 ;
481- while ((opt = getopt (argc, argv, " C:F:S:N:P:R:M:m:Dvh" )) != -1 ) {
479+ while ((opt = getopt (argc, argv, " C:F:S:N:P:R:B: M:m:Dvh" )) != -1 ) {
482480 switch (opt) {
483481 case ' C' :
484482 if (optarg != nullptr ) {
@@ -502,6 +500,9 @@ static void parse_args(int argc, char** argv)
502500 case ' P' :
503501 nof_rx_ports = std::strtol (optarg, nullptr , 10 );
504502 break ;
503+ case ' B' :
504+ bwp_size_rb = std::strtol (optarg, nullptr , 10 );
505+ break ;
505506 case ' M' :
506507 if (optarg != nullptr ) {
507508 std::optional<pusch_mcs_table> table = to_mcs_table (optarg);
@@ -538,4 +539,4 @@ int main(int argc, char** argv)
538539 test.run ();
539540
540541 return 0 ;
541- }
542+ }
0 commit comments