以一个计数程序为例,记 fluorescentG1,fluorescentG2,fluorescentG3在70ms的计数值 , 这三个数的计数值。
modelsim 仿真过程
testbench如下:
`timescale 1ns/1ps
module FluorescentAC_Test;
reg clk_16M;
reg rst_n;
reg go;
reg fluorescentG1;
reg fluorescentG2;
reg fluorescentG3;
wire[15:0] G1CNT;
wire[15:0] G2CNT;
wire[15:0] G3CNT;
FluorescentAC FluorescentAC_vt
(
.clk_16M(clk_16M),
.rst_n(rst_n),
.go(go),
.fluorescentG1(fluorescentG1),
.fluorescentG2(fluorescentG2),
.fluorescentG3(fluorescentG3),
.G1CNT(G1CNT),
.G2CNT(G2CNT),
.G3CNT(G3CNT)
);

initial
begin
rst_n=1;
clk_16M=0;
fluorescentG1=0;
fluorescentG2=0;
fluorescentG3=0;
#600 rst_n=0;
#600 rst_n=1;
end
always begin #100 clk_16M = ~clk_16M; end
always begin #850 fluorescentG1=~fluorescentG1;end
always begin #1050 fluorescentG2=~fluorescentG2;end
always begin #2050 fluorescentG3=~fluorescentG3;end

endmodule

打开modelsim,file–new project。添加两个文件.v和.vt。
之后编译compile all。点击work下面的test文件,ok
modelsim 仿真过程

之后点击最左侧add–add to wave–all items in region
modelsim 仿真过程

进入如下界面,点击run能看到波形
modelsim 仿真过程

相关文章:

  • 2021-08-05
  • 2021-08-05
  • 2021-09-05
  • 2021-08-30
  • 2021-09-29
  • 2022-01-18
  • 2021-08-05
  • 2021-07-30
猜你喜欢
  • 2021-08-05
  • 2021-08-05
  • 2021-08-05
  • 2021-08-05
  • 2021-07-16
  • 2021-08-26
  • 2021-12-08
相关资源
相似解决方案