AN 977: Nios® V Processor Custom Instruction

ID 773194
Date 4/14/2023
Public
Document Table of Contents

1.2. Implementing Custom Instruction Logic Block

The Nios® V processor supports three types of custom instructions:
  • Multicycle
  • Extended
  • External Interface
Figure 3.  Nios® V Processor Custom Instruction Logic Block Interface
Custom Instruction logic blocks consists of a Nios® V Processor Custom Instruction Subordinate interface. The figure above shows all the ports in the Nios V Custom Instruction Subordinate interface that communicates with the Nios® V processor.
  • clk
  • reset
  • data0[31:0]
  • data1[31:0]
  • alu_result[31:0]
  • ctrl[31:0]
  • enable
  • result[31:0]
  • done

All the ports can accommodate all custom instruction types. The figure above also shows a conduit interface to the external logic. The interface to external logic allows you to include a custom interface to system resources outside of the Nios® V processor datapath.

Nios® V processor custom instructions requires the clk, reset, enable and done ports. The custom instruction logic provides a result based on the inputs provided by the Nios® V processor. When the enable port is asserted, the Nios® V processor custom instruction logic receives inputs on its data0, data1, and alu_result ports and outputs the result to its result port. When the logic block asserts the done port, the processor considers the result valid.