AN 977: Nios® V Processor Custom Instruction

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

2.2.1. Multicycle Custom Instruction Ports

Table 2.  Multicycle Custom Instruction Ports
Port Name Direction Required? Description
clk Input Yes System clock.
reset Input Yes Synchronous reset.
data0[31:0] Input Optional 2 Input operand to custom instruction logic block (Source Register 1).
data1[31:0] Input Optional2 Input operand to custom instruction logic block (Source Register 2).
alu_result[31:0] Input Optional2 Input operand to custom instruction logic block (ALU Switch result).
ctrl[31:0] Input Optional2 Custom instruction word. Reserved for other use.
enable Input Yes Custom instruction logic block enables.
done Output Yes Indicator to the completion of the custom instruction execution.
result[31:0] Output Optional2 Result of the custom instruction.

The Nios® V processor system clock feeds the custom logic block’s clk port. The Nios® V processor system reset feeds the active high reset port. The reset port asserts only when the whole Nios® V processor system resets.

If you assert the enable port, the Nios® V processor custom instruction logic receives input thru the data0, data1, and alu_result ports, and drives the result to its result port. The processor considers the result as valid when the logic block asserts the done port. The ctrl port delivers the full instruction word to the logic block for other use.
Figure 4. Multicycle Custom Instruction Block Diagram
2 Use only if the custom instruction requires the port.