具体参看ug_nios2_custom_instruction.pdf,说明详细。。网上很好下。 分硬软部分,硬件部分,部分步骤如下。 This section walks you through the process of implementing Nios II custom instructions in hardware, and also provides custom instruction tool-flow explanations. To implement the Nios II custom instruction for the leading-zeros design, you must: 1. Open the custom instruction tutorial hardware design. 2. Add the leading-zeros custom instruction logic to the Nios II CPU. 3. Generate the SOPC Builder system and compile the design in Quartus II. Altera Corporation Core Version a.b.c variable 3–7 December 2004 Nios II Custom Instruction User Guide Implementing a Nios II Processor Custom Instruction Open The Custom Instruction Hardware Design 1. Choose Programs > Altera > Quartus II <version> (Windows Start menu). 2. Choose Open Project... (File menu). 3. Browse to the quartus_project directory for your board. 4. Choose the custom_instruction.qpf and click Open. 5. Choose SOPC Builder…(Tools menu) to start SOPC Builder. Add The Leading-Zeros Custom Instruction Logic This section walks you through the process of adding a custom instruction to an SOPC Builder system, and also provides custom instruction tool-flow explanations. 1. Select cpu_0 in the Altera SOPC Builder System Contents page. See Figure 3–4. Figure 3–4. SOPC Builder System Contents Page 2. Choose Edit… (Module menu). The Nios II Processor Configuration wizard appears. 3. Click on the Custom Instructions tab. 3–8 Core Version a.b.c variable Altera Corporation Nios II Custom Instruction User Guide December 2004 Implementing Custom Instruction Hardware in SOPC Builder 4. Click Import… The Interface to User Logic wizard appears. See |