$ display every time $ monitor runs in Verilog

In the Verilog test jar, 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 sensitivity list. What I really want to do is just keep track of the changes in a , and when a changes the display of b . I can’t figure out how to do this. Is there an easy way?

+4
source share
1 answer

I do not think that this behavior is possible with a monitor, but you can always just display when a changes:

 always @(a) begin $display("a=%h, b=%h",a,b); end 
+9
source

Source: https://habr.com/ru/post/1447664/


All Articles