Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

$display every time $monitor works in Verilog

Tags:

verilog

In a Verilog testbench I have a $monitor statement that looks something like this:

initial begin  
$monitor("a=%h, b=%h",a,b)  
end

This means that both a and b are in the monitor's sensitivity list. What I actually want to do is just monitor changes to a, and when a changes display b's value. I can't figure out how to do this. Is there an easy way?

like image 722
user1844175 Avatar asked Nov 22 '12 06:11

user1844175


1 Answers

I do not think that behaviour is possible with monitor, but you could always just display when a changes:

always @(a) begin  
  $display("a=%h, b=%h",a,b);
end
like image 128
Morgan Avatar answered Oct 17 '22 17:10

Morgan