producing simulation results

本文探讨了在Verilog中优化采样过程的方法,包括使用主动$monitor任务进行条件触发采样、减少不必要的采样操作以及利用always块实现高效采样策略。详细介绍了如何通过控制采样时机来最小化资源消耗并提高测试覆盖率。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

1. several ways to sample output signal

always @(negedge clk)
begin
   $strobe(...)
end

parameter INTERVAL = 10;
always
begin
   #(INTERVAL);
   $strobe(...);
end

always @(q, qb)
begin
   $strobe("...", rst, d0, d1, sel, q, qb);
end

initial
begin
   $monitor("...", rst, d0, d1, sel, q, qb);
end


 

2. Minimizing Sampling

An active  $monitor task can be turned on and off by using the $monitoron and $monitoroff tasks, respectively. If you are using an explicit sampling always block, you should include sampling minimization techniques in your model, as illustrated in Sample 5-34. A very efficient way of minimizing sampling is to have the stimulus
turn on the sampling when an interesting section of the testcase is entered, as shown in Sample 5-35.

always
begin
wait (<interesting_condition>);
while (<interesting_condition>) begin
      @ (q, qb;)
      $strobe(“...”, rst, d0, d1, sel, q, qb);
   end
end

initial
begin
   $monitor("...", rst, d0, d1, sel, q, qb);
$monitoroff;
   sync_reset;
   load_d0(1);
   sync_reset;
$monitoron;
   load_d1(1);
   load_d0(0);
   load_d1(1);
   sync_reset;
$monitoroff;
   ...
end

 


 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值