当前位置:   article > 正文

FPGA自学4—— Modelsim仿真软件使用_fpga仿真软件有哪些

fpga仿真软件有哪些

        Modelsim是一款仿真软件,可对VHDL 和Verilog HDL两种语言进行混合仿真。

        前仿真:功能仿真,考虑门电路延时与线延时,主要是验证电路与理想情况是否一致。

         后仿真: 时序仿真(布线后仿真),电路在实际应用中的工作仿真,考虑门电路延时与线延时,能反映芯片的实际工作情况。

 1、关联Quartus II 和Modelsim  软件

打开Quartus II 软件

关联modlesim软件

配置工程仿真软件

 

    现在Quartus II 和Modelsim 软件已经关联在一起了。

2、生成vt文件(Verilog test bench)

3、编写vt文件

生成后的vt文件:

修改后

  1. // Copyright (C) 1991-2013 Altera Corporation
  2. // Your use of Altera Corporation's design tools, logic functions
  3. // and other software and tools, and its AMPP partner logic
  4. // functions, and any output files from any of the foregoing
  5. // (including device programming or simulation files), and any
  6. // associated documentation or information are expressly subject
  7. // to the terms and conditions of the Altera Program License
  8. // Subscription Agreement, Altera MegaCore Function License
  9. // Agreement, or other applicable license agreement, including,
  10. // without limitation, that your use is for the sole purpose of
  11. // programming logic devices manufactured by Altera and sold by
  12. // Altera or its authorized distributors. Please refer to the
  13. // applicable agreement for further details.
  14. // *****************************************************************************
  15. // This file contains a Verilog test bench template that is freely editable to
  16. // suit user's needs .Comments are provided in each section to help the user
  17. // fill out necessary details.
  18. // *****************************************************************************
  19. // Generated on "02/10/2022 09:24:50"
  20. // Verilog Test Bench template for design : emg_fpga_top
  21. //
  22. // Simulation tool : ModelSim (Verilog)
  23. //
  24. `timescale 1 ns/ 1 ns
  25. module emg_fpga_top_vlg_tst();
  26. // constants
  27. // general purpose registers
  28. //reg eachvec; 没用的信号
  29. // test vector input registers
  30. reg Ads_irq_8;
  31. reg SPI_miso;
  32. reg Start_data_flag;
  33. reg sys_clk;
  34. reg sys_rst_n;
  35. // wires
  36. wire SPI_cs_n;
  37. wire SPI_mosi;
  38. wire SPI_sck;
  39. wire led_b;
  40. wire led_g;
  41. wire led_r;
  42. wire uart_txd;
  43. // assign statements (if any)
  44. emg_fpga_top i1 (
  45. // port map - connection between master ports and signals/registers
  46. .Ads_irq_8(Ads_irq_8),
  47. .SPI_cs_n(SPI_cs_n),
  48. .SPI_miso(SPI_miso),
  49. .SPI_mosi(SPI_mosi),
  50. .SPI_sck(SPI_sck),
  51. .Start_data_flag(Start_data_flag),
  52. .led_b(led_b),
  53. .led_g(led_g),
  54. .led_r(led_r),
  55. .sys_clk(sys_clk),
  56. .sys_rst_n(sys_rst_n),
  57. .uart_txd(uart_txd)
  58. );
  59. initial begin //付初值
  60. sys_clk=1'b0; //系统时钟付初值
  61. sys_rst_n=1'b0; //复位信号付初值
  62. #100 sys_rst_n=1'b1;//延时100ns,把复位信号拉高
  63. #1000 $stop; //程序仿真时运行1000ns,停止仿真
  64. end
  65. //产生时钟翻转信号
  66. always #10 sys_clk=~sys_clk;//系统时钟是50mhz,周期是20ns,那么就是没10ns,时钟翻转一次
  67. endmodule

 4、配置仿真功能

 

  

     接下来就可以仿真了

5、开始仿真

 这里我选择功能仿真,modelsim软件会自动打开进入这个界面

 

 

这里我选择时序仿真,modelsim软件会自动打开进入这个界面

 

本文内容由网友自发贡献,转载请注明出处:【wpsshop博客】
推荐阅读
相关标签
  

闽ICP备14008679号