is $fell(sig_a) true when sig_a from x to 0?

In IEEE1800-2017, the $fell() is defined as

— $fell returns true (1’b1) if the LSB of the expression changed to 0. Otherwise, it returns false
(1’b0).

Does it mean $fell returns true if the LSB of the expression changed from 1/x/z to 0? or only 1→0?

if x/z→0 are true, is !$isunknown($past(sig_a))&& !sig_a legal for 1→0 only?

$fell returns true if the lsb of the expression changes from 1/X/Z to 0

The same can be verified using

logic sig_a;

always@(posedge clk) begin
  if( $fell(sig_a) )
      $display("T:%0t $fell(sig_a) is true",$time);
  else
      $display("$T:%0t fell(sig_a) is false",$time);
end

// Add your stimulus as part of initial block

This would be true even when sig_a is sampled 0 on consecutive clocks

Using sv-property-fell the solution would be

!isunknown( $past(sig_a[0]) ) && $fell(sig_a)
1 Like