Configuring the custom instruction signal type, Setting up the custom instruction interfaces – Altera Nios II Custom User Manual
Page 25

Chapter 3: Implementing a Nios II Custom Instruction in SOPC Builder
3–3
Implementing Custom Instruction Hardware in SOPC Builder
January 2011
Altera Corporation
Nios II Custom Instruction User Guide
7. Click Top Level Module and select the name of the top-level module of your
custom instruction logic. The top-level module for this design example is
CRC_Custom_Instruction
.
8. To enable simulating the system in the ModelSim simulator, you can turn on Sim
for both files. In cases other than the design example, you may need to add
additional simulation files in the component editor HDL Files tab, turn on Sim
and turn off Synth for these simulation-only files, and turn off Sim for the
synthesis-only files.
Configuring the Custom Instruction Signal Type
To configure the custom instruction signal type, follow these steps:
1. Click Next to display the Signals tab.
2. For each port listed in the tab, follow these steps:
a. Select the port.
b. In the Interface column, select the name of the interface to which you want to
assign the port. For the design example, select
nios_custom_instruction_slave_0
.
c. In the Signal Type column, select the appropriate signal type for the port. The
available types are described in
“Custom Instruction Types” on page 1–3
Setting Up the Custom Instruction Interfaces
To set up the custom instruction interfaces, follow these steps:
1. Click Next to display the Interfaces tab.
2. For Type, select Custom Instruction Slave.
3. For the design example, maintain the interface name
nios_custom_instruction_slave_0
.
1
If you rename an interface by changing the value in the Name field, the
Signals
tab Interface column value changes automatically. The value
shown in the block diagram updates when you change tabs and return to
the Interfaces tab.
4. For Clock Cycles, type 0 for a variable multicycle type custom instruction, and
otherwise type the number of clock cycles your custom instruction logic requires.
The design example builds a variable multicycle type custom instruction.
1
If the interface includes a
done
signal and a
clk
signal, the component
editor automatically infers that the interface is a variable multicycle type
custom instruction interface, and sets the value to
0
.
5. For Clock Cycle Type, type
Variable
for a variable multicycle type custom
instruction,
Multicycle
for a fixed multicycle type custom instruction, or
Combinatorial
for a combinational type custom instruction.