|
|
@ -25,6 +25,7 @@ static double assert_sr_detection_min = 1.000;
|
|
|
|
static double assert_cqi_detection_min = 1.000;
|
|
|
|
static double assert_cqi_detection_min = 1.000;
|
|
|
|
static double assert_pusch_bler_max = 0.000;
|
|
|
|
static double assert_pusch_bler_max = 0.000;
|
|
|
|
static double assert_pdsch_bler_max = 0.000;
|
|
|
|
static double assert_pdsch_bler_max = 0.000;
|
|
|
|
|
|
|
|
static double assert_prach_detection_min = 1.000;
|
|
|
|
|
|
|
|
|
|
|
|
test_bench::args_t::args_t(int argc, char** argv)
|
|
|
|
test_bench::args_t::args_t(int argc, char** argv)
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -236,34 +237,57 @@ int main(int argc, char** argv)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// Print PRACH
|
|
|
|
// Print PRACH
|
|
|
|
|
|
|
|
double prach_detection = 0.0;
|
|
|
|
|
|
|
|
uint32_t prach_tx_count = 0;
|
|
|
|
|
|
|
|
uint32_t prach_rx_count = 0;
|
|
|
|
if (metrics.ue_stack.prach.size() > 0) {
|
|
|
|
if (metrics.ue_stack.prach.size() > 0) {
|
|
|
|
srsran::console("PRACH:\n");
|
|
|
|
srsran::console("PRACH:\n");
|
|
|
|
srsran::console(" UE transmitted:\n");
|
|
|
|
srsran::console(
|
|
|
|
srsran::console(" +------------+------------+\n");
|
|
|
|
" +------------+------------+------------+------------+------------+------------+------------+\n");
|
|
|
|
srsran::console(" | %10s | %10s |\n", "preamble", "count");
|
|
|
|
srsran::console(" | %10s | %10s | %10s | %10s | %10s | %10s | %10s |\n",
|
|
|
|
srsran::console(" +------------+------------+\n");
|
|
|
|
"Preamble",
|
|
|
|
|
|
|
|
"Transmit'd",
|
|
|
|
|
|
|
|
"Received",
|
|
|
|
|
|
|
|
"Detection",
|
|
|
|
|
|
|
|
"Avg TA",
|
|
|
|
|
|
|
|
"Min TA",
|
|
|
|
|
|
|
|
"Max TA");
|
|
|
|
|
|
|
|
srsran::console(
|
|
|
|
|
|
|
|
" +------------+------------+------------+------------+------------+------------+------------+\n");
|
|
|
|
|
|
|
|
|
|
|
|
for (const auto& p : metrics.ue_stack.prach) {
|
|
|
|
for (const auto& p : metrics.ue_stack.prach) {
|
|
|
|
srsran::console(" | %10d | %10d |\n", p.first, p.second.count);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Ensure the detected count matches with transmission
|
|
|
|
// Ensure the detected count matches with transmission
|
|
|
|
TESTASSERT(metrics.gnb_stack.prach.count(p.first));
|
|
|
|
// TESTASSERT(metrics.gnb_stack.prach.count(p.first));
|
|
|
|
TESTASSERT(metrics.gnb_stack.prach[p.first].count == p.second.count);
|
|
|
|
// TESTASSERT(metrics.gnb_stack.prach[p.first].count == p.second.count);
|
|
|
|
|
|
|
|
TESTASSERT(p.second.count != 0);
|
|
|
|
|
|
|
|
prach_tx_count += p.second.count;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
gnb_dummy_stack::prach_metrics_t gnb_prach = {};
|
|
|
|
|
|
|
|
if (metrics.gnb_stack.prach.count(p.first) > 0) {
|
|
|
|
|
|
|
|
gnb_prach = metrics.gnb_stack.prach[p.first];
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
gnb_prach.avg_ta = NAN;
|
|
|
|
|
|
|
|
gnb_prach.min_ta = NAN;
|
|
|
|
|
|
|
|
gnb_prach.max_ta = NAN;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
srsran::console(" +------------+------------+\n\n");
|
|
|
|
prach_rx_count += gnb_prach.count;
|
|
|
|
|
|
|
|
|
|
|
|
srsran::console(" GNB detected:\n");
|
|
|
|
double detection = (double)gnb_prach.count / (double)p.second.count;
|
|
|
|
srsran::console(" +------------+------------+------------+\n");
|
|
|
|
|
|
|
|
srsran::console(" | %10s | %10s | %10s |\n", "preamble", "count", "avg TA");
|
|
|
|
srsran::console(" | %10d | %10d | %10d | %10.3f | %10.1f | %10.1f | %10.1f |\n",
|
|
|
|
srsran::console(" +------------+------------+------------+\n");
|
|
|
|
p.first,
|
|
|
|
|
|
|
|
p.second.count,
|
|
|
|
for (const auto& p : metrics.gnb_stack.prach) {
|
|
|
|
gnb_prach.count,
|
|
|
|
srsran::console(" | %10d | %10d | %10.1f |\n", p.first, p.second.count, p.second.avg_ta);
|
|
|
|
detection,
|
|
|
|
|
|
|
|
gnb_prach.avg_ta,
|
|
|
|
// Ensure all detected preambles were transmitted
|
|
|
|
gnb_prach.min_ta,
|
|
|
|
TESTASSERT(metrics.ue_stack.prach.count(p.first) > 0);
|
|
|
|
gnb_prach.max_ta);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
srsran::console(
|
|
|
|
|
|
|
|
" +------------+------------+------------+------------+------------+------------+------------+\n");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
srsran::console(" +------------+------------+------------+\n\n");
|
|
|
|
if (prach_tx_count > 0) {
|
|
|
|
|
|
|
|
prach_detection = (double)prach_rx_count / (double)prach_tx_count;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// Print PUCCH
|
|
|
|
// Print PUCCH
|
|
|
@ -410,6 +434,10 @@ int main(int argc, char** argv)
|
|
|
|
"CQI report detection probability (%f) did not reach the assertion minimum (%f)",
|
|
|
|
"CQI report detection probability (%f) did not reach the assertion minimum (%f)",
|
|
|
|
cqi_detection,
|
|
|
|
cqi_detection,
|
|
|
|
assert_sr_detection_min);
|
|
|
|
assert_sr_detection_min);
|
|
|
|
|
|
|
|
srsran_assert(prach_tx_count == 0 or prach_detection >= assert_prach_detection_min,
|
|
|
|
|
|
|
|
"PRACH detection probability (%f) did not reach the assertion minimum (%f)",
|
|
|
|
|
|
|
|
prach_detection,
|
|
|
|
|
|
|
|
assert_prach_detection_min);
|
|
|
|
|
|
|
|
|
|
|
|
// If reached here, the test is successful
|
|
|
|
// If reached here, the test is successful
|
|
|
|
return SRSRAN_SUCCESS;
|
|
|
|
return SRSRAN_SUCCESS;
|
|
|
|