我是靠谱客的博主 激昂跳跳糖,最近开发中收集的这篇文章主要介绍FPGA常用脚本16bit vga output VGA,觉得挺不错的,现在分享给大家,希望可以做个参考。

概述

tcl脚本pin文件 .tcl
注意项目中的引脚名字与.tcl文件名字要一致
在这里插入图片描述

*set_global_assignment -name FAMILY “Cyclone IV E”
set_global_assignment -name RESERVE_ALL_UNUSED_PINS_WEAK_PULLUP “AS INPUT TRI-STATED”
set_global_assignment -name STRATIX_DEVICE_IO_STANDARD “3.3-V LVTTL”
set_global_assignment -name CYCLONEII_RESERVE_NCEO_AFTER_CONFIGURATION “USE AS REGULAR IO”
set_global_assignment -name RESERVE_DATA0_AFTER_CONFIGURATION “USE AS REGULAR IO”
set_global_assignment -name RESERVE_DATA1_AFTER_CONFIGURATION “USE AS REGULAR IO”
set_global_assignment -name RESERVE_FLASH_NCE_AFTER_CONFIGURATION “USE AS REGULAR IO”
set_global_assignment -name RESERVE_DCLK_AFTER_CONFIGURATION “USE AS REGULAR IO”
#引脚参数导入脚本
#时钟、复位
set_location_assignment PIN_E1 -to clk
set_location_assignment PIN_E15 -to rst_n
#UART
#set_location_assignment PIN_M2 -to uart_rx
#set_location_assignment PIN_G1 -to uart_tx
#LED
#set_location_assignment PIN_D16 -to led[3]
#set_location_assignment PIN_F15 -to led[2]
#set_location_assignment PIN_F16 -to led[1]
#set_location_assignment PIN_G15 -to led[0]
#独立按键
#set_location_assignment PIN_M15 -to key_in[2]
#set_location_assignment PIN_M16 -to key_in[1]
#set_location_assignment PIN_E16 -to key_in[0]
#数码管选段
set_location_assignment PIN_B7 -to dig_o[0]
set_location_assignment PIN_A8 -to dig_o[1]
set_location_assignment PIN_A6 -to dig_o[2]
set_location_assignment PIN_B5 -to dig_o[3]
set_location_assignment PIN_B6 -to dig_o[4]
set_location_assignment PIN_A7 -to dig_o[5]
set_location_assignment PIN_B8 -to dig_o[6]
set_location_assignment PIN_A5 -to dig_o[7]
#数码管片选
set_location_assignment PIN_A4 -to sel_o[0]
set_location_assignment PIN_B4 -to sel_o[1]
set_location_assignment PIN_A3 -to sel_o[2]
set_location_assignment PIN_B3 -to sel_o[3]
set_location_assignment PIN_A2 -to sel_o[4]
set_location_assignment PIN_B1 -to sel_o[5]
#蜂鸣器
#set_location_assignment PIN_J1 -to beep
#SDRAM
#地址
#set_location_assignment PIN_T8 -to addr[0]
#set_location_assignment PIN_P9 -to addr[1]
#set_location_assignment PIN_T9 -to addr[2]
#set_location_assignment PIN_R9 -to addr[3]
#set_location_assignment PIN_L16 -to addr[4]
#set_location_assignment PIN_L15 -to addr[5]
#set_location_assignment PIN_N16 -to addr[6]
#set_location_assignment PIN_N15 -to addr[7]
#set_location_assignment PIN_P16 -to addr[8]
#set_location_assignment PIN_P15 -to addr[9]
#set_location_assignment PIN_R8 -to addr[10]
#set_location_assignment PIN_R16 -to addr[11]
#set_location_assignment PIN_T15 -to addr[12]

#数据

