Scheduler

Generates test scheduler assembly code for coordinating test execution. Manages test sequencing, randomization, and synchronization across single or multiple harts. Supports barriers, mutexes, and both sequential and parallel execution modes.

Scheduler privilege mode depends on the Test’s privilege mode. - If test’s privilege mode is MACHINE, scheduler runs in MACHINE mode - If test’s privilege mode is SUPER, scheduler runs in SUPER mode - If test’s privilege mode is USER, scheduler runs in MACHINE mode

API

The Scheduler code is generated by the riescue.dtest_framework.runtime.scheduler.Scheduler class. It generates a few public routines that can be called by other Runtime components.

scheduler__init:

scheduler__dispatch:

scheduler__execute_test:

scheduler__finished:

scheduler__init

Initializes the scheduler. This is called once at the start of the test by the Loader and runs the test_setup routine.

scheduler__dispatch

Loads a0 with the next test address. This is called after the end of each discrete test.

scheduler__execute_test

Executes the test. This is called after the test is loaded into a0 by the scheduler__dispatch routine. It jumps to the test address in a0.

scheduler__finished

Final routine of the scheduler. This is called at the end of the test and runs the test_cleanup routine and returns to the EOT

Scheduler Modes:

The scheduler supports different modes for scheduling tests: - single hart (DefaultScheduler): tests are scheduled for repeat_times number of times - Parallel MP (ParallelScheduler): All harts run different tests in parallel with no sync before running - Simulataneous MP (SimultaneousScheduler): All harts run the same test in parallel, with a sync barrier before starting the test - Linux mode (LinuxScheduler): Tests are scheduled for repeat_times number of times, with runtime randomization

DefaultScheduler

This is the default scheduler mode used for single hart tests. Tests are scheduled for repeat_times number of times.

ParallelScheduler

This is a multiprocessor mode that schedules tests so that no two tests are ran at the same time by different harts. Tests for this scheduler can be written indepedently as the harts will never be runnign the same test.

There’s a couple scheduling modes for this scheduler, configured with parallel_scheduling_mode:

  • ROUND_ROBIN: All tests are ran repeat_times number of times, but each hart has an independent set of tests to run.

  • EXHAUSTIVE: All harts run all tests repeat_times number of times.

SimultaneousScheduler

is a special mode that is used to schedule tests for repeat_times number of times, with runtime randomization.

LinuxScheduler

Linux is a special mode that is used to schedule tests for repeat_times number of times, with runtime randomization.

Configuration

  • force_alignment: Align all instructions on 8-byte boundary

  • num_cpus: Number of harts for multiprocessor mode

  • priv_mode: Privilege mode for test execution

  • repeat_times: Number of times to repeat each test (-1 for Linux mode runtime randomization)

  • linux_mode: Enable Linux scheduler mode with runtime randomization

  • parallel_scheduling_mode: Scheduling mode for parallel MP (ROUND_ROBIN or EXHAUSTIVE)