summaryrefslogtreecommitdiff
path: root/cesar/ce/rx/bitloading/test/src/test_fsm.c
diff options
context:
space:
mode:
authorJérôme Jutteau2011-04-27 12:11:12 +0200
committerJérôme Jutteau2011-06-28 17:02:24 +0200
commit3f4853f8160dc4bae8addc29c8c55c8b122b7e87 (patch)
tree87b0b153e494c5950db9e6a04f80ffc80cc80558 /cesar/ce/rx/bitloading/test/src/test_fsm.c
parenta1f1b0f29b7ff28a247a138eab20f933c22a9262 (diff)
cesar/ce/rx/bl: PB Error Rate tracking, closes #2482
This commit also includes a comment indentation fix in bitloading_t.
Diffstat (limited to 'cesar/ce/rx/bitloading/test/src/test_fsm.c')
-rw-r--r--cesar/ce/rx/bitloading/test/src/test_fsm.c35
1 files changed, 29 insertions, 6 deletions
diff --git a/cesar/ce/rx/bitloading/test/src/test_fsm.c b/cesar/ce/rx/bitloading/test/src/test_fsm.c
index b0e4847c3e..24b6ab6d0e 100644
--- a/cesar/ce/rx/bitloading/test/src/test_fsm.c
+++ b/cesar/ce/rx/bitloading/test/src/test_fsm.c
@@ -362,7 +362,7 @@ test_ce_rx_bl_fsm_base (test_t t)
for (i = 0; i < iteration; i++)
{
measure.total_pb_count
- = 1 + lib_rnd_uniform (&rnd, ((u8) -1));
+ = 1 + lib_rnd_uniform (&rnd, MAC_MAX_PB_PER_MPDU - 1);
stats_pb += measure.total_pb_count;
stats_frame++;
measure.false_pb_count
@@ -376,6 +376,8 @@ test_ce_rx_bl_fsm_base (test_t t)
(TRACKING, data, no_channel_change));
scenario_test[pos++] = (scenario_entry_t)
SCENARIO_EVENT (ce_rx_bl_ber_sliding_mean_update);
+ scenario_test[pos++] = (scenario_entry_t)
+ SCENARIO_EVENT (ce_rx_bl_pber_sliding_mean_update);
}
scenario_test[pos++] = scenario_end;
scenario_run (t, scenario_test, &globals);
@@ -408,7 +410,7 @@ test_ce_rx_bl_fsm_base (test_t t)
measure.total_pb_count
= ce_rx_bl_min_pb_per_frame_
+ lib_rnd_uniform
- (&rnd, ((u8) (-1) - ce_rx_bl_min_pb_per_frame_));
+ (&rnd, (MAC_MAX_PB_PER_MPDU - ce_rx_bl_min_pb_per_frame_));
dbg_assert (measure.total_pb_count);
stats_pb += measure.total_pb_count;
stats_frame++;
@@ -425,6 +427,8 @@ test_ce_rx_bl_fsm_base (test_t t)
if (measure.false_pb_count == 0)
scenario_test[pos++] = (scenario_entry_t)
SCENARIO_EVENT (ce_rx_bl_ber_sliding_mean_update);
+ scenario_test[pos++] = (scenario_entry_t)
+ SCENARIO_EVENT (ce_rx_bl_pber_sliding_mean_update);
}
scenario_test[pos++] = scenario_end;
scenario_run (t, scenario_test, &globals);
@@ -455,7 +459,8 @@ test_ce_rx_bl_fsm_base (test_t t)
for (i = 0; i < iteration; i++)
{
measure.total_pb_count = 1;
- measure.false_pb_count = lib_rnd_uniform (&rnd, (u8) -1);
+ measure.false_pb_count = lib_rnd_uniform (&rnd,
+ measure.total_pb_count);
stats_pb += measure.total_pb_count;
stats_frame++;
scenario_test[pos++] = (scenario_entry_t)
@@ -467,6 +472,8 @@ test_ce_rx_bl_fsm_base (test_t t)
if (measure.total_pb_count != measure.false_pb_count)
scenario_test[pos++] = (scenario_entry_t)
SCENARIO_EVENT (ce_rx_bl_ber_sliding_mean_update);
+ scenario_test[pos++] = (scenario_entry_t)
+ SCENARIO_EVENT (ce_rx_bl_pber_sliding_mean_update);
}
scenario_test[pos++] = scenario_end;
scenario_run (t, scenario_test, &globals);
@@ -500,7 +507,8 @@ test_ce_rx_bl_fsm_base (test_t t)
{
/* Set to ROBO. */
measure.rx_params.tmi_av = robo[i % PHY_MOD_ROBO_NB];
- measure.false_pb_count = lib_rnd_uniform (&rnd, (u8) -1);
+ measure.false_pb_count = lib_rnd_uniform (&rnd,
+ MAC_MAX_PB_PER_MPDU);
measure.total_pb_count = measure.false_pb_count;
scenario_test[pos++] = (scenario_entry_t)
SCENARIO_ACTION (TRACKING__data,
@@ -526,7 +534,7 @@ test_ce_rx_bl_fsm_base (test_t t)
test_ce_rx_bl_stats_reset (&stats);
test_ce_rx_bl_measure_empty (&measure);
measure.total_pb_count = ce_rx_bl_min_pb_per_frame_ + lib_rnd_uniform
- (&rnd, ((u8) (-1) - ce_rx_bl_min_pb_per_frame_));
+ (&rnd, (MAC_MAX_PB_PER_MPDU - ce_rx_bl_min_pb_per_frame_));
measure.false_pb_count = measure.total_pb_count - 1;
uint i;
const uint limit = ce_rx_bl_min_frame_with_high_pb_err_rate_ - 1;
@@ -541,6 +549,8 @@ test_ce_rx_bl_fsm_base (test_t t)
(TRACKING, data, no_channel_change));
scenario_test[pos++] = (scenario_entry_t)
SCENARIO_EVENT (ce_rx_bl_ber_sliding_mean_update);
+ scenario_test[pos++] = (scenario_entry_t)
+ SCENARIO_EVENT (ce_rx_bl_pber_sliding_mean_update);
}
scenario_entry_t sub_sc_ce_restart[] =
{
@@ -550,6 +560,7 @@ test_ce_rx_bl_fsm_base (test_t t)
.branch = ce_rx_bl_fsm_next_branch
(TRACKING, data, pb_err_rate_high)),
SCENARIO_EVENT (ce_rx_bl_ber_sliding_mean_update),
+ SCENARIO_EVENT (ce_rx_bl_pber_sliding_mean_update),
/* Reset CE in RX. */
SCENARIO_EVENT (tonemaps_reset,
.tms = sta.rx_tonemaps),
@@ -597,7 +608,7 @@ test_ce_rx_bl_fsm_base (test_t t)
test_ce_rx_bl_stats_reset (&stats);
test_ce_rx_bl_measure_empty (&measure);
measure.total_pb_count = ce_rx_bl_min_pb_per_frame_ + lib_rnd_uniform
- (&rnd, ((u8) (-1) - ce_rx_bl_min_pb_per_frame_));
+ (&rnd, (MAC_MAX_PB_PER_MPDU - ce_rx_bl_min_pb_per_frame_));
measure.false_pb_count = measure.total_pb_count - 1;
uint i;
const uint limit = ce_rx_bl_min_frame_with_high_pb_err_rate_ * 2;
@@ -612,6 +623,8 @@ test_ce_rx_bl_fsm_base (test_t t)
(TRACKING, data, no_channel_change));
scenario_test[pos++] = (scenario_entry_t)
SCENARIO_EVENT (ce_rx_bl_ber_sliding_mean_update);
+ scenario_test[pos++] = (scenario_entry_t)
+ SCENARIO_EVENT (ce_rx_bl_pber_sliding_mean_update);
}
stats_pb += measure.total_pb_count * limit;
stats_frame += limit;
@@ -654,6 +667,8 @@ test_ce_rx_bl_fsm_base (test_t t)
(TRACKING, data, ber_too_low));
scenario_test[pos++] = (scenario_entry_t)
SCENARIO_EVENT (ce_rx_bl_ber_sliding_mean_update);
+ scenario_test[pos++] = (scenario_entry_t)
+ SCENARIO_EVENT (ce_rx_bl_pber_sliding_mean_update);
/* Reset CE in RX. */
scenario_test[pos++] = (scenario_entry_t)
SCENARIO_EVENT (tonemaps_reset,
@@ -713,6 +728,8 @@ test_ce_rx_bl_fsm_base (test_t t)
scenario_test[pos++] = (scenario_entry_t)
SCENARIO_EVENT (ce_rx_bl_ber_sliding_mean_update);
scenario_test[pos++] = (scenario_entry_t)
+ SCENARIO_EVENT (ce_rx_bl_pber_sliding_mean_update);
+ scenario_test[pos++] = (scenario_entry_t)
SCENARIO_END;
stats_pb += measure.total_pb_count;
stats_frame++;
@@ -756,6 +773,8 @@ test_ce_rx_bl_fsm_base (test_t t)
(TRACKING, data, ber_too_low));
scenario_test[pos++] = (scenario_entry_t)
SCENARIO_EVENT (ce_rx_bl_ber_sliding_mean_update);
+ scenario_test[pos++] = (scenario_entry_t)
+ SCENARIO_EVENT (ce_rx_bl_pber_sliding_mean_update);
/* Reset CE in RX. */
scenario_test[pos++] = (scenario_entry_t)
SCENARIO_EVENT (tonemaps_reset,
@@ -813,6 +832,8 @@ test_ce_rx_bl_fsm_base (test_t t)
scenario_test[pos++] = (scenario_entry_t)
SCENARIO_EVENT (ce_rx_bl_ber_sliding_mean_update);
scenario_test[pos++] = (scenario_entry_t)
+ SCENARIO_EVENT (ce_rx_bl_pber_sliding_mean_update);
+ scenario_test[pos++] = (scenario_entry_t)
SCENARIO_END;
stats_pb += measure.total_pb_count;
stats_frame++;
@@ -858,6 +879,8 @@ test_ce_rx_bl_fsm_base (test_t t)
scenario_test[pos++] = (scenario_entry_t)
SCENARIO_EVENT (ce_rx_bl_ber_sliding_mean_update);
scenario_test[pos++] = (scenario_entry_t)
+ SCENARIO_EVENT (ce_rx_bl_pber_sliding_mean_update);
+ scenario_test[pos++] = (scenario_entry_t)
SCENARIO_END;
stats_pb += measure.total_pb_count;
stats_frame++;