#set_location_assignment PIN_R5 -to dq[0]
#set_location_assignment PIN_T4 -to dq[1]
#set_location_assignment PIN_T3 -to dq[2]
#set_location_assignment PIN_R3 -to dq[3]
#set_location_assignment PIN_T2 -to dq[4]
#set_location_assignment PIN_R1 -to dq[5]
#set_location_assignment PIN_P2 -to dq[6]
#set_location_assignment PIN_P1 -to dq[7]
#set_location_assignment PIN_R13 -to dq[8]
#set_location_assignment PIN_T13 -to dq[9]
#set_location_assignment PIN_R12 -to dq[10]
#set_location_assignment PIN_T12 -to dq[11]
#set_location_assignment PIN_T10 -to dq[12]
#set_location_assignment PIN_R10 -to dq[13]
#set_location_assignment PIN_T11 -to dq[14]
#set_location_assignment PIN_R11 -to dq[15]
#bank
#set_location_assignment PIN_R7 -to bank[0]
#set_location_assignment PIN_T7 -to bank[1]
#dqm
#set_location_assignment PIN_N2 -to dqm[0]
#set_location_assignment PIN_T14 -to dqm[1]

#时钟

#set_location_assignment PIN_R4 -to sdram_clk
#控制信号
#set_location_assignment PIN_R14 -to cke
#set_location_assignment PIN_T6 -to cs_n
#set_location_assignment PIN_R6 -to ras_n
#set_location_assignment PIN_T5 -to cas_n
#set_location_assignment PIN_N1 -to we_n
#flash
#set_location_assignment PIN_H2 -to miso
#set_location_assignment PIN_C1 -to mosi
#set_location_assignment PIN_H1 -to sclk
#set_location_assignment PIN_D2 -to cs_n
#EEPROM
#set_location_assignment PIN_L2 -to sda
#set_location_assignment PIN_L1 -to sclk

16bit vga output VGA

#set_location_assignment PIN_F6 -to vga_out_b[4]
#set_location_assignment PIN_E5 -to vga_out_b[3]
#set_location_assignment PIN_D3 -to vga_out_b[2]
#set_location_assignment PIN_D4 -to vga_out_b[1]
#set_location_assignment PIN_C3 -to vga_out_b[0]
#set_location_assignment PIN_J6 -to vga_out_g[5]
#set_location_assignment PIN_L8 -to vga_out_g[4]
#set_location_assignment PIN_K8 -to vga_out_g[3]
#set_location_assignment PIN_F7 -to vga_out_g[2]
#set_location_assignment PIN_G5 -to vga_out_g[1]
#set_location_assignment PIN_F5 -to vga_out_g[0]
#set_location_assignment PIN_L6 -to vga_out_hs
#set_location_assignment PIN_L4 -to vga_out_r[4]
#set_location_assignment PIN_L3 -to vga_out_r[3]
#set_location_assignment PIN_L7 -to vga_out_r[2]
#set_location_assignment PIN_K5 -to vga_out_r[1]
#set_location_assignment PIN_K6 -to vga_out_r[0]
#set_location_assignment PIN_N3 -to vga_out_vs
#cmos an5640 module 摄像头
#set_location_assignment PIN_C3 -to cmos_db[7]
#set_location_assignment PIN_E5 -to cmos_db[6]
#set_location_assignment PIN_F2 -to cmos_db[5]
#set_location_assignment PIN_F3 -to cmos_db[4]
#set_location_assignment PIN_M1 -to cmos_db[3]
#set_location_assignment PIN_D4 -to cmos_db[2]
#set_location_assignment PIN_G5 -to cmos_db[1]
#set_location_assignment PIN_F5 -to cmos_db[0]
#set_location_assignment PIN_D1 -to cmos_href
#set_location_assignment PIN_D5 -to cmos_pclk
#set_location_assignment PIN_C6 -to cmos_scl
#set_location_assignment PIN_D6 -to cmos_sda
#set_location_assignment PIN_F6 -to cmos_vsync
#set_location_assignment PIN_D3 -to cmos_xclk
#set_location_assignment PIN_F1 -to cmos_rst_n
#set_location_assignment PIN_G2 -to cmos_pwdn
#lcd an430 J2
#set_location_assignment PIN_J11 -to lcd_b[7]
#set_location_assignment PIN_G16 -to lcd_b[6]
#set_location_assignment PIN_K10 -to lcd_b[5]
#set_location_assignment PIN_K9 -to lcd_b[4]
#set_location_assignment PIN_G11 -to lcd_b[3]
#set_location_assignment PIN_F14 -to lcd_b[2]
#set_location_assignment PIN_F13 -to lcd_b[1]
#set_location_assignment PIN_F11 -to lcd_b[0]
#set_location_assignment PIN_J12 -to lcd_dclk
#set_location_assignment PIN_K11 -to lcd_de
#set_location_assignment PIN_D14 -to lcd_g[7]
#set_location_assignment PIN_F10 -to lcd_g[6]
#set_location_assignment PIN_C14 -to lcd_g[5]
#set_location_assignment PIN_E11 -to lcd_g[4]
#set_location_assignment PIN_D12 -to lcd_g[3]
#set_location_assignment PIN_D11 -to lcd_g[2]
#set_location_assignment PIN_C11 -to lcd_g[1]
#set_location_assignment PIN_E10 -to lcd_g[0]
#set_location_assignment PIN_J13 -to lcd_hs
#set_location_assignment PIN_D9 -to lcd_r[7]
#set_location_assignment PIN_C9 -to lcd_r[6]
#set_location_assignment PIN_E9 -to lcd_r[5]
#set_location_assignment PIN_F9 -to lcd_r[4]
#set_location_assignment PIN_F7 -to lcd_r[3]
#set_location_assignment PIN_E8 -to lcd_r[2]
#set_location_assignment PIN_D8 -to lcd_r[1]
#set_location_assignment PIN_E7 -to lcd_r[0]
#set_location_assignment PIN_J14 -to lcd_vs*

