Lines Matching full:scaler
16 #define TIMER_BLOCK_STEP(scaler, steps_nb) \ argument
17 clock_step(TIMER_BLOCK_SCALE(scaler) * (int64_t)(steps_nb) + 1)
94 int scaler = *((int *) arg); in test_timer_oneshot() local
98 timer_start(ONESHOT, scaler); in test_timer_oneshot()
100 TIMER_BLOCK_STEP(scaler, 9999); in test_timer_oneshot()
105 TIMER_BLOCK_STEP(scaler, 9990000); in test_timer_oneshot()
110 TIMER_BLOCK_STEP(scaler, 9990000); in test_timer_oneshot()
118 int scaler = *((int *) arg); in test_timer_pause() local
122 timer_start(ONESHOT, scaler); in test_timer_pause()
124 TIMER_BLOCK_STEP(scaler, 999); in test_timer_pause()
129 TIMER_BLOCK_STEP(scaler, 9000); in test_timer_pause()
139 TIMER_BLOCK_STEP(scaler, 90000); in test_timer_pause()
144 timer_start(ONESHOT, scaler); in test_timer_pause()
146 TIMER_BLOCK_STEP(scaler, 999990000); in test_timer_pause()
151 TIMER_BLOCK_STEP(scaler, 999990000); in test_timer_pause()
159 int scaler = *((int *) arg); in test_timer_reload() local
163 timer_start(ONESHOT, scaler); in test_timer_reload()
165 TIMER_BLOCK_STEP(scaler, 90000); in test_timer_reload()
172 TIMER_BLOCK_STEP(scaler, 90000); in test_timer_reload()
180 int scaler = *((int *) arg); in test_timer_periodic() local
185 timer_start(PERIODIC, scaler); in test_timer_periodic()
188 clock_step(TIMER_BLOCK_SCALE(scaler) * (101 + repeat) + 1); in test_timer_periodic()
193 clock_step(TIMER_BLOCK_SCALE(scaler) * (101 - repeat) - 1); in test_timer_periodic()
199 int scaler = *((int *) arg); in test_timer_oneshot_to_periodic() local
203 timer_start(ONESHOT, scaler); in test_timer_oneshot_to_periodic()
205 TIMER_BLOCK_STEP(scaler, 1000); in test_timer_oneshot_to_periodic()
210 timer_start(PERIODIC, scaler); in test_timer_oneshot_to_periodic()
212 TIMER_BLOCK_STEP(scaler, 14001); in test_timer_oneshot_to_periodic()
220 int scaler = *((int *) arg); in test_timer_periodic_to_oneshot() local
224 timer_start(PERIODIC, scaler); in test_timer_periodic_to_oneshot()
226 TIMER_BLOCK_STEP(scaler, 999); in test_timer_periodic_to_oneshot()
231 timer_start(ONESHOT, scaler); in test_timer_periodic_to_oneshot()
233 TIMER_BLOCK_STEP(scaler, 99999009); in test_timer_periodic_to_oneshot()
291 int scaler = *((int *) arg); in test_timer_set_oneshot_counter_to_0() local
295 timer_start(ONESHOT, scaler); in test_timer_set_oneshot_counter_to_0()
297 TIMER_BLOCK_STEP(scaler, 1); in test_timer_set_oneshot_counter_to_0()
304 TIMER_BLOCK_STEP(scaler, 10); in test_timer_set_oneshot_counter_to_0()
307 g_assert_cmpuint(timer_get_and_clr_int_sts(), ==, !!scaler); in test_timer_set_oneshot_counter_to_0()
312 int scaler = *((int *) arg); in test_timer_set_periodic_counter_to_0() local
316 timer_start(PERIODIC, scaler); in test_timer_set_periodic_counter_to_0()
318 TIMER_BLOCK_STEP(scaler, 1); in test_timer_set_periodic_counter_to_0()
325 TIMER_BLOCK_STEP(scaler, 1); in test_timer_set_periodic_counter_to_0()
327 g_assert_cmpuint(timer_counter(), ==, UINT32_MAX - (scaler ? 0 : 1)); in test_timer_set_periodic_counter_to_0()
328 g_assert_cmpuint(timer_get_and_clr_int_sts(), ==, !!scaler); in test_timer_set_periodic_counter_to_0()
332 timer_start(PERIODIC, scaler); in test_timer_set_periodic_counter_to_0()
334 TIMER_BLOCK_STEP(scaler, 1); in test_timer_set_periodic_counter_to_0()
341 TIMER_BLOCK_STEP(scaler, 1); in test_timer_set_periodic_counter_to_0()
344 g_assert_cmpuint(timer_get_and_clr_int_sts(), ==, !!scaler); in test_timer_set_periodic_counter_to_0()
349 int scaler = *((int *) arg); in test_timer_noload_oneshot() local
352 timer_start(ONESHOT, scaler); in test_timer_noload_oneshot()
354 TIMER_BLOCK_STEP(scaler, 1); in test_timer_noload_oneshot()
357 g_assert_cmpuint(timer_get_and_clr_int_sts(), ==, !!scaler); in test_timer_noload_oneshot()
359 TIMER_BLOCK_STEP(scaler, 1); in test_timer_noload_oneshot()
367 int scaler = *((int *) arg); in test_timer_noload_periodic() local
370 timer_start(PERIODIC, scaler); in test_timer_noload_periodic()
372 TIMER_BLOCK_STEP(scaler, 1); in test_timer_noload_periodic()
375 g_assert_cmpuint(timer_get_and_clr_int_sts(), ==, !!scaler); in test_timer_noload_periodic()
377 TIMER_BLOCK_STEP(scaler, 1); in test_timer_noload_periodic()
380 g_assert_cmpuint(timer_get_and_clr_int_sts(), ==, !!scaler); in test_timer_noload_periodic()
385 int scaler = *((int *) arg); in test_timer_zero_load_oneshot() local
388 timer_start(ONESHOT, scaler); in test_timer_zero_load_oneshot()
390 TIMER_BLOCK_STEP(scaler, 1); in test_timer_zero_load_oneshot()
392 g_assert_cmpuint(timer_get_and_clr_int_sts(), ==, !!scaler); in test_timer_zero_load_oneshot()
397 TIMER_BLOCK_STEP(scaler, 1); in test_timer_zero_load_oneshot()
400 g_assert_cmpuint(timer_get_and_clr_int_sts(), ==, !!scaler); in test_timer_zero_load_oneshot()
402 TIMER_BLOCK_STEP(scaler, 1); in test_timer_zero_load_oneshot()
410 int scaler = *((int *) arg); in test_timer_zero_load_periodic() local
413 timer_start(PERIODIC, scaler); in test_timer_zero_load_periodic()
415 TIMER_BLOCK_STEP(scaler, 1); in test_timer_zero_load_periodic()
417 g_assert_cmpuint(timer_get_and_clr_int_sts(), ==, !!scaler); in test_timer_zero_load_periodic()
422 TIMER_BLOCK_STEP(scaler, 1); in test_timer_zero_load_periodic()
425 g_assert_cmpuint(timer_get_and_clr_int_sts(), ==, !!scaler); in test_timer_zero_load_periodic()
427 TIMER_BLOCK_STEP(scaler, 1); in test_timer_zero_load_periodic()
430 g_assert_cmpuint(timer_get_and_clr_int_sts(), ==, !!scaler); in test_timer_zero_load_periodic()
435 int scaler = *((int *) arg); in test_timer_zero_load_oneshot_to_nonzero() local
438 timer_start(ONESHOT, scaler); in test_timer_zero_load_oneshot_to_nonzero()
440 TIMER_BLOCK_STEP(scaler, 1); in test_timer_zero_load_oneshot_to_nonzero()
443 g_assert_cmpuint(timer_get_and_clr_int_sts(), ==, !!scaler); in test_timer_zero_load_oneshot_to_nonzero()
447 TIMER_BLOCK_STEP(scaler, 1); in test_timer_zero_load_oneshot_to_nonzero()
449 g_assert_cmpuint(timer_get_and_clr_int_sts(), ==, !!scaler); in test_timer_zero_load_oneshot_to_nonzero()
454 TIMER_BLOCK_STEP(scaler, 1001); in test_timer_zero_load_oneshot_to_nonzero()
462 int scaler = *((int *) arg); in test_timer_zero_load_periodic_to_nonzero() local
466 timer_start(PERIODIC, scaler); in test_timer_zero_load_periodic_to_nonzero()
468 TIMER_BLOCK_STEP(scaler, 1); in test_timer_zero_load_periodic_to_nonzero()
470 g_assert_cmpuint(timer_get_and_clr_int_sts(), ==, !!scaler); in test_timer_zero_load_periodic_to_nonzero()
475 TIMER_BLOCK_STEP(scaler, 1); in test_timer_zero_load_periodic_to_nonzero()
478 g_assert_cmpuint(timer_get_and_clr_int_sts(), ==, !!scaler); in test_timer_zero_load_periodic_to_nonzero()
483 TIMER_BLOCK_STEP(scaler, 2000001); in test_timer_zero_load_periodic_to_nonzero()
493 int scaler = *((int *) arg); in test_timer_nonzero_load_oneshot_to_zero() local
496 timer_start(ONESHOT, scaler); in test_timer_nonzero_load_oneshot_to_zero()
498 TIMER_BLOCK_STEP(scaler, 1); in test_timer_nonzero_load_oneshot_to_zero()
500 g_assert_cmpuint(timer_get_and_clr_int_sts(), ==, !!scaler); in test_timer_nonzero_load_oneshot_to_zero()
506 TIMER_BLOCK_STEP(scaler, 100); in test_timer_nonzero_load_oneshot_to_zero()
509 g_assert_cmpuint(timer_get_and_clr_int_sts(), ==, !!scaler); in test_timer_nonzero_load_oneshot_to_zero()
514 int scaler = *((int *) arg); in test_timer_nonzero_load_periodic_to_zero() local
517 timer_start(PERIODIC, scaler); in test_timer_nonzero_load_periodic_to_zero()
519 TIMER_BLOCK_STEP(scaler, 1); in test_timer_nonzero_load_periodic_to_zero()
522 g_assert_cmpuint(timer_get_and_clr_int_sts(), ==, !!scaler); in test_timer_nonzero_load_periodic_to_zero()
527 TIMER_BLOCK_STEP(scaler, 100); in test_timer_nonzero_load_periodic_to_zero()
530 g_assert_cmpuint(timer_get_and_clr_int_sts(), ==, !!scaler); in test_timer_nonzero_load_periodic_to_zero()
535 int scaler = *((int *) arg); in test_timer_set_periodic_counter_on_the_fly() local
539 timer_start(PERIODIC, scaler); in test_timer_set_periodic_counter_on_the_fly()
541 TIMER_BLOCK_STEP(scaler, 100); in test_timer_set_periodic_counter_on_the_fly()
548 TIMER_BLOCK_STEP(scaler, 100); in test_timer_set_periodic_counter_on_the_fly()
556 int scaler = *((int *) arg); in test_timer_enable_and_set_counter() local
559 timer_start(ONESHOT, scaler); in test_timer_enable_and_set_counter()
561 TIMER_BLOCK_STEP(scaler, 1); in test_timer_enable_and_set_counter()
563 g_assert_cmpuint(timer_get_and_clr_int_sts(), ==, !!scaler); in test_timer_enable_and_set_counter()
567 TIMER_BLOCK_STEP(scaler, 100); in test_timer_enable_and_set_counter()
575 int scaler = *((int *) arg); in test_timer_set_counter_and_enable() local
579 timer_start(ONESHOT, scaler); in test_timer_set_counter_and_enable()
581 TIMER_BLOCK_STEP(scaler, 100); in test_timer_set_counter_and_enable()
611 int scaler = *((int *) arg); in test_timer_oneshot_with_counter_0_on_start() local
616 timer_start(ONESHOT, scaler); in test_timer_oneshot_with_counter_0_on_start()
618 TIMER_BLOCK_STEP(scaler, 100); in test_timer_oneshot_with_counter_0_on_start()
621 g_assert_cmpuint(timer_get_and_clr_int_sts(), ==, !!scaler); in test_timer_oneshot_with_counter_0_on_start()
623 TIMER_BLOCK_STEP(scaler, 100); in test_timer_oneshot_with_counter_0_on_start()
631 int scaler = *((int *) arg); in test_timer_periodic_with_counter_0_on_start() local
641 timer_start(PERIODIC, scaler); in test_timer_periodic_with_counter_0_on_start()
643 TIMER_BLOCK_STEP(scaler, 100); in test_timer_periodic_with_counter_0_on_start()
645 g_assert_cmpuint(timer_get_and_clr_int_sts(), ==, !!scaler); in test_timer_periodic_with_counter_0_on_start()
646 g_assert_cmpuint(timer_counter(), ==, UINT32_MAX + (scaler ? 1 : 0) - 100); in test_timer_periodic_with_counter_0_on_start()
648 TIMER_BLOCK_STEP(scaler, 100); in test_timer_periodic_with_counter_0_on_start()
650 g_assert_cmpuint(timer_counter(), ==, UINT32_MAX + (scaler ? 1 : 0) - 200); in test_timer_periodic_with_counter_0_on_start()
660 TIMER_BLOCK_STEP(scaler, 1); in test_timer_periodic_with_counter_0_on_start()
664 timer_start(PERIODIC, scaler); in test_timer_periodic_with_counter_0_on_start()
666 TIMER_BLOCK_STEP(scaler, 1); in test_timer_periodic_with_counter_0_on_start()
668 g_assert_cmpuint(timer_get_and_clr_int_sts(), ==, !!scaler); in test_timer_periodic_with_counter_0_on_start()
670 for (i = 2 - (!!scaler ? 1 : 0); i < 10; i++) { in test_timer_periodic_with_counter_0_on_start()
671 TIMER_BLOCK_STEP(scaler, 2000001); in test_timer_periodic_with_counter_0_on_start()
682 int scaler = *((int *) arg); in test_periodic_counter() local
687 timer_start(PERIODIC, scaler); in test_periodic_counter()
692 clock_step(TIMER_BLOCK_SCALE(scaler) * test_load); in test_periodic_counter()
699 int scaler = *((int *) arg); in test_timer_set_counter_periodic_with_zero_load() local
702 timer_start(PERIODIC, scaler); in test_timer_set_counter_periodic_with_zero_load()
705 TIMER_BLOCK_STEP(scaler, 1); in test_timer_set_counter_periodic_with_zero_load()
707 g_assert_cmpuint(timer_get_and_clr_int_sts(), ==, !!scaler); in test_timer_set_counter_periodic_with_zero_load()
709 TIMER_BLOCK_STEP(scaler, 1); in test_timer_set_counter_periodic_with_zero_load()
711 g_assert_cmpuint(timer_get_and_clr_int_sts(), ==, !!scaler); in test_timer_set_counter_periodic_with_zero_load()
715 TIMER_BLOCK_STEP(scaler, 999); in test_timer_set_counter_periodic_with_zero_load()
720 TIMER_BLOCK_STEP(scaler, 1); in test_timer_set_counter_periodic_with_zero_load()
723 g_assert_cmpuint(timer_get_and_clr_int_sts(), ==, !!scaler); in test_timer_set_counter_periodic_with_zero_load()
728 int scaler = *((int *) arg); in test_timer_set_oneshot_load_to_0() local
732 timer_start(ONESHOT, scaler); in test_timer_set_oneshot_load_to_0()
734 TIMER_BLOCK_STEP(scaler, 100); in test_timer_set_oneshot_load_to_0()
741 TIMER_BLOCK_STEP(scaler, 100); in test_timer_set_oneshot_load_to_0()
744 g_assert_cmpuint(timer_get_and_clr_int_sts(), ==, !!scaler); in test_timer_set_oneshot_load_to_0()
746 TIMER_BLOCK_STEP(scaler, 100); in test_timer_set_oneshot_load_to_0()
754 int scaler = *((int *) arg); in test_timer_set_periodic_load_to_0() local
758 timer_start(PERIODIC, scaler); in test_timer_set_periodic_load_to_0()
760 TIMER_BLOCK_STEP(scaler, 100); in test_timer_set_periodic_load_to_0()
767 TIMER_BLOCK_STEP(scaler, 100); in test_timer_set_periodic_load_to_0()
770 g_assert_cmpuint(timer_get_and_clr_int_sts(), ==, !!scaler); in test_timer_set_periodic_load_to_0()
772 TIMER_BLOCK_STEP(scaler, 100); in test_timer_set_periodic_load_to_0()
774 g_assert_cmpuint(timer_get_and_clr_int_sts(), ==, !!scaler); in test_timer_set_periodic_load_to_0()
854 int scaler = *((int *) arg); in test_timer_zero_load_mode_switch() local
858 timer_start(PERIODIC, scaler); in test_timer_zero_load_mode_switch()
860 TIMER_BLOCK_STEP(scaler, 1); in test_timer_zero_load_mode_switch()
863 g_assert_cmpuint(timer_get_and_clr_int_sts(), ==, !!scaler); in test_timer_zero_load_mode_switch()
865 TIMER_BLOCK_STEP(scaler, 1); in test_timer_zero_load_mode_switch()
867 timer_start(ONESHOT, scaler); in test_timer_zero_load_mode_switch()
869 TIMER_BLOCK_STEP(scaler, 1); in test_timer_zero_load_mode_switch()
872 g_assert_cmpuint(timer_get_and_clr_int_sts(), ==, !!scaler); in test_timer_zero_load_mode_switch()
874 TIMER_BLOCK_STEP(scaler, 1); in test_timer_zero_load_mode_switch()
879 TIMER_BLOCK_STEP(scaler, 1); in test_timer_zero_load_mode_switch()
881 timer_start(PERIODIC, scaler); in test_timer_zero_load_mode_switch()
883 TIMER_BLOCK_STEP(scaler, 1); in test_timer_zero_load_mode_switch()
886 g_assert_cmpuint(timer_get_and_clr_int_sts(), ==, !!scaler); in test_timer_zero_load_mode_switch()
996 * a timer scaler setting, and one with the timer nonscaled.
1002 int *scaler = scale ? &scaled : &nonscaled; in add_scaler_test() local
1004 name = g_strdup_printf("%s=%d", str, *scaler); in add_scaler_test()
1005 qtest_add_data_func(name, scaler, fn); in add_scaler_test()
1031 add_scaler_test("mptimer/oneshot scaler", in main()
1033 add_scaler_test("mptimer/pause scaler", in main()
1035 add_scaler_test("mptimer/reload scaler", in main()
1037 add_scaler_test("mptimer/periodic scaler", in main()
1039 add_scaler_test("mptimer/oneshot_to_periodic scaler", in main()
1041 add_scaler_test("mptimer/periodic_to_oneshot scaler", in main()
1043 add_scaler_test("mptimer/set_oneshot_counter_to_0 scaler", in main()
1045 add_scaler_test("mptimer/set_periodic_counter_to_0 scaler", in main()
1047 add_scaler_test("mptimer/noload_oneshot scaler", in main()
1049 add_scaler_test("mptimer/noload_periodic scaler", in main()
1051 add_scaler_test("mptimer/zero_load_oneshot scaler", in main()
1053 add_scaler_test("mptimer/zero_load_periodic scaler", in main()
1055 add_scaler_test("mptimer/zero_load_oneshot_to_nonzero scaler", in main()
1057 add_scaler_test("mptimer/zero_load_periodic_to_nonzero scaler", in main()
1059 add_scaler_test("mptimer/nonzero_load_oneshot_to_zero scaler", in main()
1061 add_scaler_test("mptimer/nonzero_load_periodic_to_zero scaler", in main()
1063 add_scaler_test("mptimer/set_periodic_counter_on_the_fly scaler", in main()
1065 add_scaler_test("mptimer/enable_and_set_counter scaler", in main()
1067 add_scaler_test("mptimer/set_counter_and_enable scaler", in main()
1069 add_scaler_test("mptimer/oneshot_with_counter_0_on_start scaler", in main()
1071 add_scaler_test("mptimer/periodic_with_counter_0_on_start scaler", in main()
1073 add_scaler_test("mptimer/periodic_counter scaler", in main()
1075 add_scaler_test("mptimer/set_counter_periodic_with_zero_load scaler", in main()
1077 add_scaler_test("mptimer/set_oneshot_load_to_0 scaler", in main()
1079 add_scaler_test("mptimer/set_periodic_load_to_0 scaler", in main()
1081 add_scaler_test("mptimer/zero_load_mode_switch scaler", in main()