完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
/********************************************以上是一个VGA 显示的字符的代码逻辑,编译没有ERROR ,当编译后占用的寄存器资源却为0%;,利用了FPGA 里的PLL 和ROM,通过读取ROM的数据送到VGA接口显示,采用的是1024X768的分辨率屏
******************************************************************************************/ module word_test(input clk, input rst_n, output [4:0]data_r, output [5:0]data_g, output [4:0]data_b, output h_signal, output v_signal ); //Horizontal Define parameter LinePeriod = 1344; parameter H_SyncyPulse = 136; parameter H_BackProch = 160; parameter H_ActivePix = 1024; parameter H_FrontProch = 24; parameter H_start = 296; parameter H_end = 1320; //Vertical Define parameter VerticalPeriod = 806; parameter VyncyPulse = 6; parameter V_BackProch = 29; parameter V_ActivePix = 768; parameter V_FrontProch = 3; parameter V_Start = 35; parameter V_End = 803; //Register Definiton reg [10:0]H_cnt; reg [9:0]V_cnt; reg hsyncy; reg vsyncy; reg h_mask; reg v_mask; wire vga_clock; parameter H_VaildArea = 400;//default 32 bits parameter V_VaildArea = 200; parameter V_VaildAddress = 375; //counter Loop always@(posedge vga_clock) begin if(~rst_n)H_cnt <= 1; else if(H_cnt == LinePeriod) H_cnt <= 1; else H_cnt <= H_cnt + 1 ; end always@(posedge vga_clock) begin if(~rst_n)hsyncy <= 1'b1; else if(H_cnt == 1)hsyncy <= 1'b0; else if(H_cnt == H_SyncyPulse) hsyncy <= 1'b1; if(1'b0)h_mask <= 1'b0; else if(H_cnt == H_start) h_mask <= 1'b1; else if(H_cnt == H_end) h_mask <= 1'b0; end //Generate Vertical Direction Counter always@(posedge vga_clock) if(~rst_n) V_cnt <= 1; else if(V_cnt == LinePeriod)V_cnt <= V_cnt + 1; else if(V_cnt == VerticalPeriod) V_cnt <= 1; //Generate Vertical Direction Wave always@(posedge vga_clock) begin if(~rst_n) vsyncy <= 1'b1; else if(V_cnt == 1) vsyncy <= 1'b0; else if(V_cnt == VyncyPulse) vsyncy <= 1'b1; //if(~rst_n) v_mask <= 1'b0; if(1'b0) v_mask <= 1'b0; else if(V_cnt == V_Start) v_mask <= 1'b1; else if(V_cnt == V_End ) v_mask <= 1'b0; end reg [4:0]x_cnt0; // reg [4:0]x_cnt1; reg [10:0]x_address0;//first byte Address reg [10:0]x_address1;//second byte Address wire x_word0;// Array : ALEX wire x_word1; wire y_word0;// Array : ALEX wire y_word1; wire pre_word0;// Array : ALEX wire pre_word1; assign x_word0 = (H_cnt >= H_VaildArea && H_cnt < H_VaildArea + 40)? 1'b1: 1'b0; assign y_word0 = (V_cnt >= V_VaildArea && V_cnt < V_VaildArea + 75)? 1'b1: 1'b0; assign pre_word0 = (H_cnt>= H_VaildArea-2 && H_cnt < H_VaildArea +38)? 1'b1: 1'b0; assign x_word1 = ((H_cnt >= H_VaildArea +100) && H_cnt < H_VaildArea + 140)? 1'b1: 1'b0; assign y_word1 = (V_cnt >= V_VaildArea && V_cnt < V_VaildArea + 75)? 1'b1: 1'b0; assign pre_word1 = (H_cnt>= H_VaildArea-2 + 100 && H_cnt < H_VaildArea +140-2 )? 1'b1: 1'b0; //Remap Address to ROM always@(posedge vga_clock) begin if(~rst_n) begin x_cnt0 <= 0; x_cnt1 <= 0; x_address0 <= 0; x_address1 <= 375;//375 end else begin if(vsyncy == 1'b0) begin x_address0 <= 0; x_address1 <=375;// x_cnt0 <= 0; x_cnt1 <= 0; end else if((y_word0==1'b1)&&(pre_word0 == 1'b1) )begin // 0 byte address if(x_cnt0 == 7) begin x_address0 <= x_address0 + 1'b1; x_cnt0 <= 0; end else begin x_cnt0 <= x_cnt0 + 1'b1; x_address0 <= x_address0; end end else if((y_word1==1'b1)&&(pre_word1 == 1'b1) )begin if(x_cnt1 == 7) begin x_cnt1 <= 0; x_address1 <= x_address1 + 1'b1 ; end else begin x_address1 <= x_address1; x_cnt1 <= x_cnt1 + 1'b1; end end else begin x_address0 <= x_address0; x_address1 <= x_address1; ///x_address2 <= x_address2; ///x_address3 <= x_address3; x_cnt0 <= 0;//clear 0 x_cnt1 <= 0; ///x_cnt2 <= 0; ///x_cnt3 <= 0; end end end reg [4:0]x_data0; reg [4:0]x_data1; always@(posedge vga_clock) begin if(~rst_n) begin x_data0 <= 7;//Clear 0 x_data1 <= 7;// end else begin if(vsyncy == 1'b0)// begin x_data0 <= 7; x_data1 <= 7; end else if((x_word0== 1'b1) && (y_word0== 1'b1)) begin if(x_data0==0) x_data0 <= 7; else x_data0 <= x_data0 - 1'b1; end else if( (x_word1== 1'b1) && (y_word1== 1'b1)) begin if(x_data1== 0) x_data1 <= 7; else x_data1 <= x_data1 - 1'b1; end else begin x_data0 <= 7; x_data1 <= 7; end end end /*sys_pll PLL ( .areset(~rst_n), .inclk0(clk), .c0(vga_clock), .locked() ); */ wire [4:0]out_data1; wire [4:0]out_data2; wire [4:0]data_select; assign out_data1 = {5{rom_data[x_data0]}}; assign out_data2 = {5{rom_data[x_data1]}}; assign data_select = (x_word0 == 1'b1) ? out_data1 : out_data2; wire [10:0] rom_address ; wire [7:0] rom_data; assign rom_address = (x_word0 == 1'b1) ? x_address0 : x_address1; sys_rom m2( .address(rom_address), .clock(vga_clock), .q(rom_data) ); assign h_signal = hsyncy; assign v_signal = vsyncy ; assign data_r = (((y_word0 ==1'b1)&&(x_word0==1'b1)) | ((y_word1==1'b1 && (x_word1 == 1'b1)))) ? data_select : 5'b00000; assign data_g = (h_mask & v_mask ) ? 6'b000011 : 6'b000000; assign data_b = (h_mask & v_mask ) ? 5'b00011 : 5'b00000; sys_pll m1 ( .areset(~rst_n), .inclk0(clk), .c0(vga_clock), .locked() ); endmodule /*********************************************/ 以上是一个VGA 显示的字符的代码逻辑,编译没有ERROR ,当编译后占用的寄存器资源却为0%; 编译提示如下: Warning (14284): Synthesized away the following node(s): Warning (14285): Synthesized away the following RAM node(s): Warning (14320): Synthesized away node "sys_rom:m2|altsyncram:altsyncram_component|altsyncram_j491:auto_generated|q_a[0]" Warning (14320): Synthesized away node "sys_rom:m2|altsyncram:altsyncram_component|altsyncram_j491:auto_generated|q_a[1]" Warning (14320): Synthesized away node "sys_rom:m2|altsyncram:altsyncram_component|altsyncram_j491:auto_generated|q_a[2]" Warning (14320): Synthesized away node "sys_rom:m2|altsyncram:altsyncram_component|altsyncram_j491:auto_generated|q_a[3]" Warning (14320): Synthesized away node "sys_rom:m2|altsyncram:altsyncram_component|altsyncram_j491:auto_generated|q_a[4]" Warning (14320): Synthesized away node "sys_rom:m2|altsyncram:altsyncram_component|altsyncram_j491:auto_generated|q_a[5]" Warning (14320): Synthesized away node "sys_rom:m2|altsyncram:altsyncram_component|altsyncram_j491:auto_generated|q_a[6]" Warning (14320): Synthesized away node "sys_rom:m2|altsyncram:altsyncram_component|altsyncram_j491:auto_generated|q_a[7]" DeBug了很久,没有解决;求各位帮忙解答下 |
|
相关推荐
7个回答
|
|
你还是发工程上来吧
|
|
|
|
|
|
|
|
好的,刚刚上传好了,感谢
|
|
|
|
|
|
|
|
|
|
不好意思,是我没有表达清楚。Total Mermory Bits 是0%,这个工程用了FPGA内部资源,原则上不可能是0%,但是从编译结果来看的话,却没消耗。 所以不知道问题出在哪了。
|
|
|
|
这个是我编译MC8051内核,定制ROM:8k RAMX:2K RAM:128
8*1024*8 + 2*1024*8 + 128*8 = 82994 正常的reg不是用这部分的内存! |
|
|
|
只有小组成员才能发言,加入小组>>
2900 浏览 3 评论
27703 浏览 2 评论
3479 浏览 2 评论
3987 浏览 4 评论
基于采用FPGA控制MV-D1024E系列相机的图像采集系统设计
2335 浏览 3 评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-12-24 13:14 , Processed in 3.524598 second(s), Total 59, Slave 50 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号