|
本帖最后由 maidong 于 2009-8-2 21:10 编辑
我安装了从Altera的FTP上下载到的大学计划IP核:
ftp://ftp.altera.com/up/pub/Univ ... /UP_IP_Library.exe.
其中包括了VGA组件。
我看过了其中VGA相关的文档,但在最后编译的时候出错了,下面我说一下我的做法和遇到的问题,使用的是7.2版本的软件。
基于DE1_NIOS的工程模板,打开SOPC Builder添加University Program DE1 Board->VGA,如下设置:
其余标签默认设置,然后Generate。
回到Quartus II,参考新生成的system_0.v,例化VGA相关的信号:
system_0 DUT
(
//省略
.VGA_R_from_the_vga_0 (VGA_R),
.VGA_G_from_the_vga_0 (VGA_G),
.VGA_B_from_the_vga_0 (VGA_B),
.VGA_HS_from_the_vga_0 (VGA_HS),
.VGA_VS_from_the_vga_0 (VGA_VS)
/*
.SRAM_ADDR_from_the_vga_0 (SRAM_ADDR_from_the_vga_0),
.SRAM_CE_N_from_the_vga_0 (SRAM_CE_N_from_the_vga_0),
.SRAM_DQ_to_and_from_the_vga_0 (SRAM_DQ_to_and_from_the_vga_0),
.SRAM_LB_N_from_the_vga_0 (SRAM_LB_N_from_the_vga_0),
.SRAM_OE_N_from_the_vga_0 (SRAM_OE_N_from_the_vga_0),
.SRAM_UB_N_from_the_vga_0 (SRAM_UB_N_from_the_vga_0),
.SRAM_WE_N_from_the_vga_0 (SRAM_WE_N_from_the_vga_0),
.VGA_BLANK_from_the_vga_0 (VGA_BLANK_from_the_vga_0),
.VGA_SYNC_from_the_vga_0 (VGA_SYNC_from_the_vga_0),
*/
);
后面注释中是我不确定的部分,VGA_BLANK和VGA_SYNC应该不用分配吧,跟SRAM相关的信号不知如何分配。这个VGA组件中Pixel_Buffer使用了SRAM,Charactor_Buffer使用了Onchip_RAM,但我不是很清楚如何连接了的。
就按上面的整体编译,通过。
打开NIOS II IDE,新建一个hello world工程,编译出错:
**** Build of configuration Debug for project VGA ****
make -s all includes
Creating generated_app.mk...
Compiling alt_sys_init.c...
system_description/alt_sys_init.c:79: error: `VGA_0_NAME' undeclared here (not in a function)
system_description/alt_sys_init.c:79: error: initializer element is not constant
system_description/alt_sys_init.c:79: error: (near initialization for `vga_0.dev.name')
system_description/alt_sys_init.c:79: error: initializer element is not constant
system_description/alt_sys_init.c:79: error: (near initialization for `vga_0.dev')
system_description/alt_sys_init.c:79: error: `VGA_0_BASE' undeclared here (not in a function)
system_description/alt_sys_init.c:79: error: initializer element is not constant
system_description/alt_sys_init.c:79: error: (near initialization for `vga_0.pixel_base')
system_description/alt_sys_init.c:79: error: initializer element is not constant
system_description/alt_sys_init.c:79: error: (near initialization for `vga_0.char_base')
system_description/alt_sys_init.c:79: error: `VGA_0_SPAN' undeclared here (not in a function)
system_description/alt_sys_init.c:79: error: initializer element is not constant
system_description/alt_sys_init.c:79: error: (near initialization for `vga_0.pixel_slave_span')
system_description/alt_sys_init.c:79: error: `VGA_0_ALT_UP_VGA_PIX_X_RESOLUTION' undeclared here (not in a function)
system_description/alt_sys_init.c:79: error: initializer element is not constant
system_description/alt_sys_init.c:79: error: (near initialization for `vga_0.ALT_UP_VGA_PIX_X_RESOLUTION')
system_description/alt_sys_init.c:79: error: `VGA_0_ALT_UP_VGA_PIX_Y_RESOLUTION' undeclared here (not in a function)
system_description/alt_sys_init.c:79: error: initializer element is not constant
system_description/alt_sys_init.c:79: error: (near initialization for `vga_0.ALT_UP_VGA_PIX_Y_RESOLUTION')
system_description/alt_sys_init.c:79: error: `VGA_0_ALT_UP_VGA_CHAR_X_RESOLUTION' undeclared here (not in a function)
system_description/alt_sys_init.c:79: error: initializer element is not constant
system_description/alt_sys_init.c:79: error: (near initialization for `vga_0.ALT_UP_VGA_CHAR_X_RESOLUTION')
system_description/alt_sys_init.c:79: error: `VGA_0_ALT_UP_VGA_CHAR_Y_RESOLUTION' undeclared here (not in a function)
system_description/alt_sys_init.c:79: error: initializer element is not constant
system_description/alt_sys_init.c:79: error: (near initialization for `vga_0.ALT_UP_VGA_CHAR_Y_RESOLUTION')
system_description/alt_sys_init.c:79: error: `VGA_0_ALT_UP_VGA_PIX_X_COORD_OFST' undeclared here (not in a function)
system_description/alt_sys_init.c:79: error: initializer element is not constant
system_description/alt_sys_init.c:79: error: (near initialization for `vga_0.ALT_UP_VGA_PIX_X_COORD_OFST')
system_description/alt_sys_init.c:79: error: `VGA_0_ALT_UP_VGA_PIX_X_COORD_MSK' undeclared here (not in a function)
system_description/alt_sys_init.c:79: error: initializer element is not constant
system_description/alt_sys_init.c:79: error: (near initialization for `vga_0.ALT_UP_VGA_PIX_X_COORD_MSK')
system_description/alt_sys_init.c:79: error: `VGA_0_ALT_UP_VGA_PIX_Y_COORD_OFST' undeclared here (not in a function)
system_description/alt_sys_init.c:79: error: initializer element is not constant
system_description/alt_sys_init.c:79: error: (near initialization for `vga_0.ALT_UP_VGA_PIX_Y_COORD_OFST')
system_description/alt_sys_init.c:79: error: `VGA_0_ALT_UP_VGA_PIX_Y_COORD_MSK' undeclared here (not in a function)
system_description/alt_sys_init.c:79: error: initializer element is not constant
system_description/alt_sys_init.c:79: error: (near initialization for `vga_0.ALT_UP_VGA_PIX_Y_COORD_MSK')
system_description/alt_sys_init.c:79: error: `VGA_0_ALT_UP_VGA_CHAR_X_COORD_OFST' undeclared here (not in a function)
system_description/alt_sys_init.c:79: error: initializer element is not constant
system_description/alt_sys_init.c:79: error: (near initialization for `vga_0.ALT_UP_VGA_CHAR_X_COORD_OFST')
system_description/alt_sys_init.c:79: error: `VGA_0_ALT_UP_VGA_CHAR_X_COORD_MSK' undeclared here (not in a function)
system_description/alt_sys_init.c:79: error: initializer element is not constant
system_description/alt_sys_init.c:79: error: (near initialization for `vga_0.ALT_UP_VGA_CHAR_X_COORD_MSK')
system_description/alt_sys_init.c:79: error: `VGA_0_ALT_UP_VGA_CHAR_Y_COORD_OFST' undeclared here (not in a function)
system_description/alt_sys_init.c:79: error: initializer element is not constant
system_description/alt_sys_init.c:79: error: (near initialization for `vga_0.ALT_UP_VGA_CHAR_Y_COORD_OFST')
system_description/alt_sys_init.c:79: error: `VGA_0_ALT_UP_VGA_CHAR_Y_COORD_MSK' undeclared here (not in a function)
system_description/alt_sys_init.c:79: error: initializer element is not constant
system_description/alt_sys_init.c:79: error: (near initialization for `vga_0.ALT_UP_VGA_CHAR_Y_COORD_MSK')
system_description/alt_sys_init.c:79: error: `VGA_0_ALT_UP_VGA_PIX_COLOR_MASK' undeclared here (not in a function)
system_description/alt_sys_init.c:79: error: initializer element is not constant
system_description/alt_sys_init.c:79: error: (near initialization for `vga_0.ALT_UP_VGA_PIX_COLOR_MSK')
make[1]: *** [obj/alt_sys_init.o] Error 1
make: *** [system_project] Error 2
Build completed in 20.937 seconds
貌似是没有包含某个头文件引起的。我试着包含提供的"altera_up_avalon_vga_regs.h"、"altera_up_avalon_vga.h",还是一样的问题。
我想知道这个过程中有没有什么问题,实现VGA有没有其它更好的方案,谢谢! |
|