zoukankan      html  css  js  c++  java
  • modelsim仿真常用系统函数

    (1)$time

       作用:返回所在模块的仿真时间,可以查看信号的出现的时间,用来把握信号的时序。

       如:$display(''the time is %t'',$time) ;//显示当时的时间

     (2)$display

    作用: 将需要显示的内容在命令栏显示出来

    如: $display("the signal is % d",ad); //将ad信号以十进制的方式显示出来

     (3)$monitor

    作用:监视变量的变化,一旦变量变化,则将变量显示出来

    如:$monitor ("at time is %t and the signal is %b ",$time , signal) ;

      (3) 文件操作类

         $fopen

    作用:打开一个文件面,对文件的操作

     $fdisplay

    作用:在打开的文件里,写入显示的内容

     $fmonitor

    作用:在打开的文件里,写入监视的变量变化时的内容

     $fclose

    作用:关闭当前的内容

    如:initial

          Begin :block  //可以在内部声明局部变量

          Integer  out_file;

          out_file = $fopen("data.out","w") ; //打开data.out这个文件后,从第一行开始写,如果该文件没有,则首先创建该文件,然后再写。打开文件后返回out_file这个文件整形指针

          $fdisplay(out_file,"at the time is %t ",$time);

          .....

          $fmonitor(out_file,"at the time is %t and the signal is %b  ",$time ,signal);

           ......

          $fclose(out_file);

          End

  • 相关阅读:
    学好VC++的十大良好习惯
    VC6.0调试技巧
    匈牙利命名法
    VC中常用文件操作(三)
    VL_FEAT——图像处理函数库
    MATLAB——linspace
    (Your)((Term)((Project)))(字符串处理)
    Matrix Chain Multiplication(栈的简单应用)
    The Triangle(DP基础)
    MATLAB——polyfit
  • 原文地址:https://www.cnblogs.com/lianjiehere/p/3784513.html
Copyright © 2011-2022 走看看