summaryrefslogtreecommitdiff
path: root/cesar/ce/rx/bitloading/test
diff options
context:
space:
mode:
authorJalil Chemseddine2012-10-11 16:57:04 +0200
committerJalil Chemseddine2013-01-11 11:22:33 +0100
commit3e528bd03f16499b5ccca34b387a7146eb4f21af (patch)
tree391c5ada46cc29b5d2706e5d66c14316d55f9946 /cesar/ce/rx/bitloading/test
parentd4fdaf44e909e612f284730f796c21f848a8db12 (diff)
cesar/ce/rx/bl: add pber high parameters to pber structure, refs #3251
Diffstat (limited to 'cesar/ce/rx/bitloading/test')
-rw-r--r--cesar/ce/rx/bitloading/test/src/test_fsm.c43
1 files changed, 22 insertions, 21 deletions
diff --git a/cesar/ce/rx/bitloading/test/src/test_fsm.c b/cesar/ce/rx/bitloading/test/src/test_fsm.c
index f87d71e66c..477b3536f8 100644
--- a/cesar/ce/rx/bitloading/test/src/test_fsm.c
+++ b/cesar/ce/rx/bitloading/test/src/test_fsm.c
@@ -15,6 +15,7 @@
#include "ce/rx/inc/rx.h"
#include "ce/rx/bitloading/inc/ber_margin_update.h"
#include "ce/rx/bitloading/inc/ber.h"
+#include "ce/rx/bitloading/inc/pber.h"
#include "ce/rx/bitloading/fsm/event.h"
#include "ce/rx/inc/measure.h"
#include "ce/common/mod.h"
@@ -55,16 +56,16 @@
PREPROC_FOR_EACH (CE_RX_BL_TEST_STATS_UPDATE_ONE_TEST, args) \
PREPROC_FOR_EACH (CE_RX_BL_TEST_STATS_UPDATE_ONE_ORI, args)
-/* Dirty hack. */
-uint ce_rx_bl_pb_false_factor_;
-uint ce_rx_bl_pb_total_factor_;
-uint ce_rx_bl_min_pb_per_frame_;
-uint ce_rx_bl_min_frame_with_high_pb_err_rate_;
/**
* The configuration of the BER module.
*/
ce_rx_bl_ber_conf_t ce_rx_bl_ber_conf;
+/**
+ * The configuration of the PBER module.
+ */
+ce_rx_bl_pber_conf_t ce_rx_bl_pber_conf;
+
extern uint ce_rx_bl_min_time_between_resend_tm_ms;
static uint const tmi_av = 24;
@@ -477,13 +478,13 @@ test_ce_rx_bl_fsm_base (test_t t)
} test_end;
test_case_begin (t, "not sound, handle PB Error Rate");
- ce_rx_bl_pb_false_factor_ = 2;
- ce_rx_bl_pb_total_factor_ = 3;
- ce_rx_bl_min_pb_per_frame_ = 2;
- ce_rx_bl_min_frame_with_high_pb_err_rate_ = 4;
+ ce_rx_bl_pber_conf.pb_false_factor = 2;
+ ce_rx_bl_pber_conf.pb_total_factor = 3;
+ ce_rx_bl_pber_conf.min_pb_per_frame = 2;
+ ce_rx_bl_pber_conf.min_frame_with_high_pb_err_rate = 4;
scenario_entry_t scenario_end = SCENARIO_END;
- const uint table_size = ce_rx_bl_min_frame_with_high_pb_err_rate_ * 4242;
- const uint iteration = ce_rx_bl_min_frame_with_high_pb_err_rate_ * 24;
+ const uint table_size = ce_rx_bl_pber_conf.min_frame_with_high_pb_err_rate * 4242;
+ const uint iteration = ce_rx_bl_pber_conf.min_frame_with_high_pb_err_rate * 24;
scenario_entry_t scenario_test[table_size];
lib_rnd_t rnd;
lib_rnd_init (&rnd, 0x4242);
@@ -506,7 +507,7 @@ test_ce_rx_bl_fsm_base (test_t t)
stats_frame++;
measure.false_pb_count
= lib_rnd_uniform
- (&rnd, measure.total_pb_count / ce_rx_bl_pb_total_factor_);
+ (&rnd, measure.total_pb_count / ce_rx_bl_pber_conf.pb_total_factor);
scenario_test[pos++] = (scenario_entry_t)
SCENARIO_ACTION (TRACKING__data,
.sta = &sta,
@@ -547,13 +548,13 @@ test_ce_rx_bl_fsm_base (test_t t)
for (i = 0; i < iteration; i++)
{
measure.total_pb_count
- = ce_rx_bl_min_pb_per_frame_
+ = ce_rx_bl_pber_conf.min_pb_per_frame
+ lib_rnd_uniform
- (&rnd, (MAC_MAX_PB_PER_MPDU - ce_rx_bl_min_pb_per_frame_));
+ (&rnd, (MAC_MAX_PB_PER_MPDU - ce_rx_bl_pber_conf.min_pb_per_frame));
dbg_assert (measure.total_pb_count);
stats_pb += measure.total_pb_count;
stats_frame++;
- if (i % (ce_rx_bl_min_frame_with_high_pb_err_rate_ - 1) == 0)
+ if (i % (ce_rx_bl_pber_conf.min_frame_with_high_pb_err_rate - 1) == 0)
measure.false_pb_count = 0;
else
measure.false_pb_count = measure.total_pb_count;
@@ -672,11 +673,11 @@ test_ce_rx_bl_fsm_base (test_t t)
test_ce_rx_bl_reset (&sta.ce_rx_bt);
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, (MAC_MAX_PB_PER_MPDU - ce_rx_bl_min_pb_per_frame_));
+ measure.total_pb_count = ce_rx_bl_pber_conf.min_pb_per_frame + lib_rnd_uniform
+ (&rnd, (MAC_MAX_PB_PER_MPDU - ce_rx_bl_pber_conf.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;
+ const uint limit = ce_rx_bl_pber_conf.min_frame_with_high_pb_err_rate - 1;
uint pos;
for (i = 0, pos = 0; i < limit; i++)
{
@@ -747,11 +748,11 @@ test_ce_rx_bl_fsm_base (test_t t)
test_ce_rx_bl_reset (&sta.ce_rx_bt);
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, (MAC_MAX_PB_PER_MPDU - ce_rx_bl_min_pb_per_frame_));
+ measure.total_pb_count = ce_rx_bl_pber_conf.min_pb_per_frame + lib_rnd_uniform
+ (&rnd, (MAC_MAX_PB_PER_MPDU - ce_rx_bl_pber_conf.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;
+ const uint limit = ce_rx_bl_pber_conf.min_frame_with_high_pb_err_rate * 2;
uint pos;
for (i = 0, pos = 0; i < limit; i++)
{