nios - 2常见问题解答 联系客服

发布时间 : 星期六 文章nios - 2常见问题解答更新完毕开始阅读c91544d726fff705cc170a38

设备,在Sopc Builder中自己定义component。需要写HDL模块,自己定控制、状

态、数据寄存器和控制位定义,这种方式控制灵活,易于实现复杂的控制时序。 3.在Quartus II 工程中画电路模块(或用HDL写电路模块),这种方式是独立于

SOPC定义的模块之外的,做一个纯电路的处理模块,有时候会比较容易实现某些

灵活的处理。

12.在SOPC添加Avalon Trisatate Bridge时,提示有如下错误,该如何解决? Tri state bridge/tristate master requires a slave of type Avalon tristate.Please add a slave of type Avalon tristate. Generate按钮为灰色,无法Generate

答:需要一个专门接三台桥的设备,把flash添加到sopc中就可以了。 13. 在做count_binary这个例子时,出现一个错误: error: `BUTTON_PIO_IRQ' undeclared (first use in this function) BUTTON_PIO_IRQ的值如何给他定义

? 答:这个错误可能是在sopc builder中定制的pio端口名称是否与程序中用的

不一致,要和程序里的一致,把pio组件的名称就改为button_pio,如下图: 如果已经这样设置,还有可能是没有设置中断号,具体应该这样设置:

14.在Quartus II中编译时出现如下错误:

Error: Node instance \\

点击错误的地方弹出一个对话框

这个错误是怎么回事?怎样解决?

答:可能是在SOPC中所选的CPU型号不正确,换一个试试。

15.怎样自动分配管脚?

答:在Quartus II自动分配管脚有一个方法,点击Assignments->Import Assginments,导入一个管脚分配文件,后缀为.csv .txt等,前提是在顶层原理图

中各个输入输出的名称要和这个文件中的名称一致。

16.在NIOS II中编译时出现如下错误怎么解决?错误是不是由SOPC中的RAM引起?

region ram is full (count_binary.elf section .text). Region needs to be 24672 bytes larger.

address 0x80c1f8 of count_binary.elf section .rwdata is not within region ram

Unable to reach edge_capture (at 0x00800024) from the global pointer (at 0x0081419c) because the offset (-82296) is out of the allowed range, -32678 to 32767.

答:可能时RAM的大小不够,也有可能是中断地址(exception address) 的偏余量

不够,设置大些就可以了。如果还是出现这个问题,加一个SDRAM试试。 17.在Quartus II中,为什么编译一些样板工程都会出错?

Error: DDR timing cannot be verified until project has been

successfully compiled.

Error: Evaluation of Tcl script auto_verify_ddr_timing.tcl unsuccessful Error: Quartus II Shell was unsuccessful. 2 errors, 1 warning

答:在做样板工程时要注意一个问题:Due to the library paths that are coded into the Quartus settings for this project, if a user wishes to modify the hardware design they must first strip out any old paths from within the project settings file (qsf) 在qsf文件中找到类似语句

set_global_assignment-nameVHDL_FILE C:/MegaCore/ddr_ddr2_sdram- v3.2.0/lib/auk_ddr_tb_functions.vhd\这里的目录是初始的目录,把它改为正 确的目录。

18.在NIOS II IDE编译时出现如下错误是怎么回事?

system_description/alt_sys_init.c:75: error: `ONCHIP_MEMORY_BASE' undeclared here (not in a function)

system_description/alt_sys_init.c:75: error: initializer element is not

constant

system_description/alt_sys_init.c:75: error: (near initialization for `ext_flash.dev.write')

system_description/alt_sys_init.c:75: error: initializer element is not constant

system_description/alt_sys_init.c:75: error: (near initialization for `ext_flash.dev.read') 答:ONCHIP_MEMORY_BASE没有赋值,在alt_sys_init.c 程序的开头加上#define ONCHIP_MEMORY_BASE 0x00000000后面的这个地址要与SOPC中的对应。 19. 在NIOS II IDE编译时出现如下错误是怎么回事? Pausing target processor: not responding. Resetting and trying again: FAILED Leaving target processor paused 答:以下是一位FAE的回答:

1. 关于USB-Blaster在Nios II IDE下载时会发生偶发性错误,这种现象主要是

IDE software与Nios II CPU透过USB-Blaster在做通讯时发生错误,若是确认FPG

上配置没有错误,连续发生错误的机率应该是相当的低,您只需要重新下载即可 。

2. 若您使用Nios II IDE 6.0,请尽量配合SOPC Builder 6.0重新build您的 system,并且使用Quartus II 6.0重新compile您的project,以减少CPU与IDE

software不兼容的情形。

20.在NIOS II IDE中工程的System Library选项中的这几个选项代表什么意 思?.text .rodata .rwdata 与reset .exception这几个地址之间的关系是什么 ?

答:.text : 代码区 .rodata:只读数据区,一般存放静态全局变量 .rwdata:可

读写变量数据区另外还有.bss:存放未被初始化的变量。 ■ .text — the actual executable code

■ .rodata — any read only data used in the execution of the code ■ .rwdata — where read/write variables and pointers are stored ■ heap — where dynamically allocated memory is located

■ stack — where function call parameters and other temporary data is stored

21. 怎样在NIOSII中操作PIO,提供一种参考方法。 答:hello_led.c是这样写IO口的:

IOWR_ALTERA_AVALON_PIO_DATA(LED_PIO_BASE, led); 首先在altera_avalon_pio_regs.h找到定义 #i nclude

#define IORD_ALTERA_AVALON_PIO_DATA(base) IORD(base, 0)

#define IOWR_ALTERA_AVALON_PIO_DATA(base, data) IOWR(base, 0, data) 因此在NIOSII中可以调用#i nclude 库函数IORD/IOWR来操作PIO。 在small\\software\\hello_led_0_syslib\\Debug\\system_description下的 system.h

中,有以下内容:

#define LED_PIO_TYPE \#define LED_PIO_BASE 0x00004000

其中LED_PIO_BASE(IO寄存器地址?)为0x00004000同SopcBuilder中设置一致!

(其实在SopcBuilder中有关NiosII的配置,就是通过system.h来传送给IDE的!)

最后用IOWR(0x00004000, 0, led);替代

IOWR_ALTERA_AVALON_PIO_DATA(LED_PIO_BASE, led);编译,下载到开发板上,运行 成功!

22.怎样让SDRAM和FLASH,SRAM的地址公用?

答: sdram可以和sram,flash共用数据总线和地址总线.在sopc builder中添加

SDRAM控制器时,在其share pins via tristate选择项上勾上Controller shares dq/dqm/addr IO pins选项,这样sdram可以和sram,flash共用数据总线和地址总

线.但是ATERA不推荐这样做,因为这样会降低SDRAM控制器的性能,在FPGA芯片管