一、功能仿真
        废话不说,直接上脚本,用者对应修改:
        1)test_gaowin_sdr.do

        # Create the work library
vlib work
vmap work work

# Compile the verilog files
vlog -work work ../src/gaowin_sdr.v
vlog -work work ../src/gowin_rpll/gowin_rpll.v
vlog -work work ../src/fifo_hs/fifo_adc.vo
vlog -work work test_gaowin_sdr.v

# Run simulation
vsim -voptargs=+acc -t 1ps work.test_gaowin_sdr -L E:/modeltech64_10.7/gaowin/gw1n/prim_sim -L E:/modeltech64_10.7/gaowin/hardware_core/gw1n/hardcore_sim

#view wave
#add wave *
do wave.do
run 10ms

        2)wave.do
        onerror {resume}
quietly WaveActivateNextPane {} 0
quietly virtual signal -install /test_gaowin_sdr { /test_gaowin_sdr/ft600_data[11:0]} adcdata
add wave -noupdate -label clk_i  /test_gaowin_sdr/clk_i
add wave -noupdate -label FT_MCU_CLK /test_gaowin_sdr/MCU_CLK
add wave -noupdate -label ADCLK /test_gaowin_sdr/u_gaowin_sdr/ADCLK
add wave -noupdate -label plllock /test_gaowin_sdr/u_gaowin_sdr/u_PLL/lock

add wave -noupdate -divider clk

add wave -noupdate /test_gaowin_sdr/ADIN
add wave -noupdate /test_gaowin_sdr/ft600_txe_n
add wave -noupdate /test_gaowin_sdr/ft600_rxf_n
add wave -noupdate /test_gaowin_sdr/ft600_data
add wave -noupdate -label FIFO_almostfull  /test_gaowin_sdr/u_gaowin_sdr/u_fifo_adc/Almost_Full
add wave -noupdate -label FIFO_empty /test_gaowin_sdr/u_gaowin_sdr/u_fifo_adc/Empty

add wave -noupdate -divider spi
add wave -noupdate -label oob /test_gaowin_sdr/oob
add wave -noupdate -label ft600_gpio  /test_gaowin_sdr/u_gaowin_sdr/ft600_gpio
add wave -noupdate -label ft600_gpio_p2  /test_gaowin_sdr/u_gaowin_sdr/ft600_gpio_p2
add wave -noupdate -label ft600_gpio_p1  /test_gaowin_sdr/u_gaowin_sdr/ft600_gpio_p1

add wave -noupdate -label dout_up  /test_gaowin_sdr/u_gaowin_sdr/dout_up
add wave -noupdate -label dout_down  /test_gaowin_sdr/u_gaowin_sdr/dout_down
add wave -noupdate -label clk_up  /test_gaowin_sdr/u_gaowin_sdr/clk_up
add wave -noupdate -label clk_down  /test_gaowin_sdr/u_gaowin_sdr/clk_down

add wave -noupdate -label SPI1_CSn  /test_gaowin_sdr/u_gaowin_sdr/SPI1_CSn
add wave -noupdate -label SPI1_MOSI /test_gaowin_sdr/u_gaowin_sdr/SPI1_MOSI
add wave -noupdate -label SPI1_CLK /test_gaowin_sdr/u_gaowin_sdr/SPI1_CLK
add wave -noupdate -label rec_Spi_temp  /test_gaowin_sdr/rec_Spi_temp
add wave -noupdate -label rec_Spi  /test_gaowin_sdr/rec_Spi

TreeUpdate [SetDefaultTree]
WaveRestoreCursors {{Cursor 1} {15749947596 ps} 0} {{Cursor 2} {26319300200 ps} 0}
quietly wave cursor active 1
configure wave -namecolwidth 311
configure wave -valuecolwidth 100
configure wave -justifyvalue left
configure wave -signalnamewidth 0
configure wave -snapdistance 10
configure wave -datasetprefix 0
configure wave -rowmargin 4
configure wave -childrowmargin 2
configure wave -gridoffset 0
configure wave -gridperiod 1
configure wave -griddelta 40
configure wave -timeline 0
configure wave -timelineunits ns
update
WaveRestoreZoom {15749879837 ps} {15750120163 ps}

        二、时序仿真
        1)test_gaowin_sdr_time.do
        # Create the work library
