上传者: SKCQTGZX
|
上传时间: 2021-12-02 17:05:02
|
文件大小: 54.74MB
|
文件类型: ZIP
飓风cyclone FPGA开发板verilog逻辑例程Quartus工程源码文件(16例):
low_cost_lcd
S1_38yima
S2_div
S3_WAVE
S4_LCD_V
S4_LCD_VHDL
S5_UART
S6_VGA
S6_VGA_change
S7_PS2_LCD
S7_PS2_RS232
S8_test
T1_SW_PB
T2_USB_IN
T3_USB_OUT
T4_LED_RUN
1。源文件保存在src目录,QII的工程文件保存在Proj目录;
2。程序可以在VGA显示器上以800x600分辨率显示方波示例和字母示例
3。具体设计参考代码。
`timescale 1ns/1ns
module UART_tb;
wire tbre;
wire tsre;
wire sdo ;
wire rxd;
reg [7:0] din;
reg rst ;
reg clk16x ;
reg wrn;
reg rdn;
wire [7:0] dout;
wire data_ready;
wire framing_error ;
wire parity_error ;
uart PC (.dout(dout),
.data_ready(data_ready),
.framing_error(framing_error),
.parity_error(parity_error),
.rxd(rxd),
.clk16x(clk16x),
.rst(rst),
.rdn(rdn),
.din(din),
.tbre(tbre),
.tsre(tsre),
.wrn(wrn),
.sdo(sdo)
) ;
uart_if FPGA (.clk(clk16x),
.rst_n(~rst),
.txd(rxd),
.rxd(sdo)
);
// Enter fixture code here
initial begin
din = 0;
rst = 0;
clk16x = 0;
wrn = 1;
rdn = 1;
end
always #10 clk16x = ~clk16x ;
initial begin
#3 rst = 1'b1 ;
din ="R";// 8'b11110000 ;
#5000 rst = 1'b0 ;
#30 wrn = 1'b0 ;
#150 wrn = 1'b1 ;
//#4000 din ="r"; // 8'b10101010 ;
//#870 wrn = 1'b0 ;
//#200 wrn = 1'b1 ;
#104000 din ="r"; // 8'b10101010 ;
#870 wrn = 1'b0 ;
#200 wrn = 1'b1 ;
#104000 $stop;
end
always @(posedge data_ready)
begin
#100 rdn=0;
#500 rdn=1;
end
endmodule // Uart_tb