2019-03-03 02:42:38 +08:00
|
|
|
|
module DE0Nano_USTCRVSoC_top(
|
2019-09-01 21:51:23 +08:00
|
|
|
|
//////////// CLOCK //////////
|
2022-04-07 17:12:33 +08:00
|
|
|
|
input CLOCK_50,
|
2019-02-26 19:36:30 +08:00
|
|
|
|
//////////// LED, KEY, Switch //////////
|
2019-09-01 21:51:23 +08:00
|
|
|
|
output [ 7:0] LED,
|
|
|
|
|
//////////// GPIO Header 1 //////////
|
2022-04-07 17:12:33 +08:00
|
|
|
|
output [33:0] GPIO_0,
|
|
|
|
|
input [ 0:0] GPIO_1_IN,
|
|
|
|
|
output [ 0:0] GPIO_1
|
2019-02-26 19:36:30 +08:00
|
|
|
|
);
|
|
|
|
|
|
2019-03-03 02:42:38 +08:00
|
|
|
|
logic vga_red, vga_green, vga_blue;
|
|
|
|
|
assign GPIO_0[31:16] = {{5{vga_blue}},{6{vga_green}},{5{vga_red}}};
|
2019-02-26 19:36:30 +08:00
|
|
|
|
|
2022-04-07 17:12:33 +08:00
|
|
|
|
soc_top #(
|
|
|
|
|
.UART_RX_CLK_DIV ( 108 ), // 50MHz/4/115200 = 108
|
|
|
|
|
.UART_TX_CLK_DIV ( 434 ), // 50MHz/1/115200 = 434
|
|
|
|
|
.VGA_CLK_DIV ( 1 )
|
|
|
|
|
) soc_i (
|
2019-02-26 19:36:30 +08:00
|
|
|
|
.clk ( CLOCK_50 ),
|
|
|
|
|
.isp_uart_rx ( GPIO_1_IN[0] ),
|
|
|
|
|
.isp_uart_tx ( GPIO_1[0] ),
|
|
|
|
|
.vga_hsync ( GPIO_0[33] ),
|
|
|
|
|
.vga_vsync ( GPIO_0[32] ),
|
2019-03-03 02:42:38 +08:00
|
|
|
|
.vga_red ( vga_red ),
|
|
|
|
|
.vga_green ( vga_green ),
|
|
|
|
|
.vga_blue ( vga_blue )
|
2019-02-26 19:36:30 +08:00
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
// 在开发板的LED上显示ISP-UART和USER-UART的发送灯和接收灯
|
2022-04-07 17:12:33 +08:00
|
|
|
|
assign LED[7:6] = ~{GPIO_1_IN[0], GPIO_1[0]};
|
2019-02-26 19:36:30 +08:00
|
|
|
|
|
|
|
|
|
// VGA GND
|
2022-04-07 17:12:33 +08:00
|
|
|
|
assign GPIO_0[15:0] = 16'b0;
|
2019-02-26 19:36:30 +08:00
|
|
|
|
|
|
|
|
|
// 流水灯,指示SoC在运行
|
|
|
|
|
reg [21:0] cnt = 22'h0;
|
|
|
|
|
reg [ 5:0] flow = 6'h0;
|
2019-03-03 02:42:38 +08:00
|
|
|
|
always @ (posedge CLOCK_50) begin
|
|
|
|
|
cnt <= cnt + 22'h1;
|
|
|
|
|
if(cnt==22'h0)
|
|
|
|
|
flow <= {flow[4:0], ~flow[5]};
|
|
|
|
|
end
|
2019-02-26 19:36:30 +08:00
|
|
|
|
|
|
|
|
|
assign LED[5:0] = flow;
|
|
|
|
|
|
|
|
|
|
endmodule
|