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

Page 33

Advertising
background image

Chapter 4: Implementing a Nios II Custom Instruction in Qsys

4–3

Implementing Custom Instruction Hardware in Qsys

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, for the first port you configure, select New Custom
Instruction Slave

. For the remaining ports, select the name created for the first

port, which is nios_custom_instruction_slave. These selections ensure that the
ports appear together on a single interface, using the name assumed by the
design example crc_hw files.

c. In the Signal Type column, select the appropriate signal type for the port. The

available signal types are described in

“Custom Instruction Types” on

page 1–3

. In the design example, the correct signal type for each signal has the

same name as the signal.

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. If the Remove Interfaces With No Signals button is active, click it.

3. Ensure that a single interface remains, with Name set to the name in the Signals

tab. For the design example, maintain the interface name
nios_custom_instruction_slave.

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. Ensure the Type for this interface is Custom Instruction Slave.

5. 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.

Advertising