vlib work
vmap work work

# Compile the verilog files
vlog -work work gaowin_sdr.vo
vlog -work work ../src/gowin_rpll/gowin_rpll.v
vlog -work work ../src/fifo_hs/fifo_adc.vo
vlog -work work test_gaowin_sdr.v

# Run simulation

vsim -voptargs=+acc -sdftyp /u_gaowin_sdr=gaowin_sdr.sdf -sdfnoerror -sdfnowarn  work.test_gaowin_sdr -L E:/modeltech64_10.7/gaowin/gw1n/prim_sim -L E:/modeltech64_10.7/gaowin/hardware_core/gw1n/hardcore_sim

#view wave
#add wave *
do wave_time.do
run 10ms

        2)wave_time.do
        onerror {resume}
quietly WaveActivateNextPane {} 0
quietly virtual signal -install /test_gaowin_sdr { /test_gaowin_sdr/ft600_data[11:0]} adcdata
add wave -noupdate -label clk_i  /test_gaowin_sdr/clk_i
add wave -noupdate -label FT_MCU_CLK /test_gaowin_sdr/MCU_CLK
add wave -noupdate -label ADCLK /test_gaowin_sdr/u_gaowin_sdr/ADCLK
add wave -noupdate -label plllock {/test_gaowin_sdr/u_gaowin_sdr/\u_PLL/rpll_inst /LOCK}

add wave -noupdate -divider clk

add wave -noupdate /test_gaowin_sdr/ADIN
add wave -noupdate /test_gaowin_sdr/u_gaowin_sdr/ft600_txe_n_ibuf/O
add wave -noupdate /test_gaowin_sdr/u_gaowin_sdr/ft600_rxf_n_ibuf/O
add wave -noupdate /test_gaowin_sdr/ft600_data

add wave -noupdate -divider spi
add wave -noupdate -label oob /test_gaowin_sdr/oob
add wave -noupdate -label ft600_gpio  /test_gaowin_sdr/u_gaowin_sdr/ft600_gpio
add wave -noupdate -label ft600_gpio_p2  /test_gaowin_sdr/u_gaowin_sdr/ft600_gpio_p2
add wave -noupdate -label ft600_gpio_p1  /test_gaowin_sdr/u_gaowin_sdr/ft600_gpio_p1

add wave -noupdate -label SPI1_CSn  /test_gaowin_sdr/u_gaowin_sdr/SPI1_CSn
add wave -noupdate -label SPI1_MOSI /test_gaowin_sdr/u_gaowin_sdr/SPI1_MOSI
add wave -noupdate -label SPI1_CLK /test_gaowin_sdr/u_gaowin_sdr/SPI1_CLK
add wave -noupdate -label rec_Spi_temp  /test_gaowin_sdr/rec_Spi_temp
add wave -noupdate -label rec_Spi  /test_gaowin_sdr/rec_Spi

TreeUpdate [SetDefaultTree]
WaveRestoreCursors {{Cursor 1} {15749947596 ps} 0} {{Cursor 2} {26319300200 ps} 0}
quietly wave cursor active 1
configure wave -namecolwidth 311
configure wave -valuecolwidth 100
configure wave -justifyvalue left
configure wave -signalnamewidth 0
configure wave -snapdistance 10
configure wave -datasetprefix 0
configure wave -rowmargin 4
configure wave -childrowmargin 2
configure wave -gridoffset 0
configure wave -gridperiod 1
configure wave -griddelta 40
configure wave -timeline 0
configure wave -timelineunits ns
update
WaveRestoreZoom {15749879837 ps} {15750120163 ps}


本文由编辑推荐,原出处:https://www.eet-china.com/mp/a165496.html