Developer Guide

  • 2021.2
  • 06/11/2021
  • Public
Contents

Register Verification Script

This script performs a runtime check that verifies whether processor registers were applied. The script works for MSR and MMIO registers.
The script supports the Yocto Project*-based board support package.
You can copy and modify the script to support another operating system. The script must meet the following requirements to maintain compatibility with the data streams optimizer:
  • Input: The script must support these command-line arguments:
    usage: registers_checker.py [-h] {mmio,msr} ... commands: {mmio,msr} mmio Compare given value with real value for MMIO registers msr Compare given value with real value for MSR registers usage: registers_checker.py mmio [-h] -b BASE -a ADDRESS -m MASK -s SIZE -v VALUE -h Show this help message and exit. -b BASE Hex base address of the register. -a ADDRESS Hex register offset from base. -m MASK Hex mask to get register value. -s SIZE Register size in bytes (32 or 64). -v VALUE Expected register hex value. usage: registers_checker.py msr [-h] -n NUMBER -c CORE -m MASK -v VALUE -h Show this help message and exit -n NUMBER Hex number of the register value. -c CORE Hex number of core to check data -v VALUE Expected register hex value.
    For MMIO registers, the script must read MEM[BASE + ADDRESS] & MASK and compare with value VALUE.
    if MEM[BASE + ADDR] & MASK == VALUE then return 0 else return 1 end
    For MSR registers, the script must read (NUMBER register from CORE) & MASK and compare with value VALUE.
    msr = read MSR register NUMBER from core CORE if msr & MASK == VALUE then return 0 else return 1 end
  • Output: 0 or 1 in return value, 0 - if register value matches the input value, 1 - vice versa.
  • Error handling: Any nonzero value returned from the script will be interpreted as an error. Any additional logging should be printed to STDERR.
Example for MMIO:
Command line: tools/target_scripts/registers_checker.py MMIO -b 0xFEDA0000 -a 0x0A78 -m 0x1 -c 32 -v 0x1 STDOUT: No Return value: 0 STDERR: empty
Example for MSR:
Command line: tools/target_scripts/registers_checker.py MSR -c 0x0 -n 0x124 -v 0x4 STDOUT: Current value of register is 0x3 Return value: 1 STDERR: empty

Product and Performance Information

1

Performance varies by use, configuration and other factors. Learn more at www.Intel.com/PerformanceIndex.