8.3 Test Framework Libraries Available Outside Simics
Simics Reference Manual  /  8 Test Framework  / 

8.4 Test Framework Libraries Available in Simics Tests

reverse_execution

Library for running reverse execution tests on an entire system.

The tests checks the state of processors and images when using reverse execution.

reverse_execution_test

SUPERCLASSES

builtins.object

CONSTRUCTOR

reverse_execution_test(start = 0, totlen = 100000000, n1 = 10, n2 = 20, len1 = 1000000, seed = 1091, debug = False, trace_pc = False)

DESCRIPTION

Runs reverse execution tests.

The test sets up a number of points within an interval and runs several reverse execution checks in an interval after each point.

Constructor arguments (all have default values):

  • start
    the start of the interval to test within
  • totlen
    the length of the interval to test within
  • n1
    number of checks to run at each test point
  • n2
    number of points to run checks at
  • len1
    length of the interval to run checks past each test point
  • seed
    random number seed to use for generating test points and checks
  • debug
    set to True for more debug messages
  • trace_pc
    set to True to get the program counter printed at each test

SYNOPSIS
obj.print_parameters()
DESCRIPTION

Prints the parameters used by this object.

runtest

SYNOPSIS
obj.runtest(points = None, randvals = None, cpu = None)
DESCRIPTION

Run reverse execution checks.

Arguments:

  • points
    points to run the checks at, optional, defaults to points generated based on the parameters provided when constructing this object
  • randvals
    offsets past each point to check state at, optional, defaults to offsets generated based on the parameters provided when constructing this object
  • cpu
    the processor to use as a time base, optional, defaults to the current processor

testone

SYNOPSIS
obj.testone(offstable, cpu = None)
DESCRIPTION

Run reverse execution checks for the point the cpu is currently at.

Arguments:

  • offstable
    offsets from the current cycle to check the state of the system at
  • cpu
    the processor to use as a time base, optional, defaults to the current processor

info_status

Library for checking if classes has info and status commands.

report_info_status_errors

SYNOPSIS

report_info_status_errors(missing_info, missing_status, unexpected_info, unexpected_status)

DESCRIPTION

Prints its input lists and quits Simics with an error.

First each provided list is printed in a human readable manner and then the function quits Simics with the result 1, which will be detected by the test system as a test failure.

Arguments:

  • missing_info
    a list of classes which do not have info commands
  • missing_status
    a list of classes which do not have status commands
  • unexpected_info
    a list of classes which have info commands, but which were on the info command passlist
  • unexpected_status
    a list of classes which have status commands, but which were on the status command passlist

check_for_info_status

SYNOPSIS

check_for_info_status(modules, info_passlist = [], status_passlist = [], report_errors = \<function report_info_status_errors\>)

DESCRIPTION

Check that the classes in a list of modules have info and status commands.

Classes are Simics configuration classes, not python classes. The function checks all the classes in the named modules to see if they have info and status commands. If any such command is missing it will be detected as an error, but you can provide passlists. If a class is passlisted and still has the command it will be detected as an error. If any errors are detected the function calls a function to report this. By default the report_info_status_error is called, but you can override this with the report_errors argument.

The modules named in modules will be loaded into Simics as a side effect of running this test.

Arguments:

  • modules
    the modules whose classes to test
  • info_passlist
    the list of classes which should not have info commands
  • status_passlist
    the list of classes which should not have status commands
  • report_errors
    the function to call to report errors

8.3 Test Framework Libraries Available Outside Simics