modlsim脚本仿真
.do文件执行 格式 在执行框中输入 do name.do 回车
注意仿真模块要放在do文件的平行目录下,不然找不到被测试文件
注意修改do文件中的文件名字
在这里插入图片描述

#tcl脚本 自动化仿真
#创建工作库 名为work
vlib work

#映射工作库 work 到 work
vmap work work

#编译testbench文件
vlog clock_tb.v

#若要仿真IP核必须添加该文件
#vlog altera_mf.v

#编译被仿真文件
vlog …/rtl/clock.v
#vlog …/rtl/key_filter.v
#vlog …/rtl/led.v

#对IP核进行仿真
#vlog …/par/ipcore/pll.v

#指定仿真顶层
vsim -novopt work.clock_tb

#添加testbench顶层模块中的信号到波形窗
add wave -position insertpoint sim:clock_tb//*

#表示让该tb_clk信号显示黄色
#add wave -noupdate -color Yellow /follow_led_tb/tb_clk

#表示让div_coef信号用十进制tb_led来显示
#add wave -noupdate -radix decimal /follow_led_tb/tb_led

#运行2000个时间单位
run 200

#一直仿真下去
#run -all

C4开发板 数码管
localparam ZER = 7’b100_0000,
ONE = 7’b111_1001,
TWO = 7’b010_0100,
THR = 7’b011_0000,
FOU = 7’b001_1001,
FIV = 7’b001_0010,
SIX = 7’b000_0010,
SEV = 7’b111_1000,
EIG = 7’b000_0000,
NIN = 7’b001_0000;

最后

以上就是激昂跳跳糖为你收集整理的FPGA常用脚本16bit vga output VGA的全部内容,希望文章能够帮你解决FPGA常用脚本16bit vga output VGA所遇到的程序开发问题。

如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(45)

评论列表共有 0 条评论

立即
投稿
返回
顶部