Skip to content

Extension and Verification

zwabbit edited this page Jan 4, 2016 · 8 revisions

##Unit Tests Generation##

MIAOW includes a suite of unit tests that exercise all of the implemented instructions. These include not only the instructions and register values but also instruction traces generated by multi2sim, an emulator used to generate reference values for instruction, register, and memory values. The instruction traces are currently generated using a patched version of multi2sim, the source of which we make available here. We are working to merge our changes upstream so that in the future one does not need our patches. The input values (Scalar and Vector register contents) for the unit tests are randomly generated. The infrastructure for unit test development is included in $TOP_DIR/src/sw/siagen.

The following are the steps for creating unit tests for newly added instructions:

  1. cd $TOP_DIR/src/sw/siagen

  2. Open siagen.cpp. There are multiple subroutines for each set of instructions. For example, to add the scalar instruction "waitcnt" which is of type SOPP and has an opcode 0X0C, add that instruction to the sopp_ops vector. There are corresponding vectors for each type of instruction.

For further support or questions regarding this, please contact: [email protected] or [email protected]

  1. Once the modifications are complete, do make to generate the executable ./siagen.

  2. The usage of siagen is explained below:

    Usage:
    ./siagen -i <instruction_mix> -r <registers> -m <data_memory> -c <instr_count> -t <thread count> -w <workgroup count> -n <number of tests> -u <unit test>

    Options: (All required)
    i - Instruction mix represented as ratio <scalar_alu_instr>:<vector_alu_instr>:<scalar_mem_instr>:<vector_mem_instr>
    r - Absolute number of scalar and vector registers <scalar_reg>:<vector_reg> m - Data memory required c - Total instruction count t - Number of threads per workgroup w - Number of workgroups n - Number of tests to generate u - Create unit tests (i, c, w, n are overridden)

    Example: ./siagen -i 10:10:10:10 -r 12:12 -m 10000 -c 10 -t 10 -w 1 -n 10 -u 1 The above command creates unit tests for all the instructions, each unit test having the following files:

    • unit_test_config.txt - The configuration file consists of information about number of threads, LDS size and the input values to 12 scalar/vector registers.
    • unit_test_data.mem - The data memory dump with data values for the LDS size of 10000 bytes.
    • unit_test_instr.mem - The instruction memory dump.

    NOTE: During unit test generation, parameters i, c, w, and n are overridden - meaning their effect is not considered.

  3. The unit tests are generated in the same folder. Copy over them to $TOP_DIR/src/sw/miaow_unit_tests to generate reference (golden) traces using multi2sim.

Generating Multi2Sim traces - TO BE UPDATED SOON (By End September)

Multi2Sim is the reference simulator used to generate the golden traces for unit tests and the benchmarks. The steps to generate golden reference traces from Multi2Sim simulator will be updated here soon.

##Workload Development

MIAOW also has a series of more intensive benchmarks that exercise the compute unit more extensively. These include AMD APP OpenCL kernels located at $TOP_DIR/src/sw/benchmarks and also Rodinia Suite located at $TOP_DIR/src/sw/rodinia. MIAOW supports all of the AMD APP kernels and five of the Rodinia OpenCL kernels. Users of this tool can start developing the support for more kernels.

Clone this wiki locally