Specifications

Instruction Set Reference
Programming Model
Invalid Instructions
An invalid instruction word contains invalid codes in the OP or OPX field. For normal Nios II core
implementations, the result of executing an invalid instruction is undefined; processor behavior is
dependent on the Nios II core.
Therefore, the software exception funnel cannot detect or respond to an invalid instruction.
For more information about how invalid instructions are different from unimplemented instructions,
refer to the “Unimplemented Instructions” chapter.
For more information, refer to the "Nios II Core Implementation Details" chapter of the Nios II Processor
Reference Handbook.
Related Information
Unimplemented Instructions on page 8-29
Nios II Core Implementation Details
The Nios II Instruction-Related Exception Handler
The software exception funnel lets you handle instruction-related exceptions, such as the advanced
exceptions. The instruction-related exception handler is a custom handler. Your software registers the
instruction-related exception handler with the HAL at startup time.
Note:
The hal.enable_instruction_related_exceptions_api setting must be enabled in the BSP in
order for you to register an instruction-related exception handler.
For more information about the Nios II instruction-related exceptions, refer to the "Programming Model"
chapter of the Nios II Processor Reference Handbook.
For more information about enabling instruction-related exception handlers, refer to “Settings Managed
by the Software Build Tools” in the "Nios II Software Build Tools Reference" chapter of the Nios II
Software Developer’s Handbook.
When you register an instruction-related exception handler, it takes the place of the break/optional trap
logic.
When you remove the instruction-related exception handler, the HAL restores the default break/optional
trap logic.
Related Information
Programming Model
Nios II Software Build Tools Reference on page 15-1
Writing an Instruction-Related Exception Handler
The prototype for an instruction-related exception handler is as follows:
alt_exception_result handler (
alt_exception_cause cause,
8-32
Invalid Instructions
NII5V2
2015.05.14
Altera Corporation
Exception Handling
Send Feedback