Hardware Exceptions Detection

From Texas Instruments Wiki
Jump to: navigation, search

Hardware Exceptions Detection on C6000 simulators

Overview

The exception mechanism in C64x+ and C674x CPUs is intended to support error detection and program redirection to error handling service routines. There are multiple causes for internal exceptions. Examples are illegal opcodes, illegal behavior within an instruction, and resource conflicts. Refer the C64x+ CPU Reference guide for detailed information on the types of exceptions supported and usage details.

Simulation Support

The C64x+ and C674x simulators provide visibility and control on the hardware exceptions. The simulator could be configured to take any of the following actions on the occurrence of an exception -

  1. Allow the exception handler to take care of the exception. No additional action taken.
  2. Allow the exception handler to take care of the exception and also print out warnings on the console indicating the nature of the exception and the PC that caused it.
  3. Halt the simulation with an error message indicating the nature of the exception and the PC that caused it.

Supported Configurations

  1. All C64x+ based configurations
  2. All C647x based configurations

Supported Exceptions

List of supported Exceptions
Category Exception Simulator Support
Fetch error Fetch error (privilege,parity,etc) No
Two branches in execute packet Yes
Branch to middle of 32-bit instr Yes
Branch to header Yes
Branch to header Yes
Illegal fetch packets Reserved fetch packet header Yes
Illegal opcode Specified set of reserved opcodes Yes
Header not in word 7 Yes
Privilege violation Access to restricted control register No
Attempt to execute restricted instruction No
Non-secure register access violation No
Register write conflicts Register write conflicts Yes
Multiplier write path conflict Multiplier write path conflict No
SPLOOP buffer exceptions Unit conflicts Yes
Missed (but required) stall Yes
Attempt to enter early-exit in reload while draining Yes
Unexpected SPKERNEL Yes
Write to ILC or RILC in prohibited timing window Yes
Multicycle NOP prior to SPKERNEL or SPKERNELR instruction Yes


Enabling HW Exceptions on CCSv4

  1. Invoke the right GEL command via Scripts->HW Exceptions based on the action required on the occurrence of the exception.
    1. EnableHWExceptions : Allow the exception handler to take care of the exception. No additional action taken
    2. EnableHWExceptionsWithWarning : Allow the exception handler to take care of the exception and also print out warnings on the console indicating the nature of the exception and the PC that caused it.
    3. EnableHWExceptions WithError : Halt the simulation with an error message indicating the nature of the exception and the PC that caused it.
  2. If you don’t see the HW Exceptions options in the Script menu, you can manually load the GEL file that provides this option.
    1. Invoke the GEL window via Tools->GEL Files
    2. Right-Click on the GEL-Files window and select Load GEL
    3. Load the GEL file present at <CCS_INSTALL_DIR>\simulation\env\ccs\import\tisim_hwexceptions.gel
    4. Perform Step 1
Hw Exceptions Gel Menu
  1. This can be done at any time before or during the program execution and the exceptions would be tracked from that point onwards.


Screenshot for Hardware Exceptions Detection Error on CCSv4:

Exceptions wiki error v4.JPG

Enabling HW Exceptions on CCS3.3

  1. Invoke the Gel Toolbar from the menu option : View -> Gel Toolbar
  2. Provide the appropriate GEL command in the GEL Toolbar based on the action required on the occurrence of the exception -
    1. GEL_DriverString("SIM_EXCEPTION,ON"); : Allow the exception handler to take care of the exception. No additional action taken.
    2. GEL_DriverString("SIM_EXCEPTION,ON,WARNING"); : Allow the exception handler to take care of the exception and also print out warnings on the console indicating the nature of the exception and the PC that caused it.
    3. GEL_DriverString("SIM_EXCEPTION,ON,ERROR"); : Halt the simulation with an error message indicating the nature of the exception and the PC that caused it.
    4. This can be done at any time before or during the program execution and the exceptions would be tracked from that point onwards.

Screenshot for Hardware Exceptions Detection Warning on CCS3.3:
Exceptions wiki warning v3.JPG