modelsim测试文件,哪位高人能帮我加个注释!

[复制链接]
4461|5
 楼主| satellite025 发表于 2010-4-8 16:25 | 显示全部楼层 |阅读模式
module test_counter;
reg clk, rst;
wire  gpsout;
counter #(5,10) dut (count,clk,rst);
initial // Clock generator
  begin
    clk = 0;
    #10 forever #10 clk = !clk;
  end
  
initial // Test stimulus
  begin
    rst = 0;
    #5 rst = 1;
    #4 rst = 0;
    #50000 $stop;
  end
  
initial
    $monitor($stime,, rst,, clk,,, count);
   
endmodule
 楼主| satellite025 发表于 2010-4-8 16:27 | 显示全部楼层
特别是:counter #(5,10) dut (count,clk,rst);
initial
    $monitor($stime,, rst,, clk,,, count);
不太懂。
wujing198 发表于 2010-4-8 17:32 | 显示全部楼层
这个是系统任务。
liuchao114 发表于 2010-4-21 09:12 | 显示全部楼层
counter #(5,10) dut (count,clk,rst)里#后面是参数定义,看一下模块的说明文档或源码就知道是对里面的那个参数赋值了,$monitor是系统任务,监视和输出参数列表的内容,建议找本讲verilog的书具体看看
yadog 发表于 2010-4-22 19:48 | 显示全部楼层
看verilog2001相关语法就ok了
xiangfuping 发表于 2012-12-10 21:47 | 显示全部楼层
$monitor 是系统任务的一个监控指令,在多模块调试情况下,须配合$monitor on和$monitor off持续监视;
$time是利用时间系统函数可以得到当前的仿真时刻,$monitor($stime,, rst,, clk,,, count)就是监视在上述得到当前的仿真时刻rst,, clk,,, count变量的值!
您需要登录后才可以回帖 登录 | 注册

本版积分规则

0

主题

28

帖子

0

粉丝
快速回复 在线客服 返回列表 返回顶部