新手入门
- 积分
- 7
- 金钱
- 7
- 注册时间
- 2024-8-15
- 在线时间
- 1 小时
|
1金钱
我的lcd_display模块代码如下,仿真时正常,但综合时报错:“[Synth 8-2715] syntax error near [ ["C:/Users/SSWYBD/Desktop/My_Codes/ZhengDian_FPGA/22_lcd_rgb_char/rtl/lcd_display.sv":34]“,且一共有四处,但用VIVADO的编辑器打开也没有提示语法错误(错误行我用*标注了)
module lcd_display(
input wire lcd_pclk,
input wire rst_n,
input wire [10:0] pixel_xpos,
input wire [10:0] pixel_ypos,
output reg [23:0] pixel_data
);
// parameter define
localparam PIC_X_START = 11'd10;
localparam PIC_Y_START = 11'd10;
localparam PIC_WIDTH = 11'd100;
localparam PIC_HEIGHT = 11'd100;
localparam CHAR_X_START= 11'd10;
localparam CHAR_Y_START= 11'd120;
localparam CHAR_WIDTH = 11'd128;
localparam CHAR_HEIGHT = 11'd32;
localparam BACK_COLOR = 24'hE0FFFF;
localparam CHAR_COLOR = 24'hff0000;
reg [127:0] char [31:0]; // *
reg [13:0] rom_addr;
wire [10:0] x_cnt;
wire [10:0] y_cnt;
wire [23:0] rom_rd_data;
assign x_cnt = pixel_xpos + 1'b1 - CHAR_X_START;
assign y_cnt = pixel_ypos - CHAR_Y_START;
always_ff @( posedge lcd_pclk ) begin
char[0 ] <= 128'h00000000000000000000000000000000; // *
char[1 ] <= 128'h00000000000000000000000000000000;
char[2 ] <= 128'h00000000000100000000002000000000;
char[3 ] <= 128'h000000100001800002000070000000C0;
char[4 ] <= 128'h000000380001800003FFFFF803FFFFE0;
char[5 ] <= 128'h07FFFFFC0001800003006000000001E0;
char[6 ] <= 128'h0000C000000180600300600000000300;
char[7 ] <= 128'h0000C0000001FFF00300C00000000600;
char[8 ] <= 128'h0000C000000180000310804000001800;
char[9 ] <= 128'h0000C00000018000031FFFE000003000;
char[10] <= 128'h0000C00000018000031800400001C000;
char[11] <= 128'h0000C00000018000031800400001C000;
char[12] <= 128'h00C0C000018181800318004000018000;
char[13] <= 128'h00C0C00001FFFFC0031FFFC000018010;
char[14] <= 128'h00C0C060018001800318004000018038;
char[15] <= 128'h00C0FFF001800180031800403FFFFFFC;
char[16] <= 128'h00C0C000018001800318004000018000;
char[17] <= 128'h00C0C000018001800218004000018000;
char[18] <= 128'h00C0C00001800180021FFFC000018000;
char[19] <= 128'h00C0C000018001800210304000018000;
char[20] <= 128'h00C0C00001FFFF800200300000018000;
char[21] <= 128'h00C0C000018001800606300000018000;
char[22] <= 128'h00C0C000018001000607370000018000;
char[23] <= 128'h00C0C00000000000060E31C000018000;
char[24] <= 128'h00C0C000001000400418307000018000;
char[25] <= 128'h00C0C000020830600430303800018000;
char[26] <= 128'h00C0C010020C18300860301800018000;
char[27] <= 128'h00C0C038060E18180883700800018000;
char[28] <= 128'h3FFFFFFC0C0618181100F008003F8000;
char[29] <= 128'h000000001C0408182000600000070000;
char[30] <= 128'h00000000000000000000000000020000;
char[31] <= 128'h00000000000000000000000000000000;
end
always_ff @( posedge lcd_pclk or negedge rst_n ) begin
if (!rst_n) begin
pixel_data <= BACK_COLOR;
end
else if ( (pixel_xpos >= PIC_X_START - 1'b1) && (pixel_xpos < PIC_X_START + PIC_WIDTH - 1'b1)
&& (pixel_ypos >= PIC_Y_START) && (pixel_ypos < PIC_Y_START + PIC_HEIGHT) ) begin
pixel_data <= rom_rd_data;
end
else if ( (pixel_xpos >= CHAR_X_START - 1'b1) && (pixel_xpos < CHAR_X_START + CHAR_WIDTH - 1'b1)
&& (pixel_ypos >= CHAR_Y_START) && (pixel_ypos < CHAR_Y_START + CHAR_HEIGHT) ) begin
if (char[y_cnt][CHAR_WIDTH - 1'b1 - x_cnt]) begin // *
pixel_data <= CHAR_COLOR;
end
else begin // *
pixel_data <= BACK_COLOR;
end
end
else begin
pixel_data <= BACK_COLOR;
end
end
always_ff @( posedge lcd_pclk or negedge rst_n ) begin
if (!rst_n)
rom_addr <= 14'd0;
else if ((pixel_ypos >= PIC_Y_START) && (pixel_ypos < PIC_Y_START + PIC_HEIGHT)
&& (pixel_xpos >= PIC_X_START - 2'd2) && (pixel_xpos < PIC_X_START + PIC_WIDTH - 2'd2))
rom_addr <= rom_addr + 1'b1;
else if ((pixel_ypos >= PIC_Y_START + PIC_HEIGHT))
rom_addr <= 14'd0;
end
blk_mem_gen_0 u_blk_mem_gen_0 (
.clka(lcd_pclk),
.ena(1'b1),
.addra(rom_addr),
.douta(rom_rd_data)
);
endmodule
|
|