用户工具

站点工具


edastudy:vcs:vcs使用

差别

这里会显示出您选择的修订版和当前版本之间的差别。

到此差别页面的链接

两侧同时换到之前的修订记录前一修订版
后一修订版
前一修订版
edastudy:vcs:vcs使用 [2024/07/24 15:25] – [6. kdb] user01edastudy:vcs:vcs使用 [2025/01/23 09:13] (当前版本) – [1. ucli] user01
行 19: 行 19:
     force a 1     force a 1
     run 10ns     run 10ns
-    force 0+    force top.b 0
     run 10ns     run 10ns
 +    force b\[0\] 1; # force b[0]为1, 需要加\
 } }
 </code> </code>
行 26: 行 27:
  
 force 命令注意,只能force信号为具体的值,不能force一个信号到另外一个信号\\ force 命令注意,只能force信号为具体的值,不能force一个信号到另外一个信号\\
-force到的具体值需要给完整的宽度,比如8'd28,  不能直接给28,可能会有宽度不匹配的问题,导致force失败。+force到的具体值需要给完整的宽度,比如8'd28,  不能直接给28,可能会有宽度不匹配的问题,导致force失败。\\ 
 +force 信号最好给完整的信号hier名,尤其是有的仿真设置了多个-top
  
  
行 97: 行 99:
  
 ===== - rand seed ===== ===== - rand seed =====
 +
 +<code verilog>
 +
 +reg     [31:0]  seed;
 +reg     [31:0]  ret;
 +initial begin
 +    if ($value$plusargs("seed=%d",seed)) begin
 +        $display("seed = %0d", seed);
 +        ret = $urandom(seed);
 +
 +        repeat(2) begin
 +            ret = $urandom();
 +            $display("ret = %0x", ret);
 +        end
 +        $finish;
 +    end
 +end
 +</code>
 +
 +<code bash>
 +./simv +seed=21
 +seed = 21
 +ret = c7466bae
 +ret = cf3f2455
 +
 +
 +./simv +seed=22
 +seed = 22
 +ret = 4c85682
 +ret = 2c3fd11a
 +
 +
 +</code>
 +
 +
 +<code perl>
 +# perl gen seed
 +srand;
 +$rand_seed = int (rand(100000));
 +</code>
edastudy/vcs/vcs使用.1721805926.txt.gz · 最后更改: 2024/07/24 15:25 由 user01